@commercelayer/cli-plugin-triggers 4.12.0 → 4.13.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
@@ -69,7 +69,9 @@ $ commercelayer plugins:install triggers
69
69
  * [`commercelayer coupon:remove_tags ID`](#commercelayer-couponremove_tags-id)
70
70
  * [`commercelayer customer ID`](#commercelayer-customer-id)
71
71
  * [`commercelayer customer:add_tags ID`](#commercelayer-customeradd_tags-id)
72
+ * [`commercelayer customer:cancel_anonymization ID`](#commercelayer-customercancel_anonymization-id)
72
73
  * [`commercelayer customer:remove_tags ID`](#commercelayer-customerremove_tags-id)
74
+ * [`commercelayer customer:request_anonymization ID`](#commercelayer-customerrequest_anonymization-id)
73
75
  * [`commercelayer customer_password_reset ID`](#commercelayer-customer_password_reset-id)
74
76
  * [`commercelayer customer_password_reset:reset_password_token ID`](#commercelayer-customer_password_resetreset_password_token-id)
75
77
  * [`commercelayer easypost_pickup ID`](#commercelayer-easypost_pickup-id)
@@ -1138,6 +1140,28 @@ DESCRIPTION
1138
1140
 
1139
1141
  _See code: [src/commands/customer/add_tags.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/customer/add_tags.ts)_
1140
1142
 
1143
+ ### `commercelayer customer:cancel_anonymization ID`
1144
+
1145
+ Send this attribute if you want to trigger a cancellation of anonymization.
1146
+
1147
+ ```sh-session
1148
+ USAGE
1149
+ $ commercelayer customer:cancel_anonymization ID [-u [-j -p]]
1150
+
1151
+ ARGUMENTS
1152
+ ID the unique id of the resource
1153
+
1154
+ FLAGS
1155
+ -j, --json print result in JSON format
1156
+ -p, --print print out the modified resource
1157
+ -u, --unformatted print JSON output without indentation
1158
+
1159
+ DESCRIPTION
1160
+ Send this attribute if you want to trigger a cancellation of anonymization.
1161
+ ```
1162
+
1163
+ _See code: [src/commands/customer/cancel_anonymization.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/customer/cancel_anonymization.ts)_
1164
+
1141
1165
  ### `commercelayer customer:remove_tags ID`
1142
1166
 
1143
1167
  Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.
@@ -1161,6 +1185,28 @@ DESCRIPTION
1161
1185
 
1162
1186
  _See code: [src/commands/customer/remove_tags.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/customer/remove_tags.ts)_
1163
1187
 
1188
+ ### `commercelayer customer:request_anonymization ID`
1189
+
1190
+ Send this attribute if you want to trigger anonymization.
1191
+
1192
+ ```sh-session
1193
+ USAGE
1194
+ $ commercelayer customer:request_anonymization ID [-u [-j -p]]
1195
+
1196
+ ARGUMENTS
1197
+ ID the unique id of the resource
1198
+
1199
+ FLAGS
1200
+ -j, --json print result in JSON format
1201
+ -p, --print print out the modified resource
1202
+ -u, --unformatted print JSON output without indentation
1203
+
1204
+ DESCRIPTION
1205
+ Send this attribute if you want to trigger anonymization.
1206
+ ```
1207
+
1208
+ _See code: [src/commands/customer/request_anonymization.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/customer/request_anonymization.ts)_
1209
+
1164
1210
  ### `commercelayer customer_password_reset ID`
1165
1211
 
1166
1212
  Execute an action on a resource of type customer_password_resets.
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CustomerCancelAnonymization 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 = 'cancel_anonymization';
7
+ class CustomerCancelAnonymization 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(CustomerCancelAnonymization);
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 = CustomerCancelAnonymization;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CustomerRequestAnonymization 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 = 'request_anonymization';
7
+ class CustomerRequestAnonymization 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(CustomerRequestAnonymization);
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 = CustomerRequestAnonymization;
@@ -1,3 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
2
  export declare const triggers: Record<string, Trigger>;
3
- export type ActionType = 'add_tags' | 'remove_tags';
3
+ export type ActionType = 'add_tags' | 'remove_tags' | 'request_anonymization' | 'cancel_anonymization';
@@ -12,4 +12,14 @@ exports.triggers = {
12
12
  trigger: '_remove_tags',
13
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
14
  },
15
+ request_anonymization: {
16
+ action: 'request_anonymization',
17
+ trigger: '_request_anonymization',
18
+ description: 'Send this attribute if you want to trigger anonymization.',
19
+ },
20
+ cancel_anonymization: {
21
+ action: 'cancel_anonymization',
22
+ trigger: '_cancel_anonymization',
23
+ description: 'Send this attribute if you want to trigger a cancellation of anonymization.',
24
+ },
15
25
  };
@@ -3364,6 +3364,94 @@
3364
3364
  "add_tags.js"
3365
3365
  ]
3366
3366
  },
3367
+ "customer:cancel_anonymization": {
3368
+ "aliases": [],
3369
+ "args": {
3370
+ "id": {
3371
+ "description": "the unique id of the resource",
3372
+ "name": "id",
3373
+ "required": true
3374
+ }
3375
+ },
3376
+ "description": "Send this attribute if you want to trigger a cancellation of anonymization.",
3377
+ "flags": {
3378
+ "organization": {
3379
+ "char": "o",
3380
+ "description": "the slug of your organization",
3381
+ "env": "CL_CLI_ORGANIZATION",
3382
+ "hidden": true,
3383
+ "name": "organization",
3384
+ "required": true,
3385
+ "hasDynamicHelp": false,
3386
+ "multiple": false,
3387
+ "type": "option"
3388
+ },
3389
+ "domain": {
3390
+ "char": "d",
3391
+ "dependsOn": [
3392
+ "organization"
3393
+ ],
3394
+ "env": "CL_CLI_DOMAIN",
3395
+ "hidden": true,
3396
+ "name": "domain",
3397
+ "required": false,
3398
+ "hasDynamicHelp": false,
3399
+ "multiple": false,
3400
+ "type": "option"
3401
+ },
3402
+ "accessToken": {
3403
+ "env": "CL_CLI_ACCESS_TOKEN",
3404
+ "hidden": true,
3405
+ "name": "accessToken",
3406
+ "required": true,
3407
+ "hasDynamicHelp": false,
3408
+ "multiple": false,
3409
+ "type": "option"
3410
+ },
3411
+ "print": {
3412
+ "char": "p",
3413
+ "description": "print out the modified resource",
3414
+ "name": "print",
3415
+ "allowNo": false,
3416
+ "type": "boolean"
3417
+ },
3418
+ "json": {
3419
+ "char": "j",
3420
+ "dependsOn": [
3421
+ "print"
3422
+ ],
3423
+ "description": "print result in JSON format",
3424
+ "name": "json",
3425
+ "allowNo": false,
3426
+ "type": "boolean"
3427
+ },
3428
+ "unformatted": {
3429
+ "char": "u",
3430
+ "dependsOn": [
3431
+ "json"
3432
+ ],
3433
+ "description": "print JSON output without indentation",
3434
+ "name": "unformatted",
3435
+ "allowNo": false,
3436
+ "type": "boolean"
3437
+ }
3438
+ },
3439
+ "hasDynamicHelp": false,
3440
+ "hiddenAliases": [],
3441
+ "id": "customer:cancel_anonymization",
3442
+ "pluginAlias": "@commercelayer/cli-plugin-triggers",
3443
+ "pluginName": "@commercelayer/cli-plugin-triggers",
3444
+ "pluginType": "core",
3445
+ "strict": true,
3446
+ "enableJsonFlag": false,
3447
+ "isESM": false,
3448
+ "relativePath": [
3449
+ "lib",
3450
+ "commands",
3451
+ "customer",
3452
+ "cancel_anonymization.js"
3453
+ ]
3454
+ },
3367
3455
  "customer": {
3368
3456
  "aliases": [],
3369
3457
  "args": {
@@ -3540,6 +3628,94 @@
3540
3628
  "remove_tags.js"
3541
3629
  ]
3542
3630
  },
3631
+ "customer:request_anonymization": {
3632
+ "aliases": [],
3633
+ "args": {
3634
+ "id": {
3635
+ "description": "the unique id of the resource",
3636
+ "name": "id",
3637
+ "required": true
3638
+ }
3639
+ },
3640
+ "description": "Send this attribute if you want to trigger anonymization.",
3641
+ "flags": {
3642
+ "organization": {
3643
+ "char": "o",
3644
+ "description": "the slug of your organization",
3645
+ "env": "CL_CLI_ORGANIZATION",
3646
+ "hidden": true,
3647
+ "name": "organization",
3648
+ "required": true,
3649
+ "hasDynamicHelp": false,
3650
+ "multiple": false,
3651
+ "type": "option"
3652
+ },
3653
+ "domain": {
3654
+ "char": "d",
3655
+ "dependsOn": [
3656
+ "organization"
3657
+ ],
3658
+ "env": "CL_CLI_DOMAIN",
3659
+ "hidden": true,
3660
+ "name": "domain",
3661
+ "required": false,
3662
+ "hasDynamicHelp": false,
3663
+ "multiple": false,
3664
+ "type": "option"
3665
+ },
3666
+ "accessToken": {
3667
+ "env": "CL_CLI_ACCESS_TOKEN",
3668
+ "hidden": true,
3669
+ "name": "accessToken",
3670
+ "required": true,
3671
+ "hasDynamicHelp": false,
3672
+ "multiple": false,
3673
+ "type": "option"
3674
+ },
3675
+ "print": {
3676
+ "char": "p",
3677
+ "description": "print out the modified resource",
3678
+ "name": "print",
3679
+ "allowNo": false,
3680
+ "type": "boolean"
3681
+ },
3682
+ "json": {
3683
+ "char": "j",
3684
+ "dependsOn": [
3685
+ "print"
3686
+ ],
3687
+ "description": "print result in JSON format",
3688
+ "name": "json",
3689
+ "allowNo": false,
3690
+ "type": "boolean"
3691
+ },
3692
+ "unformatted": {
3693
+ "char": "u",
3694
+ "dependsOn": [
3695
+ "json"
3696
+ ],
3697
+ "description": "print JSON output without indentation",
3698
+ "name": "unformatted",
3699
+ "allowNo": false,
3700
+ "type": "boolean"
3701
+ }
3702
+ },
3703
+ "hasDynamicHelp": false,
3704
+ "hiddenAliases": [],
3705
+ "id": "customer:request_anonymization",
3706
+ "pluginAlias": "@commercelayer/cli-plugin-triggers",
3707
+ "pluginName": "@commercelayer/cli-plugin-triggers",
3708
+ "pluginType": "core",
3709
+ "strict": true,
3710
+ "enableJsonFlag": false,
3711
+ "isESM": false,
3712
+ "relativePath": [
3713
+ "lib",
3714
+ "commands",
3715
+ "customer",
3716
+ "request_anonymization.js"
3717
+ ]
3718
+ },
3543
3719
  "customer_password_reset": {
3544
3720
  "aliases": [],
3545
3721
  "args": {
@@ -20816,5 +20992,5 @@
20816
20992
  ]
20817
20993
  }
20818
20994
  },
20819
- "version": "4.12.0"
20995
+ "version": "4.13.0"
20820
20996
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercelayer/cli-plugin-triggers",
3
3
  "description": "Commerce Layer CLI Triggers plugin",
4
- "version": "4.12.0",
4
+ "version": "4.13.0",
5
5
  "author": "Pierluigi Viti <pierluigi@commercelayer.io>",
6
6
  "homepage": "https://github.com/commercelayer/commercelayer-cli-plugin-triggers",
7
7
  "repository": "commercelayer/commercelayer-cli-plugin-triggers",
@@ -57,29 +57,29 @@
57
57
  "devDependencies": {
58
58
  "@commercelayer/cli-dev": "^3.0.7",
59
59
  "@commercelayer/eslint-config-ts": "^1.4.5",
60
- "@oclif/plugin-help": "^6.2.27",
60
+ "@oclif/plugin-help": "^6.2.28",
61
61
  "@oclif/test": "^3.2.15",
62
62
  "@semantic-release/changelog": "^6.0.3",
63
63
  "@semantic-release/git": "^10.0.1",
64
64
  "@types/chai": "^4.3.20",
65
- "@types/inquirer": "^8.2.10",
65
+ "@types/inquirer": "^8.2.11",
66
66
  "@types/lodash.snakecase": "^4.1.9",
67
67
  "@types/mocha": "^10.0.10",
68
- "@types/node": "^22.13.10",
68
+ "@types/node": "^22.15.12",
69
69
  "chai": "^4.5.0",
70
70
  "eslint": "^8.57.1",
71
71
  "inflector-js": "^1.0.1",
72
72
  "lodash.snakecase": "^4.1.1",
73
73
  "mocha": "^10.8.2",
74
74
  "nyc": "^15.1.0",
75
- "oclif": "^4.17.37",
75
+ "oclif": "^4.17.46",
76
76
  "semantic-release": "^24.2.3",
77
- "tsx": "^4.19.3",
77
+ "tsx": "^4.19.4",
78
78
  "typescript": "5.5.4"
79
79
  },
80
80
  "dependencies": {
81
81
  "@commercelayer/cli-core": "beta",
82
- "@commercelayer/sdk": "^6.36.0",
82
+ "@commercelayer/sdk": "^6.40.0",
83
83
  "@oclif/core": "^3.27.0",
84
84
  "inquirer": "^8.2.6",
85
85
  "tslib": "^2.8.1"