@commercelayer/cli-plugin-triggers 4.9.2 → 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 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)
@@ -58,6 +59,8 @@ $ commercelayer plugins:install triggers
58
59
  * [`commercelayer cleanup:interrupt ID`](#commercelayer-cleanupinterrupt-id)
59
60
  * [`commercelayer customer_password_reset ID`](#commercelayer-customer_password_reset-id)
60
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)
61
64
  * [`commercelayer event ID`](#commercelayer-event-id)
62
65
  * [`commercelayer event:trigger ID`](#commercelayer-eventtrigger-id)
63
66
  * [`commercelayer export ID`](#commercelayer-export-id)
@@ -238,6 +241,28 @@ DESCRIPTION
238
241
 
239
242
  _See code: [src/commands/adyen_payment/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/adyen_payment/index.ts)_
240
243
 
244
+ ### `commercelayer adyen_payment:authorize ID`
245
+
246
+ Send this attribute if you want to authorize the payment.
247
+
248
+ ```sh-session
249
+ USAGE
250
+ $ commercelayer adyen_payment:authorize ID [-u [-j -p]]
251
+
252
+ ARGUMENTS
253
+ ID the unique id of the resource
254
+
255
+ FLAGS
256
+ -j, --json print result in JSON format
257
+ -p, --print print out the modified resource
258
+ -u, --unformatted print JSON output without indentation
259
+
260
+ DESCRIPTION
261
+ Send this attribute if you want to authorize the payment.
262
+ ```
263
+
264
+ _See code: [src/commands/adyen_payment/authorize.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/adyen_payment/authorize.ts)_
265
+
241
266
  ### `commercelayer adyen_payment:details ID`
242
267
 
243
268
  Send this attribute if you want to send additional details the payment request.
@@ -836,6 +861,50 @@ DESCRIPTION
836
861
 
837
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)_
838
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
+
839
908
  ### `commercelayer event ID`
840
909
 
841
910
  Execute an action on a resource of type events.
@@ -2216,7 +2285,7 @@ _See code: [src/commands/order/customer_payment_source_id.ts](https://github.com
2216
2285
 
2217
2286
  ### `commercelayer order:fix_payment_source ID`
2218
2287
 
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.
2288
+ 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.
2220
2289
 
2221
2290
  ```sh-session
2222
2291
  USAGE
@@ -2232,14 +2301,15 @@ FLAGS
2232
2301
 
2233
2302
  DESCRIPTION
2234
2303
  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.
2304
+ of the fix the order should be placed and authorized and ready to be approved. A tentative to fix the payment source
2305
+ is done before approval automatically. Cannot be passed by sales channels.
2236
2306
  ```
2237
2307
 
2238
2308
  _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
2309
 
2240
2310
  ### `commercelayer order:fulfill ID`
2241
2311
 
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.
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.
2243
2313
 
2244
2314
  ```sh-session
2245
2315
  USAGE
@@ -2254,8 +2324,8 @@ FLAGS
2254
2324
  -u, --unformatted print JSON output without indentation
2255
2325
 
2256
2326
  DESCRIPTION
2257
- Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered).
2258
- 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.
2259
2329
  ```
2260
2330
 
2261
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 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 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;
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'details';
3
+ export type ActionType = 'authorize' | 'details';
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.triggers = void 0;
4
4
  exports.triggers = {
5
+ authorize: {
6
+ action: 'authorize',
7
+ trigger: '_authorize',
8
+ description: 'Send this attribute if you want to authorize the payment.',
9
+ },
5
10
  details: {
6
11
  action: 'details',
7
12
  trigger: '_details',
@@ -0,0 +1,3 @@
1
+ import type { Trigger } from '../common';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'purchase';
@@ -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
+ };
@@ -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',
@@ -75,7 +75,7 @@ exports.triggers = {
75
75
  fix_payment_source: {
76
76
  action: 'fix_payment_source',
77
77
  trigger: '_fix_payment_source',
78
- description: '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.',
78
+ description: '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.',
79
79
  },
80
80
  billing_address_clone_id: {
81
81
  action: 'billing_address_clone_id',