n8n-nodes-pilot-status 1.0.4 → 1.0.5

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/README.md CHANGED
@@ -56,8 +56,9 @@ To use it:
56
56
  - **Opt-in Created:** Triggered when an opt-in is recorded (consent message received by the Pilot Status number).
57
57
 
58
58
  Webhook payload notes:
59
- - Customer webhook payloads do not include: `projectSlug`, `lastMessageId`, `correlationId`.
60
- - `message.received` includes `fromMe` (boolean).
59
+ - Customer webhook payloads do not include: `projectSlug`, `lastMessageId`. Optional `correlationId` (same as HTTP 202 when present) may appear on outbound status events and on `message.reply` / `message.received` when correlated to a prior send.
60
+ - `message.reply` always includes `messageRepliedId`: Pilot Status internal id of the original outbound message when correlated, or `null` if none was found — use `quotedMessageId` with `message.sent`’s `messageId` when it is `null`.
61
+ - `message.received` includes `fromMe` (boolean) and `fromName` (string, optional).
61
62
  - For outbound status events (`message.sent`, `message.delivered`, `message.read`, `message.failed`): `messageId` is the WhatsApp provider id (may be `null`) and `internalMessageId` is the Pilot Status message id.
62
63
 
63
64
  ---
@@ -72,7 +73,8 @@ The **Pilot Status** node provides several resources and operations to manage yo
72
73
  - **Check Opt-In:** Check if a specific destination number has opted in to receive messages from your project (required for LIVE environments when using the Pilot Status shared number).
73
74
 
74
75
  ### 2. Number
75
- - **Create:** Provision a new WhatsApp number instance. It returns a base64 QR Code that you can scan to connect the device. By default, the number is linked to the API Key used in the request.
76
+ - **Create:** Provision a new WhatsApp number instance. It returns a base64 QR Code and optional `pairingCode` (letter code) for WhatsApp “link a device”. By default, the number is linked to the API Key used in the request.
77
+ - **Connect (QR + pairing code):** Regenerate QR and pairing code for an existing instance (only when not `OPEN`).
76
78
  - **Get Status:** Check the connection status of a WhatsApp instance (e.g., `CONNECTING`, `OPEN`).
77
79
 
78
80
  ### 3. Project
@@ -194,6 +194,45 @@ class PilotStatus {
194
194
  },
195
195
  },
196
196
  },
197
+ {
198
+ displayName: 'Variables Mode',
199
+ name: 'variablesMode',
200
+ type: 'options',
201
+ noDataExpression: true,
202
+ options: [
203
+ {
204
+ name: 'UI Collection',
205
+ value: 'collection',
206
+ description: 'Add variables one by one in the UI',
207
+ },
208
+ {
209
+ name: 'JSON Object',
210
+ value: 'json',
211
+ description: 'Provide an object with key-value pairs',
212
+ },
213
+ ],
214
+ default: 'collection',
215
+ displayOptions: {
216
+ show: {
217
+ resource: ['message'],
218
+ operation: ['send'],
219
+ },
220
+ },
221
+ },
222
+ {
223
+ displayName: 'Variables (JSON)',
224
+ name: 'variablesJson',
225
+ type: 'string',
226
+ default: '{}',
227
+ displayOptions: {
228
+ show: {
229
+ resource: ['message'],
230
+ operation: ['send'],
231
+ variablesMode: ['json'],
232
+ },
233
+ },
234
+ description: 'A JSON object containing key-value pairs for variables',
235
+ },
197
236
  {
198
237
  displayName: 'Variables',
199
238
  name: 'variablesUi',
@@ -205,6 +244,7 @@ class PilotStatus {
205
244
  show: {
206
245
  resource: ['message'],
207
246
  operation: ['send'],
247
+ variablesMode: ['collection'],
208
248
  },
209
249
  },
210
250
  default: {},
@@ -246,7 +286,7 @@ class PilotStatus {
246
286
  operation: ['send'],
247
287
  },
248
288
  },
249
- default: '={{ ($parameter.variablesUi?.values || []).reduce((acc, cur) => { acc[cur.name] = cur.value; return acc; }, {}) }}',
289
+ default: '={{ $parameter.variablesMode === "json" ? (typeof $parameter.variablesJson === "string" ? JSON.parse($parameter.variablesJson) : $parameter.variablesJson) : ($parameter.variablesUi?.values || []).reduce((acc, cur) => { acc[cur.name] = cur.value; return acc; }, {}) }}',
250
290
  routing: {
251
291
  send: {
252
292
  type: 'body',
@@ -255,30 +295,33 @@ class PilotStatus {
255
295
  },
256
296
  },
257
297
  {
258
- displayName: 'Deliver At',
259
- name: 'deliverAt',
260
- type: 'dateTime',
298
+ displayName: 'Additional Fields',
299
+ name: 'additionalFields',
300
+ type: 'collection',
301
+ placeholder: 'Add Field',
302
+ default: {},
261
303
  displayOptions: {
262
304
  show: {
263
305
  resource: ['message'],
264
306
  operation: ['send'],
265
307
  },
266
308
  },
267
- default: '',
268
- description: 'Optional scheduled delivery time (ISO8601)',
269
- },
270
- {
271
- displayName: 'Deliver Until',
272
- name: 'deliverUntil',
273
- type: 'dateTime',
274
- displayOptions: {
275
- show: {
276
- resource: ['message'],
277
- operation: ['send'],
309
+ options: [
310
+ {
311
+ displayName: 'Deliver At',
312
+ name: 'deliverAt',
313
+ type: 'dateTime',
314
+ default: '',
315
+ description: 'Optional scheduled delivery time (ISO8601)',
278
316
  },
279
- },
280
- default: '',
281
- description: 'Optional expiration limit for the message delivery (ISO8601)',
317
+ {
318
+ displayName: 'Deliver Until',
319
+ name: 'deliverUntil',
320
+ type: 'dateTime',
321
+ default: '',
322
+ description: 'Optional expiration limit for the message delivery (ISO8601)',
323
+ },
324
+ ],
282
325
  },
283
326
  {
284
327
  displayName: 'Deliver At',
@@ -290,7 +333,7 @@ class PilotStatus {
290
333
  operation: ['send'],
291
334
  },
292
335
  },
293
- default: '={{ $parameter.deliverAt ? new Date($parameter.deliverAt).toISOString() : undefined }}',
336
+ default: '={{ $parameter.additionalFields?.deliverAt ? new Date($parameter.additionalFields.deliverAt).toISOString() : undefined }}',
294
337
  routing: {
295
338
  send: {
296
339
  type: 'body',
@@ -308,7 +351,7 @@ class PilotStatus {
308
351
  operation: ['send'],
309
352
  },
310
353
  },
311
- default: '={{ $parameter.deliverUntil ? new Date($parameter.deliverUntil).toISOString() : undefined }}',
354
+ default: '={{ $parameter.additionalFields?.deliverUntil ? new Date($parameter.additionalFields.deliverUntil).toISOString() : undefined }}',
312
355
  routing: {
313
356
  send: {
314
357
  type: 'body',
@@ -481,7 +524,7 @@ class PilotStatus {
481
524
  operation: ['create'],
482
525
  },
483
526
  },
484
- default: 30,
527
+ default: 3650,
485
528
  routing: {
486
529
  send: {
487
530
  type: 'body',
@@ -527,6 +570,18 @@ class PilotStatus {
527
570
  },
528
571
  },
529
572
  },
573
+ {
574
+ name: 'Connect (QR + pairing code)',
575
+ value: 'connect',
576
+ description: 'Generate a new QR code and optional letter pairing code (only when instance is not OPEN)',
577
+ action: 'Connect a number',
578
+ routing: {
579
+ request: {
580
+ method: 'GET',
581
+ url: '=/numbers/{{$parameter.numberId}}/connect',
582
+ },
583
+ },
584
+ },
530
585
  ],
531
586
  default: 'create',
532
587
  },
@@ -588,7 +643,7 @@ class PilotStatus {
588
643
  },
589
644
  },
590
645
  },
591
- // Number: Get Status
646
+ // Number: Get Status / Connect
592
647
  {
593
648
  displayName: 'Number Instance ID',
594
649
  name: 'numberId',
@@ -596,7 +651,7 @@ class PilotStatus {
596
651
  displayOptions: {
597
652
  show: {
598
653
  resource: ['number'],
599
- operation: ['getStatus'],
654
+ operation: ['getStatus', 'connect'],
600
655
  },
601
656
  },
602
657
  default: '',
@@ -65,6 +65,22 @@ class PilotStatusTrigger {
65
65
  name: 'Opt-in Created',
66
66
  value: 'optin.created',
67
67
  },
68
+ {
69
+ name: 'Number Created',
70
+ value: 'number.created',
71
+ },
72
+ {
73
+ name: 'Number Connected',
74
+ value: 'number.connected',
75
+ },
76
+ {
77
+ name: 'Number Disconnected',
78
+ value: 'number.disconnected',
79
+ },
80
+ {
81
+ name: 'Number Removed',
82
+ value: 'number.removed',
83
+ },
68
84
  ],
69
85
  default: '*',
70
86
  description: 'The event to listen to',
@@ -76,6 +92,13 @@ class PilotStatusTrigger {
76
92
  default: '',
77
93
  description: 'Copy the Webhook URL from the side panel and paste it in the Pilot Status Dashboard under Webhooks.',
78
94
  },
95
+ {
96
+ displayName: 'Notice: Payload shape',
97
+ name: 'payloadNotice',
98
+ type: 'notice',
99
+ default: '',
100
+ description: 'The full JSON body is passed through (event + data). Outbound events may include optional correlationId. message.reply always includes messageRepliedId (string or null).',
101
+ },
79
102
  ],
80
103
  };
81
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-pilot-status",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "n8n node for Pilot Status API",
5
5
  "keywords": [
6
6
  "n8ncommunity",
@@ -39,4 +39,4 @@
39
39
  "ts-jest": "^29.4.6",
40
40
  "typescript": "^5.0.0"
41
41
  }
42
- }
42
+ }