@commercelayer/cli-plugin-triggers 4.10.0 → 4.11.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 +49 -3
- package/lib/commands/easypost_pickup/index.d.ts +9 -0
- package/lib/commands/easypost_pickup/index.js +40 -0
- package/lib/commands/easypost_pickup/purchase.d.ts +9 -0
- package/lib/commands/easypost_pickup/purchase.js +22 -0
- package/lib/triggers/easypost_pickups.d.ts +3 -0
- package/lib/triggers/easypost_pickups.js +10 -0
- package/lib/triggers/orders.js +1 -1
- package/oclif.manifest.json +381 -205
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -59,6 +59,8 @@ $ commercelayer plugins:install triggers
|
|
|
59
59
|
* [`commercelayer cleanup:interrupt ID`](#commercelayer-cleanupinterrupt-id)
|
|
60
60
|
* [`commercelayer customer_password_reset ID`](#commercelayer-customer_password_reset-id)
|
|
61
61
|
* [`commercelayer customer_password_reset:reset_password_token ID`](#commercelayer-customer_password_resetreset_password_token-id)
|
|
62
|
+
* [`commercelayer easypost_pickup ID`](#commercelayer-easypost_pickup-id)
|
|
63
|
+
* [`commercelayer easypost_pickup:purchase ID`](#commercelayer-easypost_pickuppurchase-id)
|
|
62
64
|
* [`commercelayer event ID`](#commercelayer-event-id)
|
|
63
65
|
* [`commercelayer event:trigger ID`](#commercelayer-eventtrigger-id)
|
|
64
66
|
* [`commercelayer export ID`](#commercelayer-export-id)
|
|
@@ -859,6 +861,50 @@ DESCRIPTION
|
|
|
859
861
|
|
|
860
862
|
_See code: [src/commands/customer_password_reset/reset_password_token.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/customer_password_reset/reset_password_token.ts)_
|
|
861
863
|
|
|
864
|
+
### `commercelayer easypost_pickup ID`
|
|
865
|
+
|
|
866
|
+
Execute an action on a resource of type easypost_pickups.
|
|
867
|
+
|
|
868
|
+
```sh-session
|
|
869
|
+
USAGE
|
|
870
|
+
$ commercelayer easypost_pickup ID [-u [-j -p]]
|
|
871
|
+
|
|
872
|
+
ARGUMENTS
|
|
873
|
+
ID the unique id of the resource
|
|
874
|
+
|
|
875
|
+
FLAGS
|
|
876
|
+
-j, --json print result in JSON format
|
|
877
|
+
-p, --print print out the modified resource
|
|
878
|
+
-u, --unformatted print JSON output without indentation
|
|
879
|
+
|
|
880
|
+
DESCRIPTION
|
|
881
|
+
execute an action on a resource of type easypost_pickups
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
_See code: [src/commands/easypost_pickup/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/easypost_pickup/index.ts)_
|
|
885
|
+
|
|
886
|
+
### `commercelayer easypost_pickup:purchase ID`
|
|
887
|
+
|
|
888
|
+
Send this attribute if you want to purchase this pick up with the selected rate.
|
|
889
|
+
|
|
890
|
+
```sh-session
|
|
891
|
+
USAGE
|
|
892
|
+
$ commercelayer easypost_pickup:purchase ID [-u [-j -p]]
|
|
893
|
+
|
|
894
|
+
ARGUMENTS
|
|
895
|
+
ID the unique id of the resource
|
|
896
|
+
|
|
897
|
+
FLAGS
|
|
898
|
+
-j, --json print result in JSON format
|
|
899
|
+
-p, --print print out the modified resource
|
|
900
|
+
-u, --unformatted print JSON output without indentation
|
|
901
|
+
|
|
902
|
+
DESCRIPTION
|
|
903
|
+
Send this attribute if you want to purchase this pick up with the selected rate.
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
_See code: [src/commands/easypost_pickup/purchase.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/easypost_pickup/purchase.ts)_
|
|
907
|
+
|
|
862
908
|
### `commercelayer event ID`
|
|
863
909
|
|
|
864
910
|
Execute an action on a resource of type events.
|
|
@@ -2263,7 +2309,7 @@ _See code: [src/commands/order/fix_payment_source.ts](https://github.com/commerc
|
|
|
2263
2309
|
|
|
2264
2310
|
### `commercelayer order:fulfill ID`
|
|
2265
2311
|
|
|
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.
|
|
2312
|
+
Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered, alternatively order must be approved). Cannot be passed by sales channels.
|
|
2267
2313
|
|
|
2268
2314
|
```sh-session
|
|
2269
2315
|
USAGE
|
|
@@ -2278,8 +2324,8 @@ FLAGS
|
|
|
2278
2324
|
-u, --unformatted print JSON output without indentation
|
|
2279
2325
|
|
|
2280
2326
|
DESCRIPTION
|
|
2281
|
-
Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered
|
|
2282
|
-
Cannot be passed by sales channels.
|
|
2327
|
+
Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered,
|
|
2328
|
+
alternatively order must be approved). Cannot be passed by sales channels.
|
|
2283
2329
|
```
|
|
2284
2330
|
|
|
2285
2331
|
_See code: [src/commands/order/fulfill.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/fulfill.ts)_
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class EasypostPickupIndex 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 easypost_pickups_1 = require("../../triggers/easypost_pickups");
|
|
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 easypost pickup ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(easypost_pickups_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 EasypostPickupIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type easypost_pickups';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(EasypostPickupIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('easypost_pickups', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('easypost pickup', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = EasypostPickupIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class EasypostPickupPurchase 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 easypost_pickups_1 = require("../../triggers/easypost_pickups");
|
|
6
|
+
const TRIGGER = 'purchase';
|
|
7
|
+
class EasypostPickupPurchase extends base_1.default {
|
|
8
|
+
static description = easypost_pickups_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(EasypostPickupPurchase);
|
|
15
|
+
const res = await this.executeAction('easypost_pickups', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('easypost_pickup', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = EasypostPickupPurchase;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggers = void 0;
|
|
4
|
+
exports.triggers = {
|
|
5
|
+
purchase: {
|
|
6
|
+
action: 'purchase',
|
|
7
|
+
trigger: '_purchase',
|
|
8
|
+
description: 'Send this attribute if you want to purchase this pick up with the selected rate.',
|
|
9
|
+
},
|
|
10
|
+
};
|
package/lib/triggers/orders.js
CHANGED
|
@@ -60,7 +60,7 @@ exports.triggers = {
|
|
|
60
60
|
fulfill: {
|
|
61
61
|
action: 'fulfill',
|
|
62
62
|
trigger: '_fulfill',
|
|
63
|
-
description: '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.',
|
|
63
|
+
description: 'Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered, alternatively order must be approved). Cannot be passed by sales channels.',
|
|
64
64
|
},
|
|
65
65
|
update_taxes: {
|
|
66
66
|
action: 'update_taxes',
|