n8n-nodes-coresignal-api 1.0.2 → 1.1.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/nodes/Coresignal/Coresignal.node.js +100 -100
- package/package.json +4 -4
|
@@ -10,7 +10,7 @@ class Coresignal {
|
|
|
10
10
|
icon: 'file:logo.svg',
|
|
11
11
|
group: ['transform'],
|
|
12
12
|
version: 1,
|
|
13
|
-
subtitle: '={{$parameter["
|
|
13
|
+
subtitle: '={{$parameter["operation"] + " - " + $parameter["resource"]}}',
|
|
14
14
|
description: 'Interact with Coresignal API for company, employee, job, and post data',
|
|
15
15
|
documentationUrl: 'https://docs.coresignal.com/?utm_source=n8n&utm_medium=referral',
|
|
16
16
|
defaults: {
|
|
@@ -25,162 +25,162 @@ class Coresignal {
|
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
27
|
properties: [
|
|
28
|
-
//
|
|
28
|
+
// Resource Selection
|
|
29
29
|
{
|
|
30
|
-
displayName: '
|
|
31
|
-
name: '
|
|
30
|
+
displayName: 'Resource',
|
|
31
|
+
name: 'resource',
|
|
32
32
|
type: 'options',
|
|
33
33
|
noDataExpression: true,
|
|
34
34
|
options: [
|
|
35
35
|
{
|
|
36
|
-
name: 'Employee
|
|
36
|
+
name: 'Employee',
|
|
37
37
|
value: 'employee',
|
|
38
38
|
description: 'Access employee data and profiles',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
name: 'Company
|
|
41
|
+
name: 'Company',
|
|
42
42
|
value: 'company',
|
|
43
43
|
description: 'Access company data and profiles',
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
name: 'Job
|
|
46
|
+
name: 'Job',
|
|
47
47
|
value: 'job',
|
|
48
48
|
description: 'Access jobs data',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
name: 'Employee
|
|
51
|
+
name: 'Employee Post',
|
|
52
52
|
value: 'post',
|
|
53
53
|
description: 'Access employee posts data',
|
|
54
54
|
},
|
|
55
55
|
],
|
|
56
56
|
default: 'employee',
|
|
57
57
|
},
|
|
58
|
-
// ============
|
|
59
|
-
//
|
|
58
|
+
// ============ OPERATION SELECTIONS ============
|
|
59
|
+
// Operation - Company
|
|
60
60
|
{
|
|
61
|
-
displayName: '
|
|
62
|
-
name: '
|
|
61
|
+
displayName: 'Operation',
|
|
62
|
+
name: 'operation',
|
|
63
63
|
type: 'options',
|
|
64
64
|
noDataExpression: true,
|
|
65
65
|
displayOptions: {
|
|
66
66
|
show: {
|
|
67
|
-
|
|
67
|
+
resource: ['company'],
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
options: [
|
|
71
71
|
{
|
|
72
|
-
name: '
|
|
73
|
-
value: '
|
|
72
|
+
name: 'Get by ID',
|
|
73
|
+
value: 'get_by_id',
|
|
74
74
|
description: 'Retrieve a full company profile using a company ID',
|
|
75
|
-
action: '
|
|
75
|
+
action: 'Get company by ID',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
name: '
|
|
79
|
-
value: '
|
|
78
|
+
name: 'Get by Slug',
|
|
79
|
+
value: 'get_by_slug',
|
|
80
80
|
description: 'Retrieve a full company profile using a URL slug',
|
|
81
|
-
action: '
|
|
81
|
+
action: 'Get company by URL slug',
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: 'Enrich by Website',
|
|
85
85
|
value: 'enrich',
|
|
86
86
|
description: 'Enrich company data using a website URL',
|
|
87
|
-
action: 'Enrich company
|
|
87
|
+
action: 'Enrich company by website URL',
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
name: 'Search with Elasticsearch DSL',
|
|
91
91
|
value: 'search_es_dsl',
|
|
92
92
|
description: 'Search companies using an Elasticsearch DSL query',
|
|
93
|
-
action: 'Search companies using
|
|
93
|
+
action: 'Search companies using elasticsearch DSL',
|
|
94
94
|
},
|
|
95
95
|
],
|
|
96
|
-
default: '
|
|
96
|
+
default: 'get_by_id',
|
|
97
97
|
},
|
|
98
|
-
//
|
|
98
|
+
// Operation - Employee
|
|
99
99
|
{
|
|
100
|
-
displayName: '
|
|
101
|
-
name: '
|
|
100
|
+
displayName: 'Operation',
|
|
101
|
+
name: 'operation',
|
|
102
102
|
type: 'options',
|
|
103
103
|
noDataExpression: true,
|
|
104
104
|
displayOptions: {
|
|
105
105
|
show: {
|
|
106
|
-
|
|
106
|
+
resource: ['employee'],
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
options: [
|
|
110
110
|
{
|
|
111
|
-
name: '
|
|
112
|
-
value: '
|
|
111
|
+
name: 'Get by ID',
|
|
112
|
+
value: 'get_by_id',
|
|
113
113
|
description: 'Retrieve a full employee profile using an employee ID',
|
|
114
|
-
action: '
|
|
114
|
+
action: 'Get employee by ID',
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
name: '
|
|
118
|
-
value: '
|
|
117
|
+
name: 'Get by Slug',
|
|
118
|
+
value: 'get_by_slug',
|
|
119
119
|
description: 'Retrieve a full employee profile using a URL slug',
|
|
120
|
-
action: '
|
|
120
|
+
action: 'Get employee by URL slug',
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
name: 'Search with Elasticsearch DSL',
|
|
124
124
|
value: 'search_es_dsl',
|
|
125
125
|
description: 'Search employees using an Elasticsearch DSL query',
|
|
126
|
-
action: 'Search employees using
|
|
126
|
+
action: 'Search employees using elasticsearch DSL',
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
|
-
default: '
|
|
129
|
+
default: 'get_by_id',
|
|
130
130
|
},
|
|
131
|
-
//
|
|
131
|
+
// Operation - Jobs
|
|
132
132
|
{
|
|
133
|
-
displayName: '
|
|
134
|
-
name: '
|
|
133
|
+
displayName: 'Operation',
|
|
134
|
+
name: 'operation',
|
|
135
135
|
type: 'options',
|
|
136
136
|
noDataExpression: true,
|
|
137
137
|
displayOptions: {
|
|
138
138
|
show: {
|
|
139
|
-
|
|
139
|
+
resource: ['job'],
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
142
|
options: [
|
|
143
143
|
{
|
|
144
|
-
name: '
|
|
145
|
-
value: '
|
|
144
|
+
name: 'Get by ID',
|
|
145
|
+
value: 'get_by_id',
|
|
146
146
|
description: 'Retrieve a full job posting using a job ID',
|
|
147
|
-
action: '
|
|
147
|
+
action: 'Get job by ID',
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
name: 'Search with Elasticsearch DSL',
|
|
151
151
|
value: 'search_es_dsl',
|
|
152
152
|
description: 'Search jobs using an Elasticsearch DSL query',
|
|
153
|
-
action: 'Search jobs using
|
|
153
|
+
action: 'Search jobs using elasticsearch DSL',
|
|
154
154
|
},
|
|
155
155
|
],
|
|
156
|
-
default: '
|
|
156
|
+
default: 'get_by_id',
|
|
157
157
|
},
|
|
158
|
-
//
|
|
158
|
+
// Operation - Posts
|
|
159
159
|
{
|
|
160
|
-
displayName: '
|
|
161
|
-
name: '
|
|
160
|
+
displayName: 'Operation',
|
|
161
|
+
name: 'operation',
|
|
162
162
|
type: 'options',
|
|
163
163
|
noDataExpression: true,
|
|
164
164
|
displayOptions: {
|
|
165
165
|
show: {
|
|
166
|
-
|
|
166
|
+
resource: ['post'],
|
|
167
167
|
},
|
|
168
168
|
},
|
|
169
169
|
options: [
|
|
170
170
|
{
|
|
171
|
-
name: '
|
|
172
|
-
value: '
|
|
171
|
+
name: 'Get by ID',
|
|
172
|
+
value: 'get_by_id',
|
|
173
173
|
description: 'Retrieve a full employee post using a post ID',
|
|
174
|
-
action: '
|
|
174
|
+
action: 'Get employee post by ID',
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
name: 'Search with Elasticsearch DSL',
|
|
178
178
|
value: 'search_es_dsl',
|
|
179
179
|
description: 'Search employee posts using an Elasticsearch DSL query',
|
|
180
|
-
action: 'Search employee posts using
|
|
180
|
+
action: 'Search employee posts using elasticsearch DSL',
|
|
181
181
|
},
|
|
182
182
|
],
|
|
183
|
-
default: '
|
|
183
|
+
default: 'get_by_id',
|
|
184
184
|
},
|
|
185
185
|
// ============ INPUT DATA ============
|
|
186
186
|
// ID Parameter - Company
|
|
@@ -191,8 +191,8 @@ class Coresignal {
|
|
|
191
191
|
required: true,
|
|
192
192
|
displayOptions: {
|
|
193
193
|
show: {
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
resource: ['company'],
|
|
195
|
+
operation: ['get_by_id'],
|
|
196
196
|
},
|
|
197
197
|
},
|
|
198
198
|
default: '',
|
|
@@ -206,8 +206,8 @@ class Coresignal {
|
|
|
206
206
|
required: true,
|
|
207
207
|
displayOptions: {
|
|
208
208
|
show: {
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
resource: ['employee'],
|
|
210
|
+
operation: ['get_by_id'],
|
|
211
211
|
},
|
|
212
212
|
},
|
|
213
213
|
default: '',
|
|
@@ -221,8 +221,8 @@ class Coresignal {
|
|
|
221
221
|
required: true,
|
|
222
222
|
displayOptions: {
|
|
223
223
|
show: {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
resource: ['job'],
|
|
225
|
+
operation: ['get_by_id'],
|
|
226
226
|
},
|
|
227
227
|
},
|
|
228
228
|
default: '',
|
|
@@ -236,8 +236,8 @@ class Coresignal {
|
|
|
236
236
|
required: true,
|
|
237
237
|
displayOptions: {
|
|
238
238
|
show: {
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
resource: ['post'],
|
|
240
|
+
operation: ['get_by_id'],
|
|
241
241
|
},
|
|
242
242
|
},
|
|
243
243
|
default: '',
|
|
@@ -251,12 +251,12 @@ class Coresignal {
|
|
|
251
251
|
required: true,
|
|
252
252
|
displayOptions: {
|
|
253
253
|
show: {
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
resource: ['employee'],
|
|
255
|
+
operation: ['get_by_slug'],
|
|
256
256
|
},
|
|
257
257
|
},
|
|
258
258
|
default: '',
|
|
259
|
-
placeholder: 'e.g
|
|
259
|
+
placeholder: 'e.g. john-smith',
|
|
260
260
|
description: 'The slug to retrieve data for',
|
|
261
261
|
},
|
|
262
262
|
// Shorthand Name Parameter - Company
|
|
@@ -267,12 +267,12 @@ class Coresignal {
|
|
|
267
267
|
required: true,
|
|
268
268
|
displayOptions: {
|
|
269
269
|
show: {
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
resource: ['company'],
|
|
271
|
+
operation: ['get_by_slug'],
|
|
272
272
|
},
|
|
273
273
|
},
|
|
274
274
|
default: '',
|
|
275
|
-
placeholder: 'e.g
|
|
275
|
+
placeholder: 'e.g. microsoft',
|
|
276
276
|
description: 'The slug to retrieve data for',
|
|
277
277
|
},
|
|
278
278
|
// Website Parameter - Enrich
|
|
@@ -283,12 +283,12 @@ class Coresignal {
|
|
|
283
283
|
required: true,
|
|
284
284
|
displayOptions: {
|
|
285
285
|
show: {
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
resource: ['company'],
|
|
287
|
+
operation: ['enrich'],
|
|
288
288
|
},
|
|
289
289
|
},
|
|
290
290
|
default: '',
|
|
291
|
-
placeholder: 'e.g
|
|
291
|
+
placeholder: 'e.g. https://example.com',
|
|
292
292
|
description: 'The company website URL to enrich data for',
|
|
293
293
|
},
|
|
294
294
|
// Fields Parameter - Employee
|
|
@@ -298,13 +298,13 @@ class Coresignal {
|
|
|
298
298
|
type: 'string',
|
|
299
299
|
displayOptions: {
|
|
300
300
|
show: {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
resource: ['employee'],
|
|
302
|
+
operation: ['get_by_id', 'get_by_slug'],
|
|
303
303
|
},
|
|
304
304
|
},
|
|
305
305
|
default: '',
|
|
306
306
|
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
307
|
-
placeholder: 'e.g
|
|
307
|
+
placeholder: 'e.g. id,full_name,headline',
|
|
308
308
|
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
309
309
|
},
|
|
310
310
|
// Fields Parameter - Company
|
|
@@ -314,13 +314,13 @@ class Coresignal {
|
|
|
314
314
|
type: 'string',
|
|
315
315
|
displayOptions: {
|
|
316
316
|
show: {
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
resource: ['company'],
|
|
318
|
+
operation: ['get_by_id', 'get_by_slug', 'enrich'],
|
|
319
319
|
},
|
|
320
320
|
},
|
|
321
321
|
default: '',
|
|
322
322
|
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
323
|
-
placeholder: 'e.g
|
|
323
|
+
placeholder: 'e.g. id,company_name,website',
|
|
324
324
|
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
325
325
|
},
|
|
326
326
|
// Fields Parameter - Jobs
|
|
@@ -330,13 +330,13 @@ class Coresignal {
|
|
|
330
330
|
type: 'string',
|
|
331
331
|
displayOptions: {
|
|
332
332
|
show: {
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
resource: ['job'],
|
|
334
|
+
operation: ['get_by_id'],
|
|
335
335
|
},
|
|
336
336
|
},
|
|
337
337
|
default: '',
|
|
338
338
|
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
339
|
-
placeholder: 'e.g
|
|
339
|
+
placeholder: 'e.g. id,title,company_name',
|
|
340
340
|
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
341
341
|
},
|
|
342
342
|
// Fields Parameter - Posts
|
|
@@ -346,13 +346,13 @@ class Coresignal {
|
|
|
346
346
|
type: 'string',
|
|
347
347
|
displayOptions: {
|
|
348
348
|
show: {
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
resource: ['post'],
|
|
350
|
+
operation: ['get_by_id'],
|
|
351
351
|
},
|
|
352
352
|
},
|
|
353
353
|
default: '',
|
|
354
354
|
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
355
|
-
placeholder: 'e.g
|
|
355
|
+
placeholder: 'e.g. id,url,author_name',
|
|
356
356
|
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
357
357
|
},
|
|
358
358
|
// Elasticsearch DSL Query - Employee
|
|
@@ -363,8 +363,8 @@ class Coresignal {
|
|
|
363
363
|
required: true,
|
|
364
364
|
displayOptions: {
|
|
365
365
|
show: {
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
resource: ['employee'],
|
|
367
|
+
operation: ['search_es_dsl'],
|
|
368
368
|
},
|
|
369
369
|
},
|
|
370
370
|
default: '{"query": {"match_all": {}}}',
|
|
@@ -379,8 +379,8 @@ class Coresignal {
|
|
|
379
379
|
required: true,
|
|
380
380
|
displayOptions: {
|
|
381
381
|
show: {
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
resource: ['company'],
|
|
383
|
+
operation: ['search_es_dsl'],
|
|
384
384
|
},
|
|
385
385
|
},
|
|
386
386
|
default: '{"query": {"match_all": {}}}',
|
|
@@ -395,8 +395,8 @@ class Coresignal {
|
|
|
395
395
|
required: true,
|
|
396
396
|
displayOptions: {
|
|
397
397
|
show: {
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
resource: ['job'],
|
|
399
|
+
operation: ['search_es_dsl'],
|
|
400
400
|
},
|
|
401
401
|
},
|
|
402
402
|
default: '{"query": {"match_all": {}}}',
|
|
@@ -411,8 +411,8 @@ class Coresignal {
|
|
|
411
411
|
required: true,
|
|
412
412
|
displayOptions: {
|
|
413
413
|
show: {
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
resource: ['post'],
|
|
415
|
+
operation: ['search_es_dsl'],
|
|
416
416
|
},
|
|
417
417
|
},
|
|
418
418
|
default: '{"query": {"match_all": {}}}',
|
|
@@ -426,8 +426,8 @@ class Coresignal {
|
|
|
426
426
|
default: false,
|
|
427
427
|
displayOptions: {
|
|
428
428
|
show: {
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
resource: ['employee', 'company', 'job'],
|
|
430
|
+
operation: ['search_es_dsl'],
|
|
431
431
|
},
|
|
432
432
|
},
|
|
433
433
|
description: 'Whether to use preview endpoint (returns up to 20 results with essential data)',
|
|
@@ -442,27 +442,27 @@ class Coresignal {
|
|
|
442
442
|
const returnData = [];
|
|
443
443
|
for (let i = 0; i < items.length; i++) {
|
|
444
444
|
try {
|
|
445
|
-
const
|
|
445
|
+
const resource = this.getNodeParameter('resource', i);
|
|
446
446
|
const dataset = 'multi_source'; // Always use multi_source
|
|
447
|
-
const
|
|
447
|
+
const operation = this.getNodeParameter('operation', i);
|
|
448
448
|
let url = '';
|
|
449
449
|
let httpMethod = 'GET';
|
|
450
450
|
let body;
|
|
451
451
|
const qs = {};
|
|
452
452
|
// Build the data source string (e.g., "company_multi_source", "employee_multi_source")
|
|
453
453
|
// Posts use a different endpoint structure
|
|
454
|
-
const dataSource =
|
|
454
|
+
const dataSource = resource === 'post' ? 'employee_post' : `${resource}_${dataset}`;
|
|
455
455
|
const baseEndpoint = `/cdapi/v2/${dataSource}`;
|
|
456
|
-
switch (
|
|
457
|
-
case '
|
|
456
|
+
switch (operation) {
|
|
457
|
+
case 'get_by_id': {
|
|
458
458
|
let id;
|
|
459
|
-
if (
|
|
459
|
+
if (resource === 'company') {
|
|
460
460
|
id = this.getNodeParameter('companyId', i);
|
|
461
461
|
}
|
|
462
|
-
else if (
|
|
462
|
+
else if (resource === 'employee') {
|
|
463
463
|
id = this.getNodeParameter('employeeId', i);
|
|
464
464
|
}
|
|
465
|
-
else if (
|
|
465
|
+
else if (resource === 'job') {
|
|
466
466
|
id = this.getNodeParameter('jobId', i);
|
|
467
467
|
}
|
|
468
468
|
else {
|
|
@@ -476,7 +476,7 @@ class Coresignal {
|
|
|
476
476
|
}
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
|
-
case '
|
|
479
|
+
case 'get_by_slug': {
|
|
480
480
|
const slug = this.getNodeParameter('slug', i);
|
|
481
481
|
url = `${baseEndpoint}/collect/${encodeURIComponent(slug)}`;
|
|
482
482
|
httpMethod = 'GET';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-coresignal-api",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "n8n community node for Coresignal API - access company, employee, job, and post data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@n8n/node-cli": "
|
|
41
|
+
"@n8n/node-cli": "0.23.0",
|
|
42
42
|
"eslint": "9.32.0",
|
|
43
|
-
"prettier": "3.
|
|
44
|
-
"typescript": "5.9.
|
|
43
|
+
"prettier": "3.8.1",
|
|
44
|
+
"typescript": "5.9.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"n8n-workflow": "*"
|