n8n-nodes-coresignal-api 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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/credentials/CoresignalApi.credentials.d.ts +13 -0
- package/dist/credentials/CoresignalApi.credentials.js +45 -0
- package/dist/nodes/Coresignal/Coresignal.node.d.ts +5 -0
- package/dist/nodes/Coresignal/Coresignal.node.js +573 -0
- package/dist/nodes/Coresignal/logo.svg +6 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Coresignal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# n8n-nodes-coresignal-api
|
|
2
|
+
|
|
3
|
+
This is an [n8n](https://n8n.io/) community node for the [Coresignal API](https://coresignal.com/). It provides access to company, employee, job posting, and employee post data from Coresignal's multi-source datasets.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
6
|
+
|
|
7
|
+
[Installation](#installation)
|
|
8
|
+
[Operations](#operations)
|
|
9
|
+
[Credentials](#credentials)
|
|
10
|
+
[Usage](#usage)
|
|
11
|
+
[Resources](#resources)
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
16
|
+
|
|
17
|
+
## Operations
|
|
18
|
+
|
|
19
|
+
### Company Data
|
|
20
|
+
|
|
21
|
+
- **Collect by ID** - Retrieve a full company profile using a company ID
|
|
22
|
+
- **Collect by slug** - Retrieve a full company profile using a URL slug
|
|
23
|
+
- **Enrich by website** - Enrich company data using a website URL
|
|
24
|
+
- **Search with Elasticsearch DSL** - Search companies using an Elasticsearch DSL query
|
|
25
|
+
|
|
26
|
+
### Employee Data
|
|
27
|
+
|
|
28
|
+
- **Collect by ID** - Retrieve a full employee profile using an employee ID
|
|
29
|
+
- **Collect by slug** - Retrieve a full employee profile using a URL slug
|
|
30
|
+
- **Search with Elasticsearch DSL** - Search employees using an Elasticsearch DSL query
|
|
31
|
+
|
|
32
|
+
### Job Data
|
|
33
|
+
|
|
34
|
+
- **Collect by ID** - Retrieve a full job posting using a job ID
|
|
35
|
+
- **Search with Elasticsearch DSL** - Search jobs using an Elasticsearch DSL query
|
|
36
|
+
|
|
37
|
+
### Employee Posts
|
|
38
|
+
|
|
39
|
+
- **Collect by ID** - Retrieve a full employee post using a post ID
|
|
40
|
+
- **Search with Elasticsearch DSL** - Search employee posts using an Elasticsearch DSL query
|
|
41
|
+
|
|
42
|
+
## Credentials
|
|
43
|
+
|
|
44
|
+
To use this node, you need a Coresignal API key.
|
|
45
|
+
|
|
46
|
+
1. Sign up at [Coresignal](https://coresignal.com/) and obtain an API key
|
|
47
|
+
2. In n8n, go to **Credentials** > **Add Credential** > **Coresignal API**
|
|
48
|
+
3. Enter your API key
|
|
49
|
+
4. The default Base URL is `https://api.coresignal.com` (change only if instructed by Coresignal)
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
### Collect by ID
|
|
54
|
+
|
|
55
|
+
Select a category (Company, Employee, Job, or Post), choose "Collect by ID", and enter the entity ID. Optionally specify fields to return only specific data.
|
|
56
|
+
|
|
57
|
+
### Collect by slug
|
|
58
|
+
|
|
59
|
+
Available for Company and Employee categories. Enter the URL slug (e.g., `microsoft` for a company or `john-smith` for an employee).
|
|
60
|
+
|
|
61
|
+
### Enrich by website
|
|
62
|
+
|
|
63
|
+
Available for the Company category. Enter a company website URL to enrich with Coresignal data.
|
|
64
|
+
|
|
65
|
+
### Search with Elasticsearch DSL
|
|
66
|
+
|
|
67
|
+
Use an Elasticsearch DSL query to search across any category. Enable **Preview mode** for quick testing (returns up to 20 results with essential fields only).
|
|
68
|
+
|
|
69
|
+
Build your queries using the Coresignal Playground:
|
|
70
|
+
- [Employee Playground](https://dashboard.coresignal.com/apis/employees/playground)
|
|
71
|
+
- [Company Playground](https://dashboard.coresignal.com/apis/company/playground)
|
|
72
|
+
- [Jobs Playground](https://dashboard.coresignal.com/apis/jobs/playground)
|
|
73
|
+
|
|
74
|
+
## Resources
|
|
75
|
+
|
|
76
|
+
- [Coresignal API Documentation](https://docs.coresignal.com/)
|
|
77
|
+
- [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CoresignalApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: {
|
|
6
|
+
readonly light: "file:../nodes/Coresignal/logo.svg";
|
|
7
|
+
readonly dark: "file:../nodes/Coresignal/logo.svg";
|
|
8
|
+
};
|
|
9
|
+
documentationUrl: string;
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
test: ICredentialTestRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoresignalApi = void 0;
|
|
4
|
+
class CoresignalApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'coresignalApi';
|
|
7
|
+
this.displayName = 'Coresignal API';
|
|
8
|
+
this.icon = { light: 'file:../nodes/Coresignal/logo.svg', dark: 'file:../nodes/Coresignal/logo.svg' };
|
|
9
|
+
this.documentationUrl = 'https://docs.coresignal.com/';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Key',
|
|
13
|
+
name: 'apiKey',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Your Coresignal API key',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Base URL',
|
|
22
|
+
name: 'baseUrl',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: 'https://api.coresignal.com',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'Base URL for Coresignal API',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: {
|
|
32
|
+
headers: {
|
|
33
|
+
'apikey': '={{$credentials.apiKey}}',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
this.test = {
|
|
38
|
+
request: {
|
|
39
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
40
|
+
url: '/cdapi/v2/company_base/collect/2',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.CoresignalApi = CoresignalApi;
|
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Coresignal = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class Coresignal {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Coresignal',
|
|
9
|
+
name: 'coresignal',
|
|
10
|
+
icon: 'file:logo.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["action"] + " - " + $parameter["category"] + " (" + $parameter["dataset"] + ")"}}',
|
|
14
|
+
description: 'Interact with Coresignal API for company, employee, job, and post data',
|
|
15
|
+
documentationUrl: 'https://docs.coresignal.com/?utm_source=n8n&utm_medium=referral',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'Coresignal',
|
|
18
|
+
},
|
|
19
|
+
inputs: ['main'],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'coresignalApi',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
properties: [
|
|
28
|
+
// Category Selection
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Category',
|
|
31
|
+
name: 'category',
|
|
32
|
+
type: 'options',
|
|
33
|
+
noDataExpression: true,
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
37
|
+
name: 'employee data',
|
|
38
|
+
value: 'employee',
|
|
39
|
+
description: 'Access employee data and profiles',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
43
|
+
name: 'company data',
|
|
44
|
+
value: 'company',
|
|
45
|
+
description: 'Access company data and profiles',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
49
|
+
name: 'job data',
|
|
50
|
+
value: 'job',
|
|
51
|
+
description: 'Access jobs data',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
55
|
+
name: 'employee posts',
|
|
56
|
+
value: 'post',
|
|
57
|
+
description: 'Access employee posts data',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
default: 'employee',
|
|
61
|
+
},
|
|
62
|
+
// ============ METHOD SELECTIONS ============
|
|
63
|
+
// Method - Company
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Action',
|
|
66
|
+
name: 'action',
|
|
67
|
+
type: 'options',
|
|
68
|
+
noDataExpression: true,
|
|
69
|
+
displayOptions: {
|
|
70
|
+
show: {
|
|
71
|
+
category: ['company'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
options: [
|
|
75
|
+
{
|
|
76
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
77
|
+
name: 'collect by ID',
|
|
78
|
+
value: 'collect_by_id',
|
|
79
|
+
description: 'Retrieve a full company profile using a company ID',
|
|
80
|
+
action: 'Retrieve a full company profile using a company ID',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
84
|
+
name: 'collect by slug',
|
|
85
|
+
value: 'collect_by_slug',
|
|
86
|
+
description: 'Retrieve a full company profile using a URL slug',
|
|
87
|
+
action: 'Retrieve a full company profile using a URL slug',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
91
|
+
name: 'enrich by website',
|
|
92
|
+
value: 'enrich',
|
|
93
|
+
description: 'Enrich company data using a website URL',
|
|
94
|
+
action: 'Enrich company data using a website URL',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
98
|
+
name: 'search with Elasticsearch DSL',
|
|
99
|
+
value: 'search_es_dsl',
|
|
100
|
+
description: 'Search companies using an Elasticsearch DSL query',
|
|
101
|
+
action: 'Search companies using an elasticsearch dsl query',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
default: 'collect_by_id',
|
|
105
|
+
},
|
|
106
|
+
// Method - Employee
|
|
107
|
+
{
|
|
108
|
+
displayName: 'Action',
|
|
109
|
+
name: 'action',
|
|
110
|
+
type: 'options',
|
|
111
|
+
noDataExpression: true,
|
|
112
|
+
displayOptions: {
|
|
113
|
+
show: {
|
|
114
|
+
category: ['employee'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
options: [
|
|
118
|
+
{
|
|
119
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
120
|
+
name: 'collect by ID',
|
|
121
|
+
value: 'collect_by_id',
|
|
122
|
+
description: 'Retrieve a full employee profile using an employee ID',
|
|
123
|
+
action: 'Retrieve a full employee profile using an employee ID',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
127
|
+
name: 'collect by slug',
|
|
128
|
+
value: 'collect_by_slug',
|
|
129
|
+
description: 'Retrieve a full employee profile using a URL slug',
|
|
130
|
+
action: 'Retrieve a full employee profile using a URL slug',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
134
|
+
name: 'search with Elasticsearch DSL',
|
|
135
|
+
value: 'search_es_dsl',
|
|
136
|
+
description: 'Search employees using an Elasticsearch DSL query',
|
|
137
|
+
action: 'Search employees using an elasticsearch dsl query',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
default: 'collect_by_id',
|
|
141
|
+
},
|
|
142
|
+
// Method - Jobs
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Action',
|
|
145
|
+
name: 'action',
|
|
146
|
+
type: 'options',
|
|
147
|
+
noDataExpression: true,
|
|
148
|
+
displayOptions: {
|
|
149
|
+
show: {
|
|
150
|
+
category: ['job'],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
options: [
|
|
154
|
+
{
|
|
155
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
156
|
+
name: 'collect by ID',
|
|
157
|
+
value: 'collect_by_id',
|
|
158
|
+
description: 'Retrieve a full job posting using a job ID',
|
|
159
|
+
action: 'Retrieve a full job posting using a job ID',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
163
|
+
name: 'search with Elasticsearch DSL',
|
|
164
|
+
value: 'search_es_dsl',
|
|
165
|
+
description: 'Search jobs using an Elasticsearch DSL query',
|
|
166
|
+
action: 'Search jobs using an elasticsearch dsl query',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
default: 'collect_by_id',
|
|
170
|
+
},
|
|
171
|
+
// Method - Posts
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Action',
|
|
174
|
+
name: 'action',
|
|
175
|
+
type: 'options',
|
|
176
|
+
noDataExpression: true,
|
|
177
|
+
displayOptions: {
|
|
178
|
+
show: {
|
|
179
|
+
category: ['post'],
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
options: [
|
|
183
|
+
{
|
|
184
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
185
|
+
name: 'collect by ID',
|
|
186
|
+
value: 'collect_by_id',
|
|
187
|
+
description: 'Retrieve a full employee post using a post ID',
|
|
188
|
+
action: 'Retrieve a full employee post using a post ID',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
192
|
+
name: 'search with Elasticsearch DSL',
|
|
193
|
+
value: 'search_es_dsl',
|
|
194
|
+
description: 'Search employee posts using an Elasticsearch DSL query',
|
|
195
|
+
action: 'Search employee posts using an elasticsearch dsl query',
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
default: 'collect_by_id',
|
|
199
|
+
},
|
|
200
|
+
// ============ INPUT DATA ============
|
|
201
|
+
// ID Parameter - Company
|
|
202
|
+
{
|
|
203
|
+
displayName: 'Company ID',
|
|
204
|
+
name: 'companyId',
|
|
205
|
+
type: 'string',
|
|
206
|
+
required: true,
|
|
207
|
+
displayOptions: {
|
|
208
|
+
show: {
|
|
209
|
+
category: ['company'],
|
|
210
|
+
action: ['collect_by_id'],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
default: '',
|
|
214
|
+
description: 'The ID of the company to retrieve',
|
|
215
|
+
},
|
|
216
|
+
// ID Parameter - Employee
|
|
217
|
+
{
|
|
218
|
+
displayName: 'Employee ID',
|
|
219
|
+
name: 'employeeId',
|
|
220
|
+
type: 'string',
|
|
221
|
+
required: true,
|
|
222
|
+
displayOptions: {
|
|
223
|
+
show: {
|
|
224
|
+
category: ['employee'],
|
|
225
|
+
action: ['collect_by_id'],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
default: '',
|
|
229
|
+
description: 'The ID of the employee to retrieve',
|
|
230
|
+
},
|
|
231
|
+
// ID Parameter - Job
|
|
232
|
+
{
|
|
233
|
+
displayName: 'Job ID',
|
|
234
|
+
name: 'jobId',
|
|
235
|
+
type: 'string',
|
|
236
|
+
required: true,
|
|
237
|
+
displayOptions: {
|
|
238
|
+
show: {
|
|
239
|
+
category: ['job'],
|
|
240
|
+
action: ['collect_by_id'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
default: '',
|
|
244
|
+
description: 'The ID of the job posting to retrieve',
|
|
245
|
+
},
|
|
246
|
+
// ID Parameter - Post
|
|
247
|
+
{
|
|
248
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
249
|
+
displayName: 'Employee post ID',
|
|
250
|
+
name: 'postId',
|
|
251
|
+
type: 'string',
|
|
252
|
+
required: true,
|
|
253
|
+
displayOptions: {
|
|
254
|
+
show: {
|
|
255
|
+
category: ['post'],
|
|
256
|
+
action: ['collect_by_id'],
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
default: '',
|
|
260
|
+
description: 'The ID of the post to retrieve',
|
|
261
|
+
},
|
|
262
|
+
// Shorthand Name Parameter - Employee
|
|
263
|
+
{
|
|
264
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
265
|
+
displayName: 'URL slug',
|
|
266
|
+
name: 'slug',
|
|
267
|
+
type: 'string',
|
|
268
|
+
required: true,
|
|
269
|
+
displayOptions: {
|
|
270
|
+
show: {
|
|
271
|
+
category: ['employee'],
|
|
272
|
+
action: ['collect_by_slug'],
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
default: '',
|
|
276
|
+
placeholder: 'e.g., john-smith',
|
|
277
|
+
description: 'The slug to retrieve data for',
|
|
278
|
+
},
|
|
279
|
+
// Shorthand Name Parameter - Company
|
|
280
|
+
{
|
|
281
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
282
|
+
displayName: 'URL slug',
|
|
283
|
+
name: 'slug',
|
|
284
|
+
type: 'string',
|
|
285
|
+
required: true,
|
|
286
|
+
displayOptions: {
|
|
287
|
+
show: {
|
|
288
|
+
category: ['company'],
|
|
289
|
+
action: ['collect_by_slug'],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
default: '',
|
|
293
|
+
placeholder: 'e.g., microsoft',
|
|
294
|
+
description: 'The slug to retrieve data for',
|
|
295
|
+
},
|
|
296
|
+
// Website Parameter - Enrich
|
|
297
|
+
{
|
|
298
|
+
displayName: 'Website URL',
|
|
299
|
+
name: 'websiteUrl',
|
|
300
|
+
type: 'string',
|
|
301
|
+
required: true,
|
|
302
|
+
displayOptions: {
|
|
303
|
+
show: {
|
|
304
|
+
category: ['company'],
|
|
305
|
+
action: ['enrich'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
default: '',
|
|
309
|
+
placeholder: 'e.g., https://example.com',
|
|
310
|
+
description: 'The company website URL to enrich data for',
|
|
311
|
+
},
|
|
312
|
+
// Fields Parameter - Employee
|
|
313
|
+
{
|
|
314
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
315
|
+
displayName: 'Data fields (optional)',
|
|
316
|
+
name: 'fields',
|
|
317
|
+
type: 'string',
|
|
318
|
+
displayOptions: {
|
|
319
|
+
show: {
|
|
320
|
+
category: ['employee'],
|
|
321
|
+
action: ['collect_by_id', 'collect_by_slug'],
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
default: '',
|
|
325
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
326
|
+
placeholder: 'e.g., id,full_name,headline',
|
|
327
|
+
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
328
|
+
},
|
|
329
|
+
// Fields Parameter - Company
|
|
330
|
+
{
|
|
331
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
332
|
+
displayName: 'Data fields (optional)',
|
|
333
|
+
name: 'fields',
|
|
334
|
+
type: 'string',
|
|
335
|
+
displayOptions: {
|
|
336
|
+
show: {
|
|
337
|
+
category: ['company'],
|
|
338
|
+
action: ['collect_by_id', 'collect_by_slug', 'enrich'],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
default: '',
|
|
342
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
343
|
+
placeholder: 'e.g., id,company_name,website',
|
|
344
|
+
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
345
|
+
},
|
|
346
|
+
// Fields Parameter - Jobs
|
|
347
|
+
{
|
|
348
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
349
|
+
displayName: 'Data fields (optional)',
|
|
350
|
+
name: 'fields',
|
|
351
|
+
type: 'string',
|
|
352
|
+
displayOptions: {
|
|
353
|
+
show: {
|
|
354
|
+
category: ['job'],
|
|
355
|
+
action: ['collect_by_id'],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
default: '',
|
|
359
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
360
|
+
placeholder: 'e.g., id,title,company_name',
|
|
361
|
+
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
362
|
+
},
|
|
363
|
+
// Fields Parameter - Posts
|
|
364
|
+
{
|
|
365
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
366
|
+
displayName: 'Data fields (optional)',
|
|
367
|
+
name: 'fields',
|
|
368
|
+
type: 'string',
|
|
369
|
+
displayOptions: {
|
|
370
|
+
show: {
|
|
371
|
+
category: ['post'],
|
|
372
|
+
action: ['collect_by_id'],
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
default: '',
|
|
376
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id
|
|
377
|
+
placeholder: 'e.g., id,url,author_name',
|
|
378
|
+
description: 'Comma-separated list of fields to return (leave empty for all fields)',
|
|
379
|
+
},
|
|
380
|
+
// Elasticsearch DSL Query - Employee
|
|
381
|
+
{
|
|
382
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
383
|
+
displayName: 'Elasticsearch DSL query',
|
|
384
|
+
name: 'esQuery',
|
|
385
|
+
type: 'json',
|
|
386
|
+
required: true,
|
|
387
|
+
displayOptions: {
|
|
388
|
+
show: {
|
|
389
|
+
category: ['employee'],
|
|
390
|
+
action: ['search_es_dsl'],
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
default: '{"query": {"match_all": {}}}',
|
|
394
|
+
description: 'Elasticsearch DSL query object',
|
|
395
|
+
hint: 'Build your query using a <a href="https://dashboard.coresignal.com/apis/employees/playground" target="_blank">Playground</a>.',
|
|
396
|
+
},
|
|
397
|
+
// Elasticsearch DSL Query - Company
|
|
398
|
+
{
|
|
399
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
400
|
+
displayName: 'Elasticsearch DSL query',
|
|
401
|
+
name: 'esQuery',
|
|
402
|
+
type: 'json',
|
|
403
|
+
required: true,
|
|
404
|
+
displayOptions: {
|
|
405
|
+
show: {
|
|
406
|
+
category: ['company'],
|
|
407
|
+
action: ['search_es_dsl'],
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
default: '{"query": {"match_all": {}}}',
|
|
411
|
+
description: 'Elasticsearch DSL query object',
|
|
412
|
+
hint: 'Build your query using a <a href="https://dashboard.coresignal.com/apis/company/playground" target="_blank">Playground</a>.',
|
|
413
|
+
},
|
|
414
|
+
// Elasticsearch DSL Query - Job
|
|
415
|
+
{
|
|
416
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
417
|
+
displayName: 'Elasticsearch DSL query',
|
|
418
|
+
name: 'esQuery',
|
|
419
|
+
type: 'json',
|
|
420
|
+
required: true,
|
|
421
|
+
displayOptions: {
|
|
422
|
+
show: {
|
|
423
|
+
category: ['job'],
|
|
424
|
+
action: ['search_es_dsl'],
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
default: '{"query": {"match_all": {}}}',
|
|
428
|
+
description: 'Elasticsearch DSL query object',
|
|
429
|
+
hint: 'Build your query using a <a href="https://dashboard.coresignal.com/apis/jobs/playground" target="_blank">Playground</a>.',
|
|
430
|
+
},
|
|
431
|
+
// Elasticsearch DSL Query - Post
|
|
432
|
+
{
|
|
433
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
434
|
+
displayName: 'Elasticsearch DSL query',
|
|
435
|
+
name: 'esQuery',
|
|
436
|
+
type: 'json',
|
|
437
|
+
required: true,
|
|
438
|
+
displayOptions: {
|
|
439
|
+
show: {
|
|
440
|
+
category: ['post'],
|
|
441
|
+
action: ['search_es_dsl'],
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
default: '{"query": {"match_all": {}}}',
|
|
445
|
+
description: 'Elasticsearch DSL query object',
|
|
446
|
+
},
|
|
447
|
+
// Preview Mode (not available for posts)
|
|
448
|
+
{
|
|
449
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
450
|
+
displayName: 'Preview mode',
|
|
451
|
+
name: 'preview',
|
|
452
|
+
type: 'boolean',
|
|
453
|
+
default: false,
|
|
454
|
+
displayOptions: {
|
|
455
|
+
show: {
|
|
456
|
+
category: ['employee', 'company', 'job'],
|
|
457
|
+
action: ['search_es_dsl'],
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
description: 'Whether to use preview endpoint (returns up to 20 results with essential data)',
|
|
461
|
+
hint: 'Preview mode returns up to 20 results with essential fields only. Use it for quick testing.',
|
|
462
|
+
},
|
|
463
|
+
],
|
|
464
|
+
usableAsTool: true,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
async execute() {
|
|
468
|
+
const items = this.getInputData();
|
|
469
|
+
const returnData = [];
|
|
470
|
+
for (let i = 0; i < items.length; i++) {
|
|
471
|
+
try {
|
|
472
|
+
const category = this.getNodeParameter('category', i);
|
|
473
|
+
const dataset = 'multi_source'; // Always use multi_source
|
|
474
|
+
const action = this.getNodeParameter('action', i);
|
|
475
|
+
let url = '';
|
|
476
|
+
let httpMethod = 'GET';
|
|
477
|
+
let body;
|
|
478
|
+
const qs = {};
|
|
479
|
+
// Build the data source string (e.g., "company_multi_source", "employee_multi_source")
|
|
480
|
+
// Posts use a different endpoint structure
|
|
481
|
+
const dataSource = category === 'post' ? 'employee_post' : `${category}_${dataset}`;
|
|
482
|
+
const baseEndpoint = `/cdapi/v2/${dataSource}`;
|
|
483
|
+
switch (action) {
|
|
484
|
+
case 'collect_by_id': {
|
|
485
|
+
let id;
|
|
486
|
+
if (category === 'company') {
|
|
487
|
+
id = this.getNodeParameter('companyId', i);
|
|
488
|
+
}
|
|
489
|
+
else if (category === 'employee') {
|
|
490
|
+
id = this.getNodeParameter('employeeId', i);
|
|
491
|
+
}
|
|
492
|
+
else if (category === 'job') {
|
|
493
|
+
id = this.getNodeParameter('jobId', i);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
id = this.getNodeParameter('postId', i);
|
|
497
|
+
}
|
|
498
|
+
url = `${baseEndpoint}/collect/${id}`;
|
|
499
|
+
httpMethod = 'GET';
|
|
500
|
+
const fields = this.getNodeParameter('fields', i, '');
|
|
501
|
+
if (fields) {
|
|
502
|
+
qs.fields = fields.split(',').map(f => f.trim());
|
|
503
|
+
}
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
case 'collect_by_slug': {
|
|
507
|
+
const slug = this.getNodeParameter('slug', i);
|
|
508
|
+
url = `${baseEndpoint}/collect/${encodeURIComponent(slug)}`;
|
|
509
|
+
httpMethod = 'GET';
|
|
510
|
+
const fields = this.getNodeParameter('fields', i, '');
|
|
511
|
+
if (fields) {
|
|
512
|
+
qs.fields = fields.split(',').map(f => f.trim());
|
|
513
|
+
}
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
case 'enrich': {
|
|
517
|
+
const websiteUrl = this.getNodeParameter('websiteUrl', i);
|
|
518
|
+
url = `${baseEndpoint}/enrich`;
|
|
519
|
+
httpMethod = 'GET';
|
|
520
|
+
qs.website = websiteUrl;
|
|
521
|
+
const fields = this.getNodeParameter('fields', i, '');
|
|
522
|
+
if (fields) {
|
|
523
|
+
qs.fields = fields.split(',').map(f => f.trim());
|
|
524
|
+
}
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
case 'search_es_dsl': {
|
|
528
|
+
const preview = this.getNodeParameter('preview', i, false);
|
|
529
|
+
url = preview
|
|
530
|
+
? `${baseEndpoint}/search/es_dsl/preview`
|
|
531
|
+
: `${baseEndpoint}/search/es_dsl`;
|
|
532
|
+
httpMethod = 'POST';
|
|
533
|
+
body = this.getNodeParameter('esQuery', i);
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
// Get credentials to access baseUrl
|
|
538
|
+
const credentials = await this.getCredentials('coresignalApi');
|
|
539
|
+
const baseUrl = credentials.baseUrl;
|
|
540
|
+
const requestOptions = {
|
|
541
|
+
method: httpMethod,
|
|
542
|
+
url: `${baseUrl}${url}`,
|
|
543
|
+
headers: {
|
|
544
|
+
'Accept': 'application/json',
|
|
545
|
+
'Content-Type': 'application/json',
|
|
546
|
+
},
|
|
547
|
+
arrayFormat: 'repeat',
|
|
548
|
+
};
|
|
549
|
+
if (Object.keys(qs).length > 0) {
|
|
550
|
+
requestOptions.qs = qs;
|
|
551
|
+
}
|
|
552
|
+
if (body) {
|
|
553
|
+
requestOptions.body = body;
|
|
554
|
+
}
|
|
555
|
+
const responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'coresignalApi', requestOptions);
|
|
556
|
+
// Handle both single objects and arrays from API
|
|
557
|
+
const responseItems = Array.isArray(responseData) ? responseData : [responseData];
|
|
558
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseItems), { itemData: { item: i } });
|
|
559
|
+
returnData.push(...executionData);
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
if (this.continueOnFail()) {
|
|
563
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
564
|
+
returnData.push({ json: { error: errorMessage } });
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return [returnData];
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
exports.Coresignal = Coresignal;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M45.6025 26.6702C45.6156 30.1738 44.9333 33.6452 43.5949 36.8831C42.2566 40.121 40.2889 43.0611 37.8059 45.5329L37.7179 45.621L33.7869 41.69L33.8749 41.6019C36.8293 38.6502 38.8415 34.8882 39.6567 30.7923C40.472 26.6964 40.0536 22.4506 38.4546 18.5926C36.8556 14.7346 34.1478 11.4377 30.6741 9.11937C27.2004 6.80104 23.1169 5.56549 18.9407 5.56915C16.1691 5.56245 13.4237 6.10536 10.8633 7.16647C8.30295 8.22758 5.97836 9.78583 4.02404 11.7511L3.93602 11.8391L0 7.90812L0.088026 7.8201C3.81648 4.08699 8.56881 1.54415 13.7433 0.51355C18.9178 -0.517051 24.2817 0.0109308 29.156 2.03065C34.0302 4.05036 38.1956 7.47098 41.1246 11.8594C44.0537 16.2478 45.6147 21.4067 45.61 26.6828L45.6025 26.6702Z" fill="#4750EF"/>
|
|
3
|
+
<path d="M18.9407 10.6246C15.7665 10.6246 12.6636 11.5659 10.0244 13.3295C7.3852 15.093 5.32824 17.5995 4.11365 20.5322C2.89906 23.4648 2.58139 26.6917 3.20083 29.8048C3.82026 32.918 5.34898 35.7775 7.59363 38.0218C9.83829 40.2662 12.6981 41.7944 15.8113 42.4134C18.9246 43.0323 22.1515 42.7141 25.0839 41.4991C28.0163 40.284 30.5225 38.2267 32.2856 35.5872C34.0488 32.9477 34.9896 29.8447 34.9891 26.6705C34.9837 22.4161 33.2911 18.3375 30.2826 15.3294C27.274 12.3213 23.1951 10.6293 18.9407 10.6246ZM18.9407 37.1607C16.8664 37.1612 14.8386 36.5466 13.1136 35.3946C11.3886 34.2426 10.044 32.605 9.24978 30.6888C8.45553 28.7726 8.24734 26.664 8.65152 24.6295C9.0557 22.5949 10.0541 20.726 11.5205 19.2589C12.9869 17.7918 14.8553 16.7925 16.8896 16.3874C18.924 15.9822 21.0327 16.1894 22.9493 16.9827C24.8659 17.7761 26.5041 19.1199 27.6569 20.8443C28.8097 22.5687 29.4253 24.5962 29.4258 26.6705C29.4232 29.451 28.3178 32.1169 26.3522 34.0835C24.3865 36.05 21.7212 37.1567 18.9407 37.1607Z" fill="#4750EF"/>
|
|
4
|
+
<path d="M17.5725 33.3478C20.5033 33.3478 22.8792 30.9719 22.8792 28.0411C22.8792 25.1103 20.5033 22.7344 17.5725 22.7344C14.6417 22.7344 12.2658 25.1103 12.2658 28.0411C12.2658 30.9719 14.6417 33.3478 17.5725 33.3478Z" fill="#4750EF"/>
|
|
5
|
+
<path d="M17.5725 33.4736C20.5728 33.4736 23.005 31.0414 23.005 28.0411C23.005 25.0408 20.5728 22.6086 17.5725 22.6086C14.5723 22.6086 12.1401 25.0408 12.1401 28.0411C12.1401 31.0414 14.5723 33.4736 17.5725 33.4736Z" fill="#4750EF"/>
|
|
6
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-coresignal-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "n8n community node for Coresignal API - access company, employee, job, and post data",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"coresignal"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://coresignal.com",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Coresignal",
|
|
14
|
+
"email": "marketing@coresignal.com"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Coresignal-com/n8n-nodes-coresignal-api.git"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "n8n-node build",
|
|
22
|
+
"dev": "n8n-node dev",
|
|
23
|
+
"lint": "n8n-node lint",
|
|
24
|
+
"lintfix": "n8n-node lint --fix",
|
|
25
|
+
"prepublishOnly": "n8n-node build"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"n8n": {
|
|
31
|
+
"n8nNodesApiVersion": 1,
|
|
32
|
+
"strict": true,
|
|
33
|
+
"credentials": [
|
|
34
|
+
"dist/credentials/CoresignalApi.credentials.js"
|
|
35
|
+
],
|
|
36
|
+
"nodes": [
|
|
37
|
+
"dist/nodes/Coresignal/Coresignal.node.js"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@n8n/node-cli": "*",
|
|
42
|
+
"eslint": "9.32.0",
|
|
43
|
+
"prettier": "3.6.2",
|
|
44
|
+
"typescript": "5.9.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"n8n-workflow": "*"
|
|
48
|
+
}
|
|
49
|
+
}
|