@commercelayer/cli-plugin-triggers 4.11.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.
Files changed (141) hide show
  1. package/README.md +1148 -2
  2. package/lib/commands/address/add_tags.d.ts +9 -0
  3. package/lib/commands/address/add_tags.js +22 -0
  4. package/lib/commands/address/index.d.ts +9 -0
  5. package/lib/commands/address/index.js +40 -0
  6. package/lib/commands/address/remove_tags.d.ts +9 -0
  7. package/lib/commands/address/remove_tags.js +22 -0
  8. package/lib/commands/bundle/add_tags.d.ts +9 -0
  9. package/lib/commands/bundle/add_tags.js +22 -0
  10. package/lib/commands/bundle/remove_tags.d.ts +9 -0
  11. package/lib/commands/bundle/remove_tags.js +22 -0
  12. package/lib/commands/buy_x_pay_y_promotion/add_tags.d.ts +9 -0
  13. package/lib/commands/buy_x_pay_y_promotion/add_tags.js +22 -0
  14. package/lib/commands/buy_x_pay_y_promotion/remove_tags.d.ts +9 -0
  15. package/lib/commands/buy_x_pay_y_promotion/remove_tags.js +22 -0
  16. package/lib/commands/coupon/add_tags.d.ts +9 -0
  17. package/lib/commands/coupon/add_tags.js +22 -0
  18. package/lib/commands/coupon/index.d.ts +9 -0
  19. package/lib/commands/coupon/index.js +40 -0
  20. package/lib/commands/coupon/remove_tags.d.ts +9 -0
  21. package/lib/commands/coupon/remove_tags.js +22 -0
  22. package/lib/commands/customer/add_tags.d.ts +9 -0
  23. package/lib/commands/customer/add_tags.js +22 -0
  24. package/lib/commands/customer/index.d.ts +9 -0
  25. package/lib/commands/customer/index.js +40 -0
  26. package/lib/commands/customer/remove_tags.d.ts +9 -0
  27. package/lib/commands/customer/remove_tags.js +22 -0
  28. package/lib/commands/external_promotion/add_tags.d.ts +9 -0
  29. package/lib/commands/external_promotion/add_tags.js +22 -0
  30. package/lib/commands/external_promotion/remove_tags.d.ts +9 -0
  31. package/lib/commands/external_promotion/remove_tags.js +22 -0
  32. package/lib/commands/fixed_amount_promotion/add_tags.d.ts +9 -0
  33. package/lib/commands/fixed_amount_promotion/add_tags.js +22 -0
  34. package/lib/commands/fixed_amount_promotion/remove_tags.d.ts +9 -0
  35. package/lib/commands/fixed_amount_promotion/remove_tags.js +22 -0
  36. package/lib/commands/fixed_price_promotion/add_tags.d.ts +9 -0
  37. package/lib/commands/fixed_price_promotion/add_tags.js +22 -0
  38. package/lib/commands/fixed_price_promotion/remove_tags.d.ts +9 -0
  39. package/lib/commands/fixed_price_promotion/remove_tags.js +22 -0
  40. package/lib/commands/flex_promotion/add_tags.d.ts +9 -0
  41. package/lib/commands/flex_promotion/add_tags.js +22 -0
  42. package/lib/commands/flex_promotion/remove_tags.d.ts +9 -0
  43. package/lib/commands/flex_promotion/remove_tags.js +22 -0
  44. package/lib/commands/free_gift_promotion/add_tags.d.ts +9 -0
  45. package/lib/commands/free_gift_promotion/add_tags.js +22 -0
  46. package/lib/commands/free_gift_promotion/remove_tags.d.ts +9 -0
  47. package/lib/commands/free_gift_promotion/remove_tags.js +22 -0
  48. package/lib/commands/free_shipping_promotion/add_tags.d.ts +9 -0
  49. package/lib/commands/free_shipping_promotion/add_tags.js +22 -0
  50. package/lib/commands/free_shipping_promotion/remove_tags.d.ts +9 -0
  51. package/lib/commands/free_shipping_promotion/remove_tags.js +22 -0
  52. package/lib/commands/gift_card/add_tags.d.ts +9 -0
  53. package/lib/commands/gift_card/add_tags.js +22 -0
  54. package/lib/commands/gift_card/remove_tags.d.ts +9 -0
  55. package/lib/commands/gift_card/remove_tags.js +22 -0
  56. package/lib/commands/line_item/add_tags.d.ts +9 -0
  57. package/lib/commands/line_item/add_tags.js +22 -0
  58. package/lib/commands/line_item/remove_tags.d.ts +9 -0
  59. package/lib/commands/line_item/remove_tags.js +22 -0
  60. package/lib/commands/line_item_option/add_tags.d.ts +9 -0
  61. package/lib/commands/line_item_option/add_tags.js +22 -0
  62. package/lib/commands/line_item_option/index.d.ts +9 -0
  63. package/lib/commands/line_item_option/index.js +40 -0
  64. package/lib/commands/line_item_option/remove_tags.d.ts +9 -0
  65. package/lib/commands/line_item_option/remove_tags.js +22 -0
  66. package/lib/commands/order/add_tags.d.ts +9 -0
  67. package/lib/commands/order/add_tags.js +22 -0
  68. package/lib/commands/order/remove_tags.d.ts +9 -0
  69. package/lib/commands/order/remove_tags.js +22 -0
  70. package/lib/commands/order_subscription/add_tags.d.ts +9 -0
  71. package/lib/commands/order_subscription/add_tags.js +22 -0
  72. package/lib/commands/order_subscription/remove_tags.d.ts +9 -0
  73. package/lib/commands/order_subscription/remove_tags.js +22 -0
  74. package/lib/commands/percentage_discount_promotion/add_tags.d.ts +9 -0
  75. package/lib/commands/percentage_discount_promotion/add_tags.js +22 -0
  76. package/lib/commands/percentage_discount_promotion/remove_tags.d.ts +9 -0
  77. package/lib/commands/percentage_discount_promotion/remove_tags.js +22 -0
  78. package/lib/commands/return/add_tags.d.ts +9 -0
  79. package/lib/commands/return/add_tags.js +22 -0
  80. package/lib/commands/return/remove_tags.d.ts +9 -0
  81. package/lib/commands/return/remove_tags.js +22 -0
  82. package/lib/commands/shipment/add_tags.d.ts +9 -0
  83. package/lib/commands/shipment/add_tags.js +22 -0
  84. package/lib/commands/shipment/remove_tags.d.ts +9 -0
  85. package/lib/commands/shipment/remove_tags.js +22 -0
  86. package/lib/commands/sku/add_tags.d.ts +9 -0
  87. package/lib/commands/sku/add_tags.js +22 -0
  88. package/lib/commands/sku/index.d.ts +9 -0
  89. package/lib/commands/sku/index.js +40 -0
  90. package/lib/commands/sku/remove_tags.d.ts +9 -0
  91. package/lib/commands/sku/remove_tags.js +22 -0
  92. package/lib/commands/sku_option/add_tags.d.ts +9 -0
  93. package/lib/commands/sku_option/add_tags.js +22 -0
  94. package/lib/commands/sku_option/index.d.ts +9 -0
  95. package/lib/commands/sku_option/index.js +40 -0
  96. package/lib/commands/sku_option/remove_tags.d.ts +9 -0
  97. package/lib/commands/sku_option/remove_tags.js +22 -0
  98. package/lib/triggers/addresses.d.ts +3 -0
  99. package/lib/triggers/addresses.js +15 -0
  100. package/lib/triggers/bundles.d.ts +1 -1
  101. package/lib/triggers/bundles.js +10 -0
  102. package/lib/triggers/buy_x_pay_y_promotions.d.ts +1 -1
  103. package/lib/triggers/buy_x_pay_y_promotions.js +10 -0
  104. package/lib/triggers/coupons.d.ts +3 -0
  105. package/lib/triggers/coupons.js +15 -0
  106. package/lib/triggers/customers.d.ts +3 -0
  107. package/lib/triggers/customers.js +15 -0
  108. package/lib/triggers/external_promotions.d.ts +1 -1
  109. package/lib/triggers/external_promotions.js +10 -0
  110. package/lib/triggers/fixed_amount_promotions.d.ts +1 -1
  111. package/lib/triggers/fixed_amount_promotions.js +10 -0
  112. package/lib/triggers/fixed_price_promotions.d.ts +1 -1
  113. package/lib/triggers/fixed_price_promotions.js +10 -0
  114. package/lib/triggers/flex_promotions.d.ts +1 -1
  115. package/lib/triggers/flex_promotions.js +10 -0
  116. package/lib/triggers/free_gift_promotions.d.ts +1 -1
  117. package/lib/triggers/free_gift_promotions.js +10 -0
  118. package/lib/triggers/free_shipping_promotions.d.ts +1 -1
  119. package/lib/triggers/free_shipping_promotions.js +10 -0
  120. package/lib/triggers/gift_cards.d.ts +1 -1
  121. package/lib/triggers/gift_cards.js +10 -0
  122. package/lib/triggers/line_item_options.d.ts +3 -0
  123. package/lib/triggers/line_item_options.js +15 -0
  124. package/lib/triggers/line_items.d.ts +1 -1
  125. package/lib/triggers/line_items.js +10 -0
  126. package/lib/triggers/order_subscriptions.d.ts +1 -1
  127. package/lib/triggers/order_subscriptions.js +10 -0
  128. package/lib/triggers/orders.d.ts +1 -1
  129. package/lib/triggers/orders.js +10 -0
  130. package/lib/triggers/percentage_discount_promotions.d.ts +1 -1
  131. package/lib/triggers/percentage_discount_promotions.js +10 -0
  132. package/lib/triggers/returns.d.ts +1 -1
  133. package/lib/triggers/returns.js +10 -0
  134. package/lib/triggers/shipments.d.ts +1 -1
  135. package/lib/triggers/shipments.js +10 -0
  136. package/lib/triggers/sku_options.d.ts +3 -0
  137. package/lib/triggers/sku_options.js +15 -0
  138. package/lib/triggers/skus.d.ts +3 -0
  139. package/lib/triggers/skus.js +15 -0
  140. package/oclif.manifest.json +5022 -798
  141. package/package.json +5 -5
@@ -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 order_subscriptions_1 = require("../../triggers/order_subscriptions");
6
+ const TRIGGER = 'remove_tags';
7
+ class OrderSubscriptionRemoveTags extends base_1.default {
8
+ static description = order_subscriptions_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(OrderSubscriptionRemoveTags);
15
+ const res = await this.executeAction('order_subscriptions', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('order_subscription', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = OrderSubscriptionRemoveTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class PercentageDiscountPromotionAddTags 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 percentage_discount_promotions_1 = require("../../triggers/percentage_discount_promotions");
6
+ const TRIGGER = 'add_tags';
7
+ class PercentageDiscountPromotionAddTags extends base_1.default {
8
+ static description = percentage_discount_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(PercentageDiscountPromotionAddTags);
15
+ const res = await this.executeAction('percentage_discount_promotions', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('percentage_discount_promotion', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = PercentageDiscountPromotionAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class PercentageDiscountPromotionRemoveTags 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 percentage_discount_promotions_1 = require("../../triggers/percentage_discount_promotions");
6
+ const TRIGGER = 'remove_tags';
7
+ class PercentageDiscountPromotionRemoveTags extends base_1.default {
8
+ static description = percentage_discount_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(PercentageDiscountPromotionRemoveTags);
15
+ const res = await this.executeAction('percentage_discount_promotions', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('percentage_discount_promotion', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = PercentageDiscountPromotionRemoveTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ReturnAddTags 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 returns_1 = require("../../triggers/returns");
6
+ const TRIGGER = 'add_tags';
7
+ class ReturnAddTags extends base_1.default {
8
+ static description = returns_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(ReturnAddTags);
15
+ const res = await this.executeAction('returns', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('return', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ReturnAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ReturnRemoveTags 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 returns_1 = require("../../triggers/returns");
6
+ const TRIGGER = 'remove_tags';
7
+ class ReturnRemoveTags extends base_1.default {
8
+ static description = returns_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(ReturnRemoveTags);
15
+ const res = await this.executeAction('returns', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('return', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ReturnRemoveTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ShipmentAddTags 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 shipments_1 = require("../../triggers/shipments");
6
+ const TRIGGER = 'add_tags';
7
+ class ShipmentAddTags extends base_1.default {
8
+ static description = shipments_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(ShipmentAddTags);
15
+ const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('shipment', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ShipmentAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ShipmentRemoveTags 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 shipments_1 = require("../../triggers/shipments");
6
+ const TRIGGER = 'remove_tags';
7
+ class ShipmentRemoveTags extends base_1.default {
8
+ static description = shipments_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(ShipmentRemoveTags);
15
+ const res = await this.executeAction('shipments', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('shipment', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ShipmentRemoveTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuAddTags 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 skus_1 = require("../../triggers/skus");
6
+ const TRIGGER = 'add_tags';
7
+ class SkuAddTags extends base_1.default {
8
+ static description = skus_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(SkuAddTags);
15
+ const res = await this.executeAction('skus', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('sku', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = SkuAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuIndex 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 skus_1 = require("../../triggers/skus");
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 sku ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(skus_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 SkuIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type skus';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(SkuIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('skus', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('sku', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = SkuIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuRemoveTags 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 skus_1 = require("../../triggers/skus");
6
+ const TRIGGER = 'remove_tags';
7
+ class SkuRemoveTags extends base_1.default {
8
+ static description = skus_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(SkuRemoveTags);
15
+ const res = await this.executeAction('skus', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('sku', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = SkuRemoveTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuOptionAddTags 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 sku_options_1 = require("../../triggers/sku_options");
6
+ const TRIGGER = 'add_tags';
7
+ class SkuOptionAddTags extends base_1.default {
8
+ static description = sku_options_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(SkuOptionAddTags);
15
+ const res = await this.executeAction('sku_options', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('sku_option', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = SkuOptionAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuOptionIndex 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 sku_options_1 = require("../../triggers/sku_options");
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 sku option ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(sku_options_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 SkuOptionIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type sku_options';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(SkuOptionIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('sku_options', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('sku option', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = SkuOptionIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class SkuOptionRemoveTags 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 sku_options_1 = require("../../triggers/sku_options");
6
+ const TRIGGER = 'remove_tags';
7
+ class SkuOptionRemoveTags extends base_1.default {
8
+ static description = sku_options_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(SkuOptionRemoveTags);
15
+ const res = await this.executeAction('sku_options', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('sku_option', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = SkuOptionRemoveTags;
@@ -0,0 +1,3 @@
1
+ import type { Trigger } from '../common';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'add_tags' | 'remove_tags';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggers = void 0;
4
+ exports.triggers = {
5
+ add_tags: {
6
+ action: 'add_tags',
7
+ trigger: '_add_tags',
8
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
9
+ },
10
+ remove_tags: {
11
+ action: 'remove_tags',
12
+ trigger: '_remove_tags',
13
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
14
+ },
15
+ };
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'compute_price_amount' | 'compute_compare_at_amount';
3
+ export type ActionType = 'compute_price_amount' | 'compute_compare_at_amount' | 'add_tags' | 'remove_tags';
@@ -12,4 +12,14 @@ exports.triggers = {
12
12
  trigger: '_compute_compare_at_amount',
13
13
  description: 'Send this attribute if you want to compute the compare_at_amount_cents as the sum of the prices of the bundle SKUs for the market.',
14
14
  },
15
+ add_tags: {
16
+ action: 'add_tags',
17
+ trigger: '_add_tags',
18
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
19
+ },
20
+ remove_tags: {
21
+ action: 'remove_tags',
22
+ trigger: '_remove_tags',
23
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
15
25
  };
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'disable' | 'enable';
3
+ export type ActionType = 'disable' | 'enable' | 'add_tags' | 'remove_tags';
@@ -12,4 +12,14 @@ exports.triggers = {
12
12
  trigger: '_enable',
13
13
  description: 'Send this attribute if you want to mark this resource as enabled.',
14
14
  },
15
+ add_tags: {
16
+ action: 'add_tags',
17
+ trigger: '_add_tags',
18
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
19
+ },
20
+ remove_tags: {
21
+ action: 'remove_tags',
22
+ trigger: '_remove_tags',
23
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
15
25
  };
@@ -0,0 +1,3 @@
1
+ import type { Trigger } from '../common';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'add_tags' | 'remove_tags';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggers = void 0;
4
+ exports.triggers = {
5
+ add_tags: {
6
+ action: 'add_tags',
7
+ trigger: '_add_tags',
8
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
9
+ },
10
+ remove_tags: {
11
+ action: 'remove_tags',
12
+ trigger: '_remove_tags',
13
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
14
+ },
15
+ };
@@ -0,0 +1,3 @@
1
+ import type { Trigger } from '../common';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'add_tags' | 'remove_tags';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggers = void 0;
4
+ exports.triggers = {
5
+ add_tags: {
6
+ action: 'add_tags',
7
+ trigger: '_add_tags',
8
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
9
+ },
10
+ remove_tags: {
11
+ action: 'remove_tags',
12
+ trigger: '_remove_tags',
13
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
14
+ },
15
+ };
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'disable' | 'enable' | 'reset_circuit';
3
+ export type ActionType = 'disable' | 'enable' | 'add_tags' | 'remove_tags' | 'reset_circuit';
@@ -12,6 +12,16 @@ exports.triggers = {
12
12
  trigger: '_enable',
13
13
  description: 'Send this attribute if you want to mark this resource as enabled.',
14
14
  },
15
+ add_tags: {
16
+ action: 'add_tags',
17
+ trigger: '_add_tags',
18
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
19
+ },
20
+ remove_tags: {
21
+ action: 'remove_tags',
22
+ trigger: '_remove_tags',
23
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
15
25
  reset_circuit: {
16
26
  action: 'reset_circuit',
17
27
  trigger: '_reset_circuit',
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'disable' | 'enable';
3
+ export type ActionType = 'disable' | 'enable' | 'add_tags' | 'remove_tags';
@@ -12,4 +12,14 @@ exports.triggers = {
12
12
  trigger: '_enable',
13
13
  description: 'Send this attribute if you want to mark this resource as enabled.',
14
14
  },
15
+ add_tags: {
16
+ action: 'add_tags',
17
+ trigger: '_add_tags',
18
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
19
+ },
20
+ remove_tags: {
21
+ action: 'remove_tags',
22
+ trigger: '_remove_tags',
23
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
15
25
  };
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'disable' | 'enable';
3
+ export type ActionType = 'disable' | 'enable' | 'add_tags' | 'remove_tags';
@@ -12,4 +12,14 @@ exports.triggers = {
12
12
  trigger: '_enable',
13
13
  description: 'Send this attribute if you want to mark this resource as enabled.',
14
14
  },
15
+ add_tags: {
16
+ action: 'add_tags',
17
+ trigger: '_add_tags',
18
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
19
+ },
20
+ remove_tags: {
21
+ action: 'remove_tags',
22
+ trigger: '_remove_tags',
23
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
15
25
  };