telnyx 6.41.1 → 6.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/core/EventEmitter.d.mts +11 -0
- package/core/EventEmitter.d.mts.map +1 -1
- package/core/EventEmitter.d.ts +11 -0
- package/core/EventEmitter.d.ts.map +1 -1
- package/core/EventEmitter.js +15 -1
- package/core/EventEmitter.js.map +1 -1
- package/core/EventEmitter.mjs +13 -0
- package/core/EventEmitter.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/ws-adapter-browser.d.mts +34 -0
- package/internal/ws-adapter-browser.d.mts.map +1 -0
- package/internal/ws-adapter-browser.d.ts +34 -0
- package/internal/ws-adapter-browser.d.ts.map +1 -0
- package/internal/ws-adapter-browser.js +88 -0
- package/internal/ws-adapter-browser.js.map +1 -0
- package/internal/ws-adapter-browser.mjs +84 -0
- package/internal/ws-adapter-browser.mjs.map +1 -0
- package/internal/ws-adapter-node.d.mts +27 -0
- package/internal/ws-adapter-node.d.mts.map +1 -0
- package/internal/ws-adapter-node.d.ts +27 -0
- package/internal/ws-adapter-node.d.ts.map +1 -0
- package/internal/ws-adapter-node.js +90 -0
- package/internal/ws-adapter-node.js.map +1 -0
- package/internal/ws-adapter-node.mjs +86 -0
- package/internal/ws-adapter-node.mjs.map +1 -0
- package/internal/ws-adapter.d.mts +24 -0
- package/internal/ws-adapter.d.mts.map +1 -0
- package/internal/ws-adapter.d.ts +24 -0
- package/internal/ws-adapter.d.ts.map +1 -0
- package/internal/ws-adapter.js +11 -0
- package/internal/ws-adapter.js.map +1 -0
- package/internal/ws-adapter.mjs +8 -0
- package/internal/ws-adapter.mjs.map +1 -0
- package/internal/ws.d.mts +80 -0
- package/internal/ws.d.mts.map +1 -0
- package/internal/ws.d.ts +80 -0
- package/internal/ws.d.ts.map +1 -0
- package/internal/ws.js +153 -0
- package/internal/ws.js.map +1 -0
- package/internal/ws.mjs +147 -0
- package/internal/ws.mjs.map +1 -0
- package/lib/text-to-speech-ws-base.d.mts +106 -0
- package/lib/text-to-speech-ws-base.d.mts.map +1 -0
- package/lib/text-to-speech-ws-base.d.ts +106 -0
- package/lib/text-to-speech-ws-base.d.ts.map +1 -0
- package/lib/text-to-speech-ws-base.js +475 -0
- package/lib/text-to-speech-ws-base.js.map +1 -0
- package/lib/text-to-speech-ws-base.mjs +471 -0
- package/lib/text-to-speech-ws-base.mjs.map +1 -0
- package/lib/text-to-speech-ws-internal.d.mts +71 -0
- package/lib/text-to-speech-ws-internal.d.mts.map +1 -0
- package/lib/text-to-speech-ws-internal.d.ts +71 -0
- package/lib/text-to-speech-ws-internal.d.ts.map +1 -0
- package/lib/text-to-speech-ws-internal.js +47 -0
- package/lib/text-to-speech-ws-internal.js.map +1 -0
- package/lib/text-to-speech-ws-internal.mjs +41 -0
- package/lib/text-to-speech-ws-internal.mjs.map +1 -0
- package/lib/text-to-speech-ws.d.mts +13 -0
- package/lib/text-to-speech-ws.d.mts.map +1 -0
- package/lib/text-to-speech-ws.d.ts +13 -0
- package/lib/text-to-speech-ws.d.ts.map +1 -0
- package/lib/text-to-speech-ws.js +30 -0
- package/lib/text-to-speech-ws.js.map +1 -0
- package/lib/text-to-speech-ws.mjs +25 -0
- package/lib/text-to-speech-ws.mjs.map +1 -0
- package/lib/webhooks.d.mts +6 -0
- package/lib/webhooks.d.mts.map +1 -1
- package/lib/webhooks.d.ts +6 -0
- package/lib/webhooks.d.ts.map +1 -1
- package/lib/webhooks.js +16 -0
- package/lib/webhooks.js.map +1 -1
- package/lib/webhooks.mjs +14 -0
- package/lib/webhooks.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/assistants/assistants.d.mts +938 -65
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +938 -65
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js +0 -1
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs +0 -1
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/assistants/versions.d.mts +563 -25
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +563 -25
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.d.mts +2 -2
- package/resources/ai/conversations/conversations.d.mts.map +1 -1
- package/resources/ai/conversations/conversations.d.ts +2 -2
- package/resources/ai/conversations/conversations.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.js.map +1 -1
- package/resources/ai/conversations/conversations.mjs +1 -1
- package/resources/ai/conversations/conversations.mjs.map +1 -1
- package/resources/ai/conversations/index.d.mts +1 -1
- package/resources/ai/conversations/index.d.mts.map +1 -1
- package/resources/ai/conversations/index.d.ts +1 -1
- package/resources/ai/conversations/index.d.ts.map +1 -1
- package/resources/ai/conversations/index.js.map +1 -1
- package/resources/ai/conversations/index.mjs +1 -1
- package/resources/ai/conversations/index.mjs.map +1 -1
- package/resources/ai/conversations/messages.d.mts +46 -48
- package/resources/ai/conversations/messages.d.mts.map +1 -1
- package/resources/ai/conversations/messages.d.ts +46 -48
- package/resources/ai/conversations/messages.d.ts.map +1 -1
- package/resources/ai/conversations/messages.js +9 -6
- package/resources/ai/conversations/messages.js.map +1 -1
- package/resources/ai/conversations/messages.mjs +9 -6
- package/resources/ai/conversations/messages.mjs.map +1 -1
- package/resources/calls/actions.d.mts +114 -6
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +114 -6
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js +4 -0
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs +4 -0
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +168 -8
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +168 -8
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js +4 -0
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs +4 -0
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/index.d.mts +2 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -2
- package/resources/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +4 -0
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +4 -0
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/session-analysis/session-analysis.d.mts +3 -13
- package/resources/session-analysis/session-analysis.d.mts.map +1 -1
- package/resources/session-analysis/session-analysis.d.ts +3 -13
- package/resources/session-analysis/session-analysis.d.ts.map +1 -1
- package/resources/session-analysis/session-analysis.js.map +1 -1
- package/resources/session-analysis/session-analysis.mjs.map +1 -1
- package/resources/texml/accounts/calls/calls.d.mts +45 -0
- package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.ts +45 -0
- package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.js.map +1 -1
- package/resources/texml/accounts/calls/calls.mjs.map +1 -1
- package/resources/text-to-speech/index.d.mts +2 -1
- package/resources/text-to-speech/index.d.mts.map +1 -1
- package/resources/text-to-speech/index.d.ts +2 -1
- package/resources/text-to-speech/index.d.ts.map +1 -1
- package/resources/text-to-speech/index.js.map +1 -1
- package/resources/text-to-speech/index.mjs.map +1 -1
- package/resources/text-to-speech/internal-base.d.mts +1 -48
- package/resources/text-to-speech/internal-base.d.mts.map +1 -1
- package/resources/text-to-speech/internal-base.d.ts +1 -48
- package/resources/text-to-speech/internal-base.d.ts.map +1 -1
- package/resources/text-to-speech/internal-base.js +5 -48
- package/resources/text-to-speech/internal-base.js.map +1 -1
- package/resources/text-to-speech/internal-base.mjs +1 -44
- package/resources/text-to-speech/internal-base.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +28 -3
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +28 -3
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/text-to-speech/text-to-speech.js +1 -1
- package/resources/text-to-speech/text-to-speech.mjs +1 -1
- package/resources/text-to-speech/ws-base.d.mts +2 -0
- package/resources/text-to-speech/ws-base.d.mts.map +1 -0
- package/resources/text-to-speech/ws-base.d.ts +2 -0
- package/resources/text-to-speech/ws-base.d.ts.map +1 -0
- package/resources/text-to-speech/ws-base.js +7 -0
- package/resources/text-to-speech/ws-base.js.map +1 -0
- package/resources/text-to-speech/ws-base.mjs +3 -0
- package/resources/text-to-speech/ws-base.mjs.map +1 -0
- package/resources/text-to-speech/ws.d.mts +2 -41
- package/resources/text-to-speech/ws.d.mts.map +1 -1
- package/resources/text-to-speech/ws.d.ts +2 -41
- package/resources/text-to-speech/ws.d.ts.map +1 -1
- package/resources/text-to-speech/ws.js +2 -182
- package/resources/text-to-speech/ws.js.map +1 -1
- package/resources/text-to-speech/ws.mjs +1 -180
- package/resources/text-to-speech/ws.mjs.map +1 -1
- package/resources/verify-profiles.d.mts +97 -121
- package/resources/verify-profiles.d.mts.map +1 -1
- package/resources/verify-profiles.d.ts +97 -121
- package/resources/verify-profiles.d.ts.map +1 -1
- package/resources/webhooks.d.mts +642 -7
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +642 -7
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +4 -10
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -11
- package/resources/webhooks.mjs.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.d.mts +5 -0
- package/resources/whatsapp/phone-numbers/profile/profile.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.d.ts +5 -0
- package/resources/whatsapp/phone-numbers/profile/profile.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.js.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.mjs.map +1 -1
- package/src/client.ts +22 -0
- package/src/core/EventEmitter.ts +16 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/ws-adapter-browser.ts +123 -0
- package/src/internal/ws-adapter-node.ts +105 -0
- package/src/internal/ws-adapter.ts +30 -0
- package/src/internal/ws.ts +193 -0
- package/src/lib/text-to-speech-ws-base.ts +618 -0
- package/src/lib/text-to-speech-ws-internal.ts +111 -0
- package/src/lib/text-to-speech-ws.ts +40 -0
- package/src/lib/webhooks.ts +27 -0
- package/src/resources/ai/assistants/assistants.ts +1065 -65
- package/src/resources/ai/assistants/versions.ts +639 -25
- package/src/resources/ai/conversations/conversations.ts +12 -2
- package/src/resources/ai/conversations/index.ts +6 -1
- package/src/resources/ai/conversations/messages.ts +67 -54
- package/src/resources/calls/actions.ts +184 -4
- package/src/resources/calls/calls.ts +191 -4
- package/src/resources/index.ts +6 -12
- package/src/resources/messages/messages.ts +5 -0
- package/src/resources/session-analysis/session-analysis.ts +3 -16
- package/src/resources/texml/accounts/calls/calls.ts +54 -0
- package/src/resources/text-to-speech/index.ts +2 -1
- package/src/resources/text-to-speech/internal-base.ts +6 -95
- package/src/resources/text-to-speech/text-to-speech.ts +33 -3
- package/src/resources/text-to-speech/ws-base.ts +7 -0
- package/src/resources/text-to-speech/ws.ts +2 -201
- package/src/resources/verify-profiles.ts +109 -142
- package/src/resources/webhooks.ts +886 -45
- package/src/resources/whatsapp/phone-numbers/profile/profile.ts +7 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,203 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import * as TextToSpeechAPI from './text-to-speech';
|
|
6
|
-
import { Telnyx } from '../../client';
|
|
7
|
-
|
|
8
|
-
export class TextToSpeechWS extends TextToSpeechEmitter {
|
|
9
|
-
url: URL;
|
|
10
|
-
socket: WS.WebSocket;
|
|
11
|
-
private client: Telnyx;
|
|
12
|
-
|
|
13
|
-
constructor(client: Telnyx, parameters?: null | undefined, options?: WS.ClientOptions | null | undefined) {
|
|
14
|
-
super();
|
|
15
|
-
this.client = client;
|
|
16
|
-
this.url = buildURL(client, parameters);
|
|
17
|
-
this.socket = new WS.WebSocket(this.url, {
|
|
18
|
-
...options,
|
|
19
|
-
headers: {
|
|
20
|
-
...this.authHeaders(),
|
|
21
|
-
...options?.headers,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
this.socket.on('message', (wsEvent) => {
|
|
26
|
-
const event = (() => {
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(wsEvent.toString()) as TextToSpeechAPI.StreamServerEvent;
|
|
29
|
-
} catch (err) {
|
|
30
|
-
this._onError(null, 'could not parse websocket event', err);
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
})();
|
|
34
|
-
|
|
35
|
-
if (event) {
|
|
36
|
-
this._emit('event', event);
|
|
37
|
-
|
|
38
|
-
if (event.type === 'error') {
|
|
39
|
-
this._onError(event);
|
|
40
|
-
} else {
|
|
41
|
-
// @ts-ignore TS isn't smart enough to get the relationship right here
|
|
42
|
-
this._emit(event.type, event);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
this.socket.on('error', (err) => {
|
|
48
|
-
this._onError(null, err.message, err);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
send(event: TextToSpeechAPI.StreamClientEvent) {
|
|
53
|
-
try {
|
|
54
|
-
this.socket.send(JSON.stringify(event));
|
|
55
|
-
} catch (err) {
|
|
56
|
-
this._onError(null, 'could not send data', err);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
close(props?: { code: number; reason: string }) {
|
|
61
|
-
try {
|
|
62
|
-
this.socket.close(props?.code ?? 1000, props?.reason ?? 'OK');
|
|
63
|
-
} catch (err) {
|
|
64
|
-
this._onError(null, 'could not close the connection', err);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Returns an async iterator over WebSocket lifecycle and message events,
|
|
70
|
-
* providing an alternative to the event-based `.on()` API.
|
|
71
|
-
* The iterator will exit if the socket closes but breaking out of the iterator
|
|
72
|
-
* does not close the socket.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* for await (const event of connection.stream()) {
|
|
77
|
-
* switch (event.type) {
|
|
78
|
-
* case 'message':
|
|
79
|
-
* console.log('received:', event.message);
|
|
80
|
-
* break;
|
|
81
|
-
* case 'error':
|
|
82
|
-
* console.error(event.error);
|
|
83
|
-
* break;
|
|
84
|
-
* case 'close':
|
|
85
|
-
* console.log('connection closed');
|
|
86
|
-
* break;
|
|
87
|
-
* }
|
|
88
|
-
* }
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
stream(): AsyncIterableIterator<TextToSpeechStreamMessage> {
|
|
92
|
-
return this[Symbol.asyncIterator]();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<TextToSpeechStreamMessage> {
|
|
96
|
-
// Two-queue async iterator: `queue` buffers incoming messages,
|
|
97
|
-
// `resolvers` buffers waiting next() calls. A push wakes the
|
|
98
|
-
// oldest next(); a next() drains the oldest message.
|
|
99
|
-
const queue: TextToSpeechStreamMessage[] = [];
|
|
100
|
-
const resolvers: (() => void)[] = [];
|
|
101
|
-
let done = false;
|
|
102
|
-
|
|
103
|
-
const push = (msg: TextToSpeechStreamMessage) => {
|
|
104
|
-
queue.push(msg);
|
|
105
|
-
resolvers.shift()?.();
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const onEvent = (event: TextToSpeechAPI.StreamServerEvent) => {
|
|
109
|
-
if (event.type === 'error') return; // handled by onEmitterError
|
|
110
|
-
push({ type: 'message', message: event });
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// Catches both API-level and socket-level errors via _onError → _emit('error')
|
|
114
|
-
const onEmitterError = (err: WebSocketError) => {
|
|
115
|
-
push({ type: 'error', error: err });
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const onOpen = () => {
|
|
119
|
-
push({ type: 'open' });
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const flushResolvers = () => {
|
|
123
|
-
for (let resolver = resolvers.shift(); resolver; resolver = resolvers.shift()) {
|
|
124
|
-
resolver();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const onClose = () => {
|
|
129
|
-
push({ type: 'close' });
|
|
130
|
-
done = true;
|
|
131
|
-
flushResolvers();
|
|
132
|
-
cleanup();
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const cleanup = () => {
|
|
136
|
-
this.off('event', onEvent);
|
|
137
|
-
this.off('error', onEmitterError);
|
|
138
|
-
this.socket.off('open', onOpen);
|
|
139
|
-
this.socket.off('close', onClose);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
this.on('event', onEvent);
|
|
143
|
-
this.on('error', onEmitterError);
|
|
144
|
-
this.socket.on('open', onOpen);
|
|
145
|
-
this.socket.on('close', onClose);
|
|
146
|
-
|
|
147
|
-
switch (this.socket.readyState) {
|
|
148
|
-
case WS.WebSocket.CONNECTING:
|
|
149
|
-
push({ type: 'connecting' });
|
|
150
|
-
break;
|
|
151
|
-
case WS.WebSocket.OPEN:
|
|
152
|
-
push({ type: 'open' });
|
|
153
|
-
break;
|
|
154
|
-
case WS.WebSocket.CLOSING:
|
|
155
|
-
push({ type: 'closing' });
|
|
156
|
-
break;
|
|
157
|
-
case WS.WebSocket.CLOSED:
|
|
158
|
-
push({ type: 'close' });
|
|
159
|
-
done = true;
|
|
160
|
-
cleanup();
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const resolve = (res: (value: IteratorResult<TextToSpeechStreamMessage>) => void) => {
|
|
165
|
-
if (queue.length > 0) {
|
|
166
|
-
res({ value: queue.shift()!, done: false });
|
|
167
|
-
} else if (done) {
|
|
168
|
-
res({ value: undefined, done: true });
|
|
169
|
-
} else {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
return true;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const next = (): Promise<IteratorResult<TextToSpeechStreamMessage>> =>
|
|
176
|
-
new Promise((res) => {
|
|
177
|
-
if (resolve(res)) return;
|
|
178
|
-
resolvers.push(() => {
|
|
179
|
-
resolve(res);
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
return {
|
|
184
|
-
next,
|
|
185
|
-
return: (): Promise<IteratorReturnResult<undefined>> => {
|
|
186
|
-
done = true;
|
|
187
|
-
cleanup();
|
|
188
|
-
flushResolvers();
|
|
189
|
-
return Promise.resolve({ value: undefined, done: true });
|
|
190
|
-
},
|
|
191
|
-
[Symbol.asyncIterator]() {
|
|
192
|
-
return this;
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
private authHeaders(): Record<string, string> {
|
|
198
|
-
if (this.client.apiKey) {
|
|
199
|
-
return { Authorization: `Bearer ${this.client.apiKey}` };
|
|
200
|
-
}
|
|
201
|
-
return {};
|
|
202
|
-
}
|
|
203
|
-
}
|
|
3
|
+
export { TextToSpeechWS, type TextToSpeechWSClientOptions } from '../../lib/text-to-speech-ws';
|
|
4
|
+
export type { TextToSpeechWSReconnectOptions } from '../../lib/text-to-speech-ws-base';
|
|
@@ -162,14 +162,22 @@ export interface VerifyProfile {
|
|
|
162
162
|
|
|
163
163
|
created_at?: string;
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* The maximum daily spend allowed on this verify profile, in USD.
|
|
167
|
+
*/
|
|
168
|
+
daily_spend_limit?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Whether the daily spend limit is enforced for this verify profile.
|
|
172
|
+
*/
|
|
173
|
+
daily_spend_limit_enabled?: boolean;
|
|
174
|
+
|
|
165
175
|
flashcall?: VerifyProfile.Flashcall;
|
|
166
176
|
|
|
167
177
|
language?: string;
|
|
168
178
|
|
|
169
179
|
name?: string;
|
|
170
180
|
|
|
171
|
-
rcs?: VerifyProfile.Rcs;
|
|
172
|
-
|
|
173
181
|
/**
|
|
174
182
|
* The possible verification profile record types.
|
|
175
183
|
*/
|
|
@@ -182,6 +190,8 @@ export interface VerifyProfile {
|
|
|
182
190
|
webhook_failover_url?: string;
|
|
183
191
|
|
|
184
192
|
webhook_url?: string;
|
|
193
|
+
|
|
194
|
+
whatsapp?: VerifyProfile.Whatsapp;
|
|
185
195
|
}
|
|
186
196
|
|
|
187
197
|
export namespace VerifyProfile {
|
|
@@ -213,7 +223,9 @@ export namespace VerifyProfile {
|
|
|
213
223
|
/**
|
|
214
224
|
* Enabled country destinations to send verification codes. The elements in the
|
|
215
225
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
216
|
-
* destinations will be allowed.
|
|
226
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
227
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
228
|
+
* destinations; otherwise it is optional.
|
|
217
229
|
*/
|
|
218
230
|
whitelisted_destinations?: Array<string>;
|
|
219
231
|
|
|
@@ -238,7 +250,13 @@ export namespace VerifyProfile {
|
|
|
238
250
|
[k: string]: unknown;
|
|
239
251
|
}
|
|
240
252
|
|
|
241
|
-
export interface
|
|
253
|
+
export interface SMS {
|
|
254
|
+
/**
|
|
255
|
+
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
256
|
+
* alphanumeric sender ID.
|
|
257
|
+
*/
|
|
258
|
+
alpha_sender?: string | null;
|
|
259
|
+
|
|
242
260
|
/**
|
|
243
261
|
* The name that identifies the application requesting 2fa in the verification
|
|
244
262
|
* message.
|
|
@@ -263,28 +281,19 @@ export namespace VerifyProfile {
|
|
|
263
281
|
*/
|
|
264
282
|
messaging_template_id?: string;
|
|
265
283
|
|
|
266
|
-
/**
|
|
267
|
-
* Enable SMS fallback when RCS delivery fails.
|
|
268
|
-
*/
|
|
269
|
-
sms_fallback?: boolean;
|
|
270
|
-
|
|
271
284
|
/**
|
|
272
285
|
* Enabled country destinations to send verification codes. The elements in the
|
|
273
286
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
274
|
-
* destinations will be allowed.
|
|
287
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
288
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
289
|
+
* destinations; otherwise it is optional.
|
|
275
290
|
*/
|
|
276
291
|
whitelisted_destinations?: Array<string>;
|
|
277
292
|
|
|
278
293
|
[k: string]: unknown;
|
|
279
294
|
}
|
|
280
295
|
|
|
281
|
-
export interface
|
|
282
|
-
/**
|
|
283
|
-
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
284
|
-
* alphanumeric sender ID.
|
|
285
|
-
*/
|
|
286
|
-
alpha_sender?: string | null;
|
|
287
|
-
|
|
296
|
+
export interface Whatsapp {
|
|
288
297
|
/**
|
|
289
298
|
* The name that identifies the application requesting 2fa in the verification
|
|
290
299
|
* message.
|
|
@@ -309,10 +318,27 @@ export namespace VerifyProfile {
|
|
|
309
318
|
*/
|
|
310
319
|
messaging_template_id?: string;
|
|
311
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Phone number registered on the customer WABA to send OTPs from
|
|
323
|
+
*/
|
|
324
|
+
sender_phone_number?: string | null;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Customer pre-approved authentication template name registered on Meta
|
|
328
|
+
*/
|
|
329
|
+
template_id?: string | null;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Customer Meta WABA ID for Bring-Your-Own-WABA sending
|
|
333
|
+
*/
|
|
334
|
+
waba_id?: string | null;
|
|
335
|
+
|
|
312
336
|
/**
|
|
313
337
|
* Enabled country destinations to send verification codes. The elements in the
|
|
314
338
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
315
|
-
* destinations will be allowed.
|
|
339
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
340
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
341
|
+
* destinations; otherwise it is optional.
|
|
316
342
|
*/
|
|
317
343
|
whitelisted_destinations?: Array<string>;
|
|
318
344
|
|
|
@@ -342,12 +368,20 @@ export interface VerifyProfileCreateParams {
|
|
|
342
368
|
|
|
343
369
|
call?: VerifyProfileCreateParams.Call;
|
|
344
370
|
|
|
371
|
+
/**
|
|
372
|
+
* The maximum daily spend allowed on this verify profile, in USD.
|
|
373
|
+
*/
|
|
374
|
+
daily_spend_limit?: number;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Whether the daily spend limit is enforced for this verify profile.
|
|
378
|
+
*/
|
|
379
|
+
daily_spend_limit_enabled?: boolean;
|
|
380
|
+
|
|
345
381
|
flashcall?: VerifyProfileCreateParams.Flashcall;
|
|
346
382
|
|
|
347
383
|
language?: string;
|
|
348
384
|
|
|
349
|
-
rcs?: VerifyProfileCreateParams.Rcs;
|
|
350
|
-
|
|
351
385
|
sms?: VerifyProfileCreateParams.SMS;
|
|
352
386
|
|
|
353
387
|
webhook_failover_url?: string;
|
|
@@ -386,7 +420,9 @@ export namespace VerifyProfileCreateParams {
|
|
|
386
420
|
/**
|
|
387
421
|
* Enabled country destinations to send verification codes. The elements in the
|
|
388
422
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
389
|
-
* destinations will be allowed.
|
|
423
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
424
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
425
|
+
* destinations; otherwise it is optional.
|
|
390
426
|
*/
|
|
391
427
|
whitelisted_destinations?: Array<string>;
|
|
392
428
|
|
|
@@ -411,14 +447,22 @@ export namespace VerifyProfileCreateParams {
|
|
|
411
447
|
/**
|
|
412
448
|
* Enabled country destinations to send verification codes. The elements in the
|
|
413
449
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
414
|
-
* destinations will be allowed.
|
|
450
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
451
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
452
|
+
* destinations; otherwise it is optional.
|
|
415
453
|
*/
|
|
416
454
|
whitelisted_destinations?: Array<string>;
|
|
417
455
|
|
|
418
456
|
[k: string]: unknown;
|
|
419
457
|
}
|
|
420
458
|
|
|
421
|
-
export interface
|
|
459
|
+
export interface SMS {
|
|
460
|
+
/**
|
|
461
|
+
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
462
|
+
* alphanumeric sender ID.
|
|
463
|
+
*/
|
|
464
|
+
alpha_sender?: string | null;
|
|
465
|
+
|
|
422
466
|
/**
|
|
423
467
|
* The name that identifies the application requesting 2fa in the verification
|
|
424
468
|
* message.
|
|
@@ -443,39 +487,19 @@ export namespace VerifyProfileCreateParams {
|
|
|
443
487
|
*/
|
|
444
488
|
messaging_template_id?: string;
|
|
445
489
|
|
|
446
|
-
/**
|
|
447
|
-
* Enable SMS fallback when RCS delivery fails.
|
|
448
|
-
*/
|
|
449
|
-
sms_fallback?: boolean;
|
|
450
|
-
|
|
451
490
|
/**
|
|
452
491
|
* Enabled country destinations to send verification codes. The elements in the
|
|
453
492
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
454
|
-
* destinations will be allowed.
|
|
493
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
494
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
495
|
+
* destinations; otherwise it is optional.
|
|
455
496
|
*/
|
|
456
497
|
whitelisted_destinations?: Array<string>;
|
|
457
498
|
|
|
458
499
|
[k: string]: unknown;
|
|
459
500
|
}
|
|
460
501
|
|
|
461
|
-
export interface
|
|
462
|
-
/**
|
|
463
|
-
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
464
|
-
* alphanumeric sender ID.
|
|
465
|
-
*/
|
|
466
|
-
alpha_sender?: string | null;
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* The name that identifies the application requesting 2fa in the verification
|
|
470
|
-
* message.
|
|
471
|
-
*/
|
|
472
|
-
app_name?: string;
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* The length of the verify code to generate.
|
|
476
|
-
*/
|
|
477
|
-
code_length?: number;
|
|
478
|
-
|
|
502
|
+
export interface Whatsapp {
|
|
479
503
|
/**
|
|
480
504
|
* For every request that is initiated via this Verify profile, this sets the
|
|
481
505
|
* number of seconds before a verification request code expires. Once the
|
|
@@ -485,39 +509,26 @@ export namespace VerifyProfileCreateParams {
|
|
|
485
509
|
default_verification_timeout_secs?: number;
|
|
486
510
|
|
|
487
511
|
/**
|
|
488
|
-
*
|
|
489
|
-
*/
|
|
490
|
-
messaging_template_id?: string;
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Enabled country destinations to send verification codes. The elements in the
|
|
494
|
-
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
495
|
-
* destinations will be allowed.
|
|
512
|
+
* Phone number registered on the customer WABA to send OTPs from
|
|
496
513
|
*/
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
[k: string]: unknown;
|
|
500
|
-
}
|
|
514
|
+
sender_phone_number?: string | null;
|
|
501
515
|
|
|
502
|
-
export interface Whatsapp {
|
|
503
516
|
/**
|
|
504
|
-
*
|
|
505
|
-
* message.
|
|
517
|
+
* Customer pre-approved authentication template name registered on Meta
|
|
506
518
|
*/
|
|
507
|
-
|
|
519
|
+
template_id?: string | null;
|
|
508
520
|
|
|
509
521
|
/**
|
|
510
|
-
*
|
|
511
|
-
* number of seconds before a verification request code expires. Once the
|
|
512
|
-
* verification request expires, the user cannot use the code to verify their
|
|
513
|
-
* identity.
|
|
522
|
+
* Customer Meta WABA ID for Bring-Your-Own-WABA sending
|
|
514
523
|
*/
|
|
515
|
-
|
|
524
|
+
waba_id?: string | null;
|
|
516
525
|
|
|
517
526
|
/**
|
|
518
527
|
* Enabled country destinations to send verification codes. The elements in the
|
|
519
528
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
520
|
-
* destinations will be allowed.
|
|
529
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
530
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
531
|
+
* destinations; otherwise it is optional.
|
|
521
532
|
*/
|
|
522
533
|
whitelisted_destinations?: Array<string>;
|
|
523
534
|
|
|
@@ -528,14 +539,20 @@ export namespace VerifyProfileCreateParams {
|
|
|
528
539
|
export interface VerifyProfileUpdateParams {
|
|
529
540
|
call?: VerifyProfileUpdateParams.Call;
|
|
530
541
|
|
|
531
|
-
|
|
542
|
+
/**
|
|
543
|
+
* The maximum daily spend allowed on this verify profile, in USD.
|
|
544
|
+
*/
|
|
545
|
+
daily_spend_limit?: number;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Whether the daily spend limit is enforced for this verify profile.
|
|
549
|
+
*/
|
|
550
|
+
daily_spend_limit_enabled?: boolean;
|
|
532
551
|
|
|
533
552
|
language?: string;
|
|
534
553
|
|
|
535
554
|
name?: string;
|
|
536
555
|
|
|
537
|
-
rcs?: VerifyProfileUpdateParams.Rcs;
|
|
538
|
-
|
|
539
556
|
sms?: VerifyProfileUpdateParams.SMS;
|
|
540
557
|
|
|
541
558
|
webhook_failover_url?: string;
|
|
@@ -574,39 +591,22 @@ export namespace VerifyProfileUpdateParams {
|
|
|
574
591
|
/**
|
|
575
592
|
* Enabled country destinations to send verification codes. The elements in the
|
|
576
593
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
577
|
-
* destinations will be allowed.
|
|
594
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
595
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
596
|
+
* destinations; otherwise it is optional.
|
|
578
597
|
*/
|
|
579
598
|
whitelisted_destinations?: Array<string>;
|
|
580
599
|
|
|
581
600
|
[k: string]: unknown;
|
|
582
601
|
}
|
|
583
602
|
|
|
584
|
-
export interface
|
|
585
|
-
/**
|
|
586
|
-
* The name that identifies the application requesting 2fa in the verification
|
|
587
|
-
* message.
|
|
588
|
-
*/
|
|
589
|
-
app_name?: string;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* For every request that is initiated via this Verify profile, this sets the
|
|
593
|
-
* number of seconds before a verification request code expires. Once the
|
|
594
|
-
* verification request expires, the user cannot use the code to verify their
|
|
595
|
-
* identity.
|
|
596
|
-
*/
|
|
597
|
-
default_verification_timeout_secs?: number;
|
|
598
|
-
|
|
603
|
+
export interface SMS {
|
|
599
604
|
/**
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
* destinations will be allowed.
|
|
605
|
+
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
606
|
+
* alphanumeric sender ID.
|
|
603
607
|
*/
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
[k: string]: unknown;
|
|
607
|
-
}
|
|
608
|
+
alpha_sender?: string | null;
|
|
608
609
|
|
|
609
|
-
export interface Rcs {
|
|
610
610
|
/**
|
|
611
611
|
* The name that identifies the application requesting 2fa in the verification
|
|
612
612
|
* message.
|
|
@@ -631,39 +631,19 @@ export namespace VerifyProfileUpdateParams {
|
|
|
631
631
|
*/
|
|
632
632
|
messaging_template_id?: string;
|
|
633
633
|
|
|
634
|
-
/**
|
|
635
|
-
* Enable SMS fallback when RCS delivery fails.
|
|
636
|
-
*/
|
|
637
|
-
sms_fallback?: boolean;
|
|
638
|
-
|
|
639
634
|
/**
|
|
640
635
|
* Enabled country destinations to send verification codes. The elements in the
|
|
641
636
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
642
|
-
* destinations will be allowed.
|
|
637
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
638
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
639
|
+
* destinations; otherwise it is optional.
|
|
643
640
|
*/
|
|
644
641
|
whitelisted_destinations?: Array<string>;
|
|
645
642
|
|
|
646
643
|
[k: string]: unknown;
|
|
647
644
|
}
|
|
648
645
|
|
|
649
|
-
export interface
|
|
650
|
-
/**
|
|
651
|
-
* The alphanumeric sender ID to use when sending to destinations that require an
|
|
652
|
-
* alphanumeric sender ID.
|
|
653
|
-
*/
|
|
654
|
-
alpha_sender?: string | null;
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* The name that identifies the application requesting 2fa in the verification
|
|
658
|
-
* message.
|
|
659
|
-
*/
|
|
660
|
-
app_name?: string;
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* The length of the verify code to generate.
|
|
664
|
-
*/
|
|
665
|
-
code_length?: number;
|
|
666
|
-
|
|
646
|
+
export interface Whatsapp {
|
|
667
647
|
/**
|
|
668
648
|
* For every request that is initiated via this Verify profile, this sets the
|
|
669
649
|
* number of seconds before a verification request code expires. Once the
|
|
@@ -673,39 +653,26 @@ export namespace VerifyProfileUpdateParams {
|
|
|
673
653
|
default_verification_timeout_secs?: number;
|
|
674
654
|
|
|
675
655
|
/**
|
|
676
|
-
*
|
|
677
|
-
*/
|
|
678
|
-
messaging_template_id?: string;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Enabled country destinations to send verification codes. The elements in the
|
|
682
|
-
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
683
|
-
* destinations will be allowed.
|
|
656
|
+
* Phone number registered on the customer WABA to send OTPs from
|
|
684
657
|
*/
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
[k: string]: unknown;
|
|
688
|
-
}
|
|
658
|
+
sender_phone_number?: string | null;
|
|
689
659
|
|
|
690
|
-
export interface Whatsapp {
|
|
691
660
|
/**
|
|
692
|
-
*
|
|
693
|
-
* message.
|
|
661
|
+
* Customer pre-approved authentication template name registered on Meta
|
|
694
662
|
*/
|
|
695
|
-
|
|
663
|
+
template_id?: string | null;
|
|
696
664
|
|
|
697
665
|
/**
|
|
698
|
-
*
|
|
699
|
-
* number of seconds before a verification request code expires. Once the
|
|
700
|
-
* verification request expires, the user cannot use the code to verify their
|
|
701
|
-
* identity.
|
|
666
|
+
* Customer Meta WABA ID for Bring-Your-Own-WABA sending
|
|
702
667
|
*/
|
|
703
|
-
|
|
668
|
+
waba_id?: string | null;
|
|
704
669
|
|
|
705
670
|
/**
|
|
706
671
|
* Enabled country destinations to send verification codes. The elements in the
|
|
707
672
|
* list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all
|
|
708
|
-
* destinations will be allowed.
|
|
673
|
+
* destinations will be allowed. **Conditionally required:** this field must be
|
|
674
|
+
* provided when your organization is configured to require explicit whitelisted
|
|
675
|
+
* destinations; otherwise it is optional.
|
|
709
676
|
*/
|
|
710
677
|
whitelisted_destinations?: Array<string>;
|
|
711
678
|
|