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
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiAgent = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const client_1 = require("../../../../lib/api/client");
|
|
6
|
+
const capabilities_1 = require("../../../../lib/api/capabilities");
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const types_1 = require("../../../../lib/types");
|
|
9
|
+
const idempotency_1 = require("../../../../lib/utils/idempotency");
|
|
10
|
+
const phone_1 = require("../../../../lib/utils/phone");
|
|
11
|
+
const fields_1 = require("../../shared/fields");
|
|
12
|
+
const execution_1 = require("../../shared/execution");
|
|
13
|
+
const RESOURCE = 'aiAgent';
|
|
14
|
+
const description = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Operation',
|
|
17
|
+
name: 'operation',
|
|
18
|
+
type: 'options',
|
|
19
|
+
noDataExpression: true,
|
|
20
|
+
displayOptions: { show: { resource: [RESOURCE] } },
|
|
21
|
+
default: 'startCall',
|
|
22
|
+
options: [
|
|
23
|
+
{
|
|
24
|
+
name: 'Cancel Call',
|
|
25
|
+
value: 'cancelCall',
|
|
26
|
+
description: 'Withdraw a call that is still waiting for call capacity. A call that is already dialing cannot be cancelled this way.',
|
|
27
|
+
action: 'Cancel a call that has not been dialed',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Get',
|
|
31
|
+
value: 'get',
|
|
32
|
+
description: 'Retrieve an AI voice agent and the variables its calls accept',
|
|
33
|
+
action: 'Get an AI voice agent',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Get Call Result',
|
|
37
|
+
value: 'getCallResult',
|
|
38
|
+
description: 'Retrieve the outcome, summary and extracted data of an AI voice agent call',
|
|
39
|
+
action: 'Get the result of an AI voice agent call',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Get Call Status',
|
|
43
|
+
value: 'getCallStatus',
|
|
44
|
+
description: 'Check whether an AI voice agent call is still in progress',
|
|
45
|
+
action: 'Get the status of an AI voice agent call',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Get Many',
|
|
49
|
+
value: 'getMany',
|
|
50
|
+
description: 'Retrieve a list of AI voice agents',
|
|
51
|
+
action: 'Get many AI voice agents',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Get Many Calls',
|
|
55
|
+
value: 'getManyCalls',
|
|
56
|
+
description: 'Retrieve a list of the calls an AI voice agent has made',
|
|
57
|
+
action: 'Get many calls of an AI voice agent',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Start Call',
|
|
61
|
+
value: 'startCall',
|
|
62
|
+
description: 'Start a phone call with an AI voice agent. Returns a durable call ID with queued or initiating status; the result arrives later.',
|
|
63
|
+
action: 'Start a call with an AI voice agent',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
(0, fields_1.agentLocator)((0, fields_1.forOperation)(RESOURCE, ['get', 'getManyCalls'])),
|
|
68
|
+
...(0, fields_1.paging)((0, fields_1.forOperation)(RESOURCE, ['getMany', 'getManyCalls'])),
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Filters',
|
|
71
|
+
name: 'filters',
|
|
72
|
+
type: 'collection',
|
|
73
|
+
placeholder: 'Add Filter',
|
|
74
|
+
default: {},
|
|
75
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['getMany']),
|
|
76
|
+
options: [
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Type',
|
|
79
|
+
name: 'type',
|
|
80
|
+
type: 'options',
|
|
81
|
+
default: 'appointment_booking',
|
|
82
|
+
description: 'Only return agents of this type',
|
|
83
|
+
options: [
|
|
84
|
+
{ name: 'Appointment Booking', value: 'appointment_booking' },
|
|
85
|
+
{ name: 'Reminders & Notifications', value: 'reminders_notifications' },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
(0, fields_1.agentLocator)((0, fields_1.forOperation)(RESOURCE, ['startCall'])),
|
|
91
|
+
{
|
|
92
|
+
displayName: 'Phone Number',
|
|
93
|
+
name: 'phoneNumber',
|
|
94
|
+
type: 'string',
|
|
95
|
+
default: '',
|
|
96
|
+
required: true,
|
|
97
|
+
placeholder: 'e.g. +14155550123',
|
|
98
|
+
description: 'The number to call, in international format. Use an expression to read it from the previous node.',
|
|
99
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['startCall']),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Variables',
|
|
103
|
+
name: 'variables',
|
|
104
|
+
type: 'resourceMapper',
|
|
105
|
+
noDataExpression: true,
|
|
106
|
+
default: { mappingMode: 'defineBelow', value: null },
|
|
107
|
+
description: 'What the agent knows about this call, such as the first name of the person. The fields come from the agent you selected.',
|
|
108
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['startCall']),
|
|
109
|
+
typeOptions: {
|
|
110
|
+
loadOptionsDependsOn: ['agentId.value'],
|
|
111
|
+
resourceMapper: {
|
|
112
|
+
resourceMapperMethod: 'getAgentVariables',
|
|
113
|
+
mode: 'add',
|
|
114
|
+
fieldWords: { singular: 'variable', plural: 'variables' },
|
|
115
|
+
addAllFields: true,
|
|
116
|
+
multiKeyMatch: false,
|
|
117
|
+
supportAutoMap: true,
|
|
118
|
+
noFieldsError: 'Select an AI voice agent first. This agent type has no variables.',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Options',
|
|
124
|
+
name: 'options',
|
|
125
|
+
type: 'collection',
|
|
126
|
+
placeholder: 'Add Option',
|
|
127
|
+
default: {},
|
|
128
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['startCall']),
|
|
129
|
+
options: [
|
|
130
|
+
{
|
|
131
|
+
displayName: 'Caller Number',
|
|
132
|
+
name: 'callerNumberId',
|
|
133
|
+
type: 'resourceLocator',
|
|
134
|
+
default: { mode: 'list', value: '' },
|
|
135
|
+
description: 'The number the person sees. Leave empty to use the one assigned to the agent.',
|
|
136
|
+
modes: [
|
|
137
|
+
{
|
|
138
|
+
displayName: 'From List',
|
|
139
|
+
name: 'list',
|
|
140
|
+
type: 'list',
|
|
141
|
+
placeholder: 'Select a number…',
|
|
142
|
+
typeOptions: { searchListMethod: 'getCallerNumbers', searchable: true },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'By ID',
|
|
146
|
+
name: 'id',
|
|
147
|
+
type: 'string',
|
|
148
|
+
placeholder: 'e.g. 123e4567-e89b-42d3-a456-426614174000',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
displayName: 'External ID',
|
|
154
|
+
name: 'externalId',
|
|
155
|
+
type: 'string',
|
|
156
|
+
default: '',
|
|
157
|
+
placeholder: 'e.g. calendar-event-123',
|
|
158
|
+
description: 'Your own identifier for this call, such as a CRM record or calendar event ID. Ringee returns it as externalId on every event about the call, so a Ringee Trigger workflow can find the record again.',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Idempotency Key',
|
|
162
|
+
name: 'idempotencyKey',
|
|
163
|
+
type: 'string',
|
|
164
|
+
default: '',
|
|
165
|
+
placeholder: 'e.g. reminder-{{ $json.eventId }}',
|
|
166
|
+
description: 'Prevents a second paid call when the same request is repeated. Ringee places the call once per key and returns that call again for any repeat. Leave empty to let the node use a key that is unique to this execution and item, which protects against retries. Set your own, such as one per calendar event, to also protect across executions.',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
displayName: 'Metadata (JSON)',
|
|
170
|
+
name: 'metadata',
|
|
171
|
+
type: 'json',
|
|
172
|
+
default: '{}',
|
|
173
|
+
description: 'Extra data stored with the call and returned in its result',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
(0, fields_1.callIdField)((0, fields_1.forOperation)(RESOURCE, ['getCallStatus', 'getCallResult', 'cancelCall'])),
|
|
178
|
+
];
|
|
179
|
+
const getMany = async (ctx, itemIndex) => {
|
|
180
|
+
const returnAll = ctx.getNodeParameter('returnAll', itemIndex, false);
|
|
181
|
+
const limit = ctx.getNodeParameter('limit', itemIndex, 50);
|
|
182
|
+
const filters = ctx.getNodeParameter('filters', itemIndex, {});
|
|
183
|
+
const agents = await (0, client_1.ringeeRequestAllItems)(ctx, {
|
|
184
|
+
method: 'GET',
|
|
185
|
+
path: '/v1/ai-voice-agents',
|
|
186
|
+
qs: (0, execution_1.withoutEmpty)({ type: filters.type }),
|
|
187
|
+
itemIndex,
|
|
188
|
+
subject: 'AI voice agent',
|
|
189
|
+
}, { returnAll, limit });
|
|
190
|
+
return (0, execution_1.toItems)(agents, itemIndex);
|
|
191
|
+
};
|
|
192
|
+
const get = async (ctx, itemIndex) => {
|
|
193
|
+
const agentId = (0, execution_1.locatorValue)(ctx, 'agentId', itemIndex);
|
|
194
|
+
const agent = await (0, client_1.ringeeRequest)(ctx, {
|
|
195
|
+
method: 'GET',
|
|
196
|
+
path: `/v1/ai-voice-agents/${encodeURIComponent(agentId)}`,
|
|
197
|
+
itemIndex,
|
|
198
|
+
subject: 'AI voice agent',
|
|
199
|
+
});
|
|
200
|
+
return (0, execution_1.toItems)(agent, itemIndex);
|
|
201
|
+
};
|
|
202
|
+
const getManyCalls = async (ctx, itemIndex) => {
|
|
203
|
+
const agentId = (0, execution_1.locatorValue)(ctx, 'agentId', itemIndex);
|
|
204
|
+
const returnAll = ctx.getNodeParameter('returnAll', itemIndex, false);
|
|
205
|
+
const limit = ctx.getNodeParameter('limit', itemIndex, 50);
|
|
206
|
+
const calls = await (0, client_1.ringeeRequestAllItems)(ctx, {
|
|
207
|
+
method: 'GET',
|
|
208
|
+
path: `/v1/ai-voice-agents/${encodeURIComponent(agentId)}/calls`,
|
|
209
|
+
itemIndex,
|
|
210
|
+
subject: 'AI voice agent',
|
|
211
|
+
}, { returnAll, limit });
|
|
212
|
+
return (0, execution_1.toItems)(calls.map((call) => withFinished(call)), itemIndex);
|
|
213
|
+
};
|
|
214
|
+
const startCall = async (ctx, itemIndex) => {
|
|
215
|
+
var _a, _b, _c, _d;
|
|
216
|
+
const agentId = (0, execution_1.locatorValue)(ctx, 'agentId', itemIndex);
|
|
217
|
+
const options = ctx.getNodeParameter('options', itemIndex, {});
|
|
218
|
+
const phone = (0, phone_1.cleanPhoneNumber)(ctx.getNodeParameter('phoneNumber', itemIndex, ''));
|
|
219
|
+
if (!phone.value) {
|
|
220
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), (_a = phone.problem) !== null && _a !== void 0 ? _a : 'Enter the phone number.', {
|
|
221
|
+
itemIndex,
|
|
222
|
+
description: "Fix the 'Phone Number' field.",
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
const metadata = parseMetadata(ctx, options.metadata, itemIndex);
|
|
226
|
+
if ((_b = options.externalId) === null || _b === void 0 ? void 0 : _b.trim())
|
|
227
|
+
metadata.external_id = options.externalId.trim();
|
|
228
|
+
const callerNumberId = typeof options.callerNumberId === 'string'
|
|
229
|
+
? options.callerNumberId
|
|
230
|
+
: ((_d = (_c = options.callerNumberId) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : '');
|
|
231
|
+
await (0, capabilities_1.requireCapability)(ctx, 'idempotentCalls', itemIndex);
|
|
232
|
+
const idempotencyKey = resolveIdempotencyKey(ctx, options.idempotencyKey, itemIndex, agentId, phone.value);
|
|
233
|
+
if (!idempotencyKey) {
|
|
234
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Enter a stable Idempotency Key for this call.', {
|
|
235
|
+
itemIndex,
|
|
236
|
+
description: 'This execution has no stable identity. Use a persistent record-based key so retries cannot place another paid call.',
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const started = await (0, client_1.ringeeRequest)(ctx, {
|
|
240
|
+
method: 'POST',
|
|
241
|
+
path: `/v1/ai-voice-agents/${encodeURIComponent(agentId)}/calls`,
|
|
242
|
+
body: (0, execution_1.withoutEmpty)({
|
|
243
|
+
to: phone.value,
|
|
244
|
+
from_number_id: callerNumberId.trim(),
|
|
245
|
+
variables: readVariables(ctx, itemIndex),
|
|
246
|
+
metadata: Object.keys(metadata).length > 0 ? metadata : undefined,
|
|
247
|
+
}),
|
|
248
|
+
idempotencyKey,
|
|
249
|
+
itemIndex,
|
|
250
|
+
subject: 'AI voice agent',
|
|
251
|
+
timeoutMs: 60000,
|
|
252
|
+
});
|
|
253
|
+
return (0, execution_1.toItems)({
|
|
254
|
+
call_id: started.id,
|
|
255
|
+
status: started.status,
|
|
256
|
+
finished: isFinished(started.status),
|
|
257
|
+
queued: started.status === 'queued',
|
|
258
|
+
...(started.idempotent_replayed !== undefined
|
|
259
|
+
? { idempotent_replayed: started.idempotent_replayed }
|
|
260
|
+
: {}),
|
|
261
|
+
...(started.queued_at ? { queued_at: started.queued_at } : {}),
|
|
262
|
+
...(started.expires_at ? { expires_at: started.expires_at } : {}),
|
|
263
|
+
}, itemIndex);
|
|
264
|
+
};
|
|
265
|
+
const cancelCall = async (ctx, itemIndex) => {
|
|
266
|
+
const callId = (0, execution_1.textValue)(ctx, 'callId', itemIndex);
|
|
267
|
+
if (!callId) {
|
|
268
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Enter the ID of the call.', {
|
|
269
|
+
itemIndex,
|
|
270
|
+
description: "Fix the 'Call ID' field. Start Call returns it as call_id.",
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
await (0, capabilities_1.requireCapability)(ctx, 'queuedCalls', itemIndex);
|
|
274
|
+
const cancelled = await (0, client_1.ringeeRequest)(ctx, {
|
|
275
|
+
method: 'POST',
|
|
276
|
+
path: `/v1/ai-voice-agents/calls/${encodeURIComponent(callId)}/cancel`,
|
|
277
|
+
itemIndex,
|
|
278
|
+
subject: 'call',
|
|
279
|
+
});
|
|
280
|
+
return (0, execution_1.toItems)({
|
|
281
|
+
call_id: cancelled.id,
|
|
282
|
+
status: cancelled.status,
|
|
283
|
+
finished: isFinished(cancelled.status),
|
|
284
|
+
queued: false,
|
|
285
|
+
}, itemIndex);
|
|
286
|
+
};
|
|
287
|
+
const getCallResult = async (ctx, itemIndex) => {
|
|
288
|
+
const result = await readCall(ctx, itemIndex);
|
|
289
|
+
return (0, execution_1.toItems)(withFinished(result), itemIndex);
|
|
290
|
+
};
|
|
291
|
+
const getCallStatus = async (ctx, itemIndex) => {
|
|
292
|
+
const result = await readCall(ctx, itemIndex);
|
|
293
|
+
return (0, execution_1.toItems)({
|
|
294
|
+
call_id: result.call_id,
|
|
295
|
+
status: result.status,
|
|
296
|
+
finished: isFinished(result.status),
|
|
297
|
+
queued: result.status === 'queued',
|
|
298
|
+
...(result.queued_at ? { queued_at: result.queued_at } : {}),
|
|
299
|
+
...(result.expires_at ? { expires_at: result.expires_at } : {}),
|
|
300
|
+
outcome: result.outcome,
|
|
301
|
+
}, itemIndex);
|
|
302
|
+
};
|
|
303
|
+
async function readCall(ctx, itemIndex) {
|
|
304
|
+
const callId = (0, execution_1.textValue)(ctx, 'callId', itemIndex);
|
|
305
|
+
if (!callId) {
|
|
306
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Enter the ID of the call.', {
|
|
307
|
+
itemIndex,
|
|
308
|
+
description: "Fix the 'Call ID' field. Start Call returns it as call_id.",
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
return (0, client_1.ringeeRequest)(ctx, {
|
|
312
|
+
method: 'GET',
|
|
313
|
+
path: `/v1/ai-voice-agents/calls/${encodeURIComponent(callId)}`,
|
|
314
|
+
itemIndex,
|
|
315
|
+
subject: 'call',
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function isFinished(status) {
|
|
319
|
+
return types_1.AGENT_CALL_FINAL_STATUSES.includes(status);
|
|
320
|
+
}
|
|
321
|
+
function withFinished(result) {
|
|
322
|
+
return { ...result, finished: isFinished(result.status), queued: result.status === 'queued' };
|
|
323
|
+
}
|
|
324
|
+
function parseMetadata(ctx, raw, itemIndex) {
|
|
325
|
+
if (raw === undefined || raw === null || raw === '')
|
|
326
|
+
return {};
|
|
327
|
+
if (typeof raw === 'object')
|
|
328
|
+
return { ...raw };
|
|
329
|
+
try {
|
|
330
|
+
const parsed = JSON.parse(raw);
|
|
331
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed))
|
|
332
|
+
return parsed;
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
}
|
|
336
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "'Metadata (JSON)' must be a JSON object", {
|
|
337
|
+
itemIndex,
|
|
338
|
+
description: 'For example {"crm_id": "123"}.',
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function resolveIdempotencyKey(ctx, chosen, itemIndex, agentId, destination) {
|
|
342
|
+
const key = chosen === null || chosen === void 0 ? void 0 : chosen.trim();
|
|
343
|
+
if (key) {
|
|
344
|
+
if (!(0, idempotency_1.isValidIdempotencyKey)(key)) {
|
|
345
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "The 'Idempotency Key' can use letters, digits and . _ : @ / + = ~ - (up to 255 characters)", { itemIndex, description: 'For example reminder-evt_123.' });
|
|
346
|
+
}
|
|
347
|
+
return key;
|
|
348
|
+
}
|
|
349
|
+
let runIndex = 0;
|
|
350
|
+
try {
|
|
351
|
+
runIndex = Number(ctx.evaluateExpression('{{ $runIndex }}', itemIndex)) || 0;
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
}
|
|
355
|
+
const workflow = ctx.getWorkflow();
|
|
356
|
+
const operation = isAiTool(ctx)
|
|
357
|
+
? (0, crypto_1.createHash)('sha256').update(`${agentId}\n${destination}`).digest('hex').slice(0, 24)
|
|
358
|
+
: undefined;
|
|
359
|
+
return (0, idempotency_1.automaticIdempotencyKey)({
|
|
360
|
+
workflowId: workflow.id,
|
|
361
|
+
executionId: safeExecutionId(ctx),
|
|
362
|
+
nodeId: ctx.getNode().id,
|
|
363
|
+
runIndex,
|
|
364
|
+
itemIndex,
|
|
365
|
+
operation,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function isAiTool(ctx) {
|
|
369
|
+
return ctx.getNode().type.endsWith('Tool');
|
|
370
|
+
}
|
|
371
|
+
function safeExecutionId(ctx) {
|
|
372
|
+
try {
|
|
373
|
+
return ctx.getExecutionId() || undefined;
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function readVariables(ctx, itemIndex) {
|
|
380
|
+
var _a, _b, _c;
|
|
381
|
+
const mapper = ctx.getNodeParameter('variables', itemIndex, {});
|
|
382
|
+
let source = {};
|
|
383
|
+
if (mapper.mappingMode === 'autoMapInputData') {
|
|
384
|
+
const known = new Set(((_a = mapper.schema) !== null && _a !== void 0 ? _a : []).map((field) => field.id));
|
|
385
|
+
const input = (_c = (_b = ctx.getInputData()[itemIndex]) === null || _b === void 0 ? void 0 : _b.json) !== null && _c !== void 0 ? _c : {};
|
|
386
|
+
source = Object.fromEntries(Object.entries(input).filter(([key]) => known.has(key)));
|
|
387
|
+
}
|
|
388
|
+
else if (mapper.value && typeof mapper.value === 'object') {
|
|
389
|
+
source = mapper.value;
|
|
390
|
+
}
|
|
391
|
+
const variables = {};
|
|
392
|
+
for (const [key, value] of Object.entries(source)) {
|
|
393
|
+
if (value === undefined || value === null)
|
|
394
|
+
continue;
|
|
395
|
+
const text = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
396
|
+
if (text.trim() !== '')
|
|
397
|
+
variables[key] = text;
|
|
398
|
+
}
|
|
399
|
+
return Object.keys(variables).length > 0 ? variables : undefined;
|
|
400
|
+
}
|
|
401
|
+
exports.aiAgent = {
|
|
402
|
+
description,
|
|
403
|
+
operations: {
|
|
404
|
+
cancelCall,
|
|
405
|
+
get,
|
|
406
|
+
getMany,
|
|
407
|
+
getManyCalls,
|
|
408
|
+
getCallResult,
|
|
409
|
+
getCallStatus,
|
|
410
|
+
startCall,
|
|
411
|
+
},
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Ringee/resources/aiAgent/index.ts"],"names":[],"mappings":";;;AACA,+CAAkD;AAClD,uDAAkF;AAClF,mEAAqE;AACrE,mCAAoC;AACpC,iDAM+B;AAC/B,mEAAmG;AACnG,uDAA+D;AAC/D,gDAAsF;AACtF,sDAAwF;AAGxF,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B,MAAM,WAAW,GAAsB;IACtC;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EA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: true });
|
|
3
|
+
exports.call = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const client_1 = require("../../../../lib/api/client");
|
|
6
|
+
const types_1 = require("../../../../lib/types");
|
|
7
|
+
const phone_1 = require("../../../../lib/utils/phone");
|
|
8
|
+
const fields_1 = require("../../shared/fields");
|
|
9
|
+
const call_detail_1 = require("../../shared/call-detail");
|
|
10
|
+
const execution_1 = require("../../shared/execution");
|
|
11
|
+
const RESOURCE = 'call';
|
|
12
|
+
const titleCase = (value) => value.replace(/_/g, ' ').replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
13
|
+
const description = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Operation',
|
|
16
|
+
name: 'operation',
|
|
17
|
+
type: 'options',
|
|
18
|
+
noDataExpression: true,
|
|
19
|
+
displayOptions: { show: { resource: [RESOURCE] } },
|
|
20
|
+
default: 'get',
|
|
21
|
+
options: [
|
|
22
|
+
{
|
|
23
|
+
name: 'Create Dialer Link',
|
|
24
|
+
value: 'createDialerLink',
|
|
25
|
+
description: 'Create a link that opens the Ringee dialer ready to call a number. A person opens it and presses call.',
|
|
26
|
+
action: 'Create a dialer link for a human call',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Get',
|
|
30
|
+
value: 'get',
|
|
31
|
+
description: 'Retrieve a call with its outcome, transcript, recording and AI analysis',
|
|
32
|
+
action: 'Get a call',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Get Many',
|
|
36
|
+
value: 'getMany',
|
|
37
|
+
description: 'Retrieve a list of calls, newest first',
|
|
38
|
+
action: 'Get many calls',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
(0, fields_1.callIdField)((0, fields_1.forOperation)(RESOURCE, ['get'])),
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Simplify',
|
|
45
|
+
name: 'simplify',
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
default: true,
|
|
48
|
+
description: 'Whether to return a simplified version of the response instead of the raw data. Turn it off to include the full transcript segments, meetings and callbacks.',
|
|
49
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['get']),
|
|
50
|
+
},
|
|
51
|
+
...(0, fields_1.paging)((0, fields_1.forOperation)(RESOURCE, ['getMany'])),
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Filters',
|
|
54
|
+
name: 'filters',
|
|
55
|
+
type: 'collection',
|
|
56
|
+
placeholder: 'Add Filter',
|
|
57
|
+
default: {},
|
|
58
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['getMany']),
|
|
59
|
+
options: [
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Contact ID',
|
|
62
|
+
name: 'contactId',
|
|
63
|
+
type: 'string',
|
|
64
|
+
default: '',
|
|
65
|
+
description: 'Only calls with this contact',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
displayName: 'From',
|
|
69
|
+
name: 'dateFrom',
|
|
70
|
+
type: 'dateTime',
|
|
71
|
+
default: '',
|
|
72
|
+
description: 'Only calls created at or after this time',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Outcome',
|
|
76
|
+
name: 'outcome',
|
|
77
|
+
type: 'options',
|
|
78
|
+
default: 'meeting_booked',
|
|
79
|
+
description: 'Only calls recorded with this outcome',
|
|
80
|
+
options: types_1.CALL_OUTCOMES.map((value) => ({ name: titleCase(value), value })),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Status',
|
|
84
|
+
name: 'status',
|
|
85
|
+
type: 'options',
|
|
86
|
+
default: 'completed',
|
|
87
|
+
description: 'Only calls in this status',
|
|
88
|
+
options: types_1.CALL_STATUSES.map((value) => ({ name: titleCase(value), value })),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'To',
|
|
92
|
+
name: 'dateTo',
|
|
93
|
+
type: 'dateTime',
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'Only calls created at or before this time',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Phone Number',
|
|
101
|
+
name: 'phoneNumber',
|
|
102
|
+
type: 'string',
|
|
103
|
+
default: '',
|
|
104
|
+
required: true,
|
|
105
|
+
placeholder: 'e.g. +14155550123',
|
|
106
|
+
description: 'The number the person will call, in international format',
|
|
107
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['createDialerLink']),
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Options',
|
|
111
|
+
name: 'options',
|
|
112
|
+
type: 'collection',
|
|
113
|
+
placeholder: 'Add Option',
|
|
114
|
+
default: {},
|
|
115
|
+
displayOptions: (0, fields_1.forOperation)(RESOURCE, ['createDialerLink']),
|
|
116
|
+
options: [
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Agent Email',
|
|
119
|
+
name: 'agentEmail',
|
|
120
|
+
type: 'string',
|
|
121
|
+
placeholder: 'name@email.com',
|
|
122
|
+
default: '',
|
|
123
|
+
description: 'The team member who will place the call. Required in an organization workspace; a personal workspace always uses its owner.',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Caller Number',
|
|
127
|
+
name: 'fromNumber',
|
|
128
|
+
type: 'string',
|
|
129
|
+
default: '',
|
|
130
|
+
placeholder: 'e.g. +14155550100',
|
|
131
|
+
description: 'The number to show to the person. Leave empty to use the first verified caller ID or purchased number.',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
const get = async (ctx, itemIndex) => {
|
|
137
|
+
const { call } = await (0, call_detail_1.fetchCallDetail)(ctx, itemIndex);
|
|
138
|
+
const simplify = ctx.getNodeParameter('simplify', itemIndex, true);
|
|
139
|
+
return (0, execution_1.toItems)(simplify ? (0, call_detail_1.simplifyCall)(call) : call, itemIndex);
|
|
140
|
+
};
|
|
141
|
+
const getMany = async (ctx, itemIndex) => {
|
|
142
|
+
const returnAll = ctx.getNodeParameter('returnAll', itemIndex, false);
|
|
143
|
+
const limit = ctx.getNodeParameter('limit', itemIndex, 50);
|
|
144
|
+
const filters = ctx.getNodeParameter('filters', itemIndex, {});
|
|
145
|
+
const calls = await (0, client_1.ringeeRequestAllItems)(ctx, {
|
|
146
|
+
method: 'GET',
|
|
147
|
+
path: '/v1/calls',
|
|
148
|
+
qs: (0, execution_1.withoutEmpty)({
|
|
149
|
+
contact_id: filters.contactId,
|
|
150
|
+
outcome: filters.outcome,
|
|
151
|
+
status: filters.status,
|
|
152
|
+
date_from: toIso(filters.dateFrom),
|
|
153
|
+
date_to: toIso(filters.dateTo),
|
|
154
|
+
}),
|
|
155
|
+
itemIndex,
|
|
156
|
+
subject: 'call',
|
|
157
|
+
}, { returnAll, limit });
|
|
158
|
+
return (0, execution_1.toItems)(calls, itemIndex);
|
|
159
|
+
};
|
|
160
|
+
const createDialerLink = async (ctx, itemIndex) => {
|
|
161
|
+
var _a;
|
|
162
|
+
const phone = (0, phone_1.cleanPhoneNumber)(ctx.getNodeParameter('phoneNumber', itemIndex, ''));
|
|
163
|
+
if (!phone.value) {
|
|
164
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), (_a = phone.problem) !== null && _a !== void 0 ? _a : 'Enter the phone number.', {
|
|
165
|
+
itemIndex,
|
|
166
|
+
description: "Fix the 'Phone Number' field.",
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const options = ctx.getNodeParameter('options', itemIndex, {});
|
|
170
|
+
const link = await (0, client_1.ringeeRequest)(ctx, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
path: '/integrations/custom/click-to-call',
|
|
173
|
+
body: (0, execution_1.withoutEmpty)({
|
|
174
|
+
phoneNumber: phone.value,
|
|
175
|
+
agentEmail: options.agentEmail,
|
|
176
|
+
fromNumber: options.fromNumber,
|
|
177
|
+
}),
|
|
178
|
+
itemIndex,
|
|
179
|
+
subject: 'contact',
|
|
180
|
+
});
|
|
181
|
+
return (0, execution_1.toItems)({
|
|
182
|
+
dialerUrl: link.dialerUrl,
|
|
183
|
+
expiresAt: link.expiresAt,
|
|
184
|
+
toNumber: link.toNumber,
|
|
185
|
+
fromNumber: link.fromNumber,
|
|
186
|
+
contactId: link.contactId,
|
|
187
|
+
}, itemIndex);
|
|
188
|
+
};
|
|
189
|
+
function toIso(value) {
|
|
190
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
191
|
+
return undefined;
|
|
192
|
+
const date = new Date(value);
|
|
193
|
+
return Number.isNaN(date.getTime()) ? undefined : date.toISOString();
|
|
194
|
+
}
|
|
195
|
+
exports.call = {
|
|
196
|
+
description,
|
|
197
|
+
operations: { get, getMany, createDialerLink },
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Ringee/resources/call/index.ts"],"names":[],"mappings":";;;AACA,+CAAkD;AAClD,uDAAkF;AAClF,iDAA6F;AAC7F,uDAA+D;AAC/D,gDAAwE;AACxE,0DAAyE;AACzE,sDAA+D;AAG/D,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CACnC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;AAE7E,MAAM,WAAW,GAAsB;IACtC;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAClD,OAAO,EAAE,KAAK;QACd,OAAO,EAAE;YAC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