@chariow/n8n-nodes-chariow 0.0.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 (82) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +236 -0
  3. package/dist/credentials/ChariowApi.credentials.d.ts +13 -0
  4. package/dist/credentials/ChariowApi.credentials.js +44 -0
  5. package/dist/icons/chariow.svg +27 -0
  6. package/dist/nodes/Chariow/Chariow.node.d.ts +5 -0
  7. package/dist/nodes/Chariow/Chariow.node.js +168 -0
  8. package/dist/nodes/Chariow/Chariow.node.json +18 -0
  9. package/dist/nodes/Chariow/ChariowTrigger.node.d.ts +12 -0
  10. package/dist/nodes/Chariow/ChariowTrigger.node.js +212 -0
  11. package/dist/nodes/Chariow/ChariowTrigger.node.json +18 -0
  12. package/dist/nodes/Chariow/resources/affiliate/get.d.ts +3 -0
  13. package/dist/nodes/Chariow/resources/affiliate/get.js +26 -0
  14. package/dist/nodes/Chariow/resources/affiliate/index.d.ts +6 -0
  15. package/dist/nodes/Chariow/resources/affiliate/index.js +69 -0
  16. package/dist/nodes/Chariow/resources/affiliate/sendInvitations.d.ts +3 -0
  17. package/dist/nodes/Chariow/resources/affiliate/sendInvitations.js +38 -0
  18. package/dist/nodes/Chariow/resources/checkout/create.d.ts +3 -0
  19. package/dist/nodes/Chariow/resources/checkout/create.js +356 -0
  20. package/dist/nodes/Chariow/resources/checkout/index.d.ts +5 -0
  21. package/dist/nodes/Chariow/resources/checkout/index.js +61 -0
  22. package/dist/nodes/Chariow/resources/customer/get.d.ts +3 -0
  23. package/dist/nodes/Chariow/resources/customer/get.js +26 -0
  24. package/dist/nodes/Chariow/resources/customer/getAll.d.ts +3 -0
  25. package/dist/nodes/Chariow/resources/customer/getAll.js +87 -0
  26. package/dist/nodes/Chariow/resources/customer/index.d.ts +6 -0
  27. package/dist/nodes/Chariow/resources/customer/index.js +69 -0
  28. package/dist/nodes/Chariow/resources/discount/get.d.ts +3 -0
  29. package/dist/nodes/Chariow/resources/discount/get.js +26 -0
  30. package/dist/nodes/Chariow/resources/discount/getAll.d.ts +3 -0
  31. package/dist/nodes/Chariow/resources/discount/getAll.js +99 -0
  32. package/dist/nodes/Chariow/resources/discount/index.d.ts +6 -0
  33. package/dist/nodes/Chariow/resources/discount/index.js +69 -0
  34. package/dist/nodes/Chariow/resources/index.d.ts +10 -0
  35. package/dist/nodes/Chariow/resources/index.js +54 -0
  36. package/dist/nodes/Chariow/resources/licence/activate.d.ts +3 -0
  37. package/dist/nodes/Chariow/resources/licence/activate.js +53 -0
  38. package/dist/nodes/Chariow/resources/licence/get.d.ts +3 -0
  39. package/dist/nodes/Chariow/resources/licence/get.js +26 -0
  40. package/dist/nodes/Chariow/resources/licence/getActivations.d.ts +3 -0
  41. package/dist/nodes/Chariow/resources/licence/getActivations.js +63 -0
  42. package/dist/nodes/Chariow/resources/licence/getAll.d.ts +3 -0
  43. package/dist/nodes/Chariow/resources/licence/getAll.js +92 -0
  44. package/dist/nodes/Chariow/resources/licence/index.d.ts +9 -0
  45. package/dist/nodes/Chariow/resources/licence/index.js +99 -0
  46. package/dist/nodes/Chariow/resources/licence/revoke.d.ts +3 -0
  47. package/dist/nodes/Chariow/resources/licence/revoke.js +53 -0
  48. package/dist/nodes/Chariow/resources/product/get.d.ts +3 -0
  49. package/dist/nodes/Chariow/resources/product/get.js +26 -0
  50. package/dist/nodes/Chariow/resources/product/getAll.d.ts +3 -0
  51. package/dist/nodes/Chariow/resources/product/getAll.js +107 -0
  52. package/dist/nodes/Chariow/resources/product/index.d.ts +6 -0
  53. package/dist/nodes/Chariow/resources/product/index.js +69 -0
  54. package/dist/nodes/Chariow/resources/pulse/get.d.ts +3 -0
  55. package/dist/nodes/Chariow/resources/pulse/get.js +27 -0
  56. package/dist/nodes/Chariow/resources/pulse/getAll.d.ts +3 -0
  57. package/dist/nodes/Chariow/resources/pulse/getAll.js +71 -0
  58. package/dist/nodes/Chariow/resources/pulse/index.d.ts +6 -0
  59. package/dist/nodes/Chariow/resources/pulse/index.js +69 -0
  60. package/dist/nodes/Chariow/resources/sale/get.d.ts +3 -0
  61. package/dist/nodes/Chariow/resources/sale/get.js +26 -0
  62. package/dist/nodes/Chariow/resources/sale/getAll.d.ts +3 -0
  63. package/dist/nodes/Chariow/resources/sale/getAll.js +110 -0
  64. package/dist/nodes/Chariow/resources/sale/index.d.ts +6 -0
  65. package/dist/nodes/Chariow/resources/sale/index.js +69 -0
  66. package/dist/nodes/Chariow/resources/store/getInfo.d.ts +3 -0
  67. package/dist/nodes/Chariow/resources/store/getInfo.js +10 -0
  68. package/dist/nodes/Chariow/resources/store/index.d.ts +5 -0
  69. package/dist/nodes/Chariow/resources/store/index.js +61 -0
  70. package/dist/nodes/Chariow/shared/constants.d.ts +24 -0
  71. package/dist/nodes/Chariow/shared/constants.js +27 -0
  72. package/dist/nodes/Chariow/shared/descriptions.d.ts +4 -0
  73. package/dist/nodes/Chariow/shared/descriptions.js +33 -0
  74. package/dist/nodes/Chariow/shared/index.d.ts +4 -0
  75. package/dist/nodes/Chariow/shared/index.js +20 -0
  76. package/dist/nodes/Chariow/shared/transport.d.ts +3 -0
  77. package/dist/nodes/Chariow/shared/transport.js +74 -0
  78. package/dist/nodes/Chariow/shared/utils.d.ts +3 -0
  79. package/dist/nodes/Chariow/shared/utils.js +26 -0
  80. package/dist/package.json +77 -0
  81. package/dist/tsconfig.tsbuildinfo +1 -0
  82. package/package.json +69 -0
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Return All',
9
+ name: 'returnAll',
10
+ type: 'boolean',
11
+ default: false,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['discount'],
15
+ operation: ['getAll'],
16
+ },
17
+ },
18
+ description: 'Whether to return all results or only up to a given limit',
19
+ },
20
+ {
21
+ displayName: 'Limit',
22
+ name: 'limit',
23
+ type: 'number',
24
+ default: 50,
25
+ typeOptions: {
26
+ minValue: 1,
27
+ maxValue: 100,
28
+ },
29
+ displayOptions: {
30
+ show: {
31
+ resource: ['discount'],
32
+ operation: ['getAll'],
33
+ returnAll: [false],
34
+ },
35
+ },
36
+ description: 'Max number of results to return',
37
+ },
38
+ {
39
+ displayName: 'Filters',
40
+ name: 'filters',
41
+ type: 'collection',
42
+ placeholder: 'Add Filter',
43
+ default: {},
44
+ displayOptions: {
45
+ show: {
46
+ resource: ['discount'],
47
+ operation: ['getAll'],
48
+ },
49
+ },
50
+ options: [
51
+ {
52
+ displayName: 'End Date',
53
+ name: 'end_date',
54
+ type: 'string',
55
+ default: '',
56
+ placeholder: '2025-12-31',
57
+ description: 'Filter discounts created before this date (YYYY-MM-DD format)',
58
+ },
59
+ {
60
+ displayName: 'Search',
61
+ name: 'search',
62
+ type: 'string',
63
+ default: '',
64
+ description: 'Search by discount code, name, or ID',
65
+ },
66
+ {
67
+ displayName: 'Start Date',
68
+ name: 'start_date',
69
+ type: 'string',
70
+ default: '',
71
+ placeholder: '2025-01-01',
72
+ description: 'Filter discounts created after this date (YYYY-MM-DD format)',
73
+ },
74
+ {
75
+ displayName: 'Status',
76
+ name: 'status',
77
+ type: 'options',
78
+ options: [
79
+ { name: 'Active', value: 'active' },
80
+ { name: 'All', value: '' },
81
+ { name: 'Expired', value: 'expired' },
82
+ ],
83
+ default: '',
84
+ description: 'Filter by discount status',
85
+ },
86
+ ],
87
+ },
88
+ ];
89
+ async function execute(i) {
90
+ const returnAll = this.getNodeParameter('returnAll', i);
91
+ const filters = this.getNodeParameter('filters', i);
92
+ const limit = this.getNodeParameter('limit', i, 50);
93
+ const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
94
+ if (returnAll) {
95
+ return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.DISCOUNTS, {}, query);
96
+ }
97
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.DISCOUNTS, {}, query);
98
+ return (0, shared_1.extractData)(response);
99
+ }
@@ -0,0 +1,6 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import * as get from './get';
3
+ import * as getAll from './getAll';
4
+ export declare const operations: INodeProperties[];
5
+ export declare const fields: INodeProperties[];
6
+ export { get, getAll };
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getAll = exports.get = exports.fields = exports.operations = void 0;
37
+ const get = __importStar(require("./get"));
38
+ exports.get = get;
39
+ const getAll = __importStar(require("./getAll"));
40
+ exports.getAll = getAll;
41
+ exports.operations = [
42
+ {
43
+ displayName: 'Operation',
44
+ name: 'operation',
45
+ type: 'options',
46
+ noDataExpression: true,
47
+ displayOptions: {
48
+ show: {
49
+ resource: ['discount'],
50
+ },
51
+ },
52
+ options: [
53
+ {
54
+ name: 'Get',
55
+ value: 'get',
56
+ description: 'Get a discount by ID',
57
+ action: 'Get a discount',
58
+ },
59
+ {
60
+ name: 'Get Many',
61
+ value: 'getAll',
62
+ description: 'Get many discounts',
63
+ action: 'Get many discounts',
64
+ },
65
+ ],
66
+ default: 'get',
67
+ },
68
+ ];
69
+ exports.fields = [...get.description, ...getAll.description];
@@ -0,0 +1,10 @@
1
+ import * as customer from './customer';
2
+ import * as product from './product';
3
+ import * as sale from './sale';
4
+ import * as discount from './discount';
5
+ import * as licence from './licence';
6
+ import * as checkout from './checkout';
7
+ import * as store from './store';
8
+ import * as affiliate from './affiliate';
9
+ import * as pulse from './pulse';
10
+ export { customer, product, sale, discount, licence, checkout, store, affiliate, pulse };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.pulse = exports.affiliate = exports.store = exports.checkout = exports.licence = exports.discount = exports.sale = exports.product = exports.customer = void 0;
37
+ const customer = __importStar(require("./customer"));
38
+ exports.customer = customer;
39
+ const product = __importStar(require("./product"));
40
+ exports.product = product;
41
+ const sale = __importStar(require("./sale"));
42
+ exports.sale = sale;
43
+ const discount = __importStar(require("./discount"));
44
+ exports.discount = discount;
45
+ const licence = __importStar(require("./licence"));
46
+ exports.licence = licence;
47
+ const checkout = __importStar(require("./checkout"));
48
+ exports.checkout = checkout;
49
+ const store = __importStar(require("./store"));
50
+ exports.store = store;
51
+ const affiliate = __importStar(require("./affiliate"));
52
+ exports.affiliate = affiliate;
53
+ const pulse = __importStar(require("./pulse"));
54
+ exports.pulse = pulse;
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Licence ID or Key',
9
+ name: 'licenceId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['licence'],
16
+ operation: ['activate'],
17
+ },
18
+ },
19
+ description: 'The ID or key of the licence to activate',
20
+ },
21
+ {
22
+ displayName: 'Additional Fields',
23
+ name: 'additionalFields',
24
+ type: 'collection',
25
+ placeholder: 'Add Field',
26
+ default: {},
27
+ displayOptions: {
28
+ show: {
29
+ resource: ['licence'],
30
+ operation: ['activate'],
31
+ },
32
+ },
33
+ options: [
34
+ {
35
+ displayName: 'Device Identifier',
36
+ name: 'device_identifier',
37
+ type: 'string',
38
+ default: '',
39
+ description: 'Unique identifier for the device (e.g., MAC address, UUID, device name). Maximum 255 characters.',
40
+ },
41
+ ],
42
+ },
43
+ ];
44
+ async function execute(i) {
45
+ const licenceId = this.getNodeParameter('licenceId', i);
46
+ const additionalFields = this.getNodeParameter('additionalFields', i);
47
+ const body = {};
48
+ if (additionalFields.device_identifier) {
49
+ body.device_identifier = additionalFields.device_identifier;
50
+ }
51
+ const response = await shared_1.chariowApiRequest.call(this, 'POST', shared_1.ENDPOINTS.LICENSE_ACTIVATE(licenceId), body);
52
+ return (0, shared_1.extractData)(response);
53
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Licence ID or Key',
9
+ name: 'licenceId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['licence'],
16
+ operation: ['get'],
17
+ },
18
+ },
19
+ description: 'The ID or key of the licence to retrieve (e.g., lic_abc123xyz or XXXX-XXXX-XXXX)',
20
+ },
21
+ ];
22
+ async function execute(i) {
23
+ const licenceId = this.getNodeParameter('licenceId', i);
24
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.LICENSE(licenceId));
25
+ return (0, shared_1.extractData)(response);
26
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject[]>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Licence ID or Key',
9
+ name: 'licenceId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['licence'],
16
+ operation: ['getActivations'],
17
+ },
18
+ },
19
+ description: 'The ID or key of the licence to get activations for',
20
+ },
21
+ {
22
+ displayName: 'Return All',
23
+ name: 'returnAll',
24
+ type: 'boolean',
25
+ default: false,
26
+ displayOptions: {
27
+ show: {
28
+ resource: ['licence'],
29
+ operation: ['getActivations'],
30
+ },
31
+ },
32
+ description: 'Whether to return all results or only up to a given limit',
33
+ },
34
+ {
35
+ displayName: 'Limit',
36
+ name: 'limit',
37
+ type: 'number',
38
+ default: 50,
39
+ typeOptions: {
40
+ minValue: 1,
41
+ maxValue: 100,
42
+ },
43
+ displayOptions: {
44
+ show: {
45
+ resource: ['licence'],
46
+ operation: ['getActivations'],
47
+ returnAll: [false],
48
+ },
49
+ },
50
+ description: 'Max number of results to return',
51
+ },
52
+ ];
53
+ async function execute(i) {
54
+ const licenceId = this.getNodeParameter('licenceId', i);
55
+ const returnAll = this.getNodeParameter('returnAll', i);
56
+ const limit = this.getNodeParameter('limit', i, 50);
57
+ const query = (0, shared_1.buildListQuery)(limit, returnAll);
58
+ if (returnAll) {
59
+ return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.LICENSE_ACTIVATIONS(licenceId), {}, query);
60
+ }
61
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.LICENSE_ACTIVATIONS(licenceId), {}, query);
62
+ return (0, shared_1.extractData)(response);
63
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject[]>;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Return All',
9
+ name: 'returnAll',
10
+ type: 'boolean',
11
+ default: false,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['licence'],
15
+ operation: ['getAll'],
16
+ },
17
+ },
18
+ description: 'Whether to return all results or only up to a given limit',
19
+ },
20
+ {
21
+ displayName: 'Limit',
22
+ name: 'limit',
23
+ type: 'number',
24
+ default: 50,
25
+ typeOptions: {
26
+ minValue: 1,
27
+ maxValue: 100,
28
+ },
29
+ displayOptions: {
30
+ show: {
31
+ resource: ['licence'],
32
+ operation: ['getAll'],
33
+ returnAll: [false],
34
+ },
35
+ },
36
+ description: 'Max number of results to return',
37
+ },
38
+ {
39
+ displayName: 'Filters',
40
+ name: 'filters',
41
+ type: 'collection',
42
+ placeholder: 'Add Filter',
43
+ default: {},
44
+ displayOptions: {
45
+ show: {
46
+ resource: ['licence'],
47
+ operation: ['getAll'],
48
+ },
49
+ },
50
+ options: [
51
+ {
52
+ displayName: 'Customer ID',
53
+ name: 'customer_id',
54
+ type: 'string',
55
+ default: '',
56
+ description: 'Filter by customer ID (e.g., cus_abc123xyz)',
57
+ },
58
+ {
59
+ displayName: 'Product ID',
60
+ name: 'product_id',
61
+ type: 'string',
62
+ default: '',
63
+ description: 'Filter by product ID (e.g., prd_abc123xyz)',
64
+ },
65
+ {
66
+ displayName: 'Status',
67
+ name: 'status',
68
+ type: 'options',
69
+ options: [
70
+ { name: 'Active', value: 'active' },
71
+ { name: 'All', value: '' },
72
+ { name: 'Expired', value: 'expired' },
73
+ { name: 'Pending Activation', value: 'pending_activation' },
74
+ { name: 'Revoked', value: 'revoked' },
75
+ ],
76
+ default: '',
77
+ description: 'Filter by licence status',
78
+ },
79
+ ],
80
+ },
81
+ ];
82
+ async function execute(i) {
83
+ const returnAll = this.getNodeParameter('returnAll', i);
84
+ const filters = this.getNodeParameter('filters', i);
85
+ const limit = this.getNodeParameter('limit', i, 50);
86
+ const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
87
+ if (returnAll) {
88
+ return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.LICENSES, {}, query);
89
+ }
90
+ const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.LICENSES, {}, query);
91
+ return (0, shared_1.extractData)(response);
92
+ }
@@ -0,0 +1,9 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import * as get from './get';
3
+ import * as getAll from './getAll';
4
+ import * as activate from './activate';
5
+ import * as revoke from './revoke';
6
+ import * as getActivations from './getActivations';
7
+ export declare const operations: INodeProperties[];
8
+ export declare const fields: INodeProperties[];
9
+ export { get, getAll, activate, revoke, getActivations };
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getActivations = exports.revoke = exports.activate = exports.getAll = exports.get = exports.fields = exports.operations = void 0;
37
+ const get = __importStar(require("./get"));
38
+ exports.get = get;
39
+ const getAll = __importStar(require("./getAll"));
40
+ exports.getAll = getAll;
41
+ const activate = __importStar(require("./activate"));
42
+ exports.activate = activate;
43
+ const revoke = __importStar(require("./revoke"));
44
+ exports.revoke = revoke;
45
+ const getActivations = __importStar(require("./getActivations"));
46
+ exports.getActivations = getActivations;
47
+ exports.operations = [
48
+ {
49
+ displayName: 'Operation',
50
+ name: 'operation',
51
+ type: 'options',
52
+ noDataExpression: true,
53
+ displayOptions: {
54
+ show: {
55
+ resource: ['licence'],
56
+ },
57
+ },
58
+ options: [
59
+ {
60
+ name: 'Activate',
61
+ value: 'activate',
62
+ description: 'Activate a licence',
63
+ action: 'Activate a licence',
64
+ },
65
+ {
66
+ name: 'Get',
67
+ value: 'get',
68
+ description: 'Get a licence by ID or key',
69
+ action: 'Get a licence',
70
+ },
71
+ {
72
+ name: 'Get Activations',
73
+ value: 'getActivations',
74
+ description: 'Get activations for a licence',
75
+ action: 'Get licence activations',
76
+ },
77
+ {
78
+ name: 'Get Many',
79
+ value: 'getAll',
80
+ description: 'Get many licences',
81
+ action: 'Get many licences',
82
+ },
83
+ {
84
+ name: 'Revoke',
85
+ value: 'revoke',
86
+ description: 'Revoke a licence',
87
+ action: 'Revoke a licence',
88
+ },
89
+ ],
90
+ default: 'get',
91
+ },
92
+ ];
93
+ exports.fields = [
94
+ ...get.description,
95
+ ...getAll.description,
96
+ ...activate.description,
97
+ ...revoke.description,
98
+ ...getActivations.description,
99
+ ];
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const shared_1 = require("../../shared");
6
+ exports.description = [
7
+ {
8
+ displayName: 'Licence ID or Key',
9
+ name: 'licenceId',
10
+ type: 'string',
11
+ required: true,
12
+ default: '',
13
+ displayOptions: {
14
+ show: {
15
+ resource: ['licence'],
16
+ operation: ['revoke'],
17
+ },
18
+ },
19
+ description: 'The ID or key of the licence to revoke',
20
+ },
21
+ {
22
+ displayName: 'Additional Fields',
23
+ name: 'additionalFields',
24
+ type: 'collection',
25
+ placeholder: 'Add Field',
26
+ default: {},
27
+ displayOptions: {
28
+ show: {
29
+ resource: ['licence'],
30
+ operation: ['revoke'],
31
+ },
32
+ },
33
+ options: [
34
+ {
35
+ displayName: 'Reason',
36
+ name: 'reason',
37
+ type: 'string',
38
+ default: '',
39
+ description: 'Optional reason for revoking the licence (max 500 characters). Useful for audit purposes and customer support records.',
40
+ },
41
+ ],
42
+ },
43
+ ];
44
+ async function execute(i) {
45
+ const licenceId = this.getNodeParameter('licenceId', i);
46
+ const additionalFields = this.getNodeParameter('additionalFields', i);
47
+ const body = {};
48
+ if (additionalFields.reason) {
49
+ body.reason = additionalFields.reason;
50
+ }
51
+ const response = await shared_1.chariowApiRequest.call(this, 'POST', shared_1.ENDPOINTS.LICENSE_REVOKE(licenceId), body);
52
+ return (0, shared_1.extractData)(response);
53
+ }
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, IDataObject, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject>;