trm-core 7.3.0 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.txt CHANGED
@@ -8,7 +8,23 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
+ 2025-07-29 7.4.1
12
+ -------------------
13
+ ! trm-commons ^2.0.0
14
+
15
+ 2025-07-29 7.4.0
16
+ -------------------
17
+ - dependency install doesn't ask for cust/lang/package replacements anymore if not needed
18
+ ! install asks for cust/lang/package replacements when not provided by default parameter
19
+ ! import logger shows package name
20
+ ! trm-commons ^1.1.0
21
+ ! trm-server ^5.0.0
22
+ ! set/overwrite dependencies with or without automatic detection
23
+ + manifest template for post activities, trm dependency and sap entries
24
+ * local package install
25
+
11
26
  2025-07-08 v7.3.0
27
+ -------------------
12
28
  + enforce node engine ^22.12.0 with post install script
13
29
  * install package hierarchy
14
30
 
@@ -32,7 +32,7 @@ exports.importCustTransport = {
32
32
  }),
33
33
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  trm_commons_1.Logger.log('Import CUST Transport step', true);
35
- trm_commons_1.Logger.loading(`Importing...`);
35
+ trm_commons_1.Logger.loading(`Importing ${context.rawInput.packageData.name} customizing...`);
36
36
  const importTimeout = context.rawInput.installData.import.timeout;
37
37
  trm_commons_1.Logger.loading(`Uploading ${context.runtime.packageTransports.cust.binaries.trkorr}`, true);
38
38
  context.runtime.packageTransports.cust.instance = yield transport_1.Transport.upload({
@@ -28,7 +28,7 @@ exports.importDevcTransport = {
28
28
  trm_commons_1.Logger.log('Import DEVC Transport step', true);
29
29
  trm_commons_1.Logger.loading(`Getting ready to import...`);
30
30
  const rootDevclass = yield systemConnector_1.SystemConnector.getDevclass(context.runtime.originalData.hierarchy.devclass);
31
- trm_commons_1.Logger.loading(`Importing...`);
31
+ trm_commons_1.Logger.loading(`Importing ${context.rawInput.packageData.name}...`);
32
32
  const importTimeout = context.rawInput.installData.import.timeout;
33
33
  trm_commons_1.Logger.loading(`Uploading ${context.runtime.packageTransports.devc.binaries.trkorr}`, true);
34
34
  context.runtime.packageTransports.devc.instance = yield transport_1.Transport.upload({
@@ -32,7 +32,7 @@ exports.importLangTransport = {
32
32
  }),
33
33
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  trm_commons_1.Logger.log('Import LANG Transport step', true);
35
- trm_commons_1.Logger.loading(`Importing...`);
35
+ trm_commons_1.Logger.loading(`Importing ${context.rawInput.packageData.name} translations...`);
36
36
  const importTimeout = context.rawInput.installData.import.timeout;
37
37
  trm_commons_1.Logger.loading(`Uploading ${context.runtime.packageTransports.lang.binaries.trkorr}`, true);
38
38
  context.runtime.packageTransports.lang.instance = yield transport_1.Transport.upload({
@@ -22,7 +22,7 @@ exports.importTadirTransport = {
22
22
  name: 'import-tadir-transport',
23
23
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  trm_commons_1.Logger.log('Import TADIR Transport step', true);
25
- trm_commons_1.Logger.loading(`Importing...`);
25
+ trm_commons_1.Logger.loading(`Importing ${context.rawInput.packageData.name}...`);
26
26
  const importTimeout = context.rawInput.installData.import.timeout;
27
27
  trm_commons_1.Logger.loading(`Uploading ${context.runtime.packageTransports.tadir.binaries.trkorr}`, true);
28
28
  context.runtime.packageTransports.tadir.instance = yield transport_1.Transport.upload({
@@ -21,6 +21,13 @@ exports.init = {
21
21
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  trm_commons_1.Logger.log('Init step', true);
23
23
  const registry = context.rawInput.packageData.registry;
24
+ var actualRegistry;
25
+ var actualTrmPackage;
26
+ if (registry.getRegistryType() === registry_1.RegistryType.LOCAL) {
27
+ actualTrmPackage = (yield registry.getArtifact(null, null)).getManifest().getPackage();
28
+ actualRegistry = actualTrmPackage.registry;
29
+ context.rawInput.packageData.name = actualTrmPackage.packageName;
30
+ }
24
31
  context.rawInput.packageData.name = (0, commons_1.parsePackageName)({
25
32
  fullName: context.rawInput.packageData.name
26
33
  }).fullName;
@@ -49,12 +56,12 @@ exports.init = {
49
56
  trm_commons_1.Logger.info(`Ready to install "${trmManifest.name}" version ${sVersion} from registry "${registry.name}".`);
50
57
  }
51
58
  context.runtime = {
52
- registry,
59
+ registry: actualRegistry || registry,
53
60
  update: undefined,
54
61
  rollback: false,
55
62
  remotePackageData: {
56
63
  version: context.rawInput.packageData.version,
57
- trmPackage,
64
+ trmPackage: actualTrmPackage || trmPackage,
58
65
  trmManifest,
59
66
  manifest,
60
67
  artifact,
@@ -130,6 +137,16 @@ exports.init = {
130
137
  if (!context.rawInput.installData.skipPostActivities) {
131
138
  context.rawInput.installData.skipPostActivities = false;
132
139
  }
140
+ if (context.rawInput.installData.installDevclass.keepOriginal === undefined) {
141
+ if (!context.rawInput.contextData.noInquirer) {
142
+ context.rawInput.installData.installDevclass.keepOriginal = (yield trm_commons_1.Inquirer.prompt([{
143
+ name: 'keepOriginal',
144
+ message: `Keep original ABAP package(s)?`,
145
+ type: 'confirm',
146
+ default: context.rawInput.installData.installDevclass.keepOriginal ? true : false
147
+ }])).keepOriginal;
148
+ }
149
+ }
133
150
  trm_commons_1.Logger.loading(`Checking transport layer...`);
134
151
  if (!context.rawInput.installData.installDevclass.transportLayer) {
135
152
  try {
@@ -114,6 +114,7 @@ exports.installDependencies = {
114
114
  if (inputData.contextData) {
115
115
  inputData.contextData.noR3transInfo = true;
116
116
  }
117
+ delete inputData.installData.installDevclass.keepOriginal;
117
118
  trm_commons_1.Logger.log(`Ready to execute sub-workflow ${SUBWORKFLOW_NAME}, input data: ${(0, trm_commons_1.inspect)(inputData, { breakLength: Infinity, compact: true })}`, true);
118
119
  const result = yield (0, __1.installDependency)(inputData);
119
120
  trm_commons_1.Logger.log(`Workflow ${SUBWORKFLOW_NAME} result: ${(0, trm_commons_1.inspect)(result, { breakLength: Infinity, compact: true })}`, true);
@@ -45,30 +45,6 @@ exports.init = {
45
45
  if (!context.rawInput.installData.installDevclass) {
46
46
  context.rawInput.installData.installDevclass = {};
47
47
  }
48
- if (context.rawInput.contextData.noInquirer) {
49
- trm_commons_1.Logger.info(`Dependency "${context.rawInput.dependencyDataPackage.name}" will be installed with default options.`);
50
- }
51
- else {
52
- const inq = yield trm_commons_1.Inquirer.prompt([{
53
- name: 'noLang',
54
- message: `Dependency "${context.rawInput.dependencyDataPackage.name}": Import language transport (if exists)?`,
55
- type: 'confirm',
56
- default: !context.rawInput.installData.import.noLang
57
- }, {
58
- name: 'noCust',
59
- message: `Dependency "${context.rawInput.dependencyDataPackage.name}": Import customizing transport (if exists)?`,
60
- type: 'confirm',
61
- default: !context.rawInput.installData.import.noCust
62
- }, {
63
- name: 'keepOriginal',
64
- message: `Dependency "${context.rawInput.dependencyDataPackage.name}": Keep original ABAP package(s)?`,
65
- type: 'confirm',
66
- default: context.rawInput.installData.installDevclass.keepOriginal ? true : false
67
- }]);
68
- context.rawInput.installData.import.noLang = inq.noLang;
69
- context.rawInput.installData.import.noCust = inq.noCust;
70
- context.rawInput.installData.installDevclass.keepOriginal = inq.keepOriginal;
71
- }
72
48
  }),
73
49
  revert: (context) => __awaiter(void 0, void 0, void 0, function* () {
74
50
  trm_commons_1.Logger.log('Rollback init step', true);
@@ -95,41 +95,6 @@ exports.findDependencies = {
95
95
  }
96
96
  }
97
97
  });
98
- if (!context.rawInput.contextData.noInquirer) {
99
- const inq = yield trm_commons_1.Inquirer.prompt([{
100
- message: `Do you want to manually edit dependencies?`,
101
- type: 'confirm',
102
- name: 'editDependencies',
103
- default: false
104
- }, {
105
- message: 'Editor dependencies',
106
- type: 'editor',
107
- name: 'dependencies',
108
- postfix: '.json',
109
- when: (hash) => {
110
- return hash.editDependencies;
111
- },
112
- default: JSON.stringify(context.runtime.trmPackage.manifest.dependencies, null, 2),
113
- validate: (input) => {
114
- try {
115
- const parsedInput = JSON.parse(input);
116
- if (Array.isArray(parsedInput)) {
117
- return true;
118
- }
119
- else {
120
- return 'Invalid array';
121
- }
122
- }
123
- catch (e) {
124
- return 'Invalid JSON';
125
- }
126
- }
127
- }]);
128
- if (inq.dependencies) {
129
- trm_commons_1.Logger.log(`Dependencies were manually changed: before -> ${JSON.stringify(context.runtime.trmPackage.manifest.dependencies)}, after -> ${JSON.parse(inq.dependencies)}`, true);
130
- context.runtime.trmPackage.manifest.dependencies = JSON.parse(inq.dependencies);
131
- }
132
- }
133
98
  trm_commons_1.Logger.log(`Adding SAP objects dependencies to manifest`, true);
134
99
  trm_commons_1.Logger.loading(`Updating manifest...`);
135
100
  result.objectDependencies.sapObjects.forEach(o => {
@@ -146,40 +111,5 @@ exports.findDependencies = {
146
111
  }
147
112
  });
148
113
  });
149
- if (!context.rawInput.contextData.noInquirer) {
150
- const inq = yield trm_commons_1.Inquirer.prompt([{
151
- message: `Do you want to manually required SAP objects?`,
152
- type: 'confirm',
153
- name: 'editSapEntries',
154
- default: false
155
- }, {
156
- message: 'Edit SAP entries',
157
- type: 'editor',
158
- name: 'sapEntries',
159
- postfix: '.json',
160
- when: (hash) => {
161
- return hash.editSapEntries;
162
- },
163
- default: JSON.stringify(context.runtime.trmPackage.manifest.sapEntries, null, 2),
164
- validate: (input) => {
165
- try {
166
- const parsedInput = JSON.parse(input);
167
- if (typeof (parsedInput) === 'object' && !Array.isArray(parsedInput)) {
168
- return true;
169
- }
170
- else {
171
- return 'Invalid object';
172
- }
173
- }
174
- catch (e) {
175
- return 'Invalid JSON';
176
- }
177
- }
178
- }]);
179
- if (inq.sapEntries) {
180
- trm_commons_1.Logger.log(`SAP entries were manually changed: before -> ${JSON.stringify(context.runtime.trmPackage.manifest.sapEntries)}, after -> ${JSON.parse(inq.sapEntries)}`, true);
181
- context.runtime.trmPackage.manifest.sapEntries = JSON.parse(inq.sapEntries);
182
- }
183
- }
184
114
  })
185
115
  };
@@ -20,6 +20,8 @@ const chalk_1 = __importDefault(require("chalk"));
20
20
  const FileSystem_1 = require("../../registry/FileSystem");
21
21
  const validators_1 = require("../../validators");
22
22
  const lodash_1 = __importDefault(require("lodash"));
23
+ const systemConnector_1 = require("../../systemConnector");
24
+ const trmPackage_1 = require("../../trmPackage");
23
25
  exports.setManifestValues = {
24
26
  name: 'set-manifest-values',
25
27
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
@@ -85,6 +87,51 @@ exports.setManifestValues = {
85
87
  else {
86
88
  context.runtime.trmPackage.manifest.postActivities = context.runtime.trmPackage.latestReleaseManifest.postActivities;
87
89
  }
90
+ if (context.rawInput.publishData.noDependenciesDetection) {
91
+ var missingDependencies = [];
92
+ (context.runtime.trmPackage.latestReleaseManifest.dependencies || []).forEach(o => {
93
+ if (!(context.runtime.trmPackage.manifest.dependencies || []).find(k => {
94
+ return k.name === o.name && k.registry === o.registry;
95
+ })) {
96
+ missingDependencies.push(o);
97
+ }
98
+ });
99
+ if (missingDependencies.length > 0) {
100
+ if (!context.rawInput.contextData.noInquirer) {
101
+ const inq = yield trm_commons_1.Inquirer.prompt({
102
+ type: 'select',
103
+ message: `Dependency`,
104
+ name: 'dependencies',
105
+ choices: missingDependencies.map(o => {
106
+ var name;
107
+ if (o.registry) {
108
+ name = `${o.name} (${o.registry})`;
109
+ }
110
+ else {
111
+ name = o.name;
112
+ }
113
+ return {
114
+ name,
115
+ value: o
116
+ };
117
+ })
118
+ });
119
+ context.runtime.trmPackage.manifest.dependencies = (context.runtime.trmPackage.manifest.dependencies || []).concat((inq.dependencies || []));
120
+ }
121
+ else {
122
+ trm_commons_1.Logger.warning(`Latest version of the package had the following dependencies:`);
123
+ missingDependencies.forEach(o => {
124
+ if (o.registry) {
125
+ trm_commons_1.Logger.warning(` ${o.name} (${o.registry})`);
126
+ }
127
+ else {
128
+ trm_commons_1.Logger.warning(` ${o.name}`);
129
+ }
130
+ });
131
+ trm_commons_1.Logger.warning(`Include them manually later if still relveant.`);
132
+ }
133
+ }
134
+ }
88
135
  }
89
136
  }
90
137
  if (!context.rawInput.contextData.noInquirer) {
@@ -230,6 +277,19 @@ exports.setManifestValues = {
230
277
  context.runtime.trmPackage.manifest.registry = context.rawInput.packageData.registry.endpoint;
231
278
  }
232
279
  if (!context.rawInput.contextData.noInquirer) {
280
+ var inqDefault1 = context.runtime.trmPackage.manifest.postActivities || [];
281
+ if (inqDefault1.length === 0) {
282
+ inqDefault1.push({
283
+ name: '<<class name>>',
284
+ parameters: [{
285
+ name: '<<parameter1>>',
286
+ value: '<<value1>>'
287
+ }, {
288
+ name: '<<parameter2>>',
289
+ value: '<<value2>>'
290
+ }]
291
+ });
292
+ }
233
293
  const inq = yield trm_commons_1.Inquirer.prompt([{
234
294
  message: context.runtime.trmPackage.manifest.postActivities.length > 0 ? `Do you want to edit ${context.runtime.trmPackage.manifest.postActivities.length} post activities?` : `Do you want to add post activities?`,
235
295
  type: 'confirm',
@@ -243,7 +303,7 @@ exports.setManifestValues = {
243
303
  when: (hash) => {
244
304
  return hash.editPostActivities;
245
305
  },
246
- default: JSON.stringify(context.runtime.trmPackage.manifest.postActivities, null, 2),
306
+ default: JSON.stringify(inqDefault1, null, 2),
247
307
  validate: (input) => {
248
308
  try {
249
309
  const parsedInput = JSON.parse(input);
@@ -267,20 +327,122 @@ exports.setManifestValues = {
267
327
  if (Array.isArray(context.runtime.trmPackage.manifest.postActivities) && context.runtime.trmPackage.manifest.postActivities.length > 0) {
268
328
  var removedPostActivities = [];
269
329
  trm_commons_1.Logger.loading(`Checking post activities...`);
270
- for (const data of context.runtime.trmPackage.manifest.postActivities) {
330
+ for (var data of context.runtime.trmPackage.manifest.postActivities) {
271
331
  if (data.name) {
332
+ data.name = data.name.trim().toUpperCase();
272
333
  if (!removedPostActivities.find(c => c === data.name)) {
273
334
  if (!(yield manifest_1.PostActivity.exists(data.name))) {
274
- removedPostActivities.push(data.name.trim().toUpperCase());
335
+ removedPostActivities.push(data.name);
275
336
  }
276
337
  }
277
338
  }
339
+ if (Array.isArray(data.parameters)) {
340
+ data.parameters.forEach(p => {
341
+ if (p.name) {
342
+ p.name = p.name.trim().toUpperCase();
343
+ }
344
+ });
345
+ }
278
346
  }
279
347
  removedPostActivities.forEach(name => {
280
- trm_commons_1.Logger.error(`Class "${name.trim().toUpperCase()}" does not exist and will be removed from post activities list.`);
348
+ trm_commons_1.Logger.error(`Class "${name}" does not exist and will be removed from post activities list.`);
281
349
  context.runtime.trmPackage.manifest.postActivities = context.runtime.trmPackage.manifest.postActivities.filter(o => o.name !== name);
282
350
  });
283
351
  }
352
+ if (!context.rawInput.contextData.noInquirer) {
353
+ var inqDefault2 = context.runtime.trmPackage.manifest.dependencies || [];
354
+ if (inqDefault2.length === 0) {
355
+ inqDefault2.push({
356
+ name: '<<name>>',
357
+ version: '<<version>>',
358
+ registry: '<<registry?>>'
359
+ });
360
+ }
361
+ const inq = yield trm_commons_1.Inquirer.prompt([{
362
+ message: `Do you want to manually edit dependencies?`,
363
+ type: 'confirm',
364
+ name: 'editDependencies',
365
+ default: false
366
+ }, {
367
+ message: 'Editor dependencies',
368
+ type: 'editor',
369
+ name: 'dependencies',
370
+ postfix: '.json',
371
+ when: (hash) => {
372
+ return hash.editDependencies;
373
+ },
374
+ default: JSON.stringify(inqDefault2, null, 2),
375
+ validate: (input) => {
376
+ try {
377
+ const parsedInput = JSON.parse(input);
378
+ if (Array.isArray(parsedInput)) {
379
+ return true;
380
+ }
381
+ else {
382
+ return 'Invalid array';
383
+ }
384
+ }
385
+ catch (e) {
386
+ return 'Invalid JSON';
387
+ }
388
+ }
389
+ }]);
390
+ if (inq.dependencies) {
391
+ trm_commons_1.Logger.log(`Dependencies were manually changed: before -> ${JSON.stringify(context.runtime.trmPackage.manifest.dependencies)}, after -> ${JSON.parse(inq.dependencies)}`, true);
392
+ context.runtime.trmPackage.manifest.dependencies = JSON.parse(inq.dependencies);
393
+ }
394
+ }
395
+ if (!context.rawInput.contextData.noInquirer) {
396
+ var inqDefault3 = context.runtime.trmPackage.manifest.sapEntries || {};
397
+ if (Object.keys(inqDefault3).length === 0) {
398
+ inqDefault3['<<table>>'] = [{
399
+ '<<field1>>': '<<value1>>',
400
+ '<<field2>>': '<<value2>>'
401
+ }];
402
+ }
403
+ const inq = yield trm_commons_1.Inquirer.prompt([{
404
+ message: `Do you want to manually required SAP objects?`,
405
+ type: 'confirm',
406
+ name: 'editSapEntries',
407
+ default: false
408
+ }, {
409
+ message: 'Edit SAP entries',
410
+ type: 'editor',
411
+ name: 'sapEntries',
412
+ postfix: '.json',
413
+ when: (hash) => {
414
+ return hash.editSapEntries;
415
+ },
416
+ default: JSON.stringify(inqDefault3, null, 2),
417
+ validate: (input) => {
418
+ try {
419
+ const parsedInput = JSON.parse(input);
420
+ if (typeof (parsedInput) === 'object' && !Array.isArray(parsedInput)) {
421
+ return true;
422
+ }
423
+ else {
424
+ return 'Invalid object';
425
+ }
426
+ }
427
+ catch (e) {
428
+ return 'Invalid JSON';
429
+ }
430
+ }
431
+ }]);
432
+ if (inq.sapEntries) {
433
+ trm_commons_1.Logger.log(`SAP entries were manually changed: before -> ${JSON.stringify(context.runtime.trmPackage.manifest.sapEntries)}, after -> ${JSON.parse(inq.sapEntries)}`, true);
434
+ context.runtime.trmPackage.manifest.sapEntries = JSON.parse(inq.sapEntries);
435
+ }
436
+ }
437
+ trm_commons_1.Logger.loading(`Reading manifest...`);
438
+ for (var dependency of (context.runtime.trmPackage.manifest.dependencies || [])) {
439
+ if (!dependency.integrity) {
440
+ dependency.integrity = yield systemConnector_1.SystemConnector.getPackageIntegrity(new trmPackage_1.TrmPackage(dependency.name, registry_1.RegistryProvider.getRegistry(dependency.registry)));
441
+ if (!dependency.integrity) {
442
+ trm_commons_1.Logger.warning(`Dependency ${dependency.name} has no integrity match: registry might reject this!`);
443
+ }
444
+ }
445
+ }
284
446
  context.runtime.trmPackage.manifest = manifest_1.Manifest.normalize(context.runtime.trmPackage.manifest, false);
285
447
  })
286
448
  };
@@ -4,7 +4,8 @@ import { TrmPackage } from "../trmPackage";
4
4
  import { TrmManifestAuthor } from "./TrmManifestAuthor";
5
5
  export declare class Manifest {
6
6
  private _manifest;
7
- constructor(_manifest: TrmManifest);
7
+ private _filePath?;
8
+ constructor(_manifest: TrmManifest, _filePath?: string);
8
9
  get(keepRuntimeValues?: boolean): TrmManifest;
9
10
  getKey(keepVersion?: boolean): string;
10
11
  setDistFolder(dist: string): Manifest;
@@ -61,8 +61,9 @@ function getManifestAuthor(sAuthor) {
61
61
  return author;
62
62
  }
63
63
  class Manifest {
64
- constructor(_manifest) {
64
+ constructor(_manifest, _filePath) {
65
65
  this._manifest = _manifest;
66
+ this._filePath = _filePath;
66
67
  }
67
68
  get(keepRuntimeValues = false) {
68
69
  return Manifest.normalize(this._manifest, keepRuntimeValues);
@@ -326,7 +327,7 @@ class Manifest {
326
327
  }
327
328
  getPackage() {
328
329
  const manifest = this.get(true);
329
- const registry = registry_1.RegistryProvider.getRegistry(manifest.registry);
330
+ const registry = registry_1.RegistryProvider.getRegistry(manifest.registry, this._filePath);
330
331
  return new trmPackage_1.TrmPackage(manifest.name, registry, this);
331
332
  }
332
333
  static normalize(manifest, keepRuntimeValues) {
@@ -7,6 +7,7 @@ export declare class FileSystem implements AbstractRegistry {
7
7
  private _filePath?;
8
8
  endpoint: string;
9
9
  name: string;
10
+ private _artifact;
10
11
  constructor(_filePath?: string);
11
12
  compare(registry: AbstractRegistry): boolean;
12
13
  getRegistryType(): RegistryType;
@@ -125,7 +125,11 @@ class FileSystem {
125
125
  return __awaiter(this, arguments, void 0, function* (name, version = 'latest') {
126
126
  if (this._filePath) {
127
127
  try {
128
- return new trmPackage_1.TrmArtifact((0, fs_1.readFileSync)(this._filePath));
128
+ if (!this._artifact) {
129
+ this._artifact = new trmPackage_1.TrmArtifact((0, fs_1.readFileSync)(this._filePath));
130
+ this._artifact.setFilePath(this._filePath);
131
+ }
132
+ return this._artifact;
129
133
  }
130
134
  catch (e) {
131
135
  throw new Error(`File system couldn't read package`);
@@ -1,5 +1,5 @@
1
1
  import { AbstractRegistry } from "./AbstractRegistry";
2
2
  export declare namespace RegistryProvider {
3
3
  var registry: AbstractRegistry[];
4
- function getRegistry(endpoint?: string): AbstractRegistry;
4
+ function getRegistry(endpoint?: string, filePath?: string): AbstractRegistry;
5
5
  }
@@ -7,7 +7,7 @@ const RegistryType_1 = require("./RegistryType");
7
7
  var RegistryProvider;
8
8
  (function (RegistryProvider) {
9
9
  RegistryProvider.registry = [];
10
- function getRegistry(endpoint) {
10
+ function getRegistry(endpoint, filePath) {
11
11
  var foundRegistry;
12
12
  if (endpoint) {
13
13
  endpoint = endpoint.toLowerCase().trim();
@@ -20,7 +20,7 @@ var RegistryProvider;
20
20
  }
21
21
  }
22
22
  else if (endpoint === FileSystem_1.LOCAL_RESERVED_KEYWORD) {
23
- foundRegistry = new FileSystem_1.FileSystem();
23
+ foundRegistry = new FileSystem_1.FileSystem(filePath);
24
24
  }
25
25
  else {
26
26
  foundRegistry = RegistryProvider.registry.find(o => o.endpoint === endpoint);
@@ -137,10 +137,9 @@ class Transport {
137
137
  getDevclass(aTdevc) {
138
138
  return __awaiter(this, void 0, void 0, function* () {
139
139
  if (!this._rootDevclass) {
140
- var aDevclass = [];
140
+ const aE071 = yield this.getE071();
141
141
  if (!aTdevc) {
142
- const aE071 = yield this.getE071();
143
- aDevclass = aE071.filter(o => o.pgmid === 'R3TR' && o.object === 'DEVC').map(o => o.objName);
142
+ var aDevclass = aE071.filter(o => o.pgmid === 'R3TR' && o.object === 'DEVC').map(o => o.objName);
144
143
  if (!systemConnector_1.SystemConnector.getSupportedBulk().getTransportObjects) {
145
144
  for (const oE071 of aE071) {
146
145
  if (oE071.pgmid === 'R3TR') {
@@ -158,22 +157,16 @@ class Transport {
158
157
  }
159
158
  aTdevc = [];
160
159
  for (var devclass of aDevclass) {
161
- while (devclass) {
162
- var tdevc = aTdevc.find(o => o.devclass === devclass);
163
- if (!tdevc) {
164
- tdevc = yield systemConnector_1.SystemConnector.getDevclass(devclass);
165
- aTdevc.push(tdevc);
166
- }
167
- devclass = tdevc.parentcl;
160
+ var tdevc = aTdevc.find(o => o.devclass === devclass);
161
+ if (!tdevc) {
162
+ tdevc = yield systemConnector_1.SystemConnector.getDevclass(devclass);
163
+ aTdevc.push(tdevc);
168
164
  }
169
165
  }
170
166
  }
171
- else {
172
- aDevclass = aTdevc.map(o => o.devclass);
173
- }
174
167
  while (aTdevc.length > 0 && !this._rootDevclass) {
175
168
  const hierarchy = (0, commons_1.getPackageHierarchy)(aTdevc);
176
- if (aDevclass.includes(hierarchy.devclass)) {
169
+ if (aTdevc.find(o => o.devclass === hierarchy.devclass)) {
177
170
  this._rootDevclass = hierarchy.devclass;
178
171
  }
179
172
  else {
@@ -10,7 +10,9 @@ export declare class TrmArtifact {
10
10
  private _zip;
11
11
  private _binaries;
12
12
  private _content;
13
+ private _filePath;
13
14
  constructor(binary: Buffer, _distFolder?: string, _srcFolder?: string, _manifest?: Manifest);
15
+ setFilePath(filePath: string): void;
14
16
  getManifest(): Manifest | null;
15
17
  replaceManifest(oManifest: Manifest): void;
16
18
  getDistFolder(): string | null;
@@ -57,6 +57,9 @@ class TrmArtifact {
57
57
  this._manifest = _manifest;
58
58
  this._zip = new AdmZip.default(binary);
59
59
  }
60
+ setFilePath(filePath) {
61
+ this._filePath = filePath;
62
+ }
60
63
  getManifest() {
61
64
  if (this._manifest === undefined) {
62
65
  const zipEntries = this._zip.getEntries();
@@ -75,7 +78,7 @@ class TrmArtifact {
75
78
  jsonManifest.sapEntries = Object.assign(Object.assign({}, jsonManifest.sapEntries), sapEntries);
76
79
  }
77
80
  const trmManifest = manifest_1.Manifest.normalize(jsonManifest, false);
78
- this._manifest = new manifest_1.Manifest(trmManifest);
81
+ this._manifest = new manifest_1.Manifest(trmManifest, this._filePath);
79
82
  }
80
83
  }
81
84
  return this._manifest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-core",
3
- "version": "7.3.0",
3
+ "version": "7.4.1",
4
4
  "description": "TRM (Transport Request Manager) Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "license": "MIT",
37
37
  "trmDependencies": {
38
- "trm-server": "^4.0.0"
38
+ "trm-server": "^5.0.0"
39
39
  },
40
40
  "dependencies": {
41
41
  "@esm2cjs/normalize-url": "^8.0.0",
@@ -62,7 +62,7 @@
62
62
  "semver": "^7.5.4",
63
63
  "semver-sort": "^1.0.0",
64
64
  "spdx-license-ids": "^3.0.13",
65
- "trm-commons": "^1.0.0",
65
+ "trm-commons": "^2.0.0",
66
66
  "trm-registry-types": "^1.1.1",
67
67
  "uuid": "^9.0.1",
68
68
  "xml-beautify": "^1.2.3",