@webzzconnect/n8n-nodes-webzzconnect 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +141 -2
- package/dist/credentials/WebzzConnectApi.credentials.d.ts +10 -0
- package/dist/credentials/WebzzConnectApi.credentials.js +52 -0
- package/dist/credentials/WebzzConnectApi.credentials.js.map +1 -0
- package/dist/credentials/WebzzConnectOAuth2Api.credentials.d.ts +9 -0
- package/dist/credentials/WebzzConnectOAuth2Api.credentials.js +82 -0
- package/dist/credentials/WebzzConnectOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/WebzzConnect/GenericFunctions.d.ts +54 -0
- package/dist/nodes/WebzzConnect/GenericFunctions.js +295 -0
- package/dist/nodes/WebzzConnect/GenericFunctions.js.map +1 -0
- package/dist/nodes/WebzzConnect/WebzzConnect.node.d.ts +20 -0
- package/dist/nodes/WebzzConnect/WebzzConnect.node.js +845 -0
- package/dist/nodes/WebzzConnect/WebzzConnect.node.js.map +1 -0
- package/dist/nodes/WebzzConnect/WebzzConnect.node.json +12 -0
- package/dist/nodes/WebzzConnect/descriptions/ConnectionDescription.d.ts +2 -0
- package/dist/nodes/WebzzConnect/descriptions/ConnectionDescription.js +22 -0
- package/dist/nodes/WebzzConnect/descriptions/ConnectionDescription.js.map +1 -0
- package/dist/nodes/WebzzConnect/descriptions/ContactDescription.d.ts +3 -0
- package/dist/nodes/WebzzConnect/descriptions/ContactDescription.js +185 -0
- package/dist/nodes/WebzzConnect/descriptions/ContactDescription.js.map +1 -0
- package/dist/nodes/WebzzConnect/descriptions/ConversationDescription.d.ts +4 -0
- package/dist/nodes/WebzzConnect/descriptions/ConversationDescription.js +522 -0
- package/dist/nodes/WebzzConnect/descriptions/ConversationDescription.js.map +1 -0
- package/dist/nodes/WebzzConnect/descriptions/DealDescription.d.ts +3 -0
- package/dist/nodes/WebzzConnect/descriptions/DealDescription.js +282 -0
- package/dist/nodes/WebzzConnect/descriptions/DealDescription.js.map +1 -0
- package/dist/nodes/WebzzConnect/descriptions/WhatsAppTemplateDescription.d.ts +3 -0
- package/dist/nodes/WebzzConnect/descriptions/WhatsAppTemplateDescription.js +106 -0
- package/dist/nodes/WebzzConnect/descriptions/WhatsAppTemplateDescription.js.map +1 -0
- package/dist/nodes/WebzzConnect/webzzconnect.dark.svg +19 -0
- package/dist/nodes/WebzzConnect/webzzconnect.svg +19 -0
- package/dist/nodes/WebzzConnectTrigger/WebzzConnectTrigger.node.d.ts +18 -0
- package/dist/nodes/WebzzConnectTrigger/WebzzConnectTrigger.node.js +321 -0
- package/dist/nodes/WebzzConnectTrigger/WebzzConnectTrigger.node.js.map +1 -0
- package/dist/nodes/WebzzConnectTrigger/WebzzConnectTrigger.node.json +12 -0
- package/dist/nodes/WebzzConnectTrigger/webzzconnect.dark.svg +19 -0
- package/dist/nodes/WebzzConnectTrigger/webzzconnect.svg +19 -0
- package/dist/package.json +64 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +62 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Webzz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webzzconnect/n8n-nodes-webzzconnect
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is an n8n community node package for [WebzzConnect](https://connect.webzz.cloud), the omnichannel inbox, CRM and chatbot platform for small businesses. It lets you manage contacts, deals, conversations and WhatsApp templates from your n8n workflows, and start workflows instantly when something happens in WebzzConnect.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
6
|
+
|
|
7
|
+
[Installation](#installation) · [Credentials](#credentials) · [Operations](#operations) · [Trigger](#trigger) · [Rate limits](#rate-limits) · [Compatibility](#compatibility)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Follow the [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) and install `@webzzconnect/n8n-nodes-webzzconnect`.
|
|
12
|
+
|
|
13
|
+
## Credentials
|
|
14
|
+
|
|
15
|
+
The package ships two credentials. Both nodes have an **Authentication** selector to pick one. The WebzzConnect address is fixed (`https://connect.webzz.cloud`), so there is no URL field.
|
|
16
|
+
|
|
17
|
+
**WebzzConnect API (self-hosted n8n)**
|
|
18
|
+
|
|
19
|
+
1. In WebzzConnect, open **Settings > API keys** (administrators) and create a key. Tick `contacts:edit`, `deals:edit`, `conversations:reply`, `conversations:assign` and `conversations:resolve`, and optionally limit it to specific inboxes. The key is shown once.
|
|
20
|
+
2. In n8n, create a **WebzzConnect API** credential and paste the key. The credential test calls `token_info`; the account is taken from the key.
|
|
21
|
+
|
|
22
|
+
**WebzzConnect OAuth2 API (n8n Cloud)**
|
|
23
|
+
|
|
24
|
+
Create a **WebzzConnect OAuth2 API** credential and click **Connect my account**. It is a public PKCE (S256) client with the client id built in, so there is nothing to paste. Sign in to WebzzConnect if asked and approve the permissions: `contacts:edit`, `deals:edit`, `conversations:reply`, `conversations:assign` and `conversations:resolve` (each edit scope includes the matching read access). The account is taken from the token. If you untick a permission, the matching actions fail with a clear "insufficient scope" message.
|
|
25
|
+
|
|
26
|
+
**Connect as a virtual agent**
|
|
27
|
+
|
|
28
|
+
Create the key in WebzzConnect → Settings → API keys. To answer customers as a bot, make the key act as a virtual agent (admins only): its role then decides what it can do, and this connection sees only the conversations that agent handles. For reminders, CRM sync and other account-wide flows, use a key that doesn't act as a virtual agent and tick the scopes it needs.
|
|
29
|
+
|
|
30
|
+
To answer customers as a bot, choose Connect as → A virtual agent on the consent screen (admins only, one account). Choose Me to act as yourself.
|
|
31
|
+
|
|
32
|
+
Add a trigger on the same connection: it keeps the agent listening. With a virtual agent connection, keep this workflow active: it is what keeps the agent listening. While it is off, new conversations go to your team, and each conversation the agent holds goes to your team when the customer writes next. To stop the bot, pause the virtual agent in WebzzConnect. Deactivate the workflow before you switch its credential. If a credential was revoked while the workflow was active, deactivation still completes and writes "Couldn't remove WebzzConnect webhook subscription {id}: the credential is no longer valid. It may keep sending events to this URL until it's removed in WebzzConnect → Settings → App webhooks." to the n8n log; delete the leftover in WebzzConnect → Settings → App webhooks.
|
|
33
|
+
|
|
34
|
+
Replacing a connection: switching a trigger's credential, even to another credential of the same account, leaves the old subscription delivering to the old address until it is deleted. A leftover row of a virtual agent keeps that agent listening. Replacing an all-inboxes key with a one-inbox key makes activation fail with a 422 until the old row is gone. The remedy is the same: an administrator deletes the subscription in WebzzConnect → Settings → App webhooks.
|
|
35
|
+
|
|
36
|
+
Two agents' flows can hand a conversation back and forth (A hands to B, B hands back to A). Nothing stops that for you: your flow logic must prevent it, for example by recording a hand-off in a custom attribute and not handing the same conversation back.
|
|
37
|
+
|
|
38
|
+
A conversation the bot holds and the customer leaves quiet gets a nudge after 5 minutes and closes 10 minutes later (auto-closed).
|
|
39
|
+
|
|
40
|
+
Use **Connection → Get Info** to see who a credential acts as (`kind`, account, virtual agent, person). It works while the agent is paused.
|
|
41
|
+
|
|
42
|
+
**Hand off to a person or another agent**
|
|
43
|
+
|
|
44
|
+
Use Assign (a person or a virtual agent) or Unassign (your team), with a hand-off note. The person is notified and reads the note in the conversation; the customer sees nothing. Labels don't move a conversation: keep them for tagging. A virtual agent hands off to one target: pick a team or an agent, not both.
|
|
45
|
+
|
|
46
|
+
**Flows on an account key**
|
|
47
|
+
|
|
48
|
+
A person replied when `message_type` is outgoing, `private` is false, `content_attributes.automation_rule_id` is empty, and `sender.type` is "user" or `content_attributes.external_echo` is true (a reply from the WhatsApp Business app). WhatsApp campaign and scheduled template sends arrive with `message_type` "template", so they never match. An account key's messages arrive with `sender` null.
|
|
49
|
+
|
|
50
|
+
`button_payload` is customer input: compare it with Equals in a Switch node and keep a fallback; never use it in a Code node, a URL or an ID field.
|
|
51
|
+
|
|
52
|
+
Both credentials also work with n8n's HTTP Request node (**Predefined Credential Type**) for any WebzzConnect API call this node does not cover. Requests go to `https://connect.webzz.cloud/api/v1/accounts/<account id>/...`.
|
|
53
|
+
|
|
54
|
+
## Operations
|
|
55
|
+
|
|
56
|
+
**Contact**
|
|
57
|
+
- Create
|
|
58
|
+
- Update
|
|
59
|
+
- Get
|
|
60
|
+
- Search (by name, email or phone)
|
|
61
|
+
- Create or Update: finds an existing contact by exact email or by phone number (national formats such as `050-1234567` match the stored international number), updates it, or creates a new one. Running it twice with the same data never creates a duplicate.
|
|
62
|
+
|
|
63
|
+
**Deal**
|
|
64
|
+
- Create (pick the pipeline and stage from your own lists)
|
|
65
|
+
- Update
|
|
66
|
+
- Move Stage (including won and lost, with an optional lost reason and note)
|
|
67
|
+
- Get
|
|
68
|
+
- Search (query, contact, pipeline, stage, owner, status)
|
|
69
|
+
|
|
70
|
+
**Conversation**
|
|
71
|
+
- Create (with an optional first message and an optional Status). With a virtual agent connection, a new conversation is handled by that agent, so the customer's reply comes to your flow. A virtual agent can send only into conversations it handles: for reminders and broadcasts, use an account key or an "as me" connection.
|
|
72
|
+
- Send Message (reply, or add a private note; optionally attach a file by public URL, with the text as a caption). **Message Type** also offers WhatsApp interactive messages: **Reply Buttons** (up to 3), **List** (up to 10 rows with optional descriptions and sections, and a menu label) and **Link Button** (one button that opens a URL), each with an optional header (text, or image / video / document by URL; a list only takes text) and footer. The message text is the body and is required. Each button or row has an ID (the title if left empty) that comes back as `button_payload` when the contact taps it. Interactive messages need a WhatsApp Cloud inbox and the 24-hour window; WebzzConnect checks WhatsApp's limits and answers with a clear message.
|
|
73
|
+
- Set Custom Attributes (key / value pairs, merged into the conversation's existing attributes; needs the conversations view and resolve permissions)
|
|
74
|
+
- Add Labels (comma-separated, sent in lowercase, added to the conversation's existing labels; needs the conversations view and reply permissions)
|
|
75
|
+
- Get
|
|
76
|
+
- Get Many (by status, inbox and virtual agent; statuses include With a Virtual Agent, Waiting on Customer and Pending (Both). With a virtual agent connection, Open finds none)
|
|
77
|
+
- Assign (a person or a virtual agent in the conversation's inbox, and/or a team, with an optional hand-off note; an unknown or unavailable one is refused and nothing changes)
|
|
78
|
+
- Unassign (agent, team, or both, with an optional hand-off note)
|
|
79
|
+
- Update Status (Open, Resolved, Snoozed with an optional Snooze Until, or Waiting on Customer). Resolved sends the CSAT survey when the inbox has CSAT on. Open through an "as me" connection of an agent-role user also assigns the conversation to that user.
|
|
80
|
+
|
|
81
|
+
**Connection**
|
|
82
|
+
- Get Info (who this credential acts as)
|
|
83
|
+
|
|
84
|
+
**WhatsApp Template**
|
|
85
|
+
- Send: choose a WhatsApp inbox, a contact and an approved template, then fill the fields that appear for the template: header text or media URL, body variables (numbered or named), URL button variables and the copy-code coupon. If the template is set by an expression, fill **Body Variables** in order instead. The message is created in the contact's open conversation, or in a new one.
|
|
86
|
+
|
|
87
|
+
**Custom API Call**
|
|
88
|
+
- For an endpoint the node doesn't cover, pick **Custom API Call** in the node's actions. It opens an HTTP Request node. Set **Authentication** to *Predefined Credential Type*, choose **WebzzConnect API** (or **WebzzConnect OAuth2 API**), and call `https://connect.webzz.cloud/api/v1/accounts/<account id>/...`.
|
|
89
|
+
|
|
90
|
+
List-style operations have **Return All** and **Limit**. Fields that WebzzConnect uses internally (names starting with `wz_`) are removed from the output. Errors show the message from WebzzConnect; a rate-limit error tells you how long to wait.
|
|
91
|
+
|
|
92
|
+
## Trigger
|
|
93
|
+
|
|
94
|
+
**WebzzConnect Trigger** starts a workflow instantly (no polling). Choose one or more events:
|
|
95
|
+
|
|
96
|
+
- New Conversation, Conversation Status Changed, Conversation Updated
|
|
97
|
+
- Conversation Handed Off: a virtual agent handed a conversation to a person, another virtual agent or the team. The output has `handoff.from`, `handoff.to` (type agent, person or team; no ID or name for the team), `handoff.note` and `handoff.waiting_message`, each possibly null. It is sent at least once: skip a repeat with the same waiting message ID, when there is one.
|
|
98
|
+
- New Message (filter by direction; new triggers default to Incoming, which keeps a reply bot from answering its own messages and their status updates). The output has a top-level `button_payload`: the ID of the tapped reply button or list row, the text (or payload) of a template quick reply, or `null` for typed text, so a Switch node can branch on `{{$json.button_payload}}`.
|
|
99
|
+
- Contact Created, Contact Updated
|
|
100
|
+
- Deal Created, Deal Updated, Deal Stage Changed, Deal Won, Deal Lost, Deal Deleted
|
|
101
|
+
|
|
102
|
+
Optionally narrow conversation and message events to some inboxes, and deal events to some pipelines. Leave a picker empty to receive events from all of them. To change the events or the pickers, deactivate and activate the workflow again.
|
|
103
|
+
|
|
104
|
+
Activating the workflow registers the n8n webhook address in WebzzConnect; deactivating removes it. If the same address is already registered, its secret is rotated (the registration stays). If the n8n webhook address changes (for example a new host), the next activation replaces the old registration. Every delivery is checked against its HMAC-SHA256 signature (`X-WebzzConnect-Signature`) and rejected if it is older than five minutes. Your n8n webhook address must be reachable from the internet (set `WEBHOOK_URL` for self-hosted n8n).
|
|
105
|
+
|
|
106
|
+
The connected person or virtual agent needs access to the data behind each event, otherwise activation fails with a message naming the missing permission.
|
|
107
|
+
|
|
108
|
+
## Errors you may see
|
|
109
|
+
|
|
110
|
+
| Code | What it means | What to do |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| `[409] not_handling` | This virtual agent isn't handling this conversation any more: a person took it, it was handed off, or it's resolved. | Stop the flow for this conversation. |
|
|
113
|
+
| `[403] agent_paused` | The virtual agent is paused, so this connection can't act. | Set the agent live in WebzzConnect, then run again. |
|
|
114
|
+
| `[403]` other | This connection isn't allowed to do this. For a virtual agent its role decides; for an API key, its scopes and inboxes; for OAuth, what was approved at consent. | Check the server message in brackets. |
|
|
115
|
+
| `[422] assignee_not_available` | That person or virtual agent is unknown, removed, or not in the conversation's inbox. | Nothing was changed; pick another. |
|
|
116
|
+
| `[422] conversation_resolved` | A virtual agent can't be assigned to a resolved conversation. | Reopen it first, or assign a person. |
|
|
117
|
+
| `[422] handoff_note_not_allowed` | Only the virtual agent handling the conversation can add a hand-off note, and only when it hands the conversation to someone. | Remove the note, or use a virtual agent connection. |
|
|
118
|
+
| `[422] handoff_note_invalid` | The hand-off note must be 1 to 500 characters. | Shorten it. |
|
|
119
|
+
| `handoff_one_target` | A virtual agent hands off to one target. | Choose an agent or a team, not both. |
|
|
120
|
+
| `assign_no_target` | No person or virtual agent was chosen (or the ID was 0). | Pick one, or use Unassign. |
|
|
121
|
+
| `[422]` on a contact | The contact may exist but this virtual agent sees only the contacts of conversations it handles. | Use an account key or an "as me" connection. |
|
|
122
|
+
|
|
123
|
+
## Rate limits
|
|
124
|
+
|
|
125
|
+
WebzzConnect allows 600 requests per minute per connection, and contact search is limited to 100 requests per minute per account. When a limit is hit the node fails with a rate-limit error that includes the `Retry-After` wait. Use **Retry On Fail** on the node, or a Wait node, in high-volume workflows.
|
|
126
|
+
|
|
127
|
+
## Example workflows
|
|
128
|
+
|
|
129
|
+
- [WhatsApp sales chatbot with hand-off](examples/whatsapp-sales-flow.json): a menu of reply buttons, a pricing link button, a demo-slot list, and a hand-off to your team with a note. It answers only conversations its virtual agent holds (it checks Connection → Get Info), and a button tapped at the wrong step does nothing. To use it, copy the file's contents and paste them into the n8n editor, or use **Import from URL** with the file's raw GitHub link. Setup steps are in the sticky note inside the workflow.
|
|
130
|
+
|
|
131
|
+
## Compatibility
|
|
132
|
+
|
|
133
|
+
Tested with n8n 1.x and 2.x (Node.js 22). Requires a WebzzConnect account.
|
|
134
|
+
|
|
135
|
+
## Resources
|
|
136
|
+
|
|
137
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
138
|
+
- [WebzzConnect](https://connect.webzz.cloud)
|
|
139
|
+
|
|
140
|
+
## Version history
|
|
141
|
+
|
|
142
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, Icon, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class WebzzConnectApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebzzConnectApi = void 0;
|
|
4
|
+
class WebzzConnectApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'webzzConnectApi';
|
|
7
|
+
this.displayName = 'WebzzConnect API';
|
|
8
|
+
this.icon = {
|
|
9
|
+
light: 'file:../nodes/WebzzConnect/webzzconnect.svg',
|
|
10
|
+
dark: 'file:../nodes/WebzzConnect/webzzconnect.dark.svg',
|
|
11
|
+
};
|
|
12
|
+
this.documentationUrl = 'https://api-connect.webzz.cloud';
|
|
13
|
+
this.properties = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Use on self-hosted n8n.',
|
|
16
|
+
name: 'notice',
|
|
17
|
+
type: 'notice',
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Create the key in WebzzConnect → Settings → API keys. To answer customers as a bot, make the key act as a virtual agent (admins only): its role then decides what it can do, and this connection sees only the conversations that agent handles. For reminders, CRM sync and other account-wide flows, use a key that doesn\'t act as a virtual agent and tick the scopes it needs.',
|
|
22
|
+
name: 'agentNotice',
|
|
23
|
+
type: 'notice',
|
|
24
|
+
default: '',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: 'API Key',
|
|
28
|
+
name: 'apiKey',
|
|
29
|
+
type: 'string',
|
|
30
|
+
typeOptions: { password: true },
|
|
31
|
+
default: '',
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
this.authenticate = {
|
|
36
|
+
type: 'generic',
|
|
37
|
+
properties: {
|
|
38
|
+
headers: {
|
|
39
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
this.test = {
|
|
44
|
+
request: {
|
|
45
|
+
baseURL: 'https://connect.webzz.cloud',
|
|
46
|
+
url: '/api/v1/token_info',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.WebzzConnectApi = WebzzConnectApi;
|
|
52
|
+
//# sourceMappingURL=WebzzConnectApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebzzConnectApi.credentials.js","sourceRoot":"","sources":["../../credentials/WebzzConnectApi.credentials.ts"],"names":[],"mappings":";;;AAYA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QAEzB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,SAAI,GAAS;YACZ,KAAK,EAAE,6CAA6C;YACpD,IAAI,EAAE,kDAAkD;SACxD,CAAC;QAEF,qBAAgB,GAAG,iCAAiC,CAAC;QAErD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EACV,yBAAyB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EACV,qXAAqX;gBACtX,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,6BAA6B;gBACtC,GAAG,EAAE,oBAAoB;aACzB;SACD,CAAC;IACH,CAAC;CAAA;AApDD,0CAoDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class WebzzConnectOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
extends: string[];
|
|
5
|
+
displayName: string;
|
|
6
|
+
icon: Icon;
|
|
7
|
+
documentationUrl: string;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebzzConnectOAuth2Api = void 0;
|
|
4
|
+
class WebzzConnectOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'webzzConnectOAuth2Api';
|
|
7
|
+
this.extends = ['oAuth2Api'];
|
|
8
|
+
this.displayName = 'WebzzConnect OAuth2 API';
|
|
9
|
+
this.icon = {
|
|
10
|
+
light: 'file:../nodes/WebzzConnect/webzzconnect.svg',
|
|
11
|
+
dark: 'file:../nodes/WebzzConnect/webzzconnect.dark.svg',
|
|
12
|
+
};
|
|
13
|
+
this.documentationUrl = 'https://api-connect.webzz.cloud';
|
|
14
|
+
this.properties = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'For n8n Cloud. On self-hosted n8n, use WebzzConnect API.',
|
|
17
|
+
name: 'notice',
|
|
18
|
+
type: 'notice',
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'To answer customers as a bot, choose Connect as → A virtual agent on the consent screen (admins only, one account). Choose Me to act as yourself.',
|
|
23
|
+
name: 'agentNotice',
|
|
24
|
+
type: 'notice',
|
|
25
|
+
default: '',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Grant Type',
|
|
29
|
+
name: 'grantType',
|
|
30
|
+
type: 'hidden',
|
|
31
|
+
default: 'pkce',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Authorization URL',
|
|
35
|
+
name: 'authUrl',
|
|
36
|
+
type: 'hidden',
|
|
37
|
+
default: 'https://connect.webzz.cloud/oauth/authorize',
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Access Token URL',
|
|
42
|
+
name: 'accessTokenUrl',
|
|
43
|
+
type: 'hidden',
|
|
44
|
+
default: 'https://connect.webzz.cloud/oauth/token',
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Client ID',
|
|
49
|
+
name: 'clientId',
|
|
50
|
+
type: 'hidden',
|
|
51
|
+
default: '-nXfHxzbF6UryNF2eXwo2ufe3tbvUA2rbTZ-k6Mz-gM',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Client Secret',
|
|
55
|
+
name: 'clientSecret',
|
|
56
|
+
type: 'hidden',
|
|
57
|
+
typeOptions: { password: true },
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Scope',
|
|
62
|
+
name: 'scope',
|
|
63
|
+
type: 'hidden',
|
|
64
|
+
default: 'contacts:edit deals:edit conversations:reply conversations:assign conversations:resolve',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Auth URI Query Parameters',
|
|
68
|
+
name: 'authQueryParameters',
|
|
69
|
+
type: 'hidden',
|
|
70
|
+
default: '',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Authentication',
|
|
74
|
+
name: 'authentication',
|
|
75
|
+
type: 'hidden',
|
|
76
|
+
default: 'body',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.WebzzConnectOAuth2Api = WebzzConnectOAuth2Api;
|
|
82
|
+
//# sourceMappingURL=WebzzConnectOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebzzConnectOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/WebzzConnectOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAUA,MAAa,qBAAqB;IAAlC;QACC,SAAI,GAAG,uBAAuB,CAAC;QAE/B,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,yBAAyB,CAAC;QAExC,SAAI,GAAS;YACZ,KAAK,EAAE,6CAA6C;YACpD,IAAI,EAAE,kDAAkD;SACxD,CAAC;QAEF,qBAAgB,GAAG,iCAAiC,CAAC;QAErD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,0DAA0D;gBACvE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EACV,mJAAmJ;gBACpJ,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6CAA6C;gBACtD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yCAAyC;gBAClD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6CAA6C;aACtD;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yFAAyF;aAClG;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;SACD,CAAC;IACH,CAAC;CAAA;AAhFD,sDAgFC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions, INode, INodeProperties, IWebhookFunctions } from 'n8n-workflow';
|
|
2
|
+
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
|
3
|
+
export declare const BASE_URL = "https://connect.webzz.cloud";
|
|
4
|
+
export declare const API_KEY_CREDENTIAL = "webzzConnectApi";
|
|
5
|
+
export declare const PKCE_CREDENTIAL = "webzzConnectOAuth2Api";
|
|
6
|
+
export declare const authenticationProperty: INodeProperties;
|
|
7
|
+
export declare const COPY: {
|
|
8
|
+
handoffOneTarget: string;
|
|
9
|
+
connectionKindUnknown: string;
|
|
10
|
+
assignNoTarget: string;
|
|
11
|
+
contactNotVisible: string;
|
|
12
|
+
};
|
|
13
|
+
export type WzContext = IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | IWebhookFunctions;
|
|
14
|
+
interface RequestOptions {
|
|
15
|
+
qs?: IDataObject;
|
|
16
|
+
body?: IDataObject;
|
|
17
|
+
absolute?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ErrorInfo {
|
|
20
|
+
status?: number;
|
|
21
|
+
message: string;
|
|
22
|
+
retryAfter?: string;
|
|
23
|
+
body?: IDataObject;
|
|
24
|
+
}
|
|
25
|
+
export declare function digitsOnly(value: string): string;
|
|
26
|
+
export declare function stripInternalKeys<T>(value: T): T;
|
|
27
|
+
export declare function getCredentialName(this: WzContext): string;
|
|
28
|
+
export declare function getAccountId(this: WzContext): Promise<string>;
|
|
29
|
+
export declare function getConnectionInfo(this: WzContext): Promise<IDataObject>;
|
|
30
|
+
export declare function pathId(this: WzContext, value: unknown): string;
|
|
31
|
+
export declare function parseAssignee(this: WzContext, value: unknown): {
|
|
32
|
+
id: string;
|
|
33
|
+
type: 'User' | 'AgentBot';
|
|
34
|
+
} | undefined;
|
|
35
|
+
export declare function wzRawRequest(this: WzContext, method: IHttpRequestMethods, path: string, options?: RequestOptions): Promise<unknown>;
|
|
36
|
+
export declare function readErrorInfo(error: unknown): ErrorInfo;
|
|
37
|
+
export declare function handleApiError(this: WzContext, error: unknown): never;
|
|
38
|
+
export declare function errorForItem(node: INode, error: unknown, itemIndex: number): NodeApiError | NodeOperationError;
|
|
39
|
+
export declare function wzApiRequest(this: WzContext, method: IHttpRequestMethods, path: string, options?: RequestOptions): Promise<unknown>;
|
|
40
|
+
interface PaginateOptions {
|
|
41
|
+
qs?: IDataObject;
|
|
42
|
+
returnAll: boolean;
|
|
43
|
+
limit: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
extract: (response: unknown) => IDataObject[];
|
|
46
|
+
hasMore?: (response: unknown, items: IDataObject[]) => boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare function wzPaginate(this: WzContext, path: string, options: PaginateOptions): Promise<IDataObject[]>;
|
|
49
|
+
export declare function asArray(response: unknown): IDataObject[];
|
|
50
|
+
export declare function asObject(value: unknown): IDataObject;
|
|
51
|
+
export declare function unwrapContact(response: unknown): IDataObject;
|
|
52
|
+
export declare function pairsToObject(pairs: IDataObject | undefined): IDataObject;
|
|
53
|
+
export declare function phonesMatch(a: string, b: string): boolean;
|
|
54
|
+
export {};
|