@commercelayer/cli-plugin-triggers 3.14.0 → 3.15.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 +167 -2
- package/lib/base.d.ts +1 -0
- package/lib/base.js +5 -0
- package/lib/commands/adyen_payment/details.js +1 -2
- package/lib/commands/authorization/capture.js +1 -2
- package/lib/commands/authorization/capture_amount_cents.js +1 -2
- package/lib/commands/authorization/void.js +1 -2
- package/lib/commands/axerve_payment/update.js +1 -2
- package/lib/commands/bundle/compute_compare_at_amount.js +1 -2
- package/lib/commands/bundle/compute_price_amount.js +1 -2
- package/lib/commands/buy_x_pay_y_promotion/disable.js +1 -2
- package/lib/commands/buy_x_pay_y_promotion/enable.js +1 -2
- package/lib/commands/capture/refund.js +1 -2
- package/lib/commands/capture/refund_amount_cents.js +1 -2
- package/lib/commands/checkout_com_payment/details.js +1 -2
- package/lib/commands/checkout_com_payment/refresh.js +1 -2
- package/lib/commands/customer_password_reset/reset_password_token.js +1 -2
- package/lib/commands/external_promotion/disable.js +1 -2
- package/lib/commands/external_promotion/enable.js +1 -2
- package/lib/commands/fixed_amount_promotion/disable.js +1 -2
- package/lib/commands/fixed_amount_promotion/enable.js +1 -2
- package/lib/commands/fixed_price_promotion/disable.js +1 -2
- package/lib/commands/fixed_price_promotion/enable.js +1 -2
- package/lib/commands/free_gift_promotion/disable.js +1 -2
- package/lib/commands/free_gift_promotion/enable.js +1 -2
- package/lib/commands/free_shipping_promotion/disable.js +1 -2
- package/lib/commands/free_shipping_promotion/enable.js +1 -2
- package/lib/commands/gift_card/activate.js +1 -2
- package/lib/commands/gift_card/balance_change_cents.js +1 -2
- package/lib/commands/gift_card/deactivate.js +1 -2
- package/lib/commands/gift_card/purchase.js +1 -2
- package/lib/commands/in_stock_subscription/activate.js +1 -2
- package/lib/commands/in_stock_subscription/deactivate.js +1 -2
- package/lib/commands/klarna_payment/update.js +1 -2
- package/lib/commands/line_item/external_price.js +1 -2
- package/lib/commands/line_item/reserve_stock.js +1 -2
- package/lib/commands/market/disable.js +1 -2
- package/lib/commands/market/enable.js +1 -2
- package/lib/commands/order/approve.js +1 -2
- package/lib/commands/order/approve_and_capture.js +1 -2
- package/lib/commands/order/archive.js +1 -2
- package/lib/commands/order/authorization_amount_cents.js +1 -2
- package/lib/commands/order/authorize.js +1 -2
- package/lib/commands/order/billing_address_clone_id.js +1 -2
- package/lib/commands/order/billing_address_same_as_shipping.js +1 -2
- package/lib/commands/order/cancel.js +1 -2
- package/lib/commands/order/capture.js +1 -2
- package/lib/commands/order/commit_invoice.js +1 -2
- package/lib/commands/order/create_subscriptions.js +1 -2
- package/lib/commands/order/customer_payment_source_id.js +1 -2
- package/lib/commands/order/nullify_payment_source.js +1 -2
- package/lib/commands/order/place.js +1 -2
- package/lib/commands/order/refresh.js +1 -2
- package/lib/commands/order/refund.js +1 -2
- package/lib/commands/order/refund_invoice.js +1 -2
- package/lib/commands/order/save_billing_address_to_customer_address_book.js +1 -2
- package/lib/commands/order/save_payment_source_to_customer_wallet.js +1 -2
- package/lib/commands/order/save_shipping_address_to_customer_address_book.js +1 -2
- package/lib/commands/order/shipping_address_clone_id.js +1 -2
- package/lib/commands/order/shipping_address_same_as_billing.js +1 -2
- package/lib/commands/order/start_editing.js +1 -2
- package/lib/commands/order/stop_editing.js +1 -2
- package/lib/commands/order/unarchive.js +1 -2
- package/lib/commands/order/update_taxes.js +1 -2
- package/lib/commands/order/validate.js +1 -2
- package/lib/commands/order_subscription/activate.js +1 -2
- package/lib/commands/order_subscription/cancel.js +1 -2
- package/lib/commands/order_subscription/deactivate.js +1 -2
- package/lib/commands/payment_method/disable.js +1 -2
- package/lib/commands/payment_method/enable.js +1 -2
- package/lib/commands/percentage_discount_promotion/disable.js +1 -2
- package/lib/commands/percentage_discount_promotion/enable.js +1 -2
- package/lib/commands/return/approve.js +1 -2
- package/lib/commands/return/archive.js +1 -2
- package/lib/commands/return/cancel.js +1 -2
- package/lib/commands/return/receive.js +1 -2
- package/lib/commands/return/reject.js +1 -2
- package/lib/commands/return/request.js +1 -2
- package/lib/commands/return/restock.js +1 -2
- package/lib/commands/return/ship.js +1 -2
- package/lib/commands/return/unarchive.js +1 -2
- package/lib/commands/return_line_item/restock.js +1 -2
- package/lib/commands/satispay_payment/refresh.js +1 -2
- package/lib/commands/shipment/decrement_stock.d.ts +9 -0
- package/lib/commands/shipment/decrement_stock.js +20 -0
- package/lib/commands/shipment/get_rates.js +1 -2
- package/lib/commands/shipment/on_hold.js +1 -2
- package/lib/commands/shipment/packing.js +1 -2
- package/lib/commands/shipment/picking.js +1 -2
- package/lib/commands/shipment/purchase.js +1 -2
- package/lib/commands/shipment/ready_to_ship.js +1 -2
- package/lib/commands/shipment/release_stock.d.ts +9 -0
- package/lib/commands/shipment/release_stock.js +20 -0
- package/lib/commands/shipment/reserve_stock.d.ts +9 -0
- package/lib/commands/shipment/reserve_stock.js +20 -0
- package/lib/commands/shipment/ship.js +1 -2
- package/lib/commands/shipment/upcoming.d.ts +9 -0
- package/lib/commands/shipment/upcoming.js +20 -0
- package/lib/commands/shipping_method/disable.js +1 -2
- package/lib/commands/shipping_method/enable.js +1 -2
- package/lib/commands/stock_reservation/index.d.ts +9 -0
- package/lib/commands/stock_reservation/index.js +38 -0
- package/lib/commands/stock_reservation/pending.d.ts +9 -0
- package/lib/commands/stock_reservation/pending.js +20 -0
- package/lib/commands/stock_transfer/cancel.js +1 -2
- package/lib/commands/stock_transfer/complete.js +1 -2
- package/lib/commands/stock_transfer/in_transit.js +1 -2
- package/lib/commands/stock_transfer/on_hold.d.ts +9 -0
- package/lib/commands/stock_transfer/on_hold.js +20 -0
- package/lib/commands/stock_transfer/picking.js +1 -2
- package/lib/commands/stock_transfer/upcoming.js +1 -2
- package/lib/commands/stripe_payment/refresh.js +1 -2
- package/lib/commands/stripe_payment/update.js +1 -2
- package/lib/commands/webhook/reset_circuit.js +1 -2
- package/lib/exec.d.ts +3 -2
- package/lib/exec.js +7 -4
- package/lib/triggers/line_items.js +1 -1
- package/lib/triggers/shipments.d.ts +1 -1
- package/lib/triggers/shipments.js +20 -0
- package/lib/triggers/stock_reservations.d.ts +3 -0
- package/lib/triggers/stock_reservations.js +10 -0
- package/lib/triggers/stock_transfers.d.ts +1 -1
- package/lib/triggers/stock_transfers.js +5 -0
- package/oclif.manifest.json +6889 -4364
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -136,20 +136,27 @@ $ commercelayer plugins:install triggers
|
|
|
136
136
|
* [`commercelayer satispay_payment ID`](#commercelayer-satispay_payment-id)
|
|
137
137
|
* [`commercelayer satispay_payment:refresh ID`](#commercelayer-satispay_paymentrefresh-id)
|
|
138
138
|
* [`commercelayer shipment ID`](#commercelayer-shipment-id)
|
|
139
|
+
* [`commercelayer shipment:decrement_stock ID`](#commercelayer-shipmentdecrement_stock-id)
|
|
139
140
|
* [`commercelayer shipment:get_rates ID`](#commercelayer-shipmentget_rates-id)
|
|
140
141
|
* [`commercelayer shipment:on_hold ID`](#commercelayer-shipmenton_hold-id)
|
|
141
142
|
* [`commercelayer shipment:packing ID`](#commercelayer-shipmentpacking-id)
|
|
142
143
|
* [`commercelayer shipment:picking ID`](#commercelayer-shipmentpicking-id)
|
|
143
144
|
* [`commercelayer shipment:purchase ID`](#commercelayer-shipmentpurchase-id)
|
|
144
145
|
* [`commercelayer shipment:ready_to_ship ID`](#commercelayer-shipmentready_to_ship-id)
|
|
146
|
+
* [`commercelayer shipment:release_stock ID`](#commercelayer-shipmentrelease_stock-id)
|
|
147
|
+
* [`commercelayer shipment:reserve_stock ID`](#commercelayer-shipmentreserve_stock-id)
|
|
145
148
|
* [`commercelayer shipment:ship ID`](#commercelayer-shipmentship-id)
|
|
149
|
+
* [`commercelayer shipment:upcoming ID`](#commercelayer-shipmentupcoming-id)
|
|
146
150
|
* [`commercelayer shipping_method ID`](#commercelayer-shipping_method-id)
|
|
147
151
|
* [`commercelayer shipping_method:disable ID`](#commercelayer-shipping_methoddisable-id)
|
|
148
152
|
* [`commercelayer shipping_method:enable ID`](#commercelayer-shipping_methodenable-id)
|
|
153
|
+
* [`commercelayer stock_reservation ID`](#commercelayer-stock_reservation-id)
|
|
154
|
+
* [`commercelayer stock_reservation:pending ID`](#commercelayer-stock_reservationpending-id)
|
|
149
155
|
* [`commercelayer stock_transfer ID`](#commercelayer-stock_transfer-id)
|
|
150
156
|
* [`commercelayer stock_transfer:cancel ID`](#commercelayer-stock_transfercancel-id)
|
|
151
157
|
* [`commercelayer stock_transfer:complete ID`](#commercelayer-stock_transfercomplete-id)
|
|
152
158
|
* [`commercelayer stock_transfer:in_transit ID`](#commercelayer-stock_transferin_transit-id)
|
|
159
|
+
* [`commercelayer stock_transfer:on_hold ID`](#commercelayer-stock_transferon_hold-id)
|
|
153
160
|
* [`commercelayer stock_transfer:picking ID`](#commercelayer-stock_transferpicking-id)
|
|
154
161
|
* [`commercelayer stock_transfer:upcoming ID`](#commercelayer-stock_transferupcoming-id)
|
|
155
162
|
* [`commercelayer stripe_payment ID`](#commercelayer-stripe_payment-id)
|
|
@@ -1220,7 +1227,7 @@ _See code: [src/commands/line_item/index.ts](https://github.com/commercelayer/co
|
|
|
1220
1227
|
|
|
1221
1228
|
### `commercelayer line_item:external_price ID`
|
|
1222
1229
|
|
|
1223
|
-
When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source.
|
|
1230
|
+
When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price from an external source. Any successive price computation will be done externally, until the attribute is reset to '0'.
|
|
1224
1231
|
|
|
1225
1232
|
```sh-session
|
|
1226
1233
|
USAGE
|
|
@@ -1236,7 +1243,8 @@ FLAGS
|
|
|
1236
1243
|
|
|
1237
1244
|
DESCRIPTION
|
|
1238
1245
|
When creating or updating a new line item, set this attribute to '1' if you want to inject the unit_amount_cents price
|
|
1239
|
-
from an external source.
|
|
1246
|
+
from an external source. Any successive price computation will be done externally, until the attribute is reset to
|
|
1247
|
+
'0'.
|
|
1240
1248
|
```
|
|
1241
1249
|
|
|
1242
1250
|
_See code: [src/commands/line_item/external_price.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/line_item/external_price.ts)_
|
|
@@ -2507,6 +2515,29 @@ DESCRIPTION
|
|
|
2507
2515
|
|
|
2508
2516
|
_See code: [src/commands/shipment/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/index.ts)_
|
|
2509
2517
|
|
|
2518
|
+
### `commercelayer shipment:decrement_stock ID`
|
|
2519
|
+
|
|
2520
|
+
Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.
|
|
2521
|
+
|
|
2522
|
+
```sh-session
|
|
2523
|
+
USAGE
|
|
2524
|
+
$ commercelayer shipment:decrement_stock ID [-u [-j -p]]
|
|
2525
|
+
|
|
2526
|
+
ARGUMENTS
|
|
2527
|
+
ID the unique id of the resource
|
|
2528
|
+
|
|
2529
|
+
FLAGS
|
|
2530
|
+
-j, --json print result in JSON format
|
|
2531
|
+
-p, --print print out the modified resource
|
|
2532
|
+
-u, --unformatted print JSON output without indentation
|
|
2533
|
+
|
|
2534
|
+
DESCRIPTION
|
|
2535
|
+
Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line
|
|
2536
|
+
item. Can be done only when fulfillment is in progress.
|
|
2537
|
+
```
|
|
2538
|
+
|
|
2539
|
+
_See code: [src/commands/shipment/decrement_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/decrement_stock.ts)_
|
|
2540
|
+
|
|
2510
2541
|
### `commercelayer shipment:get_rates ID`
|
|
2511
2542
|
|
|
2512
2543
|
Send this attribute if you want get the shipping rates from the associated carrier accounts.
|
|
@@ -2639,6 +2670,52 @@ DESCRIPTION
|
|
|
2639
2670
|
|
|
2640
2671
|
_See code: [src/commands/shipment/ready_to_ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ready_to_ship.ts)_
|
|
2641
2672
|
|
|
2673
|
+
### `commercelayer shipment:release_stock ID`
|
|
2674
|
+
|
|
2675
|
+
Send this attribute if you want to automatically release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.
|
|
2676
|
+
|
|
2677
|
+
```sh-session
|
|
2678
|
+
USAGE
|
|
2679
|
+
$ commercelayer shipment:release_stock ID [-u [-j -p]]
|
|
2680
|
+
|
|
2681
|
+
ARGUMENTS
|
|
2682
|
+
ID the unique id of the resource
|
|
2683
|
+
|
|
2684
|
+
FLAGS
|
|
2685
|
+
-j, --json print result in JSON format
|
|
2686
|
+
-p, --print print out the modified resource
|
|
2687
|
+
-u, --unformatted print JSON output without indentation
|
|
2688
|
+
|
|
2689
|
+
DESCRIPTION
|
|
2690
|
+
Send this attribute if you want to automatically release the stock for each of the associated stock line item. Can be
|
|
2691
|
+
done only when fulfillment is in progress.
|
|
2692
|
+
```
|
|
2693
|
+
|
|
2694
|
+
_See code: [src/commands/shipment/release_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/release_stock.ts)_
|
|
2695
|
+
|
|
2696
|
+
### `commercelayer shipment:reserve_stock ID`
|
|
2697
|
+
|
|
2698
|
+
Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.
|
|
2699
|
+
|
|
2700
|
+
```sh-session
|
|
2701
|
+
USAGE
|
|
2702
|
+
$ commercelayer shipment:reserve_stock ID [-u [-j -p]]
|
|
2703
|
+
|
|
2704
|
+
ARGUMENTS
|
|
2705
|
+
ID the unique id of the resource
|
|
2706
|
+
|
|
2707
|
+
FLAGS
|
|
2708
|
+
-j, --json print result in JSON format
|
|
2709
|
+
-p, --print print out the modified resource
|
|
2710
|
+
-u, --unformatted print JSON output without indentation
|
|
2711
|
+
|
|
2712
|
+
DESCRIPTION
|
|
2713
|
+
Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be
|
|
2714
|
+
done only when fulfillment is in progress.
|
|
2715
|
+
```
|
|
2716
|
+
|
|
2717
|
+
_See code: [src/commands/shipment/reserve_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/reserve_stock.ts)_
|
|
2718
|
+
|
|
2642
2719
|
### `commercelayer shipment:ship ID`
|
|
2643
2720
|
|
|
2644
2721
|
Send this attribute if you want to mark this shipment as shipped.
|
|
@@ -2661,6 +2738,28 @@ DESCRIPTION
|
|
|
2661
2738
|
|
|
2662
2739
|
_See code: [src/commands/shipment/ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ship.ts)_
|
|
2663
2740
|
|
|
2741
|
+
### `commercelayer shipment:upcoming ID`
|
|
2742
|
+
|
|
2743
|
+
Send this attribute if you want to mark this shipment as upcoming.
|
|
2744
|
+
|
|
2745
|
+
```sh-session
|
|
2746
|
+
USAGE
|
|
2747
|
+
$ commercelayer shipment:upcoming ID [-u [-j -p]]
|
|
2748
|
+
|
|
2749
|
+
ARGUMENTS
|
|
2750
|
+
ID the unique id of the resource
|
|
2751
|
+
|
|
2752
|
+
FLAGS
|
|
2753
|
+
-j, --json print result in JSON format
|
|
2754
|
+
-p, --print print out the modified resource
|
|
2755
|
+
-u, --unformatted print JSON output without indentation
|
|
2756
|
+
|
|
2757
|
+
DESCRIPTION
|
|
2758
|
+
Send this attribute if you want to mark this shipment as upcoming.
|
|
2759
|
+
```
|
|
2760
|
+
|
|
2761
|
+
_See code: [src/commands/shipment/upcoming.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/upcoming.ts)_
|
|
2762
|
+
|
|
2664
2763
|
### `commercelayer shipping_method ID`
|
|
2665
2764
|
|
|
2666
2765
|
Execute an action on a resource of type shipping_methods.
|
|
@@ -2727,6 +2826,50 @@ DESCRIPTION
|
|
|
2727
2826
|
|
|
2728
2827
|
_See code: [src/commands/shipping_method/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/enable.ts)_
|
|
2729
2828
|
|
|
2829
|
+
### `commercelayer stock_reservation ID`
|
|
2830
|
+
|
|
2831
|
+
Execute an action on a resource of type stock_reservations.
|
|
2832
|
+
|
|
2833
|
+
```sh-session
|
|
2834
|
+
USAGE
|
|
2835
|
+
$ commercelayer stock_reservation ID [-u [-j -p]]
|
|
2836
|
+
|
|
2837
|
+
ARGUMENTS
|
|
2838
|
+
ID the unique id of the resource
|
|
2839
|
+
|
|
2840
|
+
FLAGS
|
|
2841
|
+
-j, --json print result in JSON format
|
|
2842
|
+
-p, --print print out the modified resource
|
|
2843
|
+
-u, --unformatted print JSON output without indentation
|
|
2844
|
+
|
|
2845
|
+
DESCRIPTION
|
|
2846
|
+
execute an action on a resource of type stock_reservations
|
|
2847
|
+
```
|
|
2848
|
+
|
|
2849
|
+
_See code: [src/commands/stock_reservation/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/index.ts)_
|
|
2850
|
+
|
|
2851
|
+
### `commercelayer stock_reservation:pending ID`
|
|
2852
|
+
|
|
2853
|
+
Send this attribute if you want to mark this stock reservation as pending.
|
|
2854
|
+
|
|
2855
|
+
```sh-session
|
|
2856
|
+
USAGE
|
|
2857
|
+
$ commercelayer stock_reservation:pending ID [-u [-j -p]]
|
|
2858
|
+
|
|
2859
|
+
ARGUMENTS
|
|
2860
|
+
ID the unique id of the resource
|
|
2861
|
+
|
|
2862
|
+
FLAGS
|
|
2863
|
+
-j, --json print result in JSON format
|
|
2864
|
+
-p, --print print out the modified resource
|
|
2865
|
+
-u, --unformatted print JSON output without indentation
|
|
2866
|
+
|
|
2867
|
+
DESCRIPTION
|
|
2868
|
+
Send this attribute if you want to mark this stock reservation as pending.
|
|
2869
|
+
```
|
|
2870
|
+
|
|
2871
|
+
_See code: [src/commands/stock_reservation/pending.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/pending.ts)_
|
|
2872
|
+
|
|
2730
2873
|
### `commercelayer stock_transfer ID`
|
|
2731
2874
|
|
|
2732
2875
|
Execute an action on a resource of type stock_transfers.
|
|
@@ -2815,6 +2958,28 @@ DESCRIPTION
|
|
|
2815
2958
|
|
|
2816
2959
|
_See code: [src/commands/stock_transfer/in_transit.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_transfer/in_transit.ts)_
|
|
2817
2960
|
|
|
2961
|
+
### `commercelayer stock_transfer:on_hold ID`
|
|
2962
|
+
|
|
2963
|
+
Send this attribute if you want to put this stock transfer on hold.
|
|
2964
|
+
|
|
2965
|
+
```sh-session
|
|
2966
|
+
USAGE
|
|
2967
|
+
$ commercelayer stock_transfer:on_hold ID [-u [-j -p]]
|
|
2968
|
+
|
|
2969
|
+
ARGUMENTS
|
|
2970
|
+
ID the unique id of the resource
|
|
2971
|
+
|
|
2972
|
+
FLAGS
|
|
2973
|
+
-j, --json print result in JSON format
|
|
2974
|
+
-p, --print print out the modified resource
|
|
2975
|
+
-u, --unformatted print JSON output without indentation
|
|
2976
|
+
|
|
2977
|
+
DESCRIPTION
|
|
2978
|
+
Send this attribute if you want to put this stock transfer on hold.
|
|
2979
|
+
```
|
|
2980
|
+
|
|
2981
|
+
_See code: [src/commands/stock_transfer/on_hold.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_transfer/on_hold.ts)_
|
|
2982
|
+
|
|
2818
2983
|
### `commercelayer stock_transfer:picking ID`
|
|
2819
2984
|
|
|
2820
2985
|
Send this attribute if you want to start picking this stock transfer.
|
package/lib/base.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ export default abstract class extends Command {
|
|
|
19
19
|
protected handleError(error: CommandError, flags?: any): void;
|
|
20
20
|
protected printOutput(res: Resource, flags: any): void;
|
|
21
21
|
protected successMessage(resource: string, action: string, id: string): void;
|
|
22
|
+
protected executeAction<R extends Resource>(resourceType: string, id: string, action: string, flags: any, fields?: string[]): Promise<R>;
|
|
22
23
|
}
|
|
23
24
|
export { Flags };
|
package/lib/base.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Flags = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const sdk_1 = require("@commercelayer/sdk");
|
|
5
6
|
const core_1 = require("@oclif/core");
|
|
6
7
|
Object.defineProperty(exports, "Flags", { enumerable: true, get: function () { return core_1.Flags; } });
|
|
7
8
|
const cli_core_1 = require("@commercelayer/cli-core");
|
|
9
|
+
const exec_1 = tslib_1.__importDefault(require("./exec"));
|
|
8
10
|
const pkg = require('../package.json');
|
|
9
11
|
class default_1 extends core_1.Command {
|
|
10
12
|
// INIT (override)
|
|
@@ -50,6 +52,9 @@ class default_1 extends core_1.Command {
|
|
|
50
52
|
successMessage(resource, action, id) {
|
|
51
53
|
this.log(`\nAction ${cli_core_1.clColor.api.trigger(action)} executed without errors on ${resource.replace(/_/g, ' ')} ${cli_core_1.clColor.api.id(id)}\n`);
|
|
52
54
|
}
|
|
55
|
+
async executeAction(resourceType, id, action, flags, fields) {
|
|
56
|
+
return await (0, exec_1.default)(resourceType, id, action, flags, fields, this.config);
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
default_1.baseFlags = {
|
|
55
60
|
organization: core_1.Flags.string({
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const adyen_payments_1 = require("../../triggers/adyen_payments");
|
|
7
6
|
const TRIGGER = 'details';
|
|
8
7
|
class AdyenPaymentDetails extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(AdyenPaymentDetails);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('adyen_payments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('adyen_payment', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const authorizations_1 = require("../../triggers/authorizations");
|
|
7
6
|
const TRIGGER = 'capture';
|
|
8
7
|
class AuthorizationCapture extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(AuthorizationCapture);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('authorizations', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('authorization', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const authorizations_1 = require("../../triggers/authorizations");
|
|
7
6
|
const TRIGGER = 'capture_amount_cents';
|
|
8
7
|
class AuthorizationCaptureAmountCents extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(AuthorizationCaptureAmountCents);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('authorizations', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('authorization', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const authorizations_1 = require("../../triggers/authorizations");
|
|
7
6
|
const TRIGGER = 'void';
|
|
8
7
|
class AuthorizationVoid extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(AuthorizationVoid);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('authorizations', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('authorization', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const axerve_payments_1 = require("../../triggers/axerve_payments");
|
|
7
6
|
const TRIGGER = 'update';
|
|
8
7
|
class AxervePaymentUpdate extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(AxervePaymentUpdate);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('axerve_payments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('axerve_payment', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const bundles_1 = require("../../triggers/bundles");
|
|
7
6
|
const TRIGGER = 'compute_compare_at_amount';
|
|
8
7
|
class BundleComputeCompareAtAmount extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(BundleComputeCompareAtAmount);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('bundles', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('bundle', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const bundles_1 = require("../../triggers/bundles");
|
|
7
6
|
const TRIGGER = 'compute_price_amount';
|
|
8
7
|
class BundleComputePriceAmount extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(BundleComputePriceAmount);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('bundles', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('bundle', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class BuyXPayYPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(BuyXPayYPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class BuyXPayYPromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(BuyXPayYPromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const captures_1 = require("../../triggers/captures");
|
|
7
6
|
const TRIGGER = 'refund';
|
|
8
7
|
class CaptureRefund extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(CaptureRefund);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('captures', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('capture', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const captures_1 = require("../../triggers/captures");
|
|
7
6
|
const TRIGGER = 'refund_amount_cents';
|
|
8
7
|
class CaptureRefundAmountCents extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(CaptureRefundAmountCents);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('captures', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('capture', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const checkout_com_payments_1 = require("../../triggers/checkout_com_payments");
|
|
7
6
|
const TRIGGER = 'details';
|
|
8
7
|
class CheckoutComPaymentDetails extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(CheckoutComPaymentDetails);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('checkout_com_payments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('checkout_com_payment', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const checkout_com_payments_1 = require("../../triggers/checkout_com_payments");
|
|
7
6
|
const TRIGGER = 'refresh';
|
|
8
7
|
class CheckoutComPaymentRefresh extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(CheckoutComPaymentRefresh);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('checkout_com_payments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('checkout_com_payment', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const customer_password_resets_1 = require("../../triggers/customer_password_resets");
|
|
7
6
|
const TRIGGER = 'reset_password_token';
|
|
8
7
|
class CustomerPasswordResetResetPasswordToken extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(CustomerPasswordResetResetPasswordToken);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('customer_password_resets', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('customer_password_reset', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const external_promotions_1 = require("../../triggers/external_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class ExternalPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ExternalPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const external_promotions_1 = require("../../triggers/external_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class ExternalPromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ExternalPromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const fixed_amount_promotions_1 = require("../../triggers/fixed_amount_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class FixedAmountPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FixedAmountPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('fixed_amount_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('fixed_amount_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const fixed_amount_promotions_1 = require("../../triggers/fixed_amount_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class FixedAmountPromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FixedAmountPromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('fixed_amount_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('fixed_amount_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const fixed_price_promotions_1 = require("../../triggers/fixed_price_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class FixedPricePromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FixedPricePromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('fixed_price_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('fixed_price_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const fixed_price_promotions_1 = require("../../triggers/fixed_price_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class FixedPricePromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FixedPricePromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('fixed_price_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('fixed_price_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const free_gift_promotions_1 = require("../../triggers/free_gift_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class FreeGiftPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FreeGiftPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('free_gift_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('free_gift_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const free_gift_promotions_1 = require("../../triggers/free_gift_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class FreeGiftPromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FreeGiftPromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('free_gift_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('free_gift_promotion', TRIGGER, res.id);
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
-
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
5
|
const free_shipping_promotions_1 = require("../../triggers/free_shipping_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class FreeShippingPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(FreeShippingPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('free_shipping_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('free_shipping_promotion', TRIGGER, res.id);
|