All files / output zcl_abapgit_background_pull.clas.mjs

13.04% Statements 18/138
100% Branches 2/2
12.5% Functions 1/8
13.04% Lines 18/138

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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 1381x 1x 1x 1x 1x 1x 1x 1x 1x             1x       1x     1x         1x     1x             1x                                                                                                                                                                                                   1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_background_pull.clas.abap
class zcl_abapgit_background_pull {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_BACKGROUND_PULL';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_BACKGROUND"];
  static ATTRIBUTES = {};
  static METHODS = {};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async zif_abapgit_background$get_description() {
    return zcl_abapgit_background_pull.zif_abapgit_background$get_description();
  }
  static async zif_abapgit_background$get_description() {
    let rv_description = new abap.types.String({qualifiedName: "STRING"});
    rv_description.set(abap.CharacterFactory.get(14, 'Automatic pull'));
    return rv_description;
  }
  async zif_abapgit_background$get_settings(INPUT) {
    return zcl_abapgit_background_pull.zif_abapgit_background$get_settings(INPUT);
  }
  static async zif_abapgit_background$get_settings(INPUT) {
    let ct_settings = abap.types.TableFactory.construct(new abap.types.Structure({
    "key": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-KEY"}),
    "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-VALUE"})}, "zif_abapgit_background=>ty_settings", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_background=>ty_settings_tt");
    if (INPUT && INPUT.ct_settings) {ct_settings = INPUT.ct_settings;}
    return;
  }
  async zif_abapgit_background$run(INPUT) {
    let ii_repo_online = INPUT?.ii_repo_online;
    if (ii_repo_online?.getQualifiedName === undefined || ii_repo_online.getQualifiedName() !== "ZIF_ABAPGIT_REPO_ONLINE") { ii_repo_online = undefined; }
    if (ii_repo_online === undefined) { ii_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}).set(INPUT.ii_repo_online); }
    let ii_log = INPUT?.ii_log;
    if (ii_log?.getQualifiedName === undefined || ii_log.getQualifiedName() !== "ZIF_ABAPGIT_LOG") { ii_log = undefined; }
    if (ii_log === undefined) { ii_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"}).set(INPUT.ii_log); }
    let it_settings = abap.types.TableFactory.construct(new abap.types.Structure({
    "key": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-KEY"}),
    "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-VALUE"})}, "zif_abapgit_background=>ty_settings", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_background=>ty_settings_tt");
    if (INPUT && INPUT.it_settings) {it_settings.set(INPUT.it_settings);}
    let ls_checks = new abap.types.Structure({
    "overwrite": abap.types.TableFactory.construct(new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"}),
    "state": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_definitions=>ty_overwrite-state"}),
    "action": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-ACTION"}),
    "icon": new abap.types.Character(4, {"qualifiedName":"ICON_D","ddicName":"ICON_D","description":"ICON_D"}),
    "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-TEXT"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_overwrite", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"object_type_and_name","type":"HASHED","isUnique":true,"keyFields":["OBJ_TYPE","OBJ_NAME"]}]}, "zif_abapgit_definitions=>ty_overwrite_tt"),
    "warning_package": abap.types.TableFactory.construct(new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"}),
    "state": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_definitions=>ty_overwrite-state"}),
    "action": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-ACTION"}),
    "icon": new abap.types.Character(4, {"qualifiedName":"ICON_D","ddicName":"ICON_D","description":"ICON_D"}),
    "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-TEXT"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_overwrite", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"object_type_and_name","type":"HASHED","isUnique":true,"keyFields":["OBJ_TYPE","OBJ_NAME"]}]}, "zif_abapgit_definitions=>ty_overwrite_tt"),
    "data_loss": abap.types.TableFactory.construct(new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"}),
    "state": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_definitions=>ty_overwrite-state"}),
    "action": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-ACTION"}),
    "icon": new abap.types.Character(4, {"qualifiedName":"ICON_D","ddicName":"ICON_D","description":"ICON_D"}),
    "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-TEXT"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_overwrite", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"object_type_and_name","type":"HASHED","isUnique":true,"keyFields":["OBJ_TYPE","OBJ_NAME"]}]}, "zif_abapgit_definitions=>ty_overwrite_tt"),
    "requirements": new abap.types.Structure({
    "met": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_requirements", undefined, {}, {}),
    "dependencies": new abap.types.Structure({
    "met": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_dependencies", undefined, {}, {}),
    "transport": new abap.types.Structure({
    "required": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "transport": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}),
    "type": new abap.types.Structure({
    "request": new abap.types.Character(1, {"qualifiedName":"TRFUNCTION","ddicName":"TRFUNCTION","description":"TRFUNCTION"}),
    "task": new abap.types.Character(1, {"qualifiedName":"TRFUNCTION","ddicName":"TRFUNCTION","description":"TRFUNCTION"})}, "zif_abapgit_definitions=>ty_transport_type", undefined, {}, {})}, "zif_abapgit_definitions=>ty_transport", undefined, {}, {}),
    "customizing": new abap.types.Structure({
    "required": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "transport": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}),
    "type": new abap.types.Structure({
    "request": new abap.types.Character(1, {"qualifiedName":"TRFUNCTION","ddicName":"TRFUNCTION","description":"TRFUNCTION"}),
    "task": new abap.types.Character(1, {"qualifiedName":"TRFUNCTION","ddicName":"TRFUNCTION","description":"TRFUNCTION"})}, "zif_abapgit_definitions=>ty_transport_type", undefined, {}, {})}, "zif_abapgit_definitions=>ty_transport", undefined, {}, {})}, "zif_abapgit_definitions=>ty_deserialize_checks", undefined, {}, {});
    let lo_settings = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SETTINGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_SETTINGS"});
    let li_repo = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"});
    let lv_activation_setting = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let fs_ls_overwrite_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"}),
    "state": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_definitions=>ty_overwrite-state"}),
    "action": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-ACTION"}),
    "icon": new abap.types.Character(4, {"qualifiedName":"ICON_D","ddicName":"ICON_D","description":"ICON_D"}),
    "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OVERWRITE-TEXT"}),
    "decision": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_yes_no"})}, "zif_abapgit_definitions=>ty_overwrite", undefined, {}, {}));
    li_repo.set(ii_repo_online);
    ls_checks.set((await li_repo.get().zif_abapgit_repo$deserialize_checks()));
    for await (const unique18 of abap.statements.loop(ls_checks.get().overwrite)) {
      fs_ls_overwrite_.assign(unique18);
      fs_ls_overwrite_.get().decision.set(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_yes);
    }
    lo_settings.set((await (await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_settings()).get().zif_abapgit_persist_settings$read()));
    lv_activation_setting.set((await lo_settings.get().get_activate_wo_popup()));
    await lo_settings.get().set_activate_wo_popup({iv_act_wo_popup: abap.builtin.abap_true});
    await abap.Classes['ZCL_ABAPGIT_SERVICES_REPO'].delete_unnecessary_objects({ii_repo: li_repo, is_checks: ls_checks, ii_log: ii_log});
    await li_repo.get().zif_abapgit_repo$deserialize({is_checks: ls_checks, ii_log: ii_log});
    await lo_settings.get().set_activate_wo_popup({iv_act_wo_popup: lv_activation_setting});
  }
}
abap.Classes['ZCL_ABAPGIT_BACKGROUND_PULL'] = zcl_abapgit_background_pull;
export {zcl_abapgit_background_pull};