n8n-nodes-pilot-status 1.0.3 → 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
|
|
60
|
-
- `message.
|
|
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
|
|
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',
|
|
@@ -254,18 +294,46 @@ class PilotStatus {
|
|
|
254
294
|
},
|
|
255
295
|
},
|
|
256
296
|
},
|
|
297
|
+
{
|
|
298
|
+
displayName: 'Additional Fields',
|
|
299
|
+
name: 'additionalFields',
|
|
300
|
+
type: 'collection',
|
|
301
|
+
placeholder: 'Add Field',
|
|
302
|
+
default: {},
|
|
303
|
+
displayOptions: {
|
|
304
|
+
show: {
|
|
305
|
+
resource: ['message'],
|
|
306
|
+
operation: ['send'],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
options: [
|
|
310
|
+
{
|
|
311
|
+
displayName: 'Deliver At',
|
|
312
|
+
name: 'deliverAt',
|
|
313
|
+
type: 'dateTime',
|
|
314
|
+
default: '',
|
|
315
|
+
description: 'Optional scheduled delivery time (ISO8601)',
|
|
316
|
+
},
|
|
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
|
+
],
|
|
325
|
+
},
|
|
257
326
|
{
|
|
258
327
|
displayName: 'Deliver At',
|
|
259
|
-
name: '
|
|
260
|
-
type: '
|
|
328
|
+
name: 'deliverAtNormalized',
|
|
329
|
+
type: 'hidden',
|
|
261
330
|
displayOptions: {
|
|
262
331
|
show: {
|
|
263
332
|
resource: ['message'],
|
|
264
333
|
operation: ['send'],
|
|
265
334
|
},
|
|
266
335
|
},
|
|
267
|
-
default: '',
|
|
268
|
-
description: 'Optional scheduled delivery time (ISO8601)',
|
|
336
|
+
default: '={{ $parameter.additionalFields?.deliverAt ? new Date($parameter.additionalFields.deliverAt).toISOString() : undefined }}',
|
|
269
337
|
routing: {
|
|
270
338
|
send: {
|
|
271
339
|
type: 'body',
|
|
@@ -275,16 +343,15 @@ class PilotStatus {
|
|
|
275
343
|
},
|
|
276
344
|
{
|
|
277
345
|
displayName: 'Deliver Until',
|
|
278
|
-
name: '
|
|
279
|
-
type: '
|
|
346
|
+
name: 'deliverUntilNormalized',
|
|
347
|
+
type: 'hidden',
|
|
280
348
|
displayOptions: {
|
|
281
349
|
show: {
|
|
282
350
|
resource: ['message'],
|
|
283
351
|
operation: ['send'],
|
|
284
352
|
},
|
|
285
353
|
},
|
|
286
|
-
default: '',
|
|
287
|
-
description: 'Optional expiration limit for the message delivery (ISO8601)',
|
|
354
|
+
default: '={{ $parameter.additionalFields?.deliverUntil ? new Date($parameter.additionalFields.deliverUntil).toISOString() : undefined }}',
|
|
288
355
|
routing: {
|
|
289
356
|
send: {
|
|
290
357
|
type: 'body',
|
|
@@ -457,7 +524,7 @@ class PilotStatus {
|
|
|
457
524
|
operation: ['create'],
|
|
458
525
|
},
|
|
459
526
|
},
|
|
460
|
-
default:
|
|
527
|
+
default: 3650,
|
|
461
528
|
routing: {
|
|
462
529
|
send: {
|
|
463
530
|
type: 'body',
|
|
@@ -503,6 +570,18 @@ class PilotStatus {
|
|
|
503
570
|
},
|
|
504
571
|
},
|
|
505
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
|
+
},
|
|
506
585
|
],
|
|
507
586
|
default: 'create',
|
|
508
587
|
},
|
|
@@ -564,7 +643,7 @@ class PilotStatus {
|
|
|
564
643
|
},
|
|
565
644
|
},
|
|
566
645
|
},
|
|
567
|
-
// Number: Get Status
|
|
646
|
+
// Number: Get Status / Connect
|
|
568
647
|
{
|
|
569
648
|
displayName: 'Number Instance ID',
|
|
570
649
|
name: 'numberId',
|
|
@@ -572,7 +651,7 @@ class PilotStatus {
|
|
|
572
651
|
displayOptions: {
|
|
573
652
|
show: {
|
|
574
653
|
resource: ['number'],
|
|
575
|
-
operation: ['getStatus'],
|
|
654
|
+
operation: ['getStatus', 'connect'],
|
|
576
655
|
},
|
|
577
656
|
},
|
|
578
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