trm-client 4.7.0 → 4.9.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,6 +8,19 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
+ 2025-07-29 v4.9.0
12
+ -------------------
13
+
14
+ + handle registry unauthorized error
15
+ ! trm-core ^7.4.0
16
+ ! trm-commons ^1.1.0
17
+
18
+ 2025-06-04 v4.8.0
19
+ -------------------
20
+
21
+ ! trm-core ^7.2.1
22
+ ! overwrite flag in install/update ignores existing objects replace
23
+
11
24
  2025-06-03 v4.7.0
12
25
  -------------------
13
26
 
@@ -1,6 +1,7 @@
1
1
  import { AbstractRegistry, TrmPackage } from "trm-core";
2
2
  export declare namespace CommandContext {
3
3
  var registry: AbstractRegistry;
4
+ var hasRegistryAuthData: boolean;
4
5
  var trmDependencies: TrmPackage[];
5
6
  var missingTrmDependencies: (TrmPackage | string)[];
6
7
  function getRegistry(): AbstractRegistry;
@@ -16,6 +16,7 @@ var CommandContext;
16
16
  (function (CommandContext) {
17
17
  var _systemPackages = undefined;
18
18
  CommandContext.registry = undefined;
19
+ CommandContext.hasRegistryAuthData = false;
19
20
  CommandContext.trmDependencies = [];
20
21
  CommandContext.missingTrmDependencies = [];
21
22
  function getRegistry() {
@@ -55,7 +55,8 @@ function install(commandArgs) {
55
55
  safe: commandArgs.safe,
56
56
  noDependencies: commandArgs.noDependencies,
57
57
  noObjectTypes: commandArgs.noObjectTypes,
58
- noSapEntries: commandArgs.noSapEntries
58
+ noSapEntries: commandArgs.noSapEntries,
59
+ noExistingObjects: commandArgs.overwrite
59
60
  },
60
61
  import: {
61
62
  noLang: commandArgs.noLanguageTransport,
@@ -126,6 +126,7 @@ function executeCommand(args) {
126
126
  }
127
127
  }
128
128
  commons_1.CommandContext.registry = registry;
129
+ commons_1.CommandContext.hasRegistryAuthData = !!registryAlias.authData;
129
130
  trm_core_1.RegistryProvider.registry.push(registry);
130
131
  registryAlias_1.RegistryAlias.getAll().forEach(o => {
131
132
  var append = true;
@@ -17,6 +17,7 @@ const trm_core_1 = require("trm-core");
17
17
  const util_1 = require("util");
18
18
  const chalk_1 = __importDefault(require("chalk"));
19
19
  const trm_commons_1 = require("trm-commons");
20
+ const commons_1 = require("../commands/commons");
20
21
  const _getUnauthorizedError = () => {
21
22
  return `User "${trm_core_1.SystemConnector.getLogonUser()}" is not authorized to execute TRM RFC functions. Follow this guide https://docs.trmregistry.com/#/server/docs/setup?id=user-authorization-maintenance.`;
22
23
  };
@@ -43,6 +44,10 @@ function logError(err) {
43
44
  else if (originalException.name === 'TrmRegistryError') {
44
45
  if (originalException.status) {
45
46
  sError = `${chalk_1.default.black.bgRed(originalException.status)} ${sError}`;
47
+ if ((originalException.status === 401 || /whoami$/.test(originalException.axiosError.request.path)) && !commons_1.CommandContext.hasRegistryAuthData) {
48
+ aError.push(`${chalk_1.default.black.bgRed(originalException.status)} You are not logged in!`);
49
+ aError.push(`${chalk_1.default.black.bgRed(originalException.status)} Run command "trm login" and follow instructions.`);
50
+ }
46
51
  }
47
52
  }
48
53
  else if (originalException.name === 'TrmRFCClient') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-client",
3
- "version": "4.7.0",
3
+ "version": "4.9.0",
4
4
  "description": "TRM (Transport Request Manager) Client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,8 +44,8 @@
44
44
  "get-root-path": "^2.0.2",
45
45
  "ini": "^4.1.1",
46
46
  "semver": "^7.5.4",
47
- "trm-commons": "^1.0.0",
48
- "trm-core": "^7.0.0",
47
+ "trm-commons": "^1.1.0",
48
+ "trm-core": "^7.4.0",
49
49
  "trm-registry-types": "^1.2.0",
50
50
  "xml2js": "^0.6.2"
51
51
  },