trm-client 10.0.1 → 10.0.2

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,7 @@ 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
52
  private executePrepared;
50
53
  }
@@ -401,10 +401,10 @@ 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
+ yield this.executePrepared(false, options);
408
408
  });
409
409
  }
410
410
  execute(...args) {
@@ -415,8 +415,8 @@ class AbstractCommand {
415
415
  process.exit(exitCode);
416
416
  });
417
417
  }
418
- executePrepared(logErrors) {
419
- return __awaiter(this, void 0, void 0, function* () {
418
+ executePrepared(logErrors_1) {
419
+ return __awaiter(this, arguments, void 0, function* (logErrors, options = {}) {
420
420
  try {
421
421
  yield utils_1.GlobalContext.getInstance().load();
422
422
  yield Commons.Plugin.call("client", "loadCore", { core: Core });
@@ -432,7 +432,10 @@ class AbstractCommand {
432
432
  if (this.registerOpts.requiresRegistry) {
433
433
  var registryAlias;
434
434
  var registry;
435
- if (this.args.registry) {
435
+ if (options.registry) {
436
+ registry = options.registry;
437
+ }
438
+ else if (this.args.registry) {
436
439
  registryAlias = registryAlias_1.RegistryAlias.get(this.args.registry);
437
440
  }
438
441
  else if (this.args.registryEndpoint) {
@@ -441,7 +444,9 @@ class AbstractCommand {
441
444
  else {
442
445
  registryAlias = yield (0, prompts_1.pickRegistry)();
443
446
  }
444
- registry = registryAlias.getRegistry();
447
+ if (registryAlias) {
448
+ registry = registryAlias.getRegistry();
449
+ }
445
450
  try {
446
451
  Commons.Logger.loading(`Connecting to registry "${registry.name}" (${registry.endpoint})...`);
447
452
  const registryPing = yield registry.ping();
@@ -469,7 +474,7 @@ class AbstractCommand {
469
474
  }
470
475
  }
471
476
  this.registry = registry;
472
- this.registryAuthData = !!registryAlias.authData;
477
+ this.registryAuthData = !!(registryAlias === null || registryAlias === void 0 ? void 0 : registryAlias.authData);
473
478
  Core.RegistryProvider.registry.push(registry);
474
479
  }
475
480
  registryAlias_1.RegistryAlias.getAll().forEach(o => {
@@ -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.2",
4
4
  "description": "TRM (Transport Request Manager) Client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",