@commercelayer/cli-plugin-triggers 3.14.0 → 4.0.0-oclif3.1
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 +308 -2
- package/bin/dev +0 -0
- package/bin/run +0 -0
- package/lib/base.d.ts +5 -4
- package/lib/base.js +46 -41
- package/lib/commands/adyen_payment/details.d.ts +1 -1
- package/lib/commands/adyen_payment/details.js +6 -5
- package/lib/commands/adyen_payment/index.d.ts +1 -1
- package/lib/commands/adyen_payment/index.js +5 -3
- package/lib/commands/authorization/capture.d.ts +1 -1
- package/lib/commands/authorization/capture.js +6 -5
- package/lib/commands/authorization/capture_amount_cents.d.ts +1 -1
- package/lib/commands/authorization/capture_amount_cents.js +6 -5
- package/lib/commands/authorization/index.d.ts +1 -1
- package/lib/commands/authorization/index.js +5 -3
- package/lib/commands/authorization/void.d.ts +1 -1
- package/lib/commands/authorization/void.js +6 -5
- package/lib/commands/axerve_payment/index.d.ts +1 -1
- package/lib/commands/axerve_payment/index.js +5 -3
- package/lib/commands/axerve_payment/update.d.ts +1 -1
- package/lib/commands/axerve_payment/update.js +6 -5
- package/lib/commands/bundle/compute_compare_at_amount.d.ts +1 -1
- package/lib/commands/bundle/compute_compare_at_amount.js +6 -5
- package/lib/commands/bundle/compute_price_amount.d.ts +1 -1
- package/lib/commands/bundle/compute_price_amount.js +6 -5
- package/lib/commands/bundle/index.d.ts +1 -1
- package/lib/commands/bundle/index.js +5 -3
- package/lib/commands/buy_x_pay_y_promotion/disable.d.ts +1 -1
- package/lib/commands/buy_x_pay_y_promotion/disable.js +6 -5
- package/lib/commands/buy_x_pay_y_promotion/enable.d.ts +1 -1
- package/lib/commands/buy_x_pay_y_promotion/enable.js +6 -5
- package/lib/commands/buy_x_pay_y_promotion/index.d.ts +1 -1
- package/lib/commands/buy_x_pay_y_promotion/index.js +5 -3
- package/lib/commands/capture/index.d.ts +1 -1
- package/lib/commands/capture/index.js +5 -3
- package/lib/commands/capture/refund.d.ts +1 -1
- package/lib/commands/capture/refund.js +6 -5
- package/lib/commands/capture/refund_amount_cents.d.ts +1 -1
- package/lib/commands/capture/refund_amount_cents.js +6 -5
- package/lib/commands/checkout_com_payment/details.d.ts +1 -1
- package/lib/commands/checkout_com_payment/details.js +6 -5
- package/lib/commands/checkout_com_payment/index.d.ts +1 -1
- package/lib/commands/checkout_com_payment/index.js +5 -3
- package/lib/commands/checkout_com_payment/refresh.d.ts +1 -1
- package/lib/commands/checkout_com_payment/refresh.js +6 -5
- package/lib/commands/customer_password_reset/index.d.ts +1 -1
- package/lib/commands/customer_password_reset/index.js +5 -3
- package/lib/commands/customer_password_reset/reset_password_token.d.ts +1 -1
- package/lib/commands/customer_password_reset/reset_password_token.js +6 -5
- package/lib/commands/external_promotion/disable.d.ts +1 -1
- package/lib/commands/external_promotion/disable.js +6 -5
- package/lib/commands/external_promotion/enable.d.ts +1 -1
- package/lib/commands/external_promotion/enable.js +6 -5
- package/lib/commands/external_promotion/index.d.ts +1 -1
- package/lib/commands/external_promotion/index.js +5 -3
- package/lib/commands/fixed_amount_promotion/disable.d.ts +1 -1
- package/lib/commands/fixed_amount_promotion/disable.js +6 -5
- package/lib/commands/fixed_amount_promotion/enable.d.ts +1 -1
- package/lib/commands/fixed_amount_promotion/enable.js +6 -5
- package/lib/commands/fixed_amount_promotion/index.d.ts +1 -1
- package/lib/commands/fixed_amount_promotion/index.js +5 -3
- package/lib/commands/fixed_price_promotion/disable.d.ts +1 -1
- package/lib/commands/fixed_price_promotion/disable.js +6 -5
- package/lib/commands/fixed_price_promotion/enable.d.ts +1 -1
- package/lib/commands/fixed_price_promotion/enable.js +6 -5
- package/lib/commands/fixed_price_promotion/index.d.ts +1 -1
- package/lib/commands/fixed_price_promotion/index.js +5 -3
- package/lib/commands/free_gift_promotion/disable.d.ts +1 -1
- package/lib/commands/free_gift_promotion/disable.js +6 -5
- package/lib/commands/free_gift_promotion/enable.d.ts +1 -1
- package/lib/commands/free_gift_promotion/enable.js +6 -5
- package/lib/commands/free_gift_promotion/index.d.ts +1 -1
- package/lib/commands/free_gift_promotion/index.js +5 -3
- package/lib/commands/free_shipping_promotion/disable.d.ts +1 -1
- package/lib/commands/free_shipping_promotion/disable.js +6 -5
- package/lib/commands/free_shipping_promotion/enable.d.ts +1 -1
- package/lib/commands/free_shipping_promotion/enable.js +6 -5
- package/lib/commands/free_shipping_promotion/index.d.ts +1 -1
- package/lib/commands/free_shipping_promotion/index.js +5 -3
- package/lib/commands/gift_card/activate.d.ts +1 -1
- package/lib/commands/gift_card/activate.js +6 -5
- package/lib/commands/gift_card/balance_change_cents.d.ts +1 -1
- package/lib/commands/gift_card/balance_change_cents.js +6 -5
- package/lib/commands/gift_card/deactivate.d.ts +1 -1
- package/lib/commands/gift_card/deactivate.js +6 -5
- package/lib/commands/gift_card/index.d.ts +1 -1
- package/lib/commands/gift_card/index.js +5 -3
- package/lib/commands/gift_card/purchase.d.ts +1 -1
- package/lib/commands/gift_card/purchase.js +6 -5
- package/lib/commands/in_stock_subscription/activate.d.ts +1 -1
- package/lib/commands/in_stock_subscription/activate.js +6 -5
- package/lib/commands/in_stock_subscription/deactivate.d.ts +1 -1
- package/lib/commands/in_stock_subscription/deactivate.js +6 -5
- package/lib/commands/in_stock_subscription/index.d.ts +1 -1
- package/lib/commands/in_stock_subscription/index.js +5 -3
- package/lib/commands/klarna_payment/index.d.ts +1 -1
- package/lib/commands/klarna_payment/index.js +5 -3
- package/lib/commands/klarna_payment/update.d.ts +1 -1
- package/lib/commands/klarna_payment/update.js +6 -5
- package/lib/commands/line_item/external_price.d.ts +1 -1
- package/lib/commands/line_item/external_price.js +6 -5
- package/lib/commands/line_item/index.d.ts +1 -1
- package/lib/commands/line_item/index.js +5 -3
- package/lib/commands/line_item/reserve_stock.d.ts +1 -1
- package/lib/commands/line_item/reserve_stock.js +6 -5
- package/lib/commands/market/disable.d.ts +1 -1
- package/lib/commands/market/disable.js +6 -5
- package/lib/commands/market/enable.d.ts +1 -1
- package/lib/commands/market/enable.js +6 -5
- package/lib/commands/market/index.d.ts +1 -1
- package/lib/commands/market/index.js +5 -3
- package/lib/commands/noc.js +2 -2
- package/lib/commands/order/approve.d.ts +1 -1
- package/lib/commands/order/approve.js +6 -5
- package/lib/commands/order/approve_and_capture.d.ts +1 -1
- package/lib/commands/order/approve_and_capture.js +6 -5
- package/lib/commands/order/archive.d.ts +1 -1
- package/lib/commands/order/archive.js +6 -5
- package/lib/commands/order/authorization_amount_cents.d.ts +1 -1
- package/lib/commands/order/authorization_amount_cents.js +6 -5
- package/lib/commands/order/authorize.d.ts +1 -1
- package/lib/commands/order/authorize.js +6 -5
- package/lib/commands/order/billing_address_clone_id.d.ts +2 -2
- package/lib/commands/order/billing_address_clone_id.js +13 -12
- package/lib/commands/order/billing_address_same_as_shipping.d.ts +1 -1
- package/lib/commands/order/billing_address_same_as_shipping.js +6 -5
- package/lib/commands/order/cancel.d.ts +1 -1
- package/lib/commands/order/cancel.js +6 -5
- package/lib/commands/order/capture.d.ts +1 -1
- package/lib/commands/order/capture.js +6 -5
- package/lib/commands/order/commit_invoice.d.ts +1 -1
- package/lib/commands/order/commit_invoice.js +6 -5
- package/lib/commands/order/create_subscriptions.d.ts +1 -1
- package/lib/commands/order/create_subscriptions.js +6 -5
- package/lib/commands/order/customer_payment_source_id.d.ts +2 -2
- package/lib/commands/order/customer_payment_source_id.js +13 -12
- package/lib/commands/order/index.d.ts +1 -1
- package/lib/commands/order/index.js +5 -3
- package/lib/commands/order/nullify_payment_source.d.ts +1 -1
- package/lib/commands/order/nullify_payment_source.js +6 -5
- package/lib/commands/order/place.d.ts +1 -1
- package/lib/commands/order/place.js +6 -5
- package/lib/commands/order/refresh.d.ts +1 -1
- package/lib/commands/order/refresh.js +6 -5
- package/lib/commands/order/refund.d.ts +1 -1
- package/lib/commands/order/refund.js +6 -5
- package/lib/commands/order/refund_invoice.d.ts +1 -1
- package/lib/commands/order/refund_invoice.js +6 -5
- package/lib/commands/order/save_billing_address_to_customer_address_book.d.ts +1 -1
- package/lib/commands/order/save_billing_address_to_customer_address_book.js +6 -5
- package/lib/commands/order/save_payment_source_to_customer_wallet.d.ts +1 -1
- package/lib/commands/order/save_payment_source_to_customer_wallet.js +6 -5
- package/lib/commands/order/save_shipping_address_to_customer_address_book.d.ts +1 -1
- package/lib/commands/order/save_shipping_address_to_customer_address_book.js +6 -5
- package/lib/commands/order/shipping_address_clone_id.d.ts +2 -2
- package/lib/commands/order/shipping_address_clone_id.js +13 -12
- package/lib/commands/order/shipping_address_same_as_billing.d.ts +1 -1
- package/lib/commands/order/shipping_address_same_as_billing.js +6 -5
- package/lib/commands/order/start_editing.d.ts +1 -1
- package/lib/commands/order/start_editing.js +6 -5
- package/lib/commands/order/stop_editing.d.ts +1 -1
- package/lib/commands/order/stop_editing.js +6 -5
- package/lib/commands/order/unarchive.d.ts +1 -1
- package/lib/commands/order/unarchive.js +6 -5
- package/lib/commands/order/update_taxes.d.ts +1 -1
- package/lib/commands/order/update_taxes.js +6 -5
- package/lib/commands/order/validate.d.ts +1 -1
- package/lib/commands/order/validate.js +6 -5
- package/lib/commands/order_subscription/activate.d.ts +1 -1
- package/lib/commands/order_subscription/activate.js +6 -5
- package/lib/commands/order_subscription/cancel.d.ts +1 -1
- package/lib/commands/order_subscription/cancel.js +6 -5
- package/lib/commands/order_subscription/deactivate.d.ts +1 -1
- package/lib/commands/order_subscription/deactivate.js +6 -5
- package/lib/commands/order_subscription/index.d.ts +1 -1
- package/lib/commands/order_subscription/index.js +5 -3
- package/lib/commands/payment_method/disable.d.ts +1 -1
- package/lib/commands/payment_method/disable.js +6 -5
- package/lib/commands/payment_method/enable.d.ts +1 -1
- package/lib/commands/payment_method/enable.js +6 -5
- package/lib/commands/payment_method/index.d.ts +1 -1
- package/lib/commands/payment_method/index.js +5 -3
- package/lib/commands/percentage_discount_promotion/disable.d.ts +1 -1
- package/lib/commands/percentage_discount_promotion/disable.js +6 -5
- package/lib/commands/percentage_discount_promotion/enable.d.ts +1 -1
- package/lib/commands/percentage_discount_promotion/enable.js +6 -5
- package/lib/commands/percentage_discount_promotion/index.d.ts +1 -1
- package/lib/commands/percentage_discount_promotion/index.js +5 -3
- package/lib/commands/return/approve.d.ts +1 -1
- package/lib/commands/return/approve.js +6 -5
- package/lib/commands/return/archive.d.ts +1 -1
- package/lib/commands/return/archive.js +6 -5
- package/lib/commands/return/cancel.d.ts +1 -1
- package/lib/commands/return/cancel.js +6 -5
- package/lib/commands/return/index.d.ts +1 -1
- package/lib/commands/return/index.js +5 -3
- package/lib/commands/return/receive.d.ts +1 -1
- package/lib/commands/return/receive.js +6 -5
- package/lib/commands/return/reject.d.ts +1 -1
- package/lib/commands/return/reject.js +6 -5
- package/lib/commands/return/request.d.ts +1 -1
- package/lib/commands/return/request.js +6 -5
- package/lib/commands/return/restock.d.ts +1 -1
- package/lib/commands/return/restock.js +6 -5
- package/lib/commands/return/ship.d.ts +1 -1
- package/lib/commands/return/ship.js +6 -5
- package/lib/commands/return/unarchive.d.ts +1 -1
- package/lib/commands/return/unarchive.js +6 -5
- package/lib/commands/return_line_item/index.d.ts +1 -1
- package/lib/commands/return_line_item/index.js +5 -3
- package/lib/commands/return_line_item/restock.d.ts +1 -1
- package/lib/commands/return_line_item/restock.js +6 -5
- package/lib/commands/satispay_payment/index.d.ts +1 -1
- package/lib/commands/satispay_payment/index.js +5 -3
- package/lib/commands/satispay_payment/refresh.d.ts +1 -1
- package/lib/commands/satispay_payment/refresh.js +6 -5
- package/lib/commands/shipment/decrement_stock.d.ts +9 -0
- package/lib/commands/shipment/decrement_stock.js +22 -0
- package/lib/commands/shipment/get_rates.d.ts +1 -1
- package/lib/commands/shipment/get_rates.js +6 -5
- package/lib/commands/shipment/index.d.ts +1 -1
- package/lib/commands/shipment/index.js +5 -3
- package/lib/commands/shipment/on_hold.d.ts +1 -1
- package/lib/commands/shipment/on_hold.js +6 -5
- package/lib/commands/shipment/packing.d.ts +1 -1
- package/lib/commands/shipment/packing.js +6 -5
- package/lib/commands/shipment/picking.d.ts +1 -1
- package/lib/commands/shipment/picking.js +6 -5
- package/lib/commands/shipment/purchase.d.ts +1 -1
- package/lib/commands/shipment/purchase.js +6 -5
- package/lib/commands/shipment/ready_to_ship.d.ts +1 -1
- package/lib/commands/shipment/ready_to_ship.js +6 -5
- package/lib/commands/shipment/release_stock.d.ts +9 -0
- package/lib/commands/shipment/release_stock.js +22 -0
- package/lib/commands/shipment/reserve_stock.d.ts +9 -0
- package/lib/commands/shipment/reserve_stock.js +22 -0
- package/lib/commands/shipment/ship.d.ts +1 -1
- package/lib/commands/shipment/ship.js +6 -5
- package/lib/commands/shipment/upcoming.d.ts +9 -0
- package/lib/commands/shipment/upcoming.js +22 -0
- package/lib/commands/shipping_method/disable.d.ts +1 -1
- package/lib/commands/shipping_method/disable.js +6 -5
- package/lib/commands/shipping_method/enable.d.ts +1 -1
- package/lib/commands/shipping_method/enable.js +6 -5
- package/lib/commands/shipping_method/index.d.ts +1 -1
- package/lib/commands/shipping_method/index.js +5 -3
- package/lib/commands/stock_line_item/decrement_stock.d.ts +9 -0
- package/lib/commands/stock_line_item/decrement_stock.js +22 -0
- package/lib/commands/stock_line_item/index.d.ts +9 -0
- package/lib/commands/stock_line_item/index.js +40 -0
- package/lib/commands/stock_line_item/release_stock.d.ts +9 -0
- package/lib/commands/stock_line_item/release_stock.js +22 -0
- package/lib/commands/stock_line_item/reserve_stock.d.ts +9 -0
- package/lib/commands/stock_line_item/reserve_stock.js +22 -0
- package/lib/commands/stock_reservation/index.d.ts +9 -0
- package/lib/commands/stock_reservation/index.js +40 -0
- package/lib/commands/stock_reservation/pending.d.ts +9 -0
- package/lib/commands/stock_reservation/pending.js +22 -0
- package/lib/commands/stock_transfer/cancel.d.ts +1 -1
- package/lib/commands/stock_transfer/cancel.js +6 -5
- package/lib/commands/stock_transfer/complete.d.ts +1 -1
- package/lib/commands/stock_transfer/complete.js +6 -5
- package/lib/commands/stock_transfer/in_transit.d.ts +1 -1
- package/lib/commands/stock_transfer/in_transit.js +6 -5
- package/lib/commands/stock_transfer/index.d.ts +1 -1
- package/lib/commands/stock_transfer/index.js +5 -3
- package/lib/commands/stock_transfer/on_hold.d.ts +9 -0
- package/lib/commands/stock_transfer/on_hold.js +22 -0
- package/lib/commands/stock_transfer/picking.d.ts +1 -1
- package/lib/commands/stock_transfer/picking.js +6 -5
- package/lib/commands/stock_transfer/upcoming.d.ts +1 -1
- package/lib/commands/stock_transfer/upcoming.js +6 -5
- package/lib/commands/stripe_payment/index.d.ts +1 -1
- package/lib/commands/stripe_payment/index.js +5 -3
- package/lib/commands/stripe_payment/refresh.d.ts +1 -1
- package/lib/commands/stripe_payment/refresh.js +6 -5
- package/lib/commands/stripe_payment/update.d.ts +1 -1
- package/lib/commands/stripe_payment/update.js +6 -5
- package/lib/commands/webhook/disable.d.ts +9 -0
- package/lib/commands/webhook/disable.js +22 -0
- package/lib/commands/webhook/enable.d.ts +9 -0
- package/lib/commands/webhook/enable.js +22 -0
- package/lib/commands/webhook/index.d.ts +1 -1
- package/lib/commands/webhook/index.js +5 -3
- package/lib/commands/webhook/reset_circuit.d.ts +1 -1
- package/lib/commands/webhook/reset_circuit.js +6 -5
- package/lib/exec.d.ts +4 -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_line_items.d.ts +3 -0
- package/lib/triggers/stock_line_items.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/lib/triggers/webhooks.d.ts +1 -1
- package/lib/triggers/webhooks.js +10 -0
- package/oclif.manifest.json +7560 -4372
- package/package.json +37 -31
package/README.md
CHANGED
|
@@ -136,26 +136,39 @@ $ 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_line_item ID`](#commercelayer-stock_line_item-id)
|
|
154
|
+
* [`commercelayer stock_line_item:decrement_stock ID`](#commercelayer-stock_line_itemdecrement_stock-id)
|
|
155
|
+
* [`commercelayer stock_line_item:release_stock ID`](#commercelayer-stock_line_itemrelease_stock-id)
|
|
156
|
+
* [`commercelayer stock_line_item:reserve_stock ID`](#commercelayer-stock_line_itemreserve_stock-id)
|
|
157
|
+
* [`commercelayer stock_reservation ID`](#commercelayer-stock_reservation-id)
|
|
158
|
+
* [`commercelayer stock_reservation:pending ID`](#commercelayer-stock_reservationpending-id)
|
|
149
159
|
* [`commercelayer stock_transfer ID`](#commercelayer-stock_transfer-id)
|
|
150
160
|
* [`commercelayer stock_transfer:cancel ID`](#commercelayer-stock_transfercancel-id)
|
|
151
161
|
* [`commercelayer stock_transfer:complete ID`](#commercelayer-stock_transfercomplete-id)
|
|
152
162
|
* [`commercelayer stock_transfer:in_transit ID`](#commercelayer-stock_transferin_transit-id)
|
|
163
|
+
* [`commercelayer stock_transfer:on_hold ID`](#commercelayer-stock_transferon_hold-id)
|
|
153
164
|
* [`commercelayer stock_transfer:picking ID`](#commercelayer-stock_transferpicking-id)
|
|
154
165
|
* [`commercelayer stock_transfer:upcoming ID`](#commercelayer-stock_transferupcoming-id)
|
|
155
166
|
* [`commercelayer stripe_payment ID`](#commercelayer-stripe_payment-id)
|
|
156
167
|
* [`commercelayer stripe_payment:refresh ID`](#commercelayer-stripe_paymentrefresh-id)
|
|
157
168
|
* [`commercelayer stripe_payment:update ID`](#commercelayer-stripe_paymentupdate-id)
|
|
158
169
|
* [`commercelayer webhook ID`](#commercelayer-webhook-id)
|
|
170
|
+
* [`commercelayer webhook:disable ID`](#commercelayer-webhookdisable-id)
|
|
171
|
+
* [`commercelayer webhook:enable ID`](#commercelayer-webhookenable-id)
|
|
159
172
|
* [`commercelayer webhook:reset_circuit ID`](#commercelayer-webhookreset_circuit-id)
|
|
160
173
|
|
|
161
174
|
### `commercelayer adyen_payment ID`
|
|
@@ -1220,7 +1233,7 @@ _See code: [src/commands/line_item/index.ts](https://github.com/commercelayer/co
|
|
|
1220
1233
|
|
|
1221
1234
|
### `commercelayer line_item:external_price ID`
|
|
1222
1235
|
|
|
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.
|
|
1236
|
+
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
1237
|
|
|
1225
1238
|
```sh-session
|
|
1226
1239
|
USAGE
|
|
@@ -1236,7 +1249,8 @@ FLAGS
|
|
|
1236
1249
|
|
|
1237
1250
|
DESCRIPTION
|
|
1238
1251
|
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.
|
|
1252
|
+
from an external source. Any successive price computation will be done externally, until the attribute is reset to
|
|
1253
|
+
'0'.
|
|
1240
1254
|
```
|
|
1241
1255
|
|
|
1242
1256
|
_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 +2521,29 @@ DESCRIPTION
|
|
|
2507
2521
|
|
|
2508
2522
|
_See code: [src/commands/shipment/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/index.ts)_
|
|
2509
2523
|
|
|
2524
|
+
### `commercelayer shipment:decrement_stock ID`
|
|
2525
|
+
|
|
2526
|
+
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.
|
|
2527
|
+
|
|
2528
|
+
```sh-session
|
|
2529
|
+
USAGE
|
|
2530
|
+
$ commercelayer shipment:decrement_stock ID [-u [-j -p]]
|
|
2531
|
+
|
|
2532
|
+
ARGUMENTS
|
|
2533
|
+
ID the unique id of the resource
|
|
2534
|
+
|
|
2535
|
+
FLAGS
|
|
2536
|
+
-j, --json print result in JSON format
|
|
2537
|
+
-p, --print print out the modified resource
|
|
2538
|
+
-u, --unformatted print JSON output without indentation
|
|
2539
|
+
|
|
2540
|
+
DESCRIPTION
|
|
2541
|
+
Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line
|
|
2542
|
+
item. Can be done only when fulfillment is in progress.
|
|
2543
|
+
```
|
|
2544
|
+
|
|
2545
|
+
_See code: [src/commands/shipment/decrement_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/decrement_stock.ts)_
|
|
2546
|
+
|
|
2510
2547
|
### `commercelayer shipment:get_rates ID`
|
|
2511
2548
|
|
|
2512
2549
|
Send this attribute if you want get the shipping rates from the associated carrier accounts.
|
|
@@ -2639,6 +2676,52 @@ DESCRIPTION
|
|
|
2639
2676
|
|
|
2640
2677
|
_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
2678
|
|
|
2679
|
+
### `commercelayer shipment:release_stock ID`
|
|
2680
|
+
|
|
2681
|
+
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.
|
|
2682
|
+
|
|
2683
|
+
```sh-session
|
|
2684
|
+
USAGE
|
|
2685
|
+
$ commercelayer shipment:release_stock ID [-u [-j -p]]
|
|
2686
|
+
|
|
2687
|
+
ARGUMENTS
|
|
2688
|
+
ID the unique id of the resource
|
|
2689
|
+
|
|
2690
|
+
FLAGS
|
|
2691
|
+
-j, --json print result in JSON format
|
|
2692
|
+
-p, --print print out the modified resource
|
|
2693
|
+
-u, --unformatted print JSON output without indentation
|
|
2694
|
+
|
|
2695
|
+
DESCRIPTION
|
|
2696
|
+
Send this attribute if you want to automatically release the stock for each of the associated stock line item. Can be
|
|
2697
|
+
done only when fulfillment is in progress.
|
|
2698
|
+
```
|
|
2699
|
+
|
|
2700
|
+
_See code: [src/commands/shipment/release_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/release_stock.ts)_
|
|
2701
|
+
|
|
2702
|
+
### `commercelayer shipment:reserve_stock ID`
|
|
2703
|
+
|
|
2704
|
+
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.
|
|
2705
|
+
|
|
2706
|
+
```sh-session
|
|
2707
|
+
USAGE
|
|
2708
|
+
$ commercelayer shipment:reserve_stock ID [-u [-j -p]]
|
|
2709
|
+
|
|
2710
|
+
ARGUMENTS
|
|
2711
|
+
ID the unique id of the resource
|
|
2712
|
+
|
|
2713
|
+
FLAGS
|
|
2714
|
+
-j, --json print result in JSON format
|
|
2715
|
+
-p, --print print out the modified resource
|
|
2716
|
+
-u, --unformatted print JSON output without indentation
|
|
2717
|
+
|
|
2718
|
+
DESCRIPTION
|
|
2719
|
+
Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be
|
|
2720
|
+
done only when fulfillment is in progress.
|
|
2721
|
+
```
|
|
2722
|
+
|
|
2723
|
+
_See code: [src/commands/shipment/reserve_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/reserve_stock.ts)_
|
|
2724
|
+
|
|
2642
2725
|
### `commercelayer shipment:ship ID`
|
|
2643
2726
|
|
|
2644
2727
|
Send this attribute if you want to mark this shipment as shipped.
|
|
@@ -2661,6 +2744,28 @@ DESCRIPTION
|
|
|
2661
2744
|
|
|
2662
2745
|
_See code: [src/commands/shipment/ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ship.ts)_
|
|
2663
2746
|
|
|
2747
|
+
### `commercelayer shipment:upcoming ID`
|
|
2748
|
+
|
|
2749
|
+
Send this attribute if you want to mark this shipment as upcoming.
|
|
2750
|
+
|
|
2751
|
+
```sh-session
|
|
2752
|
+
USAGE
|
|
2753
|
+
$ commercelayer shipment:upcoming ID [-u [-j -p]]
|
|
2754
|
+
|
|
2755
|
+
ARGUMENTS
|
|
2756
|
+
ID the unique id of the resource
|
|
2757
|
+
|
|
2758
|
+
FLAGS
|
|
2759
|
+
-j, --json print result in JSON format
|
|
2760
|
+
-p, --print print out the modified resource
|
|
2761
|
+
-u, --unformatted print JSON output without indentation
|
|
2762
|
+
|
|
2763
|
+
DESCRIPTION
|
|
2764
|
+
Send this attribute if you want to mark this shipment as upcoming.
|
|
2765
|
+
```
|
|
2766
|
+
|
|
2767
|
+
_See code: [src/commands/shipment/upcoming.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/upcoming.ts)_
|
|
2768
|
+
|
|
2664
2769
|
### `commercelayer shipping_method ID`
|
|
2665
2770
|
|
|
2666
2771
|
Execute an action on a resource of type shipping_methods.
|
|
@@ -2727,6 +2832,141 @@ DESCRIPTION
|
|
|
2727
2832
|
|
|
2728
2833
|
_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
2834
|
|
|
2835
|
+
### `commercelayer stock_line_item ID`
|
|
2836
|
+
|
|
2837
|
+
Execute an action on a resource of type stock_line_items.
|
|
2838
|
+
|
|
2839
|
+
```sh-session
|
|
2840
|
+
USAGE
|
|
2841
|
+
$ commercelayer stock_line_item ID [-u [-j -p]]
|
|
2842
|
+
|
|
2843
|
+
ARGUMENTS
|
|
2844
|
+
ID the unique id of the resource
|
|
2845
|
+
|
|
2846
|
+
FLAGS
|
|
2847
|
+
-j, --json print result in JSON format
|
|
2848
|
+
-p, --print print out the modified resource
|
|
2849
|
+
-u, --unformatted print JSON output without indentation
|
|
2850
|
+
|
|
2851
|
+
DESCRIPTION
|
|
2852
|
+
execute an action on a resource of type stock_line_items
|
|
2853
|
+
```
|
|
2854
|
+
|
|
2855
|
+
_See code: [src/commands/stock_line_item/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_line_item/index.ts)_
|
|
2856
|
+
|
|
2857
|
+
### `commercelayer stock_line_item:decrement_stock ID`
|
|
2858
|
+
|
|
2859
|
+
Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done only when fulfillment is in progress.
|
|
2860
|
+
|
|
2861
|
+
```sh-session
|
|
2862
|
+
USAGE
|
|
2863
|
+
$ commercelayer stock_line_item:decrement_stock ID [-u [-j -p]]
|
|
2864
|
+
|
|
2865
|
+
ARGUMENTS
|
|
2866
|
+
ID the unique id of the resource
|
|
2867
|
+
|
|
2868
|
+
FLAGS
|
|
2869
|
+
-j, --json print result in JSON format
|
|
2870
|
+
-p, --print print out the modified resource
|
|
2871
|
+
-u, --unformatted print JSON output without indentation
|
|
2872
|
+
|
|
2873
|
+
DESCRIPTION
|
|
2874
|
+
Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done
|
|
2875
|
+
only when fulfillment is in progress.
|
|
2876
|
+
```
|
|
2877
|
+
|
|
2878
|
+
_See code: [src/commands/stock_line_item/decrement_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_line_item/decrement_stock.ts)_
|
|
2879
|
+
|
|
2880
|
+
### `commercelayer stock_line_item:release_stock ID`
|
|
2881
|
+
|
|
2882
|
+
Send this attribute if you want to automatically release the stock for this stock line item. Can be done only when fulfillment is in progress.
|
|
2883
|
+
|
|
2884
|
+
```sh-session
|
|
2885
|
+
USAGE
|
|
2886
|
+
$ commercelayer stock_line_item:release_stock ID [-u [-j -p]]
|
|
2887
|
+
|
|
2888
|
+
ARGUMENTS
|
|
2889
|
+
ID the unique id of the resource
|
|
2890
|
+
|
|
2891
|
+
FLAGS
|
|
2892
|
+
-j, --json print result in JSON format
|
|
2893
|
+
-p, --print print out the modified resource
|
|
2894
|
+
-u, --unformatted print JSON output without indentation
|
|
2895
|
+
|
|
2896
|
+
DESCRIPTION
|
|
2897
|
+
Send this attribute if you want to automatically release the stock for this stock line item. Can be done only when
|
|
2898
|
+
fulfillment is in progress.
|
|
2899
|
+
```
|
|
2900
|
+
|
|
2901
|
+
_See code: [src/commands/stock_line_item/release_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_line_item/release_stock.ts)_
|
|
2902
|
+
|
|
2903
|
+
### `commercelayer stock_line_item:reserve_stock ID`
|
|
2904
|
+
|
|
2905
|
+
Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when fulfillment is in progress.
|
|
2906
|
+
|
|
2907
|
+
```sh-session
|
|
2908
|
+
USAGE
|
|
2909
|
+
$ commercelayer stock_line_item:reserve_stock ID [-u [-j -p]]
|
|
2910
|
+
|
|
2911
|
+
ARGUMENTS
|
|
2912
|
+
ID the unique id of the resource
|
|
2913
|
+
|
|
2914
|
+
FLAGS
|
|
2915
|
+
-j, --json print result in JSON format
|
|
2916
|
+
-p, --print print out the modified resource
|
|
2917
|
+
-u, --unformatted print JSON output without indentation
|
|
2918
|
+
|
|
2919
|
+
DESCRIPTION
|
|
2920
|
+
Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when
|
|
2921
|
+
fulfillment is in progress.
|
|
2922
|
+
```
|
|
2923
|
+
|
|
2924
|
+
_See code: [src/commands/stock_line_item/reserve_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_line_item/reserve_stock.ts)_
|
|
2925
|
+
|
|
2926
|
+
### `commercelayer stock_reservation ID`
|
|
2927
|
+
|
|
2928
|
+
Execute an action on a resource of type stock_reservations.
|
|
2929
|
+
|
|
2930
|
+
```sh-session
|
|
2931
|
+
USAGE
|
|
2932
|
+
$ commercelayer stock_reservation ID [-u [-j -p]]
|
|
2933
|
+
|
|
2934
|
+
ARGUMENTS
|
|
2935
|
+
ID the unique id of the resource
|
|
2936
|
+
|
|
2937
|
+
FLAGS
|
|
2938
|
+
-j, --json print result in JSON format
|
|
2939
|
+
-p, --print print out the modified resource
|
|
2940
|
+
-u, --unformatted print JSON output without indentation
|
|
2941
|
+
|
|
2942
|
+
DESCRIPTION
|
|
2943
|
+
execute an action on a resource of type stock_reservations
|
|
2944
|
+
```
|
|
2945
|
+
|
|
2946
|
+
_See code: [src/commands/stock_reservation/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/index.ts)_
|
|
2947
|
+
|
|
2948
|
+
### `commercelayer stock_reservation:pending ID`
|
|
2949
|
+
|
|
2950
|
+
Send this attribute if you want to mark this stock reservation as pending.
|
|
2951
|
+
|
|
2952
|
+
```sh-session
|
|
2953
|
+
USAGE
|
|
2954
|
+
$ commercelayer stock_reservation:pending ID [-u [-j -p]]
|
|
2955
|
+
|
|
2956
|
+
ARGUMENTS
|
|
2957
|
+
ID the unique id of the resource
|
|
2958
|
+
|
|
2959
|
+
FLAGS
|
|
2960
|
+
-j, --json print result in JSON format
|
|
2961
|
+
-p, --print print out the modified resource
|
|
2962
|
+
-u, --unformatted print JSON output without indentation
|
|
2963
|
+
|
|
2964
|
+
DESCRIPTION
|
|
2965
|
+
Send this attribute if you want to mark this stock reservation as pending.
|
|
2966
|
+
```
|
|
2967
|
+
|
|
2968
|
+
_See code: [src/commands/stock_reservation/pending.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/pending.ts)_
|
|
2969
|
+
|
|
2730
2970
|
### `commercelayer stock_transfer ID`
|
|
2731
2971
|
|
|
2732
2972
|
Execute an action on a resource of type stock_transfers.
|
|
@@ -2815,6 +3055,28 @@ DESCRIPTION
|
|
|
2815
3055
|
|
|
2816
3056
|
_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
3057
|
|
|
3058
|
+
### `commercelayer stock_transfer:on_hold ID`
|
|
3059
|
+
|
|
3060
|
+
Send this attribute if you want to put this stock transfer on hold.
|
|
3061
|
+
|
|
3062
|
+
```sh-session
|
|
3063
|
+
USAGE
|
|
3064
|
+
$ commercelayer stock_transfer:on_hold ID [-u [-j -p]]
|
|
3065
|
+
|
|
3066
|
+
ARGUMENTS
|
|
3067
|
+
ID the unique id of the resource
|
|
3068
|
+
|
|
3069
|
+
FLAGS
|
|
3070
|
+
-j, --json print result in JSON format
|
|
3071
|
+
-p, --print print out the modified resource
|
|
3072
|
+
-u, --unformatted print JSON output without indentation
|
|
3073
|
+
|
|
3074
|
+
DESCRIPTION
|
|
3075
|
+
Send this attribute if you want to put this stock transfer on hold.
|
|
3076
|
+
```
|
|
3077
|
+
|
|
3078
|
+
_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)_
|
|
3079
|
+
|
|
2818
3080
|
### `commercelayer stock_transfer:picking ID`
|
|
2819
3081
|
|
|
2820
3082
|
Send this attribute if you want to start picking this stock transfer.
|
|
@@ -2947,6 +3209,50 @@ DESCRIPTION
|
|
|
2947
3209
|
|
|
2948
3210
|
_See code: [src/commands/webhook/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/webhook/index.ts)_
|
|
2949
3211
|
|
|
3212
|
+
### `commercelayer webhook:disable ID`
|
|
3213
|
+
|
|
3214
|
+
Send this attribute if you want to mark the webhook as disabled.
|
|
3215
|
+
|
|
3216
|
+
```sh-session
|
|
3217
|
+
USAGE
|
|
3218
|
+
$ commercelayer webhook:disable ID [-u [-j -p]]
|
|
3219
|
+
|
|
3220
|
+
ARGUMENTS
|
|
3221
|
+
ID the unique id of the resource
|
|
3222
|
+
|
|
3223
|
+
FLAGS
|
|
3224
|
+
-j, --json print result in JSON format
|
|
3225
|
+
-p, --print print out the modified resource
|
|
3226
|
+
-u, --unformatted print JSON output without indentation
|
|
3227
|
+
|
|
3228
|
+
DESCRIPTION
|
|
3229
|
+
Send this attribute if you want to mark the webhook as disabled.
|
|
3230
|
+
```
|
|
3231
|
+
|
|
3232
|
+
_See code: [src/commands/webhook/disable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/webhook/disable.ts)_
|
|
3233
|
+
|
|
3234
|
+
### `commercelayer webhook:enable ID`
|
|
3235
|
+
|
|
3236
|
+
Send this attribute if you want to mark the webhook as enabled.
|
|
3237
|
+
|
|
3238
|
+
```sh-session
|
|
3239
|
+
USAGE
|
|
3240
|
+
$ commercelayer webhook:enable ID [-u [-j -p]]
|
|
3241
|
+
|
|
3242
|
+
ARGUMENTS
|
|
3243
|
+
ID the unique id of the resource
|
|
3244
|
+
|
|
3245
|
+
FLAGS
|
|
3246
|
+
-j, --json print result in JSON format
|
|
3247
|
+
-p, --print print out the modified resource
|
|
3248
|
+
-u, --unformatted print JSON output without indentation
|
|
3249
|
+
|
|
3250
|
+
DESCRIPTION
|
|
3251
|
+
Send this attribute if you want to mark the webhook as enabled.
|
|
3252
|
+
```
|
|
3253
|
+
|
|
3254
|
+
_See code: [src/commands/webhook/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/webhook/enable.ts)_
|
|
3255
|
+
|
|
2950
3256
|
### `commercelayer webhook:reset_circuit ID`
|
|
2951
3257
|
|
|
2952
3258
|
Send this attribute if you want to reset the circuit breaker associated to this webhook to 'closed' state and zero failures count.
|
package/bin/dev
CHANGED
|
File without changes
|
package/bin/run
CHANGED
|
File without changes
|
package/lib/base.d.ts
CHANGED
|
@@ -4,20 +4,21 @@ import type { Resource } from '@commercelayer/sdk/lib/cjs/resource';
|
|
|
4
4
|
import type { CLIError } from '@oclif/core/lib/errors';
|
|
5
5
|
export default abstract class extends Command {
|
|
6
6
|
static baseFlags: {
|
|
7
|
-
organization: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces
|
|
8
|
-
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces
|
|
9
|
-
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces
|
|
7
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
unformatted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
static args: {
|
|
15
|
-
id: import("@oclif/core/lib/interfaces
|
|
15
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
16
|
};
|
|
17
17
|
init(): Promise<any>;
|
|
18
18
|
catch(error: CLIError): Promise<any>;
|
|
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,12 +1,52 @@
|
|
|
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 {
|
|
12
|
+
static baseFlags = {
|
|
13
|
+
organization: core_1.Flags.string({
|
|
14
|
+
char: 'o',
|
|
15
|
+
description: 'the slug of your organization',
|
|
16
|
+
required: true,
|
|
17
|
+
env: 'CL_CLI_ORGANIZATION',
|
|
18
|
+
hidden: true,
|
|
19
|
+
}),
|
|
20
|
+
domain: core_1.Flags.string({
|
|
21
|
+
char: 'd',
|
|
22
|
+
required: false,
|
|
23
|
+
hidden: true,
|
|
24
|
+
dependsOn: ['organization'],
|
|
25
|
+
env: 'CL_CLI_DOMAIN',
|
|
26
|
+
}),
|
|
27
|
+
accessToken: core_1.Flags.string({
|
|
28
|
+
hidden: true,
|
|
29
|
+
required: true,
|
|
30
|
+
env: 'CL_CLI_ACCESS_TOKEN',
|
|
31
|
+
}),
|
|
32
|
+
print: core_1.Flags.boolean({
|
|
33
|
+
char: 'p',
|
|
34
|
+
description: 'print out the modified resource',
|
|
35
|
+
}),
|
|
36
|
+
json: core_1.Flags.boolean({
|
|
37
|
+
char: 'j',
|
|
38
|
+
description: 'print result in JSON format',
|
|
39
|
+
dependsOn: ['print'],
|
|
40
|
+
}),
|
|
41
|
+
unformatted: core_1.Flags.boolean({
|
|
42
|
+
char: 'u',
|
|
43
|
+
description: 'print JSON output without indentation',
|
|
44
|
+
dependsOn: ['json'],
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
static args = {
|
|
48
|
+
id: core_1.Args.string({ name: 'id', description: 'the unique id of the resource', required: true }),
|
|
49
|
+
};
|
|
10
50
|
// INIT (override)
|
|
11
51
|
async init() {
|
|
12
52
|
cli_core_1.clUpdate.checkUpdate(pkg);
|
|
@@ -16,15 +56,15 @@ class default_1 extends core_1.Command {
|
|
|
16
56
|
this.handleError(error);
|
|
17
57
|
}
|
|
18
58
|
handleError(error, flags) {
|
|
19
|
-
|
|
20
|
-
|
|
59
|
+
if (error.message?.match(/Missing \d required args?:\nid/)) {
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
21
61
|
const resName = cli_core_1.clApi.humanizeResource((error.parse.input.context.id).split(':')[0]);
|
|
22
62
|
this.error(`Missing the required unique ${cli_core_1.clColor.style.error('id')} of the ${cli_core_1.clColor.cli.command(resName)}`);
|
|
23
63
|
}
|
|
24
64
|
else if (sdk_1.CommerceLayerStatic.isApiError(error)) {
|
|
25
65
|
let res = '';
|
|
26
66
|
let id = '';
|
|
27
|
-
if (
|
|
67
|
+
if (error.code?.startsWith('RES_')) {
|
|
28
68
|
const tokens = error.code.replace('RES_', '').split('_');
|
|
29
69
|
if (tokens.length > 0)
|
|
30
70
|
res = tokens[0];
|
|
@@ -50,43 +90,8 @@ class default_1 extends core_1.Command {
|
|
|
50
90
|
successMessage(resource, action, id) {
|
|
51
91
|
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
92
|
}
|
|
93
|
+
async executeAction(resourceType, id, action, flags, fields) {
|
|
94
|
+
return await (0, exec_1.default)(resourceType, id, action, flags, fields, this.config);
|
|
95
|
+
}
|
|
53
96
|
}
|
|
54
|
-
default_1.baseFlags = {
|
|
55
|
-
organization: core_1.Flags.string({
|
|
56
|
-
char: 'o',
|
|
57
|
-
description: 'the slug of your organization',
|
|
58
|
-
required: true,
|
|
59
|
-
env: 'CL_CLI_ORGANIZATION',
|
|
60
|
-
hidden: true,
|
|
61
|
-
}),
|
|
62
|
-
domain: core_1.Flags.string({
|
|
63
|
-
char: 'd',
|
|
64
|
-
required: false,
|
|
65
|
-
hidden: true,
|
|
66
|
-
dependsOn: ['organization'],
|
|
67
|
-
env: 'CL_CLI_DOMAIN',
|
|
68
|
-
}),
|
|
69
|
-
accessToken: core_1.Flags.string({
|
|
70
|
-
hidden: true,
|
|
71
|
-
required: true,
|
|
72
|
-
env: 'CL_CLI_ACCESS_TOKEN',
|
|
73
|
-
}),
|
|
74
|
-
print: core_1.Flags.boolean({
|
|
75
|
-
char: 'p',
|
|
76
|
-
description: 'print out the modified resource',
|
|
77
|
-
}),
|
|
78
|
-
json: core_1.Flags.boolean({
|
|
79
|
-
char: 'j',
|
|
80
|
-
description: 'print result in JSON format',
|
|
81
|
-
dependsOn: ['print'],
|
|
82
|
-
}),
|
|
83
|
-
unformatted: core_1.Flags.boolean({
|
|
84
|
-
char: 'u',
|
|
85
|
-
description: 'print JSON output without indentation',
|
|
86
|
-
dependsOn: ['json'],
|
|
87
|
-
}),
|
|
88
|
-
};
|
|
89
|
-
default_1.args = {
|
|
90
|
-
id: core_1.Args.string({ name: 'id', description: 'the unique id of the resource', required: true }),
|
|
91
|
-
};
|
|
92
97
|
exports.default = default_1;
|
|
@@ -3,7 +3,7 @@ export default class AdyenPaymentDetails extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {};
|
|
5
5
|
static args: {
|
|
6
|
-
id: import("@oclif/core/lib/interfaces
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<any>;
|
|
9
9
|
}
|
|
@@ -2,20 +2,21 @@
|
|
|
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 {
|
|
8
|
+
static description = adyen_payments_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
9
13
|
async run() {
|
|
10
14
|
const { args, flags } = await this.parse(AdyenPaymentDetails);
|
|
11
|
-
const res = await
|
|
15
|
+
const res = await this.executeAction('adyen_payments', args.id, TRIGGER, flags);
|
|
12
16
|
if (flags.print)
|
|
13
17
|
this.printOutput(res, flags);
|
|
14
18
|
this.successMessage('adyen_payment', TRIGGER, res.id);
|
|
15
19
|
return res;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
AdyenPaymentDetails.description = adyen_payments_1.triggers[TRIGGER].description;
|
|
19
|
-
AdyenPaymentDetails.flags = {};
|
|
20
|
-
AdyenPaymentDetails.args = Object.assign({}, base_1.default.args);
|
|
21
22
|
exports.default = AdyenPaymentDetails;
|
|
@@ -3,7 +3,7 @@ export default class AdyenPaymentIndex extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {};
|
|
5
5
|
static args: {
|
|
6
|
-
id: import("@oclif/core/lib/interfaces
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<any>;
|
|
9
9
|
}
|
|
@@ -20,6 +20,11 @@ const promptAction = async (id) => {
|
|
|
20
20
|
return answers.trigger;
|
|
21
21
|
};
|
|
22
22
|
class AdyenPaymentIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type adyen_payments';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
23
28
|
async run() {
|
|
24
29
|
const { args, flags } = await this.parse(AdyenPaymentIndex);
|
|
25
30
|
const id = args.id;
|
|
@@ -32,7 +37,4 @@ class AdyenPaymentIndex extends base_1.default {
|
|
|
32
37
|
return res;
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
|
-
AdyenPaymentIndex.description = 'execute an action on a resource of type adyen_payments';
|
|
36
|
-
AdyenPaymentIndex.flags = {};
|
|
37
|
-
AdyenPaymentIndex.args = Object.assign({}, base_1.default.args);
|
|
38
40
|
exports.default = AdyenPaymentIndex;
|
|
@@ -3,7 +3,7 @@ export default class AuthorizationCapture extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {};
|
|
5
5
|
static args: {
|
|
6
|
-
id: import("@oclif/core/lib/interfaces
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<any>;
|
|
9
9
|
}
|
|
@@ -2,20 +2,21 @@
|
|
|
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 {
|
|
8
|
+
static description = authorizations_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
9
13
|
async run() {
|
|
10
14
|
const { args, flags } = await this.parse(AuthorizationCapture);
|
|
11
|
-
const res = await
|
|
15
|
+
const res = await this.executeAction('authorizations', args.id, TRIGGER, flags);
|
|
12
16
|
if (flags.print)
|
|
13
17
|
this.printOutput(res, flags);
|
|
14
18
|
this.successMessage('authorization', TRIGGER, res.id);
|
|
15
19
|
return res;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
AuthorizationCapture.description = authorizations_1.triggers[TRIGGER].description;
|
|
19
|
-
AuthorizationCapture.flags = {};
|
|
20
|
-
AuthorizationCapture.args = Object.assign({}, base_1.default.args);
|
|
21
22
|
exports.default = AuthorizationCapture;
|
|
@@ -3,7 +3,7 @@ export default class AuthorizationCaptureAmountCents extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {};
|
|
5
5
|
static args: {
|
|
6
|
-
id: import("@oclif/core/lib/interfaces
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<any>;
|
|
9
9
|
}
|