@commercelayer/cli-plugin-triggers 3.2.1 → 3.4.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.
- package/README.md +204 -4
- package/lib/commands/order/commit_invoice.d.ts +18 -0
- package/lib/commands/order/commit_invoice.js +23 -0
- package/lib/commands/order/refund_invoice.d.ts +18 -0
- package/lib/commands/order/refund_invoice.js +23 -0
- package/lib/commands/payment_method/disable.d.ts +18 -0
- package/lib/commands/payment_method/disable.js +23 -0
- package/lib/commands/payment_method/enable.d.ts +18 -0
- package/lib/commands/payment_method/enable.js +23 -0
- package/lib/commands/payment_method/index.d.ts +18 -0
- package/lib/commands/payment_method/index.js +40 -0
- package/lib/commands/shipping_method/disable.d.ts +18 -0
- package/lib/commands/shipping_method/disable.js +23 -0
- package/lib/commands/shipping_method/enable.d.ts +18 -0
- package/lib/commands/shipping_method/enable.js +23 -0
- package/lib/commands/shipping_method/index.d.ts +18 -0
- package/lib/commands/shipping_method/index.js +40 -0
- package/lib/exec.d.ts +1 -1
- package/lib/triggers/orders.d.ts +1 -1
- package/lib/triggers/orders.js +11 -1
- package/lib/triggers/payment_methods.d.ts +5 -0
- package/lib/triggers/payment_methods.js +15 -0
- package/lib/triggers/shipping_methods.d.ts +5 -0
- package/lib/triggers/shipping_methods.js +15 -0
- package/oclif.manifest.json +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -16,11 +16,17 @@ Commerce Layer CLI Triggers plugin
|
|
|
16
16
|
<!-- usage -->
|
|
17
17
|
|
|
18
18
|
```sh-session
|
|
19
|
-
|
|
19
|
+
commercelayer COMMAND
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
commercelayer [COMMAND] (--help | -h) for detailed information about plugin commands.
|
|
22
22
|
```
|
|
23
23
|
<!-- usagestop -->
|
|
24
|
+
To install as a Commerce Layer CLI plugin run the following command:
|
|
25
|
+
|
|
26
|
+
```sh-session
|
|
27
|
+
$ commercelayer plugins:install triggers
|
|
28
|
+
```
|
|
29
|
+
|
|
24
30
|
## Commands
|
|
25
31
|
<!-- commands -->
|
|
26
32
|
|
|
@@ -61,11 +67,13 @@ $ commercelayer [COMMAND] (--help | -h) for detailed information about plugin co
|
|
|
61
67
|
* [`commercelayer order:billing_address_same_as_shipping ID`](#commercelayer-orderbilling_address_same_as_shipping-id)
|
|
62
68
|
* [`commercelayer order:cancel ID`](#commercelayer-ordercancel-id)
|
|
63
69
|
* [`commercelayer order:capture ID`](#commercelayer-ordercapture-id)
|
|
70
|
+
* [`commercelayer order:commit_invoice ID`](#commercelayer-ordercommit_invoice-id)
|
|
64
71
|
* [`commercelayer order:customer_payment_source_id ID`](#commercelayer-ordercustomer_payment_source_id-id)
|
|
65
72
|
* [`commercelayer order:nullify_payment_source ID`](#commercelayer-ordernullify_payment_source-id)
|
|
66
73
|
* [`commercelayer order:place ID`](#commercelayer-orderplace-id)
|
|
67
74
|
* [`commercelayer order:refresh ID`](#commercelayer-orderrefresh-id)
|
|
68
75
|
* [`commercelayer order:refund ID`](#commercelayer-orderrefund-id)
|
|
76
|
+
* [`commercelayer order:refund_invoice ID`](#commercelayer-orderrefund_invoice-id)
|
|
69
77
|
* [`commercelayer order:save_billing_address_to_customer_address_book ID`](#commercelayer-ordersave_billing_address_to_customer_address_book-id)
|
|
70
78
|
* [`commercelayer order:save_payment_source_to_customer_wallet ID`](#commercelayer-ordersave_payment_source_to_customer_wallet-id)
|
|
71
79
|
* [`commercelayer order:save_shipping_address_to_customer_address_book ID`](#commercelayer-ordersave_shipping_address_to_customer_address_book-id)
|
|
@@ -77,6 +85,9 @@ $ commercelayer [COMMAND] (--help | -h) for detailed information about plugin co
|
|
|
77
85
|
* [`commercelayer order_subscription:activate ID`](#commercelayer-order_subscriptionactivate-id)
|
|
78
86
|
* [`commercelayer order_subscription:cancel ID`](#commercelayer-order_subscriptioncancel-id)
|
|
79
87
|
* [`commercelayer order_subscription:deactivate ID`](#commercelayer-order_subscriptiondeactivate-id)
|
|
88
|
+
* [`commercelayer payment_method ID`](#commercelayer-payment_method-id)
|
|
89
|
+
* [`commercelayer payment_method:disable ID`](#commercelayer-payment_methoddisable-id)
|
|
90
|
+
* [`commercelayer payment_method:enable ID`](#commercelayer-payment_methodenable-id)
|
|
80
91
|
* [`commercelayer return ID`](#commercelayer-return-id)
|
|
81
92
|
* [`commercelayer return:approve ID`](#commercelayer-returnapprove-id)
|
|
82
93
|
* [`commercelayer return:archive ID`](#commercelayer-returnarchive-id)
|
|
@@ -97,6 +108,9 @@ $ commercelayer [COMMAND] (--help | -h) for detailed information about plugin co
|
|
|
97
108
|
* [`commercelayer shipment:purchase ID`](#commercelayer-shipmentpurchase-id)
|
|
98
109
|
* [`commercelayer shipment:ready_to_ship ID`](#commercelayer-shipmentready_to_ship-id)
|
|
99
110
|
* [`commercelayer shipment:ship ID`](#commercelayer-shipmentship-id)
|
|
111
|
+
* [`commercelayer shipping_method ID`](#commercelayer-shipping_method-id)
|
|
112
|
+
* [`commercelayer shipping_method:disable ID`](#commercelayer-shipping_methoddisable-id)
|
|
113
|
+
* [`commercelayer shipping_method:enable ID`](#commercelayer-shipping_methodenable-id)
|
|
100
114
|
* [`commercelayer stock_transfer ID`](#commercelayer-stock_transfer-id)
|
|
101
115
|
* [`commercelayer stock_transfer:cancel ID`](#commercelayer-stock_transfercancel-id)
|
|
102
116
|
* [`commercelayer stock_transfer:complete ID`](#commercelayer-stock_transfercomplete-id)
|
|
@@ -943,7 +957,7 @@ _See code: [src/commands/order/cancel.ts](https://github.com/commercelayer/comme
|
|
|
943
957
|
|
|
944
958
|
### `commercelayer order:capture ID`
|
|
945
959
|
|
|
946
|
-
Send this attribute if you want to capture an
|
|
960
|
+
Send this attribute if you want to capture an authorized order.
|
|
947
961
|
|
|
948
962
|
```sh-session
|
|
949
963
|
USAGE
|
|
@@ -959,11 +973,35 @@ FLAGS
|
|
|
959
973
|
-u, --unformatted print JSON output without indentation
|
|
960
974
|
|
|
961
975
|
DESCRIPTION
|
|
962
|
-
Send this attribute if you want to capture an
|
|
976
|
+
Send this attribute if you want to capture an authorized order.
|
|
963
977
|
```
|
|
964
978
|
|
|
965
979
|
_See code: [src/commands/order/capture.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/capture.ts)_
|
|
966
980
|
|
|
981
|
+
### `commercelayer order:commit_invoice ID`
|
|
982
|
+
|
|
983
|
+
Send this attribute if you want commit the sales tax invoice to the associated tax calculator (currently supported by Avalara).
|
|
984
|
+
|
|
985
|
+
```sh-session
|
|
986
|
+
USAGE
|
|
987
|
+
$ commercelayer order:commit_invoice [ID] -o <value> [-u [-j -p]]
|
|
988
|
+
|
|
989
|
+
ARGUMENTS
|
|
990
|
+
ID the unique id of the resource
|
|
991
|
+
|
|
992
|
+
FLAGS
|
|
993
|
+
-j, --json print result in JSON format
|
|
994
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
995
|
+
-p, --print print out the modified resource
|
|
996
|
+
-u, --unformatted print JSON output without indentation
|
|
997
|
+
|
|
998
|
+
DESCRIPTION
|
|
999
|
+
Send this attribute if you want commit the sales tax invoice to the associated tax calculator (currently supported by
|
|
1000
|
+
Avalara).
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
_See code: [src/commands/order/commit_invoice.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/commit_invoice.ts)_
|
|
1004
|
+
|
|
967
1005
|
### `commercelayer order:customer_payment_source_id ID`
|
|
968
1006
|
|
|
969
1007
|
The id of the customer payment source (i.e. credit card) that you want to use as the order's payment source.
|
|
@@ -1080,6 +1118,30 @@ DESCRIPTION
|
|
|
1080
1118
|
|
|
1081
1119
|
_See code: [src/commands/order/refund.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/refund.ts)_
|
|
1082
1120
|
|
|
1121
|
+
### `commercelayer order:refund_invoice ID`
|
|
1122
|
+
|
|
1123
|
+
Send this attribute if you want refund the sales tax invoice to the associated tax calculator (currently supported by Avalara).
|
|
1124
|
+
|
|
1125
|
+
```sh-session
|
|
1126
|
+
USAGE
|
|
1127
|
+
$ commercelayer order:refund_invoice [ID] -o <value> [-u [-j -p]]
|
|
1128
|
+
|
|
1129
|
+
ARGUMENTS
|
|
1130
|
+
ID the unique id of the resource
|
|
1131
|
+
|
|
1132
|
+
FLAGS
|
|
1133
|
+
-j, --json print result in JSON format
|
|
1134
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1135
|
+
-p, --print print out the modified resource
|
|
1136
|
+
-u, --unformatted print JSON output without indentation
|
|
1137
|
+
|
|
1138
|
+
DESCRIPTION
|
|
1139
|
+
Send this attribute if you want refund the sales tax invoice to the associated tax calculator (currently supported by
|
|
1140
|
+
Avalara).
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
_See code: [src/commands/order/refund_invoice.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/refund_invoice.ts)_
|
|
1144
|
+
|
|
1083
1145
|
### `commercelayer order:save_billing_address_to_customer_address_book ID`
|
|
1084
1146
|
|
|
1085
1147
|
Send this attribute if you want the order's billing address to be saved in the customer's address book as a customer address.
|
|
@@ -1338,6 +1400,75 @@ DESCRIPTION
|
|
|
1338
1400
|
|
|
1339
1401
|
_See code: [src/commands/order_subscription/deactivate.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order_subscription/deactivate.ts)_
|
|
1340
1402
|
|
|
1403
|
+
### `commercelayer payment_method ID`
|
|
1404
|
+
|
|
1405
|
+
Execute an action on a resource of type payment_methods.
|
|
1406
|
+
|
|
1407
|
+
```sh-session
|
|
1408
|
+
USAGE
|
|
1409
|
+
$ commercelayer payment_method [ID] -o <value> [-u [-j -p]]
|
|
1410
|
+
|
|
1411
|
+
ARGUMENTS
|
|
1412
|
+
ID the unique id of the resource
|
|
1413
|
+
|
|
1414
|
+
FLAGS
|
|
1415
|
+
-j, --json print result in JSON format
|
|
1416
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1417
|
+
-p, --print print out the modified resource
|
|
1418
|
+
-u, --unformatted print JSON output without indentation
|
|
1419
|
+
|
|
1420
|
+
DESCRIPTION
|
|
1421
|
+
execute an action on a resource of type payment_methods
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
_See code: [src/commands/payment_method/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/payment_method/index.ts)_
|
|
1425
|
+
|
|
1426
|
+
### `commercelayer payment_method:disable ID`
|
|
1427
|
+
|
|
1428
|
+
Send this attribute if you want to mark the payment method as disabled.
|
|
1429
|
+
|
|
1430
|
+
```sh-session
|
|
1431
|
+
USAGE
|
|
1432
|
+
$ commercelayer payment_method:disable [ID] -o <value> [-u [-j -p]]
|
|
1433
|
+
|
|
1434
|
+
ARGUMENTS
|
|
1435
|
+
ID the unique id of the resource
|
|
1436
|
+
|
|
1437
|
+
FLAGS
|
|
1438
|
+
-j, --json print result in JSON format
|
|
1439
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1440
|
+
-p, --print print out the modified resource
|
|
1441
|
+
-u, --unformatted print JSON output without indentation
|
|
1442
|
+
|
|
1443
|
+
DESCRIPTION
|
|
1444
|
+
Send this attribute if you want to mark the payment method as disabled.
|
|
1445
|
+
```
|
|
1446
|
+
|
|
1447
|
+
_See code: [src/commands/payment_method/disable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/payment_method/disable.ts)_
|
|
1448
|
+
|
|
1449
|
+
### `commercelayer payment_method:enable ID`
|
|
1450
|
+
|
|
1451
|
+
Send this attribute if you want to mark the payment method as enabled.
|
|
1452
|
+
|
|
1453
|
+
```sh-session
|
|
1454
|
+
USAGE
|
|
1455
|
+
$ commercelayer payment_method:enable [ID] -o <value> [-u [-j -p]]
|
|
1456
|
+
|
|
1457
|
+
ARGUMENTS
|
|
1458
|
+
ID the unique id of the resource
|
|
1459
|
+
|
|
1460
|
+
FLAGS
|
|
1461
|
+
-j, --json print result in JSON format
|
|
1462
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1463
|
+
-p, --print print out the modified resource
|
|
1464
|
+
-u, --unformatted print JSON output without indentation
|
|
1465
|
+
|
|
1466
|
+
DESCRIPTION
|
|
1467
|
+
Send this attribute if you want to mark the payment method as enabled.
|
|
1468
|
+
```
|
|
1469
|
+
|
|
1470
|
+
_See code: [src/commands/payment_method/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/payment_method/enable.ts)_
|
|
1471
|
+
|
|
1341
1472
|
### `commercelayer return ID`
|
|
1342
1473
|
|
|
1343
1474
|
Execute an action on a resource of type returns.
|
|
@@ -1798,6 +1929,75 @@ DESCRIPTION
|
|
|
1798
1929
|
|
|
1799
1930
|
_See code: [src/commands/shipment/ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ship.ts)_
|
|
1800
1931
|
|
|
1932
|
+
### `commercelayer shipping_method ID`
|
|
1933
|
+
|
|
1934
|
+
Execute an action on a resource of type shipping_methods.
|
|
1935
|
+
|
|
1936
|
+
```sh-session
|
|
1937
|
+
USAGE
|
|
1938
|
+
$ commercelayer shipping_method [ID] -o <value> [-u [-j -p]]
|
|
1939
|
+
|
|
1940
|
+
ARGUMENTS
|
|
1941
|
+
ID the unique id of the resource
|
|
1942
|
+
|
|
1943
|
+
FLAGS
|
|
1944
|
+
-j, --json print result in JSON format
|
|
1945
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1946
|
+
-p, --print print out the modified resource
|
|
1947
|
+
-u, --unformatted print JSON output without indentation
|
|
1948
|
+
|
|
1949
|
+
DESCRIPTION
|
|
1950
|
+
execute an action on a resource of type shipping_methods
|
|
1951
|
+
```
|
|
1952
|
+
|
|
1953
|
+
_See code: [src/commands/shipping_method/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/index.ts)_
|
|
1954
|
+
|
|
1955
|
+
### `commercelayer shipping_method:disable ID`
|
|
1956
|
+
|
|
1957
|
+
Send this attribute if you want to mark the shipping method as disabled.
|
|
1958
|
+
|
|
1959
|
+
```sh-session
|
|
1960
|
+
USAGE
|
|
1961
|
+
$ commercelayer shipping_method:disable [ID] -o <value> [-u [-j -p]]
|
|
1962
|
+
|
|
1963
|
+
ARGUMENTS
|
|
1964
|
+
ID the unique id of the resource
|
|
1965
|
+
|
|
1966
|
+
FLAGS
|
|
1967
|
+
-j, --json print result in JSON format
|
|
1968
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1969
|
+
-p, --print print out the modified resource
|
|
1970
|
+
-u, --unformatted print JSON output without indentation
|
|
1971
|
+
|
|
1972
|
+
DESCRIPTION
|
|
1973
|
+
Send this attribute if you want to mark the shipping method as disabled.
|
|
1974
|
+
```
|
|
1975
|
+
|
|
1976
|
+
_See code: [src/commands/shipping_method/disable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/disable.ts)_
|
|
1977
|
+
|
|
1978
|
+
### `commercelayer shipping_method:enable ID`
|
|
1979
|
+
|
|
1980
|
+
Send this attribute if you want to mark the shipping method as enabled.
|
|
1981
|
+
|
|
1982
|
+
```sh-session
|
|
1983
|
+
USAGE
|
|
1984
|
+
$ commercelayer shipping_method:enable [ID] -o <value> [-u [-j -p]]
|
|
1985
|
+
|
|
1986
|
+
ARGUMENTS
|
|
1987
|
+
ID the unique id of the resource
|
|
1988
|
+
|
|
1989
|
+
FLAGS
|
|
1990
|
+
-j, --json print result in JSON format
|
|
1991
|
+
-o, --organization=<value> (required) the slug of your organization
|
|
1992
|
+
-p, --print print out the modified resource
|
|
1993
|
+
-u, --unformatted print JSON output without indentation
|
|
1994
|
+
|
|
1995
|
+
DESCRIPTION
|
|
1996
|
+
Send this attribute if you want to mark the shipping method as enabled.
|
|
1997
|
+
```
|
|
1998
|
+
|
|
1999
|
+
_See code: [src/commands/shipping_method/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/enable.ts)_
|
|
2000
|
+
|
|
1801
2001
|
### `commercelayer stock_transfer ID`
|
|
1802
2002
|
|
|
1803
2003
|
Execute an action on a resource of type stock_transfers.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class OrderCommitInvoice extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 orders_1 = require("../../triggers/orders");
|
|
7
|
+
const TRIGGER = 'commit_invoice';
|
|
8
|
+
class OrderCommitInvoice extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(OrderCommitInvoice);
|
|
11
|
+
const res = await (0, exec_1.default)('orders', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('order', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = OrderCommitInvoice;
|
|
19
|
+
OrderCommitInvoice.description = orders_1.triggers[TRIGGER].description;
|
|
20
|
+
OrderCommitInvoice.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
OrderCommitInvoice.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class OrderRefundInvoice extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 orders_1 = require("../../triggers/orders");
|
|
7
|
+
const TRIGGER = 'refund_invoice';
|
|
8
|
+
class OrderRefundInvoice extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(OrderRefundInvoice);
|
|
11
|
+
const res = await (0, exec_1.default)('orders', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('order', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = OrderRefundInvoice;
|
|
19
|
+
OrderRefundInvoice.description = orders_1.triggers[TRIGGER].description;
|
|
20
|
+
OrderRefundInvoice.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
OrderRefundInvoice.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaymentMethodDisable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 payment_methods_1 = require("../../triggers/payment_methods");
|
|
7
|
+
const TRIGGER = 'disable';
|
|
8
|
+
class PaymentMethodDisable extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(PaymentMethodDisable);
|
|
11
|
+
const res = await (0, exec_1.default)('payment_methods', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('payment_method', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = PaymentMethodDisable;
|
|
19
|
+
PaymentMethodDisable.description = payment_methods_1.triggers[TRIGGER].description;
|
|
20
|
+
PaymentMethodDisable.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
PaymentMethodDisable.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaymentMethodEnable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 payment_methods_1 = require("../../triggers/payment_methods");
|
|
7
|
+
const TRIGGER = 'enable';
|
|
8
|
+
class PaymentMethodEnable extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(PaymentMethodEnable);
|
|
11
|
+
const res = await (0, exec_1.default)('payment_methods', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('payment_method', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = PaymentMethodEnable;
|
|
19
|
+
PaymentMethodEnable.description = payment_methods_1.triggers[TRIGGER].description;
|
|
20
|
+
PaymentMethodEnable.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
PaymentMethodEnable.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaymentMethodIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -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 chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const payment_methods_1 = require("../../triggers/payment_methods");
|
|
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 payment method ${chalk_1.default.yellowBright(id)}:`,
|
|
14
|
+
choices: Object.keys(payment_methods_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 PaymentMethodIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(PaymentMethodIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('payment_methods', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('payment method', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = PaymentMethodIndex;
|
|
36
|
+
PaymentMethodIndex.description = 'execute an action on a resource of type payment_methods';
|
|
37
|
+
PaymentMethodIndex.flags = Object.assign({}, base_1.default.flags);
|
|
38
|
+
PaymentMethodIndex.args = [
|
|
39
|
+
...base_1.default.args,
|
|
40
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShippingMethodDisable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 shipping_methods_1 = require("../../triggers/shipping_methods");
|
|
7
|
+
const TRIGGER = 'disable';
|
|
8
|
+
class ShippingMethodDisable extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(ShippingMethodDisable);
|
|
11
|
+
const res = await (0, exec_1.default)('shipping_methods', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('shipping_method', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = ShippingMethodDisable;
|
|
19
|
+
ShippingMethodDisable.description = shipping_methods_1.triggers[TRIGGER].description;
|
|
20
|
+
ShippingMethodDisable.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
ShippingMethodDisable.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShippingMethodEnable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 shipping_methods_1 = require("../../triggers/shipping_methods");
|
|
7
|
+
const TRIGGER = 'enable';
|
|
8
|
+
class ShippingMethodEnable extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(ShippingMethodEnable);
|
|
11
|
+
const res = await (0, exec_1.default)('shipping_methods', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('shipping_method', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = ShippingMethodEnable;
|
|
19
|
+
ShippingMethodEnable.description = shipping_methods_1.triggers[TRIGGER].description;
|
|
20
|
+
ShippingMethodEnable.flags = Object.assign({}, base_1.default.flags);
|
|
21
|
+
ShippingMethodEnable.args = [
|
|
22
|
+
...base_1.default.args,
|
|
23
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShippingMethodIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
run(): Promise<any>;
|
|
18
|
+
}
|
|
@@ -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 chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const shipping_methods_1 = require("../../triggers/shipping_methods");
|
|
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 shipping method ${chalk_1.default.yellowBright(id)}:`,
|
|
14
|
+
choices: Object.keys(shipping_methods_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 ShippingMethodIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(ShippingMethodIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('shipping_methods', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('shipping method', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = ShippingMethodIndex;
|
|
36
|
+
ShippingMethodIndex.description = 'execute an action on a resource of type shipping_methods';
|
|
37
|
+
ShippingMethodIndex.flags = Object.assign({}, base_1.default.flags);
|
|
38
|
+
ShippingMethodIndex.args = [
|
|
39
|
+
...base_1.default.args,
|
|
40
|
+
];
|