@corti/sdk 0.1.1-alpha → 0.1.3-alpha

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.
Files changed (61) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -1
  3. package/dist/cjs/api/resources/transcripts/types/index.d.ts +0 -1
  4. package/dist/cjs/api/resources/transcripts/types/index.js +0 -1
  5. package/dist/cjs/api/types/StreamSupportedLanguage.d.ts +1 -17
  6. package/dist/cjs/api/types/StreamSupportedLanguage.js +0 -17
  7. package/dist/cjs/api/types/TranscribeSupportedLanguage.d.ts +1 -17
  8. package/dist/cjs/api/types/TranscribeSupportedLanguage.js +0 -17
  9. package/dist/cjs/custom/CortiClient.d.ts +4 -1
  10. package/dist/cjs/custom/CortiClient.js +7 -1
  11. package/dist/cjs/custom/CustomStream.js +2 -2
  12. package/dist/cjs/custom/CustomStreamSocket.d.ts +5 -1
  13. package/dist/cjs/custom/CustomStreamSocket.js +8 -0
  14. package/dist/cjs/custom/CustomTranscribe.js +2 -2
  15. package/dist/cjs/custom/CustomTranscribeSocket.d.ts +5 -1
  16. package/dist/cjs/custom/CustomTranscribeSocket.js +8 -0
  17. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -2
  18. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +1 -2
  19. package/dist/cjs/serialization/resources/transcripts/types/index.d.ts +0 -1
  20. package/dist/cjs/serialization/resources/transcripts/types/index.js +0 -1
  21. package/dist/cjs/serialization/types/StreamSupportedLanguage.d.ts +1 -1
  22. package/dist/cjs/serialization/types/StreamSupportedLanguage.js +1 -16
  23. package/dist/cjs/serialization/types/TranscribeSupportedLanguage.d.ts +1 -1
  24. package/dist/cjs/serialization/types/TranscribeSupportedLanguage.js +1 -16
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -1
  29. package/dist/esm/api/resources/transcripts/types/index.d.mts +0 -1
  30. package/dist/esm/api/resources/transcripts/types/index.mjs +0 -1
  31. package/dist/esm/api/types/StreamSupportedLanguage.d.mts +1 -17
  32. package/dist/esm/api/types/StreamSupportedLanguage.mjs +1 -16
  33. package/dist/esm/api/types/TranscribeSupportedLanguage.d.mts +1 -17
  34. package/dist/esm/api/types/TranscribeSupportedLanguage.mjs +1 -16
  35. package/dist/esm/custom/CortiClient.d.mts +4 -1
  36. package/dist/esm/custom/CortiClient.mjs +7 -1
  37. package/dist/esm/custom/CustomStream.mjs +2 -2
  38. package/dist/esm/custom/CustomStreamSocket.d.mts +5 -1
  39. package/dist/esm/custom/CustomStreamSocket.mjs +8 -0
  40. package/dist/esm/custom/CustomTranscribe.mjs +2 -2
  41. package/dist/esm/custom/CustomTranscribeSocket.d.mts +5 -1
  42. package/dist/esm/custom/CustomTranscribeSocket.mjs +8 -0
  43. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -2
  44. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +1 -2
  45. package/dist/esm/serialization/resources/transcripts/types/index.d.mts +0 -1
  46. package/dist/esm/serialization/resources/transcripts/types/index.mjs +0 -1
  47. package/dist/esm/serialization/types/StreamSupportedLanguage.d.mts +1 -1
  48. package/dist/esm/serialization/types/StreamSupportedLanguage.mjs +1 -16
  49. package/dist/esm/serialization/types/TranscribeSupportedLanguage.d.mts +1 -1
  50. package/dist/esm/serialization/types/TranscribeSupportedLanguage.mjs +1 -16
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/package.json +1 -1
  54. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.ts +0 -21
  55. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.js +0 -20
  56. package/dist/cjs/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.ts +0 -10
  57. package/dist/cjs/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.js +0 -41
  58. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.mts +0 -21
  59. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.mjs +0 -17
  60. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.mts +0 -10
  61. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.mjs +0 -5
@@ -63,8 +63,8 @@ class CortiClient {
63
63
  "Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
64
64
  "X-Fern-Language": "JavaScript",
65
65
  "X-Fern-SDK-Name": "@corti/sdk",
66
- "X-Fern-SDK-Version": "0.1.1-alpha",
67
- "User-Agent": "@corti/sdk/0.1.1-alpha",
66
+ "X-Fern-SDK-Version": "0.1.3-alpha",
67
+ "User-Agent": "@corti/sdk/0.1.3-alpha",
68
68
  "X-Fern-Runtime": core.RUNTIME.type,
69
69
  "X-Fern-Runtime-Version": core.RUNTIME.version,
70
70
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -14,7 +14,7 @@ export interface TranscriptsCreateRequest {
14
14
  /** The unique identifier for the recording. */
15
15
  recordingId: Corti.Uuid;
16
16
  /** The primary spoken language of the recording. Check https://docs.corti.ai/about/languages for more. */
17
- primaryLanguage: Corti.TranscriptsCreateRequestPrimaryLanguage;
17
+ primaryLanguage: string;
18
18
  /** Indicates whether spoken dictation commands should be converted to punctuation (e.g., 'comma' → ','). */
19
19
  isDictation?: boolean;
20
20
  /** If true, each audio channel is transcribed separately. */
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.js";
2
1
  export * from "./TranscriptsCreateRequestModelName.js";
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TranscriptsCreateRequestPrimaryLanguage.js"), exports);
18
17
  __exportStar(require("./TranscriptsCreateRequestModelName.js"), exports);
@@ -4,20 +4,4 @@
4
4
  /**
5
5
  * Supported language codes
6
6
  */
7
- export type StreamSupportedLanguage = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
8
- export declare const StreamSupportedLanguage: {
9
- readonly En: "en";
10
- readonly EnUs: "en-us";
11
- readonly EnGb: "en-gb";
12
- readonly Da: "da";
13
- readonly Se: "se";
14
- readonly No: "no";
15
- readonly De: "de";
16
- readonly Nl: "nl";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Fr: "fr";
20
- readonly Pt: "pt";
21
- readonly DeCh: "de-ch";
22
- readonly Sv: "sv";
23
- };
7
+ export type StreamSupportedLanguage = string;
@@ -3,20 +3,3 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.StreamSupportedLanguage = void 0;
7
- exports.StreamSupportedLanguage = {
8
- En: "en",
9
- EnUs: "en-us",
10
- EnGb: "en-gb",
11
- Da: "da",
12
- Se: "se",
13
- No: "no",
14
- De: "de",
15
- Nl: "nl",
16
- Es: "es",
17
- It: "it",
18
- Fr: "fr",
19
- Pt: "pt",
20
- DeCh: "de-ch",
21
- Sv: "sv",
22
- };
@@ -4,20 +4,4 @@
4
4
  /**
5
5
  * Supported language codes for transcription
6
6
  */
7
- export type TranscribeSupportedLanguage = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
8
- export declare const TranscribeSupportedLanguage: {
9
- readonly En: "en";
10
- readonly EnUs: "en-us";
11
- readonly EnGb: "en-gb";
12
- readonly Da: "da";
13
- readonly Se: "se";
14
- readonly No: "no";
15
- readonly De: "de";
16
- readonly Nl: "nl";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Fr: "fr";
20
- readonly Pt: "pt";
21
- readonly DeCh: "de-ch";
22
- readonly Sv: "sv";
23
- };
7
+ export type TranscribeSupportedLanguage = string;
@@ -3,20 +3,3 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TranscribeSupportedLanguage = void 0;
7
- exports.TranscribeSupportedLanguage = {
8
- En: "en",
9
- EnUs: "en-us",
10
- EnGb: "en-gb",
11
- Da: "da",
12
- Se: "se",
13
- No: "no",
14
- De: "de",
15
- Nl: "nl",
16
- Es: "es",
17
- It: "it",
18
- Fr: "fr",
19
- Pt: "pt",
20
- DeCh: "de-ch",
21
- Sv: "sv",
22
- };
@@ -40,7 +40,10 @@ export declare namespace CortiClient {
40
40
  clientSecret: core.Supplier<string>;
41
41
  }
42
42
  interface Options {
43
- environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls>;
43
+ /**
44
+ * Patch: allow to pass a custom string-based environment
45
+ * */
46
+ environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls> | string;
44
47
  /** Override the Tenant-Name header */
45
48
  tenantName: core.Supplier<string>;
46
49
  /** Additional headers to include in requests. */
@@ -97,7 +97,13 @@ class CortiClient {
97
97
  "User-Agent": `@corti/sdk/${version_js_1.SDK_VERSION}`,
98
98
  "X-Fern-Runtime": core.RUNTIME.type,
99
99
  "X-Fern-Runtime-Version": core.RUNTIME.version,
100
- }, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined });
100
+ }, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment: typeof _options.environment === "string"
101
+ ? {
102
+ base: `https://api.${_options.environment}.corti.app/v2`,
103
+ wss: `wss://api.${_options.environment}.corti.app`,
104
+ login: `https://auth.${_options.environment}.corti.app/realms`,
105
+ }
106
+ : _options.environment });
101
107
  /**
102
108
  * Patch: if `accessToken` is provided, use BearerProvider, otherwise use OAuthTokenProvider
103
109
  */
@@ -105,7 +105,7 @@ class Stream extends Client_js_1.Stream {
105
105
  || parsedResponse.value.type === 'CONFIG_NOT_PROVIDED')) {
106
106
  ws.socket.dispatchEvent(new events_js_1.ErrorEvent({
107
107
  name: parsedResponse.value.type,
108
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
108
+ message: JSON.stringify(parsedResponse.value),
109
109
  }, ''));
110
110
  ws.close();
111
111
  return;
@@ -113,7 +113,7 @@ class Stream extends Client_js_1.Stream {
113
113
  if (parsedResponse.ok && parsedResponse.value.type === 'error') {
114
114
  ws.socket.dispatchEvent(new events_js_1.ErrorEvent({
115
115
  name: 'error',
116
- message: JSON.stringify(parsedResponse.value.error),
116
+ message: JSON.stringify(parsedResponse.value),
117
117
  }, ''));
118
118
  ws.close();
119
119
  return;
@@ -3,9 +3,13 @@
3
3
  */
4
4
  import { StreamSocket as FernStreamSocket } from '../api/resources/stream/client/Socket.js';
5
5
  export declare class StreamSocket extends FernStreamSocket {
6
- sendAudio(message: ArrayBuffer | string): void;
6
+ sendAudio(message: ArrayBufferLike | Blob | ArrayBufferView | string): void;
7
7
  /**
8
8
  * Patch: have to repeat this method, because it is private in the base class
9
9
  */
10
10
  private __assertSocketIsOpen;
11
+ /**
12
+ * Patch: added ability to remove event handlers
13
+ */
14
+ off<T extends keyof FernStreamSocket.EventHandlers>(event: T, callback?: FernStreamSocket.EventHandlers[T]): void;
11
15
  }
@@ -58,5 +58,13 @@ class StreamSocket extends Socket_js_1.StreamSocket {
58
58
  throw new Error("Socket is not open.");
59
59
  }
60
60
  }
61
+ /**
62
+ * Patch: added ability to remove event handlers
63
+ */
64
+ off(event, callback) {
65
+ if (!callback || callback === this.eventHandlers[event]) {
66
+ delete this.eventHandlers[event];
67
+ }
68
+ }
61
69
  }
62
70
  exports.StreamSocket = StreamSocket;
@@ -103,7 +103,7 @@ class Transcribe extends Client_js_1.Transcribe {
103
103
  || parsedResponse.value.type === 'CONFIG_TIMEOUT')) {
104
104
  ws.socket.dispatchEvent(new events_js_1.ErrorEvent({
105
105
  name: parsedResponse.value.type,
106
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
106
+ message: JSON.stringify(parsedResponse.value),
107
107
  }, ''));
108
108
  ws.close();
109
109
  return;
@@ -111,7 +111,7 @@ class Transcribe extends Client_js_1.Transcribe {
111
111
  if (parsedResponse.ok && parsedResponse.value.type === 'error') {
112
112
  ws.socket.dispatchEvent(new events_js_1.ErrorEvent({
113
113
  name: 'error',
114
- message: JSON.stringify(parsedResponse.value.error),
114
+ message: JSON.stringify(parsedResponse.value),
115
115
  }, ''));
116
116
  ws.close();
117
117
  return;
@@ -3,9 +3,13 @@
3
3
  */
4
4
  import { TranscribeSocket as FernTranscribeSocket } from '../api/resources/transcribe/client/Socket.js';
5
5
  export declare class TranscribeSocket extends FernTranscribeSocket {
6
- sendAudio(message: ArrayBuffer | string): void;
6
+ sendAudio(message: ArrayBufferLike | Blob | ArrayBufferView | string): void;
7
7
  /**
8
8
  * Patch: have to repeat this method, because it is private in the base class
9
9
  */
10
10
  private __assertSocketIsOpen;
11
+ /**
12
+ * Patch: added ability to remove event handlers
13
+ */
14
+ off<T extends keyof FernTranscribeSocket.EventHandlers>(event: T, callback?: FernTranscribeSocket.EventHandlers[T]): void;
11
15
  }
@@ -58,5 +58,13 @@ class TranscribeSocket extends Socket_js_1.TranscribeSocket {
58
58
  throw new Error("Socket is not open.");
59
59
  }
60
60
  }
61
+ /**
62
+ * Patch: added ability to remove event handlers
63
+ */
64
+ off(event, callback) {
65
+ if (!callback || callback === this.eventHandlers[event]) {
66
+ delete this.eventHandlers[event];
67
+ }
68
+ }
61
69
  }
62
70
  exports.TranscribeSocket = TranscribeSocket;
@@ -5,14 +5,13 @@ import * as serializers from "../../../../index.js";
5
5
  import * as Corti from "../../../../../api/index.js";
6
6
  import * as core from "../../../../../core/index.js";
7
7
  import { Uuid } from "../../../../types/Uuid.js";
8
- import { TranscriptsCreateRequestPrimaryLanguage } from "../../types/TranscriptsCreateRequestPrimaryLanguage.js";
9
8
  import { TranscriptsParticipant } from "../../../../types/TranscriptsParticipant.js";
10
9
  import { TranscriptsCreateRequestModelName } from "../../types/TranscriptsCreateRequestModelName.js";
11
10
  export declare const TranscriptsCreateRequest: core.serialization.Schema<serializers.TranscriptsCreateRequest.Raw, Corti.TranscriptsCreateRequest>;
12
11
  export declare namespace TranscriptsCreateRequest {
13
12
  interface Raw {
14
13
  recordingId: Uuid.Raw;
15
- primaryLanguage: TranscriptsCreateRequestPrimaryLanguage.Raw;
14
+ primaryLanguage: string;
16
15
  isDictation?: boolean | null;
17
16
  isMultichannel?: boolean | null;
18
17
  diarize?: boolean | null;
@@ -39,12 +39,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TranscriptsCreateRequest = void 0;
40
40
  const core = __importStar(require("../../../../../core/index.js"));
41
41
  const Uuid_js_1 = require("../../../../types/Uuid.js");
42
- const TranscriptsCreateRequestPrimaryLanguage_js_1 = require("../../types/TranscriptsCreateRequestPrimaryLanguage.js");
43
42
  const TranscriptsParticipant_js_1 = require("../../../../types/TranscriptsParticipant.js");
44
43
  const TranscriptsCreateRequestModelName_js_1 = require("../../types/TranscriptsCreateRequestModelName.js");
45
44
  exports.TranscriptsCreateRequest = core.serialization.object({
46
45
  recordingId: Uuid_js_1.Uuid,
47
- primaryLanguage: TranscriptsCreateRequestPrimaryLanguage_js_1.TranscriptsCreateRequestPrimaryLanguage,
46
+ primaryLanguage: core.serialization.string(),
48
47
  isDictation: core.serialization.boolean().optional(),
49
48
  isMultichannel: core.serialization.boolean().optional(),
50
49
  diarize: core.serialization.boolean().optional(),
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.js";
2
1
  export * from "./TranscriptsCreateRequestModelName.js";
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TranscriptsCreateRequestPrimaryLanguage.js"), exports);
18
17
  __exportStar(require("./TranscriptsCreateRequestModelName.js"), exports);
@@ -6,5 +6,5 @@ import * as Corti from "../../api/index.js";
6
6
  import * as core from "../../core/index.js";
7
7
  export declare const StreamSupportedLanguage: core.serialization.Schema<serializers.StreamSupportedLanguage.Raw, Corti.StreamSupportedLanguage>;
8
8
  export declare namespace StreamSupportedLanguage {
9
- type Raw = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
9
+ type Raw = string;
10
10
  }
@@ -38,19 +38,4 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.StreamSupportedLanguage = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
- exports.StreamSupportedLanguage = core.serialization.enum_([
42
- "en",
43
- "en-us",
44
- "en-gb",
45
- "da",
46
- "se",
47
- "no",
48
- "de",
49
- "nl",
50
- "es",
51
- "it",
52
- "fr",
53
- "pt",
54
- "de-ch",
55
- "sv",
56
- ]);
41
+ exports.StreamSupportedLanguage = core.serialization.string();
@@ -6,5 +6,5 @@ import * as Corti from "../../api/index.js";
6
6
  import * as core from "../../core/index.js";
7
7
  export declare const TranscribeSupportedLanguage: core.serialization.Schema<serializers.TranscribeSupportedLanguage.Raw, Corti.TranscribeSupportedLanguage>;
8
8
  export declare namespace TranscribeSupportedLanguage {
9
- type Raw = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
9
+ type Raw = string;
10
10
  }
@@ -38,19 +38,4 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TranscribeSupportedLanguage = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
- exports.TranscribeSupportedLanguage = core.serialization.enum_([
42
- "en",
43
- "en-us",
44
- "en-gb",
45
- "da",
46
- "se",
47
- "no",
48
- "de",
49
- "nl",
50
- "es",
51
- "it",
52
- "fr",
53
- "pt",
54
- "de-ch",
55
- "sv",
56
- ]);
41
+ exports.TranscribeSupportedLanguage = core.serialization.string();
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.1-alpha";
1
+ export declare const SDK_VERSION = "0.1.3-alpha";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.1-alpha";
4
+ exports.SDK_VERSION = "0.1.3-alpha";
@@ -27,8 +27,8 @@ export class CortiClient {
27
27
  "Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
28
28
  "X-Fern-Language": "JavaScript",
29
29
  "X-Fern-SDK-Name": "@corti/sdk",
30
- "X-Fern-SDK-Version": "0.1.1-alpha",
31
- "User-Agent": "@corti/sdk/0.1.1-alpha",
30
+ "X-Fern-SDK-Version": "0.1.3-alpha",
31
+ "User-Agent": "@corti/sdk/0.1.3-alpha",
32
32
  "X-Fern-Runtime": core.RUNTIME.type,
33
33
  "X-Fern-Runtime-Version": core.RUNTIME.version,
34
34
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -14,7 +14,7 @@ export interface TranscriptsCreateRequest {
14
14
  /** The unique identifier for the recording. */
15
15
  recordingId: Corti.Uuid;
16
16
  /** The primary spoken language of the recording. Check https://docs.corti.ai/about/languages for more. */
17
- primaryLanguage: Corti.TranscriptsCreateRequestPrimaryLanguage;
17
+ primaryLanguage: string;
18
18
  /** Indicates whether spoken dictation commands should be converted to punctuation (e.g., 'comma' → ','). */
19
19
  isDictation?: boolean;
20
20
  /** If true, each audio channel is transcribed separately. */
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.mjs";
2
1
  export * from "./TranscriptsCreateRequestModelName.mjs";
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.mjs";
2
1
  export * from "./TranscriptsCreateRequestModelName.mjs";
@@ -4,20 +4,4 @@
4
4
  /**
5
5
  * Supported language codes
6
6
  */
7
- export type StreamSupportedLanguage = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
8
- export declare const StreamSupportedLanguage: {
9
- readonly En: "en";
10
- readonly EnUs: "en-us";
11
- readonly EnGb: "en-gb";
12
- readonly Da: "da";
13
- readonly Se: "se";
14
- readonly No: "no";
15
- readonly De: "de";
16
- readonly Nl: "nl";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Fr: "fr";
20
- readonly Pt: "pt";
21
- readonly DeCh: "de-ch";
22
- readonly Sv: "sv";
23
- };
7
+ export type StreamSupportedLanguage = string;
@@ -1,19 +1,4 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export const StreamSupportedLanguage = {
5
- En: "en",
6
- EnUs: "en-us",
7
- EnGb: "en-gb",
8
- Da: "da",
9
- Se: "se",
10
- No: "no",
11
- De: "de",
12
- Nl: "nl",
13
- Es: "es",
14
- It: "it",
15
- Fr: "fr",
16
- Pt: "pt",
17
- DeCh: "de-ch",
18
- Sv: "sv",
19
- };
4
+ export {};
@@ -4,20 +4,4 @@
4
4
  /**
5
5
  * Supported language codes for transcription
6
6
  */
7
- export type TranscribeSupportedLanguage = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
8
- export declare const TranscribeSupportedLanguage: {
9
- readonly En: "en";
10
- readonly EnUs: "en-us";
11
- readonly EnGb: "en-gb";
12
- readonly Da: "da";
13
- readonly Se: "se";
14
- readonly No: "no";
15
- readonly De: "de";
16
- readonly Nl: "nl";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Fr: "fr";
20
- readonly Pt: "pt";
21
- readonly DeCh: "de-ch";
22
- readonly Sv: "sv";
23
- };
7
+ export type TranscribeSupportedLanguage = string;
@@ -1,19 +1,4 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export const TranscribeSupportedLanguage = {
5
- En: "en",
6
- EnUs: "en-us",
7
- EnGb: "en-gb",
8
- Da: "da",
9
- Se: "se",
10
- No: "no",
11
- De: "de",
12
- Nl: "nl",
13
- Es: "es",
14
- It: "it",
15
- Fr: "fr",
16
- Pt: "pt",
17
- DeCh: "de-ch",
18
- Sv: "sv",
19
- };
4
+ export {};
@@ -40,7 +40,10 @@ export declare namespace CortiClient {
40
40
  clientSecret: core.Supplier<string>;
41
41
  }
42
42
  interface Options {
43
- environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls>;
43
+ /**
44
+ * Patch: allow to pass a custom string-based environment
45
+ * */
46
+ environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls> | string;
44
47
  /** Override the Tenant-Name header */
45
48
  tenantName: core.Supplier<string>;
46
49
  /** Additional headers to include in requests. */
@@ -61,7 +61,13 @@ export class CortiClient {
61
61
  "User-Agent": `@corti/sdk/${SDK_VERSION}`,
62
62
  "X-Fern-Runtime": core.RUNTIME.type,
63
63
  "X-Fern-Runtime-Version": core.RUNTIME.version,
64
- }, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined });
64
+ }, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment: typeof _options.environment === "string"
65
+ ? {
66
+ base: `https://api.${_options.environment}.corti.app/v2`,
67
+ wss: `wss://api.${_options.environment}.corti.app`,
68
+ login: `https://auth.${_options.environment}.corti.app/realms`,
69
+ }
70
+ : _options.environment });
65
71
  /**
66
72
  * Patch: if `accessToken` is provided, use BearerProvider, otherwise use OAuthTokenProvider
67
73
  */
@@ -69,7 +69,7 @@ export class Stream extends FernStream {
69
69
  || parsedResponse.value.type === 'CONFIG_NOT_PROVIDED')) {
70
70
  ws.socket.dispatchEvent(new ErrorEvent({
71
71
  name: parsedResponse.value.type,
72
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
72
+ message: JSON.stringify(parsedResponse.value),
73
73
  }, ''));
74
74
  ws.close();
75
75
  return;
@@ -77,7 +77,7 @@ export class Stream extends FernStream {
77
77
  if (parsedResponse.ok && parsedResponse.value.type === 'error') {
78
78
  ws.socket.dispatchEvent(new ErrorEvent({
79
79
  name: 'error',
80
- message: JSON.stringify(parsedResponse.value.error),
80
+ message: JSON.stringify(parsedResponse.value),
81
81
  }, ''));
82
82
  ws.close();
83
83
  return;
@@ -3,9 +3,13 @@
3
3
  */
4
4
  import { StreamSocket as FernStreamSocket } from '../api/resources/stream/client/Socket.mjs';
5
5
  export declare class StreamSocket extends FernStreamSocket {
6
- sendAudio(message: ArrayBuffer | string): void;
6
+ sendAudio(message: ArrayBufferLike | Blob | ArrayBufferView | string): void;
7
7
  /**
8
8
  * Patch: have to repeat this method, because it is private in the base class
9
9
  */
10
10
  private __assertSocketIsOpen;
11
+ /**
12
+ * Patch: added ability to remove event handlers
13
+ */
14
+ off<T extends keyof FernStreamSocket.EventHandlers>(event: T, callback?: FernStreamSocket.EventHandlers[T]): void;
11
15
  }
@@ -22,4 +22,12 @@ export class StreamSocket extends FernStreamSocket {
22
22
  throw new Error("Socket is not open.");
23
23
  }
24
24
  }
25
+ /**
26
+ * Patch: added ability to remove event handlers
27
+ */
28
+ off(event, callback) {
29
+ if (!callback || callback === this.eventHandlers[event]) {
30
+ delete this.eventHandlers[event];
31
+ }
32
+ }
25
33
  }
@@ -67,7 +67,7 @@ export class Transcribe extends FernTranscribe {
67
67
  || parsedResponse.value.type === 'CONFIG_TIMEOUT')) {
68
68
  ws.socket.dispatchEvent(new ErrorEvent({
69
69
  name: parsedResponse.value.type,
70
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
70
+ message: JSON.stringify(parsedResponse.value),
71
71
  }, ''));
72
72
  ws.close();
73
73
  return;
@@ -75,7 +75,7 @@ export class Transcribe extends FernTranscribe {
75
75
  if (parsedResponse.ok && parsedResponse.value.type === 'error') {
76
76
  ws.socket.dispatchEvent(new ErrorEvent({
77
77
  name: 'error',
78
- message: JSON.stringify(parsedResponse.value.error),
78
+ message: JSON.stringify(parsedResponse.value),
79
79
  }, ''));
80
80
  ws.close();
81
81
  return;
@@ -3,9 +3,13 @@
3
3
  */
4
4
  import { TranscribeSocket as FernTranscribeSocket } from '../api/resources/transcribe/client/Socket.mjs';
5
5
  export declare class TranscribeSocket extends FernTranscribeSocket {
6
- sendAudio(message: ArrayBuffer | string): void;
6
+ sendAudio(message: ArrayBufferLike | Blob | ArrayBufferView | string): void;
7
7
  /**
8
8
  * Patch: have to repeat this method, because it is private in the base class
9
9
  */
10
10
  private __assertSocketIsOpen;
11
+ /**
12
+ * Patch: added ability to remove event handlers
13
+ */
14
+ off<T extends keyof FernTranscribeSocket.EventHandlers>(event: T, callback?: FernTranscribeSocket.EventHandlers[T]): void;
11
15
  }
@@ -22,4 +22,12 @@ export class TranscribeSocket extends FernTranscribeSocket {
22
22
  throw new Error("Socket is not open.");
23
23
  }
24
24
  }
25
+ /**
26
+ * Patch: added ability to remove event handlers
27
+ */
28
+ off(event, callback) {
29
+ if (!callback || callback === this.eventHandlers[event]) {
30
+ delete this.eventHandlers[event];
31
+ }
32
+ }
25
33
  }
@@ -5,14 +5,13 @@ import * as serializers from "../../../../index.mjs";
5
5
  import * as Corti from "../../../../../api/index.mjs";
6
6
  import * as core from "../../../../../core/index.mjs";
7
7
  import { Uuid } from "../../../../types/Uuid.mjs";
8
- import { TranscriptsCreateRequestPrimaryLanguage } from "../../types/TranscriptsCreateRequestPrimaryLanguage.mjs";
9
8
  import { TranscriptsParticipant } from "../../../../types/TranscriptsParticipant.mjs";
10
9
  import { TranscriptsCreateRequestModelName } from "../../types/TranscriptsCreateRequestModelName.mjs";
11
10
  export declare const TranscriptsCreateRequest: core.serialization.Schema<serializers.TranscriptsCreateRequest.Raw, Corti.TranscriptsCreateRequest>;
12
11
  export declare namespace TranscriptsCreateRequest {
13
12
  interface Raw {
14
13
  recordingId: Uuid.Raw;
15
- primaryLanguage: TranscriptsCreateRequestPrimaryLanguage.Raw;
14
+ primaryLanguage: string;
16
15
  isDictation?: boolean | null;
17
16
  isMultichannel?: boolean | null;
18
17
  diarize?: boolean | null;
@@ -3,12 +3,11 @@
3
3
  */
4
4
  import * as core from "../../../../../core/index.mjs";
5
5
  import { Uuid } from "../../../../types/Uuid.mjs";
6
- import { TranscriptsCreateRequestPrimaryLanguage } from "../../types/TranscriptsCreateRequestPrimaryLanguage.mjs";
7
6
  import { TranscriptsParticipant } from "../../../../types/TranscriptsParticipant.mjs";
8
7
  import { TranscriptsCreateRequestModelName } from "../../types/TranscriptsCreateRequestModelName.mjs";
9
8
  export const TranscriptsCreateRequest = core.serialization.object({
10
9
  recordingId: Uuid,
11
- primaryLanguage: TranscriptsCreateRequestPrimaryLanguage,
10
+ primaryLanguage: core.serialization.string(),
12
11
  isDictation: core.serialization.boolean().optional(),
13
12
  isMultichannel: core.serialization.boolean().optional(),
14
13
  diarize: core.serialization.boolean().optional(),
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.mjs";
2
1
  export * from "./TranscriptsCreateRequestModelName.mjs";
@@ -1,2 +1 @@
1
- export * from "./TranscriptsCreateRequestPrimaryLanguage.mjs";
2
1
  export * from "./TranscriptsCreateRequestModelName.mjs";
@@ -6,5 +6,5 @@ import * as Corti from "../../api/index.mjs";
6
6
  import * as core from "../../core/index.mjs";
7
7
  export declare const StreamSupportedLanguage: core.serialization.Schema<serializers.StreamSupportedLanguage.Raw, Corti.StreamSupportedLanguage>;
8
8
  export declare namespace StreamSupportedLanguage {
9
- type Raw = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
9
+ type Raw = string;
10
10
  }
@@ -2,19 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as core from "../../core/index.mjs";
5
- export const StreamSupportedLanguage = core.serialization.enum_([
6
- "en",
7
- "en-us",
8
- "en-gb",
9
- "da",
10
- "se",
11
- "no",
12
- "de",
13
- "nl",
14
- "es",
15
- "it",
16
- "fr",
17
- "pt",
18
- "de-ch",
19
- "sv",
20
- ]);
5
+ export const StreamSupportedLanguage = core.serialization.string();
@@ -6,5 +6,5 @@ import * as Corti from "../../api/index.mjs";
6
6
  import * as core from "../../core/index.mjs";
7
7
  export declare const TranscribeSupportedLanguage: core.serialization.Schema<serializers.TranscribeSupportedLanguage.Raw, Corti.TranscribeSupportedLanguage>;
8
8
  export declare namespace TranscribeSupportedLanguage {
9
- type Raw = "en" | "en-us" | "en-gb" | "da" | "se" | "no" | "de" | "nl" | "es" | "it" | "fr" | "pt" | "de-ch" | "sv";
9
+ type Raw = string;
10
10
  }
@@ -2,19 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as core from "../../core/index.mjs";
5
- export const TranscribeSupportedLanguage = core.serialization.enum_([
6
- "en",
7
- "en-us",
8
- "en-gb",
9
- "da",
10
- "se",
11
- "no",
12
- "de",
13
- "nl",
14
- "es",
15
- "it",
16
- "fr",
17
- "pt",
18
- "de-ch",
19
- "sv",
20
- ]);
5
+ export const TranscribeSupportedLanguage = core.serialization.string();
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.1-alpha";
1
+ export declare const SDK_VERSION = "0.1.3-alpha";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.1-alpha";
1
+ export const SDK_VERSION = "0.1.3-alpha";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corti/sdk",
3
- "version": "0.1.1-alpha",
3
+ "version": "0.1.3-alpha",
4
4
  "private": false,
5
5
  "repository": "github:corticph/corti-sdk-typescript",
6
6
  "license": "MIT",
@@ -1,21 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * The primary spoken language of the recording. Check https://docs.corti.ai/about/languages for more.
6
- */
7
- export type TranscriptsCreateRequestPrimaryLanguage = "en" | "en-GB" | "da" | "de" | "fr" | "sv" | "de-CH" | "no" | "es" | "it" | "nl" | "pt";
8
- export declare const TranscriptsCreateRequestPrimaryLanguage: {
9
- readonly En: "en";
10
- readonly EnGb: "en-GB";
11
- readonly Da: "da";
12
- readonly De: "de";
13
- readonly Fr: "fr";
14
- readonly Sv: "sv";
15
- readonly DeCh: "de-CH";
16
- readonly No: "no";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Nl: "nl";
20
- readonly Pt: "pt";
21
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TranscriptsCreateRequestPrimaryLanguage = void 0;
7
- exports.TranscriptsCreateRequestPrimaryLanguage = {
8
- En: "en",
9
- EnGb: "en-GB",
10
- Da: "da",
11
- De: "de",
12
- Fr: "fr",
13
- Sv: "sv",
14
- DeCh: "de-CH",
15
- No: "no",
16
- Es: "es",
17
- It: "it",
18
- Nl: "nl",
19
- Pt: "pt",
20
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../../../index.js";
5
- import * as Corti from "../../../../api/index.js";
6
- import * as core from "../../../../core/index.js";
7
- export declare const TranscriptsCreateRequestPrimaryLanguage: core.serialization.Schema<serializers.TranscriptsCreateRequestPrimaryLanguage.Raw, Corti.TranscriptsCreateRequestPrimaryLanguage>;
8
- export declare namespace TranscriptsCreateRequestPrimaryLanguage {
9
- type Raw = "en" | "en-GB" | "da" | "de" | "fr" | "sv" | "de-CH" | "no" | "es" | "it" | "nl" | "pt";
10
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.TranscriptsCreateRequestPrimaryLanguage = void 0;
40
- const core = __importStar(require("../../../../core/index.js"));
41
- exports.TranscriptsCreateRequestPrimaryLanguage = core.serialization.enum_(["en", "en-GB", "da", "de", "fr", "sv", "de-CH", "no", "es", "it", "nl", "pt"]);
@@ -1,21 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * The primary spoken language of the recording. Check https://docs.corti.ai/about/languages for more.
6
- */
7
- export type TranscriptsCreateRequestPrimaryLanguage = "en" | "en-GB" | "da" | "de" | "fr" | "sv" | "de-CH" | "no" | "es" | "it" | "nl" | "pt";
8
- export declare const TranscriptsCreateRequestPrimaryLanguage: {
9
- readonly En: "en";
10
- readonly EnGb: "en-GB";
11
- readonly Da: "da";
12
- readonly De: "de";
13
- readonly Fr: "fr";
14
- readonly Sv: "sv";
15
- readonly DeCh: "de-CH";
16
- readonly No: "no";
17
- readonly Es: "es";
18
- readonly It: "it";
19
- readonly Nl: "nl";
20
- readonly Pt: "pt";
21
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export const TranscriptsCreateRequestPrimaryLanguage = {
5
- En: "en",
6
- EnGb: "en-GB",
7
- Da: "da",
8
- De: "de",
9
- Fr: "fr",
10
- Sv: "sv",
11
- DeCh: "de-CH",
12
- No: "no",
13
- Es: "es",
14
- It: "it",
15
- Nl: "nl",
16
- Pt: "pt",
17
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../../../index.mjs";
5
- import * as Corti from "../../../../api/index.mjs";
6
- import * as core from "../../../../core/index.mjs";
7
- export declare const TranscriptsCreateRequestPrimaryLanguage: core.serialization.Schema<serializers.TranscriptsCreateRequestPrimaryLanguage.Raw, Corti.TranscriptsCreateRequestPrimaryLanguage>;
8
- export declare namespace TranscriptsCreateRequestPrimaryLanguage {
9
- type Raw = "en" | "en-GB" | "da" | "de" | "fr" | "sv" | "de-CH" | "no" | "es" | "it" | "nl" | "pt";
10
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as core from "../../../../core/index.mjs";
5
- export const TranscriptsCreateRequestPrimaryLanguage = core.serialization.enum_(["en", "en-GB", "da", "de", "fr", "sv", "de-CH", "no", "es", "it", "nl", "pt"]);