@linkedcampai/n8n-nodes-linkedcamp 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +141 -2
- package/dist/credentials/LinkedcampApi.credentials.d.ts +10 -0
- package/dist/credentials/LinkedcampApi.credentials.js +61 -0
- package/dist/credentials/LinkedcampApi.credentials.js.map +1 -0
- package/dist/nodes/Linkedcamp/Linkedcamp.node.d.ts +17 -0
- package/dist/nodes/Linkedcamp/Linkedcamp.node.js +132 -0
- package/dist/nodes/Linkedcamp/Linkedcamp.node.js.map +1 -0
- package/dist/nodes/Linkedcamp/Linkedcamp.node.json +18 -0
- package/dist/nodes/Linkedcamp/LinkedcampPollTrigger.node.d.ts +14 -0
- package/dist/nodes/Linkedcamp/LinkedcampPollTrigger.node.js +132 -0
- package/dist/nodes/Linkedcamp/LinkedcampPollTrigger.node.js.map +1 -0
- package/dist/nodes/Linkedcamp/LinkedcampPollTrigger.node.json +18 -0
- package/dist/nodes/Linkedcamp/LinkedcampTrigger.node.d.ts +21 -0
- package/dist/nodes/Linkedcamp/LinkedcampTrigger.node.js +218 -0
- package/dist/nodes/Linkedcamp/LinkedcampTrigger.node.js.map +1 -0
- package/dist/nodes/Linkedcamp/LinkedcampTrigger.node.json +18 -0
- package/dist/nodes/Linkedcamp/descriptions/account.d.ts +10 -0
- package/dist/nodes/Linkedcamp/descriptions/account.js +136 -0
- package/dist/nodes/Linkedcamp/descriptions/account.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/blacklist.d.ts +5 -0
- package/dist/nodes/Linkedcamp/descriptions/blacklist.js +66 -0
- package/dist/nodes/Linkedcamp/descriptions/blacklist.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/campaign.d.ts +5 -0
- package/dist/nodes/Linkedcamp/descriptions/campaign.js +276 -0
- package/dist/nodes/Linkedcamp/descriptions/campaign.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/conversation.d.ts +5 -0
- package/dist/nodes/Linkedcamp/descriptions/conversation.js +293 -0
- package/dist/nodes/Linkedcamp/descriptions/conversation.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/crm.d.ts +11 -0
- package/dist/nodes/Linkedcamp/descriptions/crm.js +237 -0
- package/dist/nodes/Linkedcamp/descriptions/crm.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/lead.d.ts +5 -0
- package/dist/nodes/Linkedcamp/descriptions/lead.js +482 -0
- package/dist/nodes/Linkedcamp/descriptions/lead.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/tag.d.ts +5 -0
- package/dist/nodes/Linkedcamp/descriptions/tag.js +79 -0
- package/dist/nodes/Linkedcamp/descriptions/tag.js.map +1 -0
- package/dist/nodes/Linkedcamp/descriptions/types.d.ts +4 -0
- package/dist/nodes/Linkedcamp/descriptions/types.js +3 -0
- package/dist/nodes/Linkedcamp/descriptions/types.js.map +1 -0
- package/dist/nodes/Linkedcamp/linkedcamp.svg +1 -0
- package/dist/nodes/Linkedcamp/shared.d.ts +45 -0
- package/dist/nodes/Linkedcamp/shared.js +367 -0
- package/dist/nodes/Linkedcamp/shared.js.map +1 -0
- package/dist/nodes/Linkedcamp/transport/mcp.d.ts +16 -0
- package/dist/nodes/Linkedcamp/transport/mcp.js +88 -0
- package/dist/nodes/Linkedcamp/transport/mcp.js.map +1 -0
- package/dist/nodes/Linkedcamp/transport/mcpClient.d.ts +83 -0
- package/dist/nodes/Linkedcamp/transport/mcpClient.js +264 -0
- package/dist/nodes/Linkedcamp/transport/mcpClient.js.map +1 -0
- package/package.json +64 -4
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkedcampTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const mcp_1 = require("./transport/mcp");
|
|
6
|
+
const mcpClient_1 = require("./transport/mcpClient");
|
|
7
|
+
const shared_1 = require("./shared");
|
|
8
|
+
const EVENTS = [
|
|
9
|
+
{ name: 'Connection Accepted', value: 'ACCEPTS_REQUEST', description: 'A lead accepts a connection request' },
|
|
10
|
+
{ name: 'Connection Request Sent', value: 'CONNECT_INVITED', description: 'A connection request is sent to a lead' },
|
|
11
|
+
{ name: 'Email Bounced', value: 'BOUNCED', description: 'An email to a lead bounces' },
|
|
12
|
+
{ name: 'Email Link Clicked', value: 'CLICKED', description: 'A lead clicks a tracked link in an email' },
|
|
13
|
+
{ name: 'Email Opened', value: 'OPENED', description: 'A lead opens an email' },
|
|
14
|
+
{ name: 'Email Sent', value: 'EMAIL_SENT', description: 'An email is sent to a lead' },
|
|
15
|
+
{ name: 'New Reply', value: 'REPLY_DETECTED', description: 'A lead replies on LinkedIn or email' },
|
|
16
|
+
{ name: 'Unsubscribed', value: 'UNSUBSCRIBED', description: 'A lead unsubscribes from emails' },
|
|
17
|
+
];
|
|
18
|
+
function eventLabel(value) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return (_b = (_a = EVENTS.find((e) => e.value === value)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : value;
|
|
21
|
+
}
|
|
22
|
+
function buildFlow(event, url, campaignId) {
|
|
23
|
+
const triggerId = 'n8n-trigger';
|
|
24
|
+
const webhookId = 'n8n-webhook';
|
|
25
|
+
const endId = 'n8n-end';
|
|
26
|
+
return {
|
|
27
|
+
nodes: [
|
|
28
|
+
{
|
|
29
|
+
id: triggerId,
|
|
30
|
+
type: 'trigger',
|
|
31
|
+
width: 350,
|
|
32
|
+
height: 84,
|
|
33
|
+
data: { type: event, ...(campaignId ? { campaignId } : {}) },
|
|
34
|
+
position: { x: 0, y: 0 },
|
|
35
|
+
targetPosition: 'top',
|
|
36
|
+
sourcePosition: 'bottom',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: webhookId,
|
|
40
|
+
type: 'integration',
|
|
41
|
+
width: 350,
|
|
42
|
+
height: 75,
|
|
43
|
+
data: { type: 'WEBHOOK', url },
|
|
44
|
+
position: { x: 0, y: 120 },
|
|
45
|
+
targetPosition: 'top',
|
|
46
|
+
sourcePosition: 'bottom',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: endId,
|
|
50
|
+
type: 'end',
|
|
51
|
+
width: 350,
|
|
52
|
+
height: 52,
|
|
53
|
+
position: { x: 0, y: 240 },
|
|
54
|
+
targetPosition: 'top',
|
|
55
|
+
sourcePosition: 'bottom',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
edges: [
|
|
59
|
+
{ id: `${triggerId}-${webhookId}`, source: triggerId, target: webhookId, type: 'default', animated: false },
|
|
60
|
+
{ id: `${webhookId}-${endId}`, source: webhookId, target: endId, type: 'end', animated: true },
|
|
61
|
+
],
|
|
62
|
+
viewport: { x: 0, y: 0, zoom: 1 },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function webhookUrlOf(automation) {
|
|
66
|
+
const nodes = (0, shared_1.asArray)((0, shared_1.asObject)(automation.flow).nodes);
|
|
67
|
+
const node = nodes.find((n) => (0, shared_1.asObject)(n.data).type === 'WEBHOOK');
|
|
68
|
+
const url = (0, shared_1.asObject)(node === null || node === void 0 ? void 0 : node.data).url;
|
|
69
|
+
return typeof url === 'string' ? url : undefined;
|
|
70
|
+
}
|
|
71
|
+
function isNotFound(error) {
|
|
72
|
+
return error instanceof mcpClient_1.McpError && error.kind === 'tool' && /not found|invalid|no automation/i.test(error.message);
|
|
73
|
+
}
|
|
74
|
+
class LinkedcampTrigger {
|
|
75
|
+
constructor() {
|
|
76
|
+
this.description = {
|
|
77
|
+
displayName: 'Linkedcamp Trigger',
|
|
78
|
+
name: 'linkedcampTrigger',
|
|
79
|
+
icon: { light: 'file:linkedcamp.svg', dark: 'file:linkedcamp.svg' },
|
|
80
|
+
group: ['trigger'],
|
|
81
|
+
version: 1,
|
|
82
|
+
subtitle: '={{$parameter["event"]}}',
|
|
83
|
+
description: 'Starts the workflow instantly when a Linkedcamp event happens',
|
|
84
|
+
defaults: { name: 'Linkedcamp Trigger' },
|
|
85
|
+
inputs: [],
|
|
86
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
87
|
+
credentials: [{ name: 'linkedcampApi', required: true }],
|
|
88
|
+
webhooks: [
|
|
89
|
+
{
|
|
90
|
+
name: 'default',
|
|
91
|
+
httpMethod: 'POST',
|
|
92
|
+
responseMode: 'onReceived',
|
|
93
|
+
path: 'webhook',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
properties: [
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Event',
|
|
99
|
+
name: 'event',
|
|
100
|
+
type: 'options',
|
|
101
|
+
required: true,
|
|
102
|
+
default: 'REPLY_DETECTED',
|
|
103
|
+
options: EVENTS,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Options',
|
|
107
|
+
name: 'options',
|
|
108
|
+
type: 'collection',
|
|
109
|
+
placeholder: 'Add Option',
|
|
110
|
+
default: {},
|
|
111
|
+
options: [
|
|
112
|
+
(0, shared_1.optionalLocator)('campaignId', 'Campaign', 'searchCampaigns', 'Only fire for events from this campaign'),
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Activating this workflow creates a Linkedcamp automation named "n8n – <event>" that posts each event here. Deactivating it switches that automation off.',
|
|
117
|
+
name: 'notice',
|
|
118
|
+
type: 'notice',
|
|
119
|
+
default: '',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
this.methods = { listSearch: shared_1.listSearch };
|
|
124
|
+
this.webhookMethods = {
|
|
125
|
+
default: {
|
|
126
|
+
async checkExists() {
|
|
127
|
+
const state = this.getWorkflowStaticData('node');
|
|
128
|
+
if (!state.automationId)
|
|
129
|
+
return false;
|
|
130
|
+
const client = (0, mcp_1.createMcpClient)(this);
|
|
131
|
+
try {
|
|
132
|
+
const automation = (0, shared_1.asObject)(await client.callTool('automation_get', { automationId: state.automationId }));
|
|
133
|
+
if (!automation._id)
|
|
134
|
+
return false;
|
|
135
|
+
return automation.isActive === true && webhookUrlOf(automation) === this.getNodeWebhookUrl('default');
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (isNotFound(error)) {
|
|
139
|
+
delete state.automationId;
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
throw (0, mcp_1.toNodeError)(this, error);
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
await client.close();
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
async create() {
|
|
149
|
+
const state = this.getWorkflowStaticData('node');
|
|
150
|
+
const event = this.getNodeParameter('event');
|
|
151
|
+
const options = this.getNodeParameter('options', {});
|
|
152
|
+
const url = this.getNodeWebhookUrl('default');
|
|
153
|
+
const flow = buildFlow(event, url, (0, shared_1.nestedLocator)(options.campaignId));
|
|
154
|
+
const title = `n8n – ${eventLabel(event)}`;
|
|
155
|
+
const description = `Sends "${eventLabel(event)}" events to an n8n workflow. Managed by the n8n Linkedcamp Trigger node.`;
|
|
156
|
+
const client = (0, mcp_1.createMcpClient)(this);
|
|
157
|
+
try {
|
|
158
|
+
let automationId = state.automationId;
|
|
159
|
+
if (!automationId) {
|
|
160
|
+
const created = (0, shared_1.asObject)(await client.callTool('automation_upsert', { title, description, flow, isActive: false }));
|
|
161
|
+
const id = (0, shared_1.asObject)(created.data).automationId;
|
|
162
|
+
if (typeof id !== 'string' || !id) {
|
|
163
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Linkedcamp did not return an automation ID. Try activating the workflow again.');
|
|
164
|
+
}
|
|
165
|
+
automationId = id;
|
|
166
|
+
state.automationId = id;
|
|
167
|
+
}
|
|
168
|
+
await client.callTool('automation_upsert', {
|
|
169
|
+
_id: automationId,
|
|
170
|
+
title,
|
|
171
|
+
description,
|
|
172
|
+
flow,
|
|
173
|
+
isActive: true,
|
|
174
|
+
});
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
throw (0, mcp_1.toNodeError)(this, error);
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
await client.close();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
async delete() {
|
|
185
|
+
const state = this.getWorkflowStaticData('node');
|
|
186
|
+
if (!state.automationId)
|
|
187
|
+
return true;
|
|
188
|
+
const event = this.getNodeParameter('event');
|
|
189
|
+
const client = (0, mcp_1.createMcpClient)(this);
|
|
190
|
+
try {
|
|
191
|
+
await client.callTool('automation_upsert', {
|
|
192
|
+
_id: state.automationId,
|
|
193
|
+
title: `n8n – ${eventLabel(event)}`,
|
|
194
|
+
description: `Switched off: the n8n workflow using it was deactivated.`,
|
|
195
|
+
isActive: false,
|
|
196
|
+
});
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (isNotFound(error)) {
|
|
201
|
+
delete state.automationId;
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
await client.close();
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
async webhook() {
|
|
214
|
+
return { workflowData: [this.helpers.returnJsonArray(this.getBodyData())] };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.LinkedcampTrigger = LinkedcampTrigger;
|
|
218
|
+
//# sourceMappingURL=LinkedcampTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkedcampTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Linkedcamp/LinkedcampTrigger.node.ts"],"names":[],"mappings":";;;AAQA,+CAAuE;AAEvE,yCAA+D;AAC/D,qDAAiD;AACjD,qCAAyF;AAi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AAE,KAAK,CAAC,YAAY;4BACvB,KAAK,EAAE,SAAS,UAAU,CAAC,KAAK,CAAC,EAAE;4BACnC,WAAW,EAAE,0DAA0D;4BACvE,QAAQ,EAAE,KAAK;yBACf,CAAC,CAAC;wBACH,OAAO,IAAI,CAAC;oBACb,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBAChB,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;4BACvB,OAAO,KAAK,CAAC,YAAY,CAAC;4BAC1B,OAAO,IAAI,CAAC;wBACb,CAAC;wBACD,OAAO,KAAK,CAAC;oBACd,CAAC;4BAAS,CAAC;wBACV,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;oBACtB,CAAC;gBACF,CAAC;aACD;SACD,CAAC;IAMH,CAAC;IAJA,KAAK,CAAC,OAAO;QAEZ,OAAO,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7E,CAAC;CACD;AAhJD,8CAgJC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "@linkedcampai/n8n-nodes-linkedcamp.linkedcampTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Sales", "Marketing & Content", "Communication"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/LinkedCamp/n8n-nodes-linkedcamp?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/LinkedCamp/n8n-nodes-linkedcamp?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import type { HandlerMap } from './types';
|
|
3
|
+
export declare const accountOperations: INodeProperties;
|
|
4
|
+
export declare const accountHandlers: HandlerMap;
|
|
5
|
+
export declare const clientOperations: INodeProperties;
|
|
6
|
+
export declare const clientFields: INodeProperties[];
|
|
7
|
+
export declare const clientHandlers: HandlerMap;
|
|
8
|
+
export declare const toolOperations: INodeProperties;
|
|
9
|
+
export declare const toolFields: INodeProperties[];
|
|
10
|
+
export declare const toolHandlers: HandlerMap;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolHandlers = exports.toolFields = exports.toolOperations = exports.clientHandlers = exports.clientFields = exports.clientOperations = exports.accountHandlers = exports.accountOperations = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const mcp_1 = require("../transport/mcp");
|
|
6
|
+
const shared_1 = require("../shared");
|
|
7
|
+
exports.accountOperations = {
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: { resource: ['account'] } },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Get',
|
|
16
|
+
value: 'get',
|
|
17
|
+
description: 'Retrieve the account behind this API key: plan, role and permissions',
|
|
18
|
+
action: 'Get the account',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
default: 'get',
|
|
22
|
+
};
|
|
23
|
+
exports.accountHandlers = {
|
|
24
|
+
async get(ctx, client, i) {
|
|
25
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'whoami', {}, i));
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
exports.clientOperations = {
|
|
29
|
+
displayName: 'Operation',
|
|
30
|
+
name: 'operation',
|
|
31
|
+
type: 'options',
|
|
32
|
+
noDataExpression: true,
|
|
33
|
+
displayOptions: { show: { resource: ['client'] } },
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Get Many',
|
|
37
|
+
value: 'getMany',
|
|
38
|
+
description: 'Retrieve a list of client sub-accounts. Needs an account owner key.',
|
|
39
|
+
action: 'Get many clients',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
default: 'getMany',
|
|
43
|
+
};
|
|
44
|
+
exports.clientFields = [
|
|
45
|
+
...(0, shared_1.returnAllAndLimit)({ resource: ['client'], operation: ['getMany'] }, 1000),
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Filters',
|
|
48
|
+
name: 'filters',
|
|
49
|
+
type: 'collection',
|
|
50
|
+
placeholder: 'Add Filter',
|
|
51
|
+
default: {},
|
|
52
|
+
displayOptions: { show: { resource: ['client'], operation: ['getMany'] } },
|
|
53
|
+
options: [
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Keyword',
|
|
56
|
+
name: 'keyword',
|
|
57
|
+
type: 'string',
|
|
58
|
+
default: '',
|
|
59
|
+
description: 'Match on client name or email',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
exports.clientHandlers = {
|
|
65
|
+
async getMany(ctx, client, i) {
|
|
66
|
+
const filters = ctx.getNodeParameter('filters', i, {});
|
|
67
|
+
const returnAll = ctx.getNodeParameter('returnAll', i, false);
|
|
68
|
+
const limit = ctx.getNodeParameter('limit', i, 50);
|
|
69
|
+
return await (0, shared_1.collectPages)(ctx, client, 'subaccount_list', (0, mcp_1.compact)({ keyword: filters.keyword }), 'subaccounts', {
|
|
70
|
+
returnAll,
|
|
71
|
+
limit,
|
|
72
|
+
pageSize: returnAll ? 200 : Math.min(200, limit),
|
|
73
|
+
pageSizeArg: 'pageSize',
|
|
74
|
+
i,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
exports.toolOperations = {
|
|
79
|
+
displayName: 'Operation',
|
|
80
|
+
name: 'operation',
|
|
81
|
+
type: 'options',
|
|
82
|
+
noDataExpression: true,
|
|
83
|
+
displayOptions: { show: { resource: ['tool'] } },
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
name: 'Call Any Tool',
|
|
87
|
+
value: 'call',
|
|
88
|
+
description: 'Call any Linkedcamp MCP tool by name with JSON arguments. For advanced users.',
|
|
89
|
+
action: 'Call a tool',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
default: 'call',
|
|
93
|
+
};
|
|
94
|
+
exports.toolFields = [
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Tool Name or ID',
|
|
97
|
+
name: 'toolName',
|
|
98
|
+
type: 'options',
|
|
99
|
+
typeOptions: { loadOptionsMethod: 'getTools' },
|
|
100
|
+
required: true,
|
|
101
|
+
default: '',
|
|
102
|
+
description: 'The MCP tool to call. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
103
|
+
displayOptions: { show: { resource: ['tool'], operation: ['call'] } },
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Arguments (JSON)',
|
|
107
|
+
name: 'toolArguments',
|
|
108
|
+
type: 'json',
|
|
109
|
+
default: '{}',
|
|
110
|
+
description: 'Arguments as a JSON object. See the tool list at https://docs.linkedcamp.com/mcp/overview.',
|
|
111
|
+
displayOptions: { show: { resource: ['tool'], operation: ['call'] } },
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
exports.toolHandlers = {
|
|
115
|
+
async call(ctx, client, i) {
|
|
116
|
+
const name = ctx.getNodeParameter('toolName', i);
|
|
117
|
+
const raw = ctx.getNodeParameter('toolArguments', i, '{}');
|
|
118
|
+
let args = raw;
|
|
119
|
+
if (typeof raw === 'string') {
|
|
120
|
+
try {
|
|
121
|
+
args = raw.trim() ? JSON.parse(raw) : {};
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "'Arguments (JSON)' is not valid JSON", { itemIndex: i });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (typeof args !== 'object' || args === null || Array.isArray(args)) {
|
|
128
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "'Arguments (JSON)' must be a JSON object", { itemIndex: i });
|
|
129
|
+
}
|
|
130
|
+
const out = await (0, mcp_1.callTool)(ctx, client, name, args, i);
|
|
131
|
+
return typeof out === 'object' && out !== null && !Array.isArray(out)
|
|
132
|
+
? out
|
|
133
|
+
: { result: out };
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../nodes/Linkedcamp/descriptions/account.ts"],"names":[],"mappings":";;;AAIA,+CAAkD;AAElD,0CAAqD;AACrD,sCAAsE;AAKzD,QAAA,iBAAiB,GAAoB;IACjD,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;IACnD,OAAO,EAAE;QACR;YACC,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,sEAAsE;YACnF,MAAM,EAAE,iBAAiB;SACzB;KACD;IACD,OAAO,EAAE,KAAK;CACd,CAAC;AAEW,QAAA,eAAe,GAAe;IAC1C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QACvB,OAAO,IAAA,iBAAQ,EAAC,MAAM,IAAA,cAAQ,EAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACD,CAAC;AAIW,QAAA,gBAAgB,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AAC,CAAC;QACtE,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YACpE,CAAC,CAAE,GAAmB;YACtB,CAAC,CAAC,EAAE,MAAM,EAAE,GAAoB,EAAE,CAAC;IACrC,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blacklistHandlers = exports.blacklistFields = exports.blacklistOperations = void 0;
|
|
4
|
+
const mcp_1 = require("../transport/mcp");
|
|
5
|
+
const shared_1 = require("../shared");
|
|
6
|
+
const show = (operation) => ({ resource: ['blacklist'], operation });
|
|
7
|
+
exports.blacklistOperations = {
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: { resource: ['blacklist'] } },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Add Entry',
|
|
16
|
+
value: 'addEntry',
|
|
17
|
+
description: 'Add a profile, company, keyword, job title or email to a LinkedIn account blacklist',
|
|
18
|
+
action: 'Add an entry to the blacklist',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
default: 'addEntry',
|
|
22
|
+
};
|
|
23
|
+
exports.blacklistFields = [
|
|
24
|
+
(0, shared_1.locatorField)({
|
|
25
|
+
name: 'linkedAccountId',
|
|
26
|
+
displayName: 'LinkedIn Account',
|
|
27
|
+
searchMethod: 'searchLinkedinAccounts',
|
|
28
|
+
show: show(['addEntry']),
|
|
29
|
+
}),
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Type',
|
|
32
|
+
name: 'type',
|
|
33
|
+
type: 'options',
|
|
34
|
+
required: true,
|
|
35
|
+
default: 'PROFILE_URL',
|
|
36
|
+
displayOptions: { show: show(['addEntry']) },
|
|
37
|
+
options: [
|
|
38
|
+
{ name: 'Company URL', value: 'COMPANY_URL' },
|
|
39
|
+
{ name: 'Email', value: 'EMAIL' },
|
|
40
|
+
{ name: 'Job Title', value: 'JOB_TITLE' },
|
|
41
|
+
{ name: 'Keyword', value: 'KEYWORD' },
|
|
42
|
+
{ name: 'LinkedIn Profile URL', value: 'PROFILE_URL' },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Value',
|
|
47
|
+
name: 'keyword',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: true,
|
|
50
|
+
default: '',
|
|
51
|
+
placeholder: 'e.g. https://www.linkedin.com/in/jane-doe',
|
|
52
|
+
description: 'The profile URL, company URL, keyword, job title or email to block',
|
|
53
|
+
displayOptions: { show: show(['addEntry']) },
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
exports.blacklistHandlers = {
|
|
57
|
+
async addEntry(ctx, client, i) {
|
|
58
|
+
const args = {
|
|
59
|
+
linkedAccountId: (0, shared_1.locatorValue)(ctx, 'linkedAccountId', i),
|
|
60
|
+
type: ctx.getNodeParameter('type', i),
|
|
61
|
+
keyword: ctx.getNodeParameter('keyword', i),
|
|
62
|
+
};
|
|
63
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'blacklist_add', args, i));
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=blacklist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blacklist.js","sourceRoot":"","sources":["../../../../nodes/Linkedcamp/descriptions/blacklist.ts"],"names":[],"mappings":";;;AAEA,0CAA4C;AAC5C,sCAAiE;AAGjE,MAAM,IAAI,GAAG,CAAC,SAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAoB;IACnD,WAAW,EAAE,WAA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