@commercelayer/cli-plugin-triggers 4.9.0 → 4.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -0
- package/lib/commands/cleanup/index.d.ts +9 -0
- package/lib/commands/cleanup/index.js +40 -0
- package/lib/commands/cleanup/interrupt.d.ts +9 -0
- package/lib/commands/cleanup/interrupt.js +22 -0
- package/lib/commands/export/index.d.ts +9 -0
- package/lib/commands/export/index.js +40 -0
- package/lib/commands/export/interrupt.d.ts +9 -0
- package/lib/commands/export/interrupt.js +22 -0
- package/lib/commands/import/index.d.ts +9 -0
- package/lib/commands/import/index.js +40 -0
- package/lib/commands/import/interrupt.d.ts +9 -0
- package/lib/commands/import/interrupt.js +22 -0
- package/lib/commands/order/fix_payment_source.d.ts +9 -0
- package/lib/commands/order/fix_payment_source.js +22 -0
- package/lib/commands/vertex_account/index.d.ts +9 -0
- package/lib/commands/vertex_account/index.js +40 -0
- package/lib/commands/vertex_account/refresh_token.d.ts +9 -0
- package/lib/commands/vertex_account/refresh_token.js +22 -0
- package/lib/triggers/cleanups.d.ts +3 -0
- package/lib/triggers/cleanups.js +10 -0
- package/lib/triggers/exports.d.ts +3 -0
- package/lib/triggers/exports.js +10 -0
- package/lib/triggers/imports.d.ts +3 -0
- package/lib/triggers/imports.js +10 -0
- package/lib/triggers/orders.d.ts +1 -1
- package/lib/triggers/orders.js +5 -0
- package/lib/triggers/vertex_accounts.d.ts +3 -0
- package/lib/triggers/vertex_accounts.js +10 -0
- package/oclif.manifest.json +936 -144
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -54,10 +54,14 @@ $ commercelayer plugins:install triggers
|
|
|
54
54
|
* [`commercelayer checkout_com_payment ID`](#commercelayer-checkout_com_payment-id)
|
|
55
55
|
* [`commercelayer checkout_com_payment:details ID`](#commercelayer-checkout_com_paymentdetails-id)
|
|
56
56
|
* [`commercelayer checkout_com_payment:refresh ID`](#commercelayer-checkout_com_paymentrefresh-id)
|
|
57
|
+
* [`commercelayer cleanup ID`](#commercelayer-cleanup-id)
|
|
58
|
+
* [`commercelayer cleanup:interrupt ID`](#commercelayer-cleanupinterrupt-id)
|
|
57
59
|
* [`commercelayer customer_password_reset ID`](#commercelayer-customer_password_reset-id)
|
|
58
60
|
* [`commercelayer customer_password_reset:reset_password_token ID`](#commercelayer-customer_password_resetreset_password_token-id)
|
|
59
61
|
* [`commercelayer event ID`](#commercelayer-event-id)
|
|
60
62
|
* [`commercelayer event:trigger ID`](#commercelayer-eventtrigger-id)
|
|
63
|
+
* [`commercelayer export ID`](#commercelayer-export-id)
|
|
64
|
+
* [`commercelayer export:interrupt ID`](#commercelayer-exportinterrupt-id)
|
|
61
65
|
* [`commercelayer external_gateway ID`](#commercelayer-external_gateway-id)
|
|
62
66
|
* [`commercelayer external_gateway:reset_circuit ID`](#commercelayer-external_gatewayreset_circuit-id)
|
|
63
67
|
* [`commercelayer external_promotion ID`](#commercelayer-external_promotion-id)
|
|
@@ -86,6 +90,8 @@ $ commercelayer plugins:install triggers
|
|
|
86
90
|
* [`commercelayer gift_card:balance_change_cents ID`](#commercelayer-gift_cardbalance_change_cents-id)
|
|
87
91
|
* [`commercelayer gift_card:deactivate ID`](#commercelayer-gift_carddeactivate-id)
|
|
88
92
|
* [`commercelayer gift_card:purchase ID`](#commercelayer-gift_cardpurchase-id)
|
|
93
|
+
* [`commercelayer import ID`](#commercelayer-import-id)
|
|
94
|
+
* [`commercelayer import:interrupt ID`](#commercelayer-importinterrupt-id)
|
|
89
95
|
* [`commercelayer in_stock_subscription ID`](#commercelayer-in_stock_subscription-id)
|
|
90
96
|
* [`commercelayer in_stock_subscription:activate ID`](#commercelayer-in_stock_subscriptionactivate-id)
|
|
91
97
|
* [`commercelayer in_stock_subscription:deactivate ID`](#commercelayer-in_stock_subscriptiondeactivate-id)
|
|
@@ -114,6 +120,7 @@ $ commercelayer plugins:install triggers
|
|
|
114
120
|
* [`commercelayer order:commit_invoice ID`](#commercelayer-ordercommit_invoice-id)
|
|
115
121
|
* [`commercelayer order:create_subscriptions ID`](#commercelayer-ordercreate_subscriptions-id)
|
|
116
122
|
* [`commercelayer order:customer_payment_source_id ID`](#commercelayer-ordercustomer_payment_source_id-id)
|
|
123
|
+
* [`commercelayer order:fix_payment_source ID`](#commercelayer-orderfix_payment_source-id)
|
|
117
124
|
* [`commercelayer order:fulfill ID`](#commercelayer-orderfulfill-id)
|
|
118
125
|
* [`commercelayer order:nullify_payment_source ID`](#commercelayer-ordernullify_payment_source-id)
|
|
119
126
|
* [`commercelayer order:pending ID`](#commercelayer-orderpending-id)
|
|
@@ -200,6 +207,8 @@ $ commercelayer plugins:install triggers
|
|
|
200
207
|
* [`commercelayer stripe_payment ID`](#commercelayer-stripe_payment-id)
|
|
201
208
|
* [`commercelayer stripe_payment:refresh ID`](#commercelayer-stripe_paymentrefresh-id)
|
|
202
209
|
* [`commercelayer stripe_payment:update ID`](#commercelayer-stripe_paymentupdate-id)
|
|
210
|
+
* [`commercelayer vertex_account ID`](#commercelayer-vertex_account-id)
|
|
211
|
+
* [`commercelayer vertex_account:refresh_token ID`](#commercelayer-vertex_accountrefresh_token-id)
|
|
203
212
|
* [`commercelayer void ID`](#commercelayer-void-id)
|
|
204
213
|
* [`commercelayer void:forward ID`](#commercelayer-voidforward-id)
|
|
205
214
|
* [`commercelayer webhook ID`](#commercelayer-webhook-id)
|
|
@@ -739,6 +748,50 @@ DESCRIPTION
|
|
|
739
748
|
|
|
740
749
|
_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
750
|
|
|
751
|
+
### `commercelayer cleanup ID`
|
|
752
|
+
|
|
753
|
+
Execute an action on a resource of type cleanups.
|
|
754
|
+
|
|
755
|
+
```sh-session
|
|
756
|
+
USAGE
|
|
757
|
+
$ commercelayer cleanup ID [-u [-j -p]]
|
|
758
|
+
|
|
759
|
+
ARGUMENTS
|
|
760
|
+
ID the unique id of the resource
|
|
761
|
+
|
|
762
|
+
FLAGS
|
|
763
|
+
-j, --json print result in JSON format
|
|
764
|
+
-p, --print print out the modified resource
|
|
765
|
+
-u, --unformatted print JSON output without indentation
|
|
766
|
+
|
|
767
|
+
DESCRIPTION
|
|
768
|
+
execute an action on a resource of type cleanups
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
_See code: [src/commands/cleanup/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/cleanup/index.ts)_
|
|
772
|
+
|
|
773
|
+
### `commercelayer cleanup:interrupt ID`
|
|
774
|
+
|
|
775
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
776
|
+
|
|
777
|
+
```sh-session
|
|
778
|
+
USAGE
|
|
779
|
+
$ commercelayer cleanup:interrupt ID [-u [-j -p]]
|
|
780
|
+
|
|
781
|
+
ARGUMENTS
|
|
782
|
+
ID the unique id of the resource
|
|
783
|
+
|
|
784
|
+
FLAGS
|
|
785
|
+
-j, --json print result in JSON format
|
|
786
|
+
-p, --print print out the modified resource
|
|
787
|
+
-u, --unformatted print JSON output without indentation
|
|
788
|
+
|
|
789
|
+
DESCRIPTION
|
|
790
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
_See code: [src/commands/cleanup/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/cleanup/interrupt.ts)_
|
|
794
|
+
|
|
742
795
|
### `commercelayer customer_password_reset ID`
|
|
743
796
|
|
|
744
797
|
Execute an action on a resource of type customer_password_resets.
|
|
@@ -827,6 +880,50 @@ DESCRIPTION
|
|
|
827
880
|
|
|
828
881
|
_See code: [src/commands/event/trigger.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/event/trigger.ts)_
|
|
829
882
|
|
|
883
|
+
### `commercelayer export ID`
|
|
884
|
+
|
|
885
|
+
Execute an action on a resource of type exports.
|
|
886
|
+
|
|
887
|
+
```sh-session
|
|
888
|
+
USAGE
|
|
889
|
+
$ commercelayer export ID [-u [-j -p]]
|
|
890
|
+
|
|
891
|
+
ARGUMENTS
|
|
892
|
+
ID the unique id of the resource
|
|
893
|
+
|
|
894
|
+
FLAGS
|
|
895
|
+
-j, --json print result in JSON format
|
|
896
|
+
-p, --print print out the modified resource
|
|
897
|
+
-u, --unformatted print JSON output without indentation
|
|
898
|
+
|
|
899
|
+
DESCRIPTION
|
|
900
|
+
execute an action on a resource of type exports
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
_See code: [src/commands/export/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/export/index.ts)_
|
|
904
|
+
|
|
905
|
+
### `commercelayer export:interrupt ID`
|
|
906
|
+
|
|
907
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
908
|
+
|
|
909
|
+
```sh-session
|
|
910
|
+
USAGE
|
|
911
|
+
$ commercelayer export:interrupt ID [-u [-j -p]]
|
|
912
|
+
|
|
913
|
+
ARGUMENTS
|
|
914
|
+
ID the unique id of the resource
|
|
915
|
+
|
|
916
|
+
FLAGS
|
|
917
|
+
-j, --json print result in JSON format
|
|
918
|
+
-p, --print print out the modified resource
|
|
919
|
+
-u, --unformatted print JSON output without indentation
|
|
920
|
+
|
|
921
|
+
DESCRIPTION
|
|
922
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
_See code: [src/commands/export/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/export/interrupt.ts)_
|
|
926
|
+
|
|
830
927
|
### `commercelayer external_gateway ID`
|
|
831
928
|
|
|
832
929
|
Execute an action on a resource of type external_gateways.
|
|
@@ -1448,6 +1545,50 @@ DESCRIPTION
|
|
|
1448
1545
|
|
|
1449
1546
|
_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
1547
|
|
|
1548
|
+
### `commercelayer import ID`
|
|
1549
|
+
|
|
1550
|
+
Execute an action on a resource of type imports.
|
|
1551
|
+
|
|
1552
|
+
```sh-session
|
|
1553
|
+
USAGE
|
|
1554
|
+
$ commercelayer import ID [-u [-j -p]]
|
|
1555
|
+
|
|
1556
|
+
ARGUMENTS
|
|
1557
|
+
ID the unique id of the resource
|
|
1558
|
+
|
|
1559
|
+
FLAGS
|
|
1560
|
+
-j, --json print result in JSON format
|
|
1561
|
+
-p, --print print out the modified resource
|
|
1562
|
+
-u, --unformatted print JSON output without indentation
|
|
1563
|
+
|
|
1564
|
+
DESCRIPTION
|
|
1565
|
+
execute an action on a resource of type imports
|
|
1566
|
+
```
|
|
1567
|
+
|
|
1568
|
+
_See code: [src/commands/import/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/import/index.ts)_
|
|
1569
|
+
|
|
1570
|
+
### `commercelayer import:interrupt ID`
|
|
1571
|
+
|
|
1572
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
1573
|
+
|
|
1574
|
+
```sh-session
|
|
1575
|
+
USAGE
|
|
1576
|
+
$ commercelayer import:interrupt ID [-u [-j -p]]
|
|
1577
|
+
|
|
1578
|
+
ARGUMENTS
|
|
1579
|
+
ID the unique id of the resource
|
|
1580
|
+
|
|
1581
|
+
FLAGS
|
|
1582
|
+
-j, --json print result in JSON format
|
|
1583
|
+
-p, --print print out the modified resource
|
|
1584
|
+
-u, --unformatted print JSON output without indentation
|
|
1585
|
+
|
|
1586
|
+
DESCRIPTION
|
|
1587
|
+
Send this attribute if you want to mark status as 'interrupted'.
|
|
1588
|
+
```
|
|
1589
|
+
|
|
1590
|
+
_See code: [src/commands/import/interrupt.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/import/interrupt.ts)_
|
|
1591
|
+
|
|
1451
1592
|
### `commercelayer in_stock_subscription ID`
|
|
1452
1593
|
|
|
1453
1594
|
Execute an action on a resource of type in_stock_subscriptions.
|
|
@@ -2073,6 +2214,29 @@ DESCRIPTION
|
|
|
2073
2214
|
|
|
2074
2215
|
_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
2216
|
|
|
2217
|
+
### `commercelayer order:fix_payment_source ID`
|
|
2218
|
+
|
|
2219
|
+
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 for approval. Cannot be passed by sales channels.
|
|
2220
|
+
|
|
2221
|
+
```sh-session
|
|
2222
|
+
USAGE
|
|
2223
|
+
$ commercelayer order:fix_payment_source ID [-u [-j -p]]
|
|
2224
|
+
|
|
2225
|
+
ARGUMENTS
|
|
2226
|
+
ID the unique id of the resource
|
|
2227
|
+
|
|
2228
|
+
FLAGS
|
|
2229
|
+
-j, --json print result in JSON format
|
|
2230
|
+
-p, --print print out the modified resource
|
|
2231
|
+
-u, --unformatted print JSON output without indentation
|
|
2232
|
+
|
|
2233
|
+
DESCRIPTION
|
|
2234
|
+
Send this attribute if you want to set the payment source associated with the last succeeded authorization. At the end
|
|
2235
|
+
of the fix the order should be placed and authorized and ready for approval. Cannot be passed by sales channels.
|
|
2236
|
+
```
|
|
2237
|
+
|
|
2238
|
+
_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)_
|
|
2239
|
+
|
|
2076
2240
|
### `commercelayer order:fulfill ID`
|
|
2077
2241
|
|
|
2078
2242
|
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 +4150,50 @@ DESCRIPTION
|
|
|
3986
4150
|
|
|
3987
4151
|
_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
4152
|
|
|
4153
|
+
### `commercelayer vertex_account ID`
|
|
4154
|
+
|
|
4155
|
+
Execute an action on a resource of type vertex_accounts.
|
|
4156
|
+
|
|
4157
|
+
```sh-session
|
|
4158
|
+
USAGE
|
|
4159
|
+
$ commercelayer vertex_account ID [-u [-j -p]]
|
|
4160
|
+
|
|
4161
|
+
ARGUMENTS
|
|
4162
|
+
ID the unique id of the resource
|
|
4163
|
+
|
|
4164
|
+
FLAGS
|
|
4165
|
+
-j, --json print result in JSON format
|
|
4166
|
+
-p, --print print out the modified resource
|
|
4167
|
+
-u, --unformatted print JSON output without indentation
|
|
4168
|
+
|
|
4169
|
+
DESCRIPTION
|
|
4170
|
+
execute an action on a resource of type vertex_accounts
|
|
4171
|
+
```
|
|
4172
|
+
|
|
4173
|
+
_See code: [src/commands/vertex_account/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/vertex_account/index.ts)_
|
|
4174
|
+
|
|
4175
|
+
### `commercelayer vertex_account:refresh_token ID`
|
|
4176
|
+
|
|
4177
|
+
Send this attribute if you want to manually refresh the access token.
|
|
4178
|
+
|
|
4179
|
+
```sh-session
|
|
4180
|
+
USAGE
|
|
4181
|
+
$ commercelayer vertex_account:refresh_token ID [-u [-j -p]]
|
|
4182
|
+
|
|
4183
|
+
ARGUMENTS
|
|
4184
|
+
ID the unique id of the resource
|
|
4185
|
+
|
|
4186
|
+
FLAGS
|
|
4187
|
+
-j, --json print result in JSON format
|
|
4188
|
+
-p, --print print out the modified resource
|
|
4189
|
+
-u, --unformatted print JSON output without indentation
|
|
4190
|
+
|
|
4191
|
+
DESCRIPTION
|
|
4192
|
+
Send this attribute if you want to manually refresh the access token.
|
|
4193
|
+
```
|
|
4194
|
+
|
|
4195
|
+
_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)_
|
|
4196
|
+
|
|
3989
4197
|
### `commercelayer void ID`
|
|
3990
4198
|
|
|
3991
4199
|
Execute an action on a resource of type voids.
|
|
@@ -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
|
+
}
|
|
@@ -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 vertex_accounts_1 = require("../../triggers/vertex_accounts");
|
|
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 vertex account ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(vertex_accounts_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 VertexAccountIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type vertex_accounts';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(VertexAccountIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('vertex_accounts', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('vertex account', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = VertexAccountIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class VertexAccountRefreshToken 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 vertex_accounts_1 = require("../../triggers/vertex_accounts");
|
|
6
|
+
const TRIGGER = 'refresh_token';
|
|
7
|
+
class VertexAccountRefreshToken extends base_1.default {
|
|
8
|
+
static description = vertex_accounts_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(VertexAccountRefreshToken);
|
|
15
|
+
const res = await this.executeAction('vertex_accounts', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('vertex_account', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = VertexAccountRefreshToken;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggers = void 0;
|
|
4
|
+
exports.triggers = {
|
|
5
|
+
interrupt: {
|
|
6
|
+
action: 'interrupt',
|
|
7
|
+
trigger: '_interrupt',
|
|
8
|
+
description: 'Send this attribute if you want to mark status as \'interrupted\'.',
|
|
9
|
+
},
|
|
10
|
+
};
|