n8n-nodes-syncx 1.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/dist/SyncX/syncx.svg +4 -0
- package/dist/credentials/SyncXApi.credentials.d.ts +10 -0
- package/dist/credentials/SyncXApi.credentials.d.ts.map +1 -0
- package/dist/credentials/SyncXApi.credentials.js +45 -0
- package/dist/credentials/SyncXApi.credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/SyncX/SyncX.node.d.ts +16 -0
- package/dist/nodes/SyncX/SyncX.node.d.ts.map +1 -0
- package/dist/nodes/SyncX/SyncX.node.js +373 -0
- package/dist/nodes/SyncX/SyncX.node.js.map +1 -0
- package/dist/nodes/SyncX/SyncXTrigger.node.d.ts +20 -0
- package/dist/nodes/SyncX/SyncXTrigger.node.d.ts.map +1 -0
- package/dist/nodes/SyncX/SyncXTrigger.node.js +208 -0
- package/dist/nodes/SyncX/SyncXTrigger.node.js.map +1 -0
- package/dist/nodes/SyncX/syncx.svg +4 -0
- package/package.json +161 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class SyncXApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=SyncXApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncXApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/SyncXApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,QAAS,YAAW,eAAe;IAC/C,IAAI,SAAc;IAClB,WAAW,SAAe;IAC1B,gBAAgB,SAAuB;IACvC,UAAU,EAAE,eAAe,EAAE,CAkB3B;IAEF,YAAY,EAAE,oBAAoB,CAOhC;IAEF,IAAI,EAAE,sBAAsB,CAK1B;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncXApi = void 0;
|
|
4
|
+
class SyncXApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'syncXApi';
|
|
7
|
+
this.displayName = 'SyncX API';
|
|
8
|
+
this.documentationUrl = 'https://syncx.dev';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Domain',
|
|
12
|
+
name: 'domain',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://app.syncx.dev',
|
|
15
|
+
placeholder: 'https://app.syncx.dev',
|
|
16
|
+
description: 'Base URL of your SyncX instance, e.g. https://app.syncx.dev',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'API Key',
|
|
21
|
+
name: 'apiKey',
|
|
22
|
+
type: 'string',
|
|
23
|
+
typeOptions: { password: true },
|
|
24
|
+
default: '',
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
this.authenticate = {
|
|
29
|
+
type: 'generic',
|
|
30
|
+
properties: {
|
|
31
|
+
headers: {
|
|
32
|
+
'X-API-KEY': '={{$credentials.apiKey}}',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
this.test = {
|
|
37
|
+
request: {
|
|
38
|
+
baseURL: '={{$credentials.domain}}',
|
|
39
|
+
url: '/api/leads/getSheets',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.SyncXApi = SyncXApi;
|
|
45
|
+
//# sourceMappingURL=SyncXApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncXApi.credentials.js","sourceRoot":"","sources":["../../credentials/SyncXApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAClB,gBAAW,GAAG,WAAW,CAAC;QAC1B,qBAAgB,GAAG,mBAAmB,CAAC;QACvC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAuB;gBAChC,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EAAE,6DAA6D;gBAC1E,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,sBAAsB;aAC3B;SACD,CAAC;IACH,CAAC;CAAA;AAvCD,4BAuCC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncXApi = exports.SyncXTrigger = exports.SyncX = void 0;
|
|
4
|
+
var SyncX_node_1 = require("./nodes/SyncX/SyncX.node");
|
|
5
|
+
Object.defineProperty(exports, "SyncX", { enumerable: true, get: function () { return SyncX_node_1.SyncX; } });
|
|
6
|
+
var SyncXTrigger_node_1 = require("./nodes/SyncX/SyncXTrigger.node");
|
|
7
|
+
Object.defineProperty(exports, "SyncXTrigger", { enumerable: true, get: function () { return SyncXTrigger_node_1.SyncXTrigger; } });
|
|
8
|
+
var SyncXApi_credentials_1 = require("./credentials/SyncXApi.credentials");
|
|
9
|
+
Object.defineProperty(exports, "SyncXApi", { enumerable: true, get: function () { return SyncXApi_credentials_1.SyncXApi; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAAxC,mGAAA,KAAK,OAAA;AACd,qEAA+D;AAAtD,iHAAA,YAAY,OAAA;AACrB,2EAA8D;AAArD,gHAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class SyncX implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getSmartsheets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getPipelines(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
getPipelineStages(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
getTeams(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
10
|
+
getAgents(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
11
|
+
getSmartsheetColumns(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=SyncX.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncX.node.d.ts","sourceRoot":"","sources":["../../../nodes/SyncX/SyncX.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,KAAM,YAAW,SAAS;IACtC,WAAW,EAAE,oBAAoB,CA2N/B;IAEF,OAAO;;iCAEsB,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;+BAazD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;oCAalD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;2BAgBhE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;4BAatD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;uCAmB5C,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;MAiBxF;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA4DvE"}
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncX = void 0;
|
|
4
|
+
class SyncX {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'SyncX',
|
|
8
|
+
name: 'syncX',
|
|
9
|
+
icon: 'file:syncx.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
13
|
+
description: 'Create and update leads in SyncX',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'SyncX',
|
|
16
|
+
},
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'syncXApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
properties: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Operation',
|
|
28
|
+
name: 'operation',
|
|
29
|
+
type: 'options',
|
|
30
|
+
noDataExpression: true,
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Create or Update Lead',
|
|
34
|
+
value: 'createUpdateLead',
|
|
35
|
+
description: 'Creates a new lead or updates an existing lead',
|
|
36
|
+
action: 'Create or update a lead',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'createUpdateLead',
|
|
40
|
+
},
|
|
41
|
+
// ── Required fields ───────────────────────────────────────────
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Smartsheet',
|
|
44
|
+
name: 'smartListId',
|
|
45
|
+
type: 'options',
|
|
46
|
+
typeOptions: { loadOptionsMethod: 'getSmartsheets' },
|
|
47
|
+
required: true,
|
|
48
|
+
default: '',
|
|
49
|
+
description: 'The smartsheet list the lead belongs to',
|
|
50
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Pipeline',
|
|
54
|
+
name: 'pipelineId',
|
|
55
|
+
type: 'options',
|
|
56
|
+
typeOptions: { loadOptionsMethod: 'getPipelines' },
|
|
57
|
+
required: true,
|
|
58
|
+
default: '',
|
|
59
|
+
description: 'The pipeline for the lead',
|
|
60
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Phone Number',
|
|
64
|
+
name: 'phoneNumber',
|
|
65
|
+
type: 'string',
|
|
66
|
+
required: true,
|
|
67
|
+
default: '',
|
|
68
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
69
|
+
},
|
|
70
|
+
// ── Standard lead fields ──────────────────────────────────────
|
|
71
|
+
{
|
|
72
|
+
displayName: 'First Name',
|
|
73
|
+
name: 'firstName',
|
|
74
|
+
type: 'string',
|
|
75
|
+
default: '',
|
|
76
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Last Name',
|
|
80
|
+
name: 'lastName',
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: '',
|
|
83
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Email',
|
|
87
|
+
name: 'email',
|
|
88
|
+
type: 'string',
|
|
89
|
+
placeholder: 'name@email.com',
|
|
90
|
+
default: '',
|
|
91
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Address',
|
|
95
|
+
name: 'address',
|
|
96
|
+
type: 'string',
|
|
97
|
+
default: '',
|
|
98
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Notes',
|
|
102
|
+
name: 'notes',
|
|
103
|
+
type: 'string',
|
|
104
|
+
typeOptions: { rows: 3 },
|
|
105
|
+
default: '',
|
|
106
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
displayName: 'Tag',
|
|
110
|
+
name: 'tag',
|
|
111
|
+
type: 'string',
|
|
112
|
+
default: '',
|
|
113
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
114
|
+
},
|
|
115
|
+
// ── Pipeline / stage ─────────────────────────────────────────
|
|
116
|
+
{
|
|
117
|
+
displayName: 'Stage',
|
|
118
|
+
name: 'stage',
|
|
119
|
+
type: 'options',
|
|
120
|
+
typeOptions: {
|
|
121
|
+
loadOptionsMethod: 'getPipelineStages',
|
|
122
|
+
loadOptionsDependsOn: ['pipelineId'],
|
|
123
|
+
},
|
|
124
|
+
default: '',
|
|
125
|
+
description: 'Pipeline stage for the lead — reloads when Pipeline changes',
|
|
126
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
127
|
+
},
|
|
128
|
+
// ── Appointment ───────────────────────────────────────────────
|
|
129
|
+
{
|
|
130
|
+
displayName: 'Appointment Date & Time',
|
|
131
|
+
name: 'appointmentDateAndTime',
|
|
132
|
+
type: 'string',
|
|
133
|
+
placeholder: 'Dec 25, 2025, 5pm',
|
|
134
|
+
description: 'Format: Dec 25, 2025, 5pm',
|
|
135
|
+
default: '',
|
|
136
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
displayName: 'Appointment Duration',
|
|
140
|
+
name: 'appointment_duration',
|
|
141
|
+
type: 'string',
|
|
142
|
+
default: '',
|
|
143
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
displayName: 'Timezone',
|
|
147
|
+
name: 'timezone',
|
|
148
|
+
type: 'string',
|
|
149
|
+
default: '',
|
|
150
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
displayName: 'Meeting Location',
|
|
154
|
+
name: 'location',
|
|
155
|
+
type: 'string',
|
|
156
|
+
description: 'Google Meet or Zoom link',
|
|
157
|
+
default: '',
|
|
158
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
159
|
+
},
|
|
160
|
+
// ── Assignment ────────────────────────────────────────────────
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Teams',
|
|
163
|
+
name: 'teamsAssigned',
|
|
164
|
+
type: 'multiOptions',
|
|
165
|
+
typeOptions: { loadOptionsMethod: 'getTeams' },
|
|
166
|
+
default: [],
|
|
167
|
+
description: 'Team members to assign to this lead',
|
|
168
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
displayName: 'Agents',
|
|
172
|
+
name: 'mainAgentIds',
|
|
173
|
+
type: 'multiOptions',
|
|
174
|
+
typeOptions: {
|
|
175
|
+
loadOptionsMethod: 'getAgents',
|
|
176
|
+
loadOptionsDependsOn: ['pipelineId'],
|
|
177
|
+
},
|
|
178
|
+
default: [],
|
|
179
|
+
description: 'Outbound agents to assign — reloads when Pipeline changes',
|
|
180
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
181
|
+
},
|
|
182
|
+
// ── Dynamic smartsheet columns ────────────────────────────────
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Extra Smartsheet Columns',
|
|
185
|
+
name: 'extraColumns',
|
|
186
|
+
type: 'fixedCollection',
|
|
187
|
+
typeOptions: { multipleValues: true },
|
|
188
|
+
placeholder: 'Add Column',
|
|
189
|
+
default: {},
|
|
190
|
+
description: 'Column names reload when Smartsheet changes',
|
|
191
|
+
displayOptions: { show: { operation: ['createUpdateLead'] } },
|
|
192
|
+
options: [
|
|
193
|
+
{
|
|
194
|
+
name: 'values',
|
|
195
|
+
displayName: 'Column',
|
|
196
|
+
values: [
|
|
197
|
+
{
|
|
198
|
+
displayName: 'Column Name',
|
|
199
|
+
name: 'columnName',
|
|
200
|
+
type: 'options',
|
|
201
|
+
typeOptions: {
|
|
202
|
+
loadOptionsMethod: 'getSmartsheetColumns',
|
|
203
|
+
loadOptionsDependsOn: ['smartListId'],
|
|
204
|
+
},
|
|
205
|
+
default: '',
|
|
206
|
+
description: 'Pick a column — reloads when Smartsheet changes',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
displayName: 'Value',
|
|
210
|
+
name: 'value',
|
|
211
|
+
type: 'string',
|
|
212
|
+
default: '',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
};
|
|
220
|
+
this.methods = {
|
|
221
|
+
loadOptions: {
|
|
222
|
+
async getSmartsheets() {
|
|
223
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
224
|
+
const response = await this.helpers.httpRequest({
|
|
225
|
+
method: 'GET',
|
|
226
|
+
url: `${credentials.domain}/api/leads/getSheets`,
|
|
227
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
228
|
+
});
|
|
229
|
+
return response.data.map((sheet) => ({
|
|
230
|
+
name: sheet.sheetName,
|
|
231
|
+
value: sheet.id,
|
|
232
|
+
}));
|
|
233
|
+
},
|
|
234
|
+
async getPipelines() {
|
|
235
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
236
|
+
const response = await this.helpers.httpRequest({
|
|
237
|
+
method: 'GET',
|
|
238
|
+
url: `${credentials.domain}/api/pipeline/getPipelines`,
|
|
239
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
240
|
+
});
|
|
241
|
+
return response.data.map((pipeline) => ({
|
|
242
|
+
name: pipeline.title,
|
|
243
|
+
value: pipeline.id,
|
|
244
|
+
}));
|
|
245
|
+
},
|
|
246
|
+
async getPipelineStages() {
|
|
247
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
248
|
+
const pipelineId = this.getCurrentNodeParameter('pipelineId');
|
|
249
|
+
if (!pipelineId)
|
|
250
|
+
return [];
|
|
251
|
+
const response = await this.helpers.httpRequest({
|
|
252
|
+
method: 'GET',
|
|
253
|
+
url: `${credentials.domain}/api/pipeline/getPipeline`,
|
|
254
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
255
|
+
qs: { pipelineId },
|
|
256
|
+
});
|
|
257
|
+
return response.data.stages.map((stage) => ({
|
|
258
|
+
name: stage.stageTitle,
|
|
259
|
+
value: stage.id,
|
|
260
|
+
}));
|
|
261
|
+
},
|
|
262
|
+
async getTeams() {
|
|
263
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
264
|
+
const response = await this.helpers.httpRequest({
|
|
265
|
+
method: 'GET',
|
|
266
|
+
url: `${credentials.domain}/api/team/getTeamMembers`,
|
|
267
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
268
|
+
});
|
|
269
|
+
return response.data.map((member) => {
|
|
270
|
+
var _a;
|
|
271
|
+
return ({
|
|
272
|
+
name: ((_a = member.invitedUser) === null || _a === void 0 ? void 0 : _a.name) || member.name || String(member.invitedUserId),
|
|
273
|
+
value: member.invitingUserId,
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
async getAgents() {
|
|
278
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
279
|
+
const pipelineId = this.getCurrentNodeParameter('pipelineId');
|
|
280
|
+
const response = await this.helpers.httpRequest({
|
|
281
|
+
method: 'GET',
|
|
282
|
+
url: `${credentials.domain}/api/agent/getAgents`,
|
|
283
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
284
|
+
qs: { agentType: 'outbound', pipelineId, pipeline: true },
|
|
285
|
+
});
|
|
286
|
+
return response.data.map((agent) => {
|
|
287
|
+
const stages = (agent.stages || []).map((s) => s.stageTitle).join(', ');
|
|
288
|
+
return {
|
|
289
|
+
name: stages ? `${agent.name} (${stages})` : agent.name,
|
|
290
|
+
value: agent.id,
|
|
291
|
+
};
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
// Loads column names from the selected smartsheet (skips standard fields)
|
|
295
|
+
async getSmartsheetColumns() {
|
|
296
|
+
var _a;
|
|
297
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
298
|
+
const smartListId = this.getCurrentNodeParameter('smartListId');
|
|
299
|
+
if (!smartListId)
|
|
300
|
+
return [];
|
|
301
|
+
const response = await this.helpers.httpRequest({
|
|
302
|
+
method: 'GET',
|
|
303
|
+
url: `${credentials.domain}/api/leads/getSheets`,
|
|
304
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
305
|
+
});
|
|
306
|
+
const sheet = response.data.find((s) => String(s.id) === String(smartListId));
|
|
307
|
+
if (!((_a = sheet === null || sheet === void 0 ? void 0 : sheet.columns) === null || _a === void 0 ? void 0 : _a.length))
|
|
308
|
+
return [];
|
|
309
|
+
const builtIn = new Set(['First Name', 'Last Name', 'Phone Number', 'Email']);
|
|
310
|
+
return sheet.columns
|
|
311
|
+
.filter((col) => !builtIn.has(col.columnName))
|
|
312
|
+
.map((col) => ({ name: col.columnName, value: col.columnName }));
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
async execute() {
|
|
318
|
+
var _a;
|
|
319
|
+
const items = this.getInputData();
|
|
320
|
+
const returnData = [];
|
|
321
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
322
|
+
for (let i = 0; i < items.length; i++) {
|
|
323
|
+
const operation = this.getNodeParameter('operation', i);
|
|
324
|
+
if (operation === 'createUpdateLead') {
|
|
325
|
+
const body = {
|
|
326
|
+
smartListId: this.getNodeParameter('smartListId', i),
|
|
327
|
+
pipelineId: this.getNodeParameter('pipelineId', i),
|
|
328
|
+
phoneNumber: this.getNodeParameter('phoneNumber', i),
|
|
329
|
+
};
|
|
330
|
+
// Standard optional fields — only add if non-empty
|
|
331
|
+
const optionalScalars = [
|
|
332
|
+
'firstName', 'lastName', 'email', 'address', 'notes', 'tag',
|
|
333
|
+
'stage', 'appointmentDateAndTime', 'appointment_duration',
|
|
334
|
+
'timezone', 'location',
|
|
335
|
+
];
|
|
336
|
+
for (const key of optionalScalars) {
|
|
337
|
+
const val = this.getNodeParameter(key, i);
|
|
338
|
+
if (val)
|
|
339
|
+
body[key] = val;
|
|
340
|
+
}
|
|
341
|
+
// Multi-select arrays
|
|
342
|
+
const teamsAssigned = this.getNodeParameter('teamsAssigned', i);
|
|
343
|
+
if (teamsAssigned === null || teamsAssigned === void 0 ? void 0 : teamsAssigned.length)
|
|
344
|
+
body.teamsAssigned = teamsAssigned;
|
|
345
|
+
const mainAgentIds = this.getNodeParameter('mainAgentIds', i);
|
|
346
|
+
if (mainAgentIds === null || mainAgentIds === void 0 ? void 0 : mainAgentIds.length)
|
|
347
|
+
body.mainAgentIds = mainAgentIds;
|
|
348
|
+
// Dynamic smartsheet columns
|
|
349
|
+
const extraColumns = this.getNodeParameter('extraColumns', i);
|
|
350
|
+
if ((_a = extraColumns === null || extraColumns === void 0 ? void 0 : extraColumns.values) === null || _a === void 0 ? void 0 : _a.length) {
|
|
351
|
+
for (const col of extraColumns.values) {
|
|
352
|
+
if (col.columnName)
|
|
353
|
+
body[col.columnName] = col.value;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const response = await this.helpers.httpRequest({
|
|
357
|
+
method: 'PUT',
|
|
358
|
+
url: `${credentials.domain}/api/leads/updateLead`,
|
|
359
|
+
headers: {
|
|
360
|
+
'X-API-KEY': credentials.apiKey,
|
|
361
|
+
'Content-Type': 'application/json',
|
|
362
|
+
},
|
|
363
|
+
body,
|
|
364
|
+
json: true,
|
|
365
|
+
});
|
|
366
|
+
returnData.push({ json: response, pairedItem: { item: i } });
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return [returnData];
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
exports.SyncX = SyncX;
|
|
373
|
+
//# sourceMappingURL=SyncX.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncX.node.js","sourceRoot":"","sources":["../../../nodes/SyncX/SyncX.node.ts"],"names":[],"mappings":";;;AASA,MA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AE,IAAI,EAAE,QAAe,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACrE,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAzXD,sBAyXC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IHookFunctions, ILoadOptionsFunctions, INodePropertyOptions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class SyncXTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getSmartsheets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getPipelines(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
getPipelineStages(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhookMethods: {
|
|
12
|
+
default: {
|
|
13
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
14
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
15
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SyncXTrigger.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncXTrigger.node.d.ts","sourceRoot":"","sources":["../../../nodes/SyncX/SyncXTrigger.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,YAAa,YAAW,SAAS;IAC7C,WAAW,EAAE,oBAAoB,CAoF/B;IAEF,OAAO;;iCAEsB,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;+BAazD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;oCAalD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;MAgBrF;IAEF,cAAc;;8BAEY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;yBAMtC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;yBAsCjC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;;MAwBpD;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAWrE"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncXTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class SyncXTrigger {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'SyncX Trigger',
|
|
9
|
+
name: 'syncXTrigger',
|
|
10
|
+
icon: 'file:syncx.svg',
|
|
11
|
+
group: ['trigger'],
|
|
12
|
+
version: 1,
|
|
13
|
+
description: 'Triggers when a lead stage is updated in SyncX',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'SyncX Trigger',
|
|
16
|
+
},
|
|
17
|
+
inputs: [],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'syncXApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
webhooks: [
|
|
26
|
+
{
|
|
27
|
+
name: 'default',
|
|
28
|
+
httpMethod: 'POST',
|
|
29
|
+
responseMode: 'onReceived',
|
|
30
|
+
path: 'webhook',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
// Shows the webhook URL and test button in the n8n UI
|
|
34
|
+
triggerPanel: {
|
|
35
|
+
header: '',
|
|
36
|
+
executionsHelp: {
|
|
37
|
+
inactive: 'Activate the workflow to register the webhook with SyncX. Once active, SyncX will send data here whenever a lead stage changes.',
|
|
38
|
+
active: 'The workflow is active. SyncX is sending data to n8n whenever a lead stage matches your filters.',
|
|
39
|
+
},
|
|
40
|
+
activationHint: 'Activate this workflow to register the webhook with SyncX. You must activate the workflow before SyncX can send events here.',
|
|
41
|
+
},
|
|
42
|
+
properties: [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Trigger Event',
|
|
45
|
+
name: 'event',
|
|
46
|
+
type: 'options',
|
|
47
|
+
noDataExpression: true,
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
name: 'Lead Stage Updated',
|
|
51
|
+
value: 'leadStageUpdated',
|
|
52
|
+
description: 'Fires when a lead moves to a new pipeline stage',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
default: 'leadStageUpdated',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Smartsheet',
|
|
59
|
+
name: 'sheetId',
|
|
60
|
+
type: 'options',
|
|
61
|
+
typeOptions: { loadOptionsMethod: 'getSmartsheets' },
|
|
62
|
+
required: true,
|
|
63
|
+
default: '',
|
|
64
|
+
description: 'The smartsheet list to watch for stage changes',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Pipeline',
|
|
68
|
+
name: 'pipelineId',
|
|
69
|
+
type: 'options',
|
|
70
|
+
typeOptions: { loadOptionsMethod: 'getPipelines' },
|
|
71
|
+
required: true,
|
|
72
|
+
default: '',
|
|
73
|
+
description: 'The pipeline to watch',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
displayName: 'Stages',
|
|
77
|
+
name: 'stages',
|
|
78
|
+
type: 'multiOptions',
|
|
79
|
+
typeOptions: {
|
|
80
|
+
loadOptionsMethod: 'getPipelineStages',
|
|
81
|
+
loadOptionsDependsOn: ['pipelineId'],
|
|
82
|
+
},
|
|
83
|
+
required: true,
|
|
84
|
+
default: [],
|
|
85
|
+
description: 'Which stage transitions should trigger this workflow — reloads when Pipeline changes',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
this.methods = {
|
|
90
|
+
loadOptions: {
|
|
91
|
+
async getSmartsheets() {
|
|
92
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
93
|
+
const response = await this.helpers.httpRequest({
|
|
94
|
+
method: 'GET',
|
|
95
|
+
url: `${credentials.domain}/api/leads/getSheets`,
|
|
96
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
97
|
+
});
|
|
98
|
+
return response.data.map((sheet) => ({
|
|
99
|
+
name: sheet.sheetName,
|
|
100
|
+
value: sheet.id,
|
|
101
|
+
}));
|
|
102
|
+
},
|
|
103
|
+
async getPipelines() {
|
|
104
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
105
|
+
const response = await this.helpers.httpRequest({
|
|
106
|
+
method: 'GET',
|
|
107
|
+
url: `${credentials.domain}/api/pipeline/getPipelines`,
|
|
108
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
109
|
+
});
|
|
110
|
+
return response.data.map((pipeline) => ({
|
|
111
|
+
name: pipeline.title,
|
|
112
|
+
value: pipeline.id,
|
|
113
|
+
}));
|
|
114
|
+
},
|
|
115
|
+
async getPipelineStages() {
|
|
116
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
117
|
+
const pipelineId = this.getCurrentNodeParameter('pipelineId');
|
|
118
|
+
if (!pipelineId)
|
|
119
|
+
return [];
|
|
120
|
+
const response = await this.helpers.httpRequest({
|
|
121
|
+
method: 'GET',
|
|
122
|
+
url: `${credentials.domain}/api/pipeline/getPipeline`,
|
|
123
|
+
headers: { 'X-API-KEY': credentials.apiKey },
|
|
124
|
+
qs: { pipelineId },
|
|
125
|
+
});
|
|
126
|
+
return response.data.stages.map((stage) => ({
|
|
127
|
+
name: stage.stageTitle,
|
|
128
|
+
value: stage.id,
|
|
129
|
+
}));
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
this.webhookMethods = {
|
|
134
|
+
default: {
|
|
135
|
+
async checkExists() {
|
|
136
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
137
|
+
// Only consider it existing if we have a real saved ID
|
|
138
|
+
return typeof webhookData.webhookId === 'number' || typeof webhookData.webhookId === 'string';
|
|
139
|
+
},
|
|
140
|
+
async create() {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
143
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
144
|
+
const sheetId = this.getNodeParameter('sheetId');
|
|
145
|
+
const stages = this.getNodeParameter('stages');
|
|
146
|
+
const response = await this.helpers.httpRequest({
|
|
147
|
+
method: 'POST',
|
|
148
|
+
url: `${credentials.domain}/api/user/createWebhook`,
|
|
149
|
+
headers: {
|
|
150
|
+
'X-API-KEY': credentials.apiKey,
|
|
151
|
+
'Content-Type': 'application/json',
|
|
152
|
+
Accept: 'application/json',
|
|
153
|
+
},
|
|
154
|
+
body: {
|
|
155
|
+
url: webhookUrl,
|
|
156
|
+
action: 'StageChange',
|
|
157
|
+
stageIds: stages.toString(), // comma-separated string matching Zapier's format
|
|
158
|
+
sheetId,
|
|
159
|
+
},
|
|
160
|
+
json: true,
|
|
161
|
+
});
|
|
162
|
+
// Handle both { data: { id } } and { id } response shapes
|
|
163
|
+
const webhookId = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : response === null || response === void 0 ? void 0 : response.id;
|
|
164
|
+
if (webhookId === undefined || webhookId === null) {
|
|
165
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `SyncX did not return a webhook ID. Full response: ${JSON.stringify(response)}`);
|
|
166
|
+
}
|
|
167
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
168
|
+
webhookData.webhookId = webhookId;
|
|
169
|
+
return true;
|
|
170
|
+
},
|
|
171
|
+
async delete() {
|
|
172
|
+
const credentials = await this.getCredentials('syncXApi');
|
|
173
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
174
|
+
if (webhookData.webhookId !== undefined) {
|
|
175
|
+
try {
|
|
176
|
+
await this.helpers.httpRequest({
|
|
177
|
+
method: 'POST',
|
|
178
|
+
url: `${credentials.domain}/api/user/deleteWebhook`,
|
|
179
|
+
headers: {
|
|
180
|
+
'X-API-KEY': credentials.apiKey,
|
|
181
|
+
'Content-Type': 'application/json',
|
|
182
|
+
},
|
|
183
|
+
body: { id: webhookData.webhookId },
|
|
184
|
+
json: true,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// Webhook may have already been removed on the SyncX side — safe to continue
|
|
189
|
+
}
|
|
190
|
+
delete webhookData.webhookId;
|
|
191
|
+
}
|
|
192
|
+
return true;
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
async webhook() {
|
|
198
|
+
// getBodyData() is typed as IDataObject but SyncX may send an array,
|
|
199
|
+
// so cast broadly and normalise to an array either way.
|
|
200
|
+
const body = this.getBodyData();
|
|
201
|
+
const items = Array.isArray(body) ? body : [body];
|
|
202
|
+
return {
|
|
203
|
+
workflowData: [items.map((item) => ({ json: item }))],
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.SyncXTrigger = SyncXTrigger;
|
|
208
|
+
//# sourceMappingURL=SyncXTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncXTrigger.node.js","sourceRoot":"","sources":["../../../nodes/SyncX/SyncXTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAUsB;AAEtB,MAAa,YAAY;IAAzB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,eAAe;YAC5B,I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
@@ -0,0 +1,161 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-syncx",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SyncX is a no-code AI platform for sales and support that connects AI agents with business tools and workflows.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package"
|
|
7
|
+
],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "SyncX",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/syncx/n8n-nodes-syncx.git"
|
|
13
|
+
},
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc && copyfiles -u 0 \"nodes/**/*.svg\" dist/",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"lint": "eslint nodes credentials --ext .ts",
|
|
19
|
+
"lintfix": "eslint nodes credentials --ext .ts --fix",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"n8n": {
|
|
26
|
+
"n8nNodesApiVersion": 1,
|
|
27
|
+
"credentials": [
|
|
28
|
+
"dist/credentials/SyncXApi.credentials.js"
|
|
29
|
+
],
|
|
30
|
+
"nodes": [
|
|
31
|
+
"dist/nodes/SyncX/SyncX.node.js",
|
|
32
|
+
"dist/nodes/SyncX/SyncXTrigger.node.js"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^18.16.16",
|
|
37
|
+
"copyfiles": "^2.4.1",
|
|
38
|
+
"n8n-workflow": "*",
|
|
39
|
+
"typescript": "^5.1.6"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"n8n-workflow": "*"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"ansi-regex": "^5.0.1",
|
|
46
|
+
"ansi-styles": "^4.3.0",
|
|
47
|
+
"assert": "^2.1.0",
|
|
48
|
+
"ast-types": "^0.16.1",
|
|
49
|
+
"asynckit": "^0.4.0",
|
|
50
|
+
"available-typed-arrays": "^1.0.7",
|
|
51
|
+
"balanced-match": "^1.0.2",
|
|
52
|
+
"brace-expansion": "^1.1.14",
|
|
53
|
+
"call-bind": "^1.0.9",
|
|
54
|
+
"call-bind-apply-helpers": "^1.0.2",
|
|
55
|
+
"call-bound": "^1.0.4",
|
|
56
|
+
"callsites": "^3.1.0",
|
|
57
|
+
"charenc": "^0.0.2",
|
|
58
|
+
"cliui": "^7.0.4",
|
|
59
|
+
"color-convert": "^2.0.1",
|
|
60
|
+
"color-name": "^1.1.4",
|
|
61
|
+
"combined-stream": "^1.0.8",
|
|
62
|
+
"concat-map": "^0.0.1",
|
|
63
|
+
"core-util-is": "^1.0.3",
|
|
64
|
+
"crypt": "^0.0.2",
|
|
65
|
+
"define-data-property": "^1.1.4",
|
|
66
|
+
"define-properties": "^1.2.1",
|
|
67
|
+
"delayed-stream": "^1.0.0",
|
|
68
|
+
"dunder-proto": "^1.0.1",
|
|
69
|
+
"emoji-regex": "^8.0.0",
|
|
70
|
+
"es-define-property": "^1.0.1",
|
|
71
|
+
"es-errors": "^1.3.0",
|
|
72
|
+
"es-object-atoms": "^1.1.1",
|
|
73
|
+
"es-set-tostringtag": "^2.1.0",
|
|
74
|
+
"escalade": "^3.2.0",
|
|
75
|
+
"eslint-config-riot": "^1.0.0",
|
|
76
|
+
"esprima": "^4.0.1",
|
|
77
|
+
"esprima-next": "^5.8.4",
|
|
78
|
+
"for-each": "^0.3.5",
|
|
79
|
+
"form-data": "^4.0.4",
|
|
80
|
+
"fs.realpath": "^1.0.0",
|
|
81
|
+
"function-bind": "^1.1.2",
|
|
82
|
+
"generator-function": "^2.0.1",
|
|
83
|
+
"get-caller-file": "^2.0.5",
|
|
84
|
+
"get-intrinsic": "^1.3.0",
|
|
85
|
+
"get-proto": "^1.0.1",
|
|
86
|
+
"glob": "^7.2.3",
|
|
87
|
+
"gopd": "^1.2.0",
|
|
88
|
+
"has-property-descriptors": "^1.0.2",
|
|
89
|
+
"has-symbols": "^1.1.0",
|
|
90
|
+
"has-tostringtag": "^1.0.2",
|
|
91
|
+
"hasown": "^2.0.3",
|
|
92
|
+
"inflight": "^1.0.6",
|
|
93
|
+
"inherits": "^2.0.4",
|
|
94
|
+
"is-arguments": "^1.2.0",
|
|
95
|
+
"is-buffer": "^1.1.6",
|
|
96
|
+
"is-callable": "^1.2.7",
|
|
97
|
+
"is-fullwidth-code-point": "^3.0.0",
|
|
98
|
+
"is-generator-function": "^1.1.2",
|
|
99
|
+
"is-nan": "^1.3.2",
|
|
100
|
+
"is-regex": "^1.2.1",
|
|
101
|
+
"is-typed-array": "^1.1.15",
|
|
102
|
+
"isarray": "^0.0.1",
|
|
103
|
+
"isolated-vm": "^6.1.2",
|
|
104
|
+
"jmespath": "^0.16.0",
|
|
105
|
+
"js-base64": "^3.7.2",
|
|
106
|
+
"jsonrepair": "^3.13.2",
|
|
107
|
+
"jssha": "^3.3.1",
|
|
108
|
+
"lodash": "^4.17.23",
|
|
109
|
+
"luxon": "^3.7.2",
|
|
110
|
+
"math-intrinsics": "^1.1.0",
|
|
111
|
+
"md5": "^2.3.0",
|
|
112
|
+
"mime-db": "^1.52.0",
|
|
113
|
+
"mime-types": "^2.1.35",
|
|
114
|
+
"minimatch": "^3.1.5",
|
|
115
|
+
"mkdirp": "^1.0.4",
|
|
116
|
+
"node-gyp-build": "^4.8.4",
|
|
117
|
+
"noms": "^0.0.0",
|
|
118
|
+
"object-is": "^1.1.6",
|
|
119
|
+
"object-keys": "^1.1.1",
|
|
120
|
+
"object.assign": "^4.1.7",
|
|
121
|
+
"once": "^1.4.0",
|
|
122
|
+
"path-is-absolute": "^1.0.1",
|
|
123
|
+
"possible-typed-array-names": "^1.1.0",
|
|
124
|
+
"process-nextick-args": "^2.0.1",
|
|
125
|
+
"readable-stream": "^1.0.34",
|
|
126
|
+
"recast": "^0.22.0",
|
|
127
|
+
"require-directory": "^2.1.1",
|
|
128
|
+
"safe-buffer": "^5.1.2",
|
|
129
|
+
"safe-regex-test": "^1.1.0",
|
|
130
|
+
"sax": "^1.6.0",
|
|
131
|
+
"set-function-length": "^1.2.2",
|
|
132
|
+
"source-map": "^0.6.1",
|
|
133
|
+
"string-width": "^4.2.3",
|
|
134
|
+
"string_decoder": "^0.10.31",
|
|
135
|
+
"strip-ansi": "^6.0.1",
|
|
136
|
+
"through2": "^2.0.5",
|
|
137
|
+
"title-case": "^3.0.3",
|
|
138
|
+
"transliteration": "^2.3.5",
|
|
139
|
+
"tslib": "^2.8.1",
|
|
140
|
+
"undici-types": "^5.26.5",
|
|
141
|
+
"untildify": "^4.0.0",
|
|
142
|
+
"util": "^0.12.5",
|
|
143
|
+
"util-deprecate": "^1.0.2",
|
|
144
|
+
"uuid": "^10.0.0",
|
|
145
|
+
"which-typed-array": "^1.1.20",
|
|
146
|
+
"wrap-ansi": "^7.0.0",
|
|
147
|
+
"wrappy": "^1.0.2",
|
|
148
|
+
"xml2js": "^0.6.2",
|
|
149
|
+
"xmlbuilder": "^11.0.1",
|
|
150
|
+
"xtend": "^4.0.2",
|
|
151
|
+
"y18n": "^5.0.8",
|
|
152
|
+
"yargs": "^16.2.0",
|
|
153
|
+
"yargs-parser": "^20.2.9",
|
|
154
|
+
"zod": "^3.25.67"
|
|
155
|
+
},
|
|
156
|
+
"type": "commonjs",
|
|
157
|
+
"bugs": {
|
|
158
|
+
"url": "https://github.com/syncx/n8n-nodes-syncx/issues"
|
|
159
|
+
},
|
|
160
|
+
"homepage": "https://github.com/syncx/n8n-nodes-syncx#readme"
|
|
161
|
+
}
|