@corti/sdk 1.0.0-rc.6 → 1.0.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/stream/client/Socket.d.ts +1 -1
- package/dist/cjs/api/resources/transcribe/client/Socket.d.ts +1 -1
- package/dist/cjs/api/types/StreamConfigStatusMessageType.d.ts +0 -1
- package/dist/cjs/api/types/StreamConfigStatusMessageType.js +0 -1
- package/dist/cjs/api/types/StreamDeltaUsageMessage.d.ts +5 -0
- package/dist/cjs/api/types/StreamDeltaUsageMessage.js +3 -0
- package/dist/cjs/api/types/TranscribeConfigStatusMessageType.d.ts +2 -0
- package/dist/cjs/api/types/TranscribeConfigStatusMessageType.js +2 -0
- package/dist/cjs/api/types/TranscribeDeltaUsageMessage.d.ts +5 -0
- package/dist/cjs/api/types/TranscribeDeltaUsageMessage.js +3 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/custom/stream/CustomStream.js +5 -3
- package/dist/cjs/custom/transcribe/CustomTranscribe.js +6 -2
- package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.d.ts +3 -2
- package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.js +2 -0
- package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.ts +3 -2
- package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.js +2 -0
- package/dist/cjs/serialization/types/StreamConfigStatusMessageType.d.ts +1 -1
- package/dist/cjs/serialization/types/StreamConfigStatusMessageType.js +0 -1
- package/dist/cjs/serialization/types/StreamDeltaUsageMessage.d.ts +10 -0
- package/dist/cjs/serialization/types/StreamDeltaUsageMessage.js +42 -0
- package/dist/cjs/serialization/types/TranscribeConfigStatusMessageType.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeConfigStatusMessageType.js +7 -1
- package/dist/cjs/serialization/types/TranscribeDeltaUsageMessage.d.ts +10 -0
- package/dist/cjs/serialization/types/TranscribeDeltaUsageMessage.js +42 -0
- package/dist/cjs/serialization/types/index.d.ts +2 -0
- package/dist/cjs/serialization/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/stream/client/Socket.d.mts +1 -1
- package/dist/esm/api/resources/transcribe/client/Socket.d.mts +1 -1
- package/dist/esm/api/types/StreamConfigStatusMessageType.d.mts +0 -1
- package/dist/esm/api/types/StreamConfigStatusMessageType.mjs +0 -1
- package/dist/esm/api/types/StreamDeltaUsageMessage.d.mts +5 -0
- package/dist/esm/api/types/StreamDeltaUsageMessage.mjs +2 -0
- package/dist/esm/api/types/TranscribeConfigStatusMessageType.d.mts +2 -0
- package/dist/esm/api/types/TranscribeConfigStatusMessageType.mjs +2 -0
- package/dist/esm/api/types/TranscribeDeltaUsageMessage.d.mts +5 -0
- package/dist/esm/api/types/TranscribeDeltaUsageMessage.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/custom/stream/CustomStream.mjs +5 -3
- package/dist/esm/custom/transcribe/CustomTranscribe.mjs +6 -2
- package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.d.mts +3 -2
- package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.mjs +2 -0
- package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.mts +3 -2
- package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.mjs +2 -0
- package/dist/esm/serialization/types/StreamConfigStatusMessageType.d.mts +1 -1
- package/dist/esm/serialization/types/StreamConfigStatusMessageType.mjs +0 -1
- package/dist/esm/serialization/types/StreamDeltaUsageMessage.d.mts +10 -0
- package/dist/esm/serialization/types/StreamDeltaUsageMessage.mjs +6 -0
- package/dist/esm/serialization/types/TranscribeConfigStatusMessageType.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeConfigStatusMessageType.mjs +7 -1
- package/dist/esm/serialization/types/TranscribeDeltaUsageMessage.d.mts +10 -0
- package/dist/esm/serialization/types/TranscribeDeltaUsageMessage.mjs +6 -0
- package/dist/esm/serialization/types/index.d.mts +2 -0
- package/dist/esm/serialization/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "1.0.0
|
|
47
|
-
"User-Agent": "@corti/sdk/1.0.0
|
|
46
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
47
|
+
"User-Agent": "@corti/sdk/1.0.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
"Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
|
|
@@ -4,7 +4,7 @@ export declare namespace StreamSocket {
|
|
|
4
4
|
interface Args {
|
|
5
5
|
socket: core.ReconnectingWebSocket;
|
|
6
6
|
}
|
|
7
|
-
type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
|
|
7
|
+
type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamDeltaUsageMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
|
|
8
8
|
type EventHandlers = {
|
|
9
9
|
open?: () => void;
|
|
10
10
|
message?: (message: Response) => void;
|
|
@@ -4,7 +4,7 @@ export declare namespace TranscribeSocket {
|
|
|
4
4
|
interface Args {
|
|
5
5
|
socket: core.ReconnectingWebSocket;
|
|
6
6
|
}
|
|
7
|
-
type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
|
|
7
|
+
type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeDeltaUsageMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
|
|
8
8
|
type EventHandlers = {
|
|
9
9
|
open?: () => void;
|
|
10
10
|
message?: (message: Response) => void;
|
|
@@ -5,6 +5,5 @@ export declare const StreamConfigStatusMessageType: {
|
|
|
5
5
|
readonly ConfigMissing: "CONFIG_MISSING";
|
|
6
6
|
readonly ConfigNotProvided: "CONFIG_NOT_PROVIDED";
|
|
7
7
|
readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
|
|
8
|
-
readonly ConfigTimeout: "CONFIG_TIMEOUT";
|
|
9
8
|
};
|
|
10
9
|
export type StreamConfigStatusMessageType = (typeof StreamConfigStatusMessageType)[keyof typeof StreamConfigStatusMessageType];
|
|
@@ -3,5 +3,7 @@ export declare const TranscribeConfigStatusMessageType: {
|
|
|
3
3
|
readonly ConfigAccepted: "CONFIG_ACCEPTED";
|
|
4
4
|
readonly ConfigDenied: "CONFIG_DENIED";
|
|
5
5
|
readonly ConfigTimeout: "CONFIG_TIMEOUT";
|
|
6
|
+
readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
|
|
7
|
+
readonly ConfigMissing: "CONFIG_MISSING";
|
|
6
8
|
};
|
|
7
9
|
export type TranscribeConfigStatusMessageType = (typeof TranscribeConfigStatusMessageType)[keyof typeof TranscribeConfigStatusMessageType];
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.js";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.js";
|
|
137
137
|
export * from "./StreamConfigTranscription.js";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.js";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.js";
|
|
139
140
|
export * from "./StreamEndedMessage.js";
|
|
140
141
|
export * from "./StreamEndMessage.js";
|
|
141
142
|
export * from "./StreamErrorDetail.js";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.js";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.js";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.js";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.js";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.js";
|
|
171
173
|
export * from "./TranscribeEndedMessage.js";
|
|
172
174
|
export * from "./TranscribeEndMessage.js";
|
|
173
175
|
export * from "./TranscribeErrorMessage.js";
|
|
@@ -152,6 +152,7 @@ __exportStar(require("./StreamConfigStatusMessage.js"), exports);
|
|
|
152
152
|
__exportStar(require("./StreamConfigStatusMessageType.js"), exports);
|
|
153
153
|
__exportStar(require("./StreamConfigTranscription.js"), exports);
|
|
154
154
|
__exportStar(require("./StreamConfigXCortiRetentionPolicy.js"), exports);
|
|
155
|
+
__exportStar(require("./StreamDeltaUsageMessage.js"), exports);
|
|
155
156
|
__exportStar(require("./StreamEndedMessage.js"), exports);
|
|
156
157
|
__exportStar(require("./StreamEndMessage.js"), exports);
|
|
157
158
|
__exportStar(require("./StreamErrorDetail.js"), exports);
|
|
@@ -184,6 +185,7 @@ __exportStar(require("./TranscribeConfig.js"), exports);
|
|
|
184
185
|
__exportStar(require("./TranscribeConfigMessage.js"), exports);
|
|
185
186
|
__exportStar(require("./TranscribeConfigStatusMessage.js"), exports);
|
|
186
187
|
__exportStar(require("./TranscribeConfigStatusMessageType.js"), exports);
|
|
188
|
+
__exportStar(require("./TranscribeDeltaUsageMessage.js"), exports);
|
|
187
189
|
__exportStar(require("./TranscribeEndedMessage.js"), exports);
|
|
188
190
|
__exportStar(require("./TranscribeEndMessage.js"), exports);
|
|
189
191
|
__exportStar(require("./TranscribeErrorMessage.js"), exports);
|
|
@@ -64,7 +64,6 @@ const parseStreamResponseType_js_1 = require("./parseStreamResponseType.js");
|
|
|
64
64
|
const STREAM_CONFIG_REJECTION_TYPES = [
|
|
65
65
|
Corti.StreamConfigStatusMessageType.ConfigDenied,
|
|
66
66
|
Corti.StreamConfigStatusMessageType.ConfigMissing,
|
|
67
|
-
Corti.StreamConfigStatusMessageType.ConfigTimeout,
|
|
68
67
|
Corti.StreamConfigStatusMessageType.ConfigNotProvided,
|
|
69
68
|
];
|
|
70
69
|
class CustomStream extends Client_js_1.StreamClient {
|
|
@@ -134,7 +133,9 @@ class CustomStream extends Client_js_1.StreamClient {
|
|
|
134
133
|
});
|
|
135
134
|
socket.socket.addEventListener("message", (event) => {
|
|
136
135
|
const type = (0, parseStreamResponseType_js_1.parseStreamResponseType)(event.data);
|
|
137
|
-
if (type == null ||
|
|
136
|
+
if (type == null ||
|
|
137
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAccepted ||
|
|
138
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
141
|
if (STREAM_CONFIG_REJECTION_TYPES.includes(type) || type === "error") {
|
|
@@ -162,7 +163,8 @@ class CustomStream extends Client_js_1.StreamClient {
|
|
|
162
163
|
const type = (0, parseStreamResponseType_js_1.parseStreamResponseType)(event.data);
|
|
163
164
|
if (type == null)
|
|
164
165
|
return;
|
|
165
|
-
if (type === Corti.StreamConfigStatusMessageType.ConfigAccepted
|
|
166
|
+
if (type === Corti.StreamConfigStatusMessageType.ConfigAccepted ||
|
|
167
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
166
168
|
cleanup();
|
|
167
169
|
resolve();
|
|
168
170
|
}
|
|
@@ -64,6 +64,7 @@ const parseTranscribeResponseType_js_1 = require("./parseTranscribeResponseType.
|
|
|
64
64
|
const TRANSCRIBE_CONFIG_REJECTION_TYPES = [
|
|
65
65
|
Corti.TranscribeConfigStatusMessageType.ConfigDenied,
|
|
66
66
|
Corti.TranscribeConfigStatusMessageType.ConfigTimeout,
|
|
67
|
+
Corti.TranscribeConfigStatusMessageType.ConfigMissing,
|
|
67
68
|
];
|
|
68
69
|
class CustomTranscribe extends Client_js_1.TranscribeClient {
|
|
69
70
|
constructor(options) {
|
|
@@ -132,7 +133,9 @@ class CustomTranscribe extends Client_js_1.TranscribeClient {
|
|
|
132
133
|
});
|
|
133
134
|
socket.socket.addEventListener("message", (event) => {
|
|
134
135
|
const type = (0, parseTranscribeResponseType_js_1.parseTranscribeResponseType)(event.data);
|
|
135
|
-
if (type == null ||
|
|
136
|
+
if (type == null ||
|
|
137
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted ||
|
|
138
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
136
139
|
return;
|
|
137
140
|
}
|
|
138
141
|
if (TRANSCRIBE_CONFIG_REJECTION_TYPES.includes(type) || type === "error") {
|
|
@@ -160,7 +163,8 @@ class CustomTranscribe extends Client_js_1.TranscribeClient {
|
|
|
160
163
|
const type = (0, parseTranscribeResponseType_js_1.parseTranscribeResponseType)(event.data);
|
|
161
164
|
if (type == null)
|
|
162
165
|
return;
|
|
163
|
-
if (type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted
|
|
166
|
+
if (type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted ||
|
|
167
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
164
168
|
cleanup();
|
|
165
169
|
resolve();
|
|
166
170
|
}
|
|
@@ -2,13 +2,14 @@ import type * as Corti from "../../../../../api/index.js";
|
|
|
2
2
|
import * as core from "../../../../../core/index.js";
|
|
3
3
|
import type * as serializers from "../../../../index.js";
|
|
4
4
|
import { StreamConfigStatusMessage } from "../../../../types/StreamConfigStatusMessage.js";
|
|
5
|
+
import { StreamDeltaUsageMessage } from "../../../../types/StreamDeltaUsageMessage.js";
|
|
5
6
|
import { StreamEndedMessage } from "../../../../types/StreamEndedMessage.js";
|
|
6
7
|
import { StreamErrorMessage } from "../../../../types/StreamErrorMessage.js";
|
|
7
8
|
import { StreamFactsMessage } from "../../../../types/StreamFactsMessage.js";
|
|
8
9
|
import { StreamFlushedMessage } from "../../../../types/StreamFlushedMessage.js";
|
|
9
10
|
import { StreamTranscriptMessage } from "../../../../types/StreamTranscriptMessage.js";
|
|
10
11
|
import { StreamUsageMessage } from "../../../../types/StreamUsageMessage.js";
|
|
11
|
-
export declare const StreamSocketResponse: core.serialization.Schema<serializers.StreamSocketResponse.Raw, Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage>;
|
|
12
|
+
export declare const StreamSocketResponse: core.serialization.Schema<serializers.StreamSocketResponse.Raw, Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamDeltaUsageMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage>;
|
|
12
13
|
export declare namespace StreamSocketResponse {
|
|
13
|
-
type Raw = StreamTranscriptMessage.Raw | StreamFactsMessage.Raw | StreamFlushedMessage.Raw | StreamEndedMessage.Raw | StreamUsageMessage.Raw | StreamErrorMessage.Raw | StreamConfigStatusMessage.Raw;
|
|
14
|
+
type Raw = StreamTranscriptMessage.Raw | StreamFactsMessage.Raw | StreamFlushedMessage.Raw | StreamDeltaUsageMessage.Raw | StreamEndedMessage.Raw | StreamUsageMessage.Raw | StreamErrorMessage.Raw | StreamConfigStatusMessage.Raw;
|
|
14
15
|
}
|
|
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
exports.StreamSocketResponse = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../../core/index.js"));
|
|
39
39
|
const StreamConfigStatusMessage_js_1 = require("../../../../types/StreamConfigStatusMessage.js");
|
|
40
|
+
const StreamDeltaUsageMessage_js_1 = require("../../../../types/StreamDeltaUsageMessage.js");
|
|
40
41
|
const StreamEndedMessage_js_1 = require("../../../../types/StreamEndedMessage.js");
|
|
41
42
|
const StreamErrorMessage_js_1 = require("../../../../types/StreamErrorMessage.js");
|
|
42
43
|
const StreamFactsMessage_js_1 = require("../../../../types/StreamFactsMessage.js");
|
|
@@ -47,6 +48,7 @@ exports.StreamSocketResponse = core.serialization.undiscriminatedUnion([
|
|
|
47
48
|
StreamTranscriptMessage_js_1.StreamTranscriptMessage,
|
|
48
49
|
StreamFactsMessage_js_1.StreamFactsMessage,
|
|
49
50
|
StreamFlushedMessage_js_1.StreamFlushedMessage,
|
|
51
|
+
StreamDeltaUsageMessage_js_1.StreamDeltaUsageMessage,
|
|
50
52
|
StreamEndedMessage_js_1.StreamEndedMessage,
|
|
51
53
|
StreamUsageMessage_js_1.StreamUsageMessage,
|
|
52
54
|
StreamErrorMessage_js_1.StreamErrorMessage,
|
package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.ts
CHANGED
|
@@ -3,12 +3,13 @@ import * as core from "../../../../../core/index.js";
|
|
|
3
3
|
import type * as serializers from "../../../../index.js";
|
|
4
4
|
import { TranscribeCommandMessage } from "../../../../types/TranscribeCommandMessage.js";
|
|
5
5
|
import { TranscribeConfigStatusMessage } from "../../../../types/TranscribeConfigStatusMessage.js";
|
|
6
|
+
import { TranscribeDeltaUsageMessage } from "../../../../types/TranscribeDeltaUsageMessage.js";
|
|
6
7
|
import { TranscribeEndedMessage } from "../../../../types/TranscribeEndedMessage.js";
|
|
7
8
|
import { TranscribeErrorMessage } from "../../../../types/TranscribeErrorMessage.js";
|
|
8
9
|
import { TranscribeFlushedMessage } from "../../../../types/TranscribeFlushedMessage.js";
|
|
9
10
|
import { TranscribeTranscriptMessage } from "../../../../types/TranscribeTranscriptMessage.js";
|
|
10
11
|
import { TranscribeUsageMessage } from "../../../../types/TranscribeUsageMessage.js";
|
|
11
|
-
export declare const TranscribeSocketResponse: core.serialization.Schema<serializers.TranscribeSocketResponse.Raw, Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage>;
|
|
12
|
+
export declare const TranscribeSocketResponse: core.serialization.Schema<serializers.TranscribeSocketResponse.Raw, Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeDeltaUsageMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage>;
|
|
12
13
|
export declare namespace TranscribeSocketResponse {
|
|
13
|
-
type Raw = TranscribeUsageMessage.Raw | TranscribeFlushedMessage.Raw | TranscribeEndedMessage.Raw | TranscribeErrorMessage.Raw | TranscribeTranscriptMessage.Raw | TranscribeCommandMessage.Raw | TranscribeConfigStatusMessage.Raw;
|
|
14
|
+
type Raw = TranscribeUsageMessage.Raw | TranscribeFlushedMessage.Raw | TranscribeDeltaUsageMessage.Raw | TranscribeEndedMessage.Raw | TranscribeErrorMessage.Raw | TranscribeTranscriptMessage.Raw | TranscribeCommandMessage.Raw | TranscribeConfigStatusMessage.Raw;
|
|
14
15
|
}
|
package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.js
CHANGED
|
@@ -38,6 +38,7 @@ exports.TranscribeSocketResponse = void 0;
|
|
|
38
38
|
const core = __importStar(require("../../../../../core/index.js"));
|
|
39
39
|
const TranscribeCommandMessage_js_1 = require("../../../../types/TranscribeCommandMessage.js");
|
|
40
40
|
const TranscribeConfigStatusMessage_js_1 = require("../../../../types/TranscribeConfigStatusMessage.js");
|
|
41
|
+
const TranscribeDeltaUsageMessage_js_1 = require("../../../../types/TranscribeDeltaUsageMessage.js");
|
|
41
42
|
const TranscribeEndedMessage_js_1 = require("../../../../types/TranscribeEndedMessage.js");
|
|
42
43
|
const TranscribeErrorMessage_js_1 = require("../../../../types/TranscribeErrorMessage.js");
|
|
43
44
|
const TranscribeFlushedMessage_js_1 = require("../../../../types/TranscribeFlushedMessage.js");
|
|
@@ -46,6 +47,7 @@ const TranscribeUsageMessage_js_1 = require("../../../../types/TranscribeUsageMe
|
|
|
46
47
|
exports.TranscribeSocketResponse = core.serialization.undiscriminatedUnion([
|
|
47
48
|
TranscribeUsageMessage_js_1.TranscribeUsageMessage,
|
|
48
49
|
TranscribeFlushedMessage_js_1.TranscribeFlushedMessage,
|
|
50
|
+
TranscribeDeltaUsageMessage_js_1.TranscribeDeltaUsageMessage,
|
|
49
51
|
TranscribeEndedMessage_js_1.TranscribeEndedMessage,
|
|
50
52
|
TranscribeErrorMessage_js_1.TranscribeErrorMessage,
|
|
51
53
|
TranscribeTranscriptMessage_js_1.TranscribeTranscriptMessage,
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core/index.js";
|
|
|
3
3
|
import type * as serializers from "../index.js";
|
|
4
4
|
export declare const StreamConfigStatusMessageType: core.serialization.Schema<serializers.StreamConfigStatusMessageType.Raw, Corti.StreamConfigStatusMessageType>;
|
|
5
5
|
export declare namespace StreamConfigStatusMessageType {
|
|
6
|
-
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_MISSING" | "CONFIG_NOT_PROVIDED" | "CONFIG_ALREADY_RECEIVED"
|
|
6
|
+
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_MISSING" | "CONFIG_NOT_PROVIDED" | "CONFIG_ALREADY_RECEIVED";
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const StreamDeltaUsageMessage: core.serialization.ObjectSchema<serializers.StreamDeltaUsageMessage.Raw, Corti.StreamDeltaUsageMessage>;
|
|
5
|
+
export declare namespace StreamDeltaUsageMessage {
|
|
6
|
+
interface Raw {
|
|
7
|
+
type: "delta_usage";
|
|
8
|
+
credits: number;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.StreamDeltaUsageMessage = void 0;
|
|
38
|
+
const core = __importStar(require("../../core/index.js"));
|
|
39
|
+
exports.StreamDeltaUsageMessage = core.serialization.object({
|
|
40
|
+
type: core.serialization.stringLiteral("delta_usage"),
|
|
41
|
+
credits: core.serialization.number(),
|
|
42
|
+
});
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core/index.js";
|
|
|
3
3
|
import type * as serializers from "../index.js";
|
|
4
4
|
export declare const TranscribeConfigStatusMessageType: core.serialization.Schema<serializers.TranscribeConfigStatusMessageType.Raw, Corti.TranscribeConfigStatusMessageType>;
|
|
5
5
|
export declare namespace TranscribeConfigStatusMessageType {
|
|
6
|
-
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_TIMEOUT";
|
|
6
|
+
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_TIMEOUT" | "CONFIG_ALREADY_RECEIVED" | "CONFIG_MISSING";
|
|
7
7
|
}
|
|
@@ -36,4 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.TranscribeConfigStatusMessageType = void 0;
|
|
38
38
|
const core = __importStar(require("../../core/index.js"));
|
|
39
|
-
exports.TranscribeConfigStatusMessageType = core.serialization.enum_([
|
|
39
|
+
exports.TranscribeConfigStatusMessageType = core.serialization.enum_([
|
|
40
|
+
"CONFIG_ACCEPTED",
|
|
41
|
+
"CONFIG_DENIED",
|
|
42
|
+
"CONFIG_TIMEOUT",
|
|
43
|
+
"CONFIG_ALREADY_RECEIVED",
|
|
44
|
+
"CONFIG_MISSING",
|
|
45
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const TranscribeDeltaUsageMessage: core.serialization.ObjectSchema<serializers.TranscribeDeltaUsageMessage.Raw, Corti.TranscribeDeltaUsageMessage>;
|
|
5
|
+
export declare namespace TranscribeDeltaUsageMessage {
|
|
6
|
+
interface Raw {
|
|
7
|
+
type: "delta_usage";
|
|
8
|
+
credits: number;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.TranscribeDeltaUsageMessage = void 0;
|
|
38
|
+
const core = __importStar(require("../../core/index.js"));
|
|
39
|
+
exports.TranscribeDeltaUsageMessage = core.serialization.object({
|
|
40
|
+
type: core.serialization.stringLiteral("delta_usage"),
|
|
41
|
+
credits: core.serialization.number(),
|
|
42
|
+
});
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.js";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.js";
|
|
137
137
|
export * from "./StreamConfigTranscription.js";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.js";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.js";
|
|
139
140
|
export * from "./StreamEndedMessage.js";
|
|
140
141
|
export * from "./StreamEndMessage.js";
|
|
141
142
|
export * from "./StreamErrorDetail.js";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.js";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.js";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.js";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.js";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.js";
|
|
171
173
|
export * from "./TranscribeEndedMessage.js";
|
|
172
174
|
export * from "./TranscribeEndMessage.js";
|
|
173
175
|
export * from "./TranscribeErrorMessage.js";
|
|
@@ -152,6 +152,7 @@ __exportStar(require("./StreamConfigStatusMessage.js"), exports);
|
|
|
152
152
|
__exportStar(require("./StreamConfigStatusMessageType.js"), exports);
|
|
153
153
|
__exportStar(require("./StreamConfigTranscription.js"), exports);
|
|
154
154
|
__exportStar(require("./StreamConfigXCortiRetentionPolicy.js"), exports);
|
|
155
|
+
__exportStar(require("./StreamDeltaUsageMessage.js"), exports);
|
|
155
156
|
__exportStar(require("./StreamEndedMessage.js"), exports);
|
|
156
157
|
__exportStar(require("./StreamEndMessage.js"), exports);
|
|
157
158
|
__exportStar(require("./StreamErrorDetail.js"), exports);
|
|
@@ -184,6 +185,7 @@ __exportStar(require("./TranscribeConfig.js"), exports);
|
|
|
184
185
|
__exportStar(require("./TranscribeConfigMessage.js"), exports);
|
|
185
186
|
__exportStar(require("./TranscribeConfigStatusMessage.js"), exports);
|
|
186
187
|
__exportStar(require("./TranscribeConfigStatusMessageType.js"), exports);
|
|
188
|
+
__exportStar(require("./TranscribeDeltaUsageMessage.js"), exports);
|
|
187
189
|
__exportStar(require("./TranscribeEndedMessage.js"), exports);
|
|
188
190
|
__exportStar(require("./TranscribeEndMessage.js"), exports);
|
|
189
191
|
__exportStar(require("./TranscribeErrorMessage.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "1.0.0
|
|
10
|
-
"User-Agent": "@corti/sdk/1.0.0
|
|
9
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
10
|
+
"User-Agent": "@corti/sdk/1.0.0",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
"Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
|
|
@@ -4,7 +4,7 @@ export declare namespace StreamSocket {
|
|
|
4
4
|
interface Args {
|
|
5
5
|
socket: core.ReconnectingWebSocket;
|
|
6
6
|
}
|
|
7
|
-
type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
|
|
7
|
+
type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamDeltaUsageMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
|
|
8
8
|
type EventHandlers = {
|
|
9
9
|
open?: () => void;
|
|
10
10
|
message?: (message: Response) => void;
|
|
@@ -4,7 +4,7 @@ export declare namespace TranscribeSocket {
|
|
|
4
4
|
interface Args {
|
|
5
5
|
socket: core.ReconnectingWebSocket;
|
|
6
6
|
}
|
|
7
|
-
type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
|
|
7
|
+
type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeDeltaUsageMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
|
|
8
8
|
type EventHandlers = {
|
|
9
9
|
open?: () => void;
|
|
10
10
|
message?: (message: Response) => void;
|
|
@@ -5,6 +5,5 @@ export declare const StreamConfigStatusMessageType: {
|
|
|
5
5
|
readonly ConfigMissing: "CONFIG_MISSING";
|
|
6
6
|
readonly ConfigNotProvided: "CONFIG_NOT_PROVIDED";
|
|
7
7
|
readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
|
|
8
|
-
readonly ConfigTimeout: "CONFIG_TIMEOUT";
|
|
9
8
|
};
|
|
10
9
|
export type StreamConfigStatusMessageType = (typeof StreamConfigStatusMessageType)[keyof typeof StreamConfigStatusMessageType];
|
|
@@ -3,5 +3,7 @@ export declare const TranscribeConfigStatusMessageType: {
|
|
|
3
3
|
readonly ConfigAccepted: "CONFIG_ACCEPTED";
|
|
4
4
|
readonly ConfigDenied: "CONFIG_DENIED";
|
|
5
5
|
readonly ConfigTimeout: "CONFIG_TIMEOUT";
|
|
6
|
+
readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
|
|
7
|
+
readonly ConfigMissing: "CONFIG_MISSING";
|
|
6
8
|
};
|
|
7
9
|
export type TranscribeConfigStatusMessageType = (typeof TranscribeConfigStatusMessageType)[keyof typeof TranscribeConfigStatusMessageType];
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.mjs";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
137
137
|
export * from "./StreamConfigTranscription.mjs";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.mjs";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.mjs";
|
|
139
140
|
export * from "./StreamEndedMessage.mjs";
|
|
140
141
|
export * from "./StreamEndMessage.mjs";
|
|
141
142
|
export * from "./StreamErrorDetail.mjs";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.mjs";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.mjs";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
171
173
|
export * from "./TranscribeEndedMessage.mjs";
|
|
172
174
|
export * from "./TranscribeEndMessage.mjs";
|
|
173
175
|
export * from "./TranscribeErrorMessage.mjs";
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.mjs";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
137
137
|
export * from "./StreamConfigTranscription.mjs";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.mjs";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.mjs";
|
|
139
140
|
export * from "./StreamEndedMessage.mjs";
|
|
140
141
|
export * from "./StreamEndMessage.mjs";
|
|
141
142
|
export * from "./StreamErrorDetail.mjs";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.mjs";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.mjs";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
171
173
|
export * from "./TranscribeEndedMessage.mjs";
|
|
172
174
|
export * from "./TranscribeEndMessage.mjs";
|
|
173
175
|
export * from "./TranscribeErrorMessage.mjs";
|
|
@@ -28,7 +28,6 @@ import { parseStreamResponseType } from "./parseStreamResponseType.mjs";
|
|
|
28
28
|
const STREAM_CONFIG_REJECTION_TYPES = [
|
|
29
29
|
Corti.StreamConfigStatusMessageType.ConfigDenied,
|
|
30
30
|
Corti.StreamConfigStatusMessageType.ConfigMissing,
|
|
31
|
-
Corti.StreamConfigStatusMessageType.ConfigTimeout,
|
|
32
31
|
Corti.StreamConfigStatusMessageType.ConfigNotProvided,
|
|
33
32
|
];
|
|
34
33
|
export class CustomStream extends StreamClient {
|
|
@@ -98,7 +97,9 @@ export class CustomStream extends StreamClient {
|
|
|
98
97
|
});
|
|
99
98
|
socket.socket.addEventListener("message", (event) => {
|
|
100
99
|
const type = parseStreamResponseType(event.data);
|
|
101
|
-
if (type == null ||
|
|
100
|
+
if (type == null ||
|
|
101
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAccepted ||
|
|
102
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
if (STREAM_CONFIG_REJECTION_TYPES.includes(type) || type === "error") {
|
|
@@ -126,7 +127,8 @@ export class CustomStream extends StreamClient {
|
|
|
126
127
|
const type = parseStreamResponseType(event.data);
|
|
127
128
|
if (type == null)
|
|
128
129
|
return;
|
|
129
|
-
if (type === Corti.StreamConfigStatusMessageType.ConfigAccepted
|
|
130
|
+
if (type === Corti.StreamConfigStatusMessageType.ConfigAccepted ||
|
|
131
|
+
type === Corti.StreamConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
130
132
|
cleanup();
|
|
131
133
|
resolve();
|
|
132
134
|
}
|
|
@@ -28,6 +28,7 @@ import { parseTranscribeResponseType } from "./parseTranscribeResponseType.mjs";
|
|
|
28
28
|
const TRANSCRIBE_CONFIG_REJECTION_TYPES = [
|
|
29
29
|
Corti.TranscribeConfigStatusMessageType.ConfigDenied,
|
|
30
30
|
Corti.TranscribeConfigStatusMessageType.ConfigTimeout,
|
|
31
|
+
Corti.TranscribeConfigStatusMessageType.ConfigMissing,
|
|
31
32
|
];
|
|
32
33
|
export class CustomTranscribe extends TranscribeClient {
|
|
33
34
|
constructor(options) {
|
|
@@ -96,7 +97,9 @@ export class CustomTranscribe extends TranscribeClient {
|
|
|
96
97
|
});
|
|
97
98
|
socket.socket.addEventListener("message", (event) => {
|
|
98
99
|
const type = parseTranscribeResponseType(event.data);
|
|
99
|
-
if (type == null ||
|
|
100
|
+
if (type == null ||
|
|
101
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted ||
|
|
102
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
100
103
|
return;
|
|
101
104
|
}
|
|
102
105
|
if (TRANSCRIBE_CONFIG_REJECTION_TYPES.includes(type) || type === "error") {
|
|
@@ -124,7 +127,8 @@ export class CustomTranscribe extends TranscribeClient {
|
|
|
124
127
|
const type = parseTranscribeResponseType(event.data);
|
|
125
128
|
if (type == null)
|
|
126
129
|
return;
|
|
127
|
-
if (type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted
|
|
130
|
+
if (type === Corti.TranscribeConfigStatusMessageType.ConfigAccepted ||
|
|
131
|
+
type === Corti.TranscribeConfigStatusMessageType.ConfigAlreadyReceived) {
|
|
128
132
|
cleanup();
|
|
129
133
|
resolve();
|
|
130
134
|
}
|
|
@@ -2,13 +2,14 @@ import type * as Corti from "../../../../../api/index.mjs";
|
|
|
2
2
|
import * as core from "../../../../../core/index.mjs";
|
|
3
3
|
import type * as serializers from "../../../../index.mjs";
|
|
4
4
|
import { StreamConfigStatusMessage } from "../../../../types/StreamConfigStatusMessage.mjs";
|
|
5
|
+
import { StreamDeltaUsageMessage } from "../../../../types/StreamDeltaUsageMessage.mjs";
|
|
5
6
|
import { StreamEndedMessage } from "../../../../types/StreamEndedMessage.mjs";
|
|
6
7
|
import { StreamErrorMessage } from "../../../../types/StreamErrorMessage.mjs";
|
|
7
8
|
import { StreamFactsMessage } from "../../../../types/StreamFactsMessage.mjs";
|
|
8
9
|
import { StreamFlushedMessage } from "../../../../types/StreamFlushedMessage.mjs";
|
|
9
10
|
import { StreamTranscriptMessage } from "../../../../types/StreamTranscriptMessage.mjs";
|
|
10
11
|
import { StreamUsageMessage } from "../../../../types/StreamUsageMessage.mjs";
|
|
11
|
-
export declare const StreamSocketResponse: core.serialization.Schema<serializers.StreamSocketResponse.Raw, Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage>;
|
|
12
|
+
export declare const StreamSocketResponse: core.serialization.Schema<serializers.StreamSocketResponse.Raw, Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamDeltaUsageMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage>;
|
|
12
13
|
export declare namespace StreamSocketResponse {
|
|
13
|
-
type Raw = StreamTranscriptMessage.Raw | StreamFactsMessage.Raw | StreamFlushedMessage.Raw | StreamEndedMessage.Raw | StreamUsageMessage.Raw | StreamErrorMessage.Raw | StreamConfigStatusMessage.Raw;
|
|
14
|
+
type Raw = StreamTranscriptMessage.Raw | StreamFactsMessage.Raw | StreamFlushedMessage.Raw | StreamDeltaUsageMessage.Raw | StreamEndedMessage.Raw | StreamUsageMessage.Raw | StreamErrorMessage.Raw | StreamConfigStatusMessage.Raw;
|
|
14
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as core from "../../../../../core/index.mjs";
|
|
3
3
|
import { StreamConfigStatusMessage } from "../../../../types/StreamConfigStatusMessage.mjs";
|
|
4
|
+
import { StreamDeltaUsageMessage } from "../../../../types/StreamDeltaUsageMessage.mjs";
|
|
4
5
|
import { StreamEndedMessage } from "../../../../types/StreamEndedMessage.mjs";
|
|
5
6
|
import { StreamErrorMessage } from "../../../../types/StreamErrorMessage.mjs";
|
|
6
7
|
import { StreamFactsMessage } from "../../../../types/StreamFactsMessage.mjs";
|
|
@@ -11,6 +12,7 @@ export const StreamSocketResponse = core.serialization.undiscriminatedUnion([
|
|
|
11
12
|
StreamTranscriptMessage,
|
|
12
13
|
StreamFactsMessage,
|
|
13
14
|
StreamFlushedMessage,
|
|
15
|
+
StreamDeltaUsageMessage,
|
|
14
16
|
StreamEndedMessage,
|
|
15
17
|
StreamUsageMessage,
|
|
16
18
|
StreamErrorMessage,
|
package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.mts
CHANGED
|
@@ -3,12 +3,13 @@ import * as core from "../../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../../index.mjs";
|
|
4
4
|
import { TranscribeCommandMessage } from "../../../../types/TranscribeCommandMessage.mjs";
|
|
5
5
|
import { TranscribeConfigStatusMessage } from "../../../../types/TranscribeConfigStatusMessage.mjs";
|
|
6
|
+
import { TranscribeDeltaUsageMessage } from "../../../../types/TranscribeDeltaUsageMessage.mjs";
|
|
6
7
|
import { TranscribeEndedMessage } from "../../../../types/TranscribeEndedMessage.mjs";
|
|
7
8
|
import { TranscribeErrorMessage } from "../../../../types/TranscribeErrorMessage.mjs";
|
|
8
9
|
import { TranscribeFlushedMessage } from "../../../../types/TranscribeFlushedMessage.mjs";
|
|
9
10
|
import { TranscribeTranscriptMessage } from "../../../../types/TranscribeTranscriptMessage.mjs";
|
|
10
11
|
import { TranscribeUsageMessage } from "../../../../types/TranscribeUsageMessage.mjs";
|
|
11
|
-
export declare const TranscribeSocketResponse: core.serialization.Schema<serializers.TranscribeSocketResponse.Raw, Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage>;
|
|
12
|
+
export declare const TranscribeSocketResponse: core.serialization.Schema<serializers.TranscribeSocketResponse.Raw, Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeDeltaUsageMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage>;
|
|
12
13
|
export declare namespace TranscribeSocketResponse {
|
|
13
|
-
type Raw = TranscribeUsageMessage.Raw | TranscribeFlushedMessage.Raw | TranscribeEndedMessage.Raw | TranscribeErrorMessage.Raw | TranscribeTranscriptMessage.Raw | TranscribeCommandMessage.Raw | TranscribeConfigStatusMessage.Raw;
|
|
14
|
+
type Raw = TranscribeUsageMessage.Raw | TranscribeFlushedMessage.Raw | TranscribeDeltaUsageMessage.Raw | TranscribeEndedMessage.Raw | TranscribeErrorMessage.Raw | TranscribeTranscriptMessage.Raw | TranscribeCommandMessage.Raw | TranscribeConfigStatusMessage.Raw;
|
|
14
15
|
}
|
package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as core from "../../../../../core/index.mjs";
|
|
3
3
|
import { TranscribeCommandMessage } from "../../../../types/TranscribeCommandMessage.mjs";
|
|
4
4
|
import { TranscribeConfigStatusMessage } from "../../../../types/TranscribeConfigStatusMessage.mjs";
|
|
5
|
+
import { TranscribeDeltaUsageMessage } from "../../../../types/TranscribeDeltaUsageMessage.mjs";
|
|
5
6
|
import { TranscribeEndedMessage } from "../../../../types/TranscribeEndedMessage.mjs";
|
|
6
7
|
import { TranscribeErrorMessage } from "../../../../types/TranscribeErrorMessage.mjs";
|
|
7
8
|
import { TranscribeFlushedMessage } from "../../../../types/TranscribeFlushedMessage.mjs";
|
|
@@ -10,6 +11,7 @@ import { TranscribeUsageMessage } from "../../../../types/TranscribeUsageMessage
|
|
|
10
11
|
export const TranscribeSocketResponse = core.serialization.undiscriminatedUnion([
|
|
11
12
|
TranscribeUsageMessage,
|
|
12
13
|
TranscribeFlushedMessage,
|
|
14
|
+
TranscribeDeltaUsageMessage,
|
|
13
15
|
TranscribeEndedMessage,
|
|
14
16
|
TranscribeErrorMessage,
|
|
15
17
|
TranscribeTranscriptMessage,
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../index.mjs";
|
|
4
4
|
export declare const StreamConfigStatusMessageType: core.serialization.Schema<serializers.StreamConfigStatusMessageType.Raw, Corti.StreamConfigStatusMessageType>;
|
|
5
5
|
export declare namespace StreamConfigStatusMessageType {
|
|
6
|
-
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_MISSING" | "CONFIG_NOT_PROVIDED" | "CONFIG_ALREADY_RECEIVED"
|
|
6
|
+
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_MISSING" | "CONFIG_NOT_PROVIDED" | "CONFIG_ALREADY_RECEIVED";
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.mjs";
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../index.mjs";
|
|
4
|
+
export declare const StreamDeltaUsageMessage: core.serialization.ObjectSchema<serializers.StreamDeltaUsageMessage.Raw, Corti.StreamDeltaUsageMessage>;
|
|
5
|
+
export declare namespace StreamDeltaUsageMessage {
|
|
6
|
+
interface Raw {
|
|
7
|
+
type: "delta_usage";
|
|
8
|
+
credits: number;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
export const StreamDeltaUsageMessage = core.serialization.object({
|
|
4
|
+
type: core.serialization.stringLiteral("delta_usage"),
|
|
5
|
+
credits: core.serialization.number(),
|
|
6
|
+
});
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../index.mjs";
|
|
4
4
|
export declare const TranscribeConfigStatusMessageType: core.serialization.Schema<serializers.TranscribeConfigStatusMessageType.Raw, Corti.TranscribeConfigStatusMessageType>;
|
|
5
5
|
export declare namespace TranscribeConfigStatusMessageType {
|
|
6
|
-
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_TIMEOUT";
|
|
6
|
+
type Raw = "CONFIG_ACCEPTED" | "CONFIG_DENIED" | "CONFIG_TIMEOUT" | "CONFIG_ALREADY_RECEIVED" | "CONFIG_MISSING";
|
|
7
7
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as core from "../../core/index.mjs";
|
|
3
|
-
export const TranscribeConfigStatusMessageType = core.serialization.enum_([
|
|
3
|
+
export const TranscribeConfigStatusMessageType = core.serialization.enum_([
|
|
4
|
+
"CONFIG_ACCEPTED",
|
|
5
|
+
"CONFIG_DENIED",
|
|
6
|
+
"CONFIG_TIMEOUT",
|
|
7
|
+
"CONFIG_ALREADY_RECEIVED",
|
|
8
|
+
"CONFIG_MISSING",
|
|
9
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.mjs";
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../index.mjs";
|
|
4
|
+
export declare const TranscribeDeltaUsageMessage: core.serialization.ObjectSchema<serializers.TranscribeDeltaUsageMessage.Raw, Corti.TranscribeDeltaUsageMessage>;
|
|
5
|
+
export declare namespace TranscribeDeltaUsageMessage {
|
|
6
|
+
interface Raw {
|
|
7
|
+
type: "delta_usage";
|
|
8
|
+
credits: number;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
export const TranscribeDeltaUsageMessage = core.serialization.object({
|
|
4
|
+
type: core.serialization.stringLiteral("delta_usage"),
|
|
5
|
+
credits: core.serialization.number(),
|
|
6
|
+
});
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.mjs";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
137
137
|
export * from "./StreamConfigTranscription.mjs";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.mjs";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.mjs";
|
|
139
140
|
export * from "./StreamEndedMessage.mjs";
|
|
140
141
|
export * from "./StreamEndMessage.mjs";
|
|
141
142
|
export * from "./StreamErrorDetail.mjs";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.mjs";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.mjs";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
171
173
|
export * from "./TranscribeEndedMessage.mjs";
|
|
172
174
|
export * from "./TranscribeEndMessage.mjs";
|
|
173
175
|
export * from "./TranscribeErrorMessage.mjs";
|
|
@@ -136,6 +136,7 @@ export * from "./StreamConfigStatusMessage.mjs";
|
|
|
136
136
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
137
137
|
export * from "./StreamConfigTranscription.mjs";
|
|
138
138
|
export * from "./StreamConfigXCortiRetentionPolicy.mjs";
|
|
139
|
+
export * from "./StreamDeltaUsageMessage.mjs";
|
|
139
140
|
export * from "./StreamEndedMessage.mjs";
|
|
140
141
|
export * from "./StreamEndMessage.mjs";
|
|
141
142
|
export * from "./StreamErrorDetail.mjs";
|
|
@@ -168,6 +169,7 @@ export * from "./TranscribeConfig.mjs";
|
|
|
168
169
|
export * from "./TranscribeConfigMessage.mjs";
|
|
169
170
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
170
171
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
172
|
+
export * from "./TranscribeDeltaUsageMessage.mjs";
|
|
171
173
|
export * from "./TranscribeEndedMessage.mjs";
|
|
172
174
|
export * from "./TranscribeEndMessage.mjs";
|
|
173
175
|
export * from "./TranscribeErrorMessage.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.0
|
|
1
|
+
export const SDK_VERSION = "1.0.0";
|