@commercelayer/cli-plugin-triggers 4.7.1 → 4.9.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 +263 -50
- package/lib/commands/authorization/cancel.d.ts +9 -0
- package/lib/commands/authorization/cancel.js +22 -0
- package/lib/commands/capture/cancel.d.ts +9 -0
- package/lib/commands/capture/cancel.js +22 -0
- package/lib/commands/flex_promotion/disable.d.ts +9 -0
- package/lib/commands/flex_promotion/disable.js +22 -0
- package/lib/commands/flex_promotion/enable.d.ts +9 -0
- package/lib/commands/flex_promotion/enable.js +22 -0
- package/lib/commands/flex_promotion/index.d.ts +9 -0
- package/lib/commands/flex_promotion/index.js +40 -0
- package/lib/commands/refund/forward.d.ts +9 -0
- package/lib/commands/refund/forward.js +22 -0
- package/lib/commands/refund/index.d.ts +9 -0
- package/lib/commands/refund/index.js +40 -0
- package/lib/commands/void/forward.d.ts +9 -0
- package/lib/commands/void/forward.js +22 -0
- package/lib/commands/void/index.d.ts +9 -0
- package/lib/commands/void/index.js +40 -0
- package/lib/index.js +0 -1
- package/lib/triggers/authorizations.d.ts +1 -1
- package/lib/triggers/authorizations.js +5 -0
- package/lib/triggers/captures.d.ts +1 -1
- package/lib/triggers/captures.js +5 -0
- package/lib/triggers/events.js +1 -1
- package/lib/triggers/external_gateways.js +1 -1
- package/lib/triggers/external_promotions.js +1 -1
- package/lib/triggers/external_tax_calculators.js +1 -1
- package/lib/triggers/flex_promotions.d.ts +3 -0
- package/lib/triggers/flex_promotions.js +15 -0
- package/lib/triggers/line_items.js +2 -2
- package/lib/triggers/orders.js +9 -9
- package/lib/triggers/refunds.d.ts +3 -0
- package/lib/triggers/refunds.js +10 -0
- package/lib/triggers/shipments.js +5 -5
- package/lib/triggers/shipping_methods.js +1 -1
- package/lib/triggers/stock_items.js +1 -1
- package/lib/triggers/stock_line_items.js +3 -3
- package/lib/triggers/voids.d.ts +3 -0
- package/lib/triggers/voids.js +10 -0
- package/lib/triggers/webhooks.js +1 -1
- package/oclif.manifest.json +941 -149
- package/package.json +14 -14
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class AuthorizationCancel 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 authorizations_1 = require("../../triggers/authorizations");
|
|
6
|
+
const TRIGGER = 'cancel';
|
|
7
|
+
class AuthorizationCancel extends base_1.default {
|
|
8
|
+
static description = authorizations_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(AuthorizationCancel);
|
|
15
|
+
const res = await this.executeAction('authorizations', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('authorization', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = AuthorizationCancel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class CaptureCancel 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 captures_1 = require("../../triggers/captures");
|
|
6
|
+
const TRIGGER = 'cancel';
|
|
7
|
+
class CaptureCancel extends base_1.default {
|
|
8
|
+
static description = captures_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(CaptureCancel);
|
|
15
|
+
const res = await this.executeAction('captures', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('capture', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = CaptureCancel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FlexPromotionDisable 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 flex_promotions_1 = require("../../triggers/flex_promotions");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class FlexPromotionDisable extends base_1.default {
|
|
8
|
+
static description = flex_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(FlexPromotionDisable);
|
|
15
|
+
const res = await this.executeAction('flex_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('flex_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = FlexPromotionDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FlexPromotionEnable 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 flex_promotions_1 = require("../../triggers/flex_promotions");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class FlexPromotionEnable extends base_1.default {
|
|
8
|
+
static description = flex_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(FlexPromotionEnable);
|
|
15
|
+
const res = await this.executeAction('flex_promotions', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('flex_promotion', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = FlexPromotionEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class FlexPromotionIndex 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 flex_promotions_1 = require("../../triggers/flex_promotions");
|
|
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 flex promotion ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(flex_promotions_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 FlexPromotionIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type flex_promotions';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(FlexPromotionIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('flex_promotions', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('flex promotion', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = FlexPromotionIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class RefundForward 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 refunds_1 = require("../../triggers/refunds");
|
|
6
|
+
const TRIGGER = 'forward';
|
|
7
|
+
class RefundForward extends base_1.default {
|
|
8
|
+
static description = refunds_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(RefundForward);
|
|
15
|
+
const res = await this.executeAction('refunds', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('refund', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = RefundForward;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class RefundIndex 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 refunds_1 = require("../../triggers/refunds");
|
|
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 refund ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(refunds_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 RefundIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type refunds';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(RefundIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('refunds', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('refund', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = RefundIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class VoidForward 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 voids_1 = require("../../triggers/voids");
|
|
6
|
+
const TRIGGER = 'forward';
|
|
7
|
+
class VoidForward extends base_1.default {
|
|
8
|
+
static description = voids_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(VoidForward);
|
|
15
|
+
const res = await this.executeAction('voids', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('void', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = VoidForward;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class VoidIndex 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 voids_1 = require("../../triggers/voids");
|
|
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 void ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(voids_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 VoidIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type voids';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(VoidIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('voids', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('void', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = VoidIndex;
|
package/lib/index.js
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 = 'forward' | 'capture' | 'capture_amount_cents' | 'void';
|
|
3
|
+
export type ActionType = 'forward' | 'capture' | 'capture_amount_cents' | 'void' | 'cancel';
|
|
@@ -22,4 +22,9 @@ exports.triggers = {
|
|
|
22
22
|
trigger: '_void',
|
|
23
23
|
description: 'Send this attribute if you want to create a void for this authorization.',
|
|
24
24
|
},
|
|
25
|
+
cancel: {
|
|
26
|
+
action: 'cancel',
|
|
27
|
+
trigger: '_cancel',
|
|
28
|
+
description: 'Send this attribute if you want to void a succeeded authorization of a pending order (which is left unpaid).',
|
|
29
|
+
},
|
|
25
30
|
};
|
package/lib/triggers/captures.js
CHANGED
|
@@ -17,4 +17,9 @@ exports.triggers = {
|
|
|
17
17
|
trigger: '_refund_amount_cents',
|
|
18
18
|
description: 'Send this attribute as a value in cents if you want to overwrite the amount to be refunded.',
|
|
19
19
|
},
|
|
20
|
+
cancel: {
|
|
21
|
+
action: 'cancel',
|
|
22
|
+
trigger: '_cancel',
|
|
23
|
+
description: 'Send this attribute if you want to refund a succeeded capture of a pending order (which is left unpaid).',
|
|
24
|
+
},
|
|
20
25
|
};
|
package/lib/triggers/events.js
CHANGED
|
@@ -5,6 +5,6 @@ exports.triggers = {
|
|
|
5
5
|
trigger: {
|
|
6
6
|
action: 'trigger',
|
|
7
7
|
trigger: '_trigger',
|
|
8
|
-
description: 'Send this attribute if you want to force webhooks execution for this event.',
|
|
8
|
+
description: 'Send this attribute if you want to force webhooks execution for this event. Cannot be passed by sales channels.',
|
|
9
9
|
},
|
|
10
10
|
};
|
|
@@ -5,6 +5,6 @@ exports.triggers = {
|
|
|
5
5
|
reset_circuit: {
|
|
6
6
|
action: 'reset_circuit',
|
|
7
7
|
trigger: '_reset_circuit',
|
|
8
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
8
|
+
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.',
|
|
9
9
|
},
|
|
10
10
|
};
|
|
@@ -15,6 +15,6 @@ exports.triggers = {
|
|
|
15
15
|
reset_circuit: {
|
|
16
16
|
action: 'reset_circuit',
|
|
17
17
|
trigger: '_reset_circuit',
|
|
18
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
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
20
|
};
|
|
@@ -5,6 +5,6 @@ exports.triggers = {
|
|
|
5
5
|
reset_circuit: {
|
|
6
6
|
action: 'reset_circuit',
|
|
7
7
|
trigger: '_reset_circuit',
|
|
8
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
8
|
+
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.',
|
|
9
9
|
},
|
|
10
10
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggers = void 0;
|
|
4
|
+
exports.triggers = {
|
|
5
|
+
disable: {
|
|
6
|
+
action: 'disable',
|
|
7
|
+
trigger: '_disable',
|
|
8
|
+
description: 'Send this attribute if you want to mark this resource as disabled.',
|
|
9
|
+
},
|
|
10
|
+
enable: {
|
|
11
|
+
action: 'enable',
|
|
12
|
+
trigger: '_enable',
|
|
13
|
+
description: 'Send this attribute if you want to mark this resource as enabled.',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -10,11 +10,11 @@ exports.triggers = {
|
|
|
10
10
|
reserve_stock: {
|
|
11
11
|
action: 'reserve_stock',
|
|
12
12
|
trigger: '_reserve_stock',
|
|
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.',
|
|
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
15
|
reset_circuit: {
|
|
16
16
|
action: 'reset_circuit',
|
|
17
17
|
trigger: '_reset_circuit',
|
|
18
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
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
20
|
};
|
package/lib/triggers/orders.js
CHANGED
|
@@ -15,7 +15,7 @@ exports.triggers = {
|
|
|
15
15
|
pending: {
|
|
16
16
|
action: 'pending',
|
|
17
17
|
trigger: '_pending',
|
|
18
|
-
description: 'Send this attribute if you want to move a draft or placing order to pending.',
|
|
18
|
+
description: 'Send this attribute if you want to move a draft or placing order to pending. Cannot be passed by sales channels.',
|
|
19
19
|
},
|
|
20
20
|
place: {
|
|
21
21
|
action: 'place',
|
|
@@ -30,12 +30,12 @@ exports.triggers = {
|
|
|
30
30
|
approve: {
|
|
31
31
|
action: 'approve',
|
|
32
32
|
trigger: '_approve',
|
|
33
|
-
description: 'Send this attribute if you want to approve a placed order.',
|
|
33
|
+
description: 'Send this attribute if you want to approve a placed order. Cannot be passed by sales channels.',
|
|
34
34
|
},
|
|
35
35
|
approve_and_capture: {
|
|
36
36
|
action: 'approve_and_capture',
|
|
37
37
|
trigger: '_approve_and_capture',
|
|
38
|
-
description: 'Send this attribute if you want to approve and capture a placed order.',
|
|
38
|
+
description: 'Send this attribute if you want to approve and capture a placed order. Cannot be passed by sales channels.',
|
|
39
39
|
},
|
|
40
40
|
authorize: {
|
|
41
41
|
action: 'authorize',
|
|
@@ -50,17 +50,17 @@ exports.triggers = {
|
|
|
50
50
|
capture: {
|
|
51
51
|
action: 'capture',
|
|
52
52
|
trigger: '_capture',
|
|
53
|
-
description: 'Send this attribute if you want to capture an authorized order.',
|
|
53
|
+
description: 'Send this attribute if you want to capture an authorized order. Cannot be passed by sales channels.',
|
|
54
54
|
},
|
|
55
55
|
refund: {
|
|
56
56
|
action: 'refund',
|
|
57
57
|
trigger: '_refund',
|
|
58
|
-
description: 'Send this attribute if you want to refund a captured order.',
|
|
58
|
+
description: 'Send this attribute if you want to refund a captured order. Cannot be passed by sales channels.',
|
|
59
59
|
},
|
|
60
60
|
fulfill: {
|
|
61
61
|
action: 'fulfill',
|
|
62
62
|
trigger: '_fulfill',
|
|
63
|
-
description: 'Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered).',
|
|
63
|
+
description: 'Send this attribute if you want to mark as fulfilled the order (shipments must be cancelled, shipped or delivered). Cannot be passed by sales channels.',
|
|
64
64
|
},
|
|
65
65
|
update_taxes: {
|
|
66
66
|
action: 'update_taxes',
|
|
@@ -140,16 +140,16 @@ exports.triggers = {
|
|
|
140
140
|
start_editing: {
|
|
141
141
|
action: 'start_editing',
|
|
142
142
|
trigger: '_start_editing',
|
|
143
|
-
description: 'Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total amount.',
|
|
143
|
+
description: 'Send this attribute if you want to edit the order after it is placed. Remember you cannot exceed the original total amount. Cannot be passed by sales channels.',
|
|
144
144
|
},
|
|
145
145
|
stop_editing: {
|
|
146
146
|
action: 'stop_editing',
|
|
147
147
|
trigger: '_stop_editing',
|
|
148
|
-
description: 'Send this attribute to stop the editing for the order and return back to placed status.',
|
|
148
|
+
description: 'Send this attribute to stop the editing for the order and return back to placed status. Cannot be passed by sales channels.',
|
|
149
149
|
},
|
|
150
150
|
reset_circuit: {
|
|
151
151
|
action: 'reset_circuit',
|
|
152
152
|
trigger: '_reset_circuit',
|
|
153
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
153
|
+
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.',
|
|
154
154
|
},
|
|
155
155
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggers = void 0;
|
|
4
|
+
exports.triggers = {
|
|
5
|
+
forward: {
|
|
6
|
+
action: 'forward',
|
|
7
|
+
trigger: '_forward',
|
|
8
|
+
description: 'Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly.',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -5,12 +5,12 @@ exports.triggers = {
|
|
|
5
5
|
upcoming: {
|
|
6
6
|
action: 'upcoming',
|
|
7
7
|
trigger: '_upcoming',
|
|
8
|
-
description: 'Send this attribute if you want to mark this shipment as upcoming.',
|
|
8
|
+
description: 'Send this attribute if you want to mark this shipment as upcoming. Cannot be passed by sales channels.',
|
|
9
9
|
},
|
|
10
10
|
cancel: {
|
|
11
11
|
action: 'cancel',
|
|
12
12
|
trigger: '_cancel',
|
|
13
|
-
description: 'Send this attribute if you want to mark this shipment as cancelled (unless already shipped or delivered).',
|
|
13
|
+
description: 'Send this attribute if you want to mark this shipment as cancelled (unless already shipped or delivered). Cannot be passed by sales channels.',
|
|
14
14
|
},
|
|
15
15
|
on_hold: {
|
|
16
16
|
action: 'on_hold',
|
|
@@ -45,17 +45,17 @@ exports.triggers = {
|
|
|
45
45
|
reserve_stock: {
|
|
46
46
|
action: 'reserve_stock',
|
|
47
47
|
trigger: '_reserve_stock',
|
|
48
|
-
description: 'Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.',
|
|
48
|
+
description: 'Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
49
49
|
},
|
|
50
50
|
release_stock: {
|
|
51
51
|
action: 'release_stock',
|
|
52
52
|
trigger: '_release_stock',
|
|
53
|
-
description: 'Send this attribute if you want to automatically destroy the stock reservations for each of the associated stock line item. Can be done only when fulfillment is in progress.',
|
|
53
|
+
description: 'Send this attribute if you want to automatically destroy the stock reservations for each of the associated stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
54
54
|
},
|
|
55
55
|
decrement_stock: {
|
|
56
56
|
action: 'decrement_stock',
|
|
57
57
|
trigger: '_decrement_stock',
|
|
58
|
-
description: 'Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.',
|
|
58
|
+
description: 'Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
59
59
|
},
|
|
60
60
|
get_rates: {
|
|
61
61
|
action: 'get_rates',
|
|
@@ -15,6 +15,6 @@ exports.triggers = {
|
|
|
15
15
|
reset_circuit: {
|
|
16
16
|
action: 'reset_circuit',
|
|
17
17
|
trigger: '_reset_circuit',
|
|
18
|
-
description: 'Send this attribute if you want to reset the circuit breaker associated to this resource to \'closed\' state and zero failures count.',
|
|
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
20
|
};
|
|
@@ -5,6 +5,6 @@ exports.triggers = {
|
|
|
5
5
|
validate: {
|
|
6
6
|
action: 'validate',
|
|
7
7
|
trigger: '_validate',
|
|
8
|
-
description: 'Send this attribute if you want to validate the stock item quantity against the existing reserved stock one, returns an error in case the former is smaller.',
|
|
8
|
+
description: 'Send this attribute if you want to validate the stock item quantity against the existing reserved stock one, returns an error in case the former is smaller. Cannot be passed by sales channels.',
|
|
9
9
|
},
|
|
10
10
|
};
|
|
@@ -5,16 +5,16 @@ exports.triggers = {
|
|
|
5
5
|
reserve_stock: {
|
|
6
6
|
action: 'reserve_stock',
|
|
7
7
|
trigger: '_reserve_stock',
|
|
8
|
-
description: 'Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when fulfillment is in progress.',
|
|
8
|
+
description: 'Send this attribute if you want to automatically reserve the stock for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
9
9
|
},
|
|
10
10
|
release_stock: {
|
|
11
11
|
action: 'release_stock',
|
|
12
12
|
trigger: '_release_stock',
|
|
13
|
-
description: 'Send this attribute if you want to automatically destroy the stock reservation for this stock line item. Can be done only when fulfillment is in progress.',
|
|
13
|
+
description: 'Send this attribute if you want to automatically destroy the stock reservation for this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
14
14
|
},
|
|
15
15
|
decrement_stock: {
|
|
16
16
|
action: 'decrement_stock',
|
|
17
17
|
trigger: '_decrement_stock',
|
|
18
|
-
description: 'Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done only when fulfillment is in progress.',
|
|
18
|
+
description: 'Send this attribute if you want to automatically decrement and release the stock this stock line item. Can be done only when fulfillment is in progress. Cannot be passed by sales channels.',
|
|
19
19
|
},
|
|
20
20
|
};
|