@commercelayer/cli-plugin-triggers 3.13.1 → 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 +653 -5
- 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.d.ts +9 -0
- package/lib/commands/buy_x_pay_y_promotion/disable.js +20 -0
- package/lib/commands/buy_x_pay_y_promotion/enable.d.ts +9 -0
- package/lib/commands/buy_x_pay_y_promotion/enable.js +20 -0
- package/lib/commands/buy_x_pay_y_promotion/index.d.ts +9 -0
- package/lib/commands/buy_x_pay_y_promotion/index.js +38 -0
- 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.d.ts +9 -0
- package/lib/commands/external_promotion/disable.js +20 -0
- package/lib/commands/external_promotion/enable.d.ts +9 -0
- package/lib/commands/external_promotion/enable.js +20 -0
- package/lib/commands/external_promotion/index.d.ts +9 -0
- package/lib/commands/external_promotion/index.js +38 -0
- package/lib/commands/fixed_amount_promotion/disable.d.ts +9 -0
- package/lib/commands/fixed_amount_promotion/disable.js +20 -0
- package/lib/commands/fixed_amount_promotion/enable.d.ts +9 -0
- package/lib/commands/fixed_amount_promotion/enable.js +20 -0
- package/lib/commands/fixed_amount_promotion/index.d.ts +9 -0
- package/lib/commands/fixed_amount_promotion/index.js +38 -0
- package/lib/commands/fixed_price_promotion/disable.d.ts +9 -0
- package/lib/commands/fixed_price_promotion/disable.js +20 -0
- package/lib/commands/fixed_price_promotion/enable.d.ts +9 -0
- package/lib/commands/fixed_price_promotion/enable.js +20 -0
- package/lib/commands/fixed_price_promotion/index.d.ts +9 -0
- package/lib/commands/fixed_price_promotion/index.js +38 -0
- package/lib/commands/free_gift_promotion/disable.d.ts +9 -0
- package/lib/commands/free_gift_promotion/disable.js +20 -0
- package/lib/commands/free_gift_promotion/enable.d.ts +9 -0
- package/lib/commands/free_gift_promotion/enable.js +20 -0
- package/lib/commands/free_gift_promotion/index.d.ts +9 -0
- package/lib/commands/free_gift_promotion/index.js +38 -0
- package/lib/commands/free_shipping_promotion/disable.d.ts +9 -0
- package/lib/commands/free_shipping_promotion/disable.js +20 -0
- package/lib/commands/free_shipping_promotion/enable.d.ts +9 -0
- package/lib/commands/free_shipping_promotion/enable.js +20 -0
- package/lib/commands/free_shipping_promotion/index.d.ts +9 -0
- package/lib/commands/free_shipping_promotion/index.js +38 -0
- 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.d.ts +9 -0
- package/lib/commands/percentage_discount_promotion/disable.js +20 -0
- package/lib/commands/percentage_discount_promotion/enable.d.ts +9 -0
- package/lib/commands/percentage_discount_promotion/enable.js +20 -0
- package/lib/commands/percentage_discount_promotion/index.d.ts +9 -0
- package/lib/commands/percentage_discount_promotion/index.js +38 -0
- 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/buy_x_pay_y_promotions.d.ts +3 -0
- package/lib/triggers/buy_x_pay_y_promotions.js +15 -0
- package/lib/triggers/external_promotions.d.ts +3 -0
- package/lib/triggers/external_promotions.js +15 -0
- package/lib/triggers/fixed_amount_promotions.d.ts +3 -0
- package/lib/triggers/fixed_amount_promotions.js +15 -0
- package/lib/triggers/fixed_price_promotions.d.ts +3 -0
- package/lib/triggers/fixed_price_promotions.js +15 -0
- package/lib/triggers/free_gift_promotions.d.ts +3 -0
- package/lib/triggers/free_gift_promotions.js +15 -0
- package/lib/triggers/free_shipping_promotions.d.ts +3 -0
- package/lib/triggers/free_shipping_promotions.js +15 -0
- package/lib/triggers/line_items.js +1 -1
- package/lib/triggers/orders.js +1 -1
- package/lib/triggers/percentage_discount_promotions.d.ts +3 -0
- package/lib/triggers/percentage_discount_promotions.js +15 -0
- 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 +7757 -3720
- package/package.json +17 -17
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);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BuyXPayYPromotionDisable 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 buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class BuyXPayYPromotionDisable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(BuyXPayYPromotionDisable);
|
|
10
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
BuyXPayYPromotionDisable.description = buy_x_pay_y_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
BuyXPayYPromotionDisable.flags = {};
|
|
19
|
+
BuyXPayYPromotionDisable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = BuyXPayYPromotionDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BuyXPayYPromotionEnable 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 buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class BuyXPayYPromotionEnable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(BuyXPayYPromotionEnable);
|
|
10
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
BuyXPayYPromotionEnable.description = buy_x_pay_y_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
BuyXPayYPromotionEnable.flags = {};
|
|
19
|
+
BuyXPayYPromotionEnable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = BuyXPayYPromotionEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BuyXPayYPromotionIndex 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 buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
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 buy x pay y promotion ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(buy_x_pay_y_promotions_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 BuyXPayYPromotionIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(BuyXPayYPromotionIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('buy_x_pay_y_promotions', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('buy x pay y promotion', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
BuyXPayYPromotionIndex.description = 'execute an action on a resource of type buy_x_pay_y_promotions';
|
|
36
|
+
BuyXPayYPromotionIndex.flags = {};
|
|
37
|
+
BuyXPayYPromotionIndex.args = Object.assign({}, base_1.default.args);
|
|
38
|
+
exports.default = BuyXPayYPromotionIndex;
|
|
@@ -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);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ExternalPromotionDisable 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 external_promotions_1 = require("../../triggers/external_promotions");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class ExternalPromotionDisable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ExternalPromotionDisable);
|
|
10
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ExternalPromotionDisable.description = external_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
ExternalPromotionDisable.flags = {};
|
|
19
|
+
ExternalPromotionDisable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ExternalPromotionDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ExternalPromotionEnable 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 external_promotions_1 = require("../../triggers/external_promotions");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class ExternalPromotionEnable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(ExternalPromotionEnable);
|
|
10
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ExternalPromotionEnable.description = external_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
ExternalPromotionEnable.flags = {};
|
|
19
|
+
ExternalPromotionEnable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = ExternalPromotionEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ExternalPromotionIndex 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 external_promotions_1 = require("../../triggers/external_promotions");
|
|
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 external promotion ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(external_promotions_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 ExternalPromotionIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(ExternalPromotionIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('external_promotions', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('external promotion', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
ExternalPromotionIndex.description = 'execute an action on a resource of type external_promotions';
|
|
36
|
+
ExternalPromotionIndex.flags = {};
|
|
37
|
+
ExternalPromotionIndex.args = Object.assign({}, base_1.default.args);
|
|
38
|
+
exports.default = ExternalPromotionIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FixedAmountPromotionDisable 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 fixed_amount_promotions_1 = require("../../triggers/fixed_amount_promotions");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class FixedAmountPromotionDisable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(FixedAmountPromotionDisable);
|
|
10
|
+
const res = await this.executeAction('fixed_amount_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('fixed_amount_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
FixedAmountPromotionDisable.description = fixed_amount_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
FixedAmountPromotionDisable.flags = {};
|
|
19
|
+
FixedAmountPromotionDisable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = FixedAmountPromotionDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FixedAmountPromotionEnable 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 fixed_amount_promotions_1 = require("../../triggers/fixed_amount_promotions");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class FixedAmountPromotionEnable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(FixedAmountPromotionEnable);
|
|
10
|
+
const res = await this.executeAction('fixed_amount_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('fixed_amount_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
FixedAmountPromotionEnable.description = fixed_amount_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
FixedAmountPromotionEnable.flags = {};
|
|
19
|
+
FixedAmountPromotionEnable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = FixedAmountPromotionEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FixedAmountPromotionIndex 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 fixed_amount_promotions_1 = require("../../triggers/fixed_amount_promotions");
|
|
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 fixed amount promotion ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(fixed_amount_promotions_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 FixedAmountPromotionIndex extends base_1.default {
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(FixedAmountPromotionIndex);
|
|
25
|
+
const id = args.id;
|
|
26
|
+
const action = await promptAction(id);
|
|
27
|
+
const fields = [];
|
|
28
|
+
const res = await (0, exec_1.default)('fixed_amount_promotions', id, action, flags, fields);
|
|
29
|
+
this.log();
|
|
30
|
+
this.printOutput(res, flags);
|
|
31
|
+
this.successMessage('fixed amount promotion', action, res.id);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
FixedAmountPromotionIndex.description = 'execute an action on a resource of type fixed_amount_promotions';
|
|
36
|
+
FixedAmountPromotionIndex.flags = {};
|
|
37
|
+
FixedAmountPromotionIndex.args = Object.assign({}, base_1.default.args);
|
|
38
|
+
exports.default = FixedAmountPromotionIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FixedPricePromotionDisable 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 fixed_price_promotions_1 = require("../../triggers/fixed_price_promotions");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class FixedPricePromotionDisable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(FixedPricePromotionDisable);
|
|
10
|
+
const res = await this.executeAction('fixed_price_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('fixed_price_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
FixedPricePromotionDisable.description = fixed_price_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
FixedPricePromotionDisable.flags = {};
|
|
19
|
+
FixedPricePromotionDisable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = FixedPricePromotionDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FixedPricePromotionEnable 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 fixed_price_promotions_1 = require("../../triggers/fixed_price_promotions");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class FixedPricePromotionEnable extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(FixedPricePromotionEnable);
|
|
10
|
+
const res = await this.executeAction('fixed_price_promotions', args.id, TRIGGER, flags);
|
|
11
|
+
if (flags.print)
|
|
12
|
+
this.printOutput(res, flags);
|
|
13
|
+
this.successMessage('fixed_price_promotion', TRIGGER, res.id);
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
FixedPricePromotionEnable.description = fixed_price_promotions_1.triggers[TRIGGER].description;
|
|
18
|
+
FixedPricePromotionEnable.flags = {};
|
|
19
|
+
FixedPricePromotionEnable.args = Object.assign({}, base_1.default.args);
|
|
20
|
+
exports.default = FixedPricePromotionEnable;
|