@commercelayer/cli-plugin-triggers 4.14.3 → 4.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 CHANGED
@@ -136,6 +136,7 @@ $ commercelayer plugins:install triggers
136
136
  * [`commercelayer line_item:remove_tags ID`](#commercelayer-line_itemremove_tags-id)
137
137
  * [`commercelayer line_item:reserve_stock ID`](#commercelayer-line_itemreserve_stock-id)
138
138
  * [`commercelayer line_item:reset_circuit ID`](#commercelayer-line_itemreset_circuit-id)
139
+ * [`commercelayer line_item:reset_restocked_quantity ID`](#commercelayer-line_itemreset_restocked_quantity-id)
139
140
  * [`commercelayer line_item_option ID`](#commercelayer-line_item_option-id)
140
141
  * [`commercelayer line_item_option:add_tags ID`](#commercelayer-line_item_optionadd_tags-id)
141
142
  * [`commercelayer line_item_option:remove_tags ID`](#commercelayer-line_item_optionremove_tags-id)
@@ -2642,6 +2643,29 @@ DESCRIPTION
2642
2643
 
2643
2644
  _See code: [src/commands/line_item/reset_circuit.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/line_item/reset_circuit.ts)_
2644
2645
 
2646
+ ### `commercelayer line_item:reset_restocked_quantity ID`
2647
+
2648
+ Send this attribute if you want to reset the quantity restocked by a return or by an order/shipment cancel. This will allow for multiple returns, albeit you need to adjust the stock manually. Cannot be passed by sales channels.
2649
+
2650
+ ```sh-session
2651
+ USAGE
2652
+ $ commercelayer line_item:reset_restocked_quantity ID [-u [-j -p]]
2653
+
2654
+ ARGUMENTS
2655
+ ID the unique id of the resource
2656
+
2657
+ FLAGS
2658
+ -j, --json print result in JSON format
2659
+ -p, --print print out the modified resource
2660
+ -u, --unformatted print JSON output without indentation
2661
+
2662
+ DESCRIPTION
2663
+ Send this attribute if you want to reset the quantity restocked by a return or by an order/shipment cancel. This will
2664
+ allow for multiple returns, albeit you need to adjust the stock manually. Cannot be passed by sales channels.
2665
+ ```
2666
+
2667
+ _See code: [src/commands/line_item/reset_restocked_quantity.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/line_item/reset_restocked_quantity.ts)_
2668
+
2645
2669
  ### `commercelayer line_item_option ID`
2646
2670
 
2647
2671
  Execute an action on a resource of type line_item_options.
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class LineItemResetRestockedQuantity 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 line_items_1 = require("../../triggers/line_items");
6
+ const TRIGGER = 'reset_restocked_quantity';
7
+ class LineItemResetRestockedQuantity extends base_1.default {
8
+ static description = line_items_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(LineItemResetRestockedQuantity);
15
+ const res = await this.executeAction('line_items', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('line_item', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = LineItemResetRestockedQuantity;
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'external_price' | 'reserve_stock' | 'reset_circuit' | 'add_tags' | 'remove_tags';
3
+ export type ActionType = 'external_price' | 'reserve_stock' | 'reset_restocked_quantity' | 'reset_circuit' | 'add_tags' | 'remove_tags';
@@ -12,6 +12,11 @@ exports.triggers = {
12
12
  trigger: '_reserve_stock',
13
13
  description: 'Send this attribute if you want to reserve the stock for the line item\'s SKUs quantity. Stock reservations expiration depends on the inventory model\'s cutoff. When used on update the existing active stock reservations are renewed. Cannot be passed by sales channels.',
14
14
  },
15
+ reset_restocked_quantity: {
16
+ action: 'reset_restocked_quantity',
17
+ trigger: '_reset_restocked_quantity',
18
+ description: 'Send this attribute if you want to reset the quantity restocked by a return or by an order/shipment cancel. This will allow for multiple returns, albeit you need to adjust the stock manually. Cannot be passed by sales channels.',
19
+ },
15
20
  reset_circuit: {
16
21
  action: 'reset_circuit',
17
22
  trigger: '_reset_circuit',