@commercelayer/cli-plugin-triggers 3.12.0 → 3.13.1
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 +47 -0
- package/lib/commands/order/start_editing.d.ts +9 -0
- package/lib/commands/order/start_editing.js +21 -0
- package/lib/commands/order/stop_editing.d.ts +9 -0
- package/lib/commands/order/stop_editing.js +21 -0
- package/lib/triggers/orders.d.ts +1 -1
- package/lib/triggers/orders.js +10 -0
- package/oclif.manifest.json +145 -1
- package/package.json +8 -9
package/README.md
CHANGED
|
@@ -88,6 +88,8 @@ $ commercelayer plugins:install triggers
|
|
|
88
88
|
* [`commercelayer order:save_shipping_address_to_customer_address_book ID`](#commercelayer-ordersave_shipping_address_to_customer_address_book-id)
|
|
89
89
|
* [`commercelayer order:shipping_address_clone_id ID`](#commercelayer-ordershipping_address_clone_id-id)
|
|
90
90
|
* [`commercelayer order:shipping_address_same_as_billing ID`](#commercelayer-ordershipping_address_same_as_billing-id)
|
|
91
|
+
* [`commercelayer order:start_editing ID`](#commercelayer-orderstart_editing-id)
|
|
92
|
+
* [`commercelayer order:stop_editing ID`](#commercelayer-orderstop_editing-id)
|
|
91
93
|
* [`commercelayer order:unarchive ID`](#commercelayer-orderunarchive-id)
|
|
92
94
|
* [`commercelayer order:update_taxes ID`](#commercelayer-orderupdate_taxes-id)
|
|
93
95
|
* [`commercelayer order:validate ID`](#commercelayer-ordervalidate-id)
|
|
@@ -1426,6 +1428,51 @@ DESCRIPTION
|
|
|
1426
1428
|
|
|
1427
1429
|
_See code: [src/commands/order/shipping_address_same_as_billing.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/shipping_address_same_as_billing.ts)_
|
|
1428
1430
|
|
|
1431
|
+
### `commercelayer order:start_editing ID`
|
|
1432
|
+
|
|
1433
|
+
Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total amount.
|
|
1434
|
+
|
|
1435
|
+
```sh-session
|
|
1436
|
+
USAGE
|
|
1437
|
+
$ commercelayer order:start_editing ID [-u [-j -p]]
|
|
1438
|
+
|
|
1439
|
+
ARGUMENTS
|
|
1440
|
+
ID the unique id of the resource
|
|
1441
|
+
|
|
1442
|
+
FLAGS
|
|
1443
|
+
-j, --json print result in JSON format
|
|
1444
|
+
-p, --print print out the modified resource
|
|
1445
|
+
-u, --unformatted print JSON output without indentation
|
|
1446
|
+
|
|
1447
|
+
DESCRIPTION
|
|
1448
|
+
Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total
|
|
1449
|
+
amount.
|
|
1450
|
+
```
|
|
1451
|
+
|
|
1452
|
+
_See code: [src/commands/order/start_editing.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/start_editing.ts)_
|
|
1453
|
+
|
|
1454
|
+
### `commercelayer order:stop_editing ID`
|
|
1455
|
+
|
|
1456
|
+
Send this attribute to stop the editing for the order and return back to placed status.
|
|
1457
|
+
|
|
1458
|
+
```sh-session
|
|
1459
|
+
USAGE
|
|
1460
|
+
$ commercelayer order:stop_editing ID [-u [-j -p]]
|
|
1461
|
+
|
|
1462
|
+
ARGUMENTS
|
|
1463
|
+
ID the unique id of the resource
|
|
1464
|
+
|
|
1465
|
+
FLAGS
|
|
1466
|
+
-j, --json print result in JSON format
|
|
1467
|
+
-p, --print print out the modified resource
|
|
1468
|
+
-u, --unformatted print JSON output without indentation
|
|
1469
|
+
|
|
1470
|
+
DESCRIPTION
|
|
1471
|
+
Send this attribute to stop the editing for the order and return back to placed status.
|
|
1472
|
+
```
|
|
1473
|
+
|
|
1474
|
+
_See code: [src/commands/order/stop_editing.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/order/stop_editing.ts)_
|
|
1475
|
+
|
|
1429
1476
|
### `commercelayer order:unarchive ID`
|
|
1430
1477
|
|
|
1431
1478
|
Send this attribute if you want to unarchive the order.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class OrderStartEditing extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 orders_1 = require("../../triggers/orders");
|
|
7
|
+
const TRIGGER = 'start_editing';
|
|
8
|
+
class OrderStartEditing extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(OrderStartEditing);
|
|
11
|
+
const res = await (0, exec_1.default)('orders', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('order', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
OrderStartEditing.description = orders_1.triggers[TRIGGER].description;
|
|
19
|
+
OrderStartEditing.flags = {};
|
|
20
|
+
OrderStartEditing.args = Object.assign({}, base_1.default.args);
|
|
21
|
+
exports.default = OrderStartEditing;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class OrderStopEditing extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {};
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 orders_1 = require("../../triggers/orders");
|
|
7
|
+
const TRIGGER = 'stop_editing';
|
|
8
|
+
class OrderStopEditing extends base_1.default {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(OrderStopEditing);
|
|
11
|
+
const res = await (0, exec_1.default)('orders', args.id, TRIGGER, flags);
|
|
12
|
+
if (flags.print)
|
|
13
|
+
this.printOutput(res, flags);
|
|
14
|
+
this.successMessage('order', TRIGGER, res.id);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
OrderStopEditing.description = orders_1.triggers[TRIGGER].description;
|
|
19
|
+
OrderStopEditing.flags = {};
|
|
20
|
+
OrderStopEditing.args = Object.assign({}, base_1.default.args);
|
|
21
|
+
exports.default = OrderStopEditing;
|
package/lib/triggers/orders.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Trigger } from '../common';
|
|
2
2
|
export declare const triggers: Record<string, Trigger>;
|
|
3
|
-
export type ActionType = 'archive' | 'unarchive' | 'place' | 'cancel' | 'approve' | 'approve_and_capture' | 'authorize' | 'authorization_amount_cents' | 'capture' | 'refund' | 'update_taxes' | 'nullify_payment_source' | 'billing_address_clone_id' | 'shipping_address_clone_id' | 'customer_payment_source_id' | 'shipping_address_same_as_billing' | 'billing_address_same_as_shipping' | 'commit_invoice' | 'refund_invoice' | 'save_payment_source_to_customer_wallet' | 'save_shipping_address_to_customer_address_book' | 'save_billing_address_to_customer_address_book' | 'refresh' | 'validate' | 'create_subscriptions';
|
|
3
|
+
export type ActionType = 'archive' | 'unarchive' | 'place' | 'cancel' | 'approve' | 'approve_and_capture' | 'authorize' | 'authorization_amount_cents' | 'capture' | 'refund' | 'update_taxes' | 'nullify_payment_source' | 'billing_address_clone_id' | 'shipping_address_clone_id' | 'customer_payment_source_id' | 'shipping_address_same_as_billing' | 'billing_address_same_as_shipping' | 'commit_invoice' | 'refund_invoice' | 'save_payment_source_to_customer_wallet' | 'save_shipping_address_to_customer_address_book' | 'save_billing_address_to_customer_address_book' | 'refresh' | 'validate' | 'create_subscriptions' | 'start_editing' | 'stop_editing';
|
package/lib/triggers/orders.js
CHANGED
|
@@ -127,4 +127,14 @@ exports.triggers = {
|
|
|
127
127
|
trigger: '_create_subscriptions',
|
|
128
128
|
description: 'Send this attribute if you want to create order subscriptions from the recurring line items upon/after placing the order. Subscriptions are generated according to associated subscription model strategy.',
|
|
129
129
|
},
|
|
130
|
+
start_editing: {
|
|
131
|
+
action: 'start_editing',
|
|
132
|
+
trigger: '_start_editing',
|
|
133
|
+
description: 'Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total amount.',
|
|
134
|
+
},
|
|
135
|
+
stop_editing: {
|
|
136
|
+
action: 'stop_editing',
|
|
137
|
+
trigger: '_stop_editing',
|
|
138
|
+
description: 'Send this attribute to stop the editing for the order and return back to placed status.',
|
|
139
|
+
},
|
|
130
140
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.13.1",
|
|
3
3
|
"commands": {
|
|
4
4
|
"noc": {
|
|
5
5
|
"id": "noc",
|
|
@@ -4212,6 +4212,150 @@
|
|
|
4212
4212
|
}
|
|
4213
4213
|
}
|
|
4214
4214
|
},
|
|
4215
|
+
"order:start_editing": {
|
|
4216
|
+
"id": "order:start_editing",
|
|
4217
|
+
"description": "Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total amount.",
|
|
4218
|
+
"strict": true,
|
|
4219
|
+
"pluginName": "@commercelayer/cli-plugin-triggers",
|
|
4220
|
+
"pluginAlias": "@commercelayer/cli-plugin-triggers",
|
|
4221
|
+
"pluginType": "core",
|
|
4222
|
+
"aliases": [],
|
|
4223
|
+
"flags": {
|
|
4224
|
+
"organization": {
|
|
4225
|
+
"name": "organization",
|
|
4226
|
+
"type": "option",
|
|
4227
|
+
"char": "o",
|
|
4228
|
+
"description": "the slug of your organization",
|
|
4229
|
+
"hidden": true,
|
|
4230
|
+
"required": true,
|
|
4231
|
+
"multiple": false
|
|
4232
|
+
},
|
|
4233
|
+
"domain": {
|
|
4234
|
+
"name": "domain",
|
|
4235
|
+
"type": "option",
|
|
4236
|
+
"char": "d",
|
|
4237
|
+
"hidden": true,
|
|
4238
|
+
"required": false,
|
|
4239
|
+
"multiple": false,
|
|
4240
|
+
"dependsOn": [
|
|
4241
|
+
"organization"
|
|
4242
|
+
]
|
|
4243
|
+
},
|
|
4244
|
+
"accessToken": {
|
|
4245
|
+
"name": "accessToken",
|
|
4246
|
+
"type": "option",
|
|
4247
|
+
"hidden": true,
|
|
4248
|
+
"required": true,
|
|
4249
|
+
"multiple": false
|
|
4250
|
+
},
|
|
4251
|
+
"print": {
|
|
4252
|
+
"name": "print",
|
|
4253
|
+
"type": "boolean",
|
|
4254
|
+
"char": "p",
|
|
4255
|
+
"description": "print out the modified resource",
|
|
4256
|
+
"allowNo": false
|
|
4257
|
+
},
|
|
4258
|
+
"json": {
|
|
4259
|
+
"name": "json",
|
|
4260
|
+
"type": "boolean",
|
|
4261
|
+
"char": "j",
|
|
4262
|
+
"description": "print result in JSON format",
|
|
4263
|
+
"allowNo": false,
|
|
4264
|
+
"dependsOn": [
|
|
4265
|
+
"print"
|
|
4266
|
+
]
|
|
4267
|
+
},
|
|
4268
|
+
"unformatted": {
|
|
4269
|
+
"name": "unformatted",
|
|
4270
|
+
"type": "boolean",
|
|
4271
|
+
"char": "u",
|
|
4272
|
+
"description": "print JSON output without indentation",
|
|
4273
|
+
"allowNo": false,
|
|
4274
|
+
"dependsOn": [
|
|
4275
|
+
"json"
|
|
4276
|
+
]
|
|
4277
|
+
}
|
|
4278
|
+
},
|
|
4279
|
+
"args": {
|
|
4280
|
+
"id": {
|
|
4281
|
+
"name": "id",
|
|
4282
|
+
"description": "the unique id of the resource",
|
|
4283
|
+
"required": true
|
|
4284
|
+
}
|
|
4285
|
+
}
|
|
4286
|
+
},
|
|
4287
|
+
"order:stop_editing": {
|
|
4288
|
+
"id": "order:stop_editing",
|
|
4289
|
+
"description": "Send this attribute to stop the editing for the order and return back to placed status.",
|
|
4290
|
+
"strict": true,
|
|
4291
|
+
"pluginName": "@commercelayer/cli-plugin-triggers",
|
|
4292
|
+
"pluginAlias": "@commercelayer/cli-plugin-triggers",
|
|
4293
|
+
"pluginType": "core",
|
|
4294
|
+
"aliases": [],
|
|
4295
|
+
"flags": {
|
|
4296
|
+
"organization": {
|
|
4297
|
+
"name": "organization",
|
|
4298
|
+
"type": "option",
|
|
4299
|
+
"char": "o",
|
|
4300
|
+
"description": "the slug of your organization",
|
|
4301
|
+
"hidden": true,
|
|
4302
|
+
"required": true,
|
|
4303
|
+
"multiple": false
|
|
4304
|
+
},
|
|
4305
|
+
"domain": {
|
|
4306
|
+
"name": "domain",
|
|
4307
|
+
"type": "option",
|
|
4308
|
+
"char": "d",
|
|
4309
|
+
"hidden": true,
|
|
4310
|
+
"required": false,
|
|
4311
|
+
"multiple": false,
|
|
4312
|
+
"dependsOn": [
|
|
4313
|
+
"organization"
|
|
4314
|
+
]
|
|
4315
|
+
},
|
|
4316
|
+
"accessToken": {
|
|
4317
|
+
"name": "accessToken",
|
|
4318
|
+
"type": "option",
|
|
4319
|
+
"hidden": true,
|
|
4320
|
+
"required": true,
|
|
4321
|
+
"multiple": false
|
|
4322
|
+
},
|
|
4323
|
+
"print": {
|
|
4324
|
+
"name": "print",
|
|
4325
|
+
"type": "boolean",
|
|
4326
|
+
"char": "p",
|
|
4327
|
+
"description": "print out the modified resource",
|
|
4328
|
+
"allowNo": false
|
|
4329
|
+
},
|
|
4330
|
+
"json": {
|
|
4331
|
+
"name": "json",
|
|
4332
|
+
"type": "boolean",
|
|
4333
|
+
"char": "j",
|
|
4334
|
+
"description": "print result in JSON format",
|
|
4335
|
+
"allowNo": false,
|
|
4336
|
+
"dependsOn": [
|
|
4337
|
+
"print"
|
|
4338
|
+
]
|
|
4339
|
+
},
|
|
4340
|
+
"unformatted": {
|
|
4341
|
+
"name": "unformatted",
|
|
4342
|
+
"type": "boolean",
|
|
4343
|
+
"char": "u",
|
|
4344
|
+
"description": "print JSON output without indentation",
|
|
4345
|
+
"allowNo": false,
|
|
4346
|
+
"dependsOn": [
|
|
4347
|
+
"json"
|
|
4348
|
+
]
|
|
4349
|
+
}
|
|
4350
|
+
},
|
|
4351
|
+
"args": {
|
|
4352
|
+
"id": {
|
|
4353
|
+
"name": "id",
|
|
4354
|
+
"description": "the unique id of the resource",
|
|
4355
|
+
"required": true
|
|
4356
|
+
}
|
|
4357
|
+
}
|
|
4358
|
+
},
|
|
4215
4359
|
"order:unarchive": {
|
|
4216
4360
|
"id": "order:unarchive",
|
|
4217
4361
|
"description": "Send this attribute if you want to unarchive the order.",
|
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": "3.
|
|
4
|
+
"version": "3.13.1",
|
|
5
5
|
"author": "Pierluigi Viti <pierluigi@commercelayer.io>",
|
|
6
6
|
"bugs": "https://github.com/commercelayer/commercelayer-cli-plugin-triggers/issues",
|
|
7
7
|
"engines": {
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commercelayer/cli-dev": "^2.0.5",
|
|
47
47
|
"@commercelayer/eslint-config-ts": "^1.0.1",
|
|
48
|
-
"@oclif/plugin-help": "^5.2.
|
|
49
|
-
"@oclif/test": "^2.3.
|
|
48
|
+
"@oclif/plugin-help": "^5.2.14",
|
|
49
|
+
"@oclif/test": "^2.3.31",
|
|
50
50
|
"@types/chai": "^4.3.5",
|
|
51
51
|
"@types/inquirer": "^8.2.6",
|
|
52
52
|
"@types/lodash": "^4.14.195",
|
|
53
53
|
"@types/mocha": "^10.0.1",
|
|
54
|
-
"@types/node": "^20.
|
|
54
|
+
"@types/node": "^20.4.2",
|
|
55
55
|
"chai": "^4.3.7",
|
|
56
|
-
"eslint": "^8.
|
|
56
|
+
"eslint": "^8.45.0",
|
|
57
57
|
"inflector-js": "^1.0.1",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
59
|
"mocha": "^10.2.0",
|
|
@@ -62,10 +62,9 @@
|
|
|
62
62
|
"typescript": "5.0.4"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@commercelayer/cli-core": "^3.
|
|
66
|
-
"@commercelayer/
|
|
67
|
-
"@
|
|
68
|
-
"@oclif/core": "^2.8.11",
|
|
65
|
+
"@commercelayer/cli-core": "^3.12.1",
|
|
66
|
+
"@commercelayer/sdk": "^5.7.0",
|
|
67
|
+
"@oclif/core": "^2.9.4",
|
|
69
68
|
"inquirer": "^8.2.5",
|
|
70
69
|
"tslib": "^2.6.0"
|
|
71
70
|
},
|