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,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RINGEE_TEST_EVENT = exports.RINGEE_EVENTS = exports.CALL_OUTCOMES = exports.CALL_STATUSES = exports.AGENT_OUTCOMES = exports.AGENT_CALL_NOT_DIALED_STATUSES = exports.AGENT_CALL_FINAL_STATUSES = exports.AGENT_CALL_STATUSES = void 0;
|
|
4
|
+
exports.AGENT_CALL_STATUSES = [
|
|
5
|
+
'queued',
|
|
6
|
+
'created',
|
|
7
|
+
'initiating',
|
|
8
|
+
'ringing',
|
|
9
|
+
'in_progress',
|
|
10
|
+
'completed',
|
|
11
|
+
'no_answer',
|
|
12
|
+
'busy',
|
|
13
|
+
'voicemail',
|
|
14
|
+
'failed',
|
|
15
|
+
'cancelled',
|
|
16
|
+
'expired',
|
|
17
|
+
];
|
|
18
|
+
exports.AGENT_CALL_FINAL_STATUSES = [
|
|
19
|
+
'completed',
|
|
20
|
+
'no_answer',
|
|
21
|
+
'busy',
|
|
22
|
+
'voicemail',
|
|
23
|
+
'failed',
|
|
24
|
+
'cancelled',
|
|
25
|
+
'expired',
|
|
26
|
+
];
|
|
27
|
+
exports.AGENT_CALL_NOT_DIALED_STATUSES = [
|
|
28
|
+
'queued',
|
|
29
|
+
'cancelled',
|
|
30
|
+
'expired',
|
|
31
|
+
];
|
|
32
|
+
exports.AGENT_OUTCOMES = [
|
|
33
|
+
'meeting_booked',
|
|
34
|
+
'callback_scheduled',
|
|
35
|
+
'not_interested',
|
|
36
|
+
'no_answer',
|
|
37
|
+
'no_conversation',
|
|
38
|
+
'wrong_number',
|
|
39
|
+
'confirmed',
|
|
40
|
+
'cannot_attend',
|
|
41
|
+
'callback_requested',
|
|
42
|
+
'appointment_booked',
|
|
43
|
+
'unknown',
|
|
44
|
+
];
|
|
45
|
+
exports.CALL_STATUSES = [
|
|
46
|
+
'pending',
|
|
47
|
+
'ringing',
|
|
48
|
+
'answered',
|
|
49
|
+
'recording',
|
|
50
|
+
'completed',
|
|
51
|
+
'failed',
|
|
52
|
+
];
|
|
53
|
+
exports.CALL_OUTCOMES = [
|
|
54
|
+
'meeting_booked',
|
|
55
|
+
'sale',
|
|
56
|
+
'interested',
|
|
57
|
+
'follow_up',
|
|
58
|
+
'callback_scheduled',
|
|
59
|
+
'not_interested',
|
|
60
|
+
'no_answer',
|
|
61
|
+
'no_conversation',
|
|
62
|
+
'voicemail',
|
|
63
|
+
'wrong_number',
|
|
64
|
+
'gatekeeper',
|
|
65
|
+
];
|
|
66
|
+
exports.RINGEE_EVENTS = [
|
|
67
|
+
{
|
|
68
|
+
value: 'call.completed',
|
|
69
|
+
name: 'Call Completed',
|
|
70
|
+
description: 'A call has ended, human or AI. The outcome and AI analysis may arrive later',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'call.outcome.updated',
|
|
74
|
+
name: 'Call Outcome Updated',
|
|
75
|
+
description: 'An outcome was recorded, including an AI voice agent’s post-call result with summary, sentiment and extracted data',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: 'call.failed',
|
|
79
|
+
name: 'Call Failed',
|
|
80
|
+
description: 'A call could not be connected',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: 'call.missed',
|
|
84
|
+
name: 'Call Missed',
|
|
85
|
+
description: 'An inbound call was not answered',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: 'recording.ready',
|
|
89
|
+
name: 'Recording Ready',
|
|
90
|
+
description: 'The recording of a call has been processed',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 'meeting.created',
|
|
94
|
+
name: 'Meeting Created',
|
|
95
|
+
description: 'A meeting was booked, by a person or by an AI voice agent',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
value: 'callback.created',
|
|
99
|
+
name: 'Callback Created',
|
|
100
|
+
description: 'A callback was scheduled, by a person or by an AI voice agent',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: 'note.created',
|
|
104
|
+
name: 'Note Created',
|
|
105
|
+
description: 'A note was added to a contact',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: 'dnc.created',
|
|
109
|
+
name: 'Do-Not-Call Entry Created',
|
|
110
|
+
description: 'A number was added to the Do-Not-Call list',
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
exports.RINGEE_TEST_EVENT = 'test.ping';
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/types/index.ts"],"names":[],"mappings":";;;AAgBa,QAAA,mBAAmB,GAAG;IAClC,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,SAAS;IACT,aAAa;IACb,WAAW;IACX,WAAW;IACX,MAAM;IACN,WAAW;IACX,QAAQ;IACR,WAAW;IACX,SAAS;CACA,CAAC;AAIE,QAAA,yBAAyB,GAA+B;IACpE,WAAW;IACX,WAAW;IACX,MAAM;IACN,W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,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,+BAA+B;KAC5C;IACD;QACC,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,4CAA4C;KACzD;CACQ,CAAC;AAIE,QAAA,iBAAiB,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_BASE_URL = void 0;
|
|
4
|
+
exports.parseBaseUrl = parseBaseUrl;
|
|
5
|
+
exports.DEFAULT_BASE_URL = 'https://api.ringee.io';
|
|
6
|
+
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);
|
|
7
|
+
function parseBaseUrl(raw) {
|
|
8
|
+
const value = (raw !== null && raw !== void 0 ? raw : '').trim();
|
|
9
|
+
if (!value)
|
|
10
|
+
return { ok: true, url: exports.DEFAULT_BASE_URL };
|
|
11
|
+
let url;
|
|
12
|
+
try {
|
|
13
|
+
url = new URL(value);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return {
|
|
17
|
+
ok: false,
|
|
18
|
+
message: `The Base URL '${value}' is not a valid URL. Use the full address, for example ${exports.DEFAULT_BASE_URL}.`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const isLoopback = LOOPBACK_HOSTS.has(url.hostname);
|
|
22
|
+
if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopback)) {
|
|
23
|
+
return {
|
|
24
|
+
ok: false,
|
|
25
|
+
message: "The Base URL must start with 'https://'. Plain 'http://' is accepted only for localhost.",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (url.username || url.password) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
message: 'The Base URL must not contain a user name or password. Put the API key in the API Key field.',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (url.search || url.hash) {
|
|
35
|
+
return { ok: false, message: 'The Base URL must not contain a query string or a fragment.' };
|
|
36
|
+
}
|
|
37
|
+
let path = url.pathname.replace(/\/+$/, '');
|
|
38
|
+
if (path.toLowerCase() === '/api')
|
|
39
|
+
path = '';
|
|
40
|
+
return { ok: true, url: `${url.origin}${path}` };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=base-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-url.js","sourceRoot":"","sources":["../../../lib/utils/base-url.ts"],"names":[],"mappings":";;;AAsBA,oCAqCC;AA1DY,QAAA,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAmB3E,SAAgB,YAAY,CAAC,GAA8B;IAC1D,MAAM,KAAK,GAAG,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,wBAAgB,EAAE,CAAC;IAEvD,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO;YACN,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,iBAAiB,KAAK,2DAA2D,wBAAgB,GAAG;SAC7G,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,UAAU,CAAC,EAAE,CAAC;QAC5E,OAAO;YACN,EAAE,EAAE,KAAK;YACT,OAAO,EACN,0FAA0F;SAC3F,CAAC;IACH,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QAClC,OAAO;YACN,EAAE,EAAE,KAAK;YACT,OAAO,EACN,8FAA8F;SAC/F,CAAC;IACH,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,6DAA6D,EAAE,CAAC;IAC9F,CAAC;IAED,IAAI,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM;QAAE,IAAI,GAAG,EAAE,CAAC;IAE7C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SEEN_EVENT_TTL_MS: number;
|
|
2
|
+
export declare const SEEN_EVENT_MAX = 1000;
|
|
3
|
+
export type SeenEvents = Record<string, number>;
|
|
4
|
+
export declare function markEventSeen(seen: SeenEvents, eventId: string, nowMs?: number): {
|
|
5
|
+
duplicate: boolean;
|
|
6
|
+
seen: SeenEvents;
|
|
7
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEEN_EVENT_MAX = exports.SEEN_EVENT_TTL_MS = void 0;
|
|
4
|
+
exports.markEventSeen = markEventSeen;
|
|
5
|
+
exports.SEEN_EVENT_TTL_MS = 24 * 60 * 60 * 1000;
|
|
6
|
+
exports.SEEN_EVENT_MAX = 1000;
|
|
7
|
+
function markEventSeen(seen, eventId, nowMs = Date.now()) {
|
|
8
|
+
const live = {};
|
|
9
|
+
for (const [id, at] of Object.entries(seen)) {
|
|
10
|
+
if (nowMs - at < exports.SEEN_EVENT_TTL_MS)
|
|
11
|
+
live[id] = at;
|
|
12
|
+
}
|
|
13
|
+
if (eventId in live)
|
|
14
|
+
return { duplicate: true, seen: live };
|
|
15
|
+
live[eventId] = nowMs;
|
|
16
|
+
const entries = Object.entries(live);
|
|
17
|
+
if (entries.length > exports.SEEN_EVENT_MAX) {
|
|
18
|
+
entries.sort((a, b) => b[1] - a[1]);
|
|
19
|
+
return { duplicate: false, seen: Object.fromEntries(entries.slice(0, exports.SEEN_EVENT_MAX)) };
|
|
20
|
+
}
|
|
21
|
+
return { duplicate: false, seen: live };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=dedupe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dedupe.js","sourceRoot":"","sources":["../../../lib/utils/dedupe.ts"],"names":[],"mappings":";;;AAkBA,sCAkBC;AAnCY,QAAA,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACxC,QAAA,cAAc,GAAG,IAAI,CAAC;AAgBnC,SAAgB,aAAa,CAC5B,IAAgB,EAChB,OAAe,EACf,QAAgB,IAAI,CAAC,GAAG,EAAE;IAE1B,MAAM,IAAI,GAAe,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,EAAE,GAAG,yBAAiB;YAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,OAAO,IAAI,IAAI;QAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAE5D,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACtB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,OAAO,CAAC,MAAM,GAAG,sBAAc,EAAE,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,sBAAc,CAAC,CAAC,EAAE,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function isValidIdempotencyKey(key: string): boolean;
|
|
2
|
+
export interface IdempotencyContext {
|
|
3
|
+
workflowId?: string;
|
|
4
|
+
executionId?: string;
|
|
5
|
+
nodeId?: string;
|
|
6
|
+
runIndex?: number;
|
|
7
|
+
itemIndex: number;
|
|
8
|
+
operation?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function automaticIdempotencyKey(context: IdempotencyContext): string | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidIdempotencyKey = isValidIdempotencyKey;
|
|
4
|
+
exports.automaticIdempotencyKey = automaticIdempotencyKey;
|
|
5
|
+
const KEY_PATTERN = /^[A-Za-z0-9._:@/+=~-]{1,255}$/;
|
|
6
|
+
function isValidIdempotencyKey(key) {
|
|
7
|
+
return KEY_PATTERN.test(key);
|
|
8
|
+
}
|
|
9
|
+
function automaticIdempotencyKey(context) {
|
|
10
|
+
const { workflowId, executionId, nodeId, runIndex, itemIndex, operation } = context;
|
|
11
|
+
if (!workflowId || !executionId || !nodeId)
|
|
12
|
+
return undefined;
|
|
13
|
+
const attempt = operation ? [`op-${operation}`] : [`r${runIndex !== null && runIndex !== void 0 ? runIndex : 0}`, `i${itemIndex}`];
|
|
14
|
+
const key = ['n8n', workflowId, executionId, nodeId, ...attempt].join(':');
|
|
15
|
+
return isValidIdempotencyKey(key) ? key : undefined;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=idempotency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idempotency.js","sourceRoot":"","sources":["../../../lib/utils/idempotency.ts"],"names":[],"mappings":";;AAGA,sDAEC;AAmCD,0DAMC;AA7CD,MAAM,WAAW,GAAG,+BAA+B,CAAC;AAEpD,SAAgB,qBAAqB,CAAC,GAAW;IAChD,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAmCD,SAAgB,uBAAuB,CAAC,OAA2B;IAClE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACpF,IAAI,CAAC,UAAU,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC7D,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,EAAE,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;IACzF,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3E,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanPhoneNumber = cleanPhoneNumber;
|
|
4
|
+
const ALLOWED = /^\+?[0-9 ().-]+$/;
|
|
5
|
+
function cleanPhoneNumber(raw) {
|
|
6
|
+
if (typeof raw !== 'string' || raw.trim() === '') {
|
|
7
|
+
return { problem: 'Enter the phone number to call, for example +14155550123.' };
|
|
8
|
+
}
|
|
9
|
+
const trimmed = raw.trim();
|
|
10
|
+
if (!ALLOWED.test(trimmed)) {
|
|
11
|
+
return {
|
|
12
|
+
problem: `'${trimmed.slice(0, 40)}' is not a phone number. Use digits with an optional leading '+', for example +14155550123.`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const digits = trimmed.replace(/[^\d]/g, '');
|
|
16
|
+
if (digits.length < 6 || digits.length > 15) {
|
|
17
|
+
return {
|
|
18
|
+
problem: `'${trimmed}' has ${digits.length} digits. A phone number has between 6 and 15 digits, for example +14155550123.`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return { value: `${trimmed.startsWith('+') ? '+' : ''}${digits}` };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=phone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.js","sourceRoot":"","sources":["../../../lib/utils/phone.ts"],"names":[],"mappings":";;AAWA,4CAiBC;AA5BD,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAWnC,SAAgB,gBAAgB,CAAC,GAAY;IAC5C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,2DAA2D,EAAE,CAAC;IACjF,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO;YACN,OAAO,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,6FAA6F;SAC9H,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC7C,OAAO;YACN,OAAO,EAAE,IAAI,OAAO,SAAS,MAAM,CAAC,MAAM,gFAAgF;SAC1H,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const DEFAULT_TOLERANCE_SECONDS = 300;
|
|
2
|
+
export type SignatureFailure = 'missing_secret' | 'missing_signature' | 'malformed_signature' | 'timestamp_out_of_range' | 'bad_signature';
|
|
3
|
+
export interface SignatureResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
reason?: SignatureFailure;
|
|
6
|
+
timestamp?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseSignatureHeader(header: string): {
|
|
9
|
+
timestamp: string;
|
|
10
|
+
signatures: string[];
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function verifyRingeeSignature(input: {
|
|
13
|
+
rawBody: Buffer | string;
|
|
14
|
+
secret: string | undefined;
|
|
15
|
+
signatureHeader: string | undefined;
|
|
16
|
+
nowMs?: number;
|
|
17
|
+
toleranceSeconds?: number;
|
|
18
|
+
}): SignatureResult;
|
|
19
|
+
export declare function signRingeeBody(body: string, secret: string, nowMs?: number): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_TOLERANCE_SECONDS = void 0;
|
|
4
|
+
exports.parseSignatureHeader = parseSignatureHeader;
|
|
5
|
+
exports.verifyRingeeSignature = verifyRingeeSignature;
|
|
6
|
+
exports.signRingeeBody = signRingeeBody;
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
exports.DEFAULT_TOLERANCE_SECONDS = 300;
|
|
9
|
+
function parseSignatureHeader(header) {
|
|
10
|
+
let timestamp;
|
|
11
|
+
const signatures = [];
|
|
12
|
+
for (const part of header.split(',')) {
|
|
13
|
+
const [key, ...rest] = part.trim().split('=');
|
|
14
|
+
const value = rest.join('=');
|
|
15
|
+
if (key === 't' && /^\d{1,12}$/.test(value))
|
|
16
|
+
timestamp = value;
|
|
17
|
+
if (key === 'v1' && /^[0-9a-f]{64}$/i.test(value))
|
|
18
|
+
signatures.push(value.toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
if (!timestamp || signatures.length === 0)
|
|
21
|
+
return null;
|
|
22
|
+
return { timestamp, signatures };
|
|
23
|
+
}
|
|
24
|
+
function verifyRingeeSignature(input) {
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
const secret = (_a = input.secret) === null || _a === void 0 ? void 0 : _a.trim();
|
|
27
|
+
if (!secret)
|
|
28
|
+
return { ok: false, reason: 'missing_secret' };
|
|
29
|
+
if (!input.signatureHeader)
|
|
30
|
+
return { ok: false, reason: 'missing_signature' };
|
|
31
|
+
const parsed = parseSignatureHeader(input.signatureHeader);
|
|
32
|
+
if (!parsed)
|
|
33
|
+
return { ok: false, reason: 'malformed_signature' };
|
|
34
|
+
const timestamp = Number(parsed.timestamp);
|
|
35
|
+
const nowSeconds = Math.floor(((_b = input.nowMs) !== null && _b !== void 0 ? _b : Date.now()) / 1000);
|
|
36
|
+
const tolerance = (_c = input.toleranceSeconds) !== null && _c !== void 0 ? _c : exports.DEFAULT_TOLERANCE_SECONDS;
|
|
37
|
+
if (Math.abs(nowSeconds - timestamp) > tolerance) {
|
|
38
|
+
return { ok: false, reason: 'timestamp_out_of_range', timestamp };
|
|
39
|
+
}
|
|
40
|
+
const body = Buffer.isBuffer(input.rawBody) ? input.rawBody : Buffer.from(input.rawBody, 'utf8');
|
|
41
|
+
const expected = (0, crypto_1.createHmac)('sha256', secret)
|
|
42
|
+
.update(`${parsed.timestamp}.`)
|
|
43
|
+
.update(body)
|
|
44
|
+
.digest();
|
|
45
|
+
const matches = parsed.signatures.some((candidate) => {
|
|
46
|
+
const given = Buffer.from(candidate, 'hex');
|
|
47
|
+
return given.length === expected.length && (0, crypto_1.timingSafeEqual)(given, expected);
|
|
48
|
+
});
|
|
49
|
+
return matches ? { ok: true, timestamp } : { ok: false, reason: 'bad_signature', timestamp };
|
|
50
|
+
}
|
|
51
|
+
function signRingeeBody(body, secret, nowMs = Date.now()) {
|
|
52
|
+
const timestamp = Math.floor(nowMs / 1000).toString();
|
|
53
|
+
const digest = (0, crypto_1.createHmac)('sha256', secret).update(`${timestamp}.${body}`).digest('hex');
|
|
54
|
+
return `t=${timestamp},v1=${digest}`;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../lib/utils/webhook.ts"],"names":[],"mappings":";;;AAoBA,oDAaC;AAeD,sDAgCC;AAGD,wCAIC;AAvFD,mCAAqD;AAGxC,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAiB7C,SAAgB,oBAAoB,CACnC,MAAc;IAEd,IAAI,SAA6B,CAAC;IAClC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,M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AM,GAAG,IAAA,mBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzF,OAAO,KAAK,SAAS,OAAO,MAAM,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getAgentVariables } from './methods/resourceMapping';
|
|
3
|
+
import { getAgents, getCallerNumbers, getContacts } from './methods/listSearch';
|
|
4
|
+
export declare class Ringee implements INodeType {
|
|
5
|
+
description: INodeTypeDescription;
|
|
6
|
+
methods: {
|
|
7
|
+
listSearch: {
|
|
8
|
+
getAgents: typeof getAgents;
|
|
9
|
+
getCallerNumbers: typeof getCallerNumbers;
|
|
10
|
+
getContacts: typeof getContacts;
|
|
11
|
+
};
|
|
12
|
+
resourceMapping: {
|
|
13
|
+
getAgentVariables: typeof getAgentVariables;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Ringee = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const resourceMapping_1 = require("./methods/resourceMapping");
|
|
6
|
+
const listSearch_1 = require("./methods/listSearch");
|
|
7
|
+
const resources_1 = require("./resources");
|
|
8
|
+
class Ringee {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'Ringee',
|
|
12
|
+
name: 'ringee',
|
|
13
|
+
icon: { light: 'file:ringee.svg', dark: 'file:ringee.dark.svg' },
|
|
14
|
+
group: ['output'],
|
|
15
|
+
version: 1,
|
|
16
|
+
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
|
17
|
+
description: 'Make AI phone calls, read call results and transcripts, and manage contacts with Ringee',
|
|
18
|
+
defaults: { name: 'Ringee' },
|
|
19
|
+
usableAsTool: true,
|
|
20
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
21
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
22
|
+
credentials: [{ name: 'ringeeApi', required: true }],
|
|
23
|
+
properties: [
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Resource',
|
|
26
|
+
name: 'resource',
|
|
27
|
+
type: 'options',
|
|
28
|
+
noDataExpression: true,
|
|
29
|
+
options: resources_1.RESOURCE_OPTIONS,
|
|
30
|
+
default: 'aiAgent',
|
|
31
|
+
},
|
|
32
|
+
...Object.values(resources_1.RESOURCES).flatMap((resource) => resource.description),
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
this.methods = {
|
|
36
|
+
listSearch: { getAgents: listSearch_1.getAgents, getCallerNumbers: listSearch_1.getCallerNumbers, getContacts: listSearch_1.getContacts },
|
|
37
|
+
resourceMapping: { getAgentVariables: resourceMapping_1.getAgentVariables },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async execute() {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
var _d, _e;
|
|
43
|
+
const items = this.getInputData();
|
|
44
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
45
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
46
|
+
const handler = (_a = resources_1.RESOURCES[resource]) === null || _a === void 0 ? void 0 : _a.operations[operation];
|
|
47
|
+
if (!handler) {
|
|
48
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is not available for '${resource}'`, { description: 'Pick one of the operations in the list.' });
|
|
49
|
+
}
|
|
50
|
+
const returnData = [];
|
|
51
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
52
|
+
try {
|
|
53
|
+
returnData.push(...(await handler(this, itemIndex)));
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (this.continueOnFail()) {
|
|
57
|
+
returnData.push({
|
|
58
|
+
json: { error: error.message },
|
|
59
|
+
pairedItem: { item: itemIndex },
|
|
60
|
+
});
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (error instanceof n8n_workflow_1.NodeApiError) {
|
|
64
|
+
(_b = (_d = error.context).itemIndex) !== null && _b !== void 0 ? _b : (_d.itemIndex = itemIndex);
|
|
65
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
66
|
+
}
|
|
67
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
68
|
+
(_c = (_e = error.context).itemIndex) !== null && _c !== void 0 ? _c : (_e.itemIndex = itemIndex);
|
|
69
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
|
|
70
|
+
}
|
|
71
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return [returnData];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.Ringee = Ringee;
|
|
78
|
+
//# sourceMappingURL=Ringee.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ringee.node.js","sourceRoot":"","sources":["../../../nodes/Ringee/Ringee.node.ts"],"names":[],"mappings":";;;AAOA,+CAAqF;AACrF,+DAA8D;AAC9D,qDAAgF;AAChF,2CAA0D;AAE1D,MAAa,MAAM;IAAnB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE;YAChE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gEAAgE;YAC1E,W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,CAAC,CAAC;IACrB,CAAC;CACD;AA5ED,wBA4EC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-ringee.ringee",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Communication", "Sales"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/ringee-io/n8n-nodes-ringee#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/ringee-io/n8n-nodes-ringee#readme"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"alias": ["phone", "call", "voice", "telephony", "dialer", "ai voice agent", "sales", "voip"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
|
|
2
|
+
export declare function getAgents(this: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult>;
|
|
3
|
+
export declare function getCallerNumbers(this: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult>;
|
|
4
|
+
export declare function getContacts(this: ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<INodeListSearchResult>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAgents = getAgents;
|
|
4
|
+
exports.getCallerNumbers = getCallerNumbers;
|
|
5
|
+
exports.getContacts = getContacts;
|
|
6
|
+
const client_1 = require("../../../lib/api/client");
|
|
7
|
+
async function getAgents(filter) {
|
|
8
|
+
var _a;
|
|
9
|
+
const page = await (0, client_1.ringeeRequest)(this, {
|
|
10
|
+
method: 'GET',
|
|
11
|
+
path: '/v1/ai-voice-agents',
|
|
12
|
+
qs: { limit: 100 },
|
|
13
|
+
});
|
|
14
|
+
const needle = (filter !== null && filter !== void 0 ? filter : '').trim().toLowerCase();
|
|
15
|
+
const results = ((_a = page.data) !== null && _a !== void 0 ? _a : [])
|
|
16
|
+
.filter((agent) => agent.type !== 'receptionist')
|
|
17
|
+
.filter((agent) => !needle || agent.name.toLowerCase().includes(needle))
|
|
18
|
+
.map((agent) => ({
|
|
19
|
+
name: agent.name,
|
|
20
|
+
value: agent.id,
|
|
21
|
+
description: `${agent.type.replace(/_/g, ' ')}${agent.status !== 'active' ? ` · ${agent.status}` : ''}`,
|
|
22
|
+
}));
|
|
23
|
+
return { results };
|
|
24
|
+
}
|
|
25
|
+
async function getCallerNumbers(filter) {
|
|
26
|
+
const numbers = await (0, client_1.ringeeRequest)(this, {
|
|
27
|
+
method: 'GET',
|
|
28
|
+
path: '/v1/ai-voice-agents/phone-numbers',
|
|
29
|
+
});
|
|
30
|
+
const needle = (filter !== null && filter !== void 0 ? filter : '').replace(/\s+/g, '');
|
|
31
|
+
const results = (Array.isArray(numbers) ? numbers : [])
|
|
32
|
+
.filter((number) => !needle || number.phoneNumber.includes(needle))
|
|
33
|
+
.map((number) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return ({
|
|
36
|
+
name: number.phoneNumber,
|
|
37
|
+
value: number.id,
|
|
38
|
+
description: [number.isoCountry, (_a = number.kind) === null || _a === void 0 ? void 0 : _a.replace(/_/g, ' ')].filter(Boolean).join(' · '),
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return { results };
|
|
42
|
+
}
|
|
43
|
+
async function getContacts(filter, paginationToken) {
|
|
44
|
+
var _a;
|
|
45
|
+
const page = Number(paginationToken) || 1;
|
|
46
|
+
const response = await (0, client_1.ringeeRequest)(this, {
|
|
47
|
+
method: 'GET',
|
|
48
|
+
path: '/v1/contacts',
|
|
49
|
+
qs: { query: (filter === null || filter === void 0 ? void 0 : filter.trim()) || undefined, page, limit: 50 },
|
|
50
|
+
});
|
|
51
|
+
const results = ((_a = response.data) !== null && _a !== void 0 ? _a : []).map((contact) => ({
|
|
52
|
+
name: displayName(contact),
|
|
53
|
+
value: contact.id,
|
|
54
|
+
description: contact.phoneNumber,
|
|
55
|
+
}));
|
|
56
|
+
const hasMore = response.totalPages !== undefined && page < response.totalPages;
|
|
57
|
+
return { results, paginationToken: hasMore ? String(page + 1) : undefined };
|
|
58
|
+
}
|
|
59
|
+
function displayName(contact) {
|
|
60
|
+
const name = contact.name ||
|
|
61
|
+
[contact.firstName, contact.lastName].filter(Boolean).join(' ') ||
|
|
62
|
+
contact.email ||
|
|
63
|
+
contact.phoneNumber;
|
|
64
|
+
return name;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=listSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listSearch.js","sourceRoot":"","sources":["../../../../nodes/Ringee/methods/listSearch.ts"],"names":[],"mappings":";;AAcA,8BAoBC;AAGD,4CAiBC;AAGD,kCAkBC;AAtED,oDAAwD;AASjD,KAAK,UAAU,SAAS,CAE9B,MAAe;;IAEf,MAAM,IAAI,GAAG,MAAM,IAAA,sBAAa,EAAkB,IAAI,EAAE;QACvD,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,qBAAqB;QAC3B,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnD,MAAM,OAAO,GAA2B,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;SAEvD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;SAChD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC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AAC,IAAI,CAAC,GAAG,CAAC;QAC/D,OAAO,CAAC,KAAK;QACb,OAAO,CAAC,WAAW,CAAC;IACrB,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAgentVariables = getAgentVariables;
|
|
4
|
+
const client_1 = require("../../../lib/api/client");
|
|
5
|
+
async function getAgentVariables() {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const agentId = String((_a = this.getNodeParameter('agentId', '', { extractValue: true })) !== null && _a !== void 0 ? _a : '').trim();
|
|
8
|
+
if (!agentId)
|
|
9
|
+
return { fields: [] };
|
|
10
|
+
const agent = await (0, client_1.ringeeRequest)(this, {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: `/v1/ai-voice-agents/${encodeURIComponent(agentId)}`,
|
|
13
|
+
subject: 'AI voice agent',
|
|
14
|
+
});
|
|
15
|
+
const fields = ((_b = agent.variables) !== null && _b !== void 0 ? _b : []).map((variable) => ({
|
|
16
|
+
id: variable.key,
|
|
17
|
+
displayName: variable.label || variable.key,
|
|
18
|
+
required: variable.required,
|
|
19
|
+
defaultMatch: false,
|
|
20
|
+
canBeUsedToMatch: false,
|
|
21
|
+
display: true,
|
|
22
|
+
type: 'string',
|
|
23
|
+
}));
|
|
24
|
+
return { fields };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=resourceMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceMapping.js","sourceRoot":"","sources":["../../../../nodes/Ringee/methods/resourceMapping.ts"],"names":[],"mappings":";;AAgBA,8CAsBC;AAjCD,oDAAwD;AAWjD,KAAK,UAAU,iBAAiB;;IAGtC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClG,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAEpC,MAAM,KAAK,GAAG,MAAM,IAAA,sBAAa,EAAc,IAAI,EAAE;QACpD,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB,kBAAkB,CAAC,OAAO,CAAC,EAAE;QAC1D,OAAO,EAAE,gBAAgB;KACzB,CAAC,CAAC;IAEH,MAAM,MAAM,GAA0B,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAChF,EAAE,EAAE,QAAQ,CAAC,GAAG;QAChB,WAAW,EAAE,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,GAAG;QAC3C,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,YAAY,EAAE,KAAK;QACnB,gBAAgB,EAAE,KAAK;QACvB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,QAAQ;KACd,CAAC,CAAC,CAAC;IACJ,OAAO,EAAE,MAAM,EAAE,CAAC;AACnB,CAAC"}
|