All files / src/objects oauth2_profile.ts

84.84% Statements 28/33
93.33% Branches 14/15
75% Functions 3/4
84.84% Lines 28/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 33 341x 1x 1x 1x 1x 1x 10x 10x 1x 1x           1x 1x 2x 2x 2x 1x 1x 3x 3x 3x 3x 3x 2x 2x 3x 3x 3x 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;
  }
}