trm-core 9.3.0 → 9.4.0

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,14 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
- 2026-04-21 v9.2.0
11
+ 2026-04-29 v9.4.0
12
+ -------------------
13
+ ! trm-commons ^4.1.0
14
+ * upgrade of trm-server/trm-rest post /ATRM/ package replacements
15
+ ! usage of temporary packages instead of namespace
16
+ ! avoid usage of r3trans when entries are provided by registry
17
+
18
+ 2026-04-21 v9.3.0
12
19
  -------------------
13
20
  * avoid useless transport unpack for reading transport number
14
21
  ! usage with devc transport import when replacements are like original
@@ -8,12 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.checkAlreadyInstalled = void 0;
13
16
  const trm_commons_1 = require("trm-commons");
14
17
  const manifest_1 = require("../../manifest");
15
18
  const semver_1 = require("semver");
16
19
  const systemConnector_1 = require("../../systemConnector");
20
+ const chalk_1 = __importDefault(require("chalk"));
17
21
  exports.checkAlreadyInstalled = {
18
22
  name: 'check-already-installed',
19
23
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
@@ -36,10 +40,10 @@ exports.checkAlreadyInstalled = {
36
40
  }
37
41
  else {
38
42
  if ((0, semver_1.gt)(installVersion, installedVersion)) {
39
- trm_commons_1.Logger.info(`Upgrading ${installedVersion} -> ${installVersion}`);
43
+ trm_commons_1.Logger.info(`${chalk_1.default.bold('Upgrading')} ${installedVersion} -> ${installVersion}`);
40
44
  }
41
45
  else {
42
- trm_commons_1.Logger.warning(`Downgrading ${installedVersion} -> ${installVersion}`);
46
+ trm_commons_1.Logger.warning(`${chalk_1.default.bold('Downgrading')} ${installedVersion} -> ${installVersion}`);
43
47
  }
44
48
  }
45
49
  if (context.runtime.installData.upgradingPackage.isDirty()) {
@@ -15,7 +15,7 @@ const systemConnector_1 = require("../../systemConnector");
15
15
  exports.commit = {
16
16
  name: 'commit',
17
17
  filter: (context) => __awaiter(void 0, void 0, void 0, function* () {
18
- if (systemConnector_1.SystemConnector.isStateless()) {
18
+ if (!systemConnector_1.SystemConnector.isStateless()) {
19
19
  return true;
20
20
  }
21
21
  else {
@@ -14,13 +14,14 @@ const commons_1 = require("../../commons");
14
14
  const systemConnector_1 = require("../../systemConnector");
15
15
  const trm_commons_1 = require("trm-commons");
16
16
  const registry_1 = require("../../registry");
17
- function _validateDevclass(input, packagesNamespace) {
17
+ function _validateDevclass(input, namespaces) {
18
18
  const sInput = input.trim().toUpperCase();
19
+ namespaces = [...new Set(namespaces)];
19
20
  if (sInput.length > 30) {
20
21
  return `Package name must not exceede 30 characters limit.`;
21
22
  }
22
- if (!sInput.startsWith(packagesNamespace) && !sInput.startsWith('$')) {
23
- return `Package name must use namespace "${packagesNamespace}".`;
23
+ if (!namespaces.some(ns => sInput.startsWith(ns))) {
24
+ return `Package name must use one of the following namespaces: ${namespaces.join(', ')}.`;
24
25
  }
25
26
  else {
26
27
  return true;
@@ -56,14 +57,20 @@ exports.setInstallDevclass = {
56
57
  trm_commons_1.Logger.loading(`Analyzing packages...`);
57
58
  for (const t of context.runtime.packageTransportsData.tdevc) {
58
59
  var adaptDevclassName = t.devclass;
60
+ const replacement = context.rawInput.installData.installDevclass.replacements.find(o => o.originalDevclass === t.devclass);
59
61
  if (updateNamespace) {
60
- adaptDevclassName = adaptDevclassName.replace(new RegExp(`^${originalNamespace}`, 'gmi'), updateNamespace);
62
+ if (!replacement && updateNamespace === '$' && (context.runtime.remotePackageData.data.name === 'trm-server' || context.runtime.remotePackageData.data.name === 'trm-rest') && context.runtime.registry.getRegistryType() === registry_1.RegistryType.PUBLIC) {
63
+ adaptDevclassName = adaptDevclassName.replace(new RegExp(`^/ATRM/SERVER`, 'gmi'), '$TRM');
64
+ adaptDevclassName = adaptDevclassName.replace(new RegExp(`^/ATRM/REST`, 'gmi'), '$TRM_REST');
65
+ }
66
+ else {
67
+ adaptDevclassName = adaptDevclassName.replace(new RegExp(`^${originalNamespace}`, 'gmi'), updateNamespace);
68
+ }
61
69
  }
62
- const replacement = context.rawInput.installData.installDevclass.replacements.find(o => o.originalDevclass === t.devclass);
63
70
  const packageExists = yield systemConnector_1.SystemConnector.getDevclass(adaptDevclassName);
64
71
  if (!replacement) {
65
72
  if (context.rawInput.contextData.noInquirer) {
66
- const automaticValue = _validateDevclass(adaptDevclassName, updateNamespace || originalNamespace);
73
+ const automaticValue = _validateDevclass(adaptDevclassName, [updateNamespace || originalNamespace, '$', originalNamespace]);
67
74
  if (automaticValue === true) {
68
75
  context.rawInput.installData.installDevclass.replacements.push({
69
76
  originalDevclass: t.devclass,
@@ -81,13 +88,13 @@ exports.setInstallDevclass = {
81
88
  default: adaptDevclassName,
82
89
  message: packageExists ? `Rename ABAP Package "${adaptDevclassName}"?` : `ABAP Package "${adaptDevclassName}" will be generated. Do you want to rename it?`,
83
90
  validate: (input) => {
84
- return _validateDevclass(input, updateNamespace || originalNamespace);
91
+ return _validateDevclass(input, [updateNamespace || originalNamespace, '$', originalNamespace]);
85
92
  }
86
93
  });
87
94
  }
88
95
  }
89
96
  else {
90
- const devclassValid = _validateDevclass(replacement.installDevclass, updateNamespace || originalNamespace);
97
+ const devclassValid = _validateDevclass(replacement.installDevclass, [updateNamespace || originalNamespace, '$', originalNamespace]);
91
98
  if (devclassValid !== true) {
92
99
  throw new Error(devclassValid);
93
100
  }
@@ -103,6 +110,10 @@ exports.setInstallDevclass = {
103
110
  });
104
111
  });
105
112
  }
113
+ const hasTemp = context.rawInput.installData.installDevclass.replacements.some(x => x.installDevclass.startsWith('$'));
114
+ if (hasTemp && !context.rawInput.installData.installDevclass.replacements.every(x => x.installDevclass.startsWith('$'))) {
115
+ throw new Error(`All packages must start with prefix $ if one (or more) packages are temporary!`);
116
+ }
106
117
  trm_commons_1.Logger.loading(`Updating install data...`);
107
118
  var installDevc = [];
108
119
  var packageRegistry;
@@ -402,7 +402,7 @@ class RegistryV2 {
402
402
  const packageData = yield this.getPackage(fullName, version);
403
403
  const chunks = [];
404
404
  let buffer;
405
- const logProgress = trm_commons_1.Logger.progressbar(`${fullName} ${version} [{bar}] {percentage}% | {value}/{total} bytes`, '>');
405
+ const logProgress = trm_commons_1.Logger.progressbar(`↓ ${fullName} ${version} [{bar}] {percentage}% | {value}/{total} bytes`, '>');
406
406
  try {
407
407
  const response = yield this._axiosInstance.get(packageData.download_link, {
408
408
  headers: {
@@ -525,7 +525,7 @@ class RegistryV2 {
525
525
  return __awaiter(this, arguments, void 0, function* (fullName, version = 'latest') {
526
526
  var _a;
527
527
  const chunks = [];
528
- const logProgress = trm_commons_1.Logger.progressbar(`${fullName} ${version} contents [{bar}] {percentage}% | {value}/{total} bytes`, '>');
528
+ const logProgress = trm_commons_1.Logger.progressbar(`↓ ${fullName} ${version} contents [{bar}] {percentage}% | {value}/{total} bytes`, '>');
529
529
  try {
530
530
  const response = yield this._axiosInstance.get(`/package/contents/${fullName}`, {
531
531
  params: {
@@ -105,7 +105,10 @@ class TrmArtifact {
105
105
  const zipEntries = this._zip.getEntries();
106
106
  const aTransportEntries = zipEntries.filter(o => (new RegExp(`^${distFolder}(/|\\\\)`)).test(o.entryName.trim().toLowerCase()));
107
107
  var aResult = [];
108
- const r3trans = new node_r3trans_1.R3trans(r3transOption);
108
+ var r3trans;
109
+ if (!noCheck) {
110
+ r3trans = new node_r3trans_1.R3trans(r3transOption);
111
+ }
109
112
  for (const entry of aTransportEntries) {
110
113
  try {
111
114
  const type = entry.comment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-core",
3
- "version": "9.3.0",
3
+ "version": "9.4.0",
4
4
  "description": "TRM (Transport Request Manager) Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  "xml-js": "^1.6.11"
69
69
  },
70
70
  "peerDependencies": {
71
- "trm-commons": "^4.0.0"
71
+ "trm-commons": "^4.1.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/adm-zip": "^0.5.0",
@@ -84,7 +84,7 @@
84
84
  "@types/stack-trace": "^0.0.33",
85
85
  "@types/uuid": "^9.0.8",
86
86
  "rimraf": "^6.0.1",
87
- "trm-commons": "^4.0.0",
87
+ "trm-commons": "^4.1.0",
88
88
  "ts-node": "^10.9.2",
89
89
  "typescript": "^5.8.2"
90
90
  },