n8n-nodes-ringee 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +255 -2
- package/dist/credentials/RingeeApi.credentials.d.ts +13 -0
- package/dist/credentials/RingeeApi.credentials.js +76 -0
- package/dist/credentials/RingeeApi.credentials.js.map +1 -0
- package/dist/credentials/ringee.dark.svg +1 -0
- package/dist/credentials/ringee.svg +1 -0
- package/dist/lib/api/capabilities.d.ts +4 -0
- package/dist/lib/api/capabilities.js +56 -0
- package/dist/lib/api/capabilities.js.map +1 -0
- package/dist/lib/api/client.d.ts +27 -0
- package/dist/lib/api/client.js +163 -0
- package/dist/lib/api/client.js.map +1 -0
- package/dist/lib/errors/index.d.ts +12 -0
- package/dist/lib/errors/index.js +172 -0
- package/dist/lib/errors/index.js.map +1 -0
- package/dist/lib/types/index.d.ts +233 -0
- package/dist/lib/types/index.js +114 -0
- package/dist/lib/types/index.js.map +1 -0
- package/dist/lib/utils/base-url.d.ts +9 -0
- package/dist/lib/utils/base-url.js +42 -0
- package/dist/lib/utils/base-url.js.map +1 -0
- package/dist/lib/utils/dedupe.d.ts +7 -0
- package/dist/lib/utils/dedupe.js +23 -0
- package/dist/lib/utils/dedupe.js.map +1 -0
- package/dist/lib/utils/idempotency.d.ts +10 -0
- package/dist/lib/utils/idempotency.js +17 -0
- package/dist/lib/utils/idempotency.js.map +1 -0
- package/dist/lib/utils/phone.d.ts +4 -0
- package/dist/lib/utils/phone.js +23 -0
- package/dist/lib/utils/phone.js.map +1 -0
- package/dist/lib/utils/webhook.d.ts +19 -0
- package/dist/lib/utils/webhook.js +56 -0
- package/dist/lib/utils/webhook.js.map +1 -0
- package/dist/nodes/Ringee/Ringee.node.d.ts +17 -0
- package/dist/nodes/Ringee/Ringee.node.js +78 -0
- package/dist/nodes/Ringee/Ringee.node.js.map +1 -0
- package/dist/nodes/Ringee/Ringee.node.json +19 -0
- package/dist/nodes/Ringee/methods/listSearch.d.ts +4 -0
- package/dist/nodes/Ringee/methods/listSearch.js +66 -0
- package/dist/nodes/Ringee/methods/listSearch.js.map +1 -0
- package/dist/nodes/Ringee/methods/resourceMapping.d.ts +2 -0
- package/dist/nodes/Ringee/methods/resourceMapping.js +26 -0
- package/dist/nodes/Ringee/methods/resourceMapping.js.map +1 -0
- package/dist/nodes/Ringee/resources/aiAgent/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/aiAgent/index.js +413 -0
- package/dist/nodes/Ringee/resources/aiAgent/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/call/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/call/index.js +199 -0
- package/dist/nodes/Ringee/resources/call/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/contact/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/contact/index.js +329 -0
- package/dist/nodes/Ringee/resources/contact/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/index.d.ts +4 -0
- package/dist/nodes/Ringee/resources/index.js +26 -0
- package/dist/nodes/Ringee/resources/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/phoneNumber/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/phoneNumber/index.js +114 -0
- package/dist/nodes/Ringee/resources/phoneNumber/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/recording/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/recording/index.js +87 -0
- package/dist/nodes/Ringee/resources/recording/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/transcript/index.d.ts +2 -0
- package/dist/nodes/Ringee/resources/transcript/index.js +112 -0
- package/dist/nodes/Ringee/resources/transcript/index.js.map +1 -0
- package/dist/nodes/Ringee/resources/types.d.ts +6 -0
- package/dist/nodes/Ringee/resources/types.js +3 -0
- package/dist/nodes/Ringee/resources/types.js.map +1 -0
- package/dist/nodes/Ringee/ringee.dark.svg +1 -0
- package/dist/nodes/Ringee/ringee.svg +1 -0
- package/dist/nodes/Ringee/shared/call-detail.d.ts +7 -0
- package/dist/nodes/Ringee/shared/call-detail.js +50 -0
- package/dist/nodes/Ringee/shared/call-detail.js.map +1 -0
- package/dist/nodes/Ringee/shared/execution.d.ts +5 -0
- package/dist/nodes/Ringee/shared/execution.js +28 -0
- package/dist/nodes/Ringee/shared/execution.js.map +1 -0
- package/dist/nodes/Ringee/shared/fields.d.ts +7 -0
- package/dist/nodes/Ringee/shared/fields.js +113 -0
- package/dist/nodes/Ringee/shared/fields.js.map +1 -0
- package/dist/nodes/RingeeTrigger/RingeeTrigger.node.d.ts +30 -0
- package/dist/nodes/RingeeTrigger/RingeeTrigger.node.js +224 -0
- package/dist/nodes/RingeeTrigger/RingeeTrigger.node.js.map +1 -0
- package/dist/nodes/RingeeTrigger/RingeeTrigger.node.json +19 -0
- package/dist/package.json +81 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +80 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ringee
|
|
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,256 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://www.ringee.io/logos/white.logo.png">
|
|
4
|
+
<img alt="Ringee" src="https://www.ringee.io/logos/black.logo.png" width="220">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# n8n-nodes-ringee
|
|
9
|
+
|
|
10
|
+
**Give your n8n workflows the power to make phone calls.**
|
|
11
|
+
|
|
12
|
+
Ringee community node for [n8n](https://n8n.io): start AI voice agent calls, read results, transcripts and recordings, manage contacts, and react to call events. Built for AI appointment reminders, lead qualification, missed-call callbacks, AI receptionists, and AI agents that pick up the phone.
|
|
13
|
+
|
|
14
|
+
> **Status.** This is a community node. It has **not been verified by n8n yet**, so it is not available on n8n Cloud. Install it on self-hosted n8n through _Settings → Community nodes_ (see [Installation](#installation)), or use the [HTTP Request alternative](workflows/alternatives/01-ai-appointment-reminder-http-request.json) on n8n Cloud. The verification work is tracked in [docs/n8n-verification-checklist.md](docs/n8n-verification-checklist.md).
|
|
15
|
+
|
|
16
|
+
[Quick start](#make-your-first-ai-phone-call-in-under-5-minutes) ·
|
|
17
|
+
[Installation](#installation) ·
|
|
18
|
+
[Credentials](#credentials) ·
|
|
19
|
+
[Operations](#operations) ·
|
|
20
|
+
[Ringee Trigger](#ringee-trigger) ·
|
|
21
|
+
[AI Agent tools](#use-ringee-as-a-tool-in-an-n8n-ai-agent) ·
|
|
22
|
+
[Templates](#workflow-templates) ·
|
|
23
|
+
[Compatibility](#compatibility) ·
|
|
24
|
+
[Troubleshooting](#troubleshooting)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Make your first AI phone call in under 5 minutes
|
|
29
|
+
|
|
30
|
+
1. **Create the key.** In Ringee open **Integrations → Custom Integrations**, create an integration and copy its **API key** (`cik_live_…`) and **Signing Secret** (`whsec_…`).
|
|
31
|
+
2. **Install the node.** In n8n: **Settings → Community nodes → Install**, enter `n8n-nodes-ringee`.
|
|
32
|
+
3. **Add the credential.** Create a **Ringee API** credential, paste the API key (and the signing secret if you will use the trigger) and click **Test**.
|
|
33
|
+
4. **Import the quick start.** Import [`workflows/00-quick-start-first-ai-call.json`](workflows/00-quick-start-first-ai-call.json).
|
|
34
|
+
5. **Pick your agent and your number.** In _Start AI call_ choose your AI voice agent from the list and replace the sample phone number with **your own**.
|
|
35
|
+
6. **Execute.** Your phone rings. Two minutes later the last node shows how the call went.
|
|
36
|
+
|
|
37
|
+
Or build it by hand: add the **Ringee** node → **AI Voice Agent → Start Call** → choose an agent → enter a number → execute. Start Call returns immediately with the call ID; the call itself finishes later.
|
|
38
|
+
|
|
39
|
+
> **Real calls cost real credits and reach real people.** Call only people who agreed to be called, only at suitable hours, and follow your local rules on automated calls and recording. Ringee refuses numbers on your Do-Not-Call list and stops when credits run out; permission to call is yours to confirm.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
### Through the n8n interface (self-hosted)
|
|
44
|
+
|
|
45
|
+
**Settings → Community nodes → Install**, enter `n8n-nodes-ringee`, accept the risk notice and install. See n8n's [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
46
|
+
|
|
47
|
+
### Manually, on a self-hosted n8n
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cd ~/.n8n/nodes # create it if it does not exist
|
|
51
|
+
npm install n8n-nodes-ringee
|
|
52
|
+
# restart n8n
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For Docker, install it into the `nodes` folder of the volume mounted at `/home/node/.n8n`, or build an image that runs the `npm install` above.
|
|
56
|
+
|
|
57
|
+
### Using the node as an AI Agent tool
|
|
58
|
+
|
|
59
|
+
On self-hosted n8n, community nodes are only offered as tools when this is set on the n8n process:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### n8n Cloud
|
|
66
|
+
|
|
67
|
+
Cloud installs only [verified](docs/n8n-verification-checklist.md) community nodes. Until Ringee is verified, use the [HTTP Request alternative](workflows/alternatives/01-ai-appointment-reminder-http-request.json) with a Header Auth credential.
|
|
68
|
+
|
|
69
|
+
## Credentials
|
|
70
|
+
|
|
71
|
+
Create a **Ringee API** credential:
|
|
72
|
+
|
|
73
|
+
| Field | What to enter |
|
|
74
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| **API Key** | The `cik_live_…` key of a Ringee **Custom Integration** (Integrations → Custom Integrations). It is shown once; copy it when created. |
|
|
76
|
+
| **Base URL** | `https://api.ringee.io` for Ringee Cloud (the default). For a self-hosted Ringee, your API address, without `/api`. |
|
|
77
|
+
| **Webhook Signing Secret** | The integration's `whsec_…` secret. Only the **Ringee Trigger** needs it. |
|
|
78
|
+
|
|
79
|
+
Click **Test**: n8n reads one page of contacts with the key. A rejected key says so; a valid key in a workspace without AI voice agents still passes (contacts and calls do not need them).
|
|
80
|
+
|
|
81
|
+
How the key works:
|
|
82
|
+
|
|
83
|
+
- **The key belongs to a workspace.** Ringee derives the organization and the user from the key, so there is no workspace or user field and a request can never name another one.
|
|
84
|
+
- **Rotate it in Ringee.** A regenerated key stops working at once; update the credential.
|
|
85
|
+
- **It only travels to the Base URL.** The node requires `https` (plain `http` only for `localhost`), refuses addresses with embedded passwords, and **never follows redirects**, so a misconfigured or hostile address cannot receive the key.
|
|
86
|
+
- **It is never logged or returned** in node output or error messages.
|
|
87
|
+
|
|
88
|
+
## Operations
|
|
89
|
+
|
|
90
|
+
All resources use the standard **Resource → Operation** selectors. Lists have **Return All** and **Limit**; items stay linked to their inputs, and **Continue On Fail** keeps one failed item from stopping the rest.
|
|
91
|
+
|
|
92
|
+
| Resource | Operations |
|
|
93
|
+
| ------------------ | -------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| **AI Voice Agent** | Get · Get Many · **Start Call** · Cancel Call · Get Call Status · Get Call Result · Get Many Calls |
|
|
95
|
+
| **Call** | Get · Get Many · Create Dialer Link (a link a person opens to place a human call) |
|
|
96
|
+
| **Contact** | Create · Create or Update · Get · Get Many · Update · Delete |
|
|
97
|
+
| **Phone Number** | Get · Get Many (the numbers an AI voice agent can call from) |
|
|
98
|
+
| **Recording** | Get · Download (as binary audio) |
|
|
99
|
+
| **Transcript** | Get · Get AI Analysis · Get Summary · Get Extracted Information |
|
|
100
|
+
|
|
101
|
+
Agents, caller numbers and contacts are picked from searchable lists (or by ID). The variables an agent accepts, such as first name or what the call is about, appear as fields once you choose the agent.
|
|
102
|
+
|
|
103
|
+
### Start Call
|
|
104
|
+
|
|
105
|
+
`AI Voice Agent → Start Call` returns at once with the call ID, so a workflow never blocks on a phone call:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"call_id": "5a6bb1fc-00ea-4996-8fe4-0a221d047162",
|
|
110
|
+
"status": "initiating",
|
|
111
|
+
"finished": false,
|
|
112
|
+
"queued": false,
|
|
113
|
+
"idempotent_replayed": false
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Ringee paces the calls it starts. When a call has to wait for capacity it is **accepted, not dialed**: `status` is `queued`, `queued` is `true`, and `expires_at` says when it gives up. A queued call that is never dialed costs nothing and sends no event; **Cancel Call** withdraws it. Large batches, a full queue and what to do about each: [docs/queue-and-capacity.md](docs/queue-and-capacity.md).
|
|
118
|
+
|
|
119
|
+
| Option | What it does |
|
|
120
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
121
|
+
| **Caller Number** | The number the person sees. Empty = the one assigned to the agent. |
|
|
122
|
+
| **External ID** | Your own ID for this call (a CRM record, a calendar event). Ringee returns it as `externalId` on **every event** about the call, so a trigger workflow finds the record again. |
|
|
123
|
+
| **Idempotency Key** | Makes the request safe to repeat: one call per key. Empty = the node uses a key unique to this execution and item. See [Never a second paid call](#never-a-second-paid-call). |
|
|
124
|
+
| **Metadata (JSON)** | Extra data stored with the call and returned in its result. |
|
|
125
|
+
|
|
126
|
+
Ringee decides what is allowed: no credits, a number on the Do-Not-Call list, an unusable caller ID or an unavailable agent all refuse the call with a message that says what to do. Nothing is dialed.
|
|
127
|
+
|
|
128
|
+
### Reading the result
|
|
129
|
+
|
|
130
|
+
A call takes a minute or two and its analysis a little longer, so there are two ways to get the result:
|
|
131
|
+
|
|
132
|
+
- **React to the event** with the [Ringee Trigger](#ringee-trigger) (`Call Completed`), then, after a short **Wait**, read the AI's result with **Get Call Result**. Most templates do this. Ringee publishes agent-specific results such as `confirmed` or `cannot_attend` only through the result endpoint, not as events. [Why and how](docs/events-and-results.md).
|
|
133
|
+
- **Poll** with **Get Call Status** (`finished: true/false`, `queued: true/false`) or **Get Call Result** inside a bounded loop. Use explicit timeouts; the [quick start](workflows/00-quick-start-first-ai-call.json) shows a single wait-then-read.
|
|
134
|
+
|
|
135
|
+
### Never a second paid call
|
|
136
|
+
|
|
137
|
+
Retries must not dial twice. Three things protect you:
|
|
138
|
+
|
|
139
|
+
1. **Idempotency Key.** Start Call sends an `Idempotency-Key`. Ringee places the call once and answers any repeat with the original call (`idempotent_replayed: true`). Set your own key to protect across executions, for example `reminder-{{ $json.eventId }}`.
|
|
140
|
+
2. **Automatic keys.** If you set none, the node builds one from the workflow, execution, node, run and item. n8n's **Retry On Fail**, a timed-out request and a resumed execution repeat the _same_ attempt, so they cannot place a second call; a new item or a new loop iteration is a new attempt and does.
|
|
141
|
+
3. **No blind retries.** The node repeats only requests that are safe: reads on temporary gateway answers, and any request Ringee rejected as rate-limited before running it. A write that may have been processed is never resent by the node itself.
|
|
142
|
+
|
|
143
|
+
Details and limits: [docs/idempotency.md](docs/idempotency.md).
|
|
144
|
+
|
|
145
|
+
## Ringee Trigger
|
|
146
|
+
|
|
147
|
+
Starts a workflow when something happens in Ringee. It is a signed webhook receiver:
|
|
148
|
+
|
|
149
|
+
- **Verifies every delivery** with `HMAC-SHA256(secret, "<timestamp>.<raw body>")` over the exact bytes received, in constant time. An unsigned, forged, tampered or stale (older than 5 minutes by default) request is refused with `401` and starts nothing.
|
|
150
|
+
- **Ignores repeats.** Ringee sends an event again if it did not get an answer in time; the trigger skips an event ID it has already run.
|
|
151
|
+
- **Filters** by event, by AI voice agent, by "only AI agent calls" and by External ID prefix (each Custom Integration has one Outbound URL, so use one integration per workflow and this prefix to keep each workflow to its own calls).
|
|
152
|
+
- Works with **test and production URLs**. Ringee's **Send test** button shows a sample while you build.
|
|
153
|
+
|
|
154
|
+
| Event | Fires when |
|
|
155
|
+
| ----------------------------- | ---------------------------------------------------------------------------------------- |
|
|
156
|
+
| **Call Completed** | A call ended, human or AI. The AI analysis may still be on its way. |
|
|
157
|
+
| **Call Outcome Updated** | An outcome was recorded (including an AI agent's `meeting_booked`, `not_interested`, …). |
|
|
158
|
+
| **Call Failed** | A call could not be connected. |
|
|
159
|
+
| **Call Missed** | An inbound call was not answered. |
|
|
160
|
+
| **Recording Ready** | A recording was processed. Carries the transcript when it exists. |
|
|
161
|
+
| **Meeting Created** | A meeting was booked, by a person or an AI voice agent. |
|
|
162
|
+
| **Callback Created** | A callback was scheduled. |
|
|
163
|
+
| **Note Created** | A note was added to a contact. |
|
|
164
|
+
| **Do-Not-Call Entry Created** | A number was added to the Do-Not-Call list. |
|
|
165
|
+
|
|
166
|
+
**Set it up once:** in Ringee open the Custom Integration, paste the trigger's **Production URL** as the **Outbound URL**, tick the events, and put the **Signing Secret** in the credential. Activating a workflow whose credential has no signing secret fails with a message that says so, instead of silently rejecting events later.
|
|
167
|
+
|
|
168
|
+
> Ringee has one Outbound URL per Custom Integration and no webhook-registration API, so the trigger cannot register itself; it validates the setup on activation instead. Use one integration per trigger workflow, or one trigger with a router. The proposal for automatic registration is in [docs/webhook-subscriptions-proposal.md](docs/webhook-subscriptions-proposal.md).
|
|
169
|
+
|
|
170
|
+
Events not offered here (call started, answered, voicemail, transcript ready, campaign completed, contact created, meeting rescheduled or cancelled) **do not exist in Ringee today**; see the [capability matrix](docs/api-capability-matrix.md) for what each need maps to.
|
|
171
|
+
|
|
172
|
+
## Use Ringee as a tool in an n8n AI Agent
|
|
173
|
+
|
|
174
|
+
The node is available to n8n's **AI Agent** as **Ringee Tool** (set `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true` on self-hosted n8n). Add one tool per capability and let the model fill the fields:
|
|
175
|
+
|
|
176
|
+
- _Contact → Get Many_: "Find Ada Lovelace."
|
|
177
|
+
- _AI Voice Agent → Start Call_: "Call this customer to confirm tomorrow's meeting."
|
|
178
|
+
- _AI Voice Agent → Get Call Result_ and _Transcript → Get_: "Retrieve the transcript and summarize the objections."
|
|
179
|
+
|
|
180
|
+
Safety by design:
|
|
181
|
+
|
|
182
|
+
- **Delete is never offered to an AI agent.** The tool's Contact operations leave it out; only a person building a normal workflow can pick it, and it needs the contact's phone number as confirmation.
|
|
183
|
+
- **Start Call is billable.** Tell the agent to ask for your yes before every call (the [template](workflows/10-ai-agent-that-makes-phone-calls.json) does) and add n8n's human-approval step in front of the tool for production. Ringee still enforces credits, Do-Not-Call and calling limits on every call.
|
|
184
|
+
- Each tool is a separate node, so the model can only do what you wired in.
|
|
185
|
+
|
|
186
|
+
See [docs/ai-agent-tools.md](docs/ai-agent-tools.md) and [template 10](workflows/10-ai-agent-that-makes-phone-calls.json).
|
|
187
|
+
|
|
188
|
+
## Workflow templates
|
|
189
|
+
|
|
190
|
+
Twelve importable workflows in [`workflows/`](workflows/), documented in [docs/workflow-templates.md](docs/workflow-templates.md):
|
|
191
|
+
|
|
192
|
+
| # | Template |
|
|
193
|
+
| --- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
194
|
+
| 00 | [Make your first AI phone call](workflows/00-quick-start-first-ai-call.json) |
|
|
195
|
+
| 01 | [AI appointment reminder](workflows/01-ai-appointment-reminder.json) (Google Calendar) |
|
|
196
|
+
| 02 | [Automatic lead qualification](workflows/02-automatic-lead-qualification.json) (Google Sheets) |
|
|
197
|
+
| 03 | [Missed meeting follow-up](workflows/03-missed-meeting-follow-up.json) (HubSpot) |
|
|
198
|
+
| 04 | [Facebook Lead Ads → AI call](workflows/04-facebook-lead-ads-ai-call.json) |
|
|
199
|
+
| 05 | [HubSpot lead calling](workflows/05-hubspot-lead-calling.json) |
|
|
200
|
+
| 06 | [Automated missed-call callback](workflows/06-automated-missed-call-callback.json) |
|
|
201
|
+
| 07 | [AI receptionist → team notification](workflows/07-ai-receptionist.json) (Slack) |
|
|
202
|
+
| 08 | [GoHighLevel lead automation](workflows/08-gohighlevel-lead-automation.json) |
|
|
203
|
+
| 09 | [Call transcripts to Slack](workflows/09-call-transcripts-to-slack.json) |
|
|
204
|
+
| 10 | [AI Agent that makes phone calls](workflows/10-ai-agent-that-makes-phone-calls.json) |
|
|
205
|
+
| Alt | [Appointment reminder with plain HTTP Request nodes](workflows/alternatives/01-ai-appointment-reminder-http-request.json) |
|
|
206
|
+
|
|
207
|
+
Every number in them is fictional. They were imported into a real n8n, validated against n8n's node definitions and run against a mock Ringee API; **none has been run with live Google, HubSpot, Slack, Facebook or GoHighLevel accounts**, so check each connected step.
|
|
208
|
+
|
|
209
|
+
## Compatibility
|
|
210
|
+
|
|
211
|
+
- **n8n:** developed and tested on n8n 2.x (community-node API version 1). Using the node as an AI tool needs a version that supports `usableAsTool`.
|
|
212
|
+
- **Ringee Cloud:** `https://api.ringee.io` (the default).
|
|
213
|
+
- **Self-hosted Ringee:** set the Base URL. Each operation needs a Ringee that has the public API behind it; the node says so in plain words when a route is missing. The operations by Ringee capability are in [docs/compatibility.md](docs/compatibility.md).
|
|
214
|
+
|
|
215
|
+
## Troubleshooting
|
|
216
|
+
|
|
217
|
+
| You see | Why, and what to do |
|
|
218
|
+
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
219
|
+
| _Ringee did not accept the API key_ | The key was regenerated, mistyped, or its Custom Integration is disabled. Copy the current key into the credential. |
|
|
220
|
+
| _Your Ringee workspace has no credits left_ | Add credits in Ringee. Nothing was dialed. |
|
|
221
|
+
| _That number is on your Do-Not-Call list_ | Ringee did not call. Remove the number from the list only if the person agreed to be called. |
|
|
222
|
+
| _AI voice agents are not enabled for this Ringee workspace_ | The key belongs to a workspace without AI voice agents. Use a key from one that has them. |
|
|
223
|
+
| _This Ringee server does not offer that operation yet_ | A self-hosted Ringee older than this node expects. Update it, or use Ringee Cloud. See [compatibility](docs/compatibility.md). |
|
|
224
|
+
| _Ringee answered with a redirect_ | The Base URL is not the exact API address. The node never follows redirects, on purpose. |
|
|
225
|
+
| _Could not reach Ringee_ | Network or Base URL. Plain `http://` is accepted only for `localhost`; any other address must be `https://`. |
|
|
226
|
+
| Activation fails: _no Webhook Signing Secret_ | Paste the integration's `whsec_…` into the credential. |
|
|
227
|
+
| The trigger never starts | Paste the **Production** URL (not the test URL) into the integration's Outbound URL, tick the event there too, and use HTTPS. |
|
|
228
|
+
| The trigger answers 401 | The signing secret does not match that integration, or the request is older than the allowed age (check the server clock). |
|
|
229
|
+
| `outcome` is null on a result | The AI analysis takes a minute or two after the call. Wait, then read again; the templates do this for you. |
|
|
230
|
+
| Calls repeat in a loop | Give Start Call an **Idempotency Key** that names the thing being called (a record ID), so a repeat is recognized. |
|
|
231
|
+
| Rate limited (429) | The node waits as Ringee asks and retries twice. For long lists, add a **Wait** between batches. |
|
|
232
|
+
|
|
233
|
+
## Local development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
npm install
|
|
237
|
+
npm run dev # n8n with the node loaded and hot reload
|
|
238
|
+
npm test # unit + mock-API tests, no network, never a real call
|
|
239
|
+
npm run validate # lint, types, tests, build, package check
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Running it locally, the mock Ringee API and validating templates against a real n8n are covered in [docs/local-development.md](docs/local-development.md). Contributing: [CONTRIBUTING.md](CONTRIBUTING.md). Report vulnerabilities privately: [SECURITY.md](SECURITY.md).
|
|
243
|
+
|
|
244
|
+
## Resources
|
|
245
|
+
|
|
246
|
+
- [Ringee](https://ringee.io) · [Ringee documentation](https://docs.ringee.io)
|
|
247
|
+
- [API capability matrix](docs/api-capability-matrix.md) · [Events and results](docs/events-and-results.md) · [Idempotency](docs/idempotency.md)
|
|
248
|
+
- [n8n community nodes](https://docs.n8n.io/integrations/#community-nodes)
|
|
249
|
+
|
|
250
|
+
## Version history
|
|
251
|
+
|
|
252
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
[MIT](LICENSE) © Ringee. The Ringee name and logo are trademarks of Ringee and are not licensed by the MIT license; see [docs/licensing.md](docs/licensing.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class RingeeApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:ringee.svg";
|
|
8
|
+
readonly dark: "file:ringee.dark.svg";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
test: ICredentialTestRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RingeeApi = void 0;
|
|
4
|
+
const base_url_1 = require("../lib/utils/base-url");
|
|
5
|
+
class RingeeApi {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'ringeeApi';
|
|
8
|
+
this.displayName = 'Ringee API';
|
|
9
|
+
this.documentationUrl = 'https://github.com/ringee-io/n8n-nodes-ringee#credentials';
|
|
10
|
+
this.icon = { light: 'file:ringee.svg', dark: 'file:ringee.dark.svg' };
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'API Key',
|
|
14
|
+
name: 'apiKey',
|
|
15
|
+
type: 'string',
|
|
16
|
+
typeOptions: { password: true },
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
placeholder: 'cik_live_…',
|
|
20
|
+
description: 'The key of a Ringee Custom Integration. In Ringee, open Integrations, then Custom Integrations, create one and copy its API key. It starts with cik_live_ and is shown once.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Base URL',
|
|
24
|
+
name: 'baseUrl',
|
|
25
|
+
type: 'string',
|
|
26
|
+
default: base_url_1.DEFAULT_BASE_URL,
|
|
27
|
+
placeholder: base_url_1.DEFAULT_BASE_URL,
|
|
28
|
+
description: 'The address of the Ringee API, without /api. Leave it as is for Ringee Cloud. For a self-hosted Ringee, use your own API address.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Webhook Signing Secret',
|
|
32
|
+
name: 'signingSecret',
|
|
33
|
+
type: 'string',
|
|
34
|
+
typeOptions: { password: true },
|
|
35
|
+
default: '',
|
|
36
|
+
placeholder: 'whsec_…',
|
|
37
|
+
description: 'Only needed by the Ringee Trigger. The signing secret of the same Custom Integration, starting with whsec_. The trigger uses it to check that an event really comes from Ringee.',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
this.authenticate = {
|
|
41
|
+
type: 'generic',
|
|
42
|
+
properties: {
|
|
43
|
+
headers: {
|
|
44
|
+
'X-Ringee-Api-Key': '={{$credentials.apiKey}}',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
this.test = {
|
|
49
|
+
request: {
|
|
50
|
+
baseURL: '={{ ($credentials.baseUrl || "https://api.ringee.io").trim().replace(/\\/+$/, "").replace(/\\/api$/i, "") }}/api',
|
|
51
|
+
url: '/v1/capabilities',
|
|
52
|
+
method: 'GET',
|
|
53
|
+
skipSslCertificateValidation: false,
|
|
54
|
+
disableFollowRedirect: true,
|
|
55
|
+
},
|
|
56
|
+
rules: [
|
|
57
|
+
{
|
|
58
|
+
type: 'responseCode',
|
|
59
|
+
properties: {
|
|
60
|
+
value: 401,
|
|
61
|
+
message: 'Ringee did not accept this API key. Check that it is current and that its Custom Integration is enabled.',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'responseCode',
|
|
66
|
+
properties: {
|
|
67
|
+
value: 404,
|
|
68
|
+
message: 'This Ringee server does not offer the public API this node needs. Check the Base URL, or update a self-hosted Ringee.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.RingeeApi = RingeeApi;
|
|
76
|
+
//# sourceMappingURL=RingeeApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RingeeApi.credentials.js","sourceRoot":"","sources":["../../credentials/RingeeApi.credentials.ts"],"names":[],"mappings":";;;AAMA,oDAAyD;AAYzD,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QAEnB,gBAAW,GAAG,YAAY,CAAC;QAE3B,qBAAgB,GAAG,2DAA2D,CAAC;QAE/E,SAAI,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAW,CAAC;QAE3E,eAAU,GAAsB;YAC/B;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;gBACd,WAAW,EAAE,YAAY;gBACzB,WAAW,EACV,8KAA8K;aAC/K;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2BAAgB;gBACzB,WAAW,EAAE,2BAAgB;gBAC7B,WAAW,EACV,mIAAmI;aACpI;YACD;gBACC,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,SAAS;gBACtB,WAAW,EACV,kLAAkL;aACnL;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,kBAAkB,EAAE,0BAA0B;iBAC9C;aACD;SACD,CAAC;QAQF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EACN,kHAAkH;gBACnH,GAAG,EAAE,kBAAkB;gBACvB,MAAM,EAAE,KAAK;gBACb,4BAA4B,EAAE,KAAK;gBACnC,qBAAqB,EAAE,IAAI;aAC3B;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,0GAA0G;qBAC3G;iBACD;gBACD;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,uHAAuH;qBACxH;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AArFD,8BAqFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 1 426 426" width="60" height="60"><title>Ringee</title><path fill="#FFFFFF" fill-rule="evenodd" d="M192 2.1C189.5 2.6 182.1 3.6 175.5 4.4C162.5 5.8 149.9 9.3 131 16.7C104.1 27.2 81.2 42.8 58.3 66.1C42.3 82.5 29.2 101.3 20.7 120.3C15.2 132.5 9 149.5 9 152.4C9 153.2 8.4 155.4 7.6 157.2C4.3 164.8 0 196.3 0 212.5C0 221.9 1.5 238.8 3.1 247C9.9 282.6 17.8 303 34.8 329C66.2 377.1 116.6 411.7 172.7 423.7C184.8 426.3 187 426.5 211 426.5C238.6 426.5 243.9 425.8 266.6 420C294 412.9 320.2 400.2 342.5 383.1C350.7 376.8 366.9 361.1 374.7 351.8C389.2 334.4 404.3 308.9 412.5 288.1C417 276.5 422.3 255.8 424.1 243C426.1 229.3 425.8 199.2 423.6 184.5C418.7 151.6 407.9 122.3 391.3 97C368.2 61.9 331.8 32 295 18.3C291.4 17 287.6 15.3 286.5 14.6C285.4 14 282 12.7 279 11.7C276 10.8 269.8 9 265.3 7.6C260.9 6.2 253.2 4.6 248.3 4C243.5 3.4 237.5 2.5 235 2C229.4 .9 198.1 .9 192 2.1ZM255.9 37.9C279.1 60.8 297.1 103.5 303.9 151.5C307.1 174 308 187 308 211.5C308 248.2 304.7 275.6 296 310C288 341.9 275.2 367.8 258.4 385.8C254.8 389.8 252 393.4 252.4 393.7C253.5 394.8 267.3 391.9 279.3 387.9C355.7 362.7 407.4 281.9 400.1 199.1C394.1 131.5 354.7 75.2 292.5 45.4C281.2 39.9 265.2 34.2 254.3 31.7L248.2 30.2L255.9 37.9ZM154.5 34.4C143.3 38.1 122.3 49.3 103.8 61.6C89 71.4 70.3 88.8 63.5 99C61.1 102.6 57 108.2 54.4 111.5C46.3 122 31 156 31 163.8C31 165 29.9 169.4 28.5 173.7C26.7 179.4 26 183.7 26 189.8L26 198L47.4 198L68.8 198L69.9 191.8C71.3 184 74 181 80.2 180.3C86.4 179.6 92.1 182.6 95.5 188.5L98.2 193L97.8 214.2C97.5 237.6 97.2 238.7 91.4 241.5C89.6 242.3 85.9 243 83 243C78.5 243 77.4 242.6 74.5 239.7C72.1 237.3 70.9 234.9 70 230.7L68.9 225L47.4 225L26 225L26 229.8C26.1 245.3 35.5 278 45.7 298.4C59.9 326.8 86.9 356.1 114.6 373.1C131.6 383.6 170 398.3 170 394.3C170 393.8 167.9 391.4 165.4 389C157.8 381.7 146.1 367.2 139.1 356.6C129.7 342.1 119 320.9 119 316.4C119 305 130.8 299.1 138.4 306.7C139.9 308.2 144.4 315.9 148.6 323.9C160.4 347 174.9 365.5 191.7 379.1C205.9 390.4 212.9 391.6 223.7 384.5C231.3 379.5 244.4 366.2 249.8 358C260.9 341.3 270.6 316.9 275.5 293.8C291.7 216.9 282.9 125.5 254.6 77.7C248.1 66.7 242.6 59.8 232.3 49.8C222.6 40.5 214.2 35 209.6 35C199.4 35 173.4 57.3 160.3 77.5C155.9 84.2 152.9 88.6 148.4 95C147.2 96.6 145.4 101.2 144.5 105.1C141.6 116.6 135.6 121.7 127.7 119.1C123.7 117.8 120.5 114.5 119.7 111C118.1 104.7 124.2 88.7 133.4 74.5C136.5 69.8 139 65.6 139 65.1C139 64.7 139.9 63.2 141 61.9C144 58.2 144.2 58 150.4 49.5C153.6 45.1 158.1 39.9 160.5 37.9C162.9 35.9 164.6 34 164.3 33.6C163.3 32.6 158.9 33 154.5 34.4ZM123 139.6C120.8 141.6 119 143.7 119 144.2C119 144.8 118 146.6 116.8 148.3L114.5 151.5L114.6 209.6L114.6 267.6L117.6 273C124.5 285.2 135.5 284.9 141.6 272.3L144.5 266.5L144.8 211.5C145 171.4 144.8 155.3 143.9 152.2C141.8 144.5 133.9 136 128.8 136C127.8 136 125.2 137.6 123 139.6ZM175.5 138.6C171.6 140.6 168.1 143.9 166.5 147.1C165.4 149.1 165.1 161.9 164.9 210.2C164.7 268.7 164.8 270.9 166.7 274.1C173.9 286.5 191 283.7 194 269.6C194.8 266.1 195 246.4 194.8 207L194.5 149.5L191.8 144.9C187.3 137.3 182 135.2 175.5 138.6ZM217.4 177.9C211.5 181.5 211 184.1 211 210.9C211 232.7 211.2 235.4 212.9 238.8C215.2 243.4 219 245.5 224.4 245.4C232 245.2 237 239.6 237 231.2C237 228.9 237.7 226.3 238.8 225.1C240.4 223.1 241.6 223 257.5 222.8L274.5 222.5L274.8 212.1C275.2 196.6 275.8 197.1 256.6 197.6C238.7 198 238.7 198 237.6 189.9C237.2 187 236.2 183.4 235.3 181.9C231.9 176.1 223.4 174.2 217.4 177.9Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 1 426 426" width="60" height="60"><title>Ringee</title><path fill="#0F172A" fill-rule="evenodd" d="M192 2.1C189.5 2.6 182.1 3.6 175.5 4.4C162.5 5.8 149.9 9.3 131 16.7C104.1 27.2 81.2 42.8 58.3 66.1C42.3 82.5 29.2 101.3 20.7 120.3C15.2 132.5 9 149.5 9 152.4C9 153.2 8.4 155.4 7.6 157.2C4.3 164.8 0 196.3 0 212.5C0 221.9 1.5 238.8 3.1 247C9.9 282.6 17.8 303 34.8 329C66.2 377.1 116.6 411.7 172.7 423.7C184.8 426.3 187 426.5 211 426.5C238.6 426.5 243.9 425.8 266.6 420C294 412.9 320.2 400.2 342.5 383.1C350.7 376.8 366.9 361.1 374.7 351.8C389.2 334.4 404.3 308.9 412.5 288.1C417 276.5 422.3 255.8 424.1 243C426.1 229.3 425.8 199.2 423.6 184.5C418.7 151.6 407.9 122.3 391.3 97C368.2 61.9 331.8 32 295 18.3C291.4 17 287.6 15.3 286.5 14.6C285.4 14 282 12.7 279 11.7C276 10.8 269.8 9 265.3 7.6C260.9 6.2 253.2 4.6 248.3 4C243.5 3.4 237.5 2.5 235 2C229.4 .9 198.1 .9 192 2.1ZM255.9 37.9C279.1 60.8 297.1 103.5 303.9 151.5C307.1 174 308 187 308 211.5C308 248.2 304.7 275.6 296 310C288 341.9 275.2 367.8 258.4 385.8C254.8 389.8 252 393.4 252.4 393.7C253.5 394.8 267.3 391.9 279.3 387.9C355.7 362.7 407.4 281.9 400.1 199.1C394.1 131.5 354.7 75.2 292.5 45.4C281.2 39.9 265.2 34.2 254.3 31.7L248.2 30.2L255.9 37.9ZM154.5 34.4C143.3 38.1 122.3 49.3 103.8 61.6C89 71.4 70.3 88.8 63.5 99C61.1 102.6 57 108.2 54.4 111.5C46.3 122 31 156 31 163.8C31 165 29.9 169.4 28.5 173.7C26.7 179.4 26 183.7 26 189.8L26 198L47.4 198L68.8 198L69.9 191.8C71.3 184 74 181 80.2 180.3C86.4 179.6 92.1 182.6 95.5 188.5L98.2 193L97.8 214.2C97.5 237.6 97.2 238.7 91.4 241.5C89.6 242.3 85.9 243 83 243C78.5 243 77.4 242.6 74.5 239.7C72.1 237.3 70.9 234.9 70 230.7L68.9 225L47.4 225L26 225L26 229.8C26.1 245.3 35.5 278 45.7 298.4C59.9 326.8 86.9 356.1 114.6 373.1C131.6 383.6 170 398.3 170 394.3C170 393.8 167.9 391.4 165.4 389C157.8 381.7 146.1 367.2 139.1 356.6C129.7 342.1 119 320.9 119 316.4C119 305 130.8 299.1 138.4 306.7C139.9 308.2 144.4 315.9 148.6 323.9C160.4 347 174.9 365.5 191.7 379.1C205.9 390.4 212.9 391.6 223.7 384.5C231.3 379.5 244.4 366.2 249.8 358C260.9 341.3 270.6 316.9 275.5 293.8C291.7 216.9 282.9 125.5 254.6 77.7C248.1 66.7 242.6 59.8 232.3 49.8C222.6 40.5 214.2 35 209.6 35C199.4 35 173.4 57.3 160.3 77.5C155.9 84.2 152.9 88.6 148.4 95C147.2 96.6 145.4 101.2 144.5 105.1C141.6 116.6 135.6 121.7 127.7 119.1C123.7 117.8 120.5 114.5 119.7 111C118.1 104.7 124.2 88.7 133.4 74.5C136.5 69.8 139 65.6 139 65.1C139 64.7 139.9 63.2 141 61.9C144 58.2 144.2 58 150.4 49.5C153.6 45.1 158.1 39.9 160.5 37.9C162.9 35.9 164.6 34 164.3 33.6C163.3 32.6 158.9 33 154.5 34.4ZM123 139.6C120.8 141.6 119 143.7 119 144.2C119 144.8 118 146.6 116.8 148.3L114.5 151.5L114.6 209.6L114.6 267.6L117.6 273C124.5 285.2 135.5 284.9 141.6 272.3L144.5 266.5L144.8 211.5C145 171.4 144.8 155.3 143.9 152.2C141.8 144.5 133.9 136 128.8 136C127.8 136 125.2 137.6 123 139.6ZM175.5 138.6C171.6 140.6 168.1 143.9 166.5 147.1C165.4 149.1 165.1 161.9 164.9 210.2C164.7 268.7 164.8 270.9 166.7 274.1C173.9 286.5 191 283.7 194 269.6C194.8 266.1 195 246.4 194.8 207L194.5 149.5L191.8 144.9C187.3 137.3 182 135.2 175.5 138.6ZM217.4 177.9C211.5 181.5 211 184.1 211 210.9C211 232.7 211.2 235.4 212.9 238.8C215.2 243.4 219 245.5 224.4 245.4C232 245.2 237 239.6 237 231.2C237 228.9 237.7 226.3 238.8 225.1C240.4 223.1 241.6 223 257.5 222.8L274.5 222.5L274.8 212.1C275.2 196.6 275.8 197.1 256.6 197.6C238.7 198 238.7 198 237.6 189.9C237.2 187 236.2 183.4 235.3 181.9C231.9 176.1 223.4 174.2 217.4 177.9Z"/></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RingeeContext } from './client';
|
|
2
|
+
export type RingeeCapability = 'idempotentCalls' | 'agentDetail' | 'contacts' | 'calls' | 'queuedCalls';
|
|
3
|
+
export declare function requireCapability(ctx: RingeeContext, capability: RingeeCapability, itemIndex?: number): Promise<void>;
|
|
4
|
+
export declare function forgetCapabilities(): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requireCapability = requireCapability;
|
|
4
|
+
exports.forgetCapabilities = forgetCapabilities;
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
const client_1 = require("./client");
|
|
8
|
+
const TRUST_MS = 5 * 60 * 1000;
|
|
9
|
+
const confirmed = new Map();
|
|
10
|
+
async function requireCapability(ctx, capability, itemIndex) {
|
|
11
|
+
var _a, _b, _c, _d;
|
|
12
|
+
const credentials = await ctx.getCredentials(client_1.CREDENTIAL_NAME);
|
|
13
|
+
const identity = (0, crypto_1.createHash)('sha256')
|
|
14
|
+
.update(`${String((_a = credentials.baseUrl) !== null && _a !== void 0 ? _a : '')}\n${String((_b = credentials.apiKey) !== null && _b !== void 0 ? _b : '')}\n${capability}`)
|
|
15
|
+
.digest('hex');
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
if (((_c = confirmed.get(identity)) !== null && _c !== void 0 ? _c : 0) > now)
|
|
18
|
+
return;
|
|
19
|
+
let report;
|
|
20
|
+
try {
|
|
21
|
+
report = await (0, client_1.ringeeRequest)(ctx, {
|
|
22
|
+
method: 'GET',
|
|
23
|
+
path: '/v1/capabilities',
|
|
24
|
+
itemIndex,
|
|
25
|
+
subject: 'capabilities',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (error instanceof n8n_workflow_1.NodeApiError) {
|
|
30
|
+
if (String(error.httpCode) === '404')
|
|
31
|
+
throw tooOld(ctx, capability, itemIndex);
|
|
32
|
+
throw new n8n_workflow_1.NodeApiError(ctx.getNode(), error);
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof n8n_workflow_1.NodeOperationError)
|
|
35
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), error);
|
|
36
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), error, { itemIndex });
|
|
37
|
+
}
|
|
38
|
+
if (((_d = report === null || report === void 0 ? void 0 : report.capabilities) === null || _d === void 0 ? void 0 : _d[capability]) !== true)
|
|
39
|
+
throw tooOld(ctx, capability, itemIndex);
|
|
40
|
+
confirmed.set(identity, now + TRUST_MS);
|
|
41
|
+
}
|
|
42
|
+
function forgetCapabilities() {
|
|
43
|
+
confirmed.clear();
|
|
44
|
+
}
|
|
45
|
+
function tooOld(ctx, capability, itemIndex) {
|
|
46
|
+
const consequence = capability === 'idempotentCalls'
|
|
47
|
+
? 'It does not confirm that it honors the Idempotency-Key header, so a retried Start Call could place a second paid call. Nothing was dialed.'
|
|
48
|
+
: capability === 'queuedCalls'
|
|
49
|
+
? 'It does not confirm that it can cancel a call that is waiting for call capacity. Nothing was changed.'
|
|
50
|
+
: 'It does not confirm that it offers this operation.';
|
|
51
|
+
return new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'This Ringee server is too old for this operation', {
|
|
52
|
+
itemIndex,
|
|
53
|
+
description: `${consequence} Update Ringee, or point the Base URL of the credential at Ringee Cloud (https://api.ringee.io). The versions each operation needs are listed in docs/compatibility.md.`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../lib/api/capabilities.ts"],"names":[],"mappings":";;AAoCA,8CAoCC;AAGD,gDAEC;AA7ED,mCAAoC;AACpC,+CAAgE;AAEhE,qCAA8E;AAgB9E,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAgBrC,KAAK,UAAU,iBAAiB,CACtC,GAAkB,EAClB,UAA4B,EAC5B,SAAkB;;IAElB,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,wBAAe,CAAC,CAAC;IAE9D,MAAM,QAAQ,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC;SACnC,MAAM,CACN,GAAG,MAAM,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,KAAK,MAAM,CAAC,MAAA,WAAW,CAAC,MAAM,mCAAI,EAAE,CAAC,KAAK,UAAU,EAAE,CAC1F;SACA,MAAM,CAAC,KAAK,CAAC,CAAC;IAChB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,CAAC,MAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,mCAAI,CAAC,CAAC,GAAG,GAAG;QAAE,OAAO;IAEjD,IAAI,MAAwC,CAAC;IAC7C,IAAI,CAAC;QACJ,MAAM,GAAG,MAAM,IAAA,sBAAa,EAAuB,GAAG,EAAE;YACvD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB;YACxB,SAAS;YACT,OAAO,EAAE,cAAc;SACvB,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,2BAAY,EAAE,CAAC;YAEnC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,KAAK;gBAAE,MAAM,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAE/E,MAAM,IAAI,2BAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAA8B,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,KAAK,YAAY,iCAAkB;YAAE,MAAM,IAAI,iCAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5F,MAAM,IAAI,iCAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,0CAAG,UAAU,CAAC,MAAK,IAAI;QAAE,MAAM,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC1F,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC,CAAC;AACzC,CAAC;AAGD,SAAgB,kBAAkB;IACjC,SAAS,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC;AAED,SAAS,MAAM,CACd,GAAkB,EAClB,UAA4B,EAC5B,SAA6B;IAE7B,MAAM,WAAW,GAChB,UAAU,KAAK,iBAAiB;QAC/B,CAAC,CAAC,4IAA4I;QAC9I,CAAC,CAAC,UAAU,KAAK,aAAa;YAC7B,CAAC,CAAC,uGAAuG;YACzG,CAAC,CAAC,oDAAoD,CAAC;IAC1D,OAAO,IAAI,iCAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,kDAAkD,EAAE;QAChG,SAAS;QACT,WAAW,EAAE,GAAG,WAAW,yKAAyK;KACpM,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
export type RingeeContext = IExecuteFunctions | ILoadOptionsFunctions;
|
|
3
|
+
export declare const CREDENTIAL_NAME = "ringeeApi";
|
|
4
|
+
export interface RingeeRequest {
|
|
5
|
+
method: IHttpRequestMethods;
|
|
6
|
+
path: string;
|
|
7
|
+
qs?: IDataObject;
|
|
8
|
+
body?: IDataObject;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
idempotencyKey?: string;
|
|
11
|
+
itemIndex?: number;
|
|
12
|
+
subject?: string;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function ringeeRequest<T = IDataObject>(ctx: RingeeContext, request: RingeeRequest): Promise<T>;
|
|
16
|
+
export declare function ringeeRequestBinary(ctx: RingeeContext, request: RingeeRequest): Promise<{
|
|
17
|
+
data: Buffer;
|
|
18
|
+
contentType?: string;
|
|
19
|
+
contentDisposition?: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function ringeeRequestAllItems<T>(ctx: RingeeContext, request: RingeeRequest, options?: {
|
|
22
|
+
returnAll: boolean;
|
|
23
|
+
limit?: number;
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
}): Promise<T[]>;
|
|
26
|
+
export declare function shouldRetry(method: string, status: number | undefined): boolean;
|
|
27
|
+
export declare function isCapacityRefusal(status: number | undefined, body: unknown): boolean;
|