@commercelayer/cli-plugin-triggers 4.9.1 → 4.10.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 (35) hide show
  1. package/README.md +232 -0
  2. package/lib/commands/adyen_payment/authorize.d.ts +9 -0
  3. package/lib/commands/adyen_payment/authorize.js +22 -0
  4. package/lib/commands/cleanup/index.d.ts +9 -0
  5. package/lib/commands/cleanup/index.js +40 -0
  6. package/lib/commands/cleanup/interrupt.d.ts +9 -0
  7. package/lib/commands/cleanup/interrupt.js +22 -0
  8. package/lib/commands/export/index.d.ts +9 -0
  9. package/lib/commands/export/index.js +40 -0
  10. package/lib/commands/export/interrupt.d.ts +9 -0
  11. package/lib/commands/export/interrupt.js +22 -0
  12. package/lib/commands/import/index.d.ts +9 -0
  13. package/lib/commands/import/index.js +40 -0
  14. package/lib/commands/import/interrupt.d.ts +9 -0
  15. package/lib/commands/import/interrupt.js +22 -0
  16. package/lib/commands/order/fix_payment_source.d.ts +9 -0
  17. package/lib/commands/order/fix_payment_source.js +22 -0
  18. package/lib/commands/vertex_account/index.d.ts +9 -0
  19. package/lib/commands/vertex_account/index.js +40 -0
  20. package/lib/commands/vertex_account/refresh_token.d.ts +9 -0
  21. package/lib/commands/vertex_account/refresh_token.js +22 -0
  22. package/lib/triggers/adyen_payments.d.ts +1 -1
  23. package/lib/triggers/adyen_payments.js +5 -0
  24. package/lib/triggers/cleanups.d.ts +3 -0
  25. package/lib/triggers/cleanups.js +10 -0
  26. package/lib/triggers/exports.d.ts +3 -0
  27. package/lib/triggers/exports.js +10 -0
  28. package/lib/triggers/imports.d.ts +3 -0
  29. package/lib/triggers/imports.js +10 -0
  30. package/lib/triggers/orders.d.ts +1 -1
  31. package/lib/triggers/orders.js +5 -0
  32. package/lib/triggers/vertex_accounts.d.ts +3 -0
  33. package/lib/triggers/vertex_accounts.js +10 -0
  34. package/oclif.manifest.json +981 -101
  35. package/package.json +9 -8
package/README.md CHANGED
@@ -31,6 +31,7 @@ $ commercelayer plugins:install triggers
31
31
  <!-- commands -->
32
32
 
33
33
  * [`commercelayer adyen_payment ID`](#commercelayer-adyen_payment-id)
34
+ * [`commercelayer adyen_payment:authorize ID`](#commercelayer-adyen_paymentauthorize-id)
34
35
  * [`commercelayer adyen_payment:details ID`](#commercelayer-adyen_paymentdetails-id)
35
36
  * [`commercelayer authorization ID`](#commercelayer-authorization-id)
36
37
  * [`commercelayer authorization:cancel ID`](#commercelayer-authorizationcancel-id)
@@ -54,10 +55,14 @@ $ commercelayer plugins:install triggers
54
55
  * [`commercelayer checkout_com_payment ID`](#commercelayer-checkout_com_payment-id)
55
56
  * [`commercelayer checkout_com_payment:details ID`](#commercelayer-checkout_com_paymentdetails-id)
56
57
  * [`commercelayer checkout_com_payment:refresh ID`](#commercelayer-checkout_com_paymentrefresh-id)
58
+ * [`commercelayer cleanup ID`](#commercelayer-cleanup-id)
59
+ * [`commercelayer cleanup:interrupt ID`](#commercelayer-cleanupinterrupt-id)
57
60
  * [`commercelayer customer_password_reset ID`](#commercelayer-customer_password_reset-id)
58
61
  * [`commercelayer customer_password_reset:reset_password_token ID`](#commercelayer-customer_password_resetreset_password_token-id)
59
62
  * [`commercelayer event ID`](#commercelayer-event-id)
60
63
  * [`commercelayer event:trigger ID`](#commercelayer-eventtrigger-id)
64
+ * [`commercelayer export ID`](#commercelayer-export-id)
65
+ * [`commercelayer export:interrupt ID`](#commercelayer-exportinterrupt-id)
61
66
  * [`commercelayer external_gateway ID`](#commercelayer-external_gateway-id)
62
67
  * [`commercelayer external_gateway:reset_circuit ID`](#commercelayer-external_gatewayreset_circuit-id)
63
68
  * [`commercelayer external_promotion ID`](#commercelayer-external_promotion-id)
@@ -86,6 +91,8 @@ $ commercelayer plugins:install triggers
86
91
  * [`commercelayer gift_card:balance_change_cents ID`](#commercelayer-gift_cardbalance_change_cents-id)
87
92
  * [`commercelayer gift_card:deactivate ID`](#commercelayer-gift_carddeactivate-id)
88
93
  * [`commercelayer gift_card:purchase ID`](#commercelayer-gift_cardpurchase-id)
94
+ * [`commercelayer import ID`](#commercelayer-import-id)
95
+ * [`commercelayer import:interrupt ID`](#commercelayer-importinterrupt-id)
89
96
  * [`commercelayer in_stock_subscription ID`](#commercelayer-in_stock_subscription-id)
90
97
  * [`commercelayer in_stock_subscription:activate ID`](#commercelayer-in_stock_subscriptionactivate-id)
91
98
  * [`commercelayer in_stock_subscription:deactivate ID`](#commercelayer-in_stock_subscriptiondeactivate-id)
@@ -114,6 +121,7 @@ $ commercelayer plugins:install triggers
114
121
  * [`commercelayer order:commit_invoice ID`](#commercelayer-ordercommit_invoice-id)
115
122
  * [`commercelayer order:create_subscriptions ID`](#commercelayer-ordercreate_subscriptions-id)
116
123
  * [`commercelayer order:customer_payment_source_id ID`](#commercelayer-ordercustomer_payment_source_id-id)
124
+ * [`commercelayer order:fix_payment_source ID`](#commercelayer-orderfix_payment_source-id)
117
125
  * [`commercelayer order:fulfill ID`](#commercelayer-orderfulfill-id)
118
126
  * [`commercelayer order:nullify_payment_source ID`](#commercelayer-ordernullify_payment_source-id)
119
127
  * [`commercelayer order:pending ID`](#commercelayer-orderpending-id)
@@ -200,6 +208,8 @@ $ commercelayer plugins:install triggers
200
208
  * [`commercelayer stripe_payment ID`](#commercelayer-stripe_payment-id)
201
209
  * [`commercelayer stripe_payment:refresh ID`](#commercelayer-stripe_paymentrefresh-id)
202
210
  * [`commercelayer stripe_payment:update ID`](#commercelayer-stripe_paymentupdate-id)
211
+ * [`commercelayer vertex_account ID`](#commercelayer-vertex_account-id)
212
+ * [`commercelayer vertex_account:refresh_token ID`](#commercelayer-vertex_accountrefresh_token-id)
203
213
  * [`commercelayer void ID`](#commercelayer-void-id)
204
214
  * [`commercelayer void:forward ID`](#commercelayer-voidforward-id)
205
215
  * [`commercelayer webhook ID`](#commercelayer-webhook-id)
@@ -229,6 +239,28 @@ DESCRIPTION
229
239
 
230
240
  _See code: [src/commands/adyen_payment/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/adyen_payment/index.ts)_
231
241
 
242
+ ### `commercelayer adyen_payment:authorize ID`
243
+
244
+ Send this attribute if you want to authorize the payment.
245
+
246
+ ```sh-session
247
+ USAGE
248
+ $ commercelayer adyen_payment:authorize ID [-u [-j -p]]
249
+
250
+ ARGUMENTS
251
+ ID the unique id of the resource
252
+
253
+ FLAGS
254
+ -j, --json print result in JSON format
255
+ -p, --print print out the modified resource
256
+ -u, --unformatted print JSON output without indentation
257
+
258
+ DESCRIPTION
259
+ Send this attribute if you want to authorize the payment.
260
+ ```
261
+
262
+ _See code: [src/commands/adyen_payment/authorize.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/adyen_payment/authorize.ts)_
263
+
232
264
  ### `commercelayer adyen_payment:details ID`
233
265
 
234
266
  Send this attribute if you want to send additional details the payment request.
@@ -739,6 +771,50 @@ DESCRIPTION
739
771
 
740
772
  _See code: [src/commands/checkout_com_payment/refresh.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/checkout_com_payment/refresh.ts)_
741
773
 
774
+ ### `commercelayer cleanup ID`
775
+
776
+ Execute an action on a resource of type cleanups.
777
+
778
+ ```sh-session
779
+ USAGE
780
+ $ commercelayer cleanup ID [-u [-j -p]]
781
+
782
+ ARGUMENTS
783
+ ID the unique id of the resource
784
+
785
+ FLAGS
786
+ -j, --json print result in JSON format
787
+ -p, --print print out the modified resource
788
+ -u, --unformatted print JSON output without indentation
789
+
790
+ DESCRIPTION
791
+ execute an action on a resource of type cleanups
792
+ ```
793
+
794
+ _See code: [src/commands/cleanup/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/cleanup/index.ts)_
795
+
796
+ ### `commercelayer cleanup:interrupt ID`
797
+
798
+ Send this attribute if you want to mark status as 'interrupted'.
799
+
800
+ ```sh-session
801
+ USAGE
802
+ $ commercelayer cleanup:interrupt ID [-u [-j -p]]
803
+
804
+ ARGUMENTS
805
+ ID the unique id of the resource
806
+
807
+ FLAGS
808
+ -j, --json print result in JSON format
809
+ -p, --print print out the modified resource
810
+ -u, --unformatted print JSON output without indentation
811
+
812
+ DESCRIPTION
813
+ Send this attribute if you want to mark status as 'interrupted'.
814
+ ```
815
+
816
+ _See code: [src/commands/cleanup/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/cleanup/interrupt.ts)_
817
+
742
818
  ### `commercelayer customer_password_reset ID`
743
819
 
744
820
  Execute an action on a resource of type customer_password_resets.
@@ -827,6 +903,50 @@ DESCRIPTION
827
903
 
828
904
  _See code: [src/commands/event/trigger.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/event/trigger.ts)_
829
905
 
906
+ ### `commercelayer export ID`
907
+
908
+ Execute an action on a resource of type exports.
909
+
910
+ ```sh-session
911
+ USAGE
912
+ $ commercelayer export ID [-u [-j -p]]
913
+
914
+ ARGUMENTS
915
+ ID the unique id of the resource
916
+
917
+ FLAGS
918
+ -j, --json print result in JSON format
919
+ -p, --print print out the modified resource
920
+ -u, --unformatted print JSON output without indentation
921
+
922
+ DESCRIPTION
923
+ execute an action on a resource of type exports
924
+ ```
925
+
926
+ _See code: [src/commands/export/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/export/index.ts)_
927
+
928
+ ### `commercelayer export:interrupt ID`
929
+
930
+ Send this attribute if you want to mark status as 'interrupted'.
931
+
932
+ ```sh-session
933
+ USAGE
934
+ $ commercelayer export:interrupt ID [-u [-j -p]]
935
+
936
+ ARGUMENTS
937
+ ID the unique id of the resource
938
+
939
+ FLAGS
940
+ -j, --json print result in JSON format
941
+ -p, --print print out the modified resource
942
+ -u, --unformatted print JSON output without indentation
943
+
944
+ DESCRIPTION
945
+ Send this attribute if you want to mark status as 'interrupted'.
946
+ ```
947
+
948
+ _See code: [src/commands/export/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/export/interrupt.ts)_
949
+
830
950
  ### `commercelayer external_gateway ID`
831
951
 
832
952
  Execute an action on a resource of type external_gateways.
@@ -1448,6 +1568,50 @@ DESCRIPTION
1448
1568
 
1449
1569
  _See code: [src/commands/gift_card/purchase.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/gift_card/purchase.ts)_
1450
1570
 
1571
+ ### `commercelayer import ID`
1572
+
1573
+ Execute an action on a resource of type imports.
1574
+
1575
+ ```sh-session
1576
+ USAGE
1577
+ $ commercelayer import ID [-u [-j -p]]
1578
+
1579
+ ARGUMENTS
1580
+ ID the unique id of the resource
1581
+
1582
+ FLAGS
1583
+ -j, --json print result in JSON format
1584
+ -p, --print print out the modified resource
1585
+ -u, --unformatted print JSON output without indentation
1586
+
1587
+ DESCRIPTION
1588
+ execute an action on a resource of type imports
1589
+ ```
1590
+
1591
+ _See code: [src/commands/import/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/import/index.ts)_
1592
+
1593
+ ### `commercelayer import:interrupt ID`
1594
+
1595
+ Send this attribute if you want to mark status as 'interrupted'.
1596
+
1597
+ ```sh-session
1598
+ USAGE
1599
+ $ commercelayer import:interrupt ID [-u [-j -p]]
1600
+
1601
+ ARGUMENTS
1602
+ ID the unique id of the resource
1603
+
1604
+ FLAGS
1605
+ -j, --json print result in JSON format
1606
+ -p, --print print out the modified resource
1607
+ -u, --unformatted print JSON output without indentation
1608
+
1609
+ DESCRIPTION
1610
+ Send this attribute if you want to mark status as 'interrupted'.
1611
+ ```
1612
+
1613
+ _See code: [src/commands/import/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/import/interrupt.ts)_
1614
+
1451
1615
  ### `commercelayer in_stock_subscription ID`
1452
1616
 
1453
1617
  Execute an action on a resource of type in_stock_subscriptions.
@@ -2073,6 +2237,30 @@ DESCRIPTION
2073
2237
 
2074
2238
  _See code: [src/commands/order/customer_payment_source_id.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/customer_payment_source_id.ts)_
2075
2239
 
2240
+ ### `commercelayer order:fix_payment_source ID`
2241
+
2242
+ Send this attribute if you want to set the payment source associated with the last succeeded authorization. At the end of the fix the order should be placed and authorized and ready to be approved. A tentative to fix the payment source is done before approval automatically. Cannot be passed by sales channels.
2243
+
2244
+ ```sh-session
2245
+ USAGE
2246
+ $ commercelayer order:fix_payment_source ID [-u [-j -p]]
2247
+
2248
+ ARGUMENTS
2249
+ ID the unique id of the resource
2250
+
2251
+ FLAGS
2252
+ -j, --json print result in JSON format
2253
+ -p, --print print out the modified resource
2254
+ -u, --unformatted print JSON output without indentation
2255
+
2256
+ DESCRIPTION
2257
+ Send this attribute if you want to set the payment source associated with the last succeeded authorization. At the end
2258
+ of the fix the order should be placed and authorized and ready to be approved. A tentative to fix the payment source
2259
+ is done before approval automatically. Cannot be passed by sales channels.
2260
+ ```
2261
+
2262
+ _See code: [src/commands/order/fix_payment_source.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/fix_payment_source.ts)_
2263
+
2076
2264
  ### `commercelayer order:fulfill ID`
2077
2265
 
2078
2266
  Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered). Cannot be passed by sales channels.
@@ -3986,6 +4174,50 @@ DESCRIPTION
3986
4174
 
3987
4175
  _See code: [src/commands/stripe_payment/update.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stripe_payment/update.ts)_
3988
4176
 
4177
+ ### `commercelayer vertex_account ID`
4178
+
4179
+ Execute an action on a resource of type vertex_accounts.
4180
+
4181
+ ```sh-session
4182
+ USAGE
4183
+ $ commercelayer vertex_account ID [-u [-j -p]]
4184
+
4185
+ ARGUMENTS
4186
+ ID the unique id of the resource
4187
+
4188
+ FLAGS
4189
+ -j, --json print result in JSON format
4190
+ -p, --print print out the modified resource
4191
+ -u, --unformatted print JSON output without indentation
4192
+
4193
+ DESCRIPTION
4194
+ execute an action on a resource of type vertex_accounts
4195
+ ```
4196
+
4197
+ _See code: [src/commands/vertex_account/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/vertex_account/index.ts)_
4198
+
4199
+ ### `commercelayer vertex_account:refresh_token ID`
4200
+
4201
+ Send this attribute if you want to manually refresh the access token.
4202
+
4203
+ ```sh-session
4204
+ USAGE
4205
+ $ commercelayer vertex_account:refresh_token ID [-u [-j -p]]
4206
+
4207
+ ARGUMENTS
4208
+ ID the unique id of the resource
4209
+
4210
+ FLAGS
4211
+ -j, --json print result in JSON format
4212
+ -p, --print print out the modified resource
4213
+ -u, --unformatted print JSON output without indentation
4214
+
4215
+ DESCRIPTION
4216
+ Send this attribute if you want to manually refresh the access token.
4217
+ ```
4218
+
4219
+ _See code: [src/commands/vertex_account/refresh_token.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/vertex_account/refresh_token.ts)_
4220
+
3989
4221
  ### `commercelayer void ID`
3990
4222
 
3991
4223
  Execute an action on a resource of type voids.
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AdyenPaymentAuthorize extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const adyen_payments_1 = require("../../triggers/adyen_payments");
6
+ const TRIGGER = 'authorize';
7
+ class AdyenPaymentAuthorize extends base_1.default {
8
+ static description = adyen_payments_1.triggers[TRIGGER].description;
9
+ static flags = {};
10
+ static args = {
11
+ ...base_1.default.args,
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(AdyenPaymentAuthorize);
15
+ const res = await this.executeAction('adyen_payments', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('adyen_payment', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = AdyenPaymentAuthorize;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CleanupIndex extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const exec_1 = tslib_1.__importDefault(require("../../exec"));
6
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
+ const cli_core_1 = require("@commercelayer/cli-core");
8
+ const cleanups_1 = require("../../triggers/cleanups");
9
+ const promptAction = async (id) => {
10
+ const answers = await inquirer_1.default.prompt([{
11
+ type: 'list',
12
+ name: 'trigger',
13
+ message: `Select an action to execute on cleanup ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(cleanups_1.triggers).sort().map(a => {
15
+ return { name: a, value: a };
16
+ }),
17
+ loop: false,
18
+ pageSize: 10,
19
+ }]);
20
+ return answers.trigger;
21
+ };
22
+ class CleanupIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type cleanups';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(CleanupIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('cleanups', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('cleanup', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = CleanupIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CleanupInterrupt extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const cleanups_1 = require("../../triggers/cleanups");
6
+ const TRIGGER = 'interrupt';
7
+ class CleanupInterrupt extends base_1.default {
8
+ static description = cleanups_1.triggers[TRIGGER].description;
9
+ static flags = {};
10
+ static args = {
11
+ ...base_1.default.args,
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(CleanupInterrupt);
15
+ const res = await this.executeAction('cleanups', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('cleanup', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = CleanupInterrupt;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ExportIndex extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const exec_1 = tslib_1.__importDefault(require("../../exec"));
6
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
+ const cli_core_1 = require("@commercelayer/cli-core");
8
+ const exports_1 = require("../../triggers/exports");
9
+ const promptAction = async (id) => {
10
+ const answers = await inquirer_1.default.prompt([{
11
+ type: 'list',
12
+ name: 'trigger',
13
+ message: `Select an action to execute on export ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(exports_1.triggers).sort().map(a => {
15
+ return { name: a, value: a };
16
+ }),
17
+ loop: false,
18
+ pageSize: 10,
19
+ }]);
20
+ return answers.trigger;
21
+ };
22
+ class ExportIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type exports';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(ExportIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('exports', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('export', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = ExportIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ExportInterrupt extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const exports_1 = require("../../triggers/exports");
6
+ const TRIGGER = 'interrupt';
7
+ class ExportInterrupt extends base_1.default {
8
+ static description = exports_1.triggers[TRIGGER].description;
9
+ static flags = {};
10
+ static args = {
11
+ ...base_1.default.args,
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(ExportInterrupt);
15
+ const res = await this.executeAction('exports', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('export', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ExportInterrupt;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ImportIndex extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const exec_1 = tslib_1.__importDefault(require("../../exec"));
6
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
+ const cli_core_1 = require("@commercelayer/cli-core");
8
+ const imports_1 = require("../../triggers/imports");
9
+ const promptAction = async (id) => {
10
+ const answers = await inquirer_1.default.prompt([{
11
+ type: 'list',
12
+ name: 'trigger',
13
+ message: `Select an action to execute on import ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(imports_1.triggers).sort().map(a => {
15
+ return { name: a, value: a };
16
+ }),
17
+ loop: false,
18
+ pageSize: 10,
19
+ }]);
20
+ return answers.trigger;
21
+ };
22
+ class ImportIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type imports';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(ImportIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('imports', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('import', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = ImportIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ImportInterrupt extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const imports_1 = require("../../triggers/imports");
6
+ const TRIGGER = 'interrupt';
7
+ class ImportInterrupt extends base_1.default {
8
+ static description = imports_1.triggers[TRIGGER].description;
9
+ static flags = {};
10
+ static args = {
11
+ ...base_1.default.args,
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(ImportInterrupt);
15
+ const res = await this.executeAction('imports', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('import', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ImportInterrupt;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class OrderFixPaymentSource extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../base"));
5
+ const orders_1 = require("../../triggers/orders");
6
+ const TRIGGER = 'fix_payment_source';
7
+ class OrderFixPaymentSource extends base_1.default {
8
+ static description = orders_1.triggers[TRIGGER].description;
9
+ static flags = {};
10
+ static args = {
11
+ ...base_1.default.args,
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(OrderFixPaymentSource);
15
+ const res = await this.executeAction('orders', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('order', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = OrderFixPaymentSource;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class VertexAccountIndex extends Command {
3
+ static description: string;
4
+ static flags: {};
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<any>;
9
+ }