@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,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.campaignHandlers = exports.campaignFields = exports.campaignOperations = void 0;
|
|
4
|
+
const mcp_1 = require("../transport/mcp");
|
|
5
|
+
const shared_1 = require("../shared");
|
|
6
|
+
const show = (operation) => ({ resource: ['campaign'], operation });
|
|
7
|
+
exports.campaignOperations = {
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: { resource: ['campaign'] } },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
description: 'Create a draft campaign. Nothing is sent until it is launched.',
|
|
18
|
+
action: 'Create a draft campaign',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get',
|
|
22
|
+
value: 'get',
|
|
23
|
+
description: 'Retrieve one campaign with its settings and sequence',
|
|
24
|
+
action: 'Get a campaign',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get Funnel',
|
|
28
|
+
value: 'getFunnel',
|
|
29
|
+
description: 'Retrieve how many leads reached each stage of a campaign',
|
|
30
|
+
action: 'Get campaign funnel',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Get Many',
|
|
34
|
+
value: 'getMany',
|
|
35
|
+
description: 'Retrieve a list of campaigns',
|
|
36
|
+
action: 'Get many campaigns',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Get Stats',
|
|
40
|
+
value: 'getStats',
|
|
41
|
+
description: 'Retrieve performance numbers for one campaign, or for the whole account',
|
|
42
|
+
action: 'Get campaign stats',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Launch',
|
|
46
|
+
value: 'launch',
|
|
47
|
+
description: 'Launch a campaign. This starts sending real connection requests, messages and emails to its leads.',
|
|
48
|
+
action: 'Launch a campaign',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Pause or Resume',
|
|
52
|
+
value: 'setStatus',
|
|
53
|
+
description: 'Pause a running campaign or resume a paused one. Never archives, completes or deletes.',
|
|
54
|
+
action: 'Pause or resume a campaign',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
default: 'getMany',
|
|
58
|
+
};
|
|
59
|
+
const CAMPAIGN_STATUSES = [
|
|
60
|
+
{ name: 'Active', value: 'ACTIVE' },
|
|
61
|
+
{ name: 'Archived', value: 'ARCHIVED' },
|
|
62
|
+
{ name: 'Completed', value: 'COMPLETED' },
|
|
63
|
+
{ name: 'Deleted', value: 'DELETED' },
|
|
64
|
+
{ name: 'Drafted', value: 'DRAFTED' },
|
|
65
|
+
{ name: 'Failed', value: 'FAILED' },
|
|
66
|
+
{ name: 'Paused', value: 'PAUSED' },
|
|
67
|
+
];
|
|
68
|
+
exports.campaignFields = [
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Title',
|
|
71
|
+
name: 'title',
|
|
72
|
+
type: 'string',
|
|
73
|
+
required: true,
|
|
74
|
+
default: '',
|
|
75
|
+
placeholder: 'e.g. Agency founders, UK',
|
|
76
|
+
displayOptions: { show: show(['create']) },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Additional Fields',
|
|
80
|
+
name: 'additionalFields',
|
|
81
|
+
type: 'collection',
|
|
82
|
+
placeholder: 'Add Field',
|
|
83
|
+
default: {},
|
|
84
|
+
displayOptions: { show: show(['create']) },
|
|
85
|
+
options: [
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Source URL',
|
|
88
|
+
name: 'sourceUrl',
|
|
89
|
+
type: 'string',
|
|
90
|
+
default: '',
|
|
91
|
+
placeholder: 'e.g. https://www.linkedin.com/search/results/people/?keywords=founder',
|
|
92
|
+
description: 'Where the leads come from: a LinkedIn, Sales Navigator or Recruiter search, or a group, event or post URL',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
(0, shared_1.locatorField)({
|
|
97
|
+
name: 'campaignId',
|
|
98
|
+
displayName: 'Campaign',
|
|
99
|
+
searchMethod: 'searchCampaigns',
|
|
100
|
+
show: show(['get', 'getFunnel', 'launch', 'setStatus']),
|
|
101
|
+
}),
|
|
102
|
+
{
|
|
103
|
+
displayName: 'Options',
|
|
104
|
+
name: 'options',
|
|
105
|
+
type: 'collection',
|
|
106
|
+
placeholder: 'Add Option',
|
|
107
|
+
default: {},
|
|
108
|
+
displayOptions: { show: show(['get']) },
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Include Sequence',
|
|
112
|
+
name: 'includeFlow',
|
|
113
|
+
type: 'boolean',
|
|
114
|
+
default: true,
|
|
115
|
+
description: 'Whether to include the campaign sequence (its steps and branches)',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
...(0, shared_1.returnAllAndLimit)(show(['getMany']), 1000),
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Filters',
|
|
122
|
+
name: 'filters',
|
|
123
|
+
type: 'collection',
|
|
124
|
+
placeholder: 'Add Filter',
|
|
125
|
+
default: {},
|
|
126
|
+
displayOptions: { show: show(['getMany']) },
|
|
127
|
+
options: [
|
|
128
|
+
(0, shared_1.clientLocator)(),
|
|
129
|
+
{
|
|
130
|
+
displayName: 'Keyword',
|
|
131
|
+
name: 'keyword',
|
|
132
|
+
type: 'string',
|
|
133
|
+
default: '',
|
|
134
|
+
description: 'Only campaigns whose title matches this text',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Status',
|
|
138
|
+
name: 'status',
|
|
139
|
+
type: 'options',
|
|
140
|
+
default: 'ACTIVE',
|
|
141
|
+
options: CAMPAIGN_STATUSES,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
(0, shared_1.simplifyField)(show(['getMany'])),
|
|
146
|
+
{
|
|
147
|
+
displayName: 'Status',
|
|
148
|
+
name: 'status',
|
|
149
|
+
type: 'options',
|
|
150
|
+
required: true,
|
|
151
|
+
default: 'PAUSED',
|
|
152
|
+
description: 'Resume works only on a paused campaign',
|
|
153
|
+
displayOptions: { show: show(['setStatus']) },
|
|
154
|
+
options: [
|
|
155
|
+
{ name: 'Pause', value: 'PAUSED' },
|
|
156
|
+
{ name: 'Resume', value: 'ACTIVE' },
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
displayName: 'Options',
|
|
161
|
+
name: 'options',
|
|
162
|
+
type: 'collection',
|
|
163
|
+
placeholder: 'Add Option',
|
|
164
|
+
default: {},
|
|
165
|
+
displayOptions: { show: show(['launch']) },
|
|
166
|
+
options: [
|
|
167
|
+
{
|
|
168
|
+
displayName: 'Skip Preflight Checks',
|
|
169
|
+
name: 'skipPreflight',
|
|
170
|
+
type: 'boolean',
|
|
171
|
+
default: false,
|
|
172
|
+
description: 'Whether to launch without the readiness checks Linkedcamp runs first',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
displayName: 'Options',
|
|
178
|
+
name: 'options',
|
|
179
|
+
type: 'collection',
|
|
180
|
+
placeholder: 'Add Option',
|
|
181
|
+
default: {},
|
|
182
|
+
displayOptions: { show: show(['getStats']) },
|
|
183
|
+
options: [
|
|
184
|
+
(0, shared_1.optionalLocator)('campaignId', 'Campaign', 'searchCampaigns', 'Leave empty for numbers across the whole account'),
|
|
185
|
+
(0, shared_1.clientLocator)(),
|
|
186
|
+
...(0, shared_1.dateRangeFields)(),
|
|
187
|
+
{
|
|
188
|
+
displayName: 'Include Graph',
|
|
189
|
+
name: 'includeGraph',
|
|
190
|
+
type: 'boolean',
|
|
191
|
+
default: false,
|
|
192
|
+
description: 'Whether to include day-by-day series',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
displayName: 'Options',
|
|
198
|
+
name: 'options',
|
|
199
|
+
type: 'collection',
|
|
200
|
+
placeholder: 'Add Option',
|
|
201
|
+
default: {},
|
|
202
|
+
displayOptions: { show: show(['getFunnel']) },
|
|
203
|
+
options: [...(0, shared_1.dateRangeFields)()],
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
const SIMPLE_CAMPAIGN = [
|
|
207
|
+
'_id',
|
|
208
|
+
'title',
|
|
209
|
+
'status',
|
|
210
|
+
'type',
|
|
211
|
+
'url',
|
|
212
|
+
'stats',
|
|
213
|
+
'linkedAccountId',
|
|
214
|
+
'launchedAt',
|
|
215
|
+
'createdAt',
|
|
216
|
+
'updatedAt',
|
|
217
|
+
];
|
|
218
|
+
exports.campaignHandlers = {
|
|
219
|
+
async create(ctx, client, i) {
|
|
220
|
+
const extra = ctx.getNodeParameter('additionalFields', i, {});
|
|
221
|
+
const args = (0, mcp_1.compact)({ title: ctx.getNodeParameter('title', i), sourceUrl: extra.sourceUrl });
|
|
222
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'campaign_create', args, i));
|
|
223
|
+
},
|
|
224
|
+
async get(ctx, client, i) {
|
|
225
|
+
const options = ctx.getNodeParameter('options', i, {});
|
|
226
|
+
const args = (0, mcp_1.compact)({ campaignId: (0, shared_1.locatorValue)(ctx, 'campaignId', i), includeFlow: options.includeFlow });
|
|
227
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'campaign_get', args, i));
|
|
228
|
+
},
|
|
229
|
+
async getMany(ctx, client, i) {
|
|
230
|
+
const filters = ctx.getNodeParameter('filters', i, {});
|
|
231
|
+
const args = (0, mcp_1.compact)({
|
|
232
|
+
status: filters.status,
|
|
233
|
+
keyword: filters.keyword,
|
|
234
|
+
userId: (0, shared_1.nestedLocator)(filters.userId),
|
|
235
|
+
});
|
|
236
|
+
const items = await (0, shared_1.collectPages)(ctx, client, 'campaign_list', args, 'campaigns', {
|
|
237
|
+
returnAll: ctx.getNodeParameter('returnAll', i, false),
|
|
238
|
+
limit: ctx.getNodeParameter('limit', i, 50),
|
|
239
|
+
pageSize: 20,
|
|
240
|
+
i,
|
|
241
|
+
});
|
|
242
|
+
const simplify = ctx.getNodeParameter('simplify', i, true);
|
|
243
|
+
return simplify ? items.map((c) => (0, shared_1.pick)(c, SIMPLE_CAMPAIGN)) : items;
|
|
244
|
+
},
|
|
245
|
+
async setStatus(ctx, client, i) {
|
|
246
|
+
const args = {
|
|
247
|
+
campaignId: (0, shared_1.locatorValue)(ctx, 'campaignId', i),
|
|
248
|
+
status: ctx.getNodeParameter('status', i),
|
|
249
|
+
};
|
|
250
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'campaign_set_status', args, i));
|
|
251
|
+
},
|
|
252
|
+
async launch(ctx, client, i) {
|
|
253
|
+
const options = ctx.getNodeParameter('options', i, {});
|
|
254
|
+
const args = (0, mcp_1.compact)({ campaignId: (0, shared_1.locatorValue)(ctx, 'campaignId', i), skipPreflight: options.skipPreflight });
|
|
255
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'campaign_launch', args, i));
|
|
256
|
+
},
|
|
257
|
+
async getStats(ctx, client, i) {
|
|
258
|
+
const options = ctx.getNodeParameter('options', i, {});
|
|
259
|
+
const args = (0, mcp_1.compact)({
|
|
260
|
+
campaignId: (0, shared_1.nestedLocator)(options.campaignId),
|
|
261
|
+
userId: (0, shared_1.nestedLocator)(options.userId),
|
|
262
|
+
range: (0, mcp_1.buildRange)(options.dateFrom, options.dateTo),
|
|
263
|
+
includeGraph: options.includeGraph,
|
|
264
|
+
});
|
|
265
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'analytics_campaign', args, i));
|
|
266
|
+
},
|
|
267
|
+
async getFunnel(ctx, client, i) {
|
|
268
|
+
const options = ctx.getNodeParameter('options', i, {});
|
|
269
|
+
const args = (0, mcp_1.compact)({
|
|
270
|
+
campaignId: (0, shared_1.locatorValue)(ctx, 'campaignId', i),
|
|
271
|
+
range: (0, mcp_1.buildRange)(options.dateFrom, options.dateTo),
|
|
272
|
+
});
|
|
273
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'analytics_campaign_funnel', args, i));
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
//# sourceMappingURL=campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.js","sourceRoot":"","sources":["../../../../nodes/Linkedcamp/descriptions/campaign.ts"],"names":[],"mappings":";;;AAEA,0CAAiE;AACjE,sCAYmB;AAGnB,MAAM,IAAI,GAAG,CAAC,SAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAEjE,QAAA,kBAAkB,GAAoB;IAClD,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,UAAU,CAAC,EAAE,EAAE;IACpD,OAAO,EAAE;QACR;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,gEAAgE;YAC7E,MAAM,EAAE,yBAAyB;SACjC;QACD;YACC,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE,gBAAgB;SACxB;QACD;YACC,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0DAA0D;YACvE,MAAM,EAAE,qBAAqB;SAC7B;QACD;YACC,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,8BAA8B;YAC3C,MAAM,EAAE,oBAAoB;SAC5B;QACD;YACC,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,yEAAyE;YACtF,MAAM,EAAE,oBAAoB;SAC5B;QACD;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EACV,oGAAoG;YACrG,MAAM,EAAE,mBAAmB;SAC3B;Q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,YAAY,EAAE,OAAO,CAAC,YAAY;SAClC,CAAC,CAAC;QACH,OAAO,IAAA,iBAAQ,EAAC,MAAM,IAAA,cAAQ,EAAC,GAAG,EAAE,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAgB,CAAC;QACtE,MAAM,IAAI,GAAG,IAAA,aAAO,EAAC;YACpB,UAAU,EAAE,IAAA,qBAAY,EAAC,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC;YAC9C,KAAK,EAAE,IAAA,gBAAU,EAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;SACnD,CAAC,CAAC;QACH,OAAO,IAAA,iBAAQ,EAAC,MAAM,IAAA,cAAQ,EAAC,GAAG,EAAE,MAAM,EAAE,2BAA2B,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import type { HandlerMap } from './types';
|
|
3
|
+
export declare const conversationOperations: INodeProperties;
|
|
4
|
+
export declare const conversationFields: INodeProperties[];
|
|
5
|
+
export declare const conversationHandlers: HandlerMap;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conversationHandlers = exports.conversationFields = exports.conversationOperations = void 0;
|
|
4
|
+
const mcp_1 = require("../transport/mcp");
|
|
5
|
+
const shared_1 = require("../shared");
|
|
6
|
+
const show = (operation) => ({ resource: ['conversation'], operation });
|
|
7
|
+
exports.conversationOperations = {
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: { resource: ['conversation'] } },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Draft AI Reply',
|
|
16
|
+
value: 'draftAiReply',
|
|
17
|
+
description: 'Write a suggested reply with an AI provider connected in Linkedcamp. Nothing is sent.',
|
|
18
|
+
action: 'Draft an AI reply in a conversation',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get',
|
|
22
|
+
value: 'get',
|
|
23
|
+
description: 'Retrieve one conversation with its messages. This marks the thread as read in Linkedcamp.',
|
|
24
|
+
action: 'Get a conversation',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get Many',
|
|
28
|
+
value: 'getMany',
|
|
29
|
+
description: 'Retrieve a list of conversations from the unified inbox',
|
|
30
|
+
action: 'Get many conversations',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Send Message',
|
|
34
|
+
value: 'sendMessage',
|
|
35
|
+
description: 'Send a message to the lead on LinkedIn or email. It is delivered immediately and cannot be recalled.',
|
|
36
|
+
action: 'Send a message in a conversation',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Update',
|
|
40
|
+
value: 'update',
|
|
41
|
+
description: 'Archive, mark as read, or hand the conversation between the AI agent and a human',
|
|
42
|
+
action: 'Update a conversation',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
default: 'getMany',
|
|
46
|
+
};
|
|
47
|
+
exports.conversationFields = [
|
|
48
|
+
(0, shared_1.locatorField)({
|
|
49
|
+
name: 'conversationId',
|
|
50
|
+
displayName: 'Conversation',
|
|
51
|
+
searchMethod: 'searchConversations',
|
|
52
|
+
show: show(['get', 'update', 'sendMessage', 'draftAiReply']),
|
|
53
|
+
}),
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Options',
|
|
56
|
+
name: 'options',
|
|
57
|
+
type: 'collection',
|
|
58
|
+
placeholder: 'Add Option',
|
|
59
|
+
default: {},
|
|
60
|
+
displayOptions: { show: show(['get']) },
|
|
61
|
+
options: [
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Include Messages',
|
|
64
|
+
name: 'includeMessages',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
default: true,
|
|
67
|
+
description: 'Whether to include the messages in the thread',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
...(0, shared_1.returnAllAndLimit)(show(['getMany']), 1000),
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Filters',
|
|
74
|
+
name: 'filters',
|
|
75
|
+
type: 'collection',
|
|
76
|
+
placeholder: 'Add Filter',
|
|
77
|
+
default: {},
|
|
78
|
+
displayOptions: { show: show(['getMany']) },
|
|
79
|
+
options: [
|
|
80
|
+
(0, shared_1.optionalLocator)('campaignId', 'Campaign', 'searchCampaigns', 'Only conversations from this campaign'),
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Email Account ID',
|
|
83
|
+
name: 'emailAccountId',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
description: 'Only conversations on this connected mailbox',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Keyword',
|
|
90
|
+
name: 'keyword',
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: '',
|
|
93
|
+
description: 'Match on the lead name or message text',
|
|
94
|
+
},
|
|
95
|
+
(0, shared_1.optionalLocator)('linkedAccountId', 'LinkedIn Account', 'searchLinkedinAccounts', 'Only conversations on this LinkedIn account'),
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Platform',
|
|
98
|
+
name: 'platform',
|
|
99
|
+
type: 'string',
|
|
100
|
+
default: '',
|
|
101
|
+
placeholder: 'e.g. linkedin',
|
|
102
|
+
description: 'Channel to filter by, for example linkedin or email',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Tag IDs',
|
|
106
|
+
name: 'tags',
|
|
107
|
+
type: 'string',
|
|
108
|
+
default: '',
|
|
109
|
+
placeholder: 'e.g. 64f1c2a9b7e4d10012ab34cd, 64f1c2a9b7e4d10012ab34ce',
|
|
110
|
+
description: 'Comma-separated tag IDs (from Tag → Get Many)',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Type',
|
|
114
|
+
name: 'type',
|
|
115
|
+
type: 'string',
|
|
116
|
+
default: '',
|
|
117
|
+
description: 'Inbox view to filter by, as named in Linkedcamp',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
(0, shared_1.simplifyField)(show(['getMany'])),
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Update Fields',
|
|
124
|
+
name: 'updateFields',
|
|
125
|
+
type: 'collection',
|
|
126
|
+
placeholder: 'Add Field',
|
|
127
|
+
default: {},
|
|
128
|
+
displayOptions: { show: show(['update']) },
|
|
129
|
+
options: [
|
|
130
|
+
{
|
|
131
|
+
displayName: 'AI Agent Active',
|
|
132
|
+
name: 'assistant',
|
|
133
|
+
type: 'boolean',
|
|
134
|
+
default: true,
|
|
135
|
+
description: 'Whether the AI agent handles this conversation. Turn off to hand it to a human.',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Archived',
|
|
139
|
+
name: 'isArchived',
|
|
140
|
+
type: 'boolean',
|
|
141
|
+
default: false,
|
|
142
|
+
description: 'Whether the conversation is archived',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Pause AI on Manual Message',
|
|
146
|
+
name: 'pauseBotOnManualMessage',
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
default: true,
|
|
149
|
+
description: 'Whether the AI agent pauses after someone replies by hand',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Seen',
|
|
153
|
+
name: 'seen',
|
|
154
|
+
type: 'boolean',
|
|
155
|
+
default: true,
|
|
156
|
+
description: 'Whether the conversation is marked as read',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Message',
|
|
162
|
+
name: 'content',
|
|
163
|
+
type: 'string',
|
|
164
|
+
typeOptions: { rows: 4 },
|
|
165
|
+
required: true,
|
|
166
|
+
default: '',
|
|
167
|
+
description: 'Delivered immediately to a real person and cannot be recalled',
|
|
168
|
+
displayOptions: { show: show(['sendMessage']) },
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
displayName: 'Attachment',
|
|
172
|
+
name: 'attachment',
|
|
173
|
+
type: 'collection',
|
|
174
|
+
placeholder: 'Add Attachment Field',
|
|
175
|
+
default: {},
|
|
176
|
+
displayOptions: { show: show(['sendMessage']) },
|
|
177
|
+
options: [
|
|
178
|
+
{
|
|
179
|
+
displayName: 'File Name',
|
|
180
|
+
name: 'name',
|
|
181
|
+
type: 'string',
|
|
182
|
+
default: '',
|
|
183
|
+
placeholder: 'e.g. proposal.pdf',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
displayName: 'File Type',
|
|
187
|
+
name: 'type',
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: '',
|
|
190
|
+
placeholder: 'e.g. application/pdf',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
displayName: 'File URL',
|
|
194
|
+
name: 'url',
|
|
195
|
+
type: 'string',
|
|
196
|
+
default: '',
|
|
197
|
+
placeholder: 'e.g. https://example.com/proposal.pdf',
|
|
198
|
+
description: 'Public URL of the file. Required to send an attachment.',
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
displayName: 'AI Provider',
|
|
204
|
+
name: 'provider',
|
|
205
|
+
type: 'options',
|
|
206
|
+
required: true,
|
|
207
|
+
default: 'OPENAI',
|
|
208
|
+
description: 'The provider must be connected in Linkedcamp',
|
|
209
|
+
displayOptions: { show: show(['draftAiReply']) },
|
|
210
|
+
options: [
|
|
211
|
+
{ name: 'Anthropic', value: 'ANTHROPIC' },
|
|
212
|
+
{ name: 'DeepSeek', value: 'DEEPSEEK' },
|
|
213
|
+
{ name: 'Gemini', value: 'GEMINI' },
|
|
214
|
+
{ name: 'Grok', value: 'GROK' },
|
|
215
|
+
{ name: 'OpenAI', value: 'OPENAI' },
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: 'Prompt',
|
|
220
|
+
name: 'prompt',
|
|
221
|
+
type: 'string',
|
|
222
|
+
typeOptions: { rows: 4 },
|
|
223
|
+
required: true,
|
|
224
|
+
default: '',
|
|
225
|
+
placeholder: 'e.g. Reply politely and suggest a call next week',
|
|
226
|
+
displayOptions: { show: show(['draftAiReply']) },
|
|
227
|
+
},
|
|
228
|
+
];
|
|
229
|
+
const SIMPLE_CONVERSATION = [
|
|
230
|
+
'_id',
|
|
231
|
+
'type',
|
|
232
|
+
'fullName',
|
|
233
|
+
'headline',
|
|
234
|
+
'profileLink',
|
|
235
|
+
'lastMsg',
|
|
236
|
+
'lastMessageAt',
|
|
237
|
+
'seen',
|
|
238
|
+
'isArchived',
|
|
239
|
+
'leadId',
|
|
240
|
+
];
|
|
241
|
+
exports.conversationHandlers = {
|
|
242
|
+
async get(ctx, client, i) {
|
|
243
|
+
const options = ctx.getNodeParameter('options', i, {});
|
|
244
|
+
const args = (0, mcp_1.compact)({
|
|
245
|
+
conversationId: (0, shared_1.locatorValue)(ctx, 'conversationId', i),
|
|
246
|
+
includeMessages: options.includeMessages,
|
|
247
|
+
});
|
|
248
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'conversation_get', args, i));
|
|
249
|
+
},
|
|
250
|
+
async getMany(ctx, client, i) {
|
|
251
|
+
const filters = ctx.getNodeParameter('filters', i, {});
|
|
252
|
+
const args = (0, mcp_1.compact)({
|
|
253
|
+
campaignId: (0, shared_1.nestedLocator)(filters.campaignId),
|
|
254
|
+
linkedAccountId: (0, shared_1.nestedLocator)(filters.linkedAccountId),
|
|
255
|
+
emailAccountId: filters.emailAccountId,
|
|
256
|
+
keyword: filters.keyword,
|
|
257
|
+
platform: filters.platform,
|
|
258
|
+
type: filters.type,
|
|
259
|
+
tags: typeof filters.tags === 'string' ? filters.tags.replace(/\s+/g, '') : undefined,
|
|
260
|
+
});
|
|
261
|
+
const items = await (0, shared_1.collectPages)(ctx, client, 'conversation_list', args, 'conversations', {
|
|
262
|
+
returnAll: ctx.getNodeParameter('returnAll', i, false),
|
|
263
|
+
limit: ctx.getNodeParameter('limit', i, 50),
|
|
264
|
+
pageSize: 20,
|
|
265
|
+
i,
|
|
266
|
+
});
|
|
267
|
+
const simplify = ctx.getNodeParameter('simplify', i, true);
|
|
268
|
+
return simplify ? items.map((c) => (0, shared_1.pick)(c, SIMPLE_CONVERSATION)) : items;
|
|
269
|
+
},
|
|
270
|
+
async update(ctx, client, i) {
|
|
271
|
+
const fields = ctx.getNodeParameter('updateFields', i, {});
|
|
272
|
+
const args = (0, mcp_1.compact)({ conversationId: (0, shared_1.locatorValue)(ctx, 'conversationId', i), ...fields });
|
|
273
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'conversation_update', args, i));
|
|
274
|
+
},
|
|
275
|
+
async sendMessage(ctx, client, i) {
|
|
276
|
+
const attachment = ctx.getNodeParameter('attachment', i, {});
|
|
277
|
+
const args = (0, mcp_1.compact)({
|
|
278
|
+
conversationId: (0, shared_1.locatorValue)(ctx, 'conversationId', i),
|
|
279
|
+
content: ctx.getNodeParameter('content', i),
|
|
280
|
+
attachment: attachment.url ? (0, mcp_1.compact)({ url: attachment.url, name: attachment.name, type: attachment.type }) : undefined,
|
|
281
|
+
});
|
|
282
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'message_send', args, i));
|
|
283
|
+
},
|
|
284
|
+
async draftAiReply(ctx, client, i) {
|
|
285
|
+
const args = {
|
|
286
|
+
conversationId: (0, shared_1.locatorValue)(ctx, 'conversationId', i),
|
|
287
|
+
provider: ctx.getNodeParameter('provider', i),
|
|
288
|
+
prompt: ctx.getNodeParameter('prompt', i),
|
|
289
|
+
};
|
|
290
|
+
return (0, shared_1.asObject)(await (0, mcp_1.callTool)(ctx, client, 'message_draft_ai_reply', args, i));
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../../nodes/Linkedcamp/descriptions/conversation.ts"],"names":[],"mappings":";;;AAEA,0CAAqD;AACrD,sCAUmB;AAGnB,MAAM,IAAI,GAAG,CAAC,SAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAErE,QAAA,sBAAsB,GAAoB;IACtD,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,cAAc,CAAC,EAAE,EAAE;IACxD,OAAO,EAAE;QACR;YACC,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,cAAc;YACrB,WAAW,EACV,uFAAuF;YACxF,MAAM,EAAE,qCAAqC;SAC7C;QACD;YACC,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,2FAA2F;YACxG,MAAM,EAAE,oBAAoB;SAC5B;QACD;YACC,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,yDAAyD;YACtE,MAAM,EAAE,wBAAwB;SAChC;QACD;YACC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,aAAa;YACpB,WAAW,EACV,sGAAsG;YACvG,MAAM,EAAE,kCAAkC;SAC1C;QACD;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAA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EAAE,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SACvH,CAAC,CAAC;QACH,OAAO,IAAA,iBAAQ,EAAC,MAAM,IAAA,cAAQ,EAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG;YACZ,cAAc,EAAE,IAAA,qBAAY,EAAC,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;YACtD,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW;YACvD,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAW;SACnD,CAAC;QACF,OAAO,IAAA,iBAAQ,EAAC,MAAM,IAAA,cAAQ,EAAC,GAAG,EAAE,MAAM,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import type { HandlerMap } from './types';
|
|
3
|
+
export declare const taskOperations: INodeProperties;
|
|
4
|
+
export declare const taskFields: INodeProperties[];
|
|
5
|
+
export declare const taskHandlers: HandlerMap;
|
|
6
|
+
export declare const reminderOperations: INodeProperties;
|
|
7
|
+
export declare const reminderFields: INodeProperties[];
|
|
8
|
+
export declare const reminderHandlers: HandlerMap;
|
|
9
|
+
export declare const appointmentOperations: INodeProperties;
|
|
10
|
+
export declare const appointmentFields: INodeProperties[];
|
|
11
|
+
export declare const appointmentHandlers: HandlerMap;
|