All files / output zcl_abapgit_aff_registry.clas.mjs

97.36% Statements 111/114
90% Branches 18/20
50% Functions 8/16
97.36% Lines 111/114

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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 1141x 1x 10x 10x 10x 10x 10x 10x   10x 10x 10x 10x 1x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 1x 1x 10x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 10x     10x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 10x 96x 96x 96x 96x 96x 96x 96x 1x 1x 96x 96x 96x 96x 96x 96x 96x 10x 96x 1x 86x 85x 85x 96x 96x 10x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_aff_registry.clas.abap
class zcl_abapgit_aff_registry {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_AFF_REGISTRY';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_AFF_REGISTRY"];
  static ATTRIBUTES = {"GT_REGISTRY": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "obj_type": new abap.types.Character(4, {}),
  "experimental": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_aff_registry=>ty_registry_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["OBJ_TYPE"]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": "X"},
  "MV_AFF_ENABLED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_AFF_FEATURE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"INITIALIZE_REGISTRY_TABLE": {"visibility": "I", "parameters": {}},
  "REGISTER": {"visibility": "I", "parameters": {"IV_OBJ_TYPE": {"type": () => {return new abap.types.Character(4, {});}, "is_optional": " ", "parm_kind": "I", "type_name": "CharacterType"}, "IV_EXPERIMENTAL": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "I", "type_name": "CharacterType"}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {}}};
  #gt_registry;
  #mv_aff_enabled;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
    this.gt_registry = zcl_abapgit_aff_registry.gt_registry;
    this.#mv_aff_enabled = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    this.FRIENDS_ACCESS_INSTANCE["mv_aff_enabled"] = this.#mv_aff_enabled;
    this.c_aff_feature = zcl_abapgit_aff_registry.c_aff_feature;
  }
  async constructor_(INPUT) {
    this.#mv_aff_enabled.set((await abap.Classes['ZCL_ABAPGIT_FEATURE'].is_enabled({iv_feature: zcl_abapgit_aff_registry.c_aff_feature})));
    return this;
  }
  async initialize_registry_table() {
    return zcl_abapgit_aff_registry.initialize_registry_table();
  }
  static async initialize_registry_table() {
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'APLO')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'BGQC')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'CDBO')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'CHKC')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'CHKO')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'CHKV')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'COTA')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'DRTY')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'DTEB')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'DSFI')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'DRAS')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'DSFD')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'EVTB')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'EEEC')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'GSMP')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'INTF'), iv_experimental: abap.builtin.abap_true});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'SAJT')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'SAJC')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'SMBC')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'SWCR')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'NONT')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'RONT')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'UIAD')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'UIPG')});
    await this.register({iv_obj_type: abap.CharacterFactory.get(4, 'UIST')});
  }
  async register(INPUT) {
    return zcl_abapgit_aff_registry.register(INPUT);
  }
  static async register(INPUT) {
    let iv_obj_type = INPUT?.iv_obj_type;
    if (iv_obj_type === undefined) { iv_obj_type = new abap.types.Character(4, {}).set(INPUT.iv_obj_type); }
    let iv_experimental = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_experimental) {iv_experimental.set(INPUT.iv_experimental);}
    if (INPUT === undefined || INPUT.iv_experimental === undefined) {iv_experimental = abap.builtin.abap_false;}
    let ls_registry_entry = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "experimental": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_aff_registry=>ty_registry_entry", undefined, {}, {});
    ls_registry_entry.get().obj_type.set(iv_obj_type);
    ls_registry_entry.get().experimental.set(iv_experimental);
    abap.statements.insertInternal({data: ls_registry_entry, table: zcl_abapgit_aff_registry.gt_registry});
  }
  async zif_abapgit_aff_registry$is_supported_object_type(INPUT) {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_obj_type = INPUT?.iv_obj_type;
    if (iv_obj_type === undefined) { iv_obj_type = new abap.types.Character(4, {}).set(INPUT.iv_obj_type); }
    let ls_registry_entry = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "experimental": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_aff_registry=>ty_registry_entry", undefined, {}, {});
    if (abap.compare.initial(zcl_abapgit_aff_registry.gt_registry)) {
      await this.initialize_registry_table();
    }
    abap.statements.readTable(zcl_abapgit_aff_registry.gt_registry,{withTableKey: true,
      into: ls_registry_entry,
      withKey: (i) => {return abap.compare.eq(i.obj_type, iv_obj_type);},
      withKeyValue: [{key: (i) => {return i.obj_type}, value: iv_obj_type}],
      usesTableLine: false,
      withKeySimple: {"obj_type": iv_obj_type}});
    if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) && abap.compare.eq(ls_registry_entry.get().experimental, abap.builtin.abap_false)) {
      rv_result.set(abap.builtin.abap_true);
    } else if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) && abap.compare.eq(this.#mv_aff_enabled, abap.builtin.abap_true)) {
      rv_result.set(abap.builtin.abap_true);
    } else {
      rv_result.set(abap.builtin.abap_false);
    }
    return rv_result;
  }
}
abap.Classes['ZCL_ABAPGIT_AFF_REGISTRY'] = zcl_abapgit_aff_registry;
zcl_abapgit_aff_registry.gt_registry = abap.types.TableFactory.construct(new abap.types.Structure({
"obj_type": new abap.types.Character(4, {}),
"experimental": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_aff_registry=>ty_registry_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["OBJ_TYPE"]},"secondary":[]}, "");
zcl_abapgit_aff_registry.c_aff_feature = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_aff_registry.c_aff_feature.set('AFF');
zcl_abapgit_aff_registry.ty_registry_entry = new abap.types.Structure({
"obj_type": new abap.types.Character(4, {}),
"experimental": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_aff_registry=>ty_registry_entry", undefined, {}, {});
export {zcl_abapgit_aff_registry};