All files / output zcl_abapgit_repo_filter.clas.mjs

9.17% Statements 20/218
100% Branches 2/2
9.09% Functions 1/11
9.17% Lines 20/218

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 2181x 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_repo_filter.clas.abap
class zcl_abapgit_repo_filter {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_REPO_FILTER';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"APPLY": {"visibility": "U", "parameters": {"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": " "}, "CT_TADIR": {"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": " "}}},
  "APPLY_OBJECT_FILTER": {"visibility": "U", "parameters": {"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": " "}, "IO_DOT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});}, "is_optional": " "}, "IV_DEVCLASS": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});}, "is_optional": " "}, "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": " "}}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "apply": this.apply.bind(this),
      "apply_object_filter": this.apply_object_filter.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async apply(INPUT) {
    let it_filter = INPUT?.it_filter;
    if (it_filter?.getQualifiedName === undefined || it_filter.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR_TT") { it_filter = undefined; }
    if (it_filter === undefined) { 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").set(INPUT.it_filter); }
    let ct_tadir = 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.ct_tadir) {ct_tadir = INPUT.ct_tadir;}
    let lt_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":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":false,"keyFields":["OBJECT","OBJ_NAME"]},"secondary":[]}, "");
    let lv_index = new abap.types.Integer({qualifiedName: "I"});
    let fs_ls_tadir_ = new abap.types.FieldSymbol(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, {}, {}));
    if (abap.compare.eq(abap.builtin.lines({val: it_filter}), abap.IntegerFactory.get(0))) {
      return;
    }
    lt_filter.set(it_filter);
    for await (const unique544 of abap.statements.loop(ct_tadir)) {
      fs_ls_tadir_.assign(unique544);
      lv_index.set(abap.builtin.sy.get().tabix);
      abap.statements.readTable(lt_filter,{binarySearch: true,
        withKey: (i) => {return abap.compare.eq(i.object, fs_ls_tadir_.get().object) && abap.compare.eq(i.obj_name, fs_ls_tadir_.get().obj_name);},
        withKeyValue: [{key: (i) => {return i.object}, value: fs_ls_tadir_.get().object},{key: (i) => {return i.obj_name}, value: fs_ls_tadir_.get().obj_name}],
        usesTableLine: false,
        withKeySimple: {"object": fs_ls_tadir_.get().object,"obj_name": fs_ls_tadir_.get().obj_name}});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.statements.deleteInternal(ct_tadir,{index: lv_index});
      }
    }
  }
  async apply_object_filter(INPUT) {
    let it_filter = INPUT?.it_filter;
    if (it_filter?.getQualifiedName === undefined || it_filter.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR_TT") { it_filter = undefined; }
    if (it_filter === undefined) { 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").set(INPUT.it_filter); }
    let io_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});
    if (INPUT && INPUT.io_dot) {io_dot.set(INPUT.io_dot);}
    let iv_devclass = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});
    if (INPUT && INPUT.iv_devclass) {iv_devclass.set(INPUT.iv_devclass);}
    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 lr_file = new abap.types.DataReference(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, {}, {}));
    let ls_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, {}, {});
    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 lt_tadir = 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");
    let lt_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":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":false,"keyFields":["OBJECT","OBJ_NAME"]},"secondary":[]}, "");
    lt_filter.set(it_filter);
    for await (const unique545 of abap.statements.loop(ct_files)) {
      lr_file.assign(unique545);
      if (abap.compare.eq(lr_file.get().filename, abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_dot_abapgit)) {
        continue;
      }
      await abap.Classes['ZCL_ABAPGIT_FILENAME_LOGIC'].file_to_object({iv_filename: lr_file.get().filename, iv_path: lr_file.get().path, iv_devclass: iv_devclass, io_dot: io_dot, es_item: ls_item});
      lt_tadir.clear();
      ls_tadir.clear();
      ls_tadir.get().object.set(ls_item.get().obj_type);
      ls_tadir.get().obj_name.set(ls_item.get().obj_name);
      ls_tadir.get().devclass.set(ls_item.get().devclass);
      abap.statements.insertInternal({data: ls_tadir, table: lt_tadir});
      abap.statements.readTable(lt_filter,{binarySearch: true,
        withKey: (i) => {return abap.compare.eq(i.object, ls_tadir.get().object) && abap.compare.eq(i.obj_name, ls_tadir.get().obj_name);},
        withKeyValue: [{key: (i) => {return i.object}, value: ls_tadir.get().object},{key: (i) => {return i.obj_name}, value: ls_tadir.get().obj_name}],
        usesTableLine: false,
        withKeySimple: {"object": ls_tadir.get().object,"obj_name": ls_tadir.get().obj_name}});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.statements.deleteInternal(ct_files);
      }
    }
  }
}
abap.Classes['ZCL_ABAPGIT_REPO_FILTER'] = zcl_abapgit_repo_filter;
export {zcl_abapgit_repo_filter};