@commercelayer/cli-plugin-triggers 4.16.1 → 4.17.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 CHANGED
@@ -261,8 +261,10 @@ $ commercelayer plugins:install triggers
261
261
  * [`commercelayer shipment:ship ID`](#commercelayer-shipmentship-id)
262
262
  * [`commercelayer shipment:upcoming ID`](#commercelayer-shipmentupcoming-id)
263
263
  * [`commercelayer shipping_method ID`](#commercelayer-shipping_method-id)
264
+ * [`commercelayer shipping_method:add_tags ID`](#commercelayer-shipping_methodadd_tags-id)
264
265
  * [`commercelayer shipping_method:disable ID`](#commercelayer-shipping_methoddisable-id)
265
266
  * [`commercelayer shipping_method:enable ID`](#commercelayer-shipping_methodenable-id)
267
+ * [`commercelayer shipping_method:remove_tags ID`](#commercelayer-shipping_methodremove_tags-id)
266
268
  * [`commercelayer shipping_method:reset_circuit ID`](#commercelayer-shipping_methodreset_circuit-id)
267
269
  * [`commercelayer sku ID`](#commercelayer-sku-id)
268
270
  * [`commercelayer sku:add_tags ID`](#commercelayer-skuadd_tags-id)
@@ -5457,6 +5459,29 @@ DESCRIPTION
5457
5459
 
5458
5460
  _See code: [src/commands/shipping_method/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/index.ts)_
5459
5461
 
5462
+ ### `commercelayer shipping_method:add_tags ID`
5463
+
5464
+ Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.
5465
+
5466
+ ```sh-session
5467
+ USAGE
5468
+ $ commercelayer shipping_method:add_tags ID [-u [-j -p]]
5469
+
5470
+ ARGUMENTS
5471
+ ID the unique id of the resource
5472
+
5473
+ FLAGS
5474
+ -j, --json print result in JSON format
5475
+ -p, --print print out the modified resource
5476
+ -u, --unformatted print JSON output without indentation
5477
+
5478
+ DESCRIPTION
5479
+ Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by
5480
+ sales channels.
5481
+ ```
5482
+
5483
+ _See code: [src/commands/shipping_method/add_tags.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/add_tags.ts)_
5484
+
5460
5485
  ### `commercelayer shipping_method:disable ID`
5461
5486
 
5462
5487
  Send this attribute if you want to mark this resource as disabled.
@@ -5501,6 +5526,29 @@ DESCRIPTION
5501
5526
 
5502
5527
  _See code: [src/commands/shipping_method/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/enable.ts)_
5503
5528
 
5529
+ ### `commercelayer shipping_method:remove_tags ID`
5530
+
5531
+ Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.
5532
+
5533
+ ```sh-session
5534
+ USAGE
5535
+ $ commercelayer shipping_method:remove_tags ID [-u [-j -p]]
5536
+
5537
+ ARGUMENTS
5538
+ ID the unique id of the resource
5539
+
5540
+ FLAGS
5541
+ -j, --json print result in JSON format
5542
+ -p, --print print out the modified resource
5543
+ -u, --unformatted print JSON output without indentation
5544
+
5545
+ DESCRIPTION
5546
+ Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed
5547
+ by sales channels.
5548
+ ```
5549
+
5550
+ _See code: [src/commands/shipping_method/remove_tags.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/remove_tags.ts)_
5551
+
5504
5552
  ### `commercelayer shipping_method:reset_circuit ID`
5505
5553
 
5506
5554
  Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ShippingMethodAddTags 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 shipping_methods_1 = require("../../triggers/shipping_methods");
6
+ const TRIGGER = 'add_tags';
7
+ class ShippingMethodAddTags extends base_1.default {
8
+ static description = shipping_methods_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(ShippingMethodAddTags);
15
+ const res = await this.executeAction('shipping_methods', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('shipping_method', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ShippingMethodAddTags;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ShippingMethodRemoveTags 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 shipping_methods_1 = require("../../triggers/shipping_methods");
6
+ const TRIGGER = 'remove_tags';
7
+ class ShippingMethodRemoveTags extends base_1.default {
8
+ static description = shipping_methods_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(ShippingMethodRemoveTags);
15
+ const res = await this.executeAction('shipping_methods', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('shipping_method', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ShippingMethodRemoveTags;
@@ -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' | 'reset_circuit' | 'add_tags' | 'remove_tags';
@@ -17,4 +17,14 @@ exports.triggers = {
17
17
  trigger: '_reset_circuit',
18
18
  description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count. Cannot be passed by sales channels.',
19
19
  },
20
+ add_tags: {
21
+ action: 'add_tags',
22
+ trigger: '_add_tags',
23
+ description: 'Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
24
+ },
25
+ remove_tags: {
26
+ action: 'remove_tags',
27
+ trigger: '_remove_tags',
28
+ description: 'Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.',
29
+ },
20
30
  };