@corti/sdk 0.1.0-alpha → 0.1.0-rc

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 (225) hide show
  1. package/README.md +10 -11
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/recordings/client/Client.d.ts +2 -4
  4. package/dist/cjs/api/resources/recordings/client/Client.js +7 -6
  5. package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -1
  6. package/dist/cjs/api/resources/transcripts/types/index.d.ts +0 -1
  7. package/dist/cjs/api/resources/transcripts/types/index.js +0 -1
  8. package/dist/cjs/api/types/DocumentsContext.d.ts +11 -5
  9. package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +8 -0
  10. package/dist/cjs/api/types/DocumentsContextWithString.d.ts +7 -0
  11. package/dist/cjs/api/types/DocumentsContextWithString.js +5 -0
  12. package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +8 -0
  13. package/dist/cjs/api/types/DocumentsContextWithTranscript.js +5 -0
  14. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplate.d.ts +1 -1
  15. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateId.d.ts +1 -1
  16. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateKey.d.ts +1 -1
  17. package/dist/cjs/api/types/DocumentsTemplate.d.ts +1 -10
  18. package/dist/cjs/api/types/DocumentsTemplateWithSectionIds.d.ts +12 -0
  19. package/dist/cjs/api/types/DocumentsTemplateWithSectionIds.js +5 -0
  20. package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.d.ts +11 -0
  21. package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.js +5 -0
  22. package/dist/cjs/api/types/StreamSupportedLanguage.d.ts +1 -17
  23. package/dist/cjs/api/types/StreamSupportedLanguage.js +0 -17
  24. package/dist/cjs/api/types/TemplatesSection.d.ts +1 -1
  25. package/dist/cjs/api/types/TemplatesSectionTranslation.d.ts +11 -0
  26. package/dist/cjs/api/types/TemplatesSectionTranslation.js +5 -0
  27. package/dist/cjs/api/types/TemplatesTranslation.d.ts +2 -2
  28. package/dist/cjs/api/types/TranscribeSupportedLanguage.d.ts +1 -17
  29. package/dist/cjs/api/types/TranscribeSupportedLanguage.js +0 -17
  30. package/dist/cjs/api/types/index.d.ts +6 -2
  31. package/dist/cjs/api/types/index.js +6 -2
  32. package/dist/cjs/core/exports.d.ts +1 -0
  33. package/dist/cjs/core/exports.js +17 -0
  34. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +7 -4
  35. package/dist/cjs/core/fetcher/BinaryResponse.js +5 -2
  36. package/dist/cjs/core/fetcher/Fetcher.js +3 -3
  37. package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
  38. package/dist/cjs/core/fetcher/getErrorResponseBody.js +44 -0
  39. package/dist/cjs/core/fetcher/getResponseBody.js +2 -1
  40. package/dist/cjs/core/file/exports.d.ts +1 -0
  41. package/dist/cjs/core/file/exports.js +2 -0
  42. package/dist/cjs/core/file/file.d.ts +5 -0
  43. package/dist/cjs/core/file/file.js +203 -0
  44. package/dist/cjs/core/file/index.d.ts +2 -0
  45. package/dist/cjs/core/file/index.js +18 -0
  46. package/dist/cjs/core/file/types.d.ts +66 -0
  47. package/dist/cjs/core/file/types.js +2 -0
  48. package/dist/cjs/core/index.d.ts +1 -0
  49. package/dist/cjs/core/index.js +2 -1
  50. package/dist/cjs/core/schemas/utils/maybeSkipValidation.js +1 -1
  51. package/dist/cjs/core/url/join.js +23 -3
  52. package/dist/cjs/core/websocket/ws.js +1 -1
  53. package/dist/cjs/custom/CortiAuth.d.ts +8 -0
  54. package/dist/cjs/custom/CortiAuth.js +7 -0
  55. package/dist/cjs/custom/CortiClient.d.ts +4 -1
  56. package/dist/cjs/custom/CortiClient.js +2 -1
  57. package/dist/cjs/custom/CustomStream.d.ts +3 -1
  58. package/dist/cjs/custom/CustomStream.js +22 -2
  59. package/dist/cjs/custom/CustomStreamSocket.d.ts +5 -1
  60. package/dist/cjs/custom/CustomStreamSocket.js +8 -0
  61. package/dist/cjs/custom/CustomTranscribe.d.ts +3 -1
  62. package/dist/cjs/custom/CustomTranscribe.js +22 -2
  63. package/dist/cjs/custom/CustomTranscribeSocket.d.ts +5 -1
  64. package/dist/cjs/custom/CustomTranscribeSocket.js +8 -0
  65. package/dist/cjs/custom/utils/getEnvironmentFromString.d.ts +6 -0
  66. package/dist/cjs/custom/utils/getEnvironmentFromString.js +12 -0
  67. package/dist/cjs/environments.d.ts +1 -6
  68. package/dist/cjs/environments.js +0 -5
  69. package/dist/cjs/exports.d.ts +1 -0
  70. package/dist/cjs/exports.js +17 -0
  71. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -2
  72. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +1 -2
  73. package/dist/cjs/serialization/resources/transcripts/types/index.d.ts +0 -1
  74. package/dist/cjs/serialization/resources/transcripts/types/index.js +0 -1
  75. package/dist/cjs/serialization/types/DocumentsContext.d.ts +13 -6
  76. package/dist/cjs/serialization/types/DocumentsContext.js +12 -5
  77. package/dist/cjs/serialization/types/DocumentsContextWithFacts.d.ts +13 -0
  78. package/dist/cjs/serialization/{resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.js → types/DocumentsContextWithFacts.js} +6 -3
  79. package/dist/cjs/serialization/types/DocumentsContextWithString.d.ts +12 -0
  80. package/dist/cjs/serialization/types/{DocumentsContextTypeEnum.js → DocumentsContextWithString.js} +4 -2
  81. package/dist/cjs/serialization/types/DocumentsContextWithTranscript.d.ts +13 -0
  82. package/dist/cjs/serialization/types/{DocumentsContextData.js → DocumentsContextWithTranscript.js} +4 -7
  83. package/dist/cjs/serialization/types/DocumentsTemplate.d.ts +4 -8
  84. package/dist/cjs/serialization/types/DocumentsTemplate.js +3 -7
  85. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionIds.d.ts +15 -0
  86. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionIds.js +46 -0
  87. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.d.ts +14 -0
  88. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.js +45 -0
  89. package/dist/cjs/serialization/types/StreamSupportedLanguage.d.ts +1 -1
  90. package/dist/cjs/serialization/types/StreamSupportedLanguage.js +1 -16
  91. package/dist/cjs/serialization/types/TemplatesSection.d.ts +2 -2
  92. package/dist/cjs/serialization/types/TemplatesSection.js +2 -2
  93. package/dist/cjs/serialization/types/TemplatesSectionTranslation.d.ts +14 -0
  94. package/dist/cjs/serialization/types/TemplatesSectionTranslation.js +45 -0
  95. package/dist/cjs/serialization/types/TemplatesTranslation.d.ts +2 -2
  96. package/dist/cjs/serialization/types/TemplatesTranslation.js +2 -2
  97. package/dist/cjs/serialization/types/TranscribeSupportedLanguage.d.ts +1 -1
  98. package/dist/cjs/serialization/types/TranscribeSupportedLanguage.js +1 -16
  99. package/dist/cjs/serialization/types/index.d.ts +6 -2
  100. package/dist/cjs/serialization/types/index.js +6 -2
  101. package/dist/cjs/version.d.ts +1 -1
  102. package/dist/cjs/version.js +1 -1
  103. package/dist/esm/Client.mjs +2 -2
  104. package/dist/esm/api/resources/recordings/client/Client.d.mts +2 -4
  105. package/dist/esm/api/resources/recordings/client/Client.mjs +7 -6
  106. package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -1
  107. package/dist/esm/api/resources/transcripts/types/index.d.mts +0 -1
  108. package/dist/esm/api/resources/transcripts/types/index.mjs +0 -1
  109. package/dist/esm/api/types/DocumentsContext.d.mts +11 -5
  110. package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +8 -0
  111. package/dist/esm/api/types/DocumentsContextWithString.d.mts +7 -0
  112. package/dist/esm/api/types/DocumentsContextWithString.mjs +4 -0
  113. package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +8 -0
  114. package/dist/esm/api/types/DocumentsContextWithTranscript.mjs +4 -0
  115. package/dist/esm/api/types/DocumentsCreateRequestWithTemplate.d.mts +1 -1
  116. package/dist/esm/api/types/DocumentsCreateRequestWithTemplateId.d.mts +1 -1
  117. package/dist/esm/api/types/DocumentsCreateRequestWithTemplateKey.d.mts +1 -1
  118. package/dist/esm/api/types/DocumentsTemplate.d.mts +1 -10
  119. package/dist/esm/api/types/DocumentsTemplateWithSectionIds.d.mts +12 -0
  120. package/dist/esm/api/types/DocumentsTemplateWithSectionIds.mjs +4 -0
  121. package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.d.mts +11 -0
  122. package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.mjs +4 -0
  123. package/dist/esm/api/types/StreamSupportedLanguage.d.mts +1 -17
  124. package/dist/esm/api/types/StreamSupportedLanguage.mjs +1 -16
  125. package/dist/esm/api/types/TemplatesSection.d.mts +1 -1
  126. package/dist/esm/api/types/TemplatesSectionTranslation.d.mts +11 -0
  127. package/dist/esm/api/types/TemplatesSectionTranslation.mjs +4 -0
  128. package/dist/esm/api/types/TemplatesTranslation.d.mts +2 -2
  129. package/dist/esm/api/types/TranscribeSupportedLanguage.d.mts +1 -17
  130. package/dist/esm/api/types/TranscribeSupportedLanguage.mjs +1 -16
  131. package/dist/esm/api/types/index.d.mts +6 -2
  132. package/dist/esm/api/types/index.mjs +6 -2
  133. package/dist/esm/core/exports.d.mts +1 -0
  134. package/dist/esm/core/exports.mjs +1 -0
  135. package/dist/esm/core/fetcher/BinaryResponse.d.mts +7 -4
  136. package/dist/esm/core/fetcher/BinaryResponse.mjs +5 -2
  137. package/dist/esm/core/fetcher/Fetcher.mjs +3 -3
  138. package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
  139. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +41 -0
  140. package/dist/esm/core/fetcher/getResponseBody.mjs +2 -1
  141. package/dist/esm/core/file/exports.d.mts +1 -0
  142. package/dist/esm/core/file/exports.mjs +1 -0
  143. package/dist/esm/core/file/file.d.mts +5 -0
  144. package/dist/esm/core/file/file.mjs +167 -0
  145. package/dist/esm/core/file/index.d.mts +2 -0
  146. package/dist/esm/core/file/index.mjs +2 -0
  147. package/dist/esm/core/file/types.d.mts +66 -0
  148. package/dist/esm/core/file/types.mjs +1 -0
  149. package/dist/esm/core/index.d.mts +1 -0
  150. package/dist/esm/core/index.mjs +1 -0
  151. package/dist/esm/core/schemas/utils/maybeSkipValidation.mjs +1 -1
  152. package/dist/esm/core/url/join.mjs +23 -3
  153. package/dist/esm/core/websocket/ws.mjs +1 -1
  154. package/dist/esm/custom/CortiAuth.d.mts +8 -0
  155. package/dist/esm/custom/CortiAuth.mjs +7 -0
  156. package/dist/esm/custom/CortiClient.d.mts +4 -1
  157. package/dist/esm/custom/CortiClient.mjs +2 -1
  158. package/dist/esm/custom/CustomStream.d.mts +3 -1
  159. package/dist/esm/custom/CustomStream.mjs +22 -2
  160. package/dist/esm/custom/CustomStreamSocket.d.mts +5 -1
  161. package/dist/esm/custom/CustomStreamSocket.mjs +8 -0
  162. package/dist/esm/custom/CustomTranscribe.d.mts +3 -1
  163. package/dist/esm/custom/CustomTranscribe.mjs +22 -2
  164. package/dist/esm/custom/CustomTranscribeSocket.d.mts +5 -1
  165. package/dist/esm/custom/CustomTranscribeSocket.mjs +8 -0
  166. package/dist/esm/custom/utils/getEnvironmentFromString.d.mts +6 -0
  167. package/dist/esm/custom/utils/getEnvironmentFromString.mjs +9 -0
  168. package/dist/esm/environments.d.mts +1 -6
  169. package/dist/esm/environments.mjs +0 -5
  170. package/dist/esm/exports.d.mts +1 -0
  171. package/dist/esm/exports.mjs +1 -0
  172. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -2
  173. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +1 -2
  174. package/dist/esm/serialization/resources/transcripts/types/index.d.mts +0 -1
  175. package/dist/esm/serialization/resources/transcripts/types/index.mjs +0 -1
  176. package/dist/esm/serialization/types/DocumentsContext.d.mts +13 -6
  177. package/dist/esm/serialization/types/DocumentsContext.mjs +12 -5
  178. package/dist/esm/serialization/types/DocumentsContextWithFacts.d.mts +13 -0
  179. package/dist/esm/serialization/types/DocumentsContextWithFacts.mjs +8 -0
  180. package/dist/esm/serialization/types/DocumentsContextWithString.d.mts +12 -0
  181. package/dist/esm/serialization/types/{DocumentsContextTypeEnum.mjs → DocumentsContextWithString.mjs} +3 -1
  182. package/dist/esm/serialization/types/DocumentsContextWithTranscript.d.mts +13 -0
  183. package/dist/esm/serialization/types/DocumentsContextWithTranscript.mjs +8 -0
  184. package/dist/esm/serialization/types/DocumentsTemplate.d.mts +4 -8
  185. package/dist/esm/serialization/types/DocumentsTemplate.mjs +3 -7
  186. package/dist/esm/serialization/types/DocumentsTemplateWithSectionIds.d.mts +15 -0
  187. package/dist/esm/serialization/types/DocumentsTemplateWithSectionIds.mjs +10 -0
  188. package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.d.mts +14 -0
  189. package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.mjs +9 -0
  190. package/dist/esm/serialization/types/StreamSupportedLanguage.d.mts +1 -1
  191. package/dist/esm/serialization/types/StreamSupportedLanguage.mjs +1 -16
  192. package/dist/esm/serialization/types/TemplatesSection.d.mts +2 -2
  193. package/dist/esm/serialization/types/TemplatesSection.mjs +2 -2
  194. package/dist/esm/serialization/types/TemplatesSectionTranslation.d.mts +14 -0
  195. package/dist/esm/serialization/types/TemplatesSectionTranslation.mjs +9 -0
  196. package/dist/esm/serialization/types/TemplatesTranslation.d.mts +2 -2
  197. package/dist/esm/serialization/types/TemplatesTranslation.mjs +2 -2
  198. package/dist/esm/serialization/types/TranscribeSupportedLanguage.d.mts +1 -1
  199. package/dist/esm/serialization/types/TranscribeSupportedLanguage.mjs +1 -16
  200. package/dist/esm/serialization/types/index.d.mts +6 -2
  201. package/dist/esm/serialization/types/index.mjs +6 -2
  202. package/dist/esm/version.d.mts +1 -1
  203. package/dist/esm/version.mjs +1 -1
  204. package/package.json +4 -3
  205. package/reference.md +1 -1
  206. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.ts +0 -21
  207. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.js +0 -20
  208. package/dist/cjs/api/types/DocumentsContextData.d.ts +0 -14
  209. package/dist/cjs/api/types/DocumentsContextTypeEnum.d.ts +0 -9
  210. package/dist/cjs/api/types/DocumentsContextTypeEnum.js +0 -11
  211. package/dist/cjs/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.ts +0 -10
  212. package/dist/cjs/serialization/types/DocumentsContextData.d.ts +0 -12
  213. package/dist/cjs/serialization/types/DocumentsContextTypeEnum.d.ts +0 -10
  214. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.mts +0 -21
  215. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.mjs +0 -17
  216. package/dist/esm/api/types/DocumentsContextData.d.mts +0 -14
  217. package/dist/esm/api/types/DocumentsContextTypeEnum.d.mts +0 -9
  218. package/dist/esm/api/types/DocumentsContextTypeEnum.mjs +0 -8
  219. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.d.mts +0 -10
  220. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestPrimaryLanguage.mjs +0 -5
  221. package/dist/esm/serialization/types/DocumentsContextData.d.mts +0 -12
  222. package/dist/esm/serialization/types/DocumentsContextData.mjs +0 -11
  223. package/dist/esm/serialization/types/DocumentsContextTypeEnum.d.mts +0 -10
  224. /package/dist/cjs/api/types/{DocumentsContextData.js → DocumentsContextWithFacts.js} +0 -0
  225. /package/dist/esm/api/types/{DocumentsContextData.mjs → DocumentsContextWithFacts.mjs} +0 -0
@@ -0,0 +1,41 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { fromJson } from "../json.mjs";
11
+ import { getResponseBody } from "./getResponseBody.mjs";
12
+ export function getErrorResponseBody(response) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ var _a, _b, _c;
15
+ let contentType = (_a = response.headers.get("Content-Type")) === null || _a === void 0 ? void 0 : _a.toLowerCase();
16
+ if (contentType == null || contentType.length === 0) {
17
+ return getResponseBody(response);
18
+ }
19
+ if (contentType.indexOf(";") !== -1) {
20
+ contentType = (_c = (_b = contentType.split(";")[0]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : "";
21
+ }
22
+ switch (contentType) {
23
+ case "application/hal+json":
24
+ case "application/json":
25
+ case "application/ld+json":
26
+ case "application/problem+json":
27
+ case "application/vnd.api+json":
28
+ case "text/json":
29
+ const text = yield response.text();
30
+ return text.length > 0 ? fromJson(text) : undefined;
31
+ default:
32
+ if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) {
33
+ const text = yield response.text();
34
+ return text.length > 0 ? fromJson(text) : undefined;
35
+ }
36
+ // Fallback to plain text if content type is not recognized
37
+ // Even if no body is present, the response will be an empty string
38
+ return yield response.text();
39
+ }
40
+ });
41
+ }
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { getBinaryResponse } from "./BinaryResponse.mjs";
11
11
  import { isResponseWithBody } from "./ResponseWithBody.mjs";
12
+ import { fromJson } from "../json.mjs";
12
13
  export function getResponseBody(response, responseType) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  if (!isResponseWithBody(response)) {
@@ -32,7 +33,7 @@ export function getResponseBody(response, responseType) {
32
33
  const text = yield response.text();
33
34
  if (text.length > 0) {
34
35
  try {
35
- let responseBody = JSON.parse(text);
36
+ let responseBody = fromJson(text);
36
37
  return responseBody;
37
38
  }
38
39
  catch (err) {
@@ -0,0 +1 @@
1
+ export { Uploadable } from "./types.mjs";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Uploadable } from "./types.mjs";
2
+ export declare function toBinaryUploadRequest(file: Uploadable): Promise<{
3
+ body: Uploadable.FileLike;
4
+ headers?: Record<string, string>;
5
+ }>;
@@ -0,0 +1,167 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ export function toBinaryUploadRequest(file) {
11
+ return __awaiter(this, void 0, void 0, function* () {
12
+ const { data, filename, contentLength, contentType } = yield getFileWithMetadata(file);
13
+ const request = {
14
+ body: data,
15
+ headers: {},
16
+ };
17
+ if (filename) {
18
+ request.headers["Content-Disposition"] = `attachment; filename="${filename}"`;
19
+ }
20
+ if (contentType) {
21
+ request.headers["Content-Type"] = contentType;
22
+ }
23
+ if (contentLength != null) {
24
+ request.headers["Content-Length"] = contentLength.toString();
25
+ }
26
+ return request;
27
+ });
28
+ }
29
+ function getFileWithMetadata(file) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ var _a, _b, _c, _d, _e;
32
+ if (isFileLike(file)) {
33
+ return getFileWithMetadata({
34
+ data: file,
35
+ });
36
+ }
37
+ if ("path" in file) {
38
+ const fs = yield import("fs");
39
+ if (!fs || !fs.createReadStream) {
40
+ throw new Error("File path uploads are not supported in this environment.");
41
+ }
42
+ const data = fs.createReadStream(file.path);
43
+ const contentLength = (_a = file.contentLength) !== null && _a !== void 0 ? _a : (yield tryGetFileSizeFromPath(file.path));
44
+ const filename = (_b = file.filename) !== null && _b !== void 0 ? _b : getNameFromPath(file.path);
45
+ return {
46
+ data,
47
+ filename,
48
+ contentType: file.contentType,
49
+ contentLength,
50
+ };
51
+ }
52
+ if ("data" in file) {
53
+ const data = file.data;
54
+ const contentLength = (_c = file.contentLength) !== null && _c !== void 0 ? _c : (yield tryGetContentLengthFromFileLike(data));
55
+ const filename = (_d = file.filename) !== null && _d !== void 0 ? _d : tryGetNameFromFileLike(data);
56
+ return {
57
+ data,
58
+ filename,
59
+ contentType: (_e = file.contentType) !== null && _e !== void 0 ? _e : tryGetContentTypeFromFileLike(data),
60
+ contentLength,
61
+ };
62
+ }
63
+ throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);
64
+ });
65
+ }
66
+ function isFileLike(value) {
67
+ return (isBuffer(value) ||
68
+ isArrayBufferView(value) ||
69
+ isArrayBuffer(value) ||
70
+ isUint8Array(value) ||
71
+ isBlob(value) ||
72
+ isFile(value) ||
73
+ isStreamLike(value) ||
74
+ isReadableStream(value));
75
+ }
76
+ function tryGetFileSizeFromPath(path) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ try {
79
+ const fs = yield import("fs");
80
+ if (!fs || !fs.promises || !fs.promises.stat) {
81
+ return undefined;
82
+ }
83
+ const fileStat = yield fs.promises.stat(path);
84
+ return fileStat.size;
85
+ }
86
+ catch (fallbackError) {
87
+ return undefined;
88
+ }
89
+ });
90
+ }
91
+ function tryGetNameFromFileLike(data) {
92
+ if (isNamedValue(data)) {
93
+ return data.name;
94
+ }
95
+ if (isPathedValue(data)) {
96
+ return getNameFromPath(data.path.toString());
97
+ }
98
+ return undefined;
99
+ }
100
+ function tryGetContentLengthFromFileLike(data) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ if (isBuffer(data)) {
103
+ return data.length;
104
+ }
105
+ if (isArrayBufferView(data)) {
106
+ return data.byteLength;
107
+ }
108
+ if (isArrayBuffer(data)) {
109
+ return data.byteLength;
110
+ }
111
+ if (isBlob(data)) {
112
+ return data.size;
113
+ }
114
+ if (isFile(data)) {
115
+ return data.size;
116
+ }
117
+ if (isPathedValue(data)) {
118
+ return yield tryGetFileSizeFromPath(data.path.toString());
119
+ }
120
+ return undefined;
121
+ });
122
+ }
123
+ function tryGetContentTypeFromFileLike(data) {
124
+ if (isBlob(data)) {
125
+ return data.type;
126
+ }
127
+ if (isFile(data)) {
128
+ return data.type;
129
+ }
130
+ return undefined;
131
+ }
132
+ function getNameFromPath(path) {
133
+ const lastForwardSlash = path.lastIndexOf("/");
134
+ const lastBackSlash = path.lastIndexOf("\\");
135
+ const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
136
+ return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;
137
+ }
138
+ function isNamedValue(value) {
139
+ return typeof value === "object" && value != null && "name" in value;
140
+ }
141
+ function isPathedValue(value) {
142
+ return typeof value === "object" && value != null && "path" in value;
143
+ }
144
+ function isStreamLike(value) {
145
+ return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
146
+ }
147
+ function isReadableStream(value) {
148
+ return typeof value === "object" && value != null && "getReader" in value;
149
+ }
150
+ function isBuffer(value) {
151
+ return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
152
+ }
153
+ function isArrayBufferView(value) {
154
+ return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
155
+ }
156
+ function isArrayBuffer(value) {
157
+ return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
158
+ }
159
+ function isUint8Array(value) {
160
+ return typeof Uint8Array !== "undefined" && value instanceof Uint8Array;
161
+ }
162
+ function isBlob(value) {
163
+ return typeof Blob !== "undefined" && value instanceof Blob;
164
+ }
165
+ function isFile(value) {
166
+ return typeof File !== "undefined" && value instanceof File;
167
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./file.mjs";
2
+ export * from "./types.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./file.mjs";
2
+ export * from "./types.mjs";
@@ -0,0 +1,66 @@
1
+ /**
2
+ * A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.),
3
+ * a path to a file, or an object with a file-like object and metadata.
4
+ */
5
+ export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata;
6
+ export declare namespace Uploadable {
7
+ /**
8
+ * Various file-like objects that can be used to upload a file.
9
+ */
10
+ type FileLike = ArrayBuffer | ArrayBufferLike | ArrayBufferView | Uint8Array | import("buffer").Buffer | import("buffer").Blob | import("buffer").File | import("stream").Readable | import("stream/web").ReadableStream | globalThis.Blob | globalThis.File | ReadableStream;
11
+ /**
12
+ * A file path with optional metadata, used for uploading a file from the file system.
13
+ */
14
+ type FromPath = {
15
+ /** The path to the file to upload */
16
+ path: string;
17
+ /**
18
+ * Optional override for the file name (defaults to basename of path).
19
+ * This is used to set the `Content-Disposition` header in upload requests.
20
+ */
21
+ filename?: string;
22
+ /**
23
+ * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
24
+ * This is used to set the `Content-Type` header in upload requests.
25
+ */
26
+ contentType?: string;
27
+ /**
28
+ * Optional file size in bytes.
29
+ * If not provided, the file size will be determined from the file system.
30
+ * The content length is used to set the `Content-Length` header in upload requests.
31
+ */
32
+ contentLength?: number;
33
+ };
34
+ /**
35
+ * A file-like object with metadata, used for uploading files.
36
+ */
37
+ type WithMetadata = {
38
+ /** The file data */
39
+ data: FileLike;
40
+ /**
41
+ * Optional override for the file name (defaults to basename of path).
42
+ * This is used to set the `Content-Disposition` header in upload requests.
43
+ */
44
+ filename?: string;
45
+ /**
46
+ * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
47
+ * This is used to set the `Content-Type` header in upload requests.
48
+ *
49
+ * If not provided, the content type may be determined from the data itself.
50
+ * * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set.
51
+ * * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead.
52
+ */
53
+ contentType?: string;
54
+ /**
55
+ * Optional file size in bytes.
56
+ * The content length is used to set the `Content-Length` header in upload requests.
57
+ * If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead.
58
+ *
59
+ * If not provided, the file size will be determined depending on the data type.
60
+ * * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system.
61
+ * * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself.
62
+ * * If the data is a `Readable` or `ReadableStream`, the size will not be determined.
63
+ */
64
+ contentLength?: number;
65
+ };
66
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -7,3 +7,4 @@ export * from "./websocket/index.mjs";
7
7
  export * from "./base64.mjs";
8
8
  export * from "./utils/index.mjs";
9
9
  export * from "./pagination/index.mjs";
10
+ export * as file from "./file/index.mjs";
@@ -7,3 +7,4 @@ export * from "./websocket/index.mjs";
7
7
  export * from "./base64.mjs";
8
8
  export * from "./utils/index.mjs";
9
9
  export * from "./pagination/index.mjs";
10
+ export * as file from "./file/index.mjs";
@@ -6,7 +6,7 @@ function transformAndMaybeSkipValidation(transform) {
6
6
  const transformed = transform(value, opts);
7
7
  const { skipValidation = false } = opts !== null && opts !== void 0 ? opts : {};
8
8
  if (!transformed.ok && skipValidation) {
9
- // eslint-disable-next-line no-console
9
+ // biome-ignore lint/suspicious/noConsole: allow console
10
10
  console.warn([
11
11
  "Failed to validate.",
12
12
  ...transformed.errors.map((error) => " - " +
@@ -2,6 +2,9 @@ export function join(base, ...segments) {
2
2
  if (!base) {
3
3
  return "";
4
4
  }
5
+ if (segments.length === 0) {
6
+ return base;
7
+ }
5
8
  if (base.includes("://")) {
6
9
  let url;
7
10
  try {
@@ -11,24 +14,37 @@ export function join(base, ...segments) {
11
14
  // Fallback to path joining if URL is malformed
12
15
  return joinPath(base, ...segments);
13
16
  }
17
+ const lastSegment = segments[segments.length - 1];
18
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
14
19
  for (const segment of segments) {
15
20
  const cleanSegment = trimSlashes(segment);
16
21
  if (cleanSegment) {
17
22
  url.pathname = joinPathSegments(url.pathname, cleanSegment);
18
23
  }
19
24
  }
25
+ if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
26
+ url.pathname += "/";
27
+ }
20
28
  return url.toString();
21
29
  }
22
30
  return joinPath(base, ...segments);
23
31
  }
24
32
  function joinPath(base, ...segments) {
33
+ if (segments.length === 0) {
34
+ return base;
35
+ }
25
36
  let result = base;
37
+ const lastSegment = segments[segments.length - 1];
38
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
26
39
  for (const segment of segments) {
27
40
  const cleanSegment = trimSlashes(segment);
28
41
  if (cleanSegment) {
29
42
  result = joinPathSegments(result, cleanSegment);
30
43
  }
31
44
  }
45
+ if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
46
+ result += "/";
47
+ }
32
48
  return result;
33
49
  }
34
50
  function joinPathSegments(left, right) {
@@ -40,7 +56,11 @@ function joinPathSegments(left, right) {
40
56
  function trimSlashes(str) {
41
57
  if (!str)
42
58
  return str;
43
- let start = str.startsWith("/") ? 1 : 0;
44
- let end = str.endsWith("/") ? str.length - 1 : str.length;
45
- return str.slice(start, end);
59
+ let start = 0;
60
+ let end = str.length;
61
+ if (str.startsWith("/"))
62
+ start = 1;
63
+ if (str.endsWith("/"))
64
+ end = str.length - 1;
65
+ return start === 0 && end === str.length ? str : str.slice(start, end);
46
66
  }
@@ -286,7 +286,7 @@ export class ReconnectingWebSocket {
286
286
  if (this._options.debug) {
287
287
  // not using spread because compiled version uses Symbols
288
288
  // tslint:disable-next-line
289
- // eslint-disable-next-line no-console
289
+ // biome-ignore lint/suspicious/noConsole: allow console
290
290
  console.log.apply(console, ["RWS>", ...args]);
291
291
  }
292
292
  }
@@ -14,6 +14,7 @@
14
14
  import { Auth as FernAuth } from "../api/resources/auth/client/Client.mjs";
15
15
  import * as core from "../core/index.mjs";
16
16
  import * as Corti from "../api/index.mjs";
17
+ import * as environments from "../environments.mjs";
17
18
  interface AuthorizationCodeClient {
18
19
  clientId: string;
19
20
  redirectUri: string;
@@ -32,7 +33,14 @@ interface AuthorizationRefreshServer {
32
33
  interface Options {
33
34
  skipRedirect?: boolean;
34
35
  }
36
+ type AuthOptions = Omit<FernAuth.Options, 'environment'> & {
37
+ environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls> | string;
38
+ };
35
39
  export declare class Auth extends FernAuth {
40
+ /**
41
+ * Patch: use custom AuthOptions type to support string-based environment
42
+ */
43
+ constructor(_options: AuthOptions);
36
44
  /**
37
45
  * Patch: called custom implementation this.__getToken_custom instead of this.__getToken
38
46
  */
@@ -25,7 +25,14 @@ import * as core from "../core/index.mjs";
25
25
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../core/headers.mjs";
26
26
  import * as serializers from "../serialization/index.mjs";
27
27
  import * as errors from "../errors/index.mjs";
28
+ import { getEnvironment } from "./utils/getEnvironmentFromString.mjs";
28
29
  export class Auth extends FernAuth {
30
+ /**
31
+ * Patch: use custom AuthOptions type to support string-based environment
32
+ */
33
+ constructor(_options) {
34
+ super(Object.assign(Object.assign({}, _options), { environment: getEnvironment(_options.environment) }));
35
+ }
29
36
  /**
30
37
  * Patch: called custom implementation this.__getToken_custom instead of this.__getToken
31
38
  */
@@ -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. */
@@ -48,6 +48,7 @@ import { RefreshBearerProvider } from "./RefreshBearerProvider.mjs";
48
48
  * Patch: added SDK_VERSION import
49
49
  */
50
50
  import { SDK_VERSION } from '../version.mjs';
51
+ import { getEnvironment } from "./utils/getEnvironmentFromString.mjs";
51
52
  export class CortiClient {
52
53
  constructor(_options) {
53
54
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
@@ -61,7 +62,7 @@ export class CortiClient {
61
62
  "User-Agent": `@corti/sdk/${SDK_VERSION}`,
62
63
  "X-Fern-Runtime": core.RUNTIME.type,
63
64
  "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 });
65
+ }, _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: getEnvironment(_options.environment) });
65
66
  /**
66
67
  * Patch: if `accessToken` is provided, use BearerProvider, otherwise use OAuthTokenProvider
67
68
  */
@@ -14,5 +14,7 @@ export declare class Stream extends FernStream {
14
14
  /**
15
15
  * Patch: use custom connect method to support passing _options parameters
16
16
  */
17
- connect(args: Omit<FernStream.ConnectArgs, 'token' | 'tenantName'>, configuration?: api.StreamConfig): Promise<StreamSocket>;
17
+ connect({ configuration, ...args }: Omit<FernStream.ConnectArgs, 'token' | 'tenantName'> & {
18
+ configuration?: api.StreamConfig;
19
+ }): Promise<StreamSocket>;
18
20
  }
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
10
21
  /**
11
22
  * Patch: use custom Stream implementation to support passing _options parameters to connection function
12
23
  */
@@ -23,11 +34,12 @@ export class Stream extends FernStream {
23
34
  /**
24
35
  * Patch: use custom connect method to support passing _options parameters
25
36
  */
26
- connect(args, configuration) {
37
+ connect(_a) {
27
38
  const _super = Object.create(null, {
28
39
  connect: { get: () => super.connect }
29
40
  });
30
41
  return __awaiter(this, void 0, void 0, function* () {
42
+ var { configuration } = _a, args = __rest(_a, ["configuration"]);
31
43
  const fernWs = yield _super.connect.call(this, Object.assign(Object.assign({}, args), { token: (yield this._getAuthorizationHeader()) || '', tenantName: yield core.Supplier.get(this._options.tenantName) }));
32
44
  const ws = new StreamSocket({ socket: fernWs.socket });
33
45
  if (!configuration) {
@@ -57,7 +69,15 @@ export class Stream extends FernStream {
57
69
  || parsedResponse.value.type === 'CONFIG_NOT_PROVIDED')) {
58
70
  ws.socket.dispatchEvent(new ErrorEvent({
59
71
  name: parsedResponse.value.type,
60
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
72
+ message: JSON.stringify(parsedResponse.value),
73
+ }, ''));
74
+ ws.close();
75
+ return;
76
+ }
77
+ if (parsedResponse.ok && parsedResponse.value.type === 'error') {
78
+ ws.socket.dispatchEvent(new ErrorEvent({
79
+ name: 'error',
80
+ message: JSON.stringify(parsedResponse.value),
61
81
  }, ''));
62
82
  ws.close();
63
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
  }
@@ -14,5 +14,7 @@ export declare class Transcribe extends FernTranscribe {
14
14
  /**
15
15
  * Patch: use custom connect method to support passing _options parameters
16
16
  */
17
- connect(args?: Omit<FernTranscribe.ConnectArgs, 'token' | 'tenantName'>, configuration?: api.TranscribeConfig): Promise<TranscribeSocket>;
17
+ connect({ configuration, ...args }?: Omit<FernTranscribe.ConnectArgs, 'token' | 'tenantName'> & {
18
+ configuration?: api.TranscribeConfig;
19
+ }): Promise<TranscribeSocket>;
18
20
  }
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
10
21
  /**
11
22
  * Patch: use custom Transcribe implementation to support passing _options parameters to connection function
12
23
  */
@@ -27,7 +38,8 @@ export class Transcribe extends FernTranscribe {
27
38
  const _super = Object.create(null, {
28
39
  connect: { get: () => super.connect }
29
40
  });
30
- return __awaiter(this, arguments, void 0, function* (args = {}, configuration) {
41
+ return __awaiter(this, arguments, void 0, function* (_a = {}) {
42
+ var { configuration } = _a, args = __rest(_a, ["configuration"]);
31
43
  const fernWs = yield _super.connect.call(this, Object.assign(Object.assign({}, args), { token: (yield this._getAuthorizationHeader()) || '', tenantName: yield core.Supplier.get(this._options.tenantName) }));
32
44
  const ws = new TranscribeSocket({ socket: fernWs.socket });
33
45
  if (!configuration) {
@@ -55,7 +67,15 @@ export class Transcribe extends FernTranscribe {
55
67
  || parsedResponse.value.type === 'CONFIG_TIMEOUT')) {
56
68
  ws.socket.dispatchEvent(new ErrorEvent({
57
69
  name: parsedResponse.value.type,
58
- message: `Configuration error "${parsedResponse.value.type}" : ${parsedResponse.value.reason || 'No reason provided'}`,
70
+ message: JSON.stringify(parsedResponse.value),
71
+ }, ''));
72
+ ws.close();
73
+ return;
74
+ }
75
+ if (parsedResponse.ok && parsedResponse.value.type === 'error') {
76
+ ws.socket.dispatchEvent(new ErrorEvent({
77
+ name: 'error',
78
+ message: JSON.stringify(parsedResponse.value),
59
79
  }, ''));
60
80
  ws.close();
61
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
  }