All files / output zcl_abapgit_apack_migration.clas.mjs

12.32% Statements 36/292
100% Branches 2/2
5.26% Functions 1/19
12.32% Lines 36/292

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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 2921x 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             1x                     1x             1x     1x         1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_apack_migration.clas.abap
class zcl_abapgit_apack_migration {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_APACK_MIGRATION';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"C_APACK_INTERFACE_VERSION": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"INTERFACE_EXISTS": {"visibility": "I", "parameters": {"RV_INTERFACE_EXISTS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "R", "type_name": "CharacterType"}}},
  "INTERFACE_VALID": {"visibility": "I", "parameters": {"RV_INTERFACE_VALID": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "R", "type_name": "CharacterType"}}},
  "CREATE_INTERFACE": {"visibility": "I", "parameters": {}},
  "ADD_INTERFACE_SOURCE_CLASSIC": {"visibility": "I", "parameters": {"IS_CLSKEY": {"type": () => {return new abap.types.Structure({
  "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {});}, "is_optional": " ", "parm_kind": "I", "type_name": "StructureType"}}},
  "ADD_INTERFACE_SOURCE": {"visibility": "I", "parameters": {"IS_CLSKEY": {"type": () => {return new abap.types.Structure({
  "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {});}, "is_optional": " ", "parm_kind": "I", "type_name": "StructureType"}}},
  "GET_INTERFACE_SOURCE": {"visibility": "I", "parameters": {"RT_SOURCE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_string_tt");}, "is_optional": " ", "parm_kind": "R", "type_name": "TableType"}}},
  "ADD_INTF_SOURCE_AND_ACTIVATE": {"visibility": "I", "parameters": {}},
  "RUN": {"visibility": "U", "parameters": {}},
  "PERFORM_MIGRATION": {"visibility": "U", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "interface_exists": this.#interface_exists.bind(this),
      "interface_valid": this.#interface_valid.bind(this),
      "create_interface": this.#create_interface.bind(this),
      "add_interface_source_classic": this.#add_interface_source_classic.bind(this),
      "add_interface_source": this.#add_interface_source.bind(this),
      "get_interface_source": this.#get_interface_source.bind(this),
      "add_intf_source_and_activate": this.#add_intf_source_and_activate.bind(this),
      "perform_migration": this.perform_migration.bind(this),
    };
    this.c_apack_interface_version = zcl_abapgit_apack_migration.c_apack_interface_version;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #add_interface_source(INPUT) {
    let is_clskey = INPUT?.is_clskey;
    if (is_clskey?.getQualifiedName === undefined || is_clskey.getQualifiedName() !== "SEOCLSKEY") { is_clskey = undefined; }
    if (is_clskey === undefined) { is_clskey = new abap.types.Structure({
    "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {}).set(INPUT.is_clskey); }
    let lo_factory = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
    let lo_source = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
    let lt_source_code = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_string_tt");
    if (abap.FunctionModules['SEO_BUFFER_INIT'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
    await abap.FunctionModules['SEO_BUFFER_INIT']();
    if (abap.FunctionModules['SEO_BUFFER_REFRESH'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
    await abap.FunctionModules['SEO_BUFFER_REFRESH']({exporting: {cifkey: is_clskey, version: abap.TypePools["SEOC"].seoc_version_inactive}});
    try {
      if (abap.Classes['CL_OO_FACTORY'.trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } }
      lo_factory.set(await abap.dynamicCallLookup(abap.Classes['CL_OO_FACTORY'.trimEnd()], "create_instance")());
      lo_source.set(await abap.dynamicCallLookup(lo_factory.get(), "create_clif_source")({clif_name: is_clskey.get().clsname}));
      try {
        await abap.dynamicCallLookup(lo_source.get(), "if_oo_clif_source$lock")();
      } catch (e) {
        if ((abap.Classes['CX_OO_ACCESS_PERMISSION'] && e instanceof abap.Classes['CX_OO_ACCESS_PERMISSION'])) {
          await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(39, 'source_new, access permission exception')});
        } else {
          throw e;
        }
      }
      lt_source_code.set((await this.#get_interface_source()));
      await abap.dynamicCallLookup(lo_source.get(), "if_oo_clif_source$set_source")({source: lt_source_code});
      await abap.dynamicCallLookup(lo_source.get(), "if_oo_clif_source$save")();
      await abap.dynamicCallLookup(lo_source.get(), "if_oo_clif_source$unlock")();
    } catch (e) {
      if ((abap.Classes['CX_SY_DYN_CALL_ERROR'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ERROR'])) {
        await this.#add_interface_source_classic({is_clskey: is_clskey});
      } else {
        throw e;
      }
    }
  }
  async #add_interface_source_classic(INPUT) {
    let is_clskey = INPUT?.is_clskey;
    if (is_clskey?.getQualifiedName === undefined || is_clskey.getQualifiedName() !== "SEOCLSKEY") { is_clskey = undefined; }
    if (is_clskey === undefined) { is_clskey = new abap.types.Structure({
    "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {}).set(INPUT.is_clskey); }
    let lo_source = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
    let lt_source_code = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_string_tt");
    let unique8 = abap.Classes["CLAS-ZCL_ABAPGIT_APACK_MIGRATION-"+'CL_OO_SOURCE'.trimEnd()];
    if (unique8 === undefined) { unique8 = abap.Classes['CL_OO_SOURCE'.trimEnd()]; }
    if (unique8 === undefined) { throw new abap.Classes['CX_SY_CREATE_OBJECT_ERROR']; }
    lo_source.set(await (new unique8()).constructor_({clskey: is_clskey}));
    if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(23, 'error from CL_OO_SOURCE')});
    }
    try {
      await abap.dynamicCallLookup(lo_source.get(), "access_permission")({access_mode: abap.TypePools["SEOK"].seok_access_modify});
      lt_source_code.set((await this.#get_interface_source()));
      await abap.dynamicCallLookup(lo_source.get(), "set_source")({i_source: lt_source_code});
      await abap.dynamicCallLookup(lo_source.get(), "save")();
      await abap.dynamicCallLookup(lo_source.get(), "access_permission")({access_mode: abap.TypePools["SEOK"].seok_access_free});
    } catch (e) {
      if ((abap.Classes['CX_OO_ACCESS_PERMISSION'] && e instanceof abap.Classes['CX_OO_ACCESS_PERMISSION'])) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(16, 'permission error')});
      } else if ((abap.Classes['CX_OO_SOURCE_SAVE_FAILURE'] && e instanceof abap.Classes['CX_OO_SOURCE_SAVE_FAILURE'])) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(12, 'save failure')});
      } else {
        throw e;
      }
    }
  }
  async #add_intf_source_and_activate() {
    let ls_clskey = new abap.types.Structure({
    "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {});
    let ls_inactive_object = new abap.types.Structure({
    "object": new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"}),
    "obj_name": new abap.types.Character(120, {"qualifiedName":"CHAR120","ddicName":"CHAR120","description":"CHAR120"}),
    "uname": new abap.types.Character(12, {"qualifiedName":"SYUNAME","ddicName":"SYUNAME","description":"SYUNAME"}),
    "delet_flag": new abap.types.Character(1, {"qualifiedName":"CHAR1","ddicName":"CHAR1","description":"CHAR1"})}, "DWINACTIV", "DWINACTIV", {}, {});
    let lt_inactive_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "object": new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"}),
    "obj_name": new abap.types.Character(120, {"qualifiedName":"CHAR120","ddicName":"CHAR120","description":"CHAR120"}),
    "uname": new abap.types.Character(12, {"qualifiedName":"SYUNAME","ddicName":"SYUNAME","description":"SYUNAME"}),
    "delet_flag": new abap.types.Character(1, {"qualifiedName":"CHAR1","ddicName":"CHAR1","description":"CHAR1"})}, "DWINACTIV", "DWINACTIV", {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    ls_clskey.get().clsname.set(abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust);
    await this.#add_interface_source({is_clskey: ls_clskey});
    ls_inactive_object.get().object.set(abap.CharacterFactory.get(4, 'INTF'));
    ls_inactive_object.get().obj_name.set(abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust);
    abap.statements.insertInternal({data: ls_inactive_object, table: lt_inactive_objects});
    try {
      if (abap.FunctionModules['RS_WORKING_OBJECTS_ACTIVATE'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
      await abap.FunctionModules['RS_WORKING_OBJECTS_ACTIVATE']({tables: {objects: lt_inactive_objects}});
      abap.builtin.sy.get().subrc.set(0);
    } catch (e) {
      if (e.classic) {
          switch (e.classic.toUpperCase()) {
          case "EXCECUTION_ERROR": abap.builtin.sy.get().subrc.set(1); break;
          case "CANCELLED": abap.builtin.sy.get().subrc.set(2); break;
          case "INSERT_INTO_CORR_ERROR": abap.builtin.sy.get().subrc.set(3); break;
          default: abap.builtin.sy.get().subrc.set(4); break;
            }
        } else {
            throw e;
        }
      }
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise_t100();
      }
    }
    async #create_interface() {
      let ls_interface_properties = new abap.types.Structure({
      "clsname": new abap.types.Character(30, {}),
      "version": new abap.types.Numc(),
      "langu": new abap.types.Character(1, {}),
      "descript": new abap.types.Character(60, {}),
      "uuid": new abap.types.Hex({length: 16}),
      "category": new abap.types.Numc({length: 2}),
      "exposure": new abap.types.Numc(),
      "state": new abap.types.Numc(),
      "release": new abap.types.Numc(),
      "author": new abap.types.Character(12, {}),
      "createdon": new abap.types.Date(),
      "changedby": new abap.types.Character(12, {}),
      "changedon": new abap.types.Date(),
      "chgdanyby": new abap.types.Character(12, {}),
      "chgdanyon": new abap.types.Date(),
      "remote": new abap.types.Character(1, {}),
      "unicode": new abap.types.Character(1, {}),
      "r3release": new abap.types.Character(10, {}),
      "clsproxy": new abap.types.Character(1, {})}, "VSEOINTERF", "VSEOINTERF", {}, {});
      ls_interface_properties.get().clsname.set(abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust);
      ls_interface_properties.get().version.set(abap.CharacterFactory.get(1, '1'));
      ls_interface_properties.get().langu.set(abap.CharacterFactory.get(1, 'E'));
      ls_interface_properties.get().descript.set(abap.CharacterFactory.get(25, 'APACK: Manifest interface'));
      ls_interface_properties.get().exposure.set(abap.CharacterFactory.get(1, '2'));
      ls_interface_properties.get().state.set(abap.CharacterFactory.get(1, '1'));
      ls_interface_properties.get().unicode.set(abap.builtin.abap_true);
      try {
        try {
          if (abap.FunctionModules['SEO_INTERFACE_CREATE_COMPLETE'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
          await abap.FunctionModules['SEO_INTERFACE_CREATE_COMPLETE']({exporting: {devclass: abap.CharacterFactory.get(4, '$TMP'), suppress_dialog: abap.builtin.abap_true}, changing: {interface: ls_interface_properties}});
          abap.builtin.sy.get().subrc.set(0);
        } catch (e) {
          if (e.classic) {
              switch (e.classic.toUpperCase()) {
              case "EXISTING": abap.builtin.sy.get().subrc.set(1); break;
              case "IS_CLASS": abap.builtin.sy.get().subrc.set(2); break;
              case "DB_ERROR": abap.builtin.sy.get().subrc.set(3); break;
              case "COMPONENT_ERROR": abap.builtin.sy.get().subrc.set(4); break;
              case "NO_ACCESS": abap.builtin.sy.get().subrc.set(5); break;
              case "OTHER": abap.builtin.sy.get().subrc.set(6); break;
              default: abap.builtin.sy.get().subrc.set(7); break;
                }
            } else {
                throw e;
            }
          }
        } catch (e) {
          if ((abap.Classes['CX_SY_DYN_CALL_PARAM_NOT_FOUND'] && e instanceof abap.Classes['CX_SY_DYN_CALL_PARAM_NOT_FOUND'])) {
            try {
              if (abap.FunctionModules['SEO_INTERFACE_CREATE_COMPLETE'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
              await abap.FunctionModules['SEO_INTERFACE_CREATE_COMPLETE']({exporting: {devclass: abap.CharacterFactory.get(4, '$TMP')}, changing: {interface: ls_interface_properties}});
              abap.builtin.sy.get().subrc.set(0);
            } catch (e) {
              if (e.classic) {
                  switch (e.classic.toUpperCase()) {
                  case "EXISTING": abap.builtin.sy.get().subrc.set(1); break;
                  case "IS_CLASS": abap.builtin.sy.get().subrc.set(2); break;
                  case "DB_ERROR": abap.builtin.sy.get().subrc.set(3); break;
                  case "COMPONENT_ERROR": abap.builtin.sy.get().subrc.set(4); break;
                  case "NO_ACCESS": abap.builtin.sy.get().subrc.set(5); break;
                  case "OTHER": abap.builtin.sy.get().subrc.set(6); break;
                  default: abap.builtin.sy.get().subrc.set(7); break;
                    }
                } else {
                    throw e;
                }
              }
            } else {
              throw e;
            }
          }
          if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise_t100();
          }
          await this.#add_intf_source_and_activate();
        }
        async #get_interface_source() {
          let rt_source = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_string_tt");
          abap.statements.insertInternal({data: new abap.types.String().set(`INTERFACE zif_apack_manifest PUBLIC.`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(``), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`  TYPES: BEGIN OF ty_dependency,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           group_id       TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           artifact_id    TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           version        TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           git_url        TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           target_package TYPE devclass,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`         END OF ty_dependency,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`         ty_dependencies    TYPE STANDARD TABLE OF ty_dependency`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`                            WITH NON-UNIQUE DEFAULT KEY,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`         ty_repository_type TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`         BEGIN OF ty_descriptor,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           group_id        TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           artifact_id     TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           version         TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           repository_type TYPE ty_repository_type,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           git_url         TYPE string,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`           dependencies    TYPE ty_dependencies,`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`         END OF ty_descriptor.`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(``), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`  CONSTANTS: co_file_name         TYPE string VALUE '.apack-manifest.xml',`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`             co_abap_git          TYPE ty_repository_type VALUE 'abapGit',`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`             co_interface_version TYPE i VALUE 1.`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(``), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`  DATA: descriptor TYPE ty_descriptor READ-ONLY.`), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(``), table: rt_source});
          abap.statements.insertInternal({data: new abap.types.String().set(`ENDINTERFACE.`), table: rt_source});
          return rt_source;
        }
        async #interface_exists() {
          let rv_interface_exists = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
          let lv_interface_name = new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"});
          await abap.statements.select(lv_interface_name, {select: "SELECT \"clsname\" FROM " + abap.buildDbTableName("seoclass") + " WHERE \"clsname\" = '" + abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust.get() + "' UP TO 1 ROWS"});
          rv_interface_exists.set(abap.builtin.boolc(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))));
          return rv_interface_exists;
        }
        async #interface_valid() {
          let rv_interface_valid = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
          let fs_lv_interface_vers_ = new abap.types.FieldSymbol(new abap.types.Integer({qualifiedName: "I"}));
          abap.statements.assign({target: fs_lv_interface_vers_, dynamicName: abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust.get() + '=>' + 'CO_INTERFACE_VERSION', dynamicSource: (() => {
              const name = abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_apack_interface_cust.get().toLowerCase().replace(/[~\/]/g, "$").match(/[\w\$\/]+/)[0];
              try { return eval(name); } catch {}
              try { return eval("this." + name); } catch {}
          })()});
          rv_interface_valid.set(abap.builtin.boolc(abap.compare.assigned(fs_lv_interface_vers_) && abap.compare.ge(fs_lv_interface_vers_, zcl_abapgit_apack_migration.c_apack_interface_version)));
          return rv_interface_valid;
        }
        async perform_migration() {
          if (abap.compare.eq((await this.#interface_exists()), abap.builtin.abap_false)) {
            await this.#create_interface();
          } else if (abap.compare.eq((await this.#interface_valid()), abap.builtin.abap_false)) {
            await this.#add_intf_source_and_activate();
          }
        }
        async run() {
          return zcl_abapgit_apack_migration.run();
        }
        static async run() {
          let lo_apack_migration = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_APACK_MIGRATION", RTTIName: "\\CLASS=ZCL_ABAPGIT_APACK_MIGRATION"});
          lo_apack_migration.set(await (new abap.Classes['ZCL_ABAPGIT_APACK_MIGRATION']()).constructor_());
          await lo_apack_migration.get().perform_migration();
        }
      }
      abap.Classes['ZCL_ABAPGIT_APACK_MIGRATION'] = zcl_abapgit_apack_migration;
      zcl_abapgit_apack_migration.c_apack_interface_version = new abap.types.Integer({qualifiedName: "I"});
      zcl_abapgit_apack_migration.c_apack_interface_version.set(1);
export {zcl_abapgit_apack_migration};