@commercelayer/cli-plugin-triggers 4.10.0 → 4.12.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 +1287 -95
- package/lib/commands/address/add_tags.d.ts +9 -0
- package/lib/commands/address/add_tags.js +22 -0
- package/lib/commands/address/index.d.ts +9 -0
- package/lib/commands/address/index.js +40 -0
- package/lib/commands/address/remove_tags.d.ts +9 -0
- package/lib/commands/address/remove_tags.js +22 -0
- package/lib/commands/bundle/add_tags.d.ts +9 -0
- package/lib/commands/bundle/add_tags.js +22 -0
- package/lib/commands/bundle/remove_tags.d.ts +9 -0
- package/lib/commands/bundle/remove_tags.js +22 -0
- package/lib/commands/buy_x_pay_y_promotion/add_tags.d.ts +9 -0
- package/lib/commands/buy_x_pay_y_promotion/add_tags.js +22 -0
- package/lib/commands/buy_x_pay_y_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/buy_x_pay_y_promotion/remove_tags.js +22 -0
- package/lib/commands/coupon/add_tags.d.ts +9 -0
- package/lib/commands/coupon/add_tags.js +22 -0
- package/lib/commands/coupon/index.d.ts +9 -0
- package/lib/commands/coupon/index.js +40 -0
- package/lib/commands/coupon/remove_tags.d.ts +9 -0
- package/lib/commands/coupon/remove_tags.js +22 -0
- package/lib/commands/customer/add_tags.d.ts +9 -0
- package/lib/commands/customer/add_tags.js +22 -0
- package/lib/commands/customer/index.d.ts +9 -0
- package/lib/commands/customer/index.js +40 -0
- package/lib/commands/customer/remove_tags.d.ts +9 -0
- package/lib/commands/customer/remove_tags.js +22 -0
- package/lib/commands/easypost_pickup/index.d.ts +9 -0
- package/lib/commands/easypost_pickup/index.js +40 -0
- package/lib/commands/easypost_pickup/purchase.d.ts +9 -0
- package/lib/commands/easypost_pickup/purchase.js +22 -0
- package/lib/commands/external_promotion/add_tags.d.ts +9 -0
- package/lib/commands/external_promotion/add_tags.js +22 -0
- package/lib/commands/external_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/external_promotion/remove_tags.js +22 -0
- package/lib/commands/fixed_amount_promotion/add_tags.d.ts +9 -0
- package/lib/commands/fixed_amount_promotion/add_tags.js +22 -0
- package/lib/commands/fixed_amount_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/fixed_amount_promotion/remove_tags.js +22 -0
- package/lib/commands/fixed_price_promotion/add_tags.d.ts +9 -0
- package/lib/commands/fixed_price_promotion/add_tags.js +22 -0
- package/lib/commands/fixed_price_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/fixed_price_promotion/remove_tags.js +22 -0
- package/lib/commands/flex_promotion/add_tags.d.ts +9 -0
- package/lib/commands/flex_promotion/add_tags.js +22 -0
- package/lib/commands/flex_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/flex_promotion/remove_tags.js +22 -0
- package/lib/commands/free_gift_promotion/add_tags.d.ts +9 -0
- package/lib/commands/free_gift_promotion/add_tags.js +22 -0
- package/lib/commands/free_gift_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/free_gift_promotion/remove_tags.js +22 -0
- package/lib/commands/free_shipping_promotion/add_tags.d.ts +9 -0
- package/lib/commands/free_shipping_promotion/add_tags.js +22 -0
- package/lib/commands/free_shipping_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/free_shipping_promotion/remove_tags.js +22 -0
- package/lib/commands/gift_card/add_tags.d.ts +9 -0
- package/lib/commands/gift_card/add_tags.js +22 -0
- package/lib/commands/gift_card/remove_tags.d.ts +9 -0
- package/lib/commands/gift_card/remove_tags.js +22 -0
- package/lib/commands/line_item/add_tags.d.ts +9 -0
- package/lib/commands/line_item/add_tags.js +22 -0
- package/lib/commands/line_item/remove_tags.d.ts +9 -0
- package/lib/commands/line_item/remove_tags.js +22 -0
- package/lib/commands/line_item_option/add_tags.d.ts +9 -0
- package/lib/commands/line_item_option/add_tags.js +22 -0
- package/lib/commands/line_item_option/index.d.ts +9 -0
- package/lib/commands/line_item_option/index.js +40 -0
- package/lib/commands/line_item_option/remove_tags.d.ts +9 -0
- package/lib/commands/line_item_option/remove_tags.js +22 -0
- package/lib/commands/order/add_tags.d.ts +9 -0
- package/lib/commands/order/add_tags.js +22 -0
- package/lib/commands/order/remove_tags.d.ts +9 -0
- package/lib/commands/order/remove_tags.js +22 -0
- package/lib/commands/order_subscription/add_tags.d.ts +9 -0
- package/lib/commands/order_subscription/add_tags.js +22 -0
- package/lib/commands/order_subscription/remove_tags.d.ts +9 -0
- package/lib/commands/order_subscription/remove_tags.js +22 -0
- package/lib/commands/percentage_discount_promotion/add_tags.d.ts +9 -0
- package/lib/commands/percentage_discount_promotion/add_tags.js +22 -0
- package/lib/commands/percentage_discount_promotion/remove_tags.d.ts +9 -0
- package/lib/commands/percentage_discount_promotion/remove_tags.js +22 -0
- package/lib/commands/return/add_tags.d.ts +9 -0
- package/lib/commands/return/add_tags.js +22 -0
- package/lib/commands/return/remove_tags.d.ts +9 -0
- package/lib/commands/return/remove_tags.js +22 -0
- package/lib/commands/shipment/add_tags.d.ts +9 -0
- package/lib/commands/shipment/add_tags.js +22 -0
- package/lib/commands/shipment/remove_tags.d.ts +9 -0
- package/lib/commands/shipment/remove_tags.js +22 -0
- package/lib/commands/sku/add_tags.d.ts +9 -0
- package/lib/commands/sku/add_tags.js +22 -0
- package/lib/commands/sku/index.d.ts +9 -0
- package/lib/commands/sku/index.js +40 -0
- package/lib/commands/sku/remove_tags.d.ts +9 -0
- package/lib/commands/sku/remove_tags.js +22 -0
- package/lib/commands/sku_option/add_tags.d.ts +9 -0
- package/lib/commands/sku_option/add_tags.js +22 -0
- package/lib/commands/sku_option/index.d.ts +9 -0
- package/lib/commands/sku_option/index.js +40 -0
- package/lib/commands/sku_option/remove_tags.d.ts +9 -0
- package/lib/commands/sku_option/remove_tags.js +22 -0
- package/lib/triggers/addresses.d.ts +3 -0
- package/lib/triggers/addresses.js +15 -0
- package/lib/triggers/bundles.d.ts +1 -1
- package/lib/triggers/bundles.js +10 -0
- package/lib/triggers/buy_x_pay_y_promotions.d.ts +1 -1
- package/lib/triggers/buy_x_pay_y_promotions.js +10 -0
- package/lib/triggers/coupons.d.ts +3 -0
- package/lib/triggers/coupons.js +15 -0
- package/lib/triggers/customers.d.ts +3 -0
- package/lib/triggers/customers.js +15 -0
- package/lib/triggers/easypost_pickups.d.ts +3 -0
- package/lib/triggers/easypost_pickups.js +10 -0
- package/lib/triggers/external_promotions.d.ts +1 -1
- package/lib/triggers/external_promotions.js +10 -0
- package/lib/triggers/fixed_amount_promotions.d.ts +1 -1
- package/lib/triggers/fixed_amount_promotions.js +10 -0
- package/lib/triggers/fixed_price_promotions.d.ts +1 -1
- package/lib/triggers/fixed_price_promotions.js +10 -0
- package/lib/triggers/flex_promotions.d.ts +1 -1
- package/lib/triggers/flex_promotions.js +10 -0
- package/lib/triggers/free_gift_promotions.d.ts +1 -1
- package/lib/triggers/free_gift_promotions.js +10 -0
- package/lib/triggers/free_shipping_promotions.d.ts +1 -1
- package/lib/triggers/free_shipping_promotions.js +10 -0
- package/lib/triggers/gift_cards.d.ts +1 -1
- package/lib/triggers/gift_cards.js +10 -0
- package/lib/triggers/line_item_options.d.ts +3 -0
- package/lib/triggers/line_item_options.js +15 -0
- package/lib/triggers/line_items.d.ts +1 -1
- package/lib/triggers/line_items.js +10 -0
- package/lib/triggers/order_subscriptions.d.ts +1 -1
- package/lib/triggers/order_subscriptions.js +10 -0
- package/lib/triggers/orders.d.ts +1 -1
- package/lib/triggers/orders.js +11 -1
- package/lib/triggers/percentage_discount_promotions.d.ts +1 -1
- package/lib/triggers/percentage_discount_promotions.js +10 -0
- package/lib/triggers/returns.d.ts +1 -1
- package/lib/triggers/returns.js +10 -0
- package/lib/triggers/shipments.d.ts +1 -1
- package/lib/triggers/shipments.js +10 -0
- package/lib/triggers/sku_options.d.ts +3 -0
- package/lib/triggers/sku_options.js +15 -0
- package/lib/triggers/skus.d.ts +3 -0
- package/lib/triggers/skus.js +15 -0
- package/oclif.manifest.json +5193 -793
- package/package.json +6 -6
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class AddressAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const addresses_1 = require("../../triggers/addresses");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class AddressAddTags extends base_1.default {
|
|
8
|
+
static description = addresses_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(AddressAddTags);
|
|
15
|
+
const res = await this.executeAction('addresses', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('address', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = AddressAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class AddressIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const cli_core_1 = require("@commercelayer/cli-core");
|
|
8
|
+
const addresses_1 = require("../../triggers/addresses");
|
|
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 address ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(addresses_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 AddressIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type addresses';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(AddressIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('addresses', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('address', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = AddressIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class AddressRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const addresses_1 = require("../../triggers/addresses");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class AddressRemoveTags extends base_1.default {
|
|
8
|
+
static description = addresses_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(AddressRemoveTags);
|
|
15
|
+
const res = await this.executeAction('addresses', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('address', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = AddressRemoveTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BundleAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const bundles_1 = require("../../triggers/bundles");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class BundleAddTags extends base_1.default {
|
|
8
|
+
static description = bundles_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(BundleAddTags);
|
|
15
|
+
const res = await this.executeAction('bundles', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('bundle', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = BundleAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BundleRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const bundles_1 = require("../../triggers/bundles");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class BundleRemoveTags extends base_1.default {
|
|
8
|
+
static description = bundles_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(BundleRemoveTags);
|
|
15
|
+
const res = await this.executeAction('bundles', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('bundle', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = BundleRemoveTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BuyXPayYPromotionAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class BuyXPayYPromotionAddTags extends base_1.default {
|
|
8
|
+
static description = buy_x_pay_y_promotions_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(BuyXPayYPromotionAddTags);
|
|
15
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = BuyXPayYPromotionAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class BuyXPayYPromotionRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const buy_x_pay_y_promotions_1 = require("../../triggers/buy_x_pay_y_promotions");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class BuyXPayYPromotionRemoveTags extends base_1.default {
|
|
8
|
+
static description = buy_x_pay_y_promotions_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(BuyXPayYPromotionRemoveTags);
|
|
15
|
+
const res = await this.executeAction('buy_x_pay_y_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('buy_x_pay_y_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = BuyXPayYPromotionRemoveTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CouponAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const coupons_1 = require("../../triggers/coupons");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class CouponAddTags extends base_1.default {
|
|
8
|
+
static description = coupons_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(CouponAddTags);
|
|
15
|
+
const res = await this.executeAction('coupons', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('coupon', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CouponAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CouponIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const cli_core_1 = require("@commercelayer/cli-core");
|
|
8
|
+
const coupons_1 = require("../../triggers/coupons");
|
|
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 coupon ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(coupons_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 CouponIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type coupons';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(CouponIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('coupons', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('coupon', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = CouponIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CouponRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const coupons_1 = require("../../triggers/coupons");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class CouponRemoveTags extends base_1.default {
|
|
8
|
+
static description = coupons_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(CouponRemoveTags);
|
|
15
|
+
const res = await this.executeAction('coupons', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('coupon', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CouponRemoveTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CustomerAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const customers_1 = require("../../triggers/customers");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class CustomerAddTags extends base_1.default {
|
|
8
|
+
static description = customers_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(CustomerAddTags);
|
|
15
|
+
const res = await this.executeAction('customers', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('customer', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CustomerAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CustomerIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const cli_core_1 = require("@commercelayer/cli-core");
|
|
8
|
+
const customers_1 = require("../../triggers/customers");
|
|
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 customer ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(customers_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 CustomerIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type customers';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(CustomerIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('customers', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('customer', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = CustomerIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CustomerRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const customers_1 = require("../../triggers/customers");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class CustomerRemoveTags extends base_1.default {
|
|
8
|
+
static description = customers_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(CustomerRemoveTags);
|
|
15
|
+
const res = await this.executeAction('customers', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('customer', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CustomerRemoveTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class EasypostPickupIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const exec_1 = tslib_1.__importDefault(require("../../exec"));
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const cli_core_1 = require("@commercelayer/cli-core");
|
|
8
|
+
const easypost_pickups_1 = require("../../triggers/easypost_pickups");
|
|
9
|
+
const promptAction = async (id) => {
|
|
10
|
+
const answers = await inquirer_1.default.prompt([{
|
|
11
|
+
type: 'list',
|
|
12
|
+
name: 'trigger',
|
|
13
|
+
message: `Select an action to execute on easypost pickup ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(easypost_pickups_1.triggers).sort().map(a => {
|
|
15
|
+
return { name: a, value: a };
|
|
16
|
+
}),
|
|
17
|
+
loop: false,
|
|
18
|
+
pageSize: 10,
|
|
19
|
+
}]);
|
|
20
|
+
return answers.trigger;
|
|
21
|
+
};
|
|
22
|
+
class EasypostPickupIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type easypost_pickups';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(EasypostPickupIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('easypost_pickups', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('easypost pickup', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = EasypostPickupIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class EasypostPickupPurchase extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const easypost_pickups_1 = require("../../triggers/easypost_pickups");
|
|
6
|
+
const TRIGGER = 'purchase';
|
|
7
|
+
class EasypostPickupPurchase extends base_1.default {
|
|
8
|
+
static description = easypost_pickups_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(EasypostPickupPurchase);
|
|
15
|
+
const res = await this.executeAction('easypost_pickups', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('easypost_pickup', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = EasypostPickupPurchase;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ExternalPromotionAddTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const external_promotions_1 = require("../../triggers/external_promotions");
|
|
6
|
+
const TRIGGER = 'add_tags';
|
|
7
|
+
class ExternalPromotionAddTags extends base_1.default {
|
|
8
|
+
static description = external_promotions_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(ExternalPromotionAddTags);
|
|
15
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = ExternalPromotionAddTags;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ExternalPromotionRemoveTags extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const external_promotions_1 = require("../../triggers/external_promotions");
|
|
6
|
+
const TRIGGER = 'remove_tags';
|
|
7
|
+
class ExternalPromotionRemoveTags extends base_1.default {
|
|
8
|
+
static description = external_promotions_1.triggers[TRIGGER].description;
|
|
9
|
+
static flags = {};
|
|
10
|
+
static args = {
|
|
11
|
+
...base_1.default.args,
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(ExternalPromotionRemoveTags);
|
|
15
|
+
const res = await this.executeAction('external_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('external_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = ExternalPromotionRemoveTags;
|