All files / src/objects oauth2_profile.ts

75.75% Statements 25/33
50% Branches 3/6
50% Functions 2/4
75.75% Lines 25/33

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331x 1x 1x 1x 1x 1x 4x 4x 1x 1x           1x 1x       1x 1x 1x 1x 1x 1x 1x 2x 2x 1x 1x 1x 1x
import {xmlToArray} from "../xml_utils";
import {AbstractObject} from "./_abstract_object";
 
export class Oauth2Profile extends AbstractObject {
 
  public getType(): string {
    return "OA2P";
  }
 
  public getAllowedNaming() {
    return { // todo, verify
      maxLength: 30,
      allowNamespace: true,
    };
  }
 
  public getDescription(): string | undefined {
    // todo
    return undefined;
  }
 
  public listScopes(): string[] {
    const ret: string[] = [];
 
    const parsed = super.parseRaw2();
 
    for (const t of xmlToArray(parsed.abapGit["asx:abap"]["asx:values"]?.PROFILE?.T_SCOPES?.OA2P_SCOPES)) {
      ret.push(t.SCOPE);
    }
 
    return ret;
  }
}