trm-client 10.0.1 → 10.0.3

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,10 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
+ 2026-07-06 v10.0.2
12
+ -------------------
13
+ + pass registry to programmatic command handler
14
+
11
15
  2026-07-06 v10.0.1
12
16
  -------------------
13
17
  + picker type in metadata
@@ -3,6 +3,9 @@ import { RegisterCommandOpts } from "./RegisterCommandOpts";
3
3
  import { CliVersionStatus } from "../utils";
4
4
  import * as Core from "trm-core";
5
5
  import { Package } from "trm-registry-types";
6
+ export interface AbstractCommandRunOptions {
7
+ registry?: Core.AbstractRegistry;
8
+ }
6
9
  export declare abstract class AbstractCommand {
7
10
  protected command: Command;
8
11
  protected registerOpts: RegisterCommandOpts;
@@ -44,7 +47,6 @@ export declare abstract class AbstractCommand {
44
47
  parseJsonArg(name: string): any;
45
48
  parseArrayArg(name: string): string[];
46
49
  parseNumberArg(name: string): number;
47
- run(args?: any): Promise<void>;
50
+ run(args?: any, options?: AbstractCommandRunOptions): Promise<void>;
48
51
  private execute;
49
- private executePrepared;
50
52
  }
@@ -401,22 +401,24 @@ class AbstractCommand {
401
401
  }
402
402
  }
403
403
  run() {
404
- return __awaiter(this, arguments, void 0, function* (args = {}) {
404
+ return __awaiter(this, arguments, void 0, function* (args = {}, options = {}) {
405
405
  this.args = this.normalizeArgs(args);
406
406
  this.onArgs();
407
- yield this.executePrepared(false);
407
+ this.registry = options.registry;
408
+ try {
409
+ yield this.handler();
410
+ }
411
+ catch (e) {
412
+ yield (0, utils_1.logError)(e);
413
+ throw new Error("Action failed.");
414
+ }
408
415
  });
409
416
  }
410
417
  execute(...args) {
411
418
  return __awaiter(this, void 0, void 0, function* () {
419
+ var exitCode = 0;
412
420
  this.args = this.parseCommandArgs(args);
413
421
  this.onArgs();
414
- const exitCode = yield this.executePrepared(true);
415
- process.exit(exitCode);
416
- });
417
- }
418
- executePrepared(logErrors) {
419
- return __awaiter(this, void 0, void 0, function* () {
420
422
  try {
421
423
  yield utils_1.GlobalContext.getInstance().load();
422
424
  yield Commons.Plugin.call("client", "loadCore", { core: Core });
@@ -441,7 +443,9 @@ class AbstractCommand {
441
443
  else {
442
444
  registryAlias = yield (0, prompts_1.pickRegistry)();
443
445
  }
444
- registry = registryAlias.getRegistry();
446
+ if (registryAlias) {
447
+ registry = registryAlias.getRegistry();
448
+ }
445
449
  try {
446
450
  Commons.Logger.loading(`Connecting to registry "${registry.name}" (${registry.endpoint})...`);
447
451
  const registryPing = yield registry.ping();
@@ -469,7 +473,7 @@ class AbstractCommand {
469
473
  }
470
474
  }
471
475
  this.registry = registry;
472
- this.registryAuthData = !!registryAlias.authData;
476
+ this.registryAuthData = !!(registryAlias === null || registryAlias === void 0 ? void 0 : registryAlias.authData);
473
477
  Core.RegistryProvider.registry.push(registry);
474
478
  }
475
479
  registryAlias_1.RegistryAlias.getAll().forEach(o => {
@@ -503,14 +507,10 @@ class AbstractCommand {
503
507
  if (Commons.Logger.logger instanceof Commons.CliLogger || Commons.Logger.logger instanceof Commons.CliLogFileLogger) {
504
508
  Commons.Logger.logger.forceStop();
505
509
  }
506
- return 0;
507
510
  }
508
511
  catch (e) {
509
- if (logErrors) {
510
- yield (0, utils_1.logError)(e);
511
- return 1;
512
- }
513
- throw e;
512
+ yield (0, utils_1.logError)(e);
513
+ exitCode = 1;
514
514
  }
515
515
  finally {
516
516
  if (Core.SystemConnector.systemConnector) {
@@ -527,6 +527,7 @@ class AbstractCommand {
527
527
  const logFilePath = Commons.Logger.logger.getFilePath();
528
528
  Commons.Logger.info(`Saved log output "${logFilePath}" for session ID ${sessionId}.`);
529
529
  }
530
+ process.exit(exitCode);
530
531
  }
531
532
  });
532
533
  }
@@ -179,13 +179,13 @@ class Install extends AbstractCommand_1.AbstractCommand {
179
179
  exports.Install = Install;
180
180
  Install.installOptions = [
181
181
  (0, helpers_1.option)("-T, --transport-layer <transport layer>", { name: "transportLayer", label: "Transport layer", description: "Transport layer for imported package objects. Defaults to the system transport layer.", control: "transport-layer-picker" }),
182
- (0, helpers_1.option)("--no-deps", { name: "deps", label: "Dependencies", description: "Skip dependency installation.", control: "checkbox", defaultValue: true, negated: true }),
183
- (0, helpers_1.option)("--no-obj-type", { name: "objType", label: "Object type checks", description: "Skip object type checks before import.", control: "checkbox", defaultValue: true, negated: true }),
184
- (0, helpers_1.option)("--no-obj-check", { name: "objCheck", label: "Object existence checks", description: "Skip object existence checks before import.", control: "checkbox", defaultValue: true, negated: true }),
185
- (0, helpers_1.option)("--no-sap-entries", { name: "sapEntries", label: "SAP entries", description: "Skip SAP entry checks before import.", control: "checkbox", defaultValue: true, negated: true }),
186
- (0, helpers_1.option)("--no-lang-tr", { name: "langTr", label: "Language transport", description: "Skip language transport import.", control: "checkbox", defaultValue: true, negated: true }),
187
- (0, helpers_1.option)("--no-cust-tr", { name: "custTr", label: "Customizing transports", description: "Skip customizing transport import.", control: "checkbox", defaultValue: true, negated: true }),
188
- (0, helpers_1.option)("--no-install-tr", { name: "installTr", label: "Install transport", description: "Do not create an install transport.", control: "checkbox", defaultValue: true, negated: true }),
182
+ (0, helpers_1.option)("--no-deps", { name: "deps", label: "Ignore dependencies", description: "Skip dependency installation.", control: "checkbox", defaultValue: true, negated: true }),
183
+ (0, helpers_1.option)("--no-obj-type", { name: "objType", label: "Avoid object type checks", description: "Skip object type checks before import.", control: "checkbox", defaultValue: true, negated: true }),
184
+ (0, helpers_1.option)("--no-obj-check", { name: "objCheck", label: "Avoid object existence checks", description: "Skip object existence checks before import.", control: "checkbox", defaultValue: true, negated: true }),
185
+ (0, helpers_1.option)("--no-sap-entries", { name: "sapEntries", label: "Avoid SAP entries", description: "Skip SAP entry checks before import.", control: "checkbox", defaultValue: true, negated: true }),
186
+ (0, helpers_1.option)("--no-lang-tr", { name: "langTr", label: "No language transport", description: "Skip language transport import.", control: "checkbox", defaultValue: true, negated: true }),
187
+ (0, helpers_1.option)("--no-cust-tr", { name: "custTr", label: "No customizing transports", description: "Skip customizing transports import.", control: "checkbox", defaultValue: true, negated: true }),
188
+ (0, helpers_1.option)("--no-install-tr", { name: "installTr", label: "No install transport generation", description: "Do not create an install transport.", control: "checkbox", defaultValue: true, negated: true }),
189
189
  (0, helpers_1.option)("--namespace", { name: "namespace", label: "Customer namespace", description: "Import the customer namespace.", control: "checkbox" }),
190
190
  (0, helpers_1.option)("--package-replacements <replacements>", { name: "packageReplacements", label: "Package replacements", description: "SAP package replacements as JSON, or a path to a JSON file.", control: "textarea" }),
191
191
  (0, helpers_1.option)("--install-tr-target <target>", { name: "installTrTarget", label: "Install transport target", description: "Target system for the install transport.", control: "transport-target-picker" }),
@@ -118,10 +118,10 @@ exports.Publish = Publish;
118
118
  Publish.releaseOptions = [
119
119
  (0, helpers_1.option)("-P, --sap-package <sap package>", { name: "sapPackage", label: "SAP package", description: "SAP package that owns the release objects.", control: "sap-package-picker" }),
120
120
  (0, helpers_1.option)("-T, --target <target>", { name: "target", label: "Transport target", description: "Target system for release transports.", control: "transport-target-picker" }),
121
- (0, helpers_1.option)("--no-lang-tr", { name: "langTr", label: "Language transport", description: "Skip language transport generation.", control: "checkbox", defaultValue: true, negated: true }),
122
- (0, helpers_1.option)("--no-cust-tr", { name: "custTr", label: "Customizing transport", description: "Skip customizing transport generation.", control: "checkbox", defaultValue: true, negated: true }),
121
+ (0, helpers_1.option)("--no-lang-tr", { name: "langTr", label: "No language transport", description: "Skip language transport generation.", control: "checkbox", defaultValue: true, negated: true }),
122
+ (0, helpers_1.option)("--no-cust-tr", { name: "custTr", label: "No customizing transport", description: "Skip customizing transports generation.", control: "checkbox", defaultValue: true, negated: true }),
123
123
  (0, helpers_1.option)("--cust <customizing>", { name: "cust", label: "Customizing transports", description: "Customizing transport requests, separated by commas.", multiple: true }),
124
- (0, helpers_1.option)("--no-auto-deps", { name: "autoDeps", label: "Automatic dependencies", description: "Skip automatic dependency detection.", control: "checkbox", defaultValue: true, negated: true }),
124
+ (0, helpers_1.option)("--no-auto-deps", { name: "autoDeps", label: "No automatic dependencies", description: "Skip automatic dependency detection.", control: "checkbox", defaultValue: true, negated: true }),
125
125
  (0, helpers_1.option)("--authors <authors>", { name: "authors", label: "Authors", description: "Release authors, separated by commas.", multiple: true }),
126
126
  (0, helpers_1.option)("--backwards-compatible", { name: "backwardsCompatible", label: "Backwards compatible", description: "Mark the release as backwards compatible.", control: "checkbox" }),
127
127
  (0, helpers_1.option)("--description <description>", { name: "description", label: "Description", description: "Release description." }),
@@ -1,2 +1,6 @@
1
+ import type * as Core from "trm-core";
1
2
  export type CommandHandlerValues = Record<string, unknown>;
2
- export declare function runCommandHandler(id: string, values?: CommandHandlerValues): Promise<void>;
3
+ export interface CommandHandlerOptions {
4
+ registry?: Core.AbstractRegistry;
5
+ }
6
+ export declare function runCommandHandler(id: string, values?: CommandHandlerValues, options?: CommandHandlerOptions): Promise<void>;
@@ -12,13 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.runCommandHandler = runCommandHandler;
13
13
  const implementations_1 = require("./implementations");
14
14
  function runCommandHandler(id_1) {
15
- return __awaiter(this, arguments, void 0, function* (id, values = {}) {
15
+ return __awaiter(this, arguments, void 0, function* (id, values = {}, options = {}) {
16
16
  const commandClass = (0, implementations_1.getCommand)(id);
17
17
  const metadata = (0, implementations_1.getCommandMetadata)(id);
18
18
  if (!commandClass || !metadata) {
19
19
  throw new Error(`Unknown command metadata id "${id}".`);
20
20
  }
21
21
  const command = new commandClass(metadata.command, metadata.aliases, metadata.subcommand);
22
- yield command.run(values);
22
+ yield command.run(values, options);
23
23
  });
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-client",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
4
4
  "description": "TRM (Transport Request Manager) Client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",