telnyx 6.71.0 → 6.73.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 +16 -0
- package/client.d.mts +14 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -8
- package/client.d.ts.map +1 -1
- package/client.js +12 -6
- package/client.js.map +1 -1
- package/client.mjs +12 -6
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +1 -1
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +1 -1
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +2 -2
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +2 -2
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/sip-registration-status.d.mts +91 -0
- package/resources/sip-registration-status.d.mts.map +1 -0
- package/resources/sip-registration-status.d.ts +91 -0
- package/resources/sip-registration-status.d.ts.map +1 -0
- package/resources/sip-registration-status.js +20 -0
- package/resources/sip-registration-status.js.map +1 -0
- package/resources/sip-registration-status.mjs +16 -0
- package/resources/sip-registration-status.mjs.map +1 -0
- package/resources/speech-to-text/index.d.mts +3 -3
- package/resources/speech-to-text/index.d.mts.map +1 -1
- package/resources/speech-to-text/index.d.ts +3 -3
- package/resources/speech-to-text/index.d.ts.map +1 -1
- package/resources/speech-to-text/index.js +1 -5
- package/resources/speech-to-text/index.js.map +1 -1
- package/resources/speech-to-text/index.mjs +0 -2
- package/resources/speech-to-text/index.mjs.map +1 -1
- package/resources/speech-to-text/internal-base.d.mts +42 -11
- package/resources/speech-to-text/internal-base.d.mts.map +1 -1
- package/resources/speech-to-text/internal-base.d.ts +42 -11
- package/resources/speech-to-text/internal-base.d.ts.map +1 -1
- package/resources/speech-to-text/internal-base.js +5 -9
- package/resources/speech-to-text/internal-base.js.map +1 -1
- package/resources/speech-to-text/internal-base.mjs +5 -9
- package/resources/speech-to-text/internal-base.mjs.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts +79 -100
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +79 -100
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text/speech-to-text.js +16 -19
- package/resources/speech-to-text/speech-to-text.js.map +1 -1
- package/resources/speech-to-text/speech-to-text.mjs +16 -19
- package/resources/speech-to-text/speech-to-text.mjs.map +1 -1
- package/resources/speech-to-text/ws-base.d.mts +106 -0
- package/resources/speech-to-text/ws-base.d.mts.map +1 -0
- package/resources/speech-to-text/ws-base.d.ts +106 -0
- package/resources/speech-to-text/ws-base.d.ts.map +1 -0
- package/resources/speech-to-text/ws-base.js +476 -0
- package/resources/speech-to-text/ws-base.js.map +1 -0
- package/resources/speech-to-text/ws-base.mjs +472 -0
- package/resources/speech-to-text/ws-base.mjs.map +1 -0
- package/resources/speech-to-text/ws.d.mts +9 -28
- package/resources/speech-to-text/ws.d.mts.map +1 -1
- package/resources/speech-to-text/ws.d.ts +9 -28
- package/resources/speech-to-text/ws.d.ts.map +1 -1
- package/resources/speech-to-text/ws.js +17 -97
- package/resources/speech-to-text/ws.js.map +1 -1
- package/resources/speech-to-text/ws.mjs +17 -97
- package/resources/speech-to-text/ws.mjs.map +1 -1
- package/resources/speech-to-text.d.mts +1 -80
- package/resources/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text.d.ts +1 -80
- package/resources/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text.js +2 -32
- package/resources/speech-to-text.js.map +1 -1
- package/resources/speech-to-text.mjs +1 -30
- package/resources/speech-to-text.mjs.map +1 -1
- package/resources/texml/accounts/calls/calls.d.mts +31 -465
- package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.ts +31 -465
- package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.js +7 -1
- package/resources/texml/accounts/calls/calls.js.map +1 -1
- package/resources/texml/accounts/calls/calls.mjs +7 -1
- package/resources/texml/accounts/calls/calls.mjs.map +1 -1
- package/resources/text-to-speech/index.d.mts +1 -1
- package/resources/text-to-speech/index.d.mts.map +1 -1
- package/resources/text-to-speech/index.d.ts +1 -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/text-to-speech.d.mts +79 -13
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +79 -13
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/text-to-speech/text-to-speech.js +33 -1
- package/resources/text-to-speech/text-to-speech.js.map +1 -1
- package/resources/text-to-speech/text-to-speech.mjs +33 -1
- package/resources/text-to-speech/text-to-speech.mjs.map +1 -1
- package/src/client.ts +42 -20
- package/src/resources/ai/ai.ts +3 -3
- package/src/resources/index.ts +10 -2
- package/src/resources/sip-registration-status.ts +123 -0
- package/src/resources/speech-to-text/index.ts +6 -9
- package/src/resources/speech-to-text/internal-base.ts +49 -22
- package/src/resources/speech-to-text/speech-to-text.ts +102 -128
- package/src/resources/speech-to-text/ws-base.ts +619 -0
- package/src/resources/speech-to-text/ws.ts +26 -111
- package/src/resources/speech-to-text.ts +1 -112
- package/src/resources/texml/accounts/calls/calls.ts +36 -564
- package/src/resources/text-to-speech/index.ts +3 -2
- package/src/resources/text-to-speech/text-to-speech.ts +100 -16
- 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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Look up SIP registration status across credential types
|
|
6
|
+
*/
|
|
7
|
+
export declare class SipRegistrationStatus extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the live SIP registration state of a connection or credential. Supports
|
|
10
|
+
* UAC third-party credentials, telephony credentials, and SIP credential
|
|
11
|
+
* connections.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(query: SipRegistrationStatusRetrieveParams, options?: RequestOptions): APIPromise<SipRegistrationStatusRetrieveResponse>;
|
|
14
|
+
}
|
|
15
|
+
export interface SipRegistrationStatusRetrieveResponse {
|
|
16
|
+
/**
|
|
17
|
+
* Identifier of the resource.
|
|
18
|
+
*/
|
|
19
|
+
connection_id?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable connection name.
|
|
22
|
+
*/
|
|
23
|
+
connection_name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Outward-facing SIP settings used for registration. Password is redacted.
|
|
26
|
+
*/
|
|
27
|
+
external_uac_settings?: SipRegistrationStatusRetrieveResponse.ExternalUacSettings;
|
|
28
|
+
/**
|
|
29
|
+
* Internal routing target the connection delivers calls to.
|
|
30
|
+
*/
|
|
31
|
+
internal_uac_settings?: SipRegistrationStatusRetrieveResponse.InternalUacSettings;
|
|
32
|
+
/**
|
|
33
|
+
* SIP response from the last registration attempt.
|
|
34
|
+
*/
|
|
35
|
+
last_registration_response?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Internal pairing state, e.g. ACTIVE or INACTIVE.
|
|
38
|
+
*/
|
|
39
|
+
pair_state?: string;
|
|
40
|
+
/**
|
|
41
|
+
* True if the endpoint is currently registered.
|
|
42
|
+
*/
|
|
43
|
+
registered?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Owner of the resource.
|
|
46
|
+
*/
|
|
47
|
+
user_id?: string;
|
|
48
|
+
/**
|
|
49
|
+
* SIP username used for the registration.
|
|
50
|
+
*/
|
|
51
|
+
username?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare namespace SipRegistrationStatusRetrieveResponse {
|
|
54
|
+
/**
|
|
55
|
+
* Outward-facing SIP settings used for registration. Password is redacted.
|
|
56
|
+
*/
|
|
57
|
+
interface ExternalUacSettings {
|
|
58
|
+
auth_username?: string;
|
|
59
|
+
expiration_sec?: number;
|
|
60
|
+
from_user?: string;
|
|
61
|
+
outbound_proxy?: string;
|
|
62
|
+
password?: string;
|
|
63
|
+
proxy?: string;
|
|
64
|
+
transport?: 'TCP' | 'UDP' | 'TLS';
|
|
65
|
+
username?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Internal routing target the connection delivers calls to.
|
|
69
|
+
*/
|
|
70
|
+
interface InternalUacSettings {
|
|
71
|
+
destination_uri?: string;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export interface SipRegistrationStatusRetrieveParams {
|
|
75
|
+
/**
|
|
76
|
+
* Identifier of the connection or credential to look up.
|
|
77
|
+
*/
|
|
78
|
+
connection_id: string;
|
|
79
|
+
/**
|
|
80
|
+
* The kind of credential to look up.
|
|
81
|
+
*/
|
|
82
|
+
credential_type: 'uac_external_credential' | 'telephony_credential' | 'sip_credential_connection';
|
|
83
|
+
/**
|
|
84
|
+
* Owner of the connection. Used to authorize the lookup.
|
|
85
|
+
*/
|
|
86
|
+
user_id: string;
|
|
87
|
+
}
|
|
88
|
+
export declare namespace SipRegistrationStatus {
|
|
89
|
+
export { type SipRegistrationStatusRetrieveResponse as SipRegistrationStatusRetrieveResponse, type SipRegistrationStatusRetrieveParams as SipRegistrationStatusRetrieveParams, };
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=sip-registration-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sip-registration-status.d.ts","sourceRoot":"","sources":["../src/resources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UAAiB,mBAAmB;QAClC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,EAAE,yBAAyB,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;IAElG;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;CACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SipRegistrationStatus = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Look up SIP registration status across credential types
|
|
8
|
+
*/
|
|
9
|
+
class SipRegistrationStatus extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the live SIP registration state of a connection or credential. Supports
|
|
12
|
+
* UAC third-party credentials, telephony credentials, and SIP credential
|
|
13
|
+
* connections.
|
|
14
|
+
*/
|
|
15
|
+
retrieve(query, options) {
|
|
16
|
+
return this._client.get('/sip_registration_status', { query, ...options });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.SipRegistrationStatus = SipRegistrationStatus;
|
|
20
|
+
//# sourceMappingURL=sip-registration-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sip-registration-status.js","sourceRoot":"","sources":["../src/resources/sip-registration-status.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,sBAAW;IACpD;;;;OAIG;IACH,QAAQ,CACN,KAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAZD,sDAYC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Look up SIP registration status across credential types
|
|
5
|
+
*/
|
|
6
|
+
export class SipRegistrationStatus extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the live SIP registration state of a connection or credential. Supports
|
|
9
|
+
* UAC third-party credentials, telephony credentials, and SIP credential
|
|
10
|
+
* connections.
|
|
11
|
+
*/
|
|
12
|
+
retrieve(query, options) {
|
|
13
|
+
return this._client.get('/sip_registration_status', { query, ...options });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sip-registration-status.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sip-registration-status.mjs","sourceRoot":"","sources":["../src/resources/sip-registration-status.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD;;;;OAIG;IACH,QAAQ,CACN,KAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SpeechToText, type
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { SpeechToText, type SpeechToTextListProvidersResponse, type TranscribeClientEvent, type TranscribeServerEvent, type SpeechToTextListProvidersParams, } from "./speech-to-text.mjs";
|
|
2
|
+
export { type SpeechToTextWSClientOptions } from "./ws.mjs";
|
|
3
|
+
export { type SpeechToTextWSReconnectOptions } from "./ws-base.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,6BAAyB;AAC1B,OAAO,EAAE,KAAK,2BAA2B,EAAE,iBAAa;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,sBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SpeechToText, type
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { SpeechToText, type SpeechToTextListProvidersResponse, type TranscribeClientEvent, type TranscribeServerEvent, type SpeechToTextListProvidersParams, } from "./speech-to-text.js";
|
|
2
|
+
export { type SpeechToTextWSClientOptions } from "./ws.js";
|
|
3
|
+
export { type SpeechToTextWSReconnectOptions } from "./ws-base.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,4BAAyB;AAC1B,OAAO,EAAE,KAAK,2BAA2B,EAAE,gBAAa;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,qBAAkB"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SpeechToText = void 0;
|
|
5
5
|
var speech_to_text_1 = require("./speech-to-text.js");
|
|
6
6
|
Object.defineProperty(exports, "SpeechToText", { enumerable: true, get: function () { return speech_to_text_1.SpeechToText; } });
|
|
7
|
-
var ws_1 = require("./ws.js");
|
|
8
|
-
Object.defineProperty(exports, "SpeechToTextWS", { enumerable: true, get: function () { return ws_1.SpeechToTextWS; } });
|
|
9
|
-
var internal_base_1 = require("./internal-base.js");
|
|
10
|
-
Object.defineProperty(exports, "WebSocketError", { enumerable: true, get: function () { return internal_base_1.WebSocketError; } });
|
|
11
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAM0B;AALxB,8GAAA,YAAY,OAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { SpeechToText, } from "./speech-to-text.mjs";
|
|
3
|
-
export { SpeechToTextWS } from "./ws.mjs";
|
|
4
|
-
export { WebSocketError } from "./internal-base.mjs";
|
|
5
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,YAAY,GAKb,6BAAyB"}
|
|
@@ -2,39 +2,70 @@ import * as SpeechToTextAPI from "./speech-to-text.mjs";
|
|
|
2
2
|
import { Telnyx } from "../../client.mjs";
|
|
3
3
|
import { EventEmitter } from "../../core/EventEmitter.mjs";
|
|
4
4
|
import { TelnyxError } from "../../core/error.mjs";
|
|
5
|
+
import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from "../../internal/ws.mjs";
|
|
6
|
+
export type SpeechToTextStreamMessage = {
|
|
7
|
+
type: 'connecting' | 'open' | 'closing';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'close';
|
|
10
|
+
code: number;
|
|
11
|
+
reason: string;
|
|
12
|
+
unsent: UnsentMessage<SpeechToTextAPI.TranscribeClientEvent>[];
|
|
13
|
+
} | {
|
|
14
|
+
type: 'reconnecting';
|
|
15
|
+
reconnect: ReconnectingEvent;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'reconnected';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'message';
|
|
20
|
+
message: SpeechToTextAPI.TranscribeServerEvent;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'raw';
|
|
23
|
+
data: RawWebSocketData;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'error';
|
|
26
|
+
error: WebSocketError;
|
|
27
|
+
};
|
|
5
28
|
export declare class WebSocketError extends TelnyxError {
|
|
6
29
|
/**
|
|
7
30
|
* The error data that the API sent back in an error event.
|
|
8
31
|
*/
|
|
9
|
-
error?: SpeechToTextAPI.
|
|
10
|
-
constructor(message: string, event: SpeechToTextAPI.
|
|
32
|
+
error?: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame | undefined;
|
|
33
|
+
constructor(message: string, event: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame | null);
|
|
11
34
|
}
|
|
12
35
|
type Simplify<T> = {
|
|
13
36
|
[KeyType in keyof T]: T[KeyType];
|
|
14
37
|
} & {};
|
|
15
|
-
type
|
|
16
|
-
event: (event: SpeechToTextAPI.
|
|
38
|
+
type WebSocketEvents = Simplify<{
|
|
39
|
+
event: (event: SpeechToTextAPI.TranscribeServerEvent) => void;
|
|
40
|
+
raw: (data: RawWebSocketData) => void;
|
|
17
41
|
error: (error: WebSocketError) => void;
|
|
42
|
+
close: (code: number, reason: string, unsent: UnsentMessage<SpeechToTextAPI.TranscribeClientEvent>[]) => void;
|
|
43
|
+
reconnecting: (event: ReconnectingEvent) => void;
|
|
44
|
+
reconnected: () => void;
|
|
18
45
|
} & {
|
|
19
|
-
[EventType in Exclude<NonNullable<SpeechToTextAPI.
|
|
46
|
+
[EventType in Exclude<NonNullable<SpeechToTextAPI.TranscribeServerEvent['type']>, 'error'>]: (event: Extract<SpeechToTextAPI.TranscribeServerEvent, {
|
|
20
47
|
type?: EventType;
|
|
21
48
|
}>) => unknown;
|
|
22
49
|
}>;
|
|
23
|
-
export declare abstract class SpeechToTextEmitter extends EventEmitter<
|
|
50
|
+
export declare abstract class SpeechToTextEmitter extends EventEmitter<WebSocketEvents> {
|
|
24
51
|
/**
|
|
25
|
-
* Send
|
|
52
|
+
* Send an event to the API.
|
|
26
53
|
*/
|
|
27
|
-
abstract send(
|
|
54
|
+
abstract send(event: SpeechToTextAPI.TranscribeClientEvent): void;
|
|
28
55
|
/**
|
|
29
|
-
*
|
|
56
|
+
* Send raw data over the WebSocket without JSON serialization.
|
|
57
|
+
*/
|
|
58
|
+
abstract sendRaw(data: RawWebSocketData): void;
|
|
59
|
+
/**
|
|
60
|
+
* Close the WebSocket connection.
|
|
30
61
|
*/
|
|
31
62
|
abstract close(props?: {
|
|
32
63
|
code: number;
|
|
33
64
|
reason: string;
|
|
34
65
|
}): void;
|
|
35
66
|
protected _onError(event: null, message: string, cause: any): void;
|
|
36
|
-
protected _onError(event: SpeechToTextAPI.
|
|
67
|
+
protected _onError(event: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame, message?: string | undefined): void;
|
|
37
68
|
}
|
|
38
|
-
export declare function buildURL(client: Telnyx,
|
|
69
|
+
export declare function buildURL(client: Telnyx, parameters: Record<string, unknown>): URL;
|
|
39
70
|
export {};
|
|
40
71
|
//# sourceMappingURL=internal-base.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-base.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,6BAAyB;AACpD,OAAO,EAAE,MAAM,EAAE,yBAAqB;
|
|
1
|
+
{"version":3,"file":"internal-base.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,6BAAyB;AACpD,OAAO,EAAE,MAAM,EAAE,yBAAqB;AACtC,OAAO,EAAE,YAAY,EAAE,oCAAgC;AACvD,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,8BAA0B;AAE5F,MAAM,MAAM,yBAAyB,GACjC;IAAE,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,GAC3C;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,EAAE,CAAC;CAChE,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;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AAE,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,KACxE,OAAO;CACb,CACF,CAAC;AAEF,8BAAsB,mBAAoB,SAAQ,YAAY,CAAC,eAAe,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,qBAAqB,GAAG,IAAI;IAEjE;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAE9C;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAE9D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAClE,SAAS,CAAC,QAAQ,CAChB,KAAK,EAAE,eAAe,CAAC,qBAAqB,CAAC,aAAa,EAC1D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAC3B,IAAI;CA0BR;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAMjF"}
|
|
@@ -2,39 +2,70 @@ import * as SpeechToTextAPI from "./speech-to-text.js";
|
|
|
2
2
|
import { Telnyx } from "../../client.js";
|
|
3
3
|
import { EventEmitter } from "../../core/EventEmitter.js";
|
|
4
4
|
import { TelnyxError } from "../../core/error.js";
|
|
5
|
+
import type { RawWebSocketData, ReconnectingEvent, UnsentMessage } from "../../internal/ws.js";
|
|
6
|
+
export type SpeechToTextStreamMessage = {
|
|
7
|
+
type: 'connecting' | 'open' | 'closing';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'close';
|
|
10
|
+
code: number;
|
|
11
|
+
reason: string;
|
|
12
|
+
unsent: UnsentMessage<SpeechToTextAPI.TranscribeClientEvent>[];
|
|
13
|
+
} | {
|
|
14
|
+
type: 'reconnecting';
|
|
15
|
+
reconnect: ReconnectingEvent;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'reconnected';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'message';
|
|
20
|
+
message: SpeechToTextAPI.TranscribeServerEvent;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'raw';
|
|
23
|
+
data: RawWebSocketData;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'error';
|
|
26
|
+
error: WebSocketError;
|
|
27
|
+
};
|
|
5
28
|
export declare class WebSocketError extends TelnyxError {
|
|
6
29
|
/**
|
|
7
30
|
* The error data that the API sent back in an error event.
|
|
8
31
|
*/
|
|
9
|
-
error?: SpeechToTextAPI.
|
|
10
|
-
constructor(message: string, event: SpeechToTextAPI.
|
|
32
|
+
error?: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame | undefined;
|
|
33
|
+
constructor(message: string, event: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame | null);
|
|
11
34
|
}
|
|
12
35
|
type Simplify<T> = {
|
|
13
36
|
[KeyType in keyof T]: T[KeyType];
|
|
14
37
|
} & {};
|
|
15
|
-
type
|
|
16
|
-
event: (event: SpeechToTextAPI.
|
|
38
|
+
type WebSocketEvents = Simplify<{
|
|
39
|
+
event: (event: SpeechToTextAPI.TranscribeServerEvent) => void;
|
|
40
|
+
raw: (data: RawWebSocketData) => void;
|
|
17
41
|
error: (error: WebSocketError) => void;
|
|
42
|
+
close: (code: number, reason: string, unsent: UnsentMessage<SpeechToTextAPI.TranscribeClientEvent>[]) => void;
|
|
43
|
+
reconnecting: (event: ReconnectingEvent) => void;
|
|
44
|
+
reconnected: () => void;
|
|
18
45
|
} & {
|
|
19
|
-
[EventType in Exclude<NonNullable<SpeechToTextAPI.
|
|
46
|
+
[EventType in Exclude<NonNullable<SpeechToTextAPI.TranscribeServerEvent['type']>, 'error'>]: (event: Extract<SpeechToTextAPI.TranscribeServerEvent, {
|
|
20
47
|
type?: EventType;
|
|
21
48
|
}>) => unknown;
|
|
22
49
|
}>;
|
|
23
|
-
export declare abstract class SpeechToTextEmitter extends EventEmitter<
|
|
50
|
+
export declare abstract class SpeechToTextEmitter extends EventEmitter<WebSocketEvents> {
|
|
24
51
|
/**
|
|
25
|
-
* Send
|
|
52
|
+
* Send an event to the API.
|
|
26
53
|
*/
|
|
27
|
-
abstract send(
|
|
54
|
+
abstract send(event: SpeechToTextAPI.TranscribeClientEvent): void;
|
|
28
55
|
/**
|
|
29
|
-
*
|
|
56
|
+
* Send raw data over the WebSocket without JSON serialization.
|
|
57
|
+
*/
|
|
58
|
+
abstract sendRaw(data: RawWebSocketData): void;
|
|
59
|
+
/**
|
|
60
|
+
* Close the WebSocket connection.
|
|
30
61
|
*/
|
|
31
62
|
abstract close(props?: {
|
|
32
63
|
code: number;
|
|
33
64
|
reason: string;
|
|
34
65
|
}): void;
|
|
35
66
|
protected _onError(event: null, message: string, cause: any): void;
|
|
36
|
-
protected _onError(event: SpeechToTextAPI.
|
|
67
|
+
protected _onError(event: SpeechToTextAPI.TranscribeServerEvent.SttErrorFrame, message?: string | undefined): void;
|
|
37
68
|
}
|
|
38
|
-
export declare function buildURL(client: Telnyx,
|
|
69
|
+
export declare function buildURL(client: Telnyx, parameters: Record<string, unknown>): URL;
|
|
39
70
|
export {};
|
|
40
71
|
//# sourceMappingURL=internal-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-base.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,4BAAyB;AACpD,OAAO,EAAE,MAAM,EAAE,wBAAqB;
|
|
1
|
+
{"version":3,"file":"internal-base.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,4BAAyB;AACpD,OAAO,EAAE,MAAM,EAAE,wBAAqB;AACtC,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,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAMjF"}
|
|
@@ -5,7 +5,6 @@ exports.SpeechToTextEmitter = exports.WebSocketError = void 0;
|
|
|
5
5
|
exports.buildURL = buildURL;
|
|
6
6
|
const EventEmitter_1 = require("../../core/EventEmitter.js");
|
|
7
7
|
const error_1 = require("../../core/error.js");
|
|
8
|
-
const utils_1 = require("../../internal/utils.js");
|
|
9
8
|
class WebSocketError extends error_1.TelnyxError {
|
|
10
9
|
constructor(message, event) {
|
|
11
10
|
super(message);
|
|
@@ -31,14 +30,11 @@ class SpeechToTextEmitter extends EventEmitter_1.EventEmitter {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
exports.SpeechToTextEmitter = SpeechToTextEmitter;
|
|
34
|
-
function buildURL(client,
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const url = new URL(
|
|
38
|
-
|
|
39
|
-
url.search = (0, utils_1.stringifyQuery)(query);
|
|
40
|
-
}
|
|
41
|
-
url.protocol = 'wss';
|
|
33
|
+
function buildURL(client, parameters) {
|
|
34
|
+
const { ...query } = parameters;
|
|
35
|
+
const endpoint = '/speech-to-text/transcription';
|
|
36
|
+
const url = new URL(client.buildURL(endpoint, query, undefined));
|
|
37
|
+
url.protocol = url.protocol === 'http:' || url.protocol === 'ws:' ? 'ws:' : 'wss:';
|
|
42
38
|
return url;
|
|
43
39
|
}
|
|
44
40
|
function safeJSONStringify(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-base.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;
|
|
1
|
+
{"version":3,"file":"internal-base.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAyGtF,4BAMC;AA3GD,6DAAuD;AACvD,+CAA+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AK,CAAC,CAAC,CAAC,MAAM,CAAC;IACnF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { EventEmitter } from "../../core/EventEmitter.mjs";
|
|
3
3
|
import { TelnyxError } from "../../core/error.mjs";
|
|
4
|
-
import { stringifyQuery } from "../../internal/utils.mjs";
|
|
5
4
|
export class WebSocketError extends TelnyxError {
|
|
6
5
|
constructor(message, event) {
|
|
7
6
|
super(message);
|
|
@@ -25,14 +24,11 @@ export class SpeechToTextEmitter extends EventEmitter {
|
|
|
25
24
|
this._emit('error', error);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
|
-
export function buildURL(client,
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const url = new URL(
|
|
32
|
-
|
|
33
|
-
url.search = stringifyQuery(query);
|
|
34
|
-
}
|
|
35
|
-
url.protocol = 'wss';
|
|
27
|
+
export function buildURL(client, parameters) {
|
|
28
|
+
const { ...query } = parameters;
|
|
29
|
+
const endpoint = '/speech-to-text/transcription';
|
|
30
|
+
const url = new URL(client.buildURL(endpoint, query, undefined));
|
|
31
|
+
url.protocol = url.protocol === 'http:' || url.protocol === 'ws:' ? 'ws:' : 'wss:';
|
|
36
32
|
return url;
|
|
37
33
|
}
|
|
38
34
|
function safeJSONStringify(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-base.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/internal-base.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"internal-base.mjs","sourceRoot":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