@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
|
@@ -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 orders_1 = require("../../triggers/orders");
|
|
7
6
|
const TRIGGER = 'validate';
|
|
8
7
|
class OrderValidate extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(OrderValidate);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('orders', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('order', 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 order_subscriptions_1 = require("../../triggers/order_subscriptions");
|
|
7
6
|
const TRIGGER = 'activate';
|
|
8
7
|
class OrderSubscriptionActivate extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(OrderSubscriptionActivate);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('order_subscriptions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('order_subscription', 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 order_subscriptions_1 = require("../../triggers/order_subscriptions");
|
|
7
6
|
const TRIGGER = 'cancel';
|
|
8
7
|
class OrderSubscriptionCancel extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(OrderSubscriptionCancel);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('order_subscriptions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('order_subscription', 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 order_subscriptions_1 = require("../../triggers/order_subscriptions");
|
|
7
6
|
const TRIGGER = 'deactivate';
|
|
8
7
|
class OrderSubscriptionDeactivate extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(OrderSubscriptionDeactivate);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('order_subscriptions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('order_subscription', 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 payment_methods_1 = require("../../triggers/payment_methods");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class PaymentMethodDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(PaymentMethodDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('payment_methods', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('payment_method', 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 payment_methods_1 = require("../../triggers/payment_methods");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class PaymentMethodEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(PaymentMethodEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('payment_methods', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('payment_method', 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 percentage_discount_promotions_1 = require("../../triggers/percentage_discount_promotions");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class PercentageDiscountPromotionDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(PercentageDiscountPromotionDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('percentage_discount_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('percentage_discount_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 percentage_discount_promotions_1 = require("../../triggers/percentage_discount_promotions");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class PercentageDiscountPromotionEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(PercentageDiscountPromotionEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('percentage_discount_promotions', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('percentage_discount_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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'approve';
|
|
8
7
|
class ReturnApprove extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnApprove);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'archive';
|
|
8
7
|
class ReturnArchive extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnArchive);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'cancel';
|
|
8
7
|
class ReturnCancel extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnCancel);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'receive';
|
|
8
7
|
class ReturnReceive extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnReceive);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'reject';
|
|
8
7
|
class ReturnReject extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnReject);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'request';
|
|
8
7
|
class ReturnRequest extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnRequest);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'restock';
|
|
8
7
|
class ReturnRestock extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnRestock);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'ship';
|
|
8
7
|
class ReturnShip extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnShip);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 returns_1 = require("../../triggers/returns");
|
|
7
6
|
const TRIGGER = 'unarchive';
|
|
8
7
|
class ReturnUnarchive extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnUnarchive);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('returns', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return', 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 return_line_items_1 = require("../../triggers/return_line_items");
|
|
7
6
|
const TRIGGER = 'restock';
|
|
8
7
|
class ReturnLineItemRestock extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ReturnLineItemRestock);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('return_line_items', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('return_line_item', 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 satispay_payments_1 = require("../../triggers/satispay_payments");
|
|
7
6
|
const TRIGGER = 'refresh';
|
|
8
7
|
class SatispayPaymentRefresh extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(SatispayPaymentRefresh);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('satispay_payments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('satispay_payment', TRIGGER, res.id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShipmentDecrementStock extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 shipments_1 = require("../../triggers/shipments");
|
|
6
|
+
const TRIGGER = 'decrement_stock';
|
|
7
|
+
class ShipmentDecrementStock extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ShipmentDecrementStock);
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('shipment', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ShipmentDecrementStock.description = shipments_1.triggers[TRIGGER].description;
|
|
18
|
+
ShipmentDecrementStock.flags = {};
|
|
19
|
+
ShipmentDecrementStock.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ShipmentDecrementStock;
|
|
@@ -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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'get_rates';
|
|
8
7
|
class ShipmentGetRates extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentGetRates);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', 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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'on_hold';
|
|
8
7
|
class ShipmentOnHold extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentOnHold);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', 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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'packing';
|
|
8
7
|
class ShipmentPacking extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentPacking);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', 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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'picking';
|
|
8
7
|
class ShipmentPicking extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentPicking);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', 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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'purchase';
|
|
8
7
|
class ShipmentPurchase extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentPurchase);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', 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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'ready_to_ship';
|
|
8
7
|
class ShipmentReadyToShip extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentReadyToShip);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', TRIGGER, res.id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShipmentReleaseStock extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 shipments_1 = require("../../triggers/shipments");
|
|
6
|
+
const TRIGGER = 'release_stock';
|
|
7
|
+
class ShipmentReleaseStock extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ShipmentReleaseStock);
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('shipment', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ShipmentReleaseStock.description = shipments_1.triggers[TRIGGER].description;
|
|
18
|
+
ShipmentReleaseStock.flags = {};
|
|
19
|
+
ShipmentReleaseStock.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ShipmentReleaseStock;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShipmentReserveStock extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 shipments_1 = require("../../triggers/shipments");
|
|
6
|
+
const TRIGGER = 'reserve_stock';
|
|
7
|
+
class ShipmentReserveStock extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ShipmentReserveStock);
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('shipment', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ShipmentReserveStock.description = shipments_1.triggers[TRIGGER].description;
|
|
18
|
+
ShipmentReserveStock.flags = {};
|
|
19
|
+
ShipmentReserveStock.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ShipmentReserveStock;
|
|
@@ -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 shipments_1 = require("../../triggers/shipments");
|
|
7
6
|
const TRIGGER = 'ship';
|
|
8
7
|
class ShipmentShip extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShipmentShip);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipment', TRIGGER, res.id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ShipmentUpcoming extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 shipments_1 = require("../../triggers/shipments");
|
|
6
|
+
const TRIGGER = 'upcoming';
|
|
7
|
+
class ShipmentUpcoming extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ShipmentUpcoming);
|
|
10
|
+
const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('shipment', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ShipmentUpcoming.description = shipments_1.triggers[TRIGGER].description;
|
|
18
|
+
ShipmentUpcoming.flags = {};
|
|
19
|
+
ShipmentUpcoming.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ShipmentUpcoming;
|
|
@@ -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 shipping_methods_1 = require("../../triggers/shipping_methods");
|
|
7
6
|
const TRIGGER = 'disable';
|
|
8
7
|
class ShippingMethodDisable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShippingMethodDisable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipping_methods', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipping_method', 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 shipping_methods_1 = require("../../triggers/shipping_methods");
|
|
7
6
|
const TRIGGER = 'enable';
|
|
8
7
|
class ShippingMethodEnable extends base_1.default {
|
|
9
8
|
async run() {
|
|
10
9
|
const { args, flags } = await this.parse(ShippingMethodEnable);
|
|
11
|
-
const res = await
|
|
10
|
+
const res = await this.executeAction('shipping_methods', args.id, TRIGGER, flags);
|
|
12
11
|
if (flags.print)
|
|
13
12
|
this.printOutput(res, flags);
|
|
14
13
|
this.successMessage('shipping_method', TRIGGER, res.id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class StockReservationIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 stock_reservations_1 = require("../../triggers/stock_reservations");
|
|
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 stock reservation ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(stock_reservations_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 StockReservationIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(StockReservationIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('stock_reservations', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('stock reservation', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
StockReservationIndex.description = 'execute an action on a resource of type stock_reservations';
|
|
36
|
+
StockReservationIndex.flags = {};
|
|
37
|
+
StockReservationIndex.args = Object.assign({}, base_1.default.args);
|
|
38
|
+
exports.default = StockReservationIndex;
|