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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | 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 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_zip.clas.abap class zcl_abapgit_zip { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_ZIP'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {}; static METHODS = {"FILENAME": {"visibility": "I", "parameters": {"IV_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_PATH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "EV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "NORMALIZE_PATH": {"visibility": "I", "parameters": {"CT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt");}, "is_optional": " "}}}, "UNZIP_FILE": {"visibility": "I", "parameters": {"RT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt");}, "is_optional": " "}, "IV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}, "ENCODE_FILES": {"visibility": "U", "parameters": {"RV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "file": new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), "item": 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"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {})}, "zif_abapgit_definitions=>ty_file_item", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_files_item_tt");}, "is_optional": " "}}}, "EXPORT": {"visibility": "U", "parameters": {"RV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IS_LOCAL_SETTINGS": {"type": () => {return new abap.types.Structure({ "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-DISPLAY_NAME"}), "ignore_subpackages": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "write_protected": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "only_local_objects": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "code_inspector_check_variant": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}), "block_commit": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "main_language_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "suppress_lxe_po_comments": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "labels": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-LABELS"}), "transport_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "customizing_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "flow": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "exclude_remote_paths": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_persistence=>ty_local_settings", undefined, {}, {});}, "is_optional": " "}, "IV_PACKAGE": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});}, "is_optional": " "}, "IO_DOT_ABAPGIT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});}, "is_optional": " "}, "IV_SHOW_LOG": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IT_FILTER": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "pgmid": new abap.types.Character(4, {}), "object": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "korrnum": new abap.types.Character(10, {}), "delflag": new abap.types.Character(1, {}), "genflag": new abap.types.Character(1, {}), "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}), "srcsystem": new abap.types.Character(5, {}), "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_tadir_tt");}, "is_optional": " "}}}, "EXPORT_OBJECT": {"visibility": "U", "parameters": {"IV_OBJECT_TYPE": {"type": () => {return new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"});}, "is_optional": " "}, "IV_OBJECT_NAME": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"SOBJ_NAME","ddicName":"SOBJ_NAME","description":"SOBJ_NAME"});}, "is_optional": " "}, "IV_MAIN_LANGUAGE_ONLY": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IT_TRANSLATION_LANGS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_languages");}, "is_optional": " "}, "IV_USE_LXE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "EXPORT_PACKAGE": {"visibility": "U", "parameters": {"IV_PACKAGE": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});}, "is_optional": " "}, "IV_FOLDER_LOGIC": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_MAIN_LANG_ONLY": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_IGN_SUBPKG": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "LOAD": {"visibility": "U", "parameters": {"RT_FILES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt");}, "is_optional": " "}, "IV_XSTR": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}, "SAVE_BINSTRING_TO_LOCALFILE": {"visibility": "U", "parameters": {"IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_BINSTRING": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}}; 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 encode_files(INPUT) { return zcl_abapgit_zip.encode_files(INPUT); } static async encode_files(INPUT) { let rv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}); let it_files = INPUT?.it_files; if (it_files?.getQualifiedName === undefined || it_files.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_FILES_ITEM_TT") { it_files = undefined; } if (it_files === undefined) { it_files = abap.types.TableFactory.construct(new abap.types.Structure({ "file": new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), "item": 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"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {})}, "zif_abapgit_definitions=>ty_file_item", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_files_item_tt").set(INPUT.it_files); } let lo_zip = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_ZIP", RTTIName: "\\CLASS=CL_ABAP_ZIP"}); let lv_filename = new abap.types.String({qualifiedName: "STRING"}); let fs_ls_file_ = new abap.types.FieldSymbol(new abap.types.Structure({ "file": new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), "item": 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"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {})}, "zif_abapgit_definitions=>ty_file_item", undefined, {}, {})); lo_zip.set(await (new abap.Classes['CL_ABAP_ZIP']()).constructor_()); for await (const unique575 of abap.statements.loop(it_files)) { fs_ls_file_.assign(unique575); abap.statements.concatenate({source: [fs_ls_file_.get().file.get().path.getOffset({offset: 1}), fs_ls_file_.get().file.get().filename], target: lv_filename}); await lo_zip.get().add({name: lv_filename, content: fs_ls_file_.get().file.get().data}); } rv_xstr.set((await lo_zip.get().save())); return rv_xstr; } async export(INPUT) { return zcl_abapgit_zip.export(INPUT); } static async export(INPUT) { let rv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}); let is_local_settings = INPUT?.is_local_settings; if (is_local_settings?.getQualifiedName === undefined || is_local_settings.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS") { is_local_settings = undefined; } if (is_local_settings === undefined) { is_local_settings = new abap.types.Structure({ "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-DISPLAY_NAME"}), "ignore_subpackages": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "write_protected": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "only_local_objects": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "code_inspector_check_variant": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}), "block_commit": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "main_language_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "suppress_lxe_po_comments": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "labels": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-LABELS"}), "transport_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "customizing_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "flow": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "exclude_remote_paths": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_persistence=>ty_local_settings", undefined, {}, {}).set(INPUT.is_local_settings); } let iv_package = INPUT?.iv_package; if (iv_package?.getQualifiedName === undefined || iv_package.getQualifiedName() !== "DEVCLASS") { iv_package = undefined; } if (iv_package === undefined) { iv_package = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}).set(INPUT.iv_package); } let io_dot_abapgit = INPUT?.io_dot_abapgit; if (io_dot_abapgit?.getQualifiedName === undefined || io_dot_abapgit.getQualifiedName() !== "ZCL_ABAPGIT_DOT_ABAPGIT") { io_dot_abapgit = undefined; } if (io_dot_abapgit === undefined) { io_dot_abapgit = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"}).set(INPUT.io_dot_abapgit); } let iv_show_log = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_show_log) {iv_show_log.set(INPUT.iv_show_log);} if (INPUT === undefined || INPUT.iv_show_log === undefined) {iv_show_log = abap.builtin.abap_true;} let it_filter = abap.types.TableFactory.construct(new abap.types.Structure({ "pgmid": new abap.types.Character(4, {}), "object": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "korrnum": new abap.types.Character(10, {}), "delflag": new abap.types.Character(1, {}), "genflag": new abap.types.Character(1, {}), "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}), "srcsystem": new abap.types.Character(5, {}), "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_tadir_tt"); if (INPUT && INPUT.it_filter) {it_filter.set(INPUT.it_filter);} let li_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"}); let lt_zip = abap.types.TableFactory.construct(new abap.types.Structure({ "file": new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), "item": 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"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {})}, "zif_abapgit_definitions=>ty_file_item", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_files_item_tt"); let lo_serialize = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SERIALIZE", RTTIName: "\\CLASS=ZCL_ABAPGIT_SERIALIZE"}); li_log.set(await (new abap.Classes['ZCL_ABAPGIT_LOG']()).constructor_()); await li_log.get().zif_abapgit_log$set_title({iv_title: abap.CharacterFactory.get(14, 'Zip Export Log')}); if (abap.compare.eq((await (await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_sap_package({iv_package: iv_package})).get().zif_abapgit_sap_package$exists()), abap.builtin.abap_false)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Package ${abap.templateFormatting(iv_package)} doesn't exist`)}); } lo_serialize.set(await (new abap.Classes['ZCL_ABAPGIT_SERIALIZE']()).constructor_({io_dot_abapgit: io_dot_abapgit, is_local_settings: is_local_settings})); lt_zip.set((await lo_serialize.get().files_local({iv_package: iv_package, ii_log: li_log, it_filter: it_filter}))); lo_serialize.clear(); if (abap.compare.gt((await li_log.get().zif_abapgit_log$count()), abap.IntegerFactory.get(0)) && abap.compare.eq(iv_show_log, abap.builtin.abap_true)) { await abap.Classes['ZCL_ABAPGIT_LOG_VIEWER'].show_log({ii_log: li_log}); } rv_xstr.set((await this.encode_files({it_files: lt_zip}))); return rv_xstr; } async export_object(INPUT) { return zcl_abapgit_zip.export_object(INPUT); } static async export_object(INPUT) { let iv_object_type = INPUT?.iv_object_type; if (iv_object_type?.getQualifiedName === undefined || iv_object_type.getQualifiedName() !== "TROBJTYPE") { iv_object_type = undefined; } if (iv_object_type === undefined) { iv_object_type = new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"}).set(INPUT.iv_object_type); } let iv_object_name = INPUT?.iv_object_name; if (iv_object_name?.getQualifiedName === undefined || iv_object_name.getQualifiedName() !== "SOBJ_NAME") { iv_object_name = undefined; } if (iv_object_name === undefined) { iv_object_name = new abap.types.Character(40, {"qualifiedName":"SOBJ_NAME","ddicName":"SOBJ_NAME","description":"SOBJ_NAME"}).set(INPUT.iv_object_name); } let iv_main_language_only = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_main_language_only) {iv_main_language_only.set(INPUT.iv_main_language_only);} if (INPUT === undefined || INPUT.iv_main_language_only === undefined) {iv_main_language_only = abap.builtin.abap_false;} let it_translation_langs = abap.types.TableFactory.construct(new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_languages"); if (INPUT && INPUT.it_translation_langs) {it_translation_langs.set(INPUT.it_translation_langs);} let iv_use_lxe = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_use_lxe) {iv_use_lxe.set(INPUT.iv_use_lxe);} if (INPUT === undefined || INPUT.iv_use_lxe === undefined) {iv_use_lxe = abap.builtin.abap_false;} let ls_tadir = new abap.types.Structure({ "pgmid": new abap.types.Character(4, {}), "object": new abap.types.Character(4, {}), "obj_name": new abap.types.Character(40, {}), "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}), "korrnum": new abap.types.Character(10, {}), "delflag": new abap.types.Character(1, {}), "genflag": new abap.types.Character(1, {}), "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}), "srcsystem": new abap.types.Character(5, {}), "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {}); let lv_folder = new abap.types.String({qualifiedName: "STRING"}); let lv_fullpath = new abap.types.String({qualifiedName: "STRING"}); let lv_sep = new abap.types.Character(1, {}); let ls_files_item = new abap.types.Structure({ "files": abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt"), "item": 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"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {})}, "zif_abapgit_objects=>ty_serialization", undefined, {}, {}); let lo_frontend_serv = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_FRONTEND_SERVICES", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_FRONTEND_SERVICES"}); let fs_ls_file_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {})); ls_tadir.set((await (await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_tadir()).get().zif_abapgit_tadir$read_single({iv_object: iv_object_type, iv_obj_name: iv_object_name}))); if (abap.compare.initial(ls_tadir)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(25, 'Object could not be found')}); } ls_files_item.get().item.get().obj_type.set(ls_tadir.get().object); ls_files_item.get().item.get().obj_name.set(ls_tadir.get().obj_name); ls_files_item.get().item.get().abap_language_version.set(abap.CharacterFactory.get(1, '*')); ls_files_item.set((await abap.Classes['ZCL_ABAPGIT_OBJECTS'].serialize({is_item: ls_files_item.get().item, io_i18n_params: (await abap.Classes['ZCL_ABAPGIT_I18N_PARAMS'].new({iv_use_lxe: iv_use_lxe, it_translation_langs: it_translation_langs, iv_main_language_only: iv_main_language_only, iv_main_language: abap.builtin.sy.get().langu}))}))); if (abap.compare.eq(abap.builtin.lines({val: ls_files_item.get().files}), abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(5, 'Empty')}); } lo_frontend_serv.set((await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_frontend_services())); await lo_frontend_serv.get().zif_abapgit_frontend_services$directory_browse({cv_selected_folder: lv_folder}); if (abap.compare.initial(lv_folder)) { const unique576 = await (new abap.Classes['ZCX_ABAPGIT_CANCEL']()).constructor_(); unique576.EXTRA_CX = {"INTERNAL_FILENAME": "zcl_abapgit_zip.clas.abap","INTERNAL_LINE": 178}; throw unique576; } await lo_frontend_serv.get().zif_abapgit_frontend_services$get_file_separator({cv_file_separator: lv_sep}); for await (const unique577 of abap.statements.loop(ls_files_item.get().files)) { fs_ls_file_.assign(unique577); lv_fullpath.set(new abap.types.String().set(`${abap.templateFormatting(lv_folder)}${abap.templateFormatting(lv_sep)}${abap.templateFormatting(fs_ls_file_.get().filename)}`)); await this.save_binstring_to_localfile({iv_filename: lv_fullpath, iv_binstring: fs_ls_file_.get().data}); } } async export_package(INPUT) { return zcl_abapgit_zip.export_package(INPUT); } static async export_package(INPUT) { let iv_package = INPUT?.iv_package; if (iv_package?.getQualifiedName === undefined || iv_package.getQualifiedName() !== "DEVCLASS") { iv_package = undefined; } if (iv_package === undefined) { iv_package = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}).set(INPUT.iv_package); } let iv_folder_logic = INPUT?.iv_folder_logic; if (iv_folder_logic?.getQualifiedName === undefined || iv_folder_logic.getQualifiedName() !== "STRING") { iv_folder_logic = undefined; } if (iv_folder_logic === undefined) { iv_folder_logic = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_folder_logic); } let iv_main_lang_only = INPUT?.iv_main_lang_only; if (iv_main_lang_only?.getQualifiedName === undefined || iv_main_lang_only.getQualifiedName() !== "ABAP_BOOL") { iv_main_lang_only = undefined; } if (iv_main_lang_only === undefined) { iv_main_lang_only = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_main_lang_only); } let iv_ign_subpkg = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_ign_subpkg) {iv_ign_subpkg.set(INPUT.iv_ign_subpkg);} let ls_local_settings = new abap.types.Structure({ "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-DISPLAY_NAME"}), "ignore_subpackages": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "write_protected": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "only_local_objects": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "code_inspector_check_variant": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}), "block_commit": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "main_language_only": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "suppress_lxe_po_comments": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "labels": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_LOCAL_SETTINGS-LABELS"}), "transport_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "customizing_request": new abap.types.Character(20, {"qualifiedName":"TRKORR","ddicName":"TRKORR","description":"TRKORR"}), "flow": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "exclude_remote_paths": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_persistence=>ty_local_settings", undefined, {}, {}); let lo_dot_abapgit = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"}); let lo_frontend_serv = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_FRONTEND_SERVICES", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_FRONTEND_SERVICES"}); let lv_default = new abap.types.String({qualifiedName: "STRING"}); let lv_package_escaped = new abap.types.String({qualifiedName: "STRING"}); let lv_path = new abap.types.String({qualifiedName: "STRING"}); let lv_zip_xstring = new abap.types.XString({qualifiedName: "XSTRING"}); ls_local_settings.get().main_language_only.set(iv_main_lang_only); ls_local_settings.get().ignore_subpackages.set(iv_ign_subpkg); lo_dot_abapgit.set((await abap.Classes['ZCL_ABAPGIT_DOT_ABAPGIT'].build_default())); await lo_dot_abapgit.get().set_folder_logic({iv_logic: iv_folder_logic}); lo_frontend_serv.set((await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_frontend_services())); lv_package_escaped.set(iv_package); abap.statements.replace({target: lv_package_escaped, all: true, with: abap.CharacterFactory.get(1, '#'), of: abap.CharacterFactory.get(1, '/')}); lv_default.set(new abap.types.String().set(`${abap.templateFormatting(lv_package_escaped)}_${abap.templateFormatting(abap.builtin.sy.get().datlo)}_${abap.templateFormatting(abap.builtin.sy.get().timlo)}.zip`)); lv_zip_xstring.set((await this.export({is_local_settings: ls_local_settings, iv_package: iv_package, io_dot_abapgit: lo_dot_abapgit}))); lv_path.set((await lo_frontend_serv.get().zif_abapgit_frontend_services$show_file_save_dialog({iv_title: abap.CharacterFactory.get(14, 'Package Export'), iv_extension: abap.CharacterFactory.get(3, 'zip'), iv_default_filename: lv_default}))); await lo_frontend_serv.get().zif_abapgit_frontend_services$file_download({iv_path: lv_path, iv_xstr: lv_zip_xstring}); } async filename(INPUT) { return zcl_abapgit_zip.filename(INPUT); } static async filename(INPUT) { let iv_str = INPUT?.iv_str; if (iv_str?.getQualifiedName === undefined || iv_str.getQualifiedName() !== "STRING") { iv_str = undefined; } if (iv_str === undefined) { iv_str = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_str); } let ev_path = INPUT?.ev_path || new abap.types.String({qualifiedName: "STRING"}); let ev_filename = INPUT?.ev_filename || new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.ca(iv_str, abap.CharacterFactory.get(1, '/'))) { abap.statements.find(iv_str, {regex: abap.CharacterFactory.get(9, '(.*/)(.*)'), submatches: [ev_path,ev_filename]}); 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(14, 'Malformed path')}); } if (abap.compare.ne(ev_path, abap.CharacterFactory.get(1, '/'))) { abap.statements.concatenate({source: [abap.CharacterFactory.get(1, '/'), ev_path], target: ev_path}); } } else { ev_path.set(abap.CharacterFactory.get(1, '/')); ev_filename.set(iv_str); } abap.statements.translate(ev_filename, "LOWER"); } async load(INPUT) { return zcl_abapgit_zip.load(INPUT); } static async load(INPUT) { let rt_files = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt"); let iv_xstr = INPUT?.iv_xstr; if (iv_xstr?.getQualifiedName === undefined || iv_xstr.getQualifiedName() !== "XSTRING") { iv_xstr = undefined; } if (iv_xstr === undefined) { iv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_xstr); } rt_files.set((await this.unzip_file({iv_xstr: iv_xstr}))); return rt_files; } async normalize_path(INPUT) { return zcl_abapgit_zip.normalize_path(INPUT); } static async normalize_path(INPUT) { let ct_files = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt"); if (INPUT && INPUT.ct_files) {ct_files = INPUT.ct_files;} let lt_split = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); let lv_needed = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let lv_length = new abap.types.Integer({qualifiedName: "I"}); let lv_split = new abap.types.String({qualifiedName: "STRING"}); let fs_ls_file_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {})); abap.statements.readTable(ct_files,{index: abap.IntegerFactory.get(1), assigning: fs_ls_file_}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { return; } abap.statements.split({source: fs_ls_file_.get().path, at: abap.CharacterFactory.get(1, '/'), table: lt_split}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { return; } abap.statements.readTable(lt_split,{index: abap.IntegerFactory.get(2), into: lv_split}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) || abap.compare.eq(abap.builtin.strlen({val: lv_split}), abap.IntegerFactory.get(0))) { return; } abap.statements.concatenate({source: [abap.CharacterFactory.get(1, '/'), lv_split, abap.CharacterFactory.get(2, '/*')], target: lv_split}); lv_needed.set(abap.builtin.abap_true); for await (const unique578 of abap.statements.loop(ct_files)) { fs_ls_file_.assign(unique578); if (!abap.compare.cp(fs_ls_file_.get().path, lv_split)) { lv_needed.set(abap.builtin.abap_false); break; } } if (abap.compare.eq(lv_needed, abap.builtin.abap_true)) { lv_length.set(abap.operators.minus(abap.builtin.strlen({val: lv_split}),abap.IntegerFactory.get(2))); for await (const unique579 of abap.statements.loop(ct_files)) { fs_ls_file_.assign(unique579); fs_ls_file_.get().path.set(fs_ls_file_.get().path.getOffset({offset: lv_length})); } } } async save_binstring_to_localfile(INPUT) { return zcl_abapgit_zip.save_binstring_to_localfile(INPUT); } static async save_binstring_to_localfile(INPUT) { let iv_filename = INPUT?.iv_filename; if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; } if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); } let iv_binstring = INPUT?.iv_binstring; if (iv_binstring?.getQualifiedName === undefined || iv_binstring.getQualifiedName() !== "XSTRING") { iv_binstring = undefined; } if (iv_binstring === undefined) { iv_binstring = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_binstring); } await (await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_frontend_services()).get().zif_abapgit_frontend_services$file_download({iv_path: iv_filename, iv_xstr: iv_binstring}); } async unzip_file(INPUT) { return zcl_abapgit_zip.unzip_file(INPUT); } static async unzip_file(INPUT) { let rt_files = abap.types.TableFactory.construct(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"file_path","type":"SORTED","isUnique":true,"keyFields":["PATH","FILENAME"]},{"name":"file","type":"SORTED","isUnique":false,"keyFields":["FILENAME"]}]}, "zif_abapgit_git_definitions=>ty_files_tt"); let iv_xstr = INPUT?.iv_xstr; if (iv_xstr?.getQualifiedName === undefined || iv_xstr.getQualifiedName() !== "XSTRING") { iv_xstr = undefined; } if (iv_xstr === undefined) { iv_xstr = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_xstr); } let lo_zip = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_ZIP", RTTIName: "\\CLASS=CL_ABAP_ZIP"}); let lv_data = new abap.types.XString({qualifiedName: "XSTRING"}); let fs_ls_zipfile_ = new abap.types.FieldSymbol(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "CL_ABAP_ZIP=>T_FILE-NAME"}), "size": new abap.types.Integer({qualifiedName: "CL_ABAP_ZIP=>T_FILE-SIZE"})}, "cl_abap_zip=>t_file", undefined, {}, {})); let fs_ls_file_ = new abap.types.FieldSymbol(new abap.types.Structure({ "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-PATH"}), "filename": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE_SIGNATURE-FILENAME"}), "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_FILE-DATA"})}, "zif_abapgit_git_definitions=>ty_file", undefined, {}, {})); lo_zip.set(await (new abap.Classes['CL_ABAP_ZIP']()).constructor_()); try { await lo_zip.get().load({zip: iv_xstr}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "ZIP_PARSE_ERROR": abap.builtin.sy.get().subrc.set(1); break; default: abap.builtin.sy.get().subrc.set(2); break; } } else { throw e; } } 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(14, 'error from zip')}); } for await (const unique580 of abap.statements.loop(lo_zip.get().files)) { fs_ls_zipfile_.assign(unique580); try { await lo_zip.get().get({name: fs_ls_zipfile_.get().name, content: lv_data}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "ZIP_INDEX_ERROR": abap.builtin.sy.get().subrc.set(1); break; case "ZIP_DECOMPRESSION_ERROR": abap.builtin.sy.get().subrc.set(2); break; default: abap.builtin.sy.get().subrc.set(3); break; } } else { throw e; } } 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(18, 'error from zip get')}); } fs_ls_file_.assign(rt_files.appendInitial()); await this.filename({iv_str: fs_ls_zipfile_.get().name, ev_path: fs_ls_file_.get().path, ev_filename: fs_ls_file_.get().filename}); fs_ls_file_.get().data.set(lv_data); fs_ls_file_.get().sha1.set((await abap.Classes['ZCL_ABAPGIT_HASH'].sha1_blob({iv_data: fs_ls_file_.get().data}))); } await abap.statements.deleteInternal(rt_files,{where: async (I) => {return abap.compare.initial(I.filename);}}); await this.normalize_path({ct_files: rt_files}); return rt_files; } } abap.Classes['ZCL_ABAPGIT_ZIP'] = zcl_abapgit_zip; export {zcl_abapgit_zip}; |