n8n-nodes-pilot-status 1.0.4 → 1.0.6
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
|
|
@@ -72,26 +72,11 @@ class PilotStatus {
|
|
|
72
72
|
type: 'options',
|
|
73
73
|
noDataExpression: true,
|
|
74
74
|
options: [
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'Project',
|
|
81
|
-
value: 'project',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'API Key',
|
|
85
|
-
value: 'apiKey',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'Number',
|
|
89
|
-
value: 'number',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'Analytics',
|
|
93
|
-
value: 'analytics',
|
|
94
|
-
},
|
|
75
|
+
{ name: 'Message', value: 'message' },
|
|
76
|
+
{ name: 'Project', value: 'project' },
|
|
77
|
+
{ name: 'API Key', value: 'apiKey' },
|
|
78
|
+
{ name: 'Number', value: 'number' },
|
|
79
|
+
{ name: 'Analytics', value: 'analytics' },
|
|
95
80
|
],
|
|
96
81
|
default: 'message',
|
|
97
82
|
},
|
|
@@ -103,11 +88,7 @@ class PilotStatus {
|
|
|
103
88
|
name: 'operation',
|
|
104
89
|
type: 'options',
|
|
105
90
|
noDataExpression: true,
|
|
106
|
-
displayOptions: {
|
|
107
|
-
show: {
|
|
108
|
-
resource: ['message'],
|
|
109
|
-
},
|
|
110
|
-
},
|
|
91
|
+
displayOptions: { show: { resource: ['message'] } },
|
|
111
92
|
options: [
|
|
112
93
|
{
|
|
113
94
|
name: 'Send',
|
|
@@ -115,9 +96,40 @@ class PilotStatus {
|
|
|
115
96
|
description: 'Send a message',
|
|
116
97
|
action: 'Send a message',
|
|
117
98
|
routing: {
|
|
118
|
-
request: {
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
request: { method: 'POST', url: '/messages/send' },
|
|
100
|
+
// ✅ preSend hook: monta o campo "variables" como objeto antes de enviar
|
|
101
|
+
send: {
|
|
102
|
+
preSend: [
|
|
103
|
+
async function (requestOptions) {
|
|
104
|
+
var _a;
|
|
105
|
+
const mode = this.getNodeParameter('variablesMode');
|
|
106
|
+
let variables = {};
|
|
107
|
+
if (mode === 'json') {
|
|
108
|
+
const raw = this.getNodeParameter('variablesJson');
|
|
109
|
+
try {
|
|
110
|
+
const parsed = typeof raw === 'string' ? JSON.parse(raw) : raw;
|
|
111
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
112
|
+
variables = parsed;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
throw new Error(`Pilot Status: "Variables (JSON)" contém JSON inválido.\nValor recebido: ${raw}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const ui = this.getNodeParameter('variablesUi');
|
|
121
|
+
for (const entry of (_a = ui === null || ui === void 0 ? void 0 : ui.values) !== null && _a !== void 0 ? _a : []) {
|
|
122
|
+
variables[entry.name] = entry.value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Garante que o body é um objeto e injeta "variables" como objeto
|
|
126
|
+
if (!requestOptions.body || typeof requestOptions.body !== 'object') {
|
|
127
|
+
requestOptions.body = {};
|
|
128
|
+
}
|
|
129
|
+
requestOptions.body['variables'] = variables;
|
|
130
|
+
return requestOptions;
|
|
131
|
+
},
|
|
132
|
+
],
|
|
121
133
|
},
|
|
122
134
|
},
|
|
123
135
|
},
|
|
@@ -127,10 +139,7 @@ class PilotStatus {
|
|
|
127
139
|
description: 'Get the status of a message',
|
|
128
140
|
action: 'Get status of a message',
|
|
129
141
|
routing: {
|
|
130
|
-
request: {
|
|
131
|
-
method: 'GET',
|
|
132
|
-
url: '=/messages/{{$parameter.messageId}}',
|
|
133
|
-
},
|
|
142
|
+
request: { method: 'GET', url: '=/messages/{{$parameter.messageId}}' },
|
|
134
143
|
},
|
|
135
144
|
},
|
|
136
145
|
{
|
|
@@ -142,70 +151,64 @@ class PilotStatus {
|
|
|
142
151
|
request: {
|
|
143
152
|
method: 'GET',
|
|
144
153
|
url: '/messages/opt-in',
|
|
145
|
-
qs: {
|
|
146
|
-
destinationNumber: '={{$parameter.destinationNumber}}',
|
|
147
|
-
},
|
|
154
|
+
qs: { destinationNumber: '={{$parameter.destinationNumber}}' },
|
|
148
155
|
},
|
|
149
156
|
},
|
|
150
157
|
},
|
|
151
158
|
],
|
|
152
159
|
default: 'send',
|
|
153
160
|
},
|
|
154
|
-
// Message: Send
|
|
161
|
+
// Message: Send — campos
|
|
155
162
|
{
|
|
156
163
|
displayName: 'Template ID',
|
|
157
164
|
name: 'templateId',
|
|
158
165
|
type: 'options',
|
|
159
|
-
typeOptions: {
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
displayOptions: {
|
|
163
|
-
show: {
|
|
164
|
-
resource: ['message'],
|
|
165
|
-
operation: ['send'],
|
|
166
|
-
},
|
|
167
|
-
},
|
|
166
|
+
typeOptions: { loadOptionsMethod: 'getTemplates' },
|
|
167
|
+
displayOptions: { show: { resource: ['message'], operation: ['send'] } },
|
|
168
168
|
default: '',
|
|
169
169
|
required: true,
|
|
170
|
-
routing: {
|
|
171
|
-
send: {
|
|
172
|
-
type: 'body',
|
|
173
|
-
property: 'templateId',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
170
|
+
routing: { send: { type: 'body', property: 'templateId' } },
|
|
176
171
|
},
|
|
177
172
|
{
|
|
178
173
|
displayName: 'Destination Number',
|
|
179
174
|
name: 'destinationNumber',
|
|
180
175
|
type: 'string',
|
|
181
176
|
description: 'E.164 format (e.g. +5511999999999)',
|
|
182
|
-
displayOptions: {
|
|
183
|
-
show: {
|
|
184
|
-
resource: ['message'],
|
|
185
|
-
operation: ['send', 'checkOptIn'],
|
|
186
|
-
},
|
|
187
|
-
},
|
|
177
|
+
displayOptions: { show: { resource: ['message'], operation: ['send', 'checkOptIn'] } },
|
|
188
178
|
default: '',
|
|
189
179
|
required: true,
|
|
190
|
-
routing: {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
180
|
+
routing: { send: { type: 'body', property: 'destinationNumber' } },
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
displayName: 'Variables Mode',
|
|
184
|
+
name: 'variablesMode',
|
|
185
|
+
type: 'options',
|
|
186
|
+
noDataExpression: true,
|
|
187
|
+
options: [
|
|
188
|
+
{ name: 'UI Collection', value: 'collection', description: 'Add variables one by one in the UI' },
|
|
189
|
+
{ name: 'JSON Object', value: 'json', description: 'Provide an object with key-value pairs' },
|
|
190
|
+
],
|
|
191
|
+
default: 'collection',
|
|
192
|
+
displayOptions: { show: { resource: ['message'], operation: ['send'] } },
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
displayName: 'Variables (JSON)',
|
|
196
|
+
name: 'variablesJson',
|
|
197
|
+
type: 'string',
|
|
198
|
+
default: '{}',
|
|
199
|
+
displayOptions: {
|
|
200
|
+
show: { resource: ['message'], operation: ['send'], variablesMode: ['json'] },
|
|
195
201
|
},
|
|
202
|
+
description: 'A JSON object containing key-value pairs for variables',
|
|
203
|
+
// ✅ Sem routing aqui — o preSend cuida do envio como objeto
|
|
196
204
|
},
|
|
197
205
|
{
|
|
198
206
|
displayName: 'Variables',
|
|
199
207
|
name: 'variablesUi',
|
|
200
208
|
type: 'fixedCollection',
|
|
201
|
-
typeOptions: {
|
|
202
|
-
multipleValues: true,
|
|
203
|
-
},
|
|
209
|
+
typeOptions: { multipleValues: true },
|
|
204
210
|
displayOptions: {
|
|
205
|
-
show: {
|
|
206
|
-
resource: ['message'],
|
|
207
|
-
operation: ['send'],
|
|
208
|
-
},
|
|
211
|
+
show: { resource: ['message'], operation: ['send'], variablesMode: ['collection'] },
|
|
209
212
|
},
|
|
210
213
|
default: {},
|
|
211
214
|
description: 'Preencha as variáveis do template selecionado',
|
|
@@ -235,86 +238,48 @@ class PilotStatus {
|
|
|
235
238
|
],
|
|
236
239
|
},
|
|
237
240
|
],
|
|
241
|
+
// ✅ Sem routing aqui — o preSend cuida do envio como objeto
|
|
238
242
|
},
|
|
239
243
|
{
|
|
240
|
-
displayName: '
|
|
241
|
-
name: '
|
|
242
|
-
type: '
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
property: 'variables',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
displayName: 'Deliver At',
|
|
259
|
-
name: 'deliverAt',
|
|
260
|
-
type: 'dateTime',
|
|
261
|
-
displayOptions: {
|
|
262
|
-
show: {
|
|
263
|
-
resource: ['message'],
|
|
264
|
-
operation: ['send'],
|
|
244
|
+
displayName: 'Additional Fields',
|
|
245
|
+
name: 'additionalFields',
|
|
246
|
+
type: 'collection',
|
|
247
|
+
placeholder: 'Add Field',
|
|
248
|
+
default: {},
|
|
249
|
+
displayOptions: { show: { resource: ['message'], operation: ['send'] } },
|
|
250
|
+
options: [
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Deliver At',
|
|
253
|
+
name: 'deliverAt',
|
|
254
|
+
type: 'dateTime',
|
|
255
|
+
default: '',
|
|
256
|
+
description: 'Optional scheduled delivery time (ISO8601)',
|
|
265
257
|
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
name: 'deliverUntil',
|
|
273
|
-
type: 'dateTime',
|
|
274
|
-
displayOptions: {
|
|
275
|
-
show: {
|
|
276
|
-
resource: ['message'],
|
|
277
|
-
operation: ['send'],
|
|
258
|
+
{
|
|
259
|
+
displayName: 'Deliver Until',
|
|
260
|
+
name: 'deliverUntil',
|
|
261
|
+
type: 'dateTime',
|
|
262
|
+
default: '',
|
|
263
|
+
description: 'Optional expiration limit for the message delivery (ISO8601)',
|
|
278
264
|
},
|
|
279
|
-
|
|
280
|
-
default: '',
|
|
281
|
-
description: 'Optional expiration limit for the message delivery (ISO8601)',
|
|
265
|
+
],
|
|
282
266
|
},
|
|
267
|
+
// Hidden fields para deliverAt / deliverUntil normalizados
|
|
283
268
|
{
|
|
284
269
|
displayName: 'Deliver At',
|
|
285
270
|
name: 'deliverAtNormalized',
|
|
286
271
|
type: 'hidden',
|
|
287
|
-
displayOptions: {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
operation: ['send'],
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
default: '={{ $parameter.deliverAt ? new Date($parameter.deliverAt).toISOString() : undefined }}',
|
|
294
|
-
routing: {
|
|
295
|
-
send: {
|
|
296
|
-
type: 'body',
|
|
297
|
-
property: 'deliverAt',
|
|
298
|
-
},
|
|
299
|
-
},
|
|
272
|
+
displayOptions: { show: { resource: ['message'], operation: ['send'] } },
|
|
273
|
+
default: '={{ $parameter.additionalFields?.deliverAt ? new Date($parameter.additionalFields.deliverAt).toISOString() : undefined }}',
|
|
274
|
+
routing: { send: { type: 'body', property: 'deliverAt' } },
|
|
300
275
|
},
|
|
301
276
|
{
|
|
302
277
|
displayName: 'Deliver Until',
|
|
303
278
|
name: 'deliverUntilNormalized',
|
|
304
279
|
type: 'hidden',
|
|
305
|
-
displayOptions: {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
operation: ['send'],
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
default: '={{ $parameter.deliverUntil ? new Date($parameter.deliverUntil).toISOString() : undefined }}',
|
|
312
|
-
routing: {
|
|
313
|
-
send: {
|
|
314
|
-
type: 'body',
|
|
315
|
-
property: 'deliverUntil',
|
|
316
|
-
},
|
|
317
|
-
},
|
|
280
|
+
displayOptions: { show: { resource: ['message'], operation: ['send'] } },
|
|
281
|
+
default: '={{ $parameter.additionalFields?.deliverUntil ? new Date($parameter.additionalFields.deliverUntil).toISOString() : undefined }}',
|
|
282
|
+
routing: { send: { type: 'body', property: 'deliverUntil' } },
|
|
318
283
|
},
|
|
319
284
|
// Message: Get Status
|
|
320
285
|
{
|
|
@@ -322,12 +287,7 @@ class PilotStatus {
|
|
|
322
287
|
name: 'messageId',
|
|
323
288
|
type: 'string',
|
|
324
289
|
description: 'Pilot Status message id or WhatsApp provider id (from customer webhooks messageId)',
|
|
325
|
-
displayOptions: {
|
|
326
|
-
show: {
|
|
327
|
-
resource: ['message'],
|
|
328
|
-
operation: ['getStatus'],
|
|
329
|
-
},
|
|
330
|
-
},
|
|
290
|
+
displayOptions: { show: { resource: ['message'], operation: ['getStatus'] } },
|
|
331
291
|
default: '',
|
|
332
292
|
required: true,
|
|
333
293
|
},
|
|
@@ -339,76 +299,41 @@ class PilotStatus {
|
|
|
339
299
|
name: 'operation',
|
|
340
300
|
type: 'options',
|
|
341
301
|
noDataExpression: true,
|
|
342
|
-
displayOptions: {
|
|
343
|
-
show: {
|
|
344
|
-
resource: ['project'],
|
|
345
|
-
},
|
|
346
|
-
},
|
|
302
|
+
displayOptions: { show: { resource: ['project'] } },
|
|
347
303
|
options: [
|
|
348
304
|
{
|
|
349
305
|
name: 'Create',
|
|
350
306
|
value: 'create',
|
|
351
307
|
description: 'Create a new project',
|
|
352
308
|
action: 'Create a project',
|
|
353
|
-
routing: {
|
|
354
|
-
request: {
|
|
355
|
-
method: 'POST',
|
|
356
|
-
url: '/projects',
|
|
357
|
-
},
|
|
358
|
-
},
|
|
309
|
+
routing: { request: { method: 'POST', url: '/projects' } },
|
|
359
310
|
},
|
|
360
311
|
{
|
|
361
312
|
name: 'Get Many',
|
|
362
313
|
value: 'getAll',
|
|
363
314
|
description: 'Get many projects',
|
|
364
315
|
action: 'Get many projects',
|
|
365
|
-
routing: {
|
|
366
|
-
request: {
|
|
367
|
-
method: 'GET',
|
|
368
|
-
url: '/projects',
|
|
369
|
-
},
|
|
370
|
-
},
|
|
316
|
+
routing: { request: { method: 'GET', url: '/projects' } },
|
|
371
317
|
},
|
|
372
318
|
],
|
|
373
319
|
default: 'getAll',
|
|
374
320
|
},
|
|
375
|
-
// Project: Create
|
|
376
321
|
{
|
|
377
322
|
displayName: 'Name',
|
|
378
323
|
name: 'name',
|
|
379
324
|
type: 'string',
|
|
380
|
-
displayOptions: {
|
|
381
|
-
show: {
|
|
382
|
-
resource: ['project'],
|
|
383
|
-
operation: ['create'],
|
|
384
|
-
},
|
|
385
|
-
},
|
|
325
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
386
326
|
default: '',
|
|
387
327
|
required: true,
|
|
388
|
-
routing: {
|
|
389
|
-
send: {
|
|
390
|
-
type: 'body',
|
|
391
|
-
property: 'name',
|
|
392
|
-
},
|
|
393
|
-
},
|
|
328
|
+
routing: { send: { type: 'body', property: 'name' } },
|
|
394
329
|
},
|
|
395
330
|
{
|
|
396
331
|
displayName: 'Description',
|
|
397
332
|
name: 'description',
|
|
398
333
|
type: 'string',
|
|
399
|
-
displayOptions: {
|
|
400
|
-
show: {
|
|
401
|
-
resource: ['project'],
|
|
402
|
-
operation: ['create'],
|
|
403
|
-
},
|
|
404
|
-
},
|
|
334
|
+
displayOptions: { show: { resource: ['project'], operation: ['create'] } },
|
|
405
335
|
default: '',
|
|
406
|
-
routing: {
|
|
407
|
-
send: {
|
|
408
|
-
type: 'body',
|
|
409
|
-
property: 'description',
|
|
410
|
-
},
|
|
411
|
-
},
|
|
336
|
+
routing: { send: { type: 'body', property: 'description' } },
|
|
412
337
|
},
|
|
413
338
|
// ----------------------------------
|
|
414
339
|
// API Key Operations
|
|
@@ -418,76 +343,41 @@ class PilotStatus {
|
|
|
418
343
|
name: 'operation',
|
|
419
344
|
type: 'options',
|
|
420
345
|
noDataExpression: true,
|
|
421
|
-
displayOptions: {
|
|
422
|
-
show: {
|
|
423
|
-
resource: ['apiKey'],
|
|
424
|
-
},
|
|
425
|
-
},
|
|
346
|
+
displayOptions: { show: { resource: ['apiKey'] } },
|
|
426
347
|
options: [
|
|
427
348
|
{
|
|
428
349
|
name: 'Create',
|
|
429
350
|
value: 'create',
|
|
430
351
|
description: 'Create a new API Key',
|
|
431
352
|
action: 'Create an api key',
|
|
432
|
-
routing: {
|
|
433
|
-
request: {
|
|
434
|
-
method: 'POST',
|
|
435
|
-
url: '/api-keys',
|
|
436
|
-
},
|
|
437
|
-
},
|
|
353
|
+
routing: { request: { method: 'POST', url: '/api-keys' } },
|
|
438
354
|
},
|
|
439
355
|
{
|
|
440
356
|
name: 'Get Many',
|
|
441
357
|
value: 'getAll',
|
|
442
358
|
description: 'Get many API Keys',
|
|
443
359
|
action: 'Get many api keys',
|
|
444
|
-
routing: {
|
|
445
|
-
request: {
|
|
446
|
-
method: 'GET',
|
|
447
|
-
url: '/api-keys',
|
|
448
|
-
},
|
|
449
|
-
},
|
|
360
|
+
routing: { request: { method: 'GET', url: '/api-keys' } },
|
|
450
361
|
},
|
|
451
362
|
],
|
|
452
363
|
default: 'getAll',
|
|
453
364
|
},
|
|
454
|
-
// API Key: Create
|
|
455
365
|
{
|
|
456
366
|
displayName: 'Name',
|
|
457
367
|
name: 'name',
|
|
458
368
|
type: 'string',
|
|
459
|
-
displayOptions: {
|
|
460
|
-
show: {
|
|
461
|
-
resource: ['apiKey'],
|
|
462
|
-
operation: ['create'],
|
|
463
|
-
},
|
|
464
|
-
},
|
|
369
|
+
displayOptions: { show: { resource: ['apiKey'], operation: ['create'] } },
|
|
465
370
|
default: '',
|
|
466
371
|
required: true,
|
|
467
|
-
routing: {
|
|
468
|
-
send: {
|
|
469
|
-
type: 'body',
|
|
470
|
-
property: 'name',
|
|
471
|
-
},
|
|
472
|
-
},
|
|
372
|
+
routing: { send: { type: 'body', property: 'name' } },
|
|
473
373
|
},
|
|
474
374
|
{
|
|
475
375
|
displayName: 'Retention Days',
|
|
476
376
|
name: 'retentionDays',
|
|
477
377
|
type: 'number',
|
|
478
|
-
displayOptions: {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
operation: ['create'],
|
|
482
|
-
},
|
|
483
|
-
},
|
|
484
|
-
default: 30,
|
|
485
|
-
routing: {
|
|
486
|
-
send: {
|
|
487
|
-
type: 'body',
|
|
488
|
-
property: 'retentionDays',
|
|
489
|
-
},
|
|
490
|
-
},
|
|
378
|
+
displayOptions: { show: { resource: ['apiKey'], operation: ['create'] } },
|
|
379
|
+
default: 3650,
|
|
380
|
+
routing: { send: { type: 'body', property: 'retentionDays' } },
|
|
491
381
|
},
|
|
492
382
|
// ----------------------------------
|
|
493
383
|
// Number Operations
|
|
@@ -497,108 +387,64 @@ class PilotStatus {
|
|
|
497
387
|
name: 'operation',
|
|
498
388
|
type: 'options',
|
|
499
389
|
noDataExpression: true,
|
|
500
|
-
displayOptions: {
|
|
501
|
-
show: {
|
|
502
|
-
resource: ['number'],
|
|
503
|
-
},
|
|
504
|
-
},
|
|
390
|
+
displayOptions: { show: { resource: ['number'] } },
|
|
505
391
|
options: [
|
|
506
392
|
{
|
|
507
393
|
name: 'Create',
|
|
508
394
|
value: 'create',
|
|
509
395
|
description: 'Create/Connect a WhatsApp Number',
|
|
510
396
|
action: 'Create a number',
|
|
511
|
-
routing: {
|
|
512
|
-
request: {
|
|
513
|
-
method: 'POST',
|
|
514
|
-
url: '/numbers',
|
|
515
|
-
},
|
|
516
|
-
},
|
|
397
|
+
routing: { request: { method: 'POST', url: '/numbers' } },
|
|
517
398
|
},
|
|
518
399
|
{
|
|
519
400
|
name: 'Get Status',
|
|
520
401
|
value: 'getStatus',
|
|
521
402
|
description: 'Get connection status of a number',
|
|
522
403
|
action: 'Get status of a number',
|
|
523
|
-
routing: {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
404
|
+
routing: { request: { method: 'GET', url: '=/numbers/{{$parameter.numberId}}/status' } },
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'Connect (QR + pairing code)',
|
|
408
|
+
value: 'connect',
|
|
409
|
+
description: 'Generate a new QR code and optional letter pairing code (only when instance is not OPEN)',
|
|
410
|
+
action: 'Connect a number',
|
|
411
|
+
routing: { request: { method: 'GET', url: '=/numbers/{{$parameter.numberId}}/connect' } },
|
|
529
412
|
},
|
|
530
413
|
],
|
|
531
414
|
default: 'create',
|
|
532
415
|
},
|
|
533
|
-
// Number: Create
|
|
534
416
|
{
|
|
535
417
|
displayName: 'Name',
|
|
536
418
|
name: 'name',
|
|
537
419
|
type: 'string',
|
|
538
|
-
displayOptions: {
|
|
539
|
-
show: {
|
|
540
|
-
resource: ['number'],
|
|
541
|
-
operation: ['create'],
|
|
542
|
-
},
|
|
543
|
-
},
|
|
420
|
+
displayOptions: { show: { resource: ['number'], operation: ['create'] } },
|
|
544
421
|
default: '',
|
|
545
422
|
required: true,
|
|
546
|
-
routing: {
|
|
547
|
-
send: {
|
|
548
|
-
type: 'body',
|
|
549
|
-
property: 'name',
|
|
550
|
-
},
|
|
551
|
-
},
|
|
423
|
+
routing: { send: { type: 'body', property: 'name' } },
|
|
552
424
|
},
|
|
553
425
|
{
|
|
554
426
|
displayName: 'Number',
|
|
555
427
|
name: 'number',
|
|
556
428
|
type: 'string',
|
|
557
|
-
displayOptions: {
|
|
558
|
-
show: {
|
|
559
|
-
resource: ['number'],
|
|
560
|
-
operation: ['create'],
|
|
561
|
-
},
|
|
562
|
-
},
|
|
429
|
+
displayOptions: { show: { resource: ['number'], operation: ['create'] } },
|
|
563
430
|
default: '',
|
|
564
431
|
required: true,
|
|
565
432
|
description: 'E.164 format (e.g. +5511999999999)',
|
|
566
|
-
routing: {
|
|
567
|
-
send: {
|
|
568
|
-
type: 'body',
|
|
569
|
-
property: 'number',
|
|
570
|
-
},
|
|
571
|
-
},
|
|
433
|
+
routing: { send: { type: 'body', property: 'number' } },
|
|
572
434
|
},
|
|
573
435
|
{
|
|
574
436
|
displayName: 'Link to API Key',
|
|
575
437
|
name: 'linkToApiKey',
|
|
576
438
|
type: 'boolean',
|
|
577
|
-
displayOptions: {
|
|
578
|
-
show: {
|
|
579
|
-
resource: ['number'],
|
|
580
|
-
operation: ['create'],
|
|
581
|
-
},
|
|
582
|
-
},
|
|
439
|
+
displayOptions: { show: { resource: ['number'], operation: ['create'] } },
|
|
583
440
|
default: true,
|
|
584
|
-
routing: {
|
|
585
|
-
send: {
|
|
586
|
-
type: 'body',
|
|
587
|
-
property: 'linkToApiKey',
|
|
588
|
-
},
|
|
589
|
-
},
|
|
441
|
+
routing: { send: { type: 'body', property: 'linkToApiKey' } },
|
|
590
442
|
},
|
|
591
|
-
// Number: Get Status
|
|
592
443
|
{
|
|
593
444
|
displayName: 'Number Instance ID',
|
|
594
445
|
name: 'numberId',
|
|
595
446
|
type: 'string',
|
|
596
|
-
displayOptions: {
|
|
597
|
-
show: {
|
|
598
|
-
resource: ['number'],
|
|
599
|
-
operation: ['getStatus'],
|
|
600
|
-
},
|
|
601
|
-
},
|
|
447
|
+
displayOptions: { show: { resource: ['number'], operation: ['getStatus', 'connect'] } },
|
|
602
448
|
default: '',
|
|
603
449
|
required: true,
|
|
604
450
|
},
|
|
@@ -610,46 +456,26 @@ class PilotStatus {
|
|
|
610
456
|
name: 'operation',
|
|
611
457
|
type: 'options',
|
|
612
458
|
noDataExpression: true,
|
|
613
|
-
displayOptions: {
|
|
614
|
-
show: {
|
|
615
|
-
resource: ['analytics'],
|
|
616
|
-
},
|
|
617
|
-
},
|
|
459
|
+
displayOptions: { show: { resource: ['analytics'] } },
|
|
618
460
|
options: [
|
|
619
461
|
{
|
|
620
462
|
name: 'Get Dashboard',
|
|
621
463
|
value: 'getDashboard',
|
|
622
464
|
description: 'Get dashboard analytics stats',
|
|
623
465
|
action: 'Get dashboard analytics',
|
|
624
|
-
routing: {
|
|
625
|
-
request: {
|
|
626
|
-
method: 'GET',
|
|
627
|
-
url: '/analytics/dashboard',
|
|
628
|
-
},
|
|
629
|
-
},
|
|
466
|
+
routing: { request: { method: 'GET', url: '/analytics/dashboard' } },
|
|
630
467
|
},
|
|
631
468
|
],
|
|
632
469
|
default: 'getDashboard',
|
|
633
470
|
},
|
|
634
|
-
// Analytics: Get Dashboard
|
|
635
471
|
{
|
|
636
472
|
displayName: 'Timezone (TZ)',
|
|
637
473
|
name: 'tz',
|
|
638
474
|
type: 'string',
|
|
639
|
-
displayOptions: {
|
|
640
|
-
show: {
|
|
641
|
-
resource: ['analytics'],
|
|
642
|
-
operation: ['getDashboard'],
|
|
643
|
-
},
|
|
644
|
-
},
|
|
475
|
+
displayOptions: { show: { resource: ['analytics'], operation: ['getDashboard'] } },
|
|
645
476
|
default: 'America/Sao_Paulo',
|
|
646
477
|
description: 'IANA timezone (e.g. America/Sao_Paulo)',
|
|
647
|
-
routing: {
|
|
648
|
-
send: {
|
|
649
|
-
type: 'query',
|
|
650
|
-
property: 'tz',
|
|
651
|
-
},
|
|
652
|
-
},
|
|
478
|
+
routing: { send: { type: 'query', property: 'tz' } },
|
|
653
479
|
},
|
|
654
480
|
],
|
|
655
481
|
};
|
|
@@ -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