@commercelayer/cli-plugin-triggers 4.15.0 → 4.16.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 +690 -23
- package/lib/commands/adyen_gateway/disable.d.ts +9 -0
- package/lib/commands/adyen_gateway/disable.js +22 -0
- package/lib/commands/adyen_gateway/enable.d.ts +9 -0
- package/lib/commands/adyen_gateway/enable.js +22 -0
- package/lib/commands/adyen_gateway/index.d.ts +9 -0
- package/lib/commands/adyen_gateway/index.js +40 -0
- package/lib/commands/axerve_gateway/disable.d.ts +9 -0
- package/lib/commands/axerve_gateway/disable.js +22 -0
- package/lib/commands/axerve_gateway/enable.d.ts +9 -0
- package/lib/commands/axerve_gateway/enable.js +22 -0
- package/lib/commands/axerve_gateway/index.d.ts +9 -0
- package/lib/commands/axerve_gateway/index.js +40 -0
- package/lib/commands/braintree_gateway/disable.d.ts +9 -0
- package/lib/commands/braintree_gateway/disable.js +22 -0
- package/lib/commands/braintree_gateway/enable.d.ts +9 -0
- package/lib/commands/braintree_gateway/enable.js +22 -0
- package/lib/commands/braintree_gateway/index.d.ts +9 -0
- package/lib/commands/braintree_gateway/index.js +40 -0
- package/lib/commands/checkout_com_gateway/disable.d.ts +9 -0
- package/lib/commands/checkout_com_gateway/disable.js +22 -0
- package/lib/commands/checkout_com_gateway/enable.d.ts +9 -0
- package/lib/commands/checkout_com_gateway/enable.js +22 -0
- package/lib/commands/checkout_com_gateway/index.d.ts +9 -0
- package/lib/commands/checkout_com_gateway/index.js +40 -0
- package/lib/commands/external_gateway/disable.d.ts +9 -0
- package/lib/commands/external_gateway/disable.js +22 -0
- package/lib/commands/external_gateway/enable.d.ts +9 -0
- package/lib/commands/external_gateway/enable.js +22 -0
- package/lib/commands/klarna_gateway/disable.d.ts +9 -0
- package/lib/commands/klarna_gateway/disable.js +22 -0
- package/lib/commands/klarna_gateway/enable.d.ts +9 -0
- package/lib/commands/klarna_gateway/enable.js +22 -0
- package/lib/commands/klarna_gateway/index.d.ts +9 -0
- package/lib/commands/klarna_gateway/index.js +40 -0
- package/lib/commands/manual_gateway/disable.d.ts +9 -0
- package/lib/commands/manual_gateway/disable.js +22 -0
- package/lib/commands/manual_gateway/enable.d.ts +9 -0
- package/lib/commands/manual_gateway/enable.js +22 -0
- package/lib/commands/manual_gateway/index.d.ts +9 -0
- package/lib/commands/manual_gateway/index.js +40 -0
- package/lib/commands/paypal_gateway/disable.d.ts +9 -0
- package/lib/commands/paypal_gateway/disable.js +22 -0
- package/lib/commands/paypal_gateway/enable.d.ts +9 -0
- package/lib/commands/paypal_gateway/enable.js +22 -0
- package/lib/commands/paypal_gateway/index.d.ts +9 -0
- package/lib/commands/paypal_gateway/index.js +40 -0
- package/lib/commands/satispay_gateway/disable.d.ts +9 -0
- package/lib/commands/satispay_gateway/disable.js +22 -0
- package/lib/commands/satispay_gateway/enable.d.ts +9 -0
- package/lib/commands/satispay_gateway/enable.js +22 -0
- package/lib/commands/satispay_gateway/index.d.ts +9 -0
- package/lib/commands/satispay_gateway/index.js +40 -0
- package/lib/commands/stripe_gateway/disable.d.ts +9 -0
- package/lib/commands/stripe_gateway/disable.js +22 -0
- package/lib/commands/stripe_gateway/enable.d.ts +9 -0
- package/lib/commands/stripe_gateway/enable.js +22 -0
- package/lib/commands/stripe_gateway/index.d.ts +9 -0
- package/lib/commands/stripe_gateway/index.js +40 -0
- package/lib/triggers/adyen_gateways.d.ts +3 -0
- package/lib/triggers/adyen_gateways.js +15 -0
- package/lib/triggers/axerve_gateways.d.ts +3 -0
- package/lib/triggers/axerve_gateways.js +15 -0
- package/lib/triggers/braintree_gateways.d.ts +3 -0
- package/lib/triggers/braintree_gateways.js +15 -0
- package/lib/triggers/checkout_com_gateways.d.ts +3 -0
- package/lib/triggers/checkout_com_gateways.js +15 -0
- package/lib/triggers/external_gateways.d.ts +1 -1
- package/lib/triggers/external_gateways.js +10 -0
- package/lib/triggers/klarna_gateways.d.ts +3 -0
- package/lib/triggers/klarna_gateways.js +15 -0
- package/lib/triggers/manual_gateways.d.ts +3 -0
- package/lib/triggers/manual_gateways.js +15 -0
- package/lib/triggers/paypal_gateways.d.ts +3 -0
- package/lib/triggers/paypal_gateways.js +15 -0
- package/lib/triggers/satispay_gateways.d.ts +3 -0
- package/lib/triggers/satispay_gateways.js +15 -0
- package/lib/triggers/stripe_gateways.d.ts +3 -0
- package/lib/triggers/stripe_gateways.js +15 -0
- package/oclif.manifest.json +3676 -1124
- package/package.json +7 -7
|
@@ -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 klarna_gateways_1 = require("../../triggers/klarna_gateways");
|
|
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 klarna gateway ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(klarna_gateways_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 KlarnaGatewayIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type klarna_gateways';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(KlarnaGatewayIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('klarna_gateways', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('klarna gateway', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = KlarnaGatewayIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ManualGatewayDisable 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 manual_gateways_1 = require("../../triggers/manual_gateways");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class ManualGatewayDisable extends base_1.default {
|
|
8
|
+
static description = manual_gateways_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(ManualGatewayDisable);
|
|
15
|
+
const res = await this.executeAction('manual_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('manual_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = ManualGatewayDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ManualGatewayEnable 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 manual_gateways_1 = require("../../triggers/manual_gateways");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class ManualGatewayEnable extends base_1.default {
|
|
8
|
+
static description = manual_gateways_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(ManualGatewayEnable);
|
|
15
|
+
const res = await this.executeAction('manual_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('manual_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = ManualGatewayEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class ManualGatewayIndex 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 manual_gateways_1 = require("../../triggers/manual_gateways");
|
|
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 manual gateway ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(manual_gateways_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 ManualGatewayIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type manual_gateways';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(ManualGatewayIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('manual_gateways', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('manual gateway', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = ManualGatewayIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaypalGatewayDisable 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 paypal_gateways_1 = require("../../triggers/paypal_gateways");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class PaypalGatewayDisable extends base_1.default {
|
|
8
|
+
static description = paypal_gateways_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(PaypalGatewayDisable);
|
|
15
|
+
const res = await this.executeAction('paypal_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('paypal_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = PaypalGatewayDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaypalGatewayEnable 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 paypal_gateways_1 = require("../../triggers/paypal_gateways");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class PaypalGatewayEnable extends base_1.default {
|
|
8
|
+
static description = paypal_gateways_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(PaypalGatewayEnable);
|
|
15
|
+
const res = await this.executeAction('paypal_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('paypal_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = PaypalGatewayEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class PaypalGatewayIndex 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 paypal_gateways_1 = require("../../triggers/paypal_gateways");
|
|
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 paypal gateway ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(paypal_gateways_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 PaypalGatewayIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type paypal_gateways';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(PaypalGatewayIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('paypal_gateways', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('paypal gateway', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = PaypalGatewayIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class SatispayGatewayDisable 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 satispay_gateways_1 = require("../../triggers/satispay_gateways");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class SatispayGatewayDisable extends base_1.default {
|
|
8
|
+
static description = satispay_gateways_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(SatispayGatewayDisable);
|
|
15
|
+
const res = await this.executeAction('satispay_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('satispay_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = SatispayGatewayDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class SatispayGatewayEnable 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 satispay_gateways_1 = require("../../triggers/satispay_gateways");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class SatispayGatewayEnable extends base_1.default {
|
|
8
|
+
static description = satispay_gateways_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(SatispayGatewayEnable);
|
|
15
|
+
const res = await this.executeAction('satispay_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('satispay_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = SatispayGatewayEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class SatispayGatewayIndex 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 satispay_gateways_1 = require("../../triggers/satispay_gateways");
|
|
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 satispay gateway ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(satispay_gateways_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 SatispayGatewayIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type satispay_gateways';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(SatispayGatewayIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('satispay_gateways', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('satispay gateway', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = SatispayGatewayIndex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class StripeGatewayDisable 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 stripe_gateways_1 = require("../../triggers/stripe_gateways");
|
|
6
|
+
const TRIGGER = 'disable';
|
|
7
|
+
class StripeGatewayDisable extends base_1.default {
|
|
8
|
+
static description = stripe_gateways_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(StripeGatewayDisable);
|
|
15
|
+
const res = await this.executeAction('stripe_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('stripe_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = StripeGatewayDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class StripeGatewayEnable 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 stripe_gateways_1 = require("../../triggers/stripe_gateways");
|
|
6
|
+
const TRIGGER = 'enable';
|
|
7
|
+
class StripeGatewayEnable extends base_1.default {
|
|
8
|
+
static description = stripe_gateways_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(StripeGatewayEnable);
|
|
15
|
+
const res = await this.executeAction('stripe_gateways', args.id, TRIGGER, flags);
|
|
16
|
+
if (flags.print)
|
|
17
|
+
this.printOutput(res, flags);
|
|
18
|
+
this.successMessage('stripe_gateway', TRIGGER, res.id);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = StripeGatewayEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class StripeGatewayIndex 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 stripe_gateways_1 = require("../../triggers/stripe_gateways");
|
|
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 stripe gateway ${cli_core_1.clColor.api.id(id)}:`,
|
|
14
|
+
choices: Object.keys(stripe_gateways_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 StripeGatewayIndex extends base_1.default {
|
|
23
|
+
static description = 'execute an action on a resource of type stripe_gateways';
|
|
24
|
+
static flags = {};
|
|
25
|
+
static args = {
|
|
26
|
+
...base_1.default.args,
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { args, flags } = await this.parse(StripeGatewayIndex);
|
|
30
|
+
const id = args.id;
|
|
31
|
+
const action = await promptAction(id);
|
|
32
|
+
const fields = [];
|
|
33
|
+
const res = await (0, exec_1.default)('stripe_gateways', id, action, flags, fields);
|
|
34
|
+
this.log();
|
|
35
|
+
this.printOutput(res, flags);
|
|
36
|
+
this.successMessage('stripe gateway', action, res.id);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = StripeGatewayIndex;
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.triggers = void 0;
|
|
4
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
|
+
},
|
|
5
15
|
reset_circuit: {
|
|
6
16
|
action: 'reset_circuit',
|
|
7
17
|
trigger: '_reset_circuit',
|
|
@@ -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
|
+
};
|