@deepgram/sdk 4.6.0 → 4.8.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/README.md +4 -2
- package/dist/main/lib/errors.d.ts +33 -0
- package/dist/main/lib/errors.d.ts.map +1 -1
- package/dist/main/lib/errors.js +35 -1
- package/dist/main/lib/errors.js.map +1 -1
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +7 -10
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/types/AgentLiveSchema.d.ts +1 -1
- package/dist/main/lib/types/AgentLiveSchema.d.ts.map +1 -1
- package/dist/main/lib/types/CreateProjectKeySchema.d.ts +1 -1
- package/dist/main/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
- package/dist/main/lib/types/DeepgramClientOptions.d.ts +6 -6
- package/dist/main/lib/types/DeepgramClientOptions.d.ts.map +1 -1
- package/dist/main/lib/types/DeepgramResponse.d.ts +1 -1
- package/dist/main/lib/types/DeepgramResponse.d.ts.map +1 -1
- package/dist/main/lib/types/DeepgramSource.d.ts +4 -3
- package/dist/main/lib/types/DeepgramSource.d.ts.map +1 -1
- package/dist/main/lib/types/Fetch.d.ts +3 -3
- package/dist/main/lib/types/Fetch.d.ts.map +1 -1
- package/dist/main/lib/types/GetModelsResponse.d.ts +3 -3
- package/dist/main/lib/types/GetModelsResponse.d.ts.map +1 -1
- package/dist/main/lib/types/LiveConfigOptions.d.ts +1 -1
- package/dist/main/lib/types/LiveConfigOptions.d.ts.map +1 -1
- package/dist/main/lib/types/VoidResponse.d.ts +1 -1
- package/dist/main/lib/types/VoidResponse.d.ts.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/packages/AbstractLiveClient.d.ts +165 -2
- package/dist/main/packages/AbstractLiveClient.d.ts.map +1 -1
- package/dist/main/packages/AbstractLiveClient.js +162 -0
- package/dist/main/packages/AbstractLiveClient.js.map +1 -1
- package/dist/main/packages/AbstractRestClient.d.ts +1 -0
- package/dist/main/packages/AbstractRestClient.d.ts.map +1 -1
- package/dist/main/packages/AgentLiveClient.d.ts +9 -0
- package/dist/main/packages/AgentLiveClient.d.ts.map +1 -1
- package/dist/main/packages/AgentLiveClient.js +25 -10
- package/dist/main/packages/AgentLiveClient.js.map +1 -1
- package/dist/main/packages/ListenLiveClient.d.ts.map +1 -1
- package/dist/main/packages/ListenLiveClient.js +12 -9
- package/dist/main/packages/ListenLiveClient.js.map +1 -1
- package/dist/main/packages/ManageRestClient.js +1 -1
- package/dist/main/packages/ManageRestClient.js.map +1 -1
- package/dist/main/packages/SpeakLiveClient.d.ts +1 -0
- package/dist/main/packages/SpeakLiveClient.d.ts.map +1 -1
- package/dist/main/packages/SpeakLiveClient.js +15 -9
- package/dist/main/packages/SpeakLiveClient.js.map +1 -1
- package/dist/module/lib/errors.d.ts +33 -0
- package/dist/module/lib/errors.d.ts.map +1 -1
- package/dist/module/lib/errors.js +33 -0
- package/dist/module/lib/errors.js.map +1 -1
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js +7 -10
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/types/AgentLiveSchema.d.ts +1 -1
- package/dist/module/lib/types/AgentLiveSchema.d.ts.map +1 -1
- package/dist/module/lib/types/CreateProjectKeySchema.d.ts +1 -1
- package/dist/module/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
- package/dist/module/lib/types/DeepgramClientOptions.d.ts +6 -6
- package/dist/module/lib/types/DeepgramClientOptions.d.ts.map +1 -1
- package/dist/module/lib/types/DeepgramResponse.d.ts +1 -1
- package/dist/module/lib/types/DeepgramResponse.d.ts.map +1 -1
- package/dist/module/lib/types/DeepgramSource.d.ts +4 -3
- package/dist/module/lib/types/DeepgramSource.d.ts.map +1 -1
- package/dist/module/lib/types/Fetch.d.ts +3 -3
- package/dist/module/lib/types/Fetch.d.ts.map +1 -1
- package/dist/module/lib/types/GetModelsResponse.d.ts +3 -3
- package/dist/module/lib/types/GetModelsResponse.d.ts.map +1 -1
- package/dist/module/lib/types/LiveConfigOptions.d.ts +1 -1
- package/dist/module/lib/types/LiveConfigOptions.d.ts.map +1 -1
- package/dist/module/lib/types/VoidResponse.d.ts +1 -1
- package/dist/module/lib/types/VoidResponse.d.ts.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/packages/AbstractLiveClient.d.ts +165 -2
- package/dist/module/packages/AbstractLiveClient.d.ts.map +1 -1
- package/dist/module/packages/AbstractLiveClient.js +162 -0
- package/dist/module/packages/AbstractLiveClient.js.map +1 -1
- package/dist/module/packages/AbstractRestClient.d.ts +1 -0
- package/dist/module/packages/AbstractRestClient.d.ts.map +1 -1
- package/dist/module/packages/AgentLiveClient.d.ts +9 -0
- package/dist/module/packages/AgentLiveClient.d.ts.map +1 -1
- package/dist/module/packages/AgentLiveClient.js +25 -10
- package/dist/module/packages/AgentLiveClient.js.map +1 -1
- package/dist/module/packages/ListenLiveClient.d.ts.map +1 -1
- package/dist/module/packages/ListenLiveClient.js +12 -9
- package/dist/module/packages/ListenLiveClient.js.map +1 -1
- package/dist/module/packages/ManageRestClient.js +1 -1
- package/dist/module/packages/ManageRestClient.js.map +1 -1
- package/dist/module/packages/SpeakLiveClient.d.ts +1 -0
- package/dist/module/packages/SpeakLiveClient.d.ts.map +1 -1
- package/dist/module/packages/SpeakLiveClient.js +15 -9
- package/dist/module/packages/SpeakLiveClient.js.map +1 -1
- package/dist/umd/deepgram.js +2 -1
- package/dist/umd/deepgram.js.LICENSE.txt +10 -0
- package/package.json +21 -15
- package/src/lib/errors.ts +52 -0
- package/src/lib/helpers.ts +6 -10
- package/src/lib/version.ts +1 -1
- package/src/packages/AbstractLiveClient.ts +230 -0
- package/src/packages/AgentLiveClient.ts +27 -13
- package/src/packages/ListenLiveClient.ts +13 -12
- package/src/packages/ManageRestClient.ts +1 -1
- package/src/packages/SpeakLiveClient.ts +16 -12
|
@@ -35,4 +35,37 @@ export class DeepgramVersionError extends DeepgramError {
|
|
|
35
35
|
this.name = "DeepgramVersionError";
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Enhanced WebSocket error that captures additional debugging information
|
|
40
|
+
* including status codes, request IDs, and response headers when available.
|
|
41
|
+
*/
|
|
42
|
+
export class DeepgramWebSocketError extends DeepgramError {
|
|
43
|
+
constructor(message, options = {}) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.name = "DeepgramWebSocketError";
|
|
46
|
+
this.originalEvent = options.originalEvent;
|
|
47
|
+
this.statusCode = options.statusCode;
|
|
48
|
+
this.requestId = options.requestId;
|
|
49
|
+
this.responseHeaders = options.responseHeaders;
|
|
50
|
+
this.url = options.url;
|
|
51
|
+
this.readyState = options.readyState;
|
|
52
|
+
}
|
|
53
|
+
toJSON() {
|
|
54
|
+
return {
|
|
55
|
+
name: this.name,
|
|
56
|
+
message: this.message,
|
|
57
|
+
statusCode: this.statusCode,
|
|
58
|
+
requestId: this.requestId,
|
|
59
|
+
responseHeaders: this.responseHeaders,
|
|
60
|
+
url: this.url,
|
|
61
|
+
readyState: this.readyState,
|
|
62
|
+
originalEvent: this.originalEvent
|
|
63
|
+
? {
|
|
64
|
+
type: this.originalEvent.type,
|
|
65
|
+
timeStamp: this.originalEvent.timeStamp,
|
|
66
|
+
}
|
|
67
|
+
: undefined,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
38
71
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAc,SAAQ,KAAK;IAGtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,cAAS,GAAG,IAAI,CAAC;QAIzB,IAAI,CAAC,IAAI,GAAG,eAAe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,CAE9E;AAED,eAAO,MAAM,oBAAoB,eAAgB,qBAAqB,KAAG,qBA8DxE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Headers as CrossFetchHeaders } from "cross-fetch";
|
|
2
|
+
import { Readable } from "stream";
|
|
2
3
|
import merge from "deepmerge";
|
|
3
4
|
export function stripTrailingSlash(url) {
|
|
4
5
|
return url.replace(/\/$/, "");
|
|
@@ -26,12 +27,12 @@ export const resolveHeadersConstructor = () => {
|
|
|
26
27
|
return Headers;
|
|
27
28
|
};
|
|
28
29
|
export const isUrlSource = (providedSource) => {
|
|
29
|
-
if (providedSource.url)
|
|
30
|
+
if (providedSource && providedSource.url)
|
|
30
31
|
return true;
|
|
31
32
|
return false;
|
|
32
33
|
};
|
|
33
34
|
export const isTextSource = (providedSource) => {
|
|
34
|
-
if (providedSource.text)
|
|
35
|
+
if (providedSource && providedSource.text)
|
|
35
36
|
return true;
|
|
36
37
|
return false;
|
|
37
38
|
};
|
|
@@ -41,14 +42,10 @@ export const isFileSource = (providedSource) => {
|
|
|
41
42
|
return false;
|
|
42
43
|
};
|
|
43
44
|
const isBufferSource = (providedSource) => {
|
|
44
|
-
|
|
45
|
-
return true;
|
|
46
|
-
return false;
|
|
45
|
+
return providedSource != null && Buffer.isBuffer(providedSource);
|
|
47
46
|
};
|
|
48
47
|
const isReadStreamSource = (providedSource) => {
|
|
49
|
-
|
|
50
|
-
return true;
|
|
51
|
-
return false;
|
|
48
|
+
return providedSource != null && providedSource instanceof Readable;
|
|
52
49
|
};
|
|
53
50
|
export class CallbackUrl extends URL {
|
|
54
51
|
constructor() {
|
|
@@ -66,10 +63,10 @@ export const buildRequestUrl = (endpoint, baseUrl, transcriptionOptions) => {
|
|
|
66
63
|
return url;
|
|
67
64
|
};
|
|
68
65
|
export function isLiveSchema(arg) {
|
|
69
|
-
return arg && typeof arg.interim_results !== "undefined";
|
|
66
|
+
return arg != null && typeof arg.interim_results !== "undefined";
|
|
70
67
|
}
|
|
71
68
|
export function isDeepgramClientOptions(arg) {
|
|
72
|
-
return arg && typeof arg.global !== "undefined";
|
|
69
|
+
return arg != null && typeof arg.global !== "undefined";
|
|
73
70
|
}
|
|
74
71
|
export const convertLegacyOptions = (optionsArg) => {
|
|
75
72
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/helpers.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/helpers.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,MAAM,WAAW,CAAC;AAE9B,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,aAAa,CAAO,UAAsB,EAAE,EAAE,cAA0B,EAAE;IACxF,OAAO,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,YAA6B,EAC7B,OAAgC;IAEhC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACjC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAe,CAAC;YAC7C,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC5B,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,C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AO,EAAE;oBACP,KAAK,EAAE;wBACL,GAAG,EAAE,MAAA,UAAU,CAAC,SAAS,0CAAE,GAAG;qBAC/B;iBACF;aACF;SACF,CAAC;KACH;IAED,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3C,IAAI,MAAA,UAAU,CAAC,MAAM,0CAAE,GAAG,EAAE;QAC1B,UAAU,CAAC,MAAM,GAAG;YAClB,KAAK,EAAE;gBACL,OAAO,EAAE;oBACP,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG;iBAC3B;aACF;YACD,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG;iBAC3B;aACF;SACF,CAAC;KACH;IAED,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3C,IAAI,MAAA,UAAU,CAAC,MAAM,0CAAE,OAAO,EAAE;QAC9B,UAAU,CAAC,MAAM,GAAG;YAClB,KAAK,EAAE;gBACL,OAAO,EAAE;oBACP,OAAO,EAAE,MAAA,UAAU,CAAC,MAAM,0CAAE,OAAO;iBACpC;aACF;YACD,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,gBAAgB,EAAE,MAAA,UAAU,CAAC,MAAM,0CAAE,OAAO;iBAC7C;aACF;SACF,CAAC;KACH;IAED,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentLiveSchema.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/AgentLiveSchema.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"AgentLiveSchema.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/AgentLiveSchema.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,C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CAAC,CAAC;gBACrC,QAAQ,CAAC,EAAE;oBACT,GAAG,CAAC,EAAE,MAAM,CAAC;oBACb,MAAM,CAAC,EAAE,MAAM,CAAC;oBAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;iBAClC,CAAC;aACH,EAAE,CAAC;YACJ,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;SACjC,CAAC;QACF;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateProjectKeySchema.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/CreateProjectKeySchema.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CreateProjectKeySchema.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/CreateProjectKeySchema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEpE,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,UAAU,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fetch, FetchOptions } from "./Fetch";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type IKeyFactory = () => string;
|
|
3
|
+
export type IFetch = typeof fetch;
|
|
4
|
+
export type IWebSocket = typeof WebSocket;
|
|
5
5
|
interface TransportFetchOptions extends TransportOptions, FetchOptions {
|
|
6
6
|
}
|
|
7
7
|
interface TransportWebSocketOptions extends TransportOptions {
|
|
@@ -9,7 +9,7 @@ interface TransportWebSocketOptions extends TransportOptions {
|
|
|
9
9
|
[index: string]: any;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type TransportUrl = string;
|
|
13
13
|
interface TransportOptions {
|
|
14
14
|
url?: TransportUrl;
|
|
15
15
|
proxy?: {
|
|
@@ -20,7 +20,7 @@ interface ITransport<C, O> {
|
|
|
20
20
|
client?: C;
|
|
21
21
|
options?: O;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type DefaultNamespaceOptions = {
|
|
24
24
|
key?: string | IKeyFactory;
|
|
25
25
|
accessToken?: string | IKeyFactory;
|
|
26
26
|
fetch: {
|
|
@@ -40,7 +40,7 @@ export interface NamespaceOptions {
|
|
|
40
40
|
fetch?: ITransport<IFetch, TransportFetchOptions>;
|
|
41
41
|
websocket?: ITransport<IWebSocket, TransportWebSocketOptions>;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type DefaultClientOptions = {
|
|
44
44
|
global: Partial<DefaultNamespaceOptions>;
|
|
45
45
|
} & DeepgramClientOptions;
|
|
46
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepgramClientOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramClientOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"DeepgramClientOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramClientOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,CAA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B,CAAC,CAAC;CAC1C,GAAG,qBAAqB,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACnC,MAAM,CAAC,EAAE,gBAAgB,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE;YAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAA;KAAE,CAAC;IACjF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,wBAAwB,CAAC,EAAE,KAAK,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepgramResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"DeepgramResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;AAErE,UAAU,eAAe,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,EAAE,IAAI,CAAC;CACb;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;CACtB"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
3
4
|
import { Readable } from "stream";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
5
|
+
export type PrerecordedSource = UrlSource | Buffer | Readable;
|
|
6
|
+
export type FileSource = Buffer | Readable;
|
|
6
7
|
export interface UrlSource {
|
|
7
8
|
url: string;
|
|
8
9
|
}
|
|
9
10
|
export interface TextSource {
|
|
10
11
|
text: string;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
+
export type AnalyzeSource = UrlSource | TextSource;
|
|
13
14
|
//# sourceMappingURL=DeepgramSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepgramSource.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeepgramSource.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/DeepgramSource.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Fetch = typeof fetch;
|
|
2
|
+
export type FetchOptions = RequestInit & {
|
|
3
3
|
method?: RequestMethodType;
|
|
4
4
|
duplex?: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type RequestMethodType = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
7
7
|
//# sourceMappingURL=Fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/Fetch.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/Fetch.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC;AAEjC,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type Model = {
|
|
2
2
|
name: string;
|
|
3
3
|
canonical_name: string;
|
|
4
4
|
architecture: string;
|
|
@@ -15,8 +15,8 @@ declare type Model = {
|
|
|
15
15
|
sample: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type GetModelResponse = Model;
|
|
19
|
+
export type GetModelsResponse = {
|
|
20
20
|
stt: Model[];
|
|
21
21
|
tts: Model[];
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetModelsResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/GetModelsResponse.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"GetModelsResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/GetModelsResponse.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,KAAK,EAAE,CAAC;IACb,GAAG,EAAE,KAAK,EAAE,CAAC;CACd,CAAC"}
|
|
@@ -3,5 +3,5 @@ import { LiveSchema } from "./TranscriptionSchema";
|
|
|
3
3
|
* Partial configuration options for the LiveSchema, including:
|
|
4
4
|
* - `numerals`: Configures how numerals are handled in the live transcription.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type LiveConfigOptions = Partial<Pick<LiveSchema, "numerals">>;
|
|
7
7
|
//# sourceMappingURL=LiveConfigOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveConfigOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/LiveConfigOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"LiveConfigOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/LiveConfigOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoidResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/VoidResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"VoidResponse.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/VoidResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAE3D,UAAU,eAAe;IACvB,KAAK,EAAE,IAAI,CAAC;CACb;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "4.
|
|
1
|
+
export declare const version = "4.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "4.
|
|
1
|
+
export const version = "4.8.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -2,6 +2,7 @@ import { AbstractClient } from "./AbstractClient";
|
|
|
2
2
|
import { CONNECTION_STATE, SOCKET_STATES } from "../lib/constants";
|
|
3
3
|
import type { DeepgramClientOptions, LiveSchema } from "../lib/types";
|
|
4
4
|
import type { WebSocket as WSWebSocket } from "ws";
|
|
5
|
+
import { DeepgramWebSocketError } from "../lib/errors";
|
|
5
6
|
/**
|
|
6
7
|
* Represents a constructor for a WebSocket-like object that can be used in the application.
|
|
7
8
|
* The constructor takes the following parameters:
|
|
@@ -21,11 +22,11 @@ interface WebSocketLikeConstructor {
|
|
|
21
22
|
* such as the native WebSocket API, a WebSocket wrapper library, or a dummy implementation
|
|
22
23
|
* for testing purposes.
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
+
type WebSocketLike = WebSocket | WSWebSocket | WSWebSocketDummy;
|
|
25
26
|
/**
|
|
26
27
|
* Represents the types of data that can be sent or received over a WebSocket-like connection.
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
type SocketDataLike = string | ArrayBufferLike | Blob;
|
|
29
30
|
/**
|
|
30
31
|
* Represents an abstract live client that extends the AbstractClient class.
|
|
31
32
|
* The AbstractLiveClient class provides functionality for connecting, reconnecting, and disconnecting a WebSocket connection, as well as sending data over the connection.
|
|
@@ -89,6 +90,168 @@ export declare abstract class AbstractLiveClient extends AbstractClient {
|
|
|
89
90
|
* @returns {boolean} true if the current instance should proxy requests; otherwise, false
|
|
90
91
|
*/
|
|
91
92
|
get proxy(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Extracts enhanced error information from a WebSocket error event.
|
|
95
|
+
* This method attempts to capture additional debugging information such as
|
|
96
|
+
* status codes, request IDs, and response headers when available.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Enhanced error information is now available in error events:
|
|
101
|
+
* connection.on(LiveTranscriptionEvents.Error, (err) => {
|
|
102
|
+
* console.error("WebSocket Error:", err.message);
|
|
103
|
+
*
|
|
104
|
+
* // Access HTTP status code (e.g., 502, 403, etc.)
|
|
105
|
+
* if (err.statusCode) {
|
|
106
|
+
* console.error(`HTTP Status Code: ${err.statusCode}`);
|
|
107
|
+
* }
|
|
108
|
+
*
|
|
109
|
+
* // Access Deepgram request ID for support tickets
|
|
110
|
+
* if (err.requestId) {
|
|
111
|
+
* console.error(`Deepgram Request ID: ${err.requestId}`);
|
|
112
|
+
* }
|
|
113
|
+
*
|
|
114
|
+
* // Access WebSocket URL and connection state
|
|
115
|
+
* if (err.url) {
|
|
116
|
+
* console.error(`WebSocket URL: ${err.url}`);
|
|
117
|
+
* }
|
|
118
|
+
*
|
|
119
|
+
* if (err.readyState !== undefined) {
|
|
120
|
+
* const stateNames = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
|
121
|
+
* console.error(`Connection State: ${stateNames[err.readyState]}`);
|
|
122
|
+
* }
|
|
123
|
+
*
|
|
124
|
+
* // Access response headers for additional debugging
|
|
125
|
+
* if (err.responseHeaders) {
|
|
126
|
+
* console.error("Response Headers:", err.responseHeaders);
|
|
127
|
+
* }
|
|
128
|
+
*
|
|
129
|
+
* // Access the enhanced error object for detailed debugging
|
|
130
|
+
* if (err.error?.name === 'DeepgramWebSocketError') {
|
|
131
|
+
* console.error("Enhanced Error Details:", err.error.toJSON());
|
|
132
|
+
* }
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @param event - The error event from the WebSocket
|
|
137
|
+
* @param conn - The WebSocket connection object
|
|
138
|
+
* @returns Enhanced error information object
|
|
139
|
+
*/
|
|
140
|
+
protected extractErrorInformation(event: ErrorEvent | Event, conn?: WebSocketLike): {
|
|
141
|
+
statusCode?: number;
|
|
142
|
+
requestId?: string;
|
|
143
|
+
responseHeaders?: Record<string, string>;
|
|
144
|
+
url?: string;
|
|
145
|
+
readyState?: number;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Creates an enhanced error object with additional debugging information.
|
|
149
|
+
* This method provides backward compatibility by including both the original
|
|
150
|
+
* error event and enhanced error information.
|
|
151
|
+
*
|
|
152
|
+
* @param event - The original error event
|
|
153
|
+
* @param enhancedInfo - Additional error information extracted from the connection
|
|
154
|
+
* @returns An object containing both original and enhanced error information
|
|
155
|
+
*/
|
|
156
|
+
protected createEnhancedError(event: ErrorEvent | Event, enhancedInfo: {
|
|
157
|
+
statusCode?: number;
|
|
158
|
+
requestId?: string;
|
|
159
|
+
responseHeaders?: Record<string, string>;
|
|
160
|
+
url?: string;
|
|
161
|
+
readyState?: number;
|
|
162
|
+
}): {
|
|
163
|
+
error: DeepgramWebSocketError;
|
|
164
|
+
statusCode: number | undefined;
|
|
165
|
+
requestId: string | undefined;
|
|
166
|
+
responseHeaders: Record<string, string> | undefined;
|
|
167
|
+
url: string | undefined;
|
|
168
|
+
readyState: number | undefined;
|
|
169
|
+
message: string;
|
|
170
|
+
bubbles: boolean;
|
|
171
|
+
cancelBubble: boolean;
|
|
172
|
+
cancelable: boolean;
|
|
173
|
+
composed: boolean;
|
|
174
|
+
currentTarget: EventTarget | null;
|
|
175
|
+
defaultPrevented: boolean;
|
|
176
|
+
eventPhase: number;
|
|
177
|
+
isTrusted: boolean;
|
|
178
|
+
returnValue: boolean;
|
|
179
|
+
srcElement: EventTarget | null;
|
|
180
|
+
target: EventTarget | null;
|
|
181
|
+
timeStamp: number;
|
|
182
|
+
type: string;
|
|
183
|
+
composedPath(): EventTarget[];
|
|
184
|
+
initEvent(type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void;
|
|
185
|
+
preventDefault(): void;
|
|
186
|
+
stopImmediatePropagation(): void;
|
|
187
|
+
stopPropagation(): void;
|
|
188
|
+
AT_TARGET: number;
|
|
189
|
+
BUBBLING_PHASE: number;
|
|
190
|
+
CAPTURING_PHASE: number;
|
|
191
|
+
NONE: number;
|
|
192
|
+
} | {
|
|
193
|
+
error: DeepgramWebSocketError;
|
|
194
|
+
statusCode: number | undefined;
|
|
195
|
+
requestId: string | undefined;
|
|
196
|
+
responseHeaders: Record<string, string> | undefined;
|
|
197
|
+
url: string | undefined;
|
|
198
|
+
readyState: number | undefined;
|
|
199
|
+
message: string;
|
|
200
|
+
colno: number;
|
|
201
|
+
filename: string;
|
|
202
|
+
lineno: number;
|
|
203
|
+
bubbles: boolean;
|
|
204
|
+
cancelBubble: boolean;
|
|
205
|
+
cancelable: boolean;
|
|
206
|
+
composed: boolean;
|
|
207
|
+
currentTarget: EventTarget | null;
|
|
208
|
+
defaultPrevented: boolean;
|
|
209
|
+
eventPhase: number;
|
|
210
|
+
isTrusted: boolean;
|
|
211
|
+
returnValue: boolean;
|
|
212
|
+
srcElement: EventTarget | null;
|
|
213
|
+
target: EventTarget | null;
|
|
214
|
+
timeStamp: number;
|
|
215
|
+
type: string;
|
|
216
|
+
composedPath(): EventTarget[];
|
|
217
|
+
initEvent(type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void;
|
|
218
|
+
preventDefault(): void;
|
|
219
|
+
stopImmediatePropagation(): void;
|
|
220
|
+
stopPropagation(): void;
|
|
221
|
+
AT_TARGET: number;
|
|
222
|
+
BUBBLING_PHASE: number;
|
|
223
|
+
CAPTURING_PHASE: number;
|
|
224
|
+
NONE: number;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Builds an enhanced error message with additional context information.
|
|
228
|
+
*
|
|
229
|
+
* @param event - The original error event
|
|
230
|
+
* @param enhancedInfo - Additional error information
|
|
231
|
+
* @returns A more descriptive error message
|
|
232
|
+
*/
|
|
233
|
+
protected buildEnhancedErrorMessage(event: ErrorEvent | Event, enhancedInfo: {
|
|
234
|
+
statusCode?: number;
|
|
235
|
+
requestId?: string;
|
|
236
|
+
responseHeaders?: Record<string, string>;
|
|
237
|
+
url?: string;
|
|
238
|
+
readyState?: number;
|
|
239
|
+
}): string;
|
|
240
|
+
/**
|
|
241
|
+
* Sets up the standard connection event handlers (open, close, error) for WebSocket connections.
|
|
242
|
+
* This method abstracts the common connection event registration pattern used across all live clients.
|
|
243
|
+
*
|
|
244
|
+
* @param events - Object containing the event constants for the specific client type
|
|
245
|
+
* @param events.Open - Event constant for connection open
|
|
246
|
+
* @param events.Close - Event constant for connection close
|
|
247
|
+
* @param events.Error - Event constant for connection error
|
|
248
|
+
* @protected
|
|
249
|
+
*/
|
|
250
|
+
protected setupConnectionEvents(events: {
|
|
251
|
+
Open: string;
|
|
252
|
+
Close: string;
|
|
253
|
+
Error: string;
|
|
254
|
+
}): void;
|
|
92
255
|
/**
|
|
93
256
|
* Sets up the connection event handlers.
|
|
94
257
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLiveClient.d.ts","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AbstractLiveClient.d.ts","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;GAOG;AACH,UAAU,wBAAwB;IAChC,KACE,OAAO,EAAE,MAAM,GAAG,GAAG,EACrB,QAAQ,CAAC,EAAE,GAAG,EACd,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACxC,aAAa,CAAC;CAClB;AAED;;;;;GAKG;AACH,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAEhE;;GAEG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;AAmBtD;;;;;;GAMG;AACH,8BAAsB,kBAAmB,SAAQ,cAAc;IACtD,OAAO,EAAE;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