n8n-nodes-pilot-status 2.15.1 → 2.16.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/CHANGELOG.md +14 -0
- package/README.md +12 -0
- package/dist/credentials/PilotStatusApi.credentials.d.ts +1 -1
- package/dist/credentials/version.d.ts +1 -1
- package/dist/credentials/version.js +1 -1
- package/dist/nodes/PilotStatus/PilotStatus.node.d.ts +10 -0
- package/dist/nodes/PilotStatus/PilotStatus.node.js +199 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `n8n-nodes-pilot-status`.
|
|
4
4
|
|
|
5
|
+
## 2.16.0 - 2026-11-10
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Story** resource (`/v1/stories`, WhatsApp status from the credential's number —
|
|
10
|
+
Evolution Go only):
|
|
11
|
+
- **Create** (`POST /v1/stories`): type `text` (text, background/text color, font by
|
|
12
|
+
name) or `image`/`video` (Media URL, caption); optional recipients
|
|
13
|
+
(comma-separated E.164 without `+`, deduped, up to 5000); optional **Idempotency Key** sent as the
|
|
14
|
+
`Idempotency-Key` header. Only the fields of the chosen type are sent.
|
|
15
|
+
- **Get** (`GET /v1/stories/{id}`).
|
|
16
|
+
- **Delete** (`DELETE /v1/stories/{id}`): revokes a sent story (`409
|
|
17
|
+
STORY_NOT_REVOCABLE`, `410 STORY_EXPIRED`).
|
|
18
|
+
|
|
5
19
|
## 2.15.1 - 2026-11-09
|
|
6
20
|
|
|
7
21
|
### Fixed
|
package/README.md
CHANGED
|
@@ -288,6 +288,18 @@ The registry the **Pilot Status Trigger** registers in. Only two operations; lis
|
|
|
288
288
|
- **Reactivate:** `POST /v1/webhooks/{id}/reactivate`, no body → `{ ok, released, stillHeld, circuitOpen, circuitOpenedAt, circuitSuccessPct, heldCount, droppedCount }` — resumes a destination paused by the circuit breaker (it only closes by hand), re-queuing `released` held events. Idempotent.
|
|
289
289
|
- `deliveryTimeoutMs` on create/update is platform-staff only (`403 DELIVERY_TIMEOUT_STAFF_ONLY`).
|
|
290
290
|
|
|
291
|
+
### 20. Story (WhatsApp status, `/v1/stories`)
|
|
292
|
+
|
|
293
|
+
Posts from the credential's number. **Evolution Go numbers only** (`400 NOT_SUPPORTED_FOR_META` / `NOT_SUPPORTED_FOR_PROVIDER`); a disconnected instance is `409 WHATSAPP_INSTANCE_NOT_CONNECTED`.
|
|
294
|
+
|
|
295
|
+
- **Create:** `POST /v1/stories` → `202 { id, status: "QUEUED", type, recipients: "explicit" | "privacy" }`.
|
|
296
|
+
- **Type** `text`: **Text** (1–700 characters), **Background Color** / **Text Color** (`#RRGGBB` or `#AARRGGBB`; blank = API default), **Font** (`system` default, `system_text`, `script`, `system_bold`, `morningbreeze`, `calistoga`, `exo2`, `courier`).
|
|
297
|
+
- **Type** `image` / `video`: **Media URL** (https, max 100 MiB — the only media input), optional **Caption** (≤1024).
|
|
298
|
+
- **Recipients** (optional): comma-separated E.164 numbers without `+` (or JIDs), deduped, up to 5000 (more is `400`). Blank = the device privacy settings decide.
|
|
299
|
+
- **Idempotency Key** (optional): sent as the `Idempotency-Key` header; reuse it when retrying the same story.
|
|
300
|
+
- **Get:** `GET /v1/stories/{id}` → `{ id, type, status, caption, recipientsMode, recipientCount, recipients, createdAt, sentAt, revokedAt }`. `recipients` is `null` while `QUEUED` or outside retention (`redacted: true`). Not a story → `404`.
|
|
301
|
+
- **Delete:** `DELETE /v1/stories/{id}` → `{ id, revokedAt }`. Only a `SENT`, not revoked story (`409 STORY_NOT_REVOCABLE`); more than 24 h after `sentAt` → `410 STORY_EXPIRED`. Not billed.
|
|
302
|
+
|
|
291
303
|
---
|
|
292
304
|
|
|
293
305
|
## 💡 Use Case Examples
|
|
@@ -7,7 +7,7 @@ export declare const DEFAULT_BASE_URL = "https://pilotstatus.com.br";
|
|
|
7
7
|
* `/v1` callers by User-Agent and recognises this node only when the header STARTS
|
|
8
8
|
* with `pilot-status-n8n/<version>`; without it n8n would send its generic `n8n`.
|
|
9
9
|
*/
|
|
10
|
-
export declare const USER_AGENT = "pilot-status-n8n/2.
|
|
10
|
+
export declare const USER_AGENT = "pilot-status-n8n/2.16.0";
|
|
11
11
|
export declare class PilotStatusApi implements ICredentialType {
|
|
12
12
|
name: string;
|
|
13
13
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "2.
|
|
1
|
+
export declare const PACKAGE_VERSION = "2.16.0";
|
|
@@ -97,6 +97,16 @@ export declare function workspaceWebhookUpdatePreSend(this: IExecuteSingleFuncti
|
|
|
97
97
|
export declare function workspaceCreatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
98
98
|
/** Workspace API Key → Create: the body is exactly `{ name }`. */
|
|
99
99
|
export declare function workspaceApiKeyCreatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
100
|
+
/** Story fonts accepted by `POST /v1/stories` (a NAME; a number is 400). */
|
|
101
|
+
export declare const STORY_FONT_OPTIONS: INodePropertyOptions[];
|
|
102
|
+
/**
|
|
103
|
+
* Story → Create: builds the WHOLE `POST /v1/stories` body. The route refuses unknown
|
|
104
|
+
* fields (400), so only the fields of the chosen type are sent, and blanks are dropped
|
|
105
|
+
* (the API then applies its defaults). Recipients: a comma-separated string or an array,
|
|
106
|
+
* trimmed, `+` stripped, deduped; empty = the device privacy settings decide. The optional
|
|
107
|
+
* Idempotency Key goes out as the `Idempotency-Key` HEADER; blank = not sent.
|
|
108
|
+
*/
|
|
109
|
+
export declare function storyCreatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
100
110
|
/**
|
|
101
111
|
* Current Workspace → Rename: the body is exactly `{ name }` — `PATCH /v1/workspace` refuses
|
|
102
112
|
* any other field with 400 UNKNOWN_FIELDS. Trimmed; the API caps it at 60 characters.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PilotStatus = exports.WORKSPACE_WEBHOOK_EVENT_OPTIONS = exports.PHONE_LINE_WEBHOOK_EVENT_OPTIONS = exports.DEFAULT_BASE_URL = exports.FLOW_CATEGORY_OPTIONS = exports.GO_TRISTATE = void 0;
|
|
3
|
+
exports.PilotStatus = exports.STORY_FONT_OPTIONS = exports.WORKSPACE_WEBHOOK_EVENT_OPTIONS = exports.PHONE_LINE_WEBHOOK_EVENT_OPTIONS = exports.DEFAULT_BASE_URL = exports.FLOW_CATEGORY_OPTIONS = exports.GO_TRISTATE = void 0;
|
|
4
4
|
exports.apiBaseUrl = apiBaseUrl;
|
|
5
5
|
exports.resolvePhoneLineDocument = resolvePhoneLineDocument;
|
|
6
6
|
exports.phoneLineStartVerificationPreSend = phoneLineStartVerificationPreSend;
|
|
@@ -11,6 +11,7 @@ exports.workspaceWebhookCreatePreSend = workspaceWebhookCreatePreSend;
|
|
|
11
11
|
exports.workspaceWebhookUpdatePreSend = workspaceWebhookUpdatePreSend;
|
|
12
12
|
exports.workspaceCreatePreSend = workspaceCreatePreSend;
|
|
13
13
|
exports.workspaceApiKeyCreatePreSend = workspaceApiKeyCreatePreSend;
|
|
14
|
+
exports.storyCreatePreSend = storyCreatePreSend;
|
|
14
15
|
exports.currentWorkspaceRenamePreSend = currentWorkspaceRenamePreSend;
|
|
15
16
|
exports.currentWorkspaceSettingsUpdatePreSend = currentWorkspaceSettingsUpdatePreSend;
|
|
16
17
|
exports.currentWorkspaceArchivePreSend = currentWorkspaceArchivePreSend;
|
|
@@ -304,6 +305,66 @@ async function workspaceApiKeyCreatePreSend(requestOptions) {
|
|
|
304
305
|
requestOptions.body = { name: requiredName.call(this, 'workspaceApiKeyName', 'a workspace API key') };
|
|
305
306
|
return requestOptions;
|
|
306
307
|
}
|
|
308
|
+
/** Story fonts accepted by `POST /v1/stories` (a NAME; a number is 400). */
|
|
309
|
+
exports.STORY_FONT_OPTIONS = [
|
|
310
|
+
{ name: 'System (Default)', value: 'system' },
|
|
311
|
+
{ name: 'System Text', value: 'system_text' },
|
|
312
|
+
{ name: 'Script', value: 'script' },
|
|
313
|
+
{ name: 'System Bold', value: 'system_bold' },
|
|
314
|
+
{ name: 'Morning Breeze', value: 'morningbreeze' },
|
|
315
|
+
{ name: 'Calistoga', value: 'calistoga' },
|
|
316
|
+
{ name: 'Exo 2', value: 'exo2' },
|
|
317
|
+
{ name: 'Courier', value: 'courier' },
|
|
318
|
+
];
|
|
319
|
+
/**
|
|
320
|
+
* Story → Create: builds the WHOLE `POST /v1/stories` body. The route refuses unknown
|
|
321
|
+
* fields (400), so only the fields of the chosen type are sent, and blanks are dropped
|
|
322
|
+
* (the API then applies its defaults). Recipients: a comma-separated string or an array,
|
|
323
|
+
* trimmed, `+` stripped, deduped; empty = the device privacy settings decide. The optional
|
|
324
|
+
* Idempotency Key goes out as the `Idempotency-Key` HEADER; blank = not sent.
|
|
325
|
+
*/
|
|
326
|
+
async function storyCreatePreSend(requestOptions) {
|
|
327
|
+
var _a;
|
|
328
|
+
const str = (name) => { var _a; return String((_a = this.getNodeParameter(name, '')) !== null && _a !== void 0 ? _a : '').trim(); };
|
|
329
|
+
const type = str('storyType') || 'text';
|
|
330
|
+
const body = { type };
|
|
331
|
+
if (type === 'text') {
|
|
332
|
+
const text = str('storyText');
|
|
333
|
+
if (!text)
|
|
334
|
+
throw new Error('Pilot Status: "Text" is required for a text story.');
|
|
335
|
+
body.text = text;
|
|
336
|
+
const backgroundColor = str('storyBackgroundColor');
|
|
337
|
+
if (backgroundColor)
|
|
338
|
+
body.backgroundColor = backgroundColor;
|
|
339
|
+
const textColor = str('storyTextColor');
|
|
340
|
+
if (textColor)
|
|
341
|
+
body.textColor = textColor;
|
|
342
|
+
const font = str('storyFont');
|
|
343
|
+
if (font)
|
|
344
|
+
body.font = font;
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
const mediaUrl = str('storyMediaUrl');
|
|
348
|
+
if (!mediaUrl)
|
|
349
|
+
throw new Error('Pilot Status: "Media URL" is required for an image or video story.');
|
|
350
|
+
body.mediaUrl = mediaUrl;
|
|
351
|
+
const caption = str('storyCaption');
|
|
352
|
+
if (caption)
|
|
353
|
+
body.caption = caption;
|
|
354
|
+
}
|
|
355
|
+
const raw = this.getNodeParameter('storyRecipients', '');
|
|
356
|
+
const list = Array.isArray(raw) ? raw : typeof raw === 'string' ? raw.split(',') : [];
|
|
357
|
+
const recipients = [
|
|
358
|
+
...new Set(list.map((r) => String(r).trim().replace(/^\+/, '')).filter((r) => r !== '')),
|
|
359
|
+
];
|
|
360
|
+
if (recipients.length)
|
|
361
|
+
body.recipients = recipients;
|
|
362
|
+
requestOptions.body = body;
|
|
363
|
+
const key = str('storyIdempotencyKey');
|
|
364
|
+
if (key)
|
|
365
|
+
requestOptions.headers = { ...((_a = requestOptions.headers) !== null && _a !== void 0 ? _a : {}), 'Idempotency-Key': key };
|
|
366
|
+
return requestOptions;
|
|
367
|
+
}
|
|
307
368
|
/**
|
|
308
369
|
* Current Workspace → Rename: the body is exactly `{ name }` — `PATCH /v1/workspace` refuses
|
|
309
370
|
* any other field with 400 UNKNOWN_FIELDS. Trimmed; the API caps it at 60 characters.
|
|
@@ -664,6 +725,7 @@ class PilotStatus {
|
|
|
664
725
|
{ name: 'Workspace API Key (Account Key)', value: 'workspaceApiKey' },
|
|
665
726
|
{ name: 'Current Workspace', value: 'currentWorkspace' },
|
|
666
727
|
{ name: 'Webhook', value: 'webhook' },
|
|
728
|
+
{ name: 'Story', value: 'story' },
|
|
667
729
|
],
|
|
668
730
|
default: 'message',
|
|
669
731
|
},
|
|
@@ -4379,6 +4441,142 @@ class PilotStatus {
|
|
|
4379
4441
|
default: '',
|
|
4380
4442
|
required: true,
|
|
4381
4443
|
},
|
|
4444
|
+
// ----------------------------------
|
|
4445
|
+
// Story Operations (/v1/stories — WhatsApp status/story of the credential's number;
|
|
4446
|
+
// Evolution Go numbers only: a Meta number is 400 NOT_SUPPORTED_FOR_META).
|
|
4447
|
+
// ----------------------------------
|
|
4448
|
+
{
|
|
4449
|
+
displayName: 'Operation',
|
|
4450
|
+
name: 'operation',
|
|
4451
|
+
type: 'options',
|
|
4452
|
+
noDataExpression: true,
|
|
4453
|
+
displayOptions: { show: { resource: ['story'] } },
|
|
4454
|
+
options: [
|
|
4455
|
+
{
|
|
4456
|
+
name: 'Create',
|
|
4457
|
+
value: 'create',
|
|
4458
|
+
description: 'Post a story (WhatsApp status) from the credential\'s number: text, image or video. Answers 202 { id, status: "QUEUED", type, recipients: "explicit" | "privacy" }. Evolution Go numbers only (400 NOT_SUPPORTED_FOR_META / NOT_SUPPORTED_FOR_PROVIDER); disconnected instance → 409 WHATSAPP_INSTANCE_NOT_CONNECTED.',
|
|
4459
|
+
action: 'Create a story',
|
|
4460
|
+
routing: {
|
|
4461
|
+
request: { method: 'POST', url: '/stories' },
|
|
4462
|
+
send: { preSend: [storyCreatePreSend] },
|
|
4463
|
+
},
|
|
4464
|
+
},
|
|
4465
|
+
{
|
|
4466
|
+
name: 'Get',
|
|
4467
|
+
value: 'get',
|
|
4468
|
+
description: 'Get a story: { id, type, status, caption, recipientsMode, recipientCount, recipients (null while QUEUED or outside retention, then redacted: true), createdAt, sentAt, revokedAt }. An id that is not a story → 404.',
|
|
4469
|
+
action: 'Get a story',
|
|
4470
|
+
routing: {
|
|
4471
|
+
request: { method: 'GET', url: '=/stories/{{encodeURIComponent($parameter.storyId)}}' },
|
|
4472
|
+
},
|
|
4473
|
+
},
|
|
4474
|
+
{
|
|
4475
|
+
name: 'Delete',
|
|
4476
|
+
value: 'delete',
|
|
4477
|
+
description: 'Revoke a sent (also delivered/read/played) story from the recipients\' devices → { id, revokedAt }. Not sent or already revoked → 409 STORY_NOT_REVOCABLE; more than 24 h after sentAt → 410 STORY_EXPIRED. Not billed.',
|
|
4478
|
+
action: 'Delete a story',
|
|
4479
|
+
routing: {
|
|
4480
|
+
request: { method: 'DELETE', url: '=/stories/{{encodeURIComponent($parameter.storyId)}}' },
|
|
4481
|
+
},
|
|
4482
|
+
},
|
|
4483
|
+
],
|
|
4484
|
+
default: 'create',
|
|
4485
|
+
},
|
|
4486
|
+
{
|
|
4487
|
+
displayName: 'Story ID',
|
|
4488
|
+
name: 'storyId',
|
|
4489
|
+
type: 'string',
|
|
4490
|
+
description: 'The id returned by Story → Create',
|
|
4491
|
+
displayOptions: { show: { resource: ['story'], operation: ['get', 'delete'] } },
|
|
4492
|
+
default: '',
|
|
4493
|
+
required: true,
|
|
4494
|
+
},
|
|
4495
|
+
{
|
|
4496
|
+
displayName: 'Type',
|
|
4497
|
+
name: 'storyType',
|
|
4498
|
+
type: 'options',
|
|
4499
|
+
options: [
|
|
4500
|
+
{ name: 'Text', value: 'text' },
|
|
4501
|
+
{ name: 'Image', value: 'image' },
|
|
4502
|
+
{ name: 'Video', value: 'video' },
|
|
4503
|
+
],
|
|
4504
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'] } },
|
|
4505
|
+
default: 'text',
|
|
4506
|
+
},
|
|
4507
|
+
{
|
|
4508
|
+
displayName: 'Text',
|
|
4509
|
+
name: 'storyText',
|
|
4510
|
+
type: 'string',
|
|
4511
|
+
typeOptions: { rows: 3 },
|
|
4512
|
+
description: 'Story text (1–700 characters)',
|
|
4513
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'], storyType: ['text'] } },
|
|
4514
|
+
default: '',
|
|
4515
|
+
required: true,
|
|
4516
|
+
},
|
|
4517
|
+
{
|
|
4518
|
+
displayName: 'Background Color',
|
|
4519
|
+
name: 'storyBackgroundColor',
|
|
4520
|
+
type: 'string',
|
|
4521
|
+
placeholder: '#25D366',
|
|
4522
|
+
description: '#RRGGBB or #AARRGGBB. Blank = #128C7E.',
|
|
4523
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'], storyType: ['text'] } },
|
|
4524
|
+
default: '',
|
|
4525
|
+
},
|
|
4526
|
+
{
|
|
4527
|
+
displayName: 'Text Color',
|
|
4528
|
+
name: 'storyTextColor',
|
|
4529
|
+
type: 'string',
|
|
4530
|
+
placeholder: '#FFFFFF',
|
|
4531
|
+
description: '#RRGGBB or #AARRGGBB. Blank = white, or black/white by the background luminance.',
|
|
4532
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'], storyType: ['text'] } },
|
|
4533
|
+
default: '',
|
|
4534
|
+
},
|
|
4535
|
+
{
|
|
4536
|
+
displayName: 'Font',
|
|
4537
|
+
name: 'storyFont',
|
|
4538
|
+
type: 'options',
|
|
4539
|
+
options: exports.STORY_FONT_OPTIONS,
|
|
4540
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'], storyType: ['text'] } },
|
|
4541
|
+
default: 'system',
|
|
4542
|
+
},
|
|
4543
|
+
{
|
|
4544
|
+
displayName: 'Media URL',
|
|
4545
|
+
name: 'storyMediaUrl',
|
|
4546
|
+
type: 'string',
|
|
4547
|
+
placeholder: 'https://example.com/image.jpg',
|
|
4548
|
+
description: 'Public https URL of the image or video (max 100 MiB; webp is converted to jpeg)',
|
|
4549
|
+
displayOptions: {
|
|
4550
|
+
show: { resource: ['story'], operation: ['create'], storyType: ['image', 'video'] },
|
|
4551
|
+
},
|
|
4552
|
+
default: '',
|
|
4553
|
+
required: true,
|
|
4554
|
+
},
|
|
4555
|
+
{
|
|
4556
|
+
displayName: 'Caption',
|
|
4557
|
+
name: 'storyCaption',
|
|
4558
|
+
type: 'string',
|
|
4559
|
+
description: 'Optional caption (max 1024 characters)',
|
|
4560
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'], storyType: ['image', 'video'] } },
|
|
4561
|
+
default: '',
|
|
4562
|
+
},
|
|
4563
|
+
{
|
|
4564
|
+
displayName: 'Recipients',
|
|
4565
|
+
name: 'storyRecipients',
|
|
4566
|
+
type: 'string',
|
|
4567
|
+
placeholder: '5511999999999, 5521988887777',
|
|
4568
|
+
description: 'Optional. Comma-separated E.164 numbers without + (or JIDs) who see the story, up to 5000 (more is refused with 400). Blank = the WhatsApp privacy settings of the device decide.',
|
|
4569
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'] } },
|
|
4570
|
+
default: '',
|
|
4571
|
+
},
|
|
4572
|
+
{
|
|
4573
|
+
displayName: 'Idempotency Key',
|
|
4574
|
+
name: 'storyIdempotencyKey',
|
|
4575
|
+
type: 'string',
|
|
4576
|
+
description: 'Optional. Sent as the Idempotency-Key header, never in the body. REUSE THE SAME KEY when retrying the same story: the API returns the first accepted response instead of posting again. Blank = not sent.',
|
|
4577
|
+
displayOptions: { show: { resource: ['story'], operation: ['create'] } },
|
|
4578
|
+
default: '',
|
|
4579
|
+
},
|
|
4382
4580
|
],
|
|
4383
4581
|
};
|
|
4384
4582
|
}
|