n8n-nodes-linq 3.1.2 → 4.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.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Alex
3
+ Copyright (c) 2026 Everyday Workflows
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,150 +1,148 @@
1
1
  # n8n-nodes-linq
2
2
 
3
- Linq Partner API (v2) community node for n8n. This node lets you manage chats, messages (with attachments), phone numbers, webhooks, and contacts in Linq from your n8n workflows.
3
+ Community node for the Linq Partner API v3 in n8n. Use this node to manage chats, messages, attachments, phone numbers, webhooks, and contacts from your workflows.
4
4
 
5
- - Package: `n8n-nodes-linq`
6
- - Node icon: included (SVG)
7
- - API version: v2
8
- - Auth: Integration Token (`X-LINQ-INTEGRATION-TOKEN`)
5
+ **Ownership:** The Linq Partner API is owned and operated by Linq (https://linqapp.com/). This repository is community-maintained by Everyday Workflows.
6
+
7
+ **Disclaimer:** This is a community-built integration. It is not affiliated with, endorsed by, or supported by Linq App Inc.
8
+
9
+ **Acceptable use:** Users are responsible for complying with Linq’s Acceptable Use Policy and Apple’s Business Chat guidelines. Automated messaging should only be used for transactional or opted‑in communications.
10
+
11
+ ## Quick links
12
+
13
+ - Usage guide: [docs/usage.md](docs/usage.md)
14
+ - API reference (v3): [docs/api-reference.md](docs/api-reference.md)
15
+ - OpenAPI spec: [V3.yaml](V3.yaml)
16
+ - Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
17
+ - License: [LICENSE.md](LICENSE.md)
18
+
19
+ ## Requirements
20
+
21
+ - Node.js >= 20.15
22
+ - n8n compatible with `n8n-workflow` ^1.120.7
9
23
 
10
24
  ## Installation (in n8n)
11
25
 
12
26
  - Using the n8n UI:
13
- 1) Settings → Community Nodes → Install
14
- 2) Enter: `n8n-nodes-linq`
15
- 3) Restart n8n if prompted
27
+ 1. Settings → Community Nodes → Install
28
+ 2. Enter: `n8n-nodes-linq`
29
+ 3. Restart n8n if prompted
16
30
 
17
31
  - Headless / environment variable:
18
32
  - Add `n8n-nodes-linq` to `N8N_COMMUNITY_PACKAGES` (or install with npm in your instance) and restart n8n.
19
33
 
20
34
  ## Credentials
21
35
 
22
- Create a new credential of type "Linq API" and set your Integration Token:
36
+ Create a new credential of type **Linq API**:
23
37
 
24
- - Header used: `X-LINQ-INTEGRATION-TOKEN: <your token>`
25
- - The field is hidden in the UI (password type).
38
+ - **API Token**: Linq Partner API token used as `Authorization: Bearer <token>`
39
+ - **Webhook Signing Secret**: Required for Linq Trigger signature verification
40
+ - This is returned **only once** when a webhook subscription is created. Store it securely.
26
41
 
27
- Where it's defined:
28
- - [class LinqApi implements ICredentialType](credentials/LinqApi.credentials.ts:1)
42
+ Where its defined:
43
+
44
+ - [LinqApi.credentials.ts](credentials/LinqApi.credentials.ts:1)
29
45
 
30
46
  ## Node usage
31
47
 
32
- Add the "Linq" node to your workflow. The node provides Resources and Operations that map 1:1 to the documented Linq Partner API endpoints.
48
+ Add the **Linq** node to your workflow. Operations map to Linq Partner API v3 endpoints.
33
49
 
34
- - Node implementation:
35
- - [class Linq implements INodeType](nodes/Linq/Linq.node.ts:1)
36
- - Icon is configured at the node-level: `icon: 'file:linq.svg'`
37
- - SVG file: [linq.svg](nodes/Linq/linq.svg:1)
50
+ - Node implementation: [Linq.node.ts](nodes/Linq/Linq.node.ts:1)
51
+ - Icon: [linq.svg](nodes/Linq/linq.svg:1)
38
52
 
39
53
  ### Supported resources and operations
40
54
 
41
- The node implements all endpoints from your Linq Partner API documentation (v2):
42
-
43
- - Resource: Chat
44
- - Operations:
45
- - Get Many → GET `/chats` (requires `phone_number`; pagination supported)
46
- - Get One GET `/chats/:id`
47
- - FindGET `/chats/find` (requires your `phone_number` and `phone_numbers[]` of participants)
48
- - Create → POST `/chats` (requires `send_from`, supports group chats via `phone_numbers[]`, optional display name, initial `message.text`)
49
- - Share Contact → POST `/chats/{chat_id}/share_contact` (chat_id required; feature must be enabled by Linq)
50
-
51
- - Resource: Chat Message
52
- - Operations:
53
- - Get Many GET `/chats/{chat_id}/chat_messages`
54
- - Get One GET `/chat_messages/:id`
55
- - Create → POST `/chats/{chat_id}/chat_messages` (supports `text`, optional `attachment_urls[]`, optional `idempotency_key`)
56
- - Delete → DELETE `/chat_messages/:id`
57
- - Edit → POST `/chat_messages/:id/edit` (`text`)
58
- - React → POST `/chat_messages/:id/reactions` (`reaction`)
59
- - Get Reaction → GET `/chat_message_reactions/:reaction_id`
60
-
61
- - Resource: Phone Number
62
- - Operations:
63
- - Get Many → GET `/phone_numbers`
64
- - UpdatePUT `/phone_numbers/:id` (optional `forward_to`, optional `label`)
65
-
66
- - Resource: Webhook Subscription
67
- - Operations:
68
- - Get Many GET `/webhook_subscriptions`
69
- - Get One → GET `/webhook_subscriptions/:id`
70
- - Create → POST `/webhook_subscriptions`
71
- - Update → PUT `/webhook_subscriptions/:id`
72
- - DeleteDELETE `/webhook_subscriptions/:id`
73
-
74
- - Resource: Contact
75
- - Operations:
76
- - Create → POST `/contacts`
77
- - Get One → GET `/contacts/:id`
78
- - Update → PUT `/contacts/:id`
79
- - DeleteDELETE `/contacts/:id`
80
-
81
- ### Linq Trigger Node
82
-
83
- Add the "Linq Trigger" node to automatically start workflows when Linq events occur. The node automatically registers a webhook with Linq when the workflow is activated.
84
-
85
- - Supported Events:
86
- - Message Sent (`message.sent`)
87
- - Message Received (`message.received`)
88
- - Message Read (`message.read`)
89
- - Call Completed (`call.completed`)
90
- - Contact Created (`contact.created`)
91
- - Contact Updated (`contact.updated`)
92
- - Contact Deleted (`contact.deleted`)
93
-
94
- - Configuration:
95
- 1. Add the "Linq Trigger" node to your workflow
96
- 2. Select which events should trigger the workflow
97
- 3. Activate the workflow (this registers the webhook with Linq)
98
- 4. Linq will send events to your workflow when they occur
99
-
100
- - Security:
101
- - The node verifies the signature of incoming events using HMAC-SHA256
102
- - Requires the same Linq API credentials as the main node
103
-
104
- ### Example workflows
105
-
106
- 1) Send a group message
107
- - Resource: Chat
108
- - Operation: Create
55
+ **Chat**
56
+
57
+ - Get Many → `GET /v3/chats` (requires `from`, supports cursor/limit)
58
+ - Get One → `GET /v3/chats/{chatId}`
59
+ - Find`GET /v3/chats` (with `from` + `phone_numbers[]`)
60
+ - Create`POST /v3/chats`
61
+ - Share Contact `POST /v3/chats/{chatId}/share_contact_card`
62
+
63
+ **Chat Message**
64
+
65
+ - Get Many → `GET /v3/chats/{chatId}/messages`
66
+ - Get One → `GET /v3/messages/{messageId}`
67
+ - Create`POST /v3/chats/{chatId}/messages`
68
+ - Delete`DELETE /v3/messages/{messageId}`
69
+ - React`POST /v3/messages/{messageId}/reactions`
70
+
71
+ **Phone Number**
72
+
73
+ - Get Many`GET /v3/phonenumbers`
74
+ - Update → `PUT /v3/phonenumbers/{phoneNumberId}`
75
+
76
+ **Webhook Subscription**
77
+
78
+ - Get Many → `GET /v3/webhook-subscriptions`
79
+ - Get One → `GET /v3/webhook-subscriptions/{subscriptionId}`
80
+ - Create `POST /v3/webhook-subscriptions`
81
+ - Update → `PUT /v3/webhook-subscriptions/{subscriptionId}`
82
+ - Delete`DELETE /v3/webhook-subscriptions/{subscriptionId}`
83
+
84
+ **Contact (extension)**
85
+
86
+ - Create`POST /v3/contacts`
87
+ - Get One → `GET /v3/contacts/{contactId}`
88
+ - Update → `PUT /v3/contacts/{contactId}`
89
+ - Delete → `DELETE /v3/contacts/{contactId}`
90
+
91
+ **Chat Message (extension)**
92
+
93
+ - Edit`POST /v3/messages/{messageId}/edit`
94
+ - Get Reaction → `GET /v3/chat_message_reactions/{reactionId}`
95
+
96
+ > **Note:** The “extension” endpoints above are currently implemented in the node but are not present in `V3.yaml`. They will be aligned once the spec is updated.
97
+
98
+ ## Linq Trigger Node
99
+
100
+ Add the **Linq Trigger** node to start workflows when Linq events occur. The trigger automatically registers a webhook with Linq when the workflow is activated.
101
+
102
+ **Supported Events**
103
+
104
+ - `message.sent`
105
+ - `message.received`
106
+ - `message.read`
107
+ - `call.completed`
108
+ - `contact.created`
109
+ - `contact.updated`
110
+ - `contact.deleted`
111
+
112
+ **Security**
113
+
114
+ - The trigger verifies Linq webhooks using HMAC-SHA256
115
+ - Uses `X-Webhook-Timestamp` + raw request body for the signature payload: `{timestamp}.{payload}`
116
+ - Requires the **Webhook Signing Secret** from credentials
117
+
118
+ ## Examples
119
+
120
+ ### Send a group message
121
+
122
+ - Resource: Chat → Create
109
123
  - Fields:
110
124
  - Send From (required): `+13175551234`
111
125
  - Display Name (optional): `Project A`
112
126
  - Phone Numbers: `+13341234567, +13347654321`
113
127
  - Message Text: `Hello from n8n!`
114
128
 
115
- 2) Create a contact
116
- - Resource: Contact
117
- - Operation: Create
118
- - Fields:
119
- - First Name: `John`
120
- - Last Name: `Doe`
121
- - Email: `john@example.com`
122
- - Phone Number: `+15551234567`
123
- 3) Manage webhook subscriptions
124
- - Resource: Webhook Subscription
125
- - Operation: Create
129
+ ### Create a webhook subscription
130
+
131
+ - Resource: Webhook Subscription → Create
126
132
  - Fields:
127
133
  - Webhook URL: `https://example.com/webhooks/linq`
128
134
  - Events: `message.sent, message.received, contact.created`
129
- - Version: `2`
130
135
  - Active: `true`
131
136
 
132
- 4) Update phone number forwarding
133
- - Resource: Phone Number
134
- - Operation: Update
135
- - Fields:
136
- - Phone Number ID: `<id>`
137
- - Forward To (optional): `+15551230000`
138
- - Label (optional): `Support Line`
139
-
140
137
  ## Development
141
138
 
142
139
  Requirements:
143
- - Node.js ≥ 20
144
- - npm or pnpm (npm commands shown below)
145
- - n8n local instance if testing end-to-end
140
+
141
+ - Node.js >= 20
142
+ - npm or pnpm (npm commands below)
146
143
 
147
144
  Install and build:
145
+
148
146
  ```bash
149
147
  cd n8n-nodes-linq
150
148
  npm install
@@ -152,7 +150,8 @@ npm run build
152
150
  npm run lint
153
151
  ```
154
152
 
155
- Local link for testing in a local n8n:
153
+ Local link for testing in n8n:
154
+
156
155
  ```bash
157
156
  # in this folder
158
157
  npm link
@@ -162,33 +161,21 @@ npm link n8n-nodes-linq
162
161
  ```
163
162
 
164
163
  Project files of interest:
164
+
165
165
  - Node: [Linq.node.ts](nodes/Linq/Linq.node.ts:1)
166
+ - Trigger: [LinqTrigger.node.ts](nodes/LinqTrigger/LinqTrigger.node.ts:1)
166
167
  - Credentials: [LinqApi.credentials.ts](credentials/LinqApi.credentials.ts:1)
167
- - Gulp (copies icons): [gulpfile.js](gulpfile.js:1)
168
+ - Gulp (icons): [gulpfile.js](gulpfile.js:1)
168
169
  - TypeScript config: [tsconfig.json](tsconfig.json:1)
169
170
  - Index shim: [index.js](index.js:1)
170
171
 
171
172
  ## Publishing to npm
172
173
 
173
- 1) Ensure metadata is correct in [package.json](package.json:1)
174
- - name: `n8n-nodes-linq`
175
- - version: increment for each release, e.g. `0.1.0`
176
- - author: `"alexautomates"`
177
- - keywords include: `n8n-community-node-package`
178
- - `files: ["dist"]` to publish only built files
179
- - `n8n` block lists built nodes and credentials in `dist/`
180
-
181
- 2) Build and publish:
182
174
  ```bash
183
175
  npm run build
184
176
  npm publish --access public
185
177
  ```
186
178
 
187
- 3) Users can install from the n8n UI (Community Nodes) by typing `n8n-nodes-linq`.
188
-
189
- ## Icon / Branding
190
-
191
- - Icon file is included at: [nodes/Linq/linq.svg](nodes/Linq/linq.svg:1)
192
- - Node description references it as `icon: 'file:linq.svg'`, so it renders in the n8n UI.
193
-
194
179
  ## License
180
+
181
+ MIT — see [LICENSE.md](LICENSE.md).
@@ -2,30 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LinqApi = void 0;
4
4
  class LinqApi {
5
- constructor() {
6
- this.name = 'linqApi';
7
- this.displayName = 'Linq API';
8
- this.documentationUrl = 'https://apidocs.linqapp.com/reference/';
9
- this.properties = [
10
- {
11
- displayName: 'Integration Token',
12
- name: 'integrationToken',
13
- type: 'string',
14
- default: '',
15
- description: 'Your Linq Integration Token',
16
- typeOptions: {
17
- password: true,
18
- },
5
+ name = 'linqApi';
6
+ displayName = 'Linq API';
7
+ documentationUrl = 'https://apidocs.linqapp.com/reference/';
8
+ properties = [
9
+ {
10
+ displayName: 'API Token',
11
+ name: 'integrationToken',
12
+ type: 'string',
13
+ default: '',
14
+ description: 'Your Linq Partner API token (Bearer)',
15
+ typeOptions: {
16
+ password: true,
19
17
  },
20
- ];
21
- this.authenticate = {
22
- type: 'generic',
23
- properties: {
24
- headers: {
25
- Authorization: 'Bearer {{$credentials.integrationToken}}',
26
- },
18
+ },
19
+ {
20
+ displayName: 'Webhook Signing Secret',
21
+ name: 'webhookSigningSecret',
22
+ type: 'string',
23
+ default: '',
24
+ description: 'Signing secret returned when creating a webhook subscription (required for Linq Trigger)',
25
+ typeOptions: {
26
+ password: true,
27
27
  },
28
- };
29
- }
28
+ },
29
+ ];
30
+ authenticate = {
31
+ type: 'generic',
32
+ properties: {
33
+ headers: {
34
+ Authorization: 'Bearer {{$credentials.integrationToken}}',
35
+ },
36
+ },
37
+ };
30
38
  }
31
39
  exports.LinqApi = LinqApi;
@@ -1,5 +1,4 @@
1
- import { IExecuteFunctions } from 'n8n-workflow';
2
- import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
3
2
  export declare class Linq implements INodeType {
4
3
  description: INodeTypeDescription;
5
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;