@copado/agentia-cli 0.56.0-alpha.0 → 0.58.0-alpha.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.
Files changed (142) hide show
  1. package/README.md +1180 -117
  2. package/dist/commands/cicd/data/commit/create.d.ts +11 -0
  3. package/dist/commands/cicd/data/commit/create.js +41 -0
  4. package/dist/commands/cicd/data/commit/create.js.map +1 -0
  5. package/dist/commands/cicd/data/commit/list.d.ts +10 -0
  6. package/dist/commands/cicd/data/commit/list.js +42 -0
  7. package/dist/commands/cicd/data/commit/list.js.map +1 -0
  8. package/dist/commands/cicd/data/dataset-file/content.d.ts +10 -0
  9. package/dist/commands/cicd/data/dataset-file/content.js +53 -0
  10. package/dist/commands/cicd/data/dataset-file/content.js.map +1 -0
  11. package/dist/commands/cicd/data/dataset-file/list.d.ts +10 -0
  12. package/dist/commands/cicd/data/dataset-file/list.js +42 -0
  13. package/dist/commands/cicd/data/dataset-file/list.js.map +1 -0
  14. package/dist/commands/cicd/data/filter/add.d.ts +13 -0
  15. package/dist/commands/cicd/data/filter/add.js +42 -0
  16. package/dist/commands/cicd/data/filter/add.js.map +1 -0
  17. package/dist/commands/cicd/data/filter/delete.d.ts +10 -0
  18. package/dist/commands/cicd/data/filter/delete.js +33 -0
  19. package/dist/commands/cicd/data/filter/delete.js.map +1 -0
  20. package/dist/commands/cicd/data/filter/list.d.ts +10 -0
  21. package/dist/commands/cicd/data/filter/list.js +42 -0
  22. package/dist/commands/cicd/data/filter/list.js.map +1 -0
  23. package/dist/commands/cicd/data/filter/update.d.ts +14 -0
  24. package/dist/commands/cicd/data/filter/update.js +46 -0
  25. package/dist/commands/cicd/data/filter/update.js.map +1 -0
  26. package/dist/commands/cicd/data/formula/create.d.ts +16 -0
  27. package/dist/commands/cicd/data/formula/create.js +62 -0
  28. package/dist/commands/cicd/data/formula/create.js.map +1 -0
  29. package/dist/commands/cicd/data/formula/list.d.ts +10 -0
  30. package/dist/commands/cicd/data/formula/list.js +42 -0
  31. package/dist/commands/cicd/data/formula/list.js.map +1 -0
  32. package/dist/commands/cicd/data/formula/update.d.ts +18 -0
  33. package/dist/commands/cicd/data/formula/update.js +78 -0
  34. package/dist/commands/cicd/data/formula/update.js.map +1 -0
  35. package/dist/commands/cicd/data/records/match.d.ts +11 -0
  36. package/dist/commands/cicd/data/records/match.js +39 -0
  37. package/dist/commands/cicd/data/records/match.js.map +1 -0
  38. package/dist/commands/cicd/data/records/search.d.ts +14 -0
  39. package/dist/commands/cicd/data/records/search.js +65 -0
  40. package/dist/commands/cicd/data/records/search.js.map +1 -0
  41. package/dist/commands/cicd/data/sobject/fields.d.ts +13 -0
  42. package/dist/commands/cicd/data/sobject/fields.js +56 -0
  43. package/dist/commands/cicd/data/sobject/fields.js.map +1 -0
  44. package/dist/commands/cicd/data/sobject/relationships.d.ts +13 -0
  45. package/dist/commands/cicd/data/sobject/relationships.js +66 -0
  46. package/dist/commands/cicd/data/sobject/relationships.js.map +1 -0
  47. package/dist/commands/cicd/data/sync/apply.d.ts +11 -0
  48. package/dist/commands/cicd/data/sync/apply.js +40 -0
  49. package/dist/commands/cicd/data/sync/apply.js.map +1 -0
  50. package/dist/commands/cicd/data/sync/preview-updates.d.ts +11 -0
  51. package/dist/commands/cicd/data/sync/preview-updates.js +58 -0
  52. package/dist/commands/cicd/data/sync/preview-updates.js.map +1 -0
  53. package/dist/commands/cicd/data/template/convert-old.d.ts +9 -0
  54. package/dist/commands/cicd/data/template/convert-old.js +29 -0
  55. package/dist/commands/cicd/data/template/convert-old.js.map +1 -0
  56. package/dist/commands/cicd/data/template/create.d.ts +13 -0
  57. package/dist/commands/cicd/data/template/create.js +56 -0
  58. package/dist/commands/cicd/data/template/create.js.map +1 -0
  59. package/dist/commands/cicd/data/template/delete.d.ts +9 -0
  60. package/dist/commands/cicd/data/template/delete.js +29 -0
  61. package/dist/commands/cicd/data/template/delete.js.map +1 -0
  62. package/dist/commands/cicd/data/template/get-detail.d.ts +10 -0
  63. package/dist/commands/cicd/data/template/get-detail.js +29 -0
  64. package/dist/commands/cicd/data/template/get-detail.js.map +1 -0
  65. package/dist/commands/cicd/data/template/get.d.ts +10 -0
  66. package/dist/commands/cicd/data/template/get.js +29 -0
  67. package/dist/commands/cicd/data/template/get.js.map +1 -0
  68. package/dist/commands/cicd/data/template/list.d.ts +11 -0
  69. package/dist/commands/cicd/data/template/list.js +44 -0
  70. package/dist/commands/cicd/data/template/list.js.map +1 -0
  71. package/dist/commands/cicd/data/template/save-detail.d.ts +13 -0
  72. package/dist/commands/cicd/data/template/save-detail.js +42 -0
  73. package/dist/commands/cicd/data/template/save-detail.js.map +1 -0
  74. package/dist/commands/cicd/function/defaults.d.ts +12 -0
  75. package/dist/commands/cicd/function/defaults.js +31 -0
  76. package/dist/commands/cicd/function/defaults.js.map +1 -0
  77. package/dist/commands/cicd/function/delete.d.ts +11 -0
  78. package/dist/commands/cicd/function/delete.js +29 -0
  79. package/dist/commands/cicd/function/delete.js.map +1 -0
  80. package/dist/commands/cicd/function/get.d.ts +10 -0
  81. package/dist/commands/cicd/function/get.js +30 -0
  82. package/dist/commands/cicd/function/get.js.map +1 -0
  83. package/dist/commands/cicd/function/list.d.ts +10 -0
  84. package/dist/commands/cicd/function/list.js +36 -0
  85. package/dist/commands/cicd/function/list.js.map +1 -0
  86. package/dist/commands/cicd/function/result/get.d.ts +10 -0
  87. package/dist/commands/cicd/function/result/get.js +30 -0
  88. package/dist/commands/cicd/function/result/get.js.map +1 -0
  89. package/dist/commands/cicd/function/result/log/get.d.ts +17 -0
  90. package/dist/commands/cicd/function/result/log/get.js +41 -0
  91. package/dist/commands/cicd/function/result/log/get.js.map +1 -0
  92. package/dist/commands/cicd/function/run-local.d.ts +17 -0
  93. package/dist/commands/cicd/function/run-local.js +64 -0
  94. package/dist/commands/cicd/function/run-local.js.map +1 -0
  95. package/dist/commands/cicd/function/run.d.ts +16 -0
  96. package/dist/commands/cicd/function/run.js +42 -0
  97. package/dist/commands/cicd/function/run.js.map +1 -0
  98. package/dist/commands/cicd/function/upsert.d.ts +27 -0
  99. package/dist/commands/cicd/function/upsert.js +45 -0
  100. package/dist/commands/cicd/function/upsert.js.map +1 -0
  101. package/dist/commands/cicd/promotion/run.d.ts +23 -0
  102. package/dist/commands/cicd/promotion/run.js +137 -0
  103. package/dist/commands/cicd/promotion/run.js.map +1 -0
  104. package/dist/commands/cicd/work/promote.d.ts +25 -0
  105. package/dist/commands/cicd/work/promote.js +141 -0
  106. package/dist/commands/cicd/work/promote.js.map +1 -0
  107. package/dist/lib/cicd-gateway.js +3 -2
  108. package/dist/lib/cicd-gateway.js.map +1 -1
  109. package/dist/lib/data-flags.d.ts +14 -0
  110. package/dist/lib/data-flags.js +61 -0
  111. package/dist/lib/data-flags.js.map +1 -0
  112. package/dist/lib/data-types.d.ts +322 -0
  113. package/dist/lib/data-types.js +176 -0
  114. package/dist/lib/data-types.js.map +1 -0
  115. package/dist/lib/function-flags.d.ts +69 -0
  116. package/dist/lib/function-flags.js +199 -0
  117. package/dist/lib/function-flags.js.map +1 -0
  118. package/dist/lib/function-local-run.d.ts +64 -0
  119. package/dist/lib/function-local-run.js +148 -0
  120. package/dist/lib/function-local-run.js.map +1 -0
  121. package/dist/lib/function-types.d.ts +106 -0
  122. package/dist/lib/function-types.js +171 -0
  123. package/dist/lib/function-types.js.map +1 -0
  124. package/dist/lib/mcp/data-tools.d.ts +159 -0
  125. package/dist/lib/mcp/data-tools.js +547 -0
  126. package/dist/lib/mcp/data-tools.js.map +1 -0
  127. package/dist/lib/mcp/tools.d.ts +231 -0
  128. package/dist/lib/mcp/tools.js +288 -0
  129. package/dist/lib/mcp/tools.js.map +1 -1
  130. package/dist/lib/mcp/work-tools.d.ts +29 -0
  131. package/dist/lib/mcp/work-tools.js +62 -0
  132. package/dist/lib/mcp/work-tools.js.map +1 -1
  133. package/dist/lib/promotion-run.d.ts +105 -0
  134. package/dist/lib/promotion-run.js +481 -0
  135. package/dist/lib/promotion-run.js.map +1 -0
  136. package/dist/lib/salesforce-id.d.ts +9 -0
  137. package/dist/lib/salesforce-id.js +30 -0
  138. package/dist/lib/salesforce-id.js.map +1 -1
  139. package/dist/lib/sf-org-context.js +5 -5
  140. package/dist/lib/sf-org-context.js.map +1 -1
  141. package/oclif.manifest.json +4818 -2752
  142. package/package.json +28 -1
@@ -0,0 +1,41 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../../lib/cicd-gateway.js';
4
+ import { functionResultLogEndpoint } from '../../../../../lib/function-types.js';
5
+ export default class FunctionResultLogGet extends AgentiaCommand {
6
+ static args = {
7
+ 'result-id': Args.string({
8
+ description: 'Function result Id',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Get log output for a Copado Function result';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> <result-id>',
15
+ '<%= config.bin %> <%= command.id %> <result-id> --type stdout',
16
+ '<%= config.bin %> <%= command.id %> <result-id> --json',
17
+ ];
18
+ static flags = {
19
+ type: Flags.string({
20
+ description: 'Optional log file type filter',
21
+ }),
22
+ };
23
+ async run() {
24
+ const { args, flags } = await this.parse(FunctionResultLogGet);
25
+ const log = await this.withSpinner('Fetching function result log', () => CicdGateway.call({
26
+ endpoint: functionResultLogEndpoint(args['result-id'], flags.type),
27
+ method: 'GET',
28
+ responseType: 'text',
29
+ }));
30
+ const result = {
31
+ log,
32
+ resultId: args['result-id'],
33
+ ...(flags.type === undefined ? {} : { type: flags.type }),
34
+ };
35
+ this.display(() => {
36
+ process.stdout.write(log);
37
+ });
38
+ return result;
39
+ }
40
+ }
41
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../../src/commands/cicd/function/result/log/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO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AAC,OAAO,CAAC,GAAG,EAAE;YAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type LocalFunctionRunResult } from '../../../lib/function-local-run.js';
3
+ export default class FunctionRunLocal extends AgentiaCommand {
4
+ static args: {
5
+ script: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ cwd: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ image: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ parameter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ platform: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ runtime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ };
16
+ run(): Promise<LocalFunctionRunResult>;
17
+ }
@@ -0,0 +1,64 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { DEFAULT_FUNCTION_LOCAL_IMAGE, executeLocalFunctionRun, formatLocalFunctionRunResult, } from '../../../lib/function-local-run.js';
4
+ import { FUNCTION_RUNTIMES } from '../../../lib/function-types.js';
5
+ export default class FunctionRunLocal extends AgentiaCommand {
6
+ static args = {
7
+ script: Args.string({
8
+ description: 'Path to the local function script (.sh, .js, or .py)',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Run a Copado Function script locally in Docker (no CICD gateway). Override --image when the Copado registry is unavailable.';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> copado/functions/myFunction.sh',
15
+ '<%= config.bin %> <%= command.id %> ./myFunction.js --cwd . --image my-registry/function-core:v1 --parameter ENV=dev --json',
16
+ '<%= config.bin %> <%= command.id %> ./myFunction.py --runtime python --platform linux/amd64',
17
+ ];
18
+ static flags = {
19
+ cwd: Flags.string({
20
+ description: 'Host directory bind-mounted at /app inside the container (defaults to the current working directory)',
21
+ }),
22
+ image: Flags.string({
23
+ char: 'i',
24
+ default: DEFAULT_FUNCTION_LOCAL_IMAGE,
25
+ description: 'Docker image used to run the function. Override when the Copado image registry is unavailable (e.g. for partners).',
26
+ }),
27
+ parameter: Flags.string({
28
+ description: 'Environment variable for the script as key=value (repeatable)',
29
+ multiple: true,
30
+ }),
31
+ platform: Flags.string({
32
+ description: 'Docker --platform value (e.g. linux/amd64 on Apple Silicon)',
33
+ }),
34
+ runtime: Flags.string({
35
+ description: 'Override runtime detection from the script extension',
36
+ options: [...FUNCTION_RUNTIMES],
37
+ }),
38
+ };
39
+ async run() {
40
+ const { args, flags } = await this.parse(FunctionRunLocal);
41
+ let result;
42
+ try {
43
+ result = await this.withSpinner('Running function locally in Docker', () => executeLocalFunctionRun({
44
+ cwd: flags.cwd,
45
+ image: flags.image,
46
+ parameter: flags.parameter,
47
+ platform: flags.platform,
48
+ runtime: flags.runtime,
49
+ script: args.script,
50
+ }));
51
+ }
52
+ catch (error) {
53
+ this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
54
+ }
55
+ this.display(() => {
56
+ this.log(formatLocalFunctionRunResult(result));
57
+ });
58
+ if (!this.jsonEnabled() && (result.exitCode ?? 1) !== 0) {
59
+ this.exit(result.exitCode ?? 1);
60
+ }
61
+ return result;
62
+ }
63
+ }
64
+ //# sourceMappingURL=run-local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-local.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/run-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OA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AC;YACH,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oCAAoC,EAAE,GAAG,EAAE,CACzE,uBAAuB,CAAC;gBACtB,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CACH,CAAA;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAC/E,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAA;QACjC,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type FunctionRunResult } from '../../../lib/function-types.js';
3
+ export default class FunctionRun extends AgentiaCommand {
4
+ static args: {
5
+ 'api-name': import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly 'context-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly 'deploy-first': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ readonly parameter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ readonly 'show-validation-errors': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<FunctionRunResult>;
16
+ }
@@ -0,0 +1,42 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { buildFunctionRunPayload, functionRunFlags } from '../../../lib/function-flags.js';
5
+ import { formatFunctionRunResult, functionRunEndpoint, normalizeFunctionRunResult, } from '../../../lib/function-types.js';
6
+ export default class FunctionRun extends AgentiaCommand {
7
+ static args = {
8
+ 'api-name': Args.string({
9
+ description: 'Function API name',
10
+ required: true,
11
+ }),
12
+ };
13
+ static description = 'Run a Copado Function and return the result Id';
14
+ static examples = [
15
+ '<%= config.bin %> <%= command.id %> myFunction',
16
+ '<%= config.bin %> <%= command.id %> myFunction --parameter env=dev --json',
17
+ '<%= config.bin %> <%= command.id %> myFunction --context-id a00... --deploy-first --json',
18
+ ];
19
+ static flags = functionRunFlags;
20
+ async run() {
21
+ const { args, flags } = await this.parse(FunctionRun);
22
+ const built = buildFunctionRunPayload(flags);
23
+ if (built.error !== undefined) {
24
+ this.error(built.error, { exit: 2 });
25
+ }
26
+ const response = await this.withSpinner('Running function', () => CicdGateway.call({
27
+ body: built.payload,
28
+ endpoint: functionRunEndpoint(args['api-name']),
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ },
32
+ method: 'POST',
33
+ }));
34
+ const result = normalizeFunctionRunResult(response);
35
+ this.display(() => {
36
+ this.log('Function run started');
37
+ this.log(formatFunctionRunResult(result));
38
+ });
39
+ return result;
40
+ }
41
+ }
42
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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QAAQ,EAAE,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/C,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,MAAM;SACf,CAAC,CACH,CAAA;QACD,MAAM,MAAM,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAA;QAEnD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;YAChC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type CopadoFunction } from '../../../lib/function-types.js';
3
+ export default class FunctionUpsert extends AgentiaCommand {
4
+ static args: {
5
+ 'api-name': import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly 'apex-class': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly callback: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ readonly description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ readonly file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ readonly 'flow-handler': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ readonly 'image-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ readonly 'parameters-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ readonly runtime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ readonly script: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ readonly 'script-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ readonly size: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ readonly timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ readonly type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ readonly version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ };
26
+ run(): Promise<CopadoFunction>;
27
+ }
@@ -0,0 +1,45 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { buildFunctionUpsertPayload, functionUpsertFlags } from '../../../lib/function-flags.js';
5
+ import { formatFunctionDetail, functionEndpoint, normalizeFunction, } from '../../../lib/function-types.js';
6
+ export default class FunctionUpsert extends AgentiaCommand {
7
+ static args = {
8
+ 'api-name': Args.string({
9
+ description: 'Function API name',
10
+ required: true,
11
+ }),
12
+ };
13
+ static description = 'Create or update a Copado Function by API name';
14
+ static examples = [
15
+ '<%= config.bin %> <%= command.id %> myFunction --name "My Function" --script "echo hello"',
16
+ '<%= config.bin %> <%= command.id %> myFunction --script-file ./run.sh --runtime bash --json',
17
+ '<%= config.bin %> <%= command.id %> myFunction --file ./function.json --json',
18
+ ];
19
+ static flags = functionUpsertFlags;
20
+ async run() {
21
+ const { args, flags } = await this.parse(FunctionUpsert);
22
+ let payload;
23
+ try {
24
+ payload = await buildFunctionUpsertPayload(args['api-name'], flags);
25
+ }
26
+ catch (error) {
27
+ this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
28
+ }
29
+ const response = await this.withSpinner('Upserting function', () => CicdGateway.call({
30
+ body: payload,
31
+ endpoint: functionEndpoint(args['api-name']),
32
+ headers: {
33
+ 'Content-Type': 'application/json',
34
+ },
35
+ method: 'PUT',
36
+ }));
37
+ const fn = normalizeFunction(response);
38
+ this.display(() => {
39
+ this.log(`Upserted function ${fn.apiName ?? args['api-name']} (ID: ${fn.id ?? 'unknown id'}).`);
40
+ this.log(formatFunctionDetail(fn));
41
+ });
42
+ return fn;
43
+ }
44
+ }
45
+ //# sourceMappingURL=upsert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upsert.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/upsert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,0BAA0B,EAAE,mBAAmB,EAAC,MAAM,gCAAgC,CAAA;AAC9F,OAAO,EAEL,oBAAoB,EACpB,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,IAAI,GAAG;QACrB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,gDAAgD,CAAA;IAC9E,MAAM,CAAU,QAAQ,GAAG;QACzB,2FAA2F;QAC3F,6FAA6F;QAC7F,8EAA8E;KAC/E,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAEtD,IAAI,OAAO,CAAA;QACX,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAA;QACrE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAC/E,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAAE,CACjE,WAAW,CAAC,IAAI,CAAmB;YACjC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5C,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,EAAE,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QAEtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,YAAY,IAAI,CAAC,CAAA;YAC/F,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAA;IACX,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type PromotionRunResult } from '../../../lib/promotion-run.js';
3
+ export default class PromotionRun extends AgentiaCommand {
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ 'deployment-step-id': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'ignored-metadata-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ operation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'recreate-promotion-branch': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ resume: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
+ 'wait-timeout': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
17
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ };
19
+ run(): Promise<PromotionRunResult>;
20
+ protected toErrorJson(err: unknown): unknown;
21
+ private execute;
22
+ private hooks;
23
+ }
@@ -0,0 +1,137 @@
1
+ import { confirm } from '@inquirer/prompts';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
4
+ import { formatPromotionRunResult, isPromotionRunExecutionError, parseIgnoredMetadataJson, performPromotionResume, performPromotionRun, PROMOTION_OPERATIONS, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, promotionRunErrorJson, PromotionRunValidationError, } from '../../../lib/promotion-run.js';
5
+ export default class PromotionRun extends AgentiaCommand {
6
+ static args = {
7
+ id: Args.string({
8
+ description: '18-character Salesforce Promotion ID',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = [
13
+ 'Preflight, start, and optionally wait for a Copado promotion execution.',
14
+ 'Use --resume to continue an existing failed or conflict-resolved execution without starting a duplicate promotion.',
15
+ ].join(' ');
16
+ static examples = [
17
+ '<%= config.bin %> <%= command.id %> a0BXXXXXXXXXXXXXXX --operation merge',
18
+ '<%= config.bin %> <%= command.id %> a0BXXXXXXXXXXXXXXX --operation merge_and_deploy --json',
19
+ '<%= config.bin %> <%= command.id %> a0BXXXXXXXXXXXXXXX --resume a4NXXXXXXXXXXXXXXX',
20
+ ];
21
+ static flags = {
22
+ 'deployment-step-id': Flags.string({
23
+ description: 'Ordered deployment-step Salesforce ID. Can be provided multiple times.',
24
+ multiple: true,
25
+ }),
26
+ 'ignored-metadata-json': Flags.string({
27
+ description: 'JSON array to persist through ignored-metadata before starting the promotion.',
28
+ }),
29
+ operation: Flags.string({
30
+ description: 'Promotion operation. Required unless --resume is used.',
31
+ options: [...PROMOTION_OPERATIONS],
32
+ }),
33
+ 'recreate-promotion-branch': Flags.boolean({
34
+ description: 'Recreate the promotion branch before execution. Requires confirmation or --yes.',
35
+ }),
36
+ resume: Flags.string({
37
+ description: 'Resume this existing JobExecution ID instead of calling the promotion run endpoint.',
38
+ }),
39
+ wait: Flags.boolean({
40
+ allowNo: true,
41
+ default: true,
42
+ description: 'Poll promotion and deployment executions to terminal status.',
43
+ }),
44
+ 'wait-timeout': Flags.integer({
45
+ default: PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS,
46
+ description: 'Maximum total seconds to wait for promotion and deployment executions.',
47
+ }),
48
+ yes: Flags.boolean({
49
+ char: 'y',
50
+ default: false,
51
+ description: 'Confirm promotion branch recreation without prompting.',
52
+ }),
53
+ };
54
+ async run() {
55
+ const { args, flags } = await this.parse(PromotionRun);
56
+ const runFlags = flags;
57
+ if (!Number.isInteger(runFlags['wait-timeout']) || runFlags['wait-timeout'] <= 0) {
58
+ this.error('--wait-timeout must be a positive integer.', { exit: 2 });
59
+ }
60
+ if (runFlags.resume !== undefined && runFlags.operation !== undefined) {
61
+ this.error('Use --resume or --operation, not both.', { exit: 2 });
62
+ }
63
+ if (runFlags.resume === undefined && runFlags.operation === undefined) {
64
+ this.error('--operation is required unless --resume is used.', { exit: 2 });
65
+ }
66
+ if (runFlags.resume !== undefined) {
67
+ if (runFlags['deployment-step-id'] !== undefined ||
68
+ runFlags['ignored-metadata-json'] !== undefined ||
69
+ runFlags['recreate-promotion-branch'] === true) {
70
+ this.error('--resume cannot be combined with run request flags.', { exit: 2 });
71
+ }
72
+ return this.execute(() => performPromotionResume({
73
+ hooks: this.hooks(),
74
+ jobExecutionId: runFlags.resume,
75
+ promotionId: args.id,
76
+ timeoutSeconds: runFlags['wait-timeout'],
77
+ wait: runFlags.wait,
78
+ }));
79
+ }
80
+ if (runFlags['recreate-promotion-branch'] === true && !runFlags.yes) {
81
+ if (this.jsonEnabled() || !process.stdin.isTTY) {
82
+ this.error('Promotion branch recreation requires confirmation. Pass --yes for headless or JSON execution.', {
83
+ exit: 2,
84
+ });
85
+ }
86
+ const confirmed = await confirm({
87
+ default: false,
88
+ message: `Recreate the promotion branch for ${args.id}? Existing promotion branch changes may be replaced.`,
89
+ });
90
+ if (!confirmed) {
91
+ this.error('Promotion canceled.', { exit: 1 });
92
+ }
93
+ }
94
+ return this.execute(() => performPromotionRun({
95
+ deploymentStepIds: runFlags['deployment-step-id'],
96
+ hooks: this.hooks(),
97
+ ignoredMetadata: parseIgnoredMetadataJson(runFlags['ignored-metadata-json']),
98
+ operation: runFlags.operation,
99
+ promotionId: args.id,
100
+ recreatePromotionBranch: runFlags['recreate-promotion-branch'],
101
+ timeoutSeconds: runFlags['wait-timeout'],
102
+ wait: runFlags.wait,
103
+ }));
104
+ }
105
+ toErrorJson(err) {
106
+ const base = super.toErrorJson(err);
107
+ return promotionRunErrorJson(base, err);
108
+ }
109
+ async execute(action) {
110
+ try {
111
+ const result = await action();
112
+ this.display(() => this.log(formatPromotionRunResult(result)));
113
+ return result;
114
+ }
115
+ catch (error) {
116
+ if (error instanceof PromotionRunValidationError) {
117
+ this.error(error.message, { exit: 2 });
118
+ }
119
+ if (isPromotionRunExecutionError(error)) {
120
+ this.display(() => {
121
+ if (error.result !== undefined) {
122
+ this.log(formatPromotionRunResult(error.result));
123
+ }
124
+ });
125
+ error.oclif = { exit: 1 };
126
+ }
127
+ throw error;
128
+ }
129
+ }
130
+ hooks() {
131
+ return {
132
+ log: (message) => this.display(() => this.log(message)),
133
+ withSpinner: (message, action) => this.withSpinner(message, action),
134
+ };
135
+ }
136
+ }
137
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/commands/cicd/promotion/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,qCAAqC,EAErC,qBAAqB,EAErB,2BAA2B,GAC5B,MAAM,+BAA+B,CAAA;AAatC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG;QAC5B,yEAAyE;QACzE,oHAAoH;KACrH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACX,MAAM,CAAU,QAAQ,GAAG;QACzB,0EAA0E;QAC1E,4FAA4F;QAC5F,oFAAoF;KACrF,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC;YACjC,WAAW,EAAE,wEAAwE;YACrF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAAC;YACpC,WAA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A;YACtC,CAAC;YAED,IAAI,4BAA4B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;oBAChB,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;wBAC/B,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;oBAClD,CAAC;gBACH,CAAC,CAAC,CACD;gBAAC,KAA0C,CAAC,KAAK,GAAG,EAAC,IAAI,EAAE,CAAC,EAAC,CAAA;YAChE,CAAC;YAED,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;IAEO,KAAK;QACX,OAAO;YACL,GAAG,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAChE,WAAW,EAAE,CAAI,OAAe,EAAE,MAAwB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;SACjG,CAAA;IACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type PromotionRunResult } from '../../../lib/promotion-run.js';
3
+ export type WorkPromoteResult = PromotionRunResult & {
4
+ workItemId: string;
5
+ };
6
+ export default class WorkPromote extends AgentiaCommand {
7
+ static args: {
8
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
9
+ };
10
+ static description: string;
11
+ static examples: string[];
12
+ static flags: {
13
+ cloud: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ deploy: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ 'deployment-step-id': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'ignored-metadata-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'promotion-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'recreate-promotion-branch': import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ 'wait-timeout': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
21
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
+ };
23
+ run(): Promise<WorkPromoteResult>;
24
+ protected toErrorJson(err: unknown): unknown;
25
+ }
@@ -0,0 +1,141 @@
1
+ import { confirm } from '@inquirer/prompts';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
4
+ import { formatPromotionRunResult, isPromotionRunExecutionError, parseIgnoredMetadataJson, performPromotionRun, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, promotionRunErrorJson, PromotionRunValidationError, resolvePromotionIdForWorkItem, } from '../../../lib/promotion-run.js';
5
+ import { resolveWorkItemId, WorkActiveResolutionError } from '../../../lib/work-active.js';
6
+ export default class WorkPromote extends AgentiaCommand {
7
+ static args = {
8
+ id: Args.string({
9
+ description: 'User Story ID (defaults to the active work item from `work set`)',
10
+ required: false,
11
+ }),
12
+ };
13
+ static description = [
14
+ 'Promote the explicit or active User Story through its Copado Promotion.',
15
+ 'Requires --cloud and selects promote-only unless --deploy is passed.',
16
+ ].join(' ');
17
+ static examples = [
18
+ '<%= config.bin %> <%= command.id %> --cloud',
19
+ '<%= config.bin %> <%= command.id %> a07XXXXXXXXXXXXXXX --cloud --promotion-id a0BXXXXXXXXXXXXXXX',
20
+ '<%= config.bin %> <%= command.id %> --cloud --deploy --json',
21
+ ];
22
+ static flags = {
23
+ cloud: Flags.boolean({
24
+ default: false,
25
+ description: 'Use the Copado cloud promotion API. Required for this command.',
26
+ }),
27
+ deploy: Flags.boolean({
28
+ default: false,
29
+ description: 'Use merge_and_deploy instead of promote-only merge.',
30
+ }),
31
+ 'deployment-step-id': Flags.string({
32
+ description: 'Ordered deployment-step Salesforce ID. Can be provided multiple times with --deploy.',
33
+ multiple: true,
34
+ }),
35
+ 'ignored-metadata-json': Flags.string({
36
+ description: 'JSON array to persist through ignored-metadata before starting the promotion.',
37
+ }),
38
+ 'promotion-id': Flags.string({
39
+ description: 'Explicit 18-character Promotion ID when the User Story belongs to multiple promotions.',
40
+ }),
41
+ 'recreate-promotion-branch': Flags.boolean({
42
+ description: 'Recreate the promotion branch before execution. Requires confirmation or --yes.',
43
+ }),
44
+ wait: Flags.boolean({
45
+ allowNo: true,
46
+ default: true,
47
+ description: 'Poll promotion and deployment executions to terminal status.',
48
+ }),
49
+ 'wait-timeout': Flags.integer({
50
+ default: PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS,
51
+ description: 'Maximum total seconds to wait for promotion and deployment executions.',
52
+ }),
53
+ yes: Flags.boolean({
54
+ char: 'y',
55
+ default: false,
56
+ description: 'Confirm promotion branch recreation without prompting.',
57
+ }),
58
+ };
59
+ async run() {
60
+ const { args, flags } = await this.parse(WorkPromote);
61
+ const promoteFlags = flags;
62
+ if (!promoteFlags.cloud) {
63
+ this.error('Only cloud promotion is supported for this command. Pass --cloud.', { exit: 2 });
64
+ }
65
+ if (!Number.isInteger(promoteFlags['wait-timeout']) || promoteFlags['wait-timeout'] <= 0) {
66
+ this.error('--wait-timeout must be a positive integer.', { exit: 2 });
67
+ }
68
+ if (!promoteFlags.deploy && promoteFlags['deployment-step-id'] !== undefined) {
69
+ this.error('--deployment-step-id requires --deploy.', { exit: 2 });
70
+ }
71
+ let workItemId;
72
+ try {
73
+ workItemId = await resolveWorkItemId(args.id);
74
+ }
75
+ catch (error) {
76
+ if (error instanceof WorkActiveResolutionError) {
77
+ this.error(error.message, {
78
+ exit: 1,
79
+ suggestions: [`${this.config.bin} cicd work set <id>`],
80
+ });
81
+ }
82
+ throw error;
83
+ }
84
+ try {
85
+ const promotionId = await this.withSpinner('Resolving User Story promotion', () => resolvePromotionIdForWorkItem(workItemId, promoteFlags['promotion-id']));
86
+ if (promoteFlags['recreate-promotion-branch'] === true && !promoteFlags.yes) {
87
+ if (this.jsonEnabled() || !process.stdin.isTTY) {
88
+ this.error('Promotion branch recreation requires confirmation. Pass --yes for headless or JSON execution.', {
89
+ exit: 2,
90
+ });
91
+ }
92
+ const confirmed = await confirm({
93
+ default: false,
94
+ message: `Recreate the promotion branch for ${promotionId}? Existing promotion branch changes may be replaced.`,
95
+ });
96
+ if (!confirmed) {
97
+ this.error('Promotion canceled.', { exit: 1 });
98
+ }
99
+ }
100
+ const result = await performPromotionRun({
101
+ deploymentStepIds: promoteFlags['deployment-step-id'],
102
+ hooks: {
103
+ log: (message) => this.display(() => this.log(message)),
104
+ withSpinner: (message, action) => this.withSpinner(message, action),
105
+ },
106
+ ignoredMetadata: parseIgnoredMetadataJson(promoteFlags['ignored-metadata-json']),
107
+ operation: promoteFlags.deploy ? 'merge_and_deploy' : 'merge',
108
+ promotionId,
109
+ recreatePromotionBranch: promoteFlags['recreate-promotion-branch'],
110
+ timeoutSeconds: promoteFlags['wait-timeout'],
111
+ wait: promoteFlags.wait,
112
+ });
113
+ const workResult = { ...result, workItemId };
114
+ this.display(() => {
115
+ this.log(`User Story: ${workItemId}`);
116
+ this.log(formatPromotionRunResult(result));
117
+ });
118
+ return workResult;
119
+ }
120
+ catch (error) {
121
+ if (error instanceof PromotionRunValidationError) {
122
+ this.error(error.message, { exit: 2 });
123
+ }
124
+ if (isPromotionRunExecutionError(error)) {
125
+ this.display(() => {
126
+ if (error.result !== undefined) {
127
+ this.log(`User Story: ${workItemId}`);
128
+ this.log(formatPromotionRunResult(error.result));
129
+ }
130
+ });
131
+ error.oclif = { exit: 1 };
132
+ }
133
+ throw error;
134
+ }
135
+ }
136
+ toErrorJson(err) {
137
+ const base = super.toErrorJson(err);
138
+ return promotionRunErrorJson(base, err);
139
+ }
140
+ }
141
+ //# sourceMappingURL=promote.js.map
@@ -0,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