@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.
- package/LICENSE.md +21 -0
- package/README.md +236 -0
- package/dist/credentials/ChariowApi.credentials.d.ts +13 -0
- package/dist/credentials/ChariowApi.credentials.js +44 -0
- package/dist/icons/chariow.svg +27 -0
- package/dist/nodes/Chariow/Chariow.node.d.ts +5 -0
- package/dist/nodes/Chariow/Chariow.node.js +168 -0
- package/dist/nodes/Chariow/Chariow.node.json +18 -0
- package/dist/nodes/Chariow/ChariowTrigger.node.d.ts +12 -0
- package/dist/nodes/Chariow/ChariowTrigger.node.js +212 -0
- package/dist/nodes/Chariow/ChariowTrigger.node.json +18 -0
- package/dist/nodes/Chariow/resources/affiliate/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/affiliate/get.js +26 -0
- package/dist/nodes/Chariow/resources/affiliate/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/affiliate/index.js +69 -0
- package/dist/nodes/Chariow/resources/affiliate/sendInvitations.d.ts +3 -0
- package/dist/nodes/Chariow/resources/affiliate/sendInvitations.js +38 -0
- package/dist/nodes/Chariow/resources/checkout/create.d.ts +3 -0
- package/dist/nodes/Chariow/resources/checkout/create.js +356 -0
- package/dist/nodes/Chariow/resources/checkout/index.d.ts +5 -0
- package/dist/nodes/Chariow/resources/checkout/index.js +61 -0
- package/dist/nodes/Chariow/resources/customer/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/customer/get.js +26 -0
- package/dist/nodes/Chariow/resources/customer/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/customer/getAll.js +87 -0
- package/dist/nodes/Chariow/resources/customer/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/customer/index.js +69 -0
- package/dist/nodes/Chariow/resources/discount/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/discount/get.js +26 -0
- package/dist/nodes/Chariow/resources/discount/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/discount/getAll.js +99 -0
- package/dist/nodes/Chariow/resources/discount/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/discount/index.js +69 -0
- package/dist/nodes/Chariow/resources/index.d.ts +10 -0
- package/dist/nodes/Chariow/resources/index.js +54 -0
- package/dist/nodes/Chariow/resources/licence/activate.d.ts +3 -0
- package/dist/nodes/Chariow/resources/licence/activate.js +53 -0
- package/dist/nodes/Chariow/resources/licence/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/licence/get.js +26 -0
- package/dist/nodes/Chariow/resources/licence/getActivations.d.ts +3 -0
- package/dist/nodes/Chariow/resources/licence/getActivations.js +63 -0
- package/dist/nodes/Chariow/resources/licence/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/licence/getAll.js +92 -0
- package/dist/nodes/Chariow/resources/licence/index.d.ts +9 -0
- package/dist/nodes/Chariow/resources/licence/index.js +99 -0
- package/dist/nodes/Chariow/resources/licence/revoke.d.ts +3 -0
- package/dist/nodes/Chariow/resources/licence/revoke.js +53 -0
- package/dist/nodes/Chariow/resources/product/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/product/get.js +26 -0
- package/dist/nodes/Chariow/resources/product/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/product/getAll.js +107 -0
- package/dist/nodes/Chariow/resources/product/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/product/index.js +69 -0
- package/dist/nodes/Chariow/resources/pulse/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/pulse/get.js +27 -0
- package/dist/nodes/Chariow/resources/pulse/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/pulse/getAll.js +71 -0
- package/dist/nodes/Chariow/resources/pulse/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/pulse/index.js +69 -0
- package/dist/nodes/Chariow/resources/sale/get.d.ts +3 -0
- package/dist/nodes/Chariow/resources/sale/get.js +26 -0
- package/dist/nodes/Chariow/resources/sale/getAll.d.ts +3 -0
- package/dist/nodes/Chariow/resources/sale/getAll.js +110 -0
- package/dist/nodes/Chariow/resources/sale/index.d.ts +6 -0
- package/dist/nodes/Chariow/resources/sale/index.js +69 -0
- package/dist/nodes/Chariow/resources/store/getInfo.d.ts +3 -0
- package/dist/nodes/Chariow/resources/store/getInfo.js +10 -0
- package/dist/nodes/Chariow/resources/store/index.d.ts +5 -0
- package/dist/nodes/Chariow/resources/store/index.js +61 -0
- package/dist/nodes/Chariow/shared/constants.d.ts +24 -0
- package/dist/nodes/Chariow/shared/constants.js +27 -0
- package/dist/nodes/Chariow/shared/descriptions.d.ts +4 -0
- package/dist/nodes/Chariow/shared/descriptions.js +33 -0
- package/dist/nodes/Chariow/shared/index.d.ts +4 -0
- package/dist/nodes/Chariow/shared/index.js +20 -0
- package/dist/nodes/Chariow/shared/transport.d.ts +3 -0
- package/dist/nodes/Chariow/shared/transport.js +74 -0
- package/dist/nodes/Chariow/shared/utils.d.ts +3 -0
- package/dist/nodes/Chariow/shared/utils.js +26 -0
- package/dist/package.json +77 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +69 -0
|
@@ -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: 'Product ID',
|
|
9
|
+
name: 'productId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
default: '',
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['product'],
|
|
16
|
+
operation: ['get'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
description: 'The ID of the product to retrieve (e.g., prd_abc123xyz)',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
async function execute(i) {
|
|
23
|
+
const productId = this.getNodeParameter('productId', i);
|
|
24
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.PRODUCT(productId));
|
|
25
|
+
return (0, shared_1.extractData)(response);
|
|
26
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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: ['product'],
|
|
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: ['product'],
|
|
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: ['product'],
|
|
47
|
+
operation: ['getAll'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Category',
|
|
53
|
+
name: 'category',
|
|
54
|
+
type: 'options',
|
|
55
|
+
options: [
|
|
56
|
+
{ name: 'All', value: '' },
|
|
57
|
+
{ name: 'Business & Finance', value: 'business_and_finance' },
|
|
58
|
+
{ name: 'Creative Arts', value: 'creative_arts' },
|
|
59
|
+
{ name: 'Education & Learning', value: 'education_and_learning' },
|
|
60
|
+
{ name: 'Entertainment', value: 'entertainment' },
|
|
61
|
+
{ name: 'Health & Wellness', value: 'health_and_wellness' },
|
|
62
|
+
{ name: 'Literature & Publishing', value: 'literature_and_publishing' },
|
|
63
|
+
{ name: 'Media & Communication', value: 'media_and_communication' },
|
|
64
|
+
{ name: 'Miscellaneous', value: 'miscellaneous' },
|
|
65
|
+
{ name: 'Personal Development', value: 'personal_development' },
|
|
66
|
+
{ name: 'Technology', value: 'technology' },
|
|
67
|
+
],
|
|
68
|
+
default: '',
|
|
69
|
+
description: 'Filter by product category',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Search',
|
|
73
|
+
name: 'search',
|
|
74
|
+
type: 'string',
|
|
75
|
+
default: '',
|
|
76
|
+
description: 'Search products by name or slug',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Type',
|
|
80
|
+
name: 'type',
|
|
81
|
+
type: 'options',
|
|
82
|
+
options: [
|
|
83
|
+
{ name: 'All', value: '' },
|
|
84
|
+
{ name: 'Bundle', value: 'bundle' },
|
|
85
|
+
{ name: 'Coaching', value: 'coaching' },
|
|
86
|
+
{ name: 'Course', value: 'course' },
|
|
87
|
+
{ name: 'Downloadable', value: 'downloadable' },
|
|
88
|
+
{ name: 'License', value: 'license' },
|
|
89
|
+
{ name: 'Service', value: 'service' },
|
|
90
|
+
],
|
|
91
|
+
default: '',
|
|
92
|
+
description: 'Filter by product type',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
async function execute(i) {
|
|
98
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
99
|
+
const filters = this.getNodeParameter('filters', i);
|
|
100
|
+
const limit = this.getNodeParameter('limit', i, 50);
|
|
101
|
+
const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
|
|
102
|
+
if (returnAll) {
|
|
103
|
+
return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.PRODUCTS, {}, query);
|
|
104
|
+
}
|
|
105
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.PRODUCTS, {}, query);
|
|
106
|
+
return (0, shared_1.extractData)(response);
|
|
107
|
+
}
|
|
@@ -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: ['product'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
name: 'Get',
|
|
55
|
+
value: 'get',
|
|
56
|
+
description: 'Get a product by ID',
|
|
57
|
+
action: 'Get a product',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Get Many',
|
|
61
|
+
value: 'getAll',
|
|
62
|
+
description: 'Get many products',
|
|
63
|
+
action: 'Get many products',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
default: 'get',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
exports.fields = [...get.description, ...getAll.description];
|
|
@@ -0,0 +1,27 @@
|
|
|
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: 'Pulse ID',
|
|
9
|
+
name: 'pulseId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
default: '',
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['pulse'],
|
|
16
|
+
operation: ['get'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
description: 'The ID of the pulse/webhook (e.g., pulse_abc123xyz)',
|
|
20
|
+
placeholder: 'pulse_abc123xyz',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
async function execute(i) {
|
|
24
|
+
const pulseId = this.getNodeParameter('pulseId', i);
|
|
25
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.PULSE(pulseId));
|
|
26
|
+
return (0, shared_1.extractData)(response);
|
|
27
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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: ['pulse'],
|
|
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: ['pulse'],
|
|
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: ['pulse'],
|
|
47
|
+
operation: ['getAll'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Search',
|
|
53
|
+
name: 'search',
|
|
54
|
+
type: 'string',
|
|
55
|
+
default: '',
|
|
56
|
+
description: 'Search by webhook URL or triggers',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
async function execute(i) {
|
|
62
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
63
|
+
const filters = this.getNodeParameter('filters', i);
|
|
64
|
+
const limit = this.getNodeParameter('limit', i, 50);
|
|
65
|
+
const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
|
|
66
|
+
if (returnAll) {
|
|
67
|
+
return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.PULSES, {}, query);
|
|
68
|
+
}
|
|
69
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.PULSES, {}, query);
|
|
70
|
+
return (0, shared_1.extractData)(response);
|
|
71
|
+
}
|
|
@@ -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: ['pulse'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
name: 'Get',
|
|
55
|
+
value: 'get',
|
|
56
|
+
description: 'Get a pulse/webhook by ID',
|
|
57
|
+
action: 'Get a pulse',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Get Many',
|
|
61
|
+
value: 'getAll',
|
|
62
|
+
description: 'Get many pulses/webhooks',
|
|
63
|
+
action: 'Get many pulses',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
default: 'get',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
exports.fields = [...get.description, ...getAll.description];
|
|
@@ -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: 'Sale ID',
|
|
9
|
+
name: 'saleId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
required: true,
|
|
12
|
+
default: '',
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['sale'],
|
|
16
|
+
operation: ['get'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
description: 'The ID of the sale to retrieve (e.g., sal_abc123xyz)',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
async function execute(i) {
|
|
23
|
+
const saleId = this.getNodeParameter('saleId', i);
|
|
24
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.SALE(saleId));
|
|
25
|
+
return (0, shared_1.extractData)(response);
|
|
26
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
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: ['sale'],
|
|
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: ['sale'],
|
|
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: ['sale'],
|
|
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: 'End Date',
|
|
60
|
+
name: 'end_date',
|
|
61
|
+
type: 'string',
|
|
62
|
+
default: '',
|
|
63
|
+
placeholder: '2025-12-31',
|
|
64
|
+
description: 'Filter sales created before this date (YYYY-MM-DD format)',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Search',
|
|
68
|
+
name: 'search',
|
|
69
|
+
type: 'string',
|
|
70
|
+
default: '',
|
|
71
|
+
description: 'Search by sale reference or customer email',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Start Date',
|
|
75
|
+
name: 'start_date',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
placeholder: '2025-01-01',
|
|
79
|
+
description: 'Filter sales created after this date (YYYY-MM-DD format)',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Status',
|
|
83
|
+
name: 'status',
|
|
84
|
+
type: 'options',
|
|
85
|
+
options: [
|
|
86
|
+
{ name: 'Abandoned', value: 'abandoned' },
|
|
87
|
+
{ name: 'All', value: '' },
|
|
88
|
+
{ name: 'Awaiting Payment', value: 'awaiting_payment' },
|
|
89
|
+
{ name: 'Completed', value: 'completed' },
|
|
90
|
+
{ name: 'Failed', value: 'failed' },
|
|
91
|
+
{ name: 'Initiated', value: 'initiated' },
|
|
92
|
+
{ name: 'Settled', value: 'settled' },
|
|
93
|
+
],
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'Filter by sale status',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
async function execute(i) {
|
|
101
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
102
|
+
const filters = this.getNodeParameter('filters', i);
|
|
103
|
+
const limit = this.getNodeParameter('limit', i, 50);
|
|
104
|
+
const query = (0, shared_1.buildListQuery)(limit, returnAll, filters);
|
|
105
|
+
if (returnAll) {
|
|
106
|
+
return shared_1.chariowApiRequestAllItems.call(this, 'GET', shared_1.ENDPOINTS.SALES, {}, query);
|
|
107
|
+
}
|
|
108
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.SALES, {}, query);
|
|
109
|
+
return (0, shared_1.extractData)(response);
|
|
110
|
+
}
|
|
@@ -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: ['sale'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
name: 'Get',
|
|
55
|
+
value: 'get',
|
|
56
|
+
description: 'Get a sale by ID',
|
|
57
|
+
action: 'Get a sale',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Get Many',
|
|
61
|
+
value: 'getAll',
|
|
62
|
+
description: 'Get many sales',
|
|
63
|
+
action: 'Get many sales',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
default: 'get',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
exports.fields = [...get.description, ...getAll.description];
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
async function execute() {
|
|
8
|
+
const response = await shared_1.chariowApiRequest.call(this, 'GET', shared_1.ENDPOINTS.STORE);
|
|
9
|
+
return (0, shared_1.extractData)(response);
|
|
10
|
+
}
|