@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Linkedcamp
|
|
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
CHANGED
|
@@ -1,3 +1,142 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.linkedcamp.com"><img src="assets/logo-wide-1200.png" alt="Linkedcamp" width="480"></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# @linkedcampai/n8n-nodes-linkedcamp
|
|
6
|
+
|
|
7
|
+
The official [n8n](https://n8n.io) nodes for [Linkedcamp](https://www.linkedcamp.com).
|
|
8
|
+
|
|
9
|
+
Linkedcamp is agentic LinkedIn and email outreach for lead generation agencies. Each client runs as its own sub-account, and every LinkedIn account gets a country-matched dedicated IP, free on every plan. Use this node to add leads to campaigns from any form, CRM or enrichment tool, react instantly when a prospect accepts a connection or replies, write enrichment data back to leads, and manage campaigns and replies. Actions run on the Linkedcamp MCP server, so the same API key also works in AI assistants. Plans start from $79/mo with a 14-day trial.
|
|
10
|
+
|
|
11
|
+
The package contains three nodes:
|
|
12
|
+
|
|
13
|
+
| Node | What it does |
|
|
14
|
+
|---|---|
|
|
15
|
+
| **Linkedcamp** | Actions on campaigns, leads, conversations, tags, tasks, reminders, appointments and clients |
|
|
16
|
+
| **Linkedcamp Trigger** | Starts a workflow instantly when a Linkedcamp event happens (reply, connection accepted, email opened, ...) |
|
|
17
|
+
| **Linkedcamp Poll Trigger** | Checks Linkedcamp on a schedule for new appointments, campaigns, replies and connections |
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
**n8n Cloud and self-hosted n8n (v1.94.0 or later):** once the node is verified, open the nodes panel, search for **Linkedcamp** and install it.
|
|
22
|
+
|
|
23
|
+
**Self-hosted n8n:** go to **Settings → Community Nodes → Install**, enter `@linkedcampai/n8n-nodes-linkedcamp` and confirm. See the [n8n community nodes guide](https://docs.n8n.io/integrations/community-nodes/installation-and-management/).
|
|
24
|
+
|
|
25
|
+
## Credentials
|
|
26
|
+
|
|
27
|
+
1. In Linkedcamp, open **Settings → Integrations → API** ([direct link](https://app.linkedcamp.com/settings/integrations?type=api)) and copy your API key. The key needs a plan with Pro features (Pro or Agency) and the **Integrations** permission.
|
|
28
|
+
2. In n8n, create a **Linkedcamp API** credential and paste the key.
|
|
29
|
+
3. Click **Test**. n8n asks Linkedcamp who the key belongs to; a wrong or rotated key is rejected.
|
|
30
|
+
|
|
31
|
+
One key covers all three nodes. It is sent as the `X-Api-Key` header to `https://mcp.linkedcamp.com/mcp`.
|
|
32
|
+
|
|
33
|
+
Agency owners: the key of the account owner can read client sub-accounts. Use the **Client** option on Campaign → Get Many, Campaign → Get Stats and Tag → Get Many.
|
|
34
|
+
|
|
35
|
+
## Operations
|
|
36
|
+
|
|
37
|
+
| Resource | Operation | Notes |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| Account | Get | Plan, role and permissions behind the key |
|
|
40
|
+
| Appointment | Get Many | Filter by lead, conversation or status |
|
|
41
|
+
| Blacklist | Add Entry | Profile URL, company URL, keyword, job title or email, per LinkedIn account |
|
|
42
|
+
| Campaign | Create | Creates a **draft**. Nothing is sent until it is launched |
|
|
43
|
+
| Campaign | Get | Optionally includes the sequence |
|
|
44
|
+
| Campaign | Get Funnel | How many leads reached each stage |
|
|
45
|
+
| Campaign | Get Many | Filter by status or keyword. Simplify toggle |
|
|
46
|
+
| Campaign | Get Stats | One campaign, or the whole account when no campaign is set |
|
|
47
|
+
| Campaign | Launch | **Starts sending real outreach** to the campaign's leads |
|
|
48
|
+
| Campaign | Pause or Resume | Resume works only on a paused campaign |
|
|
49
|
+
| Client | Get Many | Agency client sub-accounts (owner key only) |
|
|
50
|
+
| Conversation | Draft AI Reply | Writes a suggested reply with a connected AI provider. Sends nothing |
|
|
51
|
+
| Conversation | Get | Includes messages. **Marks the thread as read** in Linkedcamp |
|
|
52
|
+
| Conversation | Get Many | The unified inbox. Simplify toggle |
|
|
53
|
+
| Conversation | Send Message | **Delivered immediately on LinkedIn or email; cannot be recalled** |
|
|
54
|
+
| Conversation | Update | Archive, mark read, hand over between the AI agent and a human |
|
|
55
|
+
| Lead | Add Many to Campaign | Upload up to 5,000 rows (from input items or JSON) with a column mapping |
|
|
56
|
+
| Lead | Add Note | Internal note, never sent |
|
|
57
|
+
| Lead | Add to Blacklist | **Permanent and account-wide** |
|
|
58
|
+
| Lead | Add to Campaign | By LinkedIn Profile URL or email, with optional details and custom fields |
|
|
59
|
+
| Lead | Get | Optionally with activities and messages |
|
|
60
|
+
| Lead | Get Many | Filter by campaign, status, keyword, tags or date. Simplify toggle |
|
|
61
|
+
| Lead | Update | Contact details, custom fields and flags (paused, excluded, interested, seen) |
|
|
62
|
+
| Reminder | Create | Optionally linked to a lead, conversation or LinkedIn account |
|
|
63
|
+
| Tag | Create | Name plus interest (positive, neutral, negative) |
|
|
64
|
+
| Tag | Get Many | |
|
|
65
|
+
| Task | Create or Update | Leave Task ID empty to create |
|
|
66
|
+
| Tool | Call Any Tool | Advanced: call any Linkedcamp MCP tool by name with JSON arguments |
|
|
67
|
+
|
|
68
|
+
Campaign, Lead, Conversation, LinkedIn Account and Client fields can be picked **From List** (searchable) or entered **By ID**.
|
|
69
|
+
|
|
70
|
+
## Triggers
|
|
71
|
+
|
|
72
|
+
### Linkedcamp Trigger (instant)
|
|
73
|
+
|
|
74
|
+
| Event | Fires when |
|
|
75
|
+
|---|---|
|
|
76
|
+
| New Reply | A lead replies on LinkedIn or email |
|
|
77
|
+
| Connection Accepted | A lead accepts a connection request |
|
|
78
|
+
| Connection Request Sent | A connection request is sent |
|
|
79
|
+
| Email Sent | An email is sent to a lead |
|
|
80
|
+
| Email Opened | A lead opens an email |
|
|
81
|
+
| Email Link Clicked | A lead clicks a tracked link |
|
|
82
|
+
| Email Bounced | An email bounces |
|
|
83
|
+
| Unsubscribed | A lead unsubscribes |
|
|
84
|
+
|
|
85
|
+
Activating the workflow creates a Linkedcamp automation called `n8n – <event>` that posts each event to the workflow. Deactivating the workflow switches that automation off. Optionally limit it to one campaign. The event body is passed to the workflow exactly as Linkedcamp sends it (lead, campaign, company and LinkedIn account details under `data`).
|
|
86
|
+
|
|
87
|
+
### Linkedcamp Poll Trigger (scheduled)
|
|
88
|
+
|
|
89
|
+
| Event | Checks |
|
|
90
|
+
|---|---|
|
|
91
|
+
| New Appointment Booked | Confirmed appointments |
|
|
92
|
+
| New Campaign | Newly created campaigns |
|
|
93
|
+
| New Replied Lead | Leads with status Replied |
|
|
94
|
+
| New Connected Lead | Leads with status Connected |
|
|
95
|
+
|
|
96
|
+
The first run records what already exists and emits nothing, so only new items start the workflow. A manual test run returns the newest item.
|
|
97
|
+
|
|
98
|
+
## Example workflows
|
|
99
|
+
|
|
100
|
+
**New reply → Slack.** Linkedcamp Trigger (New Reply) → Slack (Send Message) with `{{ $json.data.fullName }}` and the campaign name. Optionally add Linkedcamp → Conversation → Draft AI Reply and post the draft for a human to approve.
|
|
101
|
+
|
|
102
|
+
**Form → add lead to campaign.** n8n Form Trigger (or Typeform, HubSpot, Tally) → Linkedcamp → Lead → Add to Campaign, mapping the LinkedIn URL or email, first name and job title. Add enrichment in between and pass extra data as custom fields for personalisation.
|
|
103
|
+
|
|
104
|
+
**Appointment booked → CRM.** Linkedcamp Poll Trigger (New Appointment Booked) → Linkedcamp → Lead → Get (with the appointment's lead ID) → HubSpot / Pipedrive (Create Deal).
|
|
105
|
+
|
|
106
|
+
## Using Linkedcamp in an AI Agent
|
|
107
|
+
|
|
108
|
+
The same API key works with n8n's **MCP Client Tool** in an AI Agent workflow:
|
|
109
|
+
|
|
110
|
+
- Endpoint: `https://mcp.linkedcamp.com/mcp`
|
|
111
|
+
- Transport: HTTP Streamable
|
|
112
|
+
- Authentication: header `X-Api-Key: <your key>`
|
|
113
|
+
|
|
114
|
+
The Linkedcamp node is also marked as usable as an AI tool, so it can be attached to an AI Agent directly.
|
|
115
|
+
|
|
116
|
+
## Links
|
|
117
|
+
|
|
118
|
+
- [Linkedcamp + n8n](https://www.linkedcamp.com/integrations/n8n)
|
|
119
|
+
- [Linkedcamp MCP documentation](https://docs.linkedcamp.com/mcp/overview)
|
|
120
|
+
- [Linkedcamp](https://www.linkedcamp.com)
|
|
121
|
+
|
|
122
|
+
## Development
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm install
|
|
126
|
+
npm run build # compile to dist/
|
|
127
|
+
npm run lint # n8n community node lint
|
|
128
|
+
npm test # unit + node behaviour tests (no network)
|
|
129
|
+
npm run dev # local n8n with the nodes loaded
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`dev/bootstrap.mjs` captures real, anonymised responses from a test account into `dev/captures/`:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
LINKEDCAMP_TEST_API_KEY=... node dev/bootstrap.mjs
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
It calls read-only tools only. The `dev/` and `test/` folders are not published to npm.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class LinkedcampApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkedcampApi = void 0;
|
|
4
|
+
class LinkedcampApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'linkedcampApi';
|
|
7
|
+
this.displayName = 'Linkedcamp API';
|
|
8
|
+
this.icon = { light: 'file:../nodes/Linkedcamp/linkedcamp.svg', dark: 'file:../nodes/Linkedcamp/linkedcamp.svg' };
|
|
9
|
+
this.documentationUrl = 'https://docs.linkedcamp.com/mcp/quickstart';
|
|
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: 'Find it in Linkedcamp under Settings → Integrations → API. Needs a plan with Pro features (Pro or Agency) and the Integrations permission.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
headers: {
|
|
25
|
+
'X-Api-Key': '={{$credentials.apiKey}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://mcp.linkedcamp.com',
|
|
32
|
+
url: '/mcp',
|
|
33
|
+
method: 'POST',
|
|
34
|
+
headers: {
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
Accept: 'application/json, text/event-stream',
|
|
37
|
+
'MCP-Protocol-Version': '2025-06-18',
|
|
38
|
+
},
|
|
39
|
+
body: {
|
|
40
|
+
jsonrpc: '2.0',
|
|
41
|
+
id: 1,
|
|
42
|
+
method: 'tools/call',
|
|
43
|
+
params: { name: 'whoami', arguments: {} },
|
|
44
|
+
},
|
|
45
|
+
json: true,
|
|
46
|
+
},
|
|
47
|
+
rules: [
|
|
48
|
+
{
|
|
49
|
+
type: 'responseSuccessBody',
|
|
50
|
+
properties: {
|
|
51
|
+
key: 'result.isError',
|
|
52
|
+
value: true,
|
|
53
|
+
message: 'Linkedcamp did not accept this API key. Copy it again from Settings → Integrations → API.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.LinkedcampApi = LinkedcampApi;
|
|
61
|
+
//# sourceMappingURL=LinkedcampApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkedcampApi.credentials.js","sourceRoot":"","sources":["../../credentials/LinkedcampApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QAEvB,gBAAW,GAAG,gBAAgB,CAAC;QAE/B,SAAI,GAAS,EAAE,KAAK,EAAE,yCAAyC,EAAE,IAAI,EAAE,yCAAyC,EAAE,CAAC;QAEnH,qBAAgB,GAAG,4CAA4C,CAAC;QAEhE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,4IAA4I;aAC7I;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAOF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,4BAA4B;gBACrC,GAAG,EAAE,MAAM;gBACX,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACR,cAAc,EAAE,kBAAkB;oBAClC,MAAM,EAAE,qCAAqC;oBAC7C,sBAAsB,EAAE,YAAY;iBACpC;gBACD,IAAI,EAAE;oBACL,OAAO,EAAE,KAAK;oBACd,EAAE,EAAE,CAAC;oBACL,MAAM,EAAE,YAAY;oBACpB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;iBACzC;gBACD,IAAI,EAAE,IAAI;aACV;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,UAAU,EAAE;wBACX,GAAG,EAAE,gBAAgB;wBACrB,KAAK,EAAE,IAAI;wBACX,OAAO,EAAE,2FAA2F;qBACpG;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAjED,sCAiEC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Linkedcamp implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
listSearch: {
|
|
6
|
+
searchCampaigns(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
7
|
+
searchLeads(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
8
|
+
searchConversations(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
9
|
+
searchLinkedinAccounts(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
10
|
+
searchClients(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
11
|
+
};
|
|
12
|
+
loadOptions: {
|
|
13
|
+
getTools(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Linkedcamp = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const mcp_1 = require("./transport/mcp");
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
|
+
const account_1 = require("./descriptions/account");
|
|
8
|
+
const blacklist_1 = require("./descriptions/blacklist");
|
|
9
|
+
const campaign_1 = require("./descriptions/campaign");
|
|
10
|
+
const conversation_1 = require("./descriptions/conversation");
|
|
11
|
+
const crm_1 = require("./descriptions/crm");
|
|
12
|
+
const lead_1 = require("./descriptions/lead");
|
|
13
|
+
const tag_1 = require("./descriptions/tag");
|
|
14
|
+
const HANDLERS = {
|
|
15
|
+
account: account_1.accountHandlers,
|
|
16
|
+
appointment: crm_1.appointmentHandlers,
|
|
17
|
+
blacklist: blacklist_1.blacklistHandlers,
|
|
18
|
+
campaign: campaign_1.campaignHandlers,
|
|
19
|
+
client: account_1.clientHandlers,
|
|
20
|
+
conversation: conversation_1.conversationHandlers,
|
|
21
|
+
lead: lead_1.leadHandlers,
|
|
22
|
+
reminder: crm_1.reminderHandlers,
|
|
23
|
+
tag: tag_1.tagHandlers,
|
|
24
|
+
task: crm_1.taskHandlers,
|
|
25
|
+
tool: account_1.toolHandlers,
|
|
26
|
+
};
|
|
27
|
+
class Linkedcamp {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.description = {
|
|
30
|
+
displayName: 'Linkedcamp',
|
|
31
|
+
name: 'linkedcamp',
|
|
32
|
+
icon: { light: 'file:linkedcamp.svg', dark: 'file:linkedcamp.svg' },
|
|
33
|
+
group: ['transform'],
|
|
34
|
+
version: 1,
|
|
35
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
36
|
+
description: 'Run Linkedcamp LinkedIn and email outreach: campaigns, leads, inbox replies and AI agents',
|
|
37
|
+
defaults: { name: 'Linkedcamp' },
|
|
38
|
+
usableAsTool: true,
|
|
39
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
40
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
41
|
+
credentials: [{ name: 'linkedcampApi', required: true }],
|
|
42
|
+
properties: [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Resource',
|
|
45
|
+
name: 'resource',
|
|
46
|
+
type: 'options',
|
|
47
|
+
noDataExpression: true,
|
|
48
|
+
options: [
|
|
49
|
+
{ name: 'Account', value: 'account' },
|
|
50
|
+
{ name: 'Appointment', value: 'appointment' },
|
|
51
|
+
{ name: 'Blacklist', value: 'blacklist' },
|
|
52
|
+
{ name: 'Campaign', value: 'campaign' },
|
|
53
|
+
{ name: 'Client', value: 'client', description: 'Client sub-accounts of an agency' },
|
|
54
|
+
{ name: 'Conversation', value: 'conversation' },
|
|
55
|
+
{ name: 'Lead', value: 'lead' },
|
|
56
|
+
{ name: 'Reminder', value: 'reminder' },
|
|
57
|
+
{ name: 'Tag', value: 'tag' },
|
|
58
|
+
{ name: 'Task', value: 'task' },
|
|
59
|
+
{ name: 'Tool', value: 'tool', description: 'Call any Linkedcamp MCP tool' },
|
|
60
|
+
],
|
|
61
|
+
default: 'lead',
|
|
62
|
+
},
|
|
63
|
+
account_1.accountOperations,
|
|
64
|
+
crm_1.appointmentOperations,
|
|
65
|
+
...crm_1.appointmentFields,
|
|
66
|
+
blacklist_1.blacklistOperations,
|
|
67
|
+
...blacklist_1.blacklistFields,
|
|
68
|
+
campaign_1.campaignOperations,
|
|
69
|
+
...campaign_1.campaignFields,
|
|
70
|
+
account_1.clientOperations,
|
|
71
|
+
...account_1.clientFields,
|
|
72
|
+
conversation_1.conversationOperations,
|
|
73
|
+
...conversation_1.conversationFields,
|
|
74
|
+
lead_1.leadOperations,
|
|
75
|
+
...lead_1.leadFields,
|
|
76
|
+
crm_1.reminderOperations,
|
|
77
|
+
...crm_1.reminderFields,
|
|
78
|
+
tag_1.tagOperations,
|
|
79
|
+
...tag_1.tagFields,
|
|
80
|
+
crm_1.taskOperations,
|
|
81
|
+
...crm_1.taskFields,
|
|
82
|
+
account_1.toolOperations,
|
|
83
|
+
...account_1.toolFields,
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
this.methods = { listSearch: shared_1.listSearch, loadOptions: shared_1.loadOptions };
|
|
87
|
+
}
|
|
88
|
+
async execute() {
|
|
89
|
+
var _a;
|
|
90
|
+
const items = this.getInputData();
|
|
91
|
+
const returnData = [];
|
|
92
|
+
const client = (0, mcp_1.createMcpClient)(this);
|
|
93
|
+
try {
|
|
94
|
+
for (let i = 0; i < items.length; i++) {
|
|
95
|
+
try {
|
|
96
|
+
const resource = this.getNodeParameter('resource', i);
|
|
97
|
+
const operation = this.getNodeParameter('operation', i);
|
|
98
|
+
const handler = (_a = HANDLERS[resource]) === null || _a === void 0 ? void 0 : _a[operation];
|
|
99
|
+
if (!handler) {
|
|
100
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported for resource "${resource}"`, { itemIndex: i });
|
|
101
|
+
}
|
|
102
|
+
const result = await handler(this, client, i);
|
|
103
|
+
const rows = Array.isArray(result) ? result : [result];
|
|
104
|
+
returnData.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), {
|
|
105
|
+
itemData: { item: i },
|
|
106
|
+
}));
|
|
107
|
+
if (resource === 'lead' &&
|
|
108
|
+
operation === 'addManyToCampaign' &&
|
|
109
|
+
this.getNodeParameter('rowsSource', i, 'items') === 'items') {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (this.continueOnFail()) {
|
|
115
|
+
returnData.push({
|
|
116
|
+
json: { error: error.message },
|
|
117
|
+
pairedItem: { item: i },
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
throw (0, mcp_1.toNodeError)(this, error, i);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
await client.close();
|
|
127
|
+
}
|
|
128
|
+
return [returnData];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.Linkedcamp = Linkedcamp;
|
|
132
|
+
//# sourceMappingURL=Linkedcamp.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Linkedcamp.node.js","sourceRoot":"","sources":["../../../nodes/Linkedcamp/Linkedcamp.node.ts"],"names":[],"mappings":";;;AAOA,+CAAuE;AAEvE,yCAA+D;AAC/D,qCAAmD;AAEnD,oDAAsK;AACtK,wDAAmG;AACnG,sDAA+F;AAC/F,8DAA+G;AAC/G,4CAU4B;AAC5B,8CAA+E;AAC/E,4CAA2E;AAE3E,MAAM,QAAQ,GAA+B;IAC5C,OAAO,EAAE,yBAAe;IACxB,WAAW,EAAE,yBAAmB;IAChC,SAAS,EAAE,6BAAiB;IAC5B,QAAQ,EAAE,2BAAgB;IAC1B,MAAM,EAAE,wBAAc;IACtB,YAAY,EAAE,mCAAoB;IAClC,IAAI,EAAE,mBAAY;IAClB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,IAAA,iBAAW,EAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;gBACnC,CAAC;YACF,CAAC;QACF,CAAC;gBAAS,CAAC;YACV,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAlHD,gCAkHC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "@linkedcampai/n8n-nodes-linkedcamp.linkedcamp",
|
|
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,14 @@
|
|
|
1
|
+
import type { INodeExecutionData, INodeType, INodeTypeDescription, IPollFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare class LinkedcampPollTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
listSearch: {
|
|
6
|
+
searchCampaigns(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
7
|
+
searchLeads(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
8
|
+
searchConversations(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
9
|
+
searchLinkedinAccounts(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
10
|
+
searchClients(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkedcampPollTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const mcp_1 = require("./transport/mcp");
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
|
+
const OVERLAP_MS = 5 * 60 * 1000;
|
|
8
|
+
const MANUAL_LOOKBACK_MS = 30 * 24 * 60 * 60 * 1000;
|
|
9
|
+
const MAX_SEEN = 5000;
|
|
10
|
+
const MAX_LEAD_PAGES = 10;
|
|
11
|
+
async function fetchItems(client, event, window, campaignId) {
|
|
12
|
+
if (event === 'newAppointment') {
|
|
13
|
+
const out = (0, shared_1.asObject)(await client.callTool('appointment_list', { status: 'CONFIRMED', page: 1 }));
|
|
14
|
+
return (0, shared_1.asArray)(out.appointments);
|
|
15
|
+
}
|
|
16
|
+
if (event === 'newCampaign') {
|
|
17
|
+
const out = (0, shared_1.asObject)(await client.callTool('campaign_list', { page: 1 }));
|
|
18
|
+
return (0, shared_1.asArray)(out.campaigns);
|
|
19
|
+
}
|
|
20
|
+
const status = event === 'newRepliedLead' ? 'REPLIED' : 'CONNECTED';
|
|
21
|
+
const leads = [];
|
|
22
|
+
for (let page = 1; page <= MAX_LEAD_PAGES; page++) {
|
|
23
|
+
const out = (0, shared_1.asObject)(await client.callTool('lead_list', (0, mcp_1.compact)({ status, campaignId, range: window, page, pageSize: 100 })));
|
|
24
|
+
const batch = (0, shared_1.asArray)(out.leads);
|
|
25
|
+
leads.push(...batch);
|
|
26
|
+
const total = typeof out.total === 'number' ? out.total : undefined;
|
|
27
|
+
if (batch.length < 100 || (total !== undefined && leads.length >= total))
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
return leads;
|
|
31
|
+
}
|
|
32
|
+
class LinkedcampPollTrigger {
|
|
33
|
+
constructor() {
|
|
34
|
+
this.description = {
|
|
35
|
+
displayName: 'Linkedcamp Poll Trigger',
|
|
36
|
+
name: 'linkedcampPollTrigger',
|
|
37
|
+
icon: { light: 'file:linkedcamp.svg', dark: 'file:linkedcamp.svg' },
|
|
38
|
+
group: ['trigger'],
|
|
39
|
+
version: 1,
|
|
40
|
+
subtitle: '={{$parameter["event"]}}',
|
|
41
|
+
description: 'Starts the workflow when Linkedcamp has new appointments, campaigns, replies or connections',
|
|
42
|
+
defaults: { name: 'Linkedcamp Poll Trigger' },
|
|
43
|
+
polling: true,
|
|
44
|
+
inputs: [],
|
|
45
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
46
|
+
credentials: [{ name: 'linkedcampApi', required: true }],
|
|
47
|
+
properties: [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Event',
|
|
50
|
+
name: 'event',
|
|
51
|
+
type: 'options',
|
|
52
|
+
required: true,
|
|
53
|
+
default: 'newRepliedLead',
|
|
54
|
+
options: [
|
|
55
|
+
{
|
|
56
|
+
name: 'New Appointment Booked',
|
|
57
|
+
value: 'newAppointment',
|
|
58
|
+
description: 'A confirmed appointment appears',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'New Campaign',
|
|
62
|
+
value: 'newCampaign',
|
|
63
|
+
description: 'A campaign is created',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'New Connected Lead',
|
|
67
|
+
value: 'newConnectedLead',
|
|
68
|
+
description: 'A lead accepts a connection request',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'New Replied Lead',
|
|
72
|
+
value: 'newRepliedLead',
|
|
73
|
+
description: 'A lead replies',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Options',
|
|
79
|
+
name: 'options',
|
|
80
|
+
type: 'collection',
|
|
81
|
+
placeholder: 'Add Option',
|
|
82
|
+
default: {},
|
|
83
|
+
displayOptions: { show: { event: ['newRepliedLead', 'newConnectedLead'] } },
|
|
84
|
+
options: [
|
|
85
|
+
(0, shared_1.optionalLocator)('campaignId', 'Campaign', 'searchCampaigns', 'Only leads from this campaign'),
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
this.methods = { listSearch: shared_1.listSearch };
|
|
91
|
+
}
|
|
92
|
+
async poll() {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
const event = this.getNodeParameter('event');
|
|
95
|
+
const options = this.getNodeParameter('options', {});
|
|
96
|
+
const campaignId = (0, shared_1.nestedLocator)(options.campaignId);
|
|
97
|
+
const state = this.getWorkflowStaticData('node');
|
|
98
|
+
const manual = this.getMode() === 'manual';
|
|
99
|
+
const firstRun = state.lastPoll === undefined;
|
|
100
|
+
const now = Date.now();
|
|
101
|
+
const from = firstRun ? now - MANUAL_LOOKBACK_MS : state.lastPoll - OVERLAP_MS;
|
|
102
|
+
const client = (0, mcp_1.createMcpClient)(this);
|
|
103
|
+
let items;
|
|
104
|
+
try {
|
|
105
|
+
items = await fetchItems(client, event, { from, to: now }, campaignId);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
throw (0, mcp_1.toNodeError)(this, error);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
await client.close();
|
|
112
|
+
}
|
|
113
|
+
const seen = new Set((_a = state.seenIds) !== null && _a !== void 0 ? _a : []);
|
|
114
|
+
const fresh = items.filter((item) => {
|
|
115
|
+
const id = item._id === undefined || item._id === null ? '' : String(item._id);
|
|
116
|
+
return id !== '' && !seen.has(id);
|
|
117
|
+
});
|
|
118
|
+
if (!manual) {
|
|
119
|
+
const ids = [...((_b = state.seenIds) !== null && _b !== void 0 ? _b : []), ...fresh.map((item) => String(item._id))];
|
|
120
|
+
state.seenIds = ids.slice(-MAX_SEEN);
|
|
121
|
+
state.lastPoll = now;
|
|
122
|
+
}
|
|
123
|
+
if (firstRun && !manual)
|
|
124
|
+
return null;
|
|
125
|
+
const emit = manual ? items.slice(0, 1) : fresh;
|
|
126
|
+
if (!emit.length)
|
|
127
|
+
return null;
|
|
128
|
+
return [this.helpers.returnJsonArray(emit)];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.LinkedcampPollTrigger = LinkedcampPollTrigger;
|
|
132
|
+
//# sourceMappingURL=LinkedcampPollTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkedcampPollTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Linkedcamp/LinkedcampPollTrigger.node.ts"],"names":[],"mappings":";;;AAOA,+CAAmD;AAGnD,yCAAwE;AACxE,qCAAyF;AAGzF,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEpD,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,MAAM,cAAc,GAAG,EAAE,CAAC;AAS1B,KAAK,UAAU,UAAU,CACxB,MAAiB,EACjB,KAAgB,EAChB,MAAoC,EACpC,UAAkB;IAElB,IAAI,KAAK,KAAK,gBAAgB,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAA,iBAAQ,EAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CA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D;AAjGD,sDAiGC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "@linkedcampai/n8n-nodes-linkedcamp.linkedcampPollTrigger",
|
|
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,21 @@
|
|
|
1
|
+
import type { IHookFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class LinkedcampTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
listSearch: {
|
|
6
|
+
searchCampaigns(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
7
|
+
searchLeads(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
8
|
+
searchConversations(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
9
|
+
searchLinkedinAccounts(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
10
|
+
searchClients(this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
webhookMethods: {
|
|
14
|
+
default: {
|
|
15
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
16
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
17
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
21
|
+
}
|