@copado/agentia-cli 0.57.0-alpha.0 → 0.59.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 (133) hide show
  1. package/README.md +1090 -116
  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/lib/cicd-gateway.js +3 -2
  102. package/dist/lib/cicd-gateway.js.map +1 -1
  103. package/dist/lib/cli-update.d.ts +2 -0
  104. package/dist/lib/cli-update.js +20 -1
  105. package/dist/lib/cli-update.js.map +1 -1
  106. package/dist/lib/data-flags.d.ts +14 -0
  107. package/dist/lib/data-flags.js +61 -0
  108. package/dist/lib/data-flags.js.map +1 -0
  109. package/dist/lib/data-types.d.ts +322 -0
  110. package/dist/lib/data-types.js +176 -0
  111. package/dist/lib/data-types.js.map +1 -0
  112. package/dist/lib/function-flags.d.ts +69 -0
  113. package/dist/lib/function-flags.js +199 -0
  114. package/dist/lib/function-flags.js.map +1 -0
  115. package/dist/lib/function-local-run.d.ts +64 -0
  116. package/dist/lib/function-local-run.js +148 -0
  117. package/dist/lib/function-local-run.js.map +1 -0
  118. package/dist/lib/function-types.d.ts +106 -0
  119. package/dist/lib/function-types.js +171 -0
  120. package/dist/lib/function-types.js.map +1 -0
  121. package/dist/lib/mcp/data-tools.d.ts +159 -0
  122. package/dist/lib/mcp/data-tools.js +547 -0
  123. package/dist/lib/mcp/data-tools.js.map +1 -0
  124. package/dist/lib/mcp/tools.d.ts +188 -0
  125. package/dist/lib/mcp/tools.js +215 -0
  126. package/dist/lib/mcp/tools.js.map +1 -1
  127. package/dist/lib/salesforce-id.d.ts +9 -0
  128. package/dist/lib/salesforce-id.js +30 -0
  129. package/dist/lib/salesforce-id.js.map +1 -1
  130. package/dist/lib/sf-org-context.js +5 -5
  131. package/dist/lib/sf-org-context.js.map +1 -1
  132. package/oclif.manifest.json +4876 -3011
  133. package/package.json +28 -1
@@ -0,0 +1,56 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { DATA_TEMPLATES_BASE, } from '../../../../lib/data-types.js';
5
+ export default class DataTemplateCreate extends AgentiaCommand {
6
+ static description = 'Create a Copado data template';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> --credential-id a0Y... --template-name Accounts --api-name Accounts --main-object-api-name Account --main-object-label Account',
9
+ '<%= config.bin %> <%= command.id %> --credential-id a0Y... --template-name Accounts --api-name Accounts --main-object-api-name Account --main-object-label Account --json',
10
+ ];
11
+ static flags = {
12
+ 'api-name': Flags.string({
13
+ description: 'Template API name',
14
+ required: true,
15
+ }),
16
+ 'credential-id': Flags.string({
17
+ description: 'Org credential Id',
18
+ required: true,
19
+ }),
20
+ 'main-object-api-name': Flags.string({
21
+ description: 'Main sObject API name',
22
+ required: true,
23
+ }),
24
+ 'main-object-label': Flags.string({
25
+ description: 'Main sObject label',
26
+ required: true,
27
+ }),
28
+ 'template-name': Flags.string({
29
+ description: 'Template display name',
30
+ required: true,
31
+ }),
32
+ };
33
+ async run() {
34
+ const { flags } = await this.parse(DataTemplateCreate);
35
+ const body = {
36
+ apiName: flags['api-name'],
37
+ credentialId: flags['credential-id'],
38
+ mainObject: {
39
+ apiName: flags['main-object-api-name'],
40
+ label: flags['main-object-label'],
41
+ },
42
+ templateName: flags['template-name'],
43
+ };
44
+ const id = await this.withSpinner('Creating data template', () => CicdGateway.call({
45
+ body,
46
+ endpoint: DATA_TEMPLATES_BASE,
47
+ headers: { 'Content-Type': 'application/json' },
48
+ method: 'POST',
49
+ }));
50
+ this.display(() => {
51
+ this.log(`Created data template (ID: ${id}).`);
52
+ });
53
+ return id;
54
+ }
55
+ }
56
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAEL,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AAEtC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,cAAc;IAC5D,MAAM,CAAU,WAAW,GAAG,+BAA+B,CAAA;IAC7D,MAAM,CAAU,QAAQ,GAAG;QACzB,oKAAoK;QACpK,2KAA2K;KAC5K,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC;YACnC,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC;YAChC,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAEpD,MAAM,IAAI,GAA8B;YACtC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC;YAC1B,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,UAAU,EAAE;gBACV,OAAO,EAAE,KAAK,CAAC,sBAAsB,CAAC;gBACtC,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC;aAClC;YACD,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;SACrC,CAAA;QAED,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAC/D,WAAW,CAAC,IAAI,CAAS;YACvB,IAAI;YACJ,QAAQ,EAAE,mBAAmB;YAC7B,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,MAAM;SACf,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAA;IACX,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ export default class DataTemplateDelete extends AgentiaCommand {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<boolean>;
9
+ }
@@ -0,0 +1,29 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { dataTemplateEndpoint } from '../../../../lib/data-types.js';
5
+ export default class DataTemplateDelete extends AgentiaCommand {
6
+ static args = {
7
+ id: Args.string({
8
+ description: 'Data template Id',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Delete a Copado data template';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> a0X000000000001',
15
+ '<%= config.bin %> <%= command.id %> a0X000000000001 --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(DataTemplateDelete);
19
+ const result = await this.withSpinner('Deleting data template', () => CicdGateway.call({
20
+ endpoint: dataTemplateEndpoint(args.id),
21
+ method: 'DELETE',
22
+ }));
23
+ this.display(() => {
24
+ this.log(`Deleted data template (ID: ${args.id}).`);
25
+ });
26
+ return result;
27
+ }
28
+ }
29
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAA;AAElE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,cAAc;IAC5D,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,+BAA+B,CAAA;IAC7D,MAAM,CAAU,QAAQ,GAAG;QACzB,qDAAqD;QACrD,4DAA4D;KAC7D,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAEnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,GAAG,EAAE,CACnE,WAAW,CAAC,IAAI,CAAU;YACxB,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,MAAM,EAAE,QAAQ;SACjB,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,8BAA8B,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ import { type V2Template } from '../../../../lib/data-types.js';
3
+ export default class DataTemplateGetDetail 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
+ run(): Promise<V2Template>;
10
+ }
@@ -0,0 +1,29 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { dataTemplateDetailEndpoint } from '../../../../lib/data-types.js';
5
+ export default class DataTemplateGetDetail extends AgentiaCommand {
6
+ static args = {
7
+ id: Args.string({
8
+ description: 'Data template Id',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Get the raw v2 data template detail payload';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> a0X000000000001',
15
+ '<%= config.bin %> <%= command.id %> a0X000000000001 --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(DataTemplateGetDetail);
19
+ const detail = await this.withSpinner('Fetching data template detail', () => CicdGateway.call({
20
+ endpoint: dataTemplateDetailEndpoint(args.id),
21
+ method: 'GET',
22
+ }));
23
+ this.display(() => {
24
+ this.log(JSON.stringify(detail, null, 2));
25
+ });
26
+ return detail;
27
+ }
28
+ }
29
+ //# sourceMappingURL=get-detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-detail.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/get-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAC,0BAA0B,EAAkB,MAAM,+BAA+B,CAAA;AAEzF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,cAAc;IAC/D,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,6CAA6C,CAAA;IAC3E,MAAM,CAAU,QAAQ,GAAG;QACzB,qDAAqD;QACrD,4DAA4D;KAC7D,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAEtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAC1E,WAAW,CAAC,IAAI,CAAa;YAC3B,QAAQ,EAAE,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ import { type V2TemplateDetail } from '../../../../lib/data-types.js';
3
+ export default class DataTemplateGet 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
+ run(): Promise<Record<string, V2TemplateDetail>>;
10
+ }
@@ -0,0 +1,29 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { dataTemplateEndpoint } from '../../../../lib/data-types.js';
5
+ export default class DataTemplateGet extends AgentiaCommand {
6
+ static args = {
7
+ id: Args.string({
8
+ description: 'Data template Id',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Get a data template export graph (selected columns only)';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> a0X000000000001',
15
+ '<%= config.bin %> <%= command.id %> a0X000000000001 --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(DataTemplateGet);
19
+ const graph = await this.withSpinner('Fetching data template graph', () => CicdGateway.call({
20
+ endpoint: dataTemplateEndpoint(args.id),
21
+ method: 'GET',
22
+ }));
23
+ this.display(() => {
24
+ this.log(JSON.stringify(graph, null, 2));
25
+ });
26
+ return graph;
27
+ }
28
+ }
29
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAC,oBAAoB,EAAwB,MAAM,+BAA+B,CAAA;AAEzF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,cAAc;IACzD,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,0DAA0D,CAAA;IACxF,MAAM,CAAU,QAAQ,GAAG;QACzB,qDAAqD;QACrD,4DAA4D;KAC7D,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QAEhD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,8BAA8B,EAAE,GAAG,EAAE,CACxE,WAAW,CAAC,IAAI,CAAmC;YACjD,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;QAEF,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ import { type DataTemplate } from '../../../../lib/data-types.js';
3
+ export default class DataTemplateList extends AgentiaCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ active: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ 'fetch-related': import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<DataTemplate[]>;
11
+ }
@@ -0,0 +1,44 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { dataTemplatesListEndpoint, formatDataTemplateTable, normalizeDataTemplates, } from '../../../../lib/data-types.js';
5
+ export default class DataTemplateList extends AgentiaCommand {
6
+ static description = 'List Copado data templates';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --fetch-related --active',
10
+ '<%= config.bin %> <%= command.id %> --no-active --json',
11
+ ];
12
+ static flags = {
13
+ active: Flags.boolean({
14
+ allowNo: true,
15
+ description: 'Filter by active flag (--active / --no-active)',
16
+ }),
17
+ 'fetch-related': Flags.boolean({
18
+ default: false,
19
+ description: 'Include related template information',
20
+ }),
21
+ };
22
+ async run() {
23
+ const { flags } = await this.parse(DataTemplateList);
24
+ const templates = await this.withSpinner('Fetching data templates', async () => {
25
+ const response = await CicdGateway.call({
26
+ endpoint: dataTemplatesListEndpoint({
27
+ active: flags.active,
28
+ fetchRelated: flags['fetch-related'] || undefined,
29
+ }),
30
+ method: 'GET',
31
+ });
32
+ return normalizeDataTemplates(response);
33
+ });
34
+ this.display(() => {
35
+ if (templates.length === 0) {
36
+ this.log('No data templates found.');
37
+ return;
38
+ }
39
+ this.log(formatDataTemplateTable(templates));
40
+ });
41
+ return templates;
42
+ }
43
+ }
44
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAEL,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,+BAA+B,CAAA;AAEtC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,MAAM,CAAU,WAAW,GAAG,4BAA4B,CAAA;IAC1D,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,8DAA8D;QAC9D,wDAAwD;KACzD,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,gDAAgD;SAC9D,CAAC;QACF,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC;YAC7B,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,sCAAsC;SACpD,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;QAElD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;YAC7E,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAA2C;gBAChF,QAAQ,EAAE,yBAAyB,CAAC;oBAClC,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,SAAS;iBAClD,CAAC;gBACF,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;YACF,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;gBACpC,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ export default class DataTemplateSaveDetail extends AgentiaCommand {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<boolean>;
13
+ }
@@ -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 { assertJsonObject, jsonBodyFlags, readJsonBodyFromFileOrStdin, } from '../../../../lib/data-flags.js';
5
+ import { dataTemplateDetailEndpoint } from '../../../../lib/data-types.js';
6
+ export default class DataTemplateSaveDetail extends AgentiaCommand {
7
+ static args = {
8
+ id: Args.string({
9
+ description: 'Data template Id',
10
+ required: true,
11
+ }),
12
+ };
13
+ static description = 'Save a v2 data template detail payload';
14
+ static examples = [
15
+ '<%= config.bin %> <%= command.id %> a0X000000000001 --file detail.json',
16
+ '<%= config.bin %> <%= command.id %> a0X000000000001 --stdin --json',
17
+ ];
18
+ static flags = {
19
+ ...jsonBodyFlags,
20
+ };
21
+ async run() {
22
+ const { args, flags } = await this.parse(DataTemplateSaveDetail);
23
+ const raw = await readJsonBodyFromFileOrStdin({
24
+ file: flags.file,
25
+ label: 'template detail',
26
+ required: true,
27
+ stdin: flags.stdin,
28
+ });
29
+ const body = assertJsonObject(raw, 'template detail');
30
+ const result = await this.withSpinner('Saving data template detail', () => CicdGateway.call({
31
+ body,
32
+ endpoint: dataTemplateDetailEndpoint(args.id),
33
+ headers: { 'Content-Type': 'application/json' },
34
+ method: 'PUT',
35
+ }));
36
+ this.display(() => {
37
+ this.log(`Saved data template detail for ${args.id}.`);
38
+ });
39
+ return result;
40
+ }
41
+ }
42
+ //# sourceMappingURL=save-detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-detail.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/data/template/save-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,2BAA2B,GAC5B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAC,0BAA0B,EAAkB,MAAM,+BAA+B,CAAA;AAEzF,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,cAAc;IAChE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,wCAAwC,CAAA;IACtE,MAAM,CAAU,QAAQ,GAAG;QACzB,wEAAwE;QACxE,oEAAoE;KACrE,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,aAAa;KACjB,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAC9D,MAAM,GAAG,GAAG,MAAM,2BAA2B,CAAC;YAC5C,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,CAA0B,CAAA;QAE9E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,6BAA6B,EAAE,GAAG,EAAE,CACxE,WAAW,CAAC,IAAI,CAAU;YACxB,IAAI;YACJ,QAAQ,EAAE,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,kCAAkC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type CopadoFunction } from '../../../lib/function-types.js';
3
+ export default class FunctionDefaults extends AgentiaCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ readonly 'image-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ readonly name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ readonly runtime: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<CopadoFunction>;
12
+ }
@@ -0,0 +1,31 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
3
+ import { buildFunctionDefaultsPayload, functionDefaultsFlags } from '../../../lib/function-flags.js';
4
+ import { formatFunctionDetail, functionsEndpoint, normalizeFunction, } from '../../../lib/function-types.js';
5
+ export default class FunctionDefaults extends AgentiaCommand {
6
+ static description = 'Scaffold default Copado Function metadata and script without writing to Salesforce';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> --name MyFunction',
9
+ '<%= config.bin %> <%= command.id %> --name MyFunction --runtime python --json',
10
+ ];
11
+ static flags = functionDefaultsFlags;
12
+ async run() {
13
+ const { flags } = await this.parse(FunctionDefaults);
14
+ const payload = buildFunctionDefaultsPayload(flags);
15
+ const response = await this.withSpinner('Scaffolding function defaults', () => CicdGateway.call({
16
+ body: payload,
17
+ endpoint: functionsEndpoint(),
18
+ headers: {
19
+ 'Content-Type': 'application/json',
20
+ },
21
+ method: 'POST',
22
+ }));
23
+ const fn = normalizeFunction(response);
24
+ this.display(() => {
25
+ this.log('Scaffolded function defaults (not persisted).');
26
+ this.log(formatFunctionDetail(fn));
27
+ });
28
+ return fn;
29
+ }
30
+ }
31
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,4BAA4B,EAAE,qBAAqB,EAAC,MAAM,gCAAgC,CAAA;AAClG,OAAO,EAEL,oBAAoB,EAEpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,MAAM,CAAU,WAAW,GACzB,oFAAoF,CAAA;IACtF,MAAM,CAAU,QAAQ,GAAG;QACzB,uDAAuD;QACvD,+EAA+E;KAChF,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,qBAAqB,CAAA;IAEtC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;QAClD,MAAM,OAAO,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAC5E,WAAW,CAAC,IAAI,CAAmB;YACjC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,iBAAiB,EAAE;YAC7B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,MAAM;SACf,CAAC,CACH,CAAA;QACD,MAAM,EAAE,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QAEtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAA;YACzD,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAA;IACX,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ export default class FunctionDelete extends AgentiaCommand {
3
+ static args: {
4
+ 'api-name': import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<{
9
+ apiName: string;
10
+ }>;
11
+ }
@@ -0,0 +1,29 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { functionEndpoint } from '../../../lib/function-types.js';
5
+ export default class FunctionDelete extends AgentiaCommand {
6
+ static args = {
7
+ 'api-name': Args.string({
8
+ description: 'Function API name',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Delete a Copado Function by API name';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> myFunction',
15
+ '<%= config.bin %> <%= command.id %> myFunction --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(FunctionDelete);
19
+ await this.withSpinner('Deleting function', () => CicdGateway.call({
20
+ endpoint: functionEndpoint(args['api-name']),
21
+ method: 'DELETE',
22
+ }));
23
+ this.display(() => {
24
+ this.log(`Deleted function ${args['api-name']}.`);
25
+ });
26
+ return { apiName: args['api-name'] };
27
+ }
28
+ }
29
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/delete.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,gBAAgB,EAAC,MAAM,gCAAgC,CAAA;AAE/D,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,sCAAsC,CAAA;IACpE,MAAM,CAAU,QAAQ,GAAG;QACzB,gDAAgD;QAChD,uDAAuD;KACxD,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAE/C,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAC/C,WAAW,CAAC,IAAI,CAAO;YACrB,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5C,MAAM,EAAE,QAAQ;SACjB,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QAEF,OAAO,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,EAAC,CAAA;IACpC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type CopadoFunction } from '../../../lib/function-types.js';
3
+ export default class FunctionGet 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
+ run(): Promise<CopadoFunction>;
10
+ }
@@ -0,0 +1,30 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { formatFunctionDetail, functionEndpoint, normalizeFunction, } from '../../../lib/function-types.js';
5
+ export default class FunctionGet extends AgentiaCommand {
6
+ static args = {
7
+ 'api-name': Args.string({
8
+ description: 'Function API name',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Get a Copado Function by API name';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> myFunction',
15
+ '<%= config.bin %> <%= command.id %> myFunction --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(FunctionGet);
19
+ const response = await this.withSpinner('Fetching function', () => CicdGateway.call({
20
+ endpoint: functionEndpoint(args['api-name']),
21
+ method: 'GET',
22
+ }));
23
+ const fn = normalizeFunction(response);
24
+ this.display(() => {
25
+ this.log(formatFunctionDetail(fn));
26
+ });
27
+ return fn;
28
+ }
29
+ }
30
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/get.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,EAEL,oBAAoB,EACpB,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,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,mCAAmC,CAAA;IACjE,MAAM,CAAU,QAAQ,GAAG;QACzB,gDAAgD;QAChD,uDAAuD;KACxD,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAChE,WAAW,CAAC,IAAI,CAAmB;YACjC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5C,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,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAA;IACX,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type CopadoFunction } from '../../../lib/function-types.js';
3
+ export default class FunctionList extends AgentiaCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<CopadoFunction[]>;
10
+ }
@@ -0,0 +1,36 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { formatFunctionTable, FUNCTION_LIST_TYPES, functionsEndpoint, normalizeFunctionsList, } from '../../../lib/function-types.js';
5
+ export default class FunctionList extends AgentiaCommand {
6
+ static description = 'List Copado Functions';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --type all',
10
+ '<%= config.bin %> <%= command.id %> --json',
11
+ ];
12
+ static flags = {
13
+ type: Flags.string({
14
+ default: 'custom',
15
+ description: 'List Custom functions only, or all functions',
16
+ options: [...FUNCTION_LIST_TYPES],
17
+ }),
18
+ };
19
+ async run() {
20
+ const { flags } = await this.parse(FunctionList);
21
+ const response = await this.withSpinner('Fetching functions', () => CicdGateway.call({
22
+ endpoint: functionsEndpoint({ type: flags.type }),
23
+ method: 'GET',
24
+ }));
25
+ const functions = normalizeFunctionsList(response);
26
+ this.display(() => {
27
+ if (functions.length === 0) {
28
+ this.log('No functions found.');
29
+ return;
30
+ }
31
+ this.log(formatFunctionTable(functions));
32
+ });
33
+ return functions;
34
+ }
35
+ }
36
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,EAEnB,iBAAiB,EAEjB,sBAAsB,GACvB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,gDAAgD;QAChD,4CAA4C;KAC7C,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,8CAA8C;YAC3D,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC;SAClC,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAAE,CACjE,WAAW,CAAC,IAAI,CAAwB;YACtC,QAAQ,EAAE,iBAAiB,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,IAAwB,EAAC,CAAC;YACnE,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QAElD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;gBAC/B,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ import { type FunctionResultStatus } from '../../../../lib/function-types.js';
3
+ export default class FunctionResultGet extends AgentiaCommand {
4
+ static args: {
5
+ 'result-id': import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<FunctionResultStatus>;
10
+ }
@@ -0,0 +1,30 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
4
+ import { formatFunctionResultStatus, functionResultEndpoint, normalizeFunctionResultStatus, } from '../../../../lib/function-types.js';
5
+ export default class FunctionResultGet extends AgentiaCommand {
6
+ static args = {
7
+ 'result-id': Args.string({
8
+ description: 'Function result Id',
9
+ required: true,
10
+ }),
11
+ };
12
+ static description = 'Get Copado Function execution status by result Id';
13
+ static examples = [
14
+ '<%= config.bin %> <%= command.id %> <result-id>',
15
+ '<%= config.bin %> <%= command.id %> <result-id> --json',
16
+ ];
17
+ async run() {
18
+ const { args } = await this.parse(FunctionResultGet);
19
+ const response = await this.withSpinner('Fetching function result', () => CicdGateway.call({
20
+ endpoint: functionResultEndpoint(args['result-id']),
21
+ method: 'GET',
22
+ }));
23
+ const result = normalizeFunctionResultStatus(response);
24
+ this.display(() => {
25
+ this.log(formatFunctionResultStatus(result));
26
+ });
27
+ return result;
28
+ }
29
+ }
30
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/function/result/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EAGtB,6BAA6B,GAC9B,MAAM,mCAAmC,CAAA;AAE1C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,MAAM,CAAU,IAAI,GAAG;QACrB,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,mDAAmD,CAAA;IACjF,MAAM,CAAU,QAAQ,GAAG;QACzB,iDAAiD;QACjD,wDAAwD;KACzD,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,CACvE,WAAW,CAAC,IAAI,CAA+B;YAC7C,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,MAAM,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAA;QAEtD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { AgentiaCommand } from '../../../../../lib/agentia-command.js';
2
+ export type FunctionResultLogResult = {
3
+ log: string;
4
+ resultId: string;
5
+ type?: string;
6
+ };
7
+ export default class FunctionResultLogGet extends AgentiaCommand {
8
+ static args: {
9
+ 'result-id': import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
10
+ };
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ };
16
+ run(): Promise<FunctionResultLogResult>;
17
+ }