n8n-nodes-pilot-status 1.2.0 → 2.1.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 +45 -0
- package/README.md +74 -24
- package/dist/credentials/PilotStatusApi.credentials.d.ts +2 -0
- package/dist/credentials/PilotStatusApi.credentials.js +26 -3
- package/dist/nodes/PilotStatus/PilotStatus.node.d.ts +28 -0
- package/dist/nodes/PilotStatus/PilotStatus.node.js +1111 -98
- package/dist/nodes/PilotStatusTrigger/PilotStatusTrigger.node.d.ts +22 -1
- package/dist/nodes/PilotStatusTrigger/PilotStatusTrigger.node.js +189 -3
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `n8n-nodes-pilot-status`.
|
|
4
|
+
|
|
5
|
+
## 2.1.0
|
|
6
|
+
|
|
7
|
+
⛔ **This release is the first one npm has seen since `1.3.0`.** `1.4.0` and `2.0.0` were
|
|
8
|
+
bumped in the repository and never published — the commit that set `2.0.0` announced the
|
|
9
|
+
jump as done. Everything they carried arrives here, at once, **including the breaking change
|
|
10
|
+
that made `2.0.0` a major**. Upgrading from `1.3.0` is a major upgrade, whatever the version
|
|
11
|
+
number in between suggests.
|
|
12
|
+
|
|
13
|
+
### Breaking
|
|
14
|
+
|
|
15
|
+
- **The `Project` resource is gone.** The `/v1/projects` endpoint was withdrawn; the resource
|
|
16
|
+
had already stopped doing anything before it was removed. Any workflow with a Pilot Status
|
|
17
|
+
node set to `Project` will fail on execution — open it and delete or replace that node.
|
|
18
|
+
There is no replacement operation, because there is no longer a resource behind it.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **Flow resource** — WhatsApp Flows as a first-class resource: list, create, update,
|
|
23
|
+
publish, deprecate, and upload the Flow JSON. Categories: Sign Up, Sign In, Appointment
|
|
24
|
+
Booking, Lead Generation, Contact Us, Customer Support, Survey, Other.
|
|
25
|
+
- **`Flow Response Received` trigger event** (`flow.response_received`) — fires when someone
|
|
26
|
+
SUBMITS a Flow form, carrying the answers. **META numbers only, and picking it for a
|
|
27
|
+
non-Meta number fails SILENTLY**: the API filters a webhook's events down to what the
|
|
28
|
+
number's provider can emit, so the subscription is created with an empty event list,
|
|
29
|
+
returns `201`, and never fires. The payload is wrapped in `data`; the number field is
|
|
30
|
+
`whatsappNumberId`, not `numberId`; and `response` / `responseRaw` are mutually exclusive.
|
|
31
|
+
- **Service Window resource** — whether the 24h window is open for a contact.
|
|
32
|
+
- **Message operations**: Get Many (the operational log, with direction and status filters),
|
|
33
|
+
Get Unread, Mark as Read, Send Typing Indicator.
|
|
34
|
+
- **Media types**: Sticker, Audio (voice note), and Voice Note with waveform.
|
|
35
|
+
- Number lifecycle operations and the portfolio tier on the number resource.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- The README enumerated the trigger's events by hand and had already drifted:
|
|
40
|
+
`flow.response_received` was in the dropdown and absent from the docs. Each bullet now
|
|
41
|
+
carries the raw event name, and a test compares the README against the node's own options.
|
|
42
|
+
|
|
43
|
+
## 2.0.0 / 1.4.0
|
|
44
|
+
|
|
45
|
+
Never published to npm. Their contents ship in `2.1.0`.
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Pilot Status - n8n Integration
|
|
2
2
|
|
|
3
|
-
This is the official [n8n](https://n8n.io/) node for [Pilot Status](https://
|
|
3
|
+
This is the official [n8n](https://n8n.io/) node for [Pilot Status](https://pilotstatus.com.br) — a WhatsApp transactional, marketing, and bulk messaging platform.
|
|
4
4
|
|
|
5
|
-
With this integration, you can seamlessly connect your n8n workflows to Pilot Status to send messages,
|
|
5
|
+
With this integration, you can seamlessly connect your n8n workflows to Pilot Status to send messages, connect WhatsApp numbers, and react to incoming messages or status changes in real time.
|
|
6
|
+
|
|
7
|
+
> **Not every endpoint is a node operation, and that is deliberate.** In an n8n node the cost is not the HTTP call — it is the UI: every field needs a control written and positioned by hand, and every optional one needs a hidden twin to undo n8n's empty-value behaviour. So this node covers the operations a workflow author actually reaches for. For anything else in the public API — templates CRUD, group writes, Chatwoot, webhooks CRUD, billing — use n8n's built-in **HTTP Request** node with the same **Pilot Status API** credential: it is header auth, so it works out of the box. That is the supported escape hatch, not a workaround.
|
|
6
8
|
|
|
7
9
|
## 📦 Installation
|
|
8
10
|
|
|
@@ -27,10 +29,15 @@ npm install n8n-nodes-pilot-status
|
|
|
27
29
|
|
|
28
30
|
To use the Pilot Status node, you need an **API Key**.
|
|
29
31
|
|
|
30
|
-
1. Go to your [Pilot Status Dashboard](https://
|
|
32
|
+
1. Go to your [Pilot Status Dashboard](https://pilotstatus.com.br/api-keys).
|
|
31
33
|
2. Create a new API Key.
|
|
32
34
|
3. In n8n, add a new **Pilot Status API** credential and paste your API Key.
|
|
33
35
|
|
|
36
|
+
The credential has two optional fields:
|
|
37
|
+
|
|
38
|
+
- **Base URL** — API root without `/v1`. Leave it alone unless you are pointing the workflow at a staging environment. It is used by the node, by the credential test *and* by the dropdowns (templates, groups, newsletters), which used to always hit production.
|
|
39
|
+
- **WhatsApp Number ID** — sent as `x-whatsapp-number-id` on every request. Fill it in when your key is **tenant-scoped** and the operation is per-number; a **number-scoped** key already carries its number, and the header is ignored.
|
|
40
|
+
|
|
34
41
|
*Note: TEST keys will only send messages to the WhatsApp number registered in your Pilot Status Profile.*
|
|
35
42
|
|
|
36
43
|
---
|
|
@@ -39,20 +46,34 @@ To use the Pilot Status node, you need an **API Key**.
|
|
|
39
46
|
|
|
40
47
|
The **Pilot Status Trigger** node allows your workflows to react to real-time events.
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
**Registration: Automatic (recommended).** Select the event, pick your Pilot Status API credential, and set **Registration** to *Automatic*. Activating the workflow creates the webhook subscribed to **that event only** — so unwanted events are never delivered — and deactivating it deletes the subscription.
|
|
50
|
+
|
|
51
|
+
**Registration: Manual (default, unchanged).** Nothing is created for you:
|
|
43
52
|
1. Add the **Pilot Status Trigger** node to your workflow.
|
|
44
53
|
2. Select the event you want to listen to (or select "All Events").
|
|
45
54
|
3. **Copy the Webhook URL** provided by the node.
|
|
46
55
|
4. Go to the **Webhooks** section in your Pilot Status Dashboard and paste the URL.
|
|
47
56
|
|
|
57
|
+
In this mode the event filter runs **after** delivery: the payload has already reached n8n, and non-matching events are answered `200 Ignored event`.
|
|
58
|
+
|
|
59
|
+
### ⚠️ Verify the signature
|
|
60
|
+
|
|
61
|
+
Every delivery from a webhook that has a secret carries `x-pilot-status-signature`: `HMAC-SHA256` hex over the raw body. Paste that secret into the trigger's **Signing Secret** field and any delivery that does not match is rejected with `401`. Leave it empty and **anyone who learns your n8n webhook URL can fire this workflow** with a hand-written payload.
|
|
62
|
+
|
|
63
|
+
The API never returns the secret — not even in the `201` of the create call — so it cannot be filled in for you, including in Automatic registration. Copy it from the dashboard when the webhook is created; it is shown once.
|
|
64
|
+
|
|
48
65
|
### Available Events:
|
|
49
|
-
- **Message Sent
|
|
50
|
-
- **Message Delivered
|
|
51
|
-
- **Message Read
|
|
52
|
-
- **Message Failed
|
|
53
|
-
- **Message Reply
|
|
54
|
-
- **Message Received
|
|
55
|
-
- **Group Message
|
|
66
|
+
- **Message Sent** (`message.sent`): Triggered when the message is sent to the provider.
|
|
67
|
+
- **Message Delivered** (`message.delivered`): Triggered when the message is successfully delivered to the device.
|
|
68
|
+
- **Message Read** (`message.read`): Triggered when the user reads the message.
|
|
69
|
+
- **Message Failed** (`message.failed`): Triggered if the message fails to send (includes error details).
|
|
70
|
+
- **Message Reply** (`message.reply`): Triggered when a user replies specifically to an automated message.
|
|
71
|
+
- **Message Received** (`message.received`): Triggered when a general inbound message is received on your connected WhatsApp number.
|
|
72
|
+
- **Group Message** (`message.group`): Triggered when an inbound group message is received (group subject is included when available).
|
|
73
|
+
- **Newsletter Message** (`message.newsletter`): Triggered when an inbound WhatsApp channel / newsletter message is received.
|
|
74
|
+
- **Number Created / Connected / Disconnected / Removed** (`number.created`, `number.connected`, `number.disconnected`, `number.removed`): Lifecycle of a WhatsApp number in your account.
|
|
75
|
+
- **Call Ringing / Connected / Ended / Missed / Permission Updated** (`call.ringing`, `call.connected`, `call.ended`, `call.missed`, `call.permission_updated`): WhatsApp Business Calling events (`call.*`) — Meta Cloud API **and web (Pilot Status) numbers** (`call.permission_updated` is Meta-only). Payloads are **flat** (fields next to `event`, no `data` wrapper): `{ event, callId, externalCallId?, direction, status, from, to, timestamp, duration? }`; `duration` (seconds) appears on `call.ended` only when the call was answered. `externalCallId` is the provider call id (Meta `wacid...` or Evolution GO CallID).
|
|
76
|
+
- **Flow Response Received** (`flow.response_received`): Triggered when someone SUBMITS a WhatsApp Flow form — the answers arrive here. **META numbers only.** Wrapped in `data`: `{ event, data: { event, flowId, metaFlowId, flowToken, messageId, whatsappNumberId, from, receivedAt, response, responseRaw } }`. Three things to know. The number field is **`whatsappNumberId`, not `numberId`** — same value, different name on the wire. **`response` and `responseRaw` are mutually exclusive**: `response` holds the parsed answers and `responseRaw` is `null`; if the parse failed it is the other way round, and the raw string is the only copy of the answer there is. And picking this event for a **non-Meta** number fails SILENTLY: the API filters a webhook's events down to what the number's provider can emit, so the subscription is created with an empty event list, returns `201`, and never fires.
|
|
56
77
|
|
|
57
78
|
Webhook payload notes:
|
|
58
79
|
- 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.
|
|
@@ -69,23 +90,52 @@ The **Pilot Status** node provides several resources and operations to manage yo
|
|
|
69
90
|
### 1. Message
|
|
70
91
|
- **Send:** Send a template message (OTP, Utility, or Marketing). Choose **Phone Number** or **WhatsApp Group**; for groups use `groupId` (JID ending in `@g.us`) instead of `destinationNumber`. Optional dropdown loads groups from `GET /v1/groups` when the WhatsApp session is connected. Variables can be provided via JSON or the UI collection (including placeholders used in button labels).
|
|
71
92
|
- **Get Status:** Retrieve the current status of a specific message using either its Pilot Status message id or WhatsApp provider id.
|
|
93
|
+
- **Get History:** Read the conversation history of the number, newest first — both directions, every provider, including messages imported from the device on connect. Filters by **Start Date** / **End Date** over the *provider* timestamp (when the message happened, not when it was ingested). This is how you fetch old messages: the webhook does not replay history by default. Requires a number-scoped API key.
|
|
94
|
+
- **Get Many:** The message **log** — sent and received, with delivery status, newest first. Different from Get History: this is the operational trail (`status`, `errorCode`, `origin`, whether the 24h window was open at send), not the chat thread. Filters: Direction, Status (comma-separated), Page, Page Size. For date/search/template filters use the HTTP Request node.
|
|
95
|
+
- **Get Unread:** Unread inbound messages. ⚠️ `total` is the **real** unread count from the conversation counters — *not* the length of the returned list, which carries only the latest unread per conversation.
|
|
96
|
+
- **Mark as Read:** Blue ticks for a contact's last inbound message and every earlier one, without sending anything. Best-effort: a `200` with `acked: false` means there was nothing to acknowledge, or the number is `RELAY_ONLY`.
|
|
97
|
+
- **Send Typing Indicator:** Show "typing"/"recording" to a contact. It clears when a message is sent or after a provider timeout (~25s on Meta). On **META** numbers `recording` is shown as `typing` and `paused` is a no-op — read `effectiveState` in the response for what actually happened.
|
|
98
|
+
- **Cancel:** Cancel scheduled (not-yet-sent) messages by id.
|
|
72
99
|
|
|
73
100
|
### 2. Number
|
|
101
|
+
|
|
102
|
+
> ⚠️ **Delete changed meaning.** It used to destroy the number and free the phone for immediate reconnection. It is now a **30-day soft delete**: the device is logged out, the row survives, and the response carries `restorableUntil`. Use **Restore** to undo it (you must reconnect afterwards) or **Purge** for the old, irreversible behaviour. Deleting still does **not** reduce paid capacity — the freed slot stays available to reconnect another number this cycle.
|
|
103
|
+
|
|
74
104
|
- **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.
|
|
75
105
|
- **Connect (QR + pairing code):** Regenerate QR and pairing code for an existing instance (only when not `OPEN`).
|
|
76
106
|
- **Get Status:** Check the connection status of a WhatsApp instance (e.g., `CONNECTING`, `OPEN`).
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
85
|
-
|
|
86
|
-
|
|
107
|
+
- **Get:** Full detail of one number, including the `settings` block and — for official Meta numbers — the nested `meta` block.
|
|
108
|
+
- **Delete:** Soft-delete (30 days, reversible — see the warning above).
|
|
109
|
+
- **Restore:** Undo a soft-delete inside the window. Gives back the **row**, not the connection: run **Connect** afterwards (`requiresReconnect: true`).
|
|
110
|
+
- **Purge:** Irreversible hard delete. Cascades chat, messages, templates and keys, and tears the number down at Meta.
|
|
111
|
+
- **Logout:** Unpair the device without deleting anything — id, keys, webhooks and history are kept.
|
|
112
|
+
- **Check on WhatsApp:** Whether a phone exists on WhatsApp. **Non-official (Evolution) numbers only** — a Meta number answers `400 NOT_SUPPORTED_FOR_META`. For Brazilian mobiles the 9th-digit variant is probed too, and the returned `number` is the **registered** form to send to, which may differ from what you passed.
|
|
113
|
+
- **Update Settings:** Per-number settings. This is the only settings endpoint: there is no `POST /numbers/{id}/settings`, and Evolution's `syncFullHistory` does not exist here. Partial — only the fields you add to the collection change.
|
|
114
|
+
- **History Import Enabled** / **Webhook Historical Messages** apply to every provider. The second is off by default: each reconnect replays up to 30 days of conversation, and your integration cannot tell it apart from new traffic (on the FREE plan it also consumes inbound quota). To *read* history, use Message → Get History.
|
|
115
|
+
- **Always Online**, **Reject Call**, **Reject Call Message**, **Read Messages**, **Ignore Groups**, **Ignore Status** are the Evolution GO advanced settings, in the GO dialect (`ignoreGroups`, not the v2 `groupsIgnore`). They are tri-state: *Inherit From Provider* leaves the field untouched, *Reset to Provider Default* clears the stored value. On a Meta number they are stored but never applied.
|
|
116
|
+
|
|
117
|
+
### 3. API Key
|
|
118
|
+
- **Regenerate:** Regenerate the default API Key of a single WhatsApp number (tenant-scoped), identified by its `whatsappNumberId`. The previous key for that number is rotated and the new key is returned.
|
|
119
|
+
- **Get Many:** List API Keys. With a tenant key, this reveals every number's real API key.
|
|
120
|
+
|
|
121
|
+
### 4. Analytics
|
|
87
122
|
- **Get Dashboard:** Retrieve your messaging statistics (Total Sent, Total Failed, Failure Rate, and Daily charts) based on your timezone.
|
|
88
123
|
|
|
124
|
+
### 6. Call (WhatsApp Business Calling — Meta Cloud API + web/Pilot Status numbers)
|
|
125
|
+
- **Initiate:** Start a business-initiated voice call (BIC) — provide the destination phone. On **Meta** numbers also provide the SDP offer (RFC 8866) from your WebRTC client and a prior user call permission; BIC minutes are billed by **Meta directly on your WABA** (per minute, 6-second pulses, only when answered). On **web (Pilot Status) numbers** leave the SDP empty — media is handled server-side, no permission step and no Meta billing. Pilot Status does not charge for calls.
|
|
126
|
+
- **Accept:** Answer an inbound (user-initiated) call, after the `call.ringing` webhook. On **Meta** numbers pass the business-side SDP answer, built from the `sdpOffer` that **Get** returns with *Include SDP*; on **web** numbers leave it empty.
|
|
127
|
+
- **Reject:** Decline an incoming call.
|
|
128
|
+
- **Get:** One call. Turn on *Include SDP* to also get `sdpOffer`/`sdpAnswer` — always `null` on web numbers.
|
|
129
|
+
- **Get Many:** The number's calls, newest first (`Limit`, `Before` cursor).
|
|
130
|
+
- **Terminate:** Hang up an active call by its Pilot Status id (`call_...`) or provider call id (Meta wacid / Evolution GO CallID).
|
|
131
|
+
- **Play** *(web numbers only)*: Play an audio file into an active call by public URL (`.mp3`/`.wav`/`.opus`). Queued and played on connect when the call is not active yet. Meta numbers return `400 FEATURE_NOT_SUPPORTED`.
|
|
132
|
+
- **Realtime Session** *(web numbers only)*: Open a short-lived full-duplex realtime media session — returns `{ wsUrl, token, expiresInSeconds }`. Connect a WebSocket to `wsUrl` and exchange **raw binary PCM16 LE audio frames** (plain WebSocket transport, NOT WebRTC; single-use token, ~2 minutes). `talk` sends and receives audio; `listen` only receives.
|
|
133
|
+
- **Get Settings / Update Settings** *(Meta only)*: Read the number's `calling` settings object or enable/disable calling.
|
|
134
|
+
- **Get Permission / Request Permission** *(Meta only)*: Check whether the business may call a user, and send the interactive call-permission request (inside the 24h service window). The user's reply arrives as the `call.permission_updated` webhook.
|
|
135
|
+
|
|
136
|
+
### 5. Service Window
|
|
137
|
+
- **Get:** Whether the Meta 24h customer-service window is open for a contact. ⚠️ Branch on `windowType`, not on `open`: on a **META** number `windowType` is `META_24H` and `open` is a real constraint (outside the window only an approved template goes through); on a **web/unofficial** number `windowType` is `NONE` and `open` is **always** `true`, because the Meta rule does not exist there.
|
|
138
|
+
|
|
89
139
|
---
|
|
90
140
|
|
|
91
141
|
## 💡 Use Case Examples
|
|
@@ -94,14 +144,14 @@ Here are some ideas of what you can build with this integration:
|
|
|
94
144
|
|
|
95
145
|
1. **Abandoned Cart Recovery:** Trigger a workflow from your e-commerce platform (like Shopify or WooCommerce) to send a Pilot Status message with a discount code 1 hour after cart abandonment.
|
|
96
146
|
2. **Customer Support Routing:** Use the Trigger node to listen for `Message Received`. If the customer asks for help, create a ticket in Jira or Zendesk automatically.
|
|
97
|
-
3. **SaaS Onboarding:** When a new client signs up on your app, automatically
|
|
147
|
+
3. **SaaS Onboarding:** When a new client signs up on your app, automatically generate an API Key and provision a WhatsApp Number for them using n8n.
|
|
98
148
|
4. **Appointment Reminders:** Connect Google Calendar to n8n and use the `deliverAt` field in the Send Message operation to schedule a reminder 24 hours before the event.
|
|
99
149
|
|
|
100
150
|
---
|
|
101
151
|
|
|
102
152
|
## 📚 Documentation & Support
|
|
103
153
|
|
|
104
|
-
- **API Documentation:** [https://
|
|
105
|
-
- **Official Website:** [https://
|
|
154
|
+
- **API Documentation:** [https://pilotstatus.com.br/docs](https://pilotstatus.com.br/docs)
|
|
155
|
+
- **Official Website:** [https://pilotstatus.com.br](https://pilotstatus.com.br)
|
|
106
156
|
|
|
107
157
|
If you have any questions or need help, feel free to reach out to our support via the dashboard!
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/** Production. This is the value stored in every credential that does not pick another one. */
|
|
3
|
+
export declare const DEFAULT_BASE_URL = "https://pilotstatus.com.br";
|
|
2
4
|
export declare class PilotStatusApi implements ICredentialType {
|
|
3
5
|
name: string;
|
|
4
6
|
displayName: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PilotStatusApi = void 0;
|
|
3
|
+
exports.PilotStatusApi = exports.DEFAULT_BASE_URL = void 0;
|
|
4
|
+
/** Production. This is the value stored in every credential that does not pick another one. */
|
|
5
|
+
exports.DEFAULT_BASE_URL = 'https://pilotstatus.com.br';
|
|
4
6
|
class PilotStatusApi {
|
|
5
7
|
constructor() {
|
|
6
8
|
this.name = 'pilotStatusApi';
|
|
7
9
|
this.displayName = 'Pilot Status API';
|
|
8
|
-
this.documentationUrl = 'https://
|
|
10
|
+
this.documentationUrl = 'https://pilotstatus.com.br/docs';
|
|
9
11
|
this.properties = [
|
|
10
12
|
{
|
|
11
13
|
displayName: 'API Key',
|
|
@@ -18,18 +20,39 @@ class PilotStatusApi {
|
|
|
18
20
|
required: true,
|
|
19
21
|
description: 'API Key can be found in Pilot Status Dashboard -> API Keys',
|
|
20
22
|
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Base URL',
|
|
25
|
+
name: 'baseUrl',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: exports.DEFAULT_BASE_URL,
|
|
28
|
+
required: false,
|
|
29
|
+
description: 'API root, without the /v1 suffix. Change it only to point at a staging environment.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'WhatsApp Number ID',
|
|
33
|
+
name: 'whatsappNumberId',
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: '',
|
|
36
|
+
required: false,
|
|
37
|
+
description: 'Sent as x-whatsapp-number-id on every request. Required when the key is tenant-scoped and the operation is per-number (Chatwoot, webhook logs); leave empty for a number-scoped key, which already carries its number.',
|
|
38
|
+
},
|
|
21
39
|
];
|
|
22
40
|
this.authenticate = {
|
|
23
41
|
type: 'generic',
|
|
24
42
|
properties: {
|
|
25
43
|
headers: {
|
|
26
44
|
'x-api-key': '={{$credentials.apiKey}}',
|
|
45
|
+
// An empty header is omitted by n8n, so a credential without a number
|
|
46
|
+
// keeps behaving exactly as before — it does not become
|
|
47
|
+
// `x-whatsapp-number-id: `, which the server would read as a header
|
|
48
|
+
// that is present and invalid.
|
|
49
|
+
'x-whatsapp-number-id': '={{$credentials.whatsappNumberId || undefined}}',
|
|
27
50
|
},
|
|
28
51
|
},
|
|
29
52
|
};
|
|
30
53
|
this.test = {
|
|
31
54
|
request: {
|
|
32
|
-
baseURL: 'https://
|
|
55
|
+
baseURL: '={{($credentials.baseUrl || "https://pilotstatus.com.br").replace(/\\/+$/, "") + "/v1"}}',
|
|
33
56
|
url: '/templates',
|
|
34
57
|
},
|
|
35
58
|
};
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { ILoadOptionsFunctions, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Tri-estado dos `advancedSettings` do Evolution GO. A API distingue `true`,
|
|
4
|
+
* `false` e `null` (= volta ao default do provider), e o `type: 'boolean'` do
|
|
5
|
+
* n8n só produz dois valores — daí strings + tradução no hidden normalizado.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GO_TRISTATE: INodePropertyOptions[];
|
|
8
|
+
/**
|
|
9
|
+
* The Flow categories Meta accepts, as n8n dropdown options.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ A CLOSED list, mirroring `FLOW_CATEGORIES` in the backend's `flow.service.ts`.
|
|
12
|
+
* A free string would only fail AFTER the round trip to the Graph, and Meta's refusal
|
|
13
|
+
* does not name which of the values it rejected — so the author would be left guessing
|
|
14
|
+
* at a typo the node could have made unrepresentable.
|
|
15
|
+
*
|
|
16
|
+
* Shared by Create and Update so the two controls cannot drift apart.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FLOW_CATEGORY_OPTIONS: INodePropertyOptions[];
|
|
19
|
+
/** Production. Mirrors the credential's default. */
|
|
20
|
+
export declare const DEFAULT_BASE_URL = "https://pilotstatus.com.br";
|
|
21
|
+
/**
|
|
22
|
+
* The `/v1` root to use in the `loadOptions` calls.
|
|
23
|
+
*
|
|
24
|
+
* The node's `requestDefaults` resolves `$credentials` on its own, but
|
|
25
|
+
* `loadOptions` runs outside that path: here the URL was a literal, so the
|
|
26
|
+
* template/group dropdowns hit PRODUCTION even with the credential pointing at
|
|
27
|
+
* staging — the author saw one list while the workflow called a different API.
|
|
28
|
+
*/
|
|
29
|
+
export declare function apiBaseUrl(ctx: ILoadOptionsFunctions): Promise<string>;
|
|
2
30
|
export declare class PilotStatus implements INodeType {
|
|
3
31
|
methods: {
|
|
4
32
|
loadOptions: {
|