@commercelayer/cli-plugin-triggers 4.15.1 → 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.
Files changed (81) hide show
  1. package/README.md +690 -23
  2. package/lib/commands/adyen_gateway/disable.d.ts +9 -0
  3. package/lib/commands/adyen_gateway/disable.js +22 -0
  4. package/lib/commands/adyen_gateway/enable.d.ts +9 -0
  5. package/lib/commands/adyen_gateway/enable.js +22 -0
  6. package/lib/commands/adyen_gateway/index.d.ts +9 -0
  7. package/lib/commands/adyen_gateway/index.js +40 -0
  8. package/lib/commands/axerve_gateway/disable.d.ts +9 -0
  9. package/lib/commands/axerve_gateway/disable.js +22 -0
  10. package/lib/commands/axerve_gateway/enable.d.ts +9 -0
  11. package/lib/commands/axerve_gateway/enable.js +22 -0
  12. package/lib/commands/axerve_gateway/index.d.ts +9 -0
  13. package/lib/commands/axerve_gateway/index.js +40 -0
  14. package/lib/commands/braintree_gateway/disable.d.ts +9 -0
  15. package/lib/commands/braintree_gateway/disable.js +22 -0
  16. package/lib/commands/braintree_gateway/enable.d.ts +9 -0
  17. package/lib/commands/braintree_gateway/enable.js +22 -0
  18. package/lib/commands/braintree_gateway/index.d.ts +9 -0
  19. package/lib/commands/braintree_gateway/index.js +40 -0
  20. package/lib/commands/checkout_com_gateway/disable.d.ts +9 -0
  21. package/lib/commands/checkout_com_gateway/disable.js +22 -0
  22. package/lib/commands/checkout_com_gateway/enable.d.ts +9 -0
  23. package/lib/commands/checkout_com_gateway/enable.js +22 -0
  24. package/lib/commands/checkout_com_gateway/index.d.ts +9 -0
  25. package/lib/commands/checkout_com_gateway/index.js +40 -0
  26. package/lib/commands/external_gateway/disable.d.ts +9 -0
  27. package/lib/commands/external_gateway/disable.js +22 -0
  28. package/lib/commands/external_gateway/enable.d.ts +9 -0
  29. package/lib/commands/external_gateway/enable.js +22 -0
  30. package/lib/commands/klarna_gateway/disable.d.ts +9 -0
  31. package/lib/commands/klarna_gateway/disable.js +22 -0
  32. package/lib/commands/klarna_gateway/enable.d.ts +9 -0
  33. package/lib/commands/klarna_gateway/enable.js +22 -0
  34. package/lib/commands/klarna_gateway/index.d.ts +9 -0
  35. package/lib/commands/klarna_gateway/index.js +40 -0
  36. package/lib/commands/manual_gateway/disable.d.ts +9 -0
  37. package/lib/commands/manual_gateway/disable.js +22 -0
  38. package/lib/commands/manual_gateway/enable.d.ts +9 -0
  39. package/lib/commands/manual_gateway/enable.js +22 -0
  40. package/lib/commands/manual_gateway/index.d.ts +9 -0
  41. package/lib/commands/manual_gateway/index.js +40 -0
  42. package/lib/commands/paypal_gateway/disable.d.ts +9 -0
  43. package/lib/commands/paypal_gateway/disable.js +22 -0
  44. package/lib/commands/paypal_gateway/enable.d.ts +9 -0
  45. package/lib/commands/paypal_gateway/enable.js +22 -0
  46. package/lib/commands/paypal_gateway/index.d.ts +9 -0
  47. package/lib/commands/paypal_gateway/index.js +40 -0
  48. package/lib/commands/satispay_gateway/disable.d.ts +9 -0
  49. package/lib/commands/satispay_gateway/disable.js +22 -0
  50. package/lib/commands/satispay_gateway/enable.d.ts +9 -0
  51. package/lib/commands/satispay_gateway/enable.js +22 -0
  52. package/lib/commands/satispay_gateway/index.d.ts +9 -0
  53. package/lib/commands/satispay_gateway/index.js +40 -0
  54. package/lib/commands/stripe_gateway/disable.d.ts +9 -0
  55. package/lib/commands/stripe_gateway/disable.js +22 -0
  56. package/lib/commands/stripe_gateway/enable.d.ts +9 -0
  57. package/lib/commands/stripe_gateway/enable.js +22 -0
  58. package/lib/commands/stripe_gateway/index.d.ts +9 -0
  59. package/lib/commands/stripe_gateway/index.js +40 -0
  60. package/lib/triggers/adyen_gateways.d.ts +3 -0
  61. package/lib/triggers/adyen_gateways.js +15 -0
  62. package/lib/triggers/axerve_gateways.d.ts +3 -0
  63. package/lib/triggers/axerve_gateways.js +15 -0
  64. package/lib/triggers/braintree_gateways.d.ts +3 -0
  65. package/lib/triggers/braintree_gateways.js +15 -0
  66. package/lib/triggers/checkout_com_gateways.d.ts +3 -0
  67. package/lib/triggers/checkout_com_gateways.js +15 -0
  68. package/lib/triggers/external_gateways.d.ts +1 -1
  69. package/lib/triggers/external_gateways.js +10 -0
  70. package/lib/triggers/klarna_gateways.d.ts +3 -0
  71. package/lib/triggers/klarna_gateways.js +15 -0
  72. package/lib/triggers/manual_gateways.d.ts +3 -0
  73. package/lib/triggers/manual_gateways.js +15 -0
  74. package/lib/triggers/paypal_gateways.d.ts +3 -0
  75. package/lib/triggers/paypal_gateways.js +15 -0
  76. package/lib/triggers/satispay_gateways.d.ts +3 -0
  77. package/lib/triggers/satispay_gateways.js +15 -0
  78. package/lib/triggers/stripe_gateways.d.ts +3 -0
  79. package/lib/triggers/stripe_gateways.js +15 -0
  80. package/oclif.manifest.json +3647 -1095
  81. package/package.json +6 -6
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AdyenGatewayDisable 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 adyen_gateways_1 = require("../../triggers/adyen_gateways");
6
+ const TRIGGER = 'disable';
7
+ class AdyenGatewayDisable extends base_1.default {
8
+ static description = adyen_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(AdyenGatewayDisable);
15
+ const res = await this.executeAction('adyen_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('adyen_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = AdyenGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AdyenGatewayEnable 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 adyen_gateways_1 = require("../../triggers/adyen_gateways");
6
+ const TRIGGER = 'enable';
7
+ class AdyenGatewayEnable extends base_1.default {
8
+ static description = adyen_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(AdyenGatewayEnable);
15
+ const res = await this.executeAction('adyen_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('adyen_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = AdyenGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AdyenGatewayIndex 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 adyen_gateways_1 = require("../../triggers/adyen_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 adyen gateway ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(adyen_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 AdyenGatewayIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type adyen_gateways';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(AdyenGatewayIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('adyen_gateways', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('adyen gateway', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = AdyenGatewayIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AxerveGatewayDisable 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 axerve_gateways_1 = require("../../triggers/axerve_gateways");
6
+ const TRIGGER = 'disable';
7
+ class AxerveGatewayDisable extends base_1.default {
8
+ static description = axerve_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(AxerveGatewayDisable);
15
+ const res = await this.executeAction('axerve_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('axerve_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = AxerveGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AxerveGatewayEnable 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 axerve_gateways_1 = require("../../triggers/axerve_gateways");
6
+ const TRIGGER = 'enable';
7
+ class AxerveGatewayEnable extends base_1.default {
8
+ static description = axerve_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(AxerveGatewayEnable);
15
+ const res = await this.executeAction('axerve_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('axerve_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = AxerveGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class AxerveGatewayIndex 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 axerve_gateways_1 = require("../../triggers/axerve_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 axerve gateway ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(axerve_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 AxerveGatewayIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type axerve_gateways';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(AxerveGatewayIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('axerve_gateways', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('axerve gateway', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = AxerveGatewayIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class BraintreeGatewayDisable 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 braintree_gateways_1 = require("../../triggers/braintree_gateways");
6
+ const TRIGGER = 'disable';
7
+ class BraintreeGatewayDisable extends base_1.default {
8
+ static description = braintree_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(BraintreeGatewayDisable);
15
+ const res = await this.executeAction('braintree_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('braintree_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = BraintreeGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class BraintreeGatewayEnable 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 braintree_gateways_1 = require("../../triggers/braintree_gateways");
6
+ const TRIGGER = 'enable';
7
+ class BraintreeGatewayEnable extends base_1.default {
8
+ static description = braintree_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(BraintreeGatewayEnable);
15
+ const res = await this.executeAction('braintree_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('braintree_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = BraintreeGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class BraintreeGatewayIndex 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 braintree_gateways_1 = require("../../triggers/braintree_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 braintree gateway ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(braintree_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 BraintreeGatewayIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type braintree_gateways';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(BraintreeGatewayIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('braintree_gateways', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('braintree gateway', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = BraintreeGatewayIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CheckoutComGatewayDisable 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 checkout_com_gateways_1 = require("../../triggers/checkout_com_gateways");
6
+ const TRIGGER = 'disable';
7
+ class CheckoutComGatewayDisable extends base_1.default {
8
+ static description = checkout_com_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(CheckoutComGatewayDisable);
15
+ const res = await this.executeAction('checkout_com_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('checkout_com_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = CheckoutComGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CheckoutComGatewayEnable 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 checkout_com_gateways_1 = require("../../triggers/checkout_com_gateways");
6
+ const TRIGGER = 'enable';
7
+ class CheckoutComGatewayEnable extends base_1.default {
8
+ static description = checkout_com_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(CheckoutComGatewayEnable);
15
+ const res = await this.executeAction('checkout_com_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('checkout_com_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = CheckoutComGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class CheckoutComGatewayIndex 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 checkout_com_gateways_1 = require("../../triggers/checkout_com_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 checkout com gateway ${cli_core_1.clColor.api.id(id)}:`,
14
+ choices: Object.keys(checkout_com_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 CheckoutComGatewayIndex extends base_1.default {
23
+ static description = 'execute an action on a resource of type checkout_com_gateways';
24
+ static flags = {};
25
+ static args = {
26
+ ...base_1.default.args,
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(CheckoutComGatewayIndex);
30
+ const id = args.id;
31
+ const action = await promptAction(id);
32
+ const fields = [];
33
+ const res = await (0, exec_1.default)('checkout_com_gateways', id, action, flags, fields);
34
+ this.log();
35
+ this.printOutput(res, flags);
36
+ this.successMessage('checkout com gateway', action, res.id);
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = CheckoutComGatewayIndex;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ExternalGatewayDisable 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 external_gateways_1 = require("../../triggers/external_gateways");
6
+ const TRIGGER = 'disable';
7
+ class ExternalGatewayDisable extends base_1.default {
8
+ static description = external_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(ExternalGatewayDisable);
15
+ const res = await this.executeAction('external_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('external_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ExternalGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class ExternalGatewayEnable 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 external_gateways_1 = require("../../triggers/external_gateways");
6
+ const TRIGGER = 'enable';
7
+ class ExternalGatewayEnable extends base_1.default {
8
+ static description = external_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(ExternalGatewayEnable);
15
+ const res = await this.executeAction('external_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('external_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = ExternalGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class KlarnaGatewayDisable 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 klarna_gateways_1 = require("../../triggers/klarna_gateways");
6
+ const TRIGGER = 'disable';
7
+ class KlarnaGatewayDisable extends base_1.default {
8
+ static description = klarna_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(KlarnaGatewayDisable);
15
+ const res = await this.executeAction('klarna_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('klarna_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = KlarnaGatewayDisable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class KlarnaGatewayEnable 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 klarna_gateways_1 = require("../../triggers/klarna_gateways");
6
+ const TRIGGER = 'enable';
7
+ class KlarnaGatewayEnable extends base_1.default {
8
+ static description = klarna_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(KlarnaGatewayEnable);
15
+ const res = await this.executeAction('klarna_gateways', args.id, TRIGGER, flags);
16
+ if (flags.print)
17
+ this.printOutput(res, flags);
18
+ this.successMessage('klarna_gateway', TRIGGER, res.id);
19
+ return res;
20
+ }
21
+ }
22
+ exports.default = KlarnaGatewayEnable;
@@ -0,0 +1,9 @@
1
+ import Command from '../../base';
2
+ export default class KlarnaGatewayIndex 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
+ }