@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
package/README.md CHANGED
@@ -1,20 +1,19 @@
1
- # Corti TypeScript Library
1
+ # Corti JavaScript Library
2
2
 
3
- [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fcorticph%2Fcorti-sdk-typescript)
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fcorticph%2Fcorti-sdk-javascript)
4
4
  [![npm shield](https://img.shields.io/npm/v/@corti/sdk)](https://www.npmjs.com/package/@corti/sdk)
5
5
 
6
6
  > [!WARNING]
7
- > This is an **alpha version** of the Corti TypeScript SDK library. As such, there will be breaking changes in future releases as we work toward our beta version. Additionally, types might not always match the actual API reality, and some features may be missing or incomplete. We're actively working to improve the library and would greatly appreciate any feedback if you encounter any inconsistencies or issues 💚
7
+ > This is a **Beta version** of the Corti JavaScript SDK library. We are treating it as stable for production use, but
8
+ > there may still be breaking changes before we reach version 1.0. We're actively working to improve the library and would greatly
9
+ > appreciate any feedback if you encounter any inconsistencies or issues 💚
8
10
 
9
- The Corti TypeScript library provides convenient access to the Corti API from TypeScript.
11
+ The Corti JavaScript library provides convenient access to the Corti API from JavaScript.
10
12
 
11
13
  ## Installation
12
14
 
13
- > [!NOTE]
14
- > You must install the alpha version as the latest version is essentially empty. Use the command below to get the functional SDK.
15
-
16
15
  ```sh
17
- npm i -s @corti/sdk@alpha
16
+ npm i -s @corti/sdk
18
17
  ```
19
18
 
20
19
  ## Reference
@@ -32,7 +31,7 @@ import { CortiEnvironment, CortiClient } from "@corti/sdk";
32
31
 
33
32
  // Using client credentials (OAuth2)
34
33
  const client = new CortiClient({
35
- environment: CortiEnvironment.BetaEu,
34
+ environment: CortiEnvironment.Eu,
36
35
  tenantName: "YOUR_TENANT_NAME",
37
36
  auth: {
38
37
  clientId: "YOUR_CLIENT_ID",
@@ -42,7 +41,7 @@ const client = new CortiClient({
42
41
 
43
42
  // Or using a bearer token
44
43
  const client = new CortiClient({
45
- environment: CortiEnvironment.BetaEu,
44
+ environment: CortiEnvironment.Eu,
46
45
  tenantName: "YOUR_TENANT_NAME",
47
46
  auth: {
48
47
  accessToken: "YOUR_ACCESS_TOKEN",
@@ -120,7 +119,7 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
120
119
  import { CortiEnvironment, CortiClient } from "@corti/sdk";
121
120
 
122
121
  const client = new CortiClient({
123
- environment: CortiEnvironment.BetaEu,
122
+ environment: CortiEnvironment.Eu,
124
123
  tenantName: "YOUR_TENANT_NAME",
125
124
  auth: {
126
125
  clientId: "YOUR_CLIENT_ID",
@@ -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.0-alpha",
67
- "User-Agent": "@corti/sdk/0.1.0-alpha",
66
+ "X-Fern-SDK-Version": "0.1.0-rc",
67
+ "User-Agent": "@corti/sdk/0.1.0-rc",
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) });
@@ -4,8 +4,6 @@
4
4
  import * as environments from "../../../../environments.js";
5
5
  import * as core from "../../../../core/index.js";
6
6
  import * as Corti from "../../../index.js";
7
- import * as fs from "fs";
8
- import { Blob } from "buffer";
9
7
  export declare namespace Recordings {
10
8
  interface Options {
11
9
  environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls>;
@@ -52,7 +50,7 @@ export declare class Recordings {
52
50
  /**
53
51
  * Upload a recording for a given interaction. There is a maximum limit of 60 minutes in length and 150MB in size for recordings.
54
52
  *
55
- * @param {File | fs.ReadStream | Blob} bytes
53
+ * @param {core.file.Uploadable} uploadable
56
54
  * @param {Corti.Uuid} id
57
55
  * @param {Recordings.RequestOptions} requestOptions - Request-specific configuration.
58
56
  *
@@ -61,7 +59,7 @@ export declare class Recordings {
61
59
  * @throws {@link Corti.InternalServerError}
62
60
  * @throws {@link Corti.GatewayTimeoutError}
63
61
  */
64
- upload(bytes: File | fs.ReadStream | Blob, id: Corti.Uuid, requestOptions?: Recordings.RequestOptions): core.HttpResponsePromise<Corti.RecordingsCreateResponse>;
62
+ upload(uploadable: core.file.Uploadable, id: Corti.Uuid, requestOptions?: Recordings.RequestOptions): core.HttpResponsePromise<Corti.RecordingsCreateResponse>;
65
63
  private __upload;
66
64
  /**
67
65
  * Retrieve a specific recording for a given interaction.
@@ -148,7 +148,7 @@ class Recordings {
148
148
  /**
149
149
  * Upload a recording for a given interaction. There is a maximum limit of 60 minutes in length and 150MB in size for recordings.
150
150
  *
151
- * @param {File | fs.ReadStream | Blob} bytes
151
+ * @param {core.file.Uploadable} uploadable
152
152
  * @param {Corti.Uuid} id
153
153
  * @param {Recordings.RequestOptions} requestOptions - Request-specific configuration.
154
154
  *
@@ -157,23 +157,24 @@ class Recordings {
157
157
  * @throws {@link Corti.InternalServerError}
158
158
  * @throws {@link Corti.GatewayTimeoutError}
159
159
  */
160
- upload(bytes, id, requestOptions) {
161
- return core.HttpResponsePromise.fromPromise(this.__upload(bytes, id, requestOptions));
160
+ upload(uploadable, id, requestOptions) {
161
+ return core.HttpResponsePromise.fromPromise(this.__upload(uploadable, id, requestOptions));
162
162
  }
163
- __upload(bytes, id, requestOptions) {
163
+ __upload(uploadable, id, requestOptions) {
164
164
  return __awaiter(this, void 0, void 0, function* () {
165
165
  var _a, _b;
166
+ const _binaryUploadRequest = yield core.file.toBinaryUploadRequest(uploadable);
166
167
  const _response = yield core.fetcher({
167
168
  url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(serializers.Uuid.jsonOrThrow(id, { omitUndefined: true }))}/recordings/`),
168
169
  method: "POST",
169
170
  headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
170
171
  Authorization: yield this._getAuthorizationHeader(),
171
172
  "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
172
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
173
+ }), _binaryUploadRequest.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
173
174
  contentType: "application/octet-stream",
174
175
  requestType: "bytes",
175
176
  duplex: "half",
176
- body: bytes,
177
+ body: _binaryUploadRequest.body,
177
178
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
178
179
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
179
180
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -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);
@@ -2,9 +2,15 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export interface DocumentsContext {
6
- /** The type of context data. */
7
- type: Corti.DocumentsContextTypeEnum;
8
- /** The actual data, which can be an array of facts, a transcript, or a string. */
9
- data: Corti.DocumentsContextData;
5
+ export type DocumentsContext = Corti.DocumentsContext.Facts | Corti.DocumentsContext.Transcript | Corti.DocumentsContext.String;
6
+ export declare namespace DocumentsContext {
7
+ interface Facts extends Corti.DocumentsContextWithFacts {
8
+ type: "facts";
9
+ }
10
+ interface Transcript extends Corti.DocumentsContextWithTranscript {
11
+ type: "transcript";
12
+ }
13
+ interface String extends Corti.DocumentsContextWithString {
14
+ type: "string";
15
+ }
10
16
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../index.js";
5
+ export interface DocumentsContextWithFacts {
6
+ /** An array of facts. */
7
+ data: Corti.FactsContext[];
8
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface DocumentsContextWithString {
5
+ /** String data. */
6
+ data: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../index.js";
5
+ export interface DocumentsContextWithTranscript {
6
+ /** Transcript data. */
7
+ data: Corti.CommonTranscript;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface DocumentsCreateRequestWithTemplate {
6
- /** An array of context objects. */
6
+ /** An array of context objects. Currently accepts exactly one context object to be used as input for document generation. */
7
7
  context: Corti.DocumentsContext[];
8
8
  /** Template details if the template should be generated during the request. */
9
9
  template: Corti.DocumentsTemplate;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface DocumentsCreateRequestWithTemplateId {
6
- /** An array of context objects. */
6
+ /** An array of context objects. Currently accepts exactly one context object to be used as input for document generation. */
7
7
  context: Corti.DocumentsContext[];
8
8
  /** The UUID of the template to use. */
9
9
  templateId: Corti.Uuid;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface DocumentsCreateRequestWithTemplateKey {
6
- /** An array of context objects. */
6
+ /** An array of context objects. Currently accepts exactly one context object to be used as input for document generation. */
7
7
  context: Corti.DocumentsContext[];
8
8
  /** The key of the template that informs on what kind of document is to be generated. */
9
9
  templateKey: string;
@@ -2,13 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export interface DocumentsTemplate {
6
- /** An array of section IDs. */
7
- sectionIds?: Corti.Uuid[];
8
- /** An array of section keys. */
9
- sectionKeys?: string[];
10
- /** The name of the document. */
11
- documentName?: string;
12
- /** Any additional instructions to be considered during document generation. */
13
- additionalInstructions?: string;
14
- }
5
+ export type DocumentsTemplate = Corti.DocumentsTemplateWithSectionKeys | Corti.DocumentsTemplateWithSectionIds;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../index.js";
5
+ export interface DocumentsTemplateWithSectionIds {
6
+ /** An array of section IDs. */
7
+ sectionIds: Corti.Uuid[];
8
+ /** The name of the document. */
9
+ documentName?: string;
10
+ /** Any additional instructions to be considered during document generation. */
11
+ additionalInstructions?: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface DocumentsTemplateWithSectionKeys {
5
+ /** An array of section keys. */
6
+ sectionKeys: string[];
7
+ /** The name of the document. */
8
+ documentName?: string;
9
+ /** Any additional instructions to be considered during document generation. */
10
+ additionalInstructions?: string;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
- };
@@ -18,5 +18,5 @@ export interface TemplatesSection {
18
18
  /** Type of section */
19
19
  sectionType: string;
20
20
  /** Available translations for the section */
21
- translations: Corti.TemplatesTranslation[];
21
+ translations: Corti.TemplatesSectionTranslation[];
22
22
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface TemplatesSectionTranslation {
5
+ /** Language identifier */
6
+ languagesId: string;
7
+ /** Localized name */
8
+ name?: string | null;
9
+ /** Localized description */
10
+ description?: string | null;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,7 +5,7 @@ export interface TemplatesTranslation {
5
5
  /** Language identifier */
6
6
  languagesId: string;
7
7
  /** Localized name */
8
- name?: string | null;
8
+ name?: string;
9
9
  /** Localized description */
10
- description?: string | null;
10
+ description?: string;
11
11
  }
@@ -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
- };
@@ -1,7 +1,11 @@
1
1
  export * from "./DocumentsContext.js";
2
- export * from "./DocumentsContextData.js";
2
+ export * from "./DocumentsContextWithFacts.js";
3
+ export * from "./DocumentsContextWithTranscript.js";
4
+ export * from "./DocumentsContextWithString.js";
3
5
  export * from "./DocumentsSection.js";
4
6
  export * from "./DocumentsTemplate.js";
7
+ export * from "./DocumentsTemplateWithSectionKeys.js";
8
+ export * from "./DocumentsTemplateWithSectionIds.js";
5
9
  export * from "./InteractionsEncounterCreateRequest.js";
6
10
  export * from "./InteractionsEncounterUpdateRequest.js";
7
11
  export * from "./InteractionsEncounterResponse.js";
@@ -49,13 +53,13 @@ export * from "./TemplatesSectionSorted.js";
49
53
  export * from "./CommonTranscript.js";
50
54
  export * from "./Uuid.js";
51
55
  export * from "./CommonUsageInfo.js";
52
- export * from "./DocumentsContextTypeEnum.js";
53
56
  export * from "./InteractionsEncounterStatusEnum.js";
54
57
  export * from "./InteractionsEncounterTypeEnum.js";
55
58
  export * from "./InteractionsGenderEnum.js";
56
59
  export * from "./CommonSourceEnum.js";
57
60
  export * from "./TranscriptsParticipantRoleEnum.js";
58
61
  export * from "./TemplatesWritingStyle.js";
62
+ export * from "./TemplatesSectionTranslation.js";
59
63
  export * from "./TemplatesTranslation.js";
60
64
  export * from "./StreamConfigMessage.js";
61
65
  export * from "./StreamConfig.js";
@@ -15,9 +15,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DocumentsContext.js"), exports);
18
- __exportStar(require("./DocumentsContextData.js"), exports);
18
+ __exportStar(require("./DocumentsContextWithFacts.js"), exports);
19
+ __exportStar(require("./DocumentsContextWithTranscript.js"), exports);
20
+ __exportStar(require("./DocumentsContextWithString.js"), exports);
19
21
  __exportStar(require("./DocumentsSection.js"), exports);
20
22
  __exportStar(require("./DocumentsTemplate.js"), exports);
23
+ __exportStar(require("./DocumentsTemplateWithSectionKeys.js"), exports);
24
+ __exportStar(require("./DocumentsTemplateWithSectionIds.js"), exports);
21
25
  __exportStar(require("./InteractionsEncounterCreateRequest.js"), exports);
22
26
  __exportStar(require("./InteractionsEncounterUpdateRequest.js"), exports);
23
27
  __exportStar(require("./InteractionsEncounterResponse.js"), exports);
@@ -65,13 +69,13 @@ __exportStar(require("./TemplatesSectionSorted.js"), exports);
65
69
  __exportStar(require("./CommonTranscript.js"), exports);
66
70
  __exportStar(require("./Uuid.js"), exports);
67
71
  __exportStar(require("./CommonUsageInfo.js"), exports);
68
- __exportStar(require("./DocumentsContextTypeEnum.js"), exports);
69
72
  __exportStar(require("./InteractionsEncounterStatusEnum.js"), exports);
70
73
  __exportStar(require("./InteractionsEncounterTypeEnum.js"), exports);
71
74
  __exportStar(require("./InteractionsGenderEnum.js"), exports);
72
75
  __exportStar(require("./CommonSourceEnum.js"), exports);
73
76
  __exportStar(require("./TranscriptsParticipantRoleEnum.js"), exports);
74
77
  __exportStar(require("./TemplatesWritingStyle.js"), exports);
78
+ __exportStar(require("./TemplatesSectionTranslation.js"), exports);
75
79
  __exportStar(require("./TemplatesTranslation.js"), exports);
76
80
  __exportStar(require("./StreamConfigMessage.js"), exports);
77
81
  __exportStar(require("./StreamConfig.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./file/exports.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./file/exports.js"), exports);
@@ -1,5 +1,5 @@
1
1
  import { ResponseWithBody } from "./ResponseWithBody.js";
2
- export interface BinaryResponse {
2
+ export type BinaryResponse = {
3
3
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
4
4
  bodyUsed: boolean;
5
5
  /**
@@ -11,7 +11,10 @@ export interface BinaryResponse {
11
11
  arrayBuffer: () => Promise<ArrayBuffer>;
12
12
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
13
13
  blob: () => Promise<Blob>;
14
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
15
- bytes(): Promise<Uint8Array>;
16
- }
14
+ /**
15
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
16
+ * Some versions of the Fetch API may not support this method.
17
+ */
18
+ bytes?(): Promise<Uint8Array>;
19
+ };
17
20
  export declare function getBinaryResponse(response: ResponseWithBody): BinaryResponse;
@@ -2,13 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBinaryResponse = getBinaryResponse;
4
4
  function getBinaryResponse(response) {
5
- return {
5
+ const binaryResponse = {
6
6
  get bodyUsed() {
7
7
  return response.bodyUsed;
8
8
  },
9
9
  stream: () => response.body,
10
10
  arrayBuffer: response.arrayBuffer.bind(response),
11
11
  blob: response.blob.bind(response),
12
- bytes: response.bytes.bind(response),
13
12
  };
13
+ if ("bytes" in response && typeof response.bytes === "function") {
14
+ binaryResponse.bytes = response.bytes.bind(response);
15
+ }
16
+ return binaryResponse;
14
17
  }
@@ -15,6 +15,7 @@ const json_js_1 = require("../json.js");
15
15
  const RawResponse_js_1 = require("./RawResponse.js");
16
16
  const Supplier_js_1 = require("./Supplier.js");
17
17
  const createRequestUrl_js_1 = require("./createRequestUrl.js");
18
+ const getErrorResponseBody_js_1 = require("./getErrorResponseBody.js");
18
19
  const getFetchFn_js_1 = require("./getFetchFn.js");
19
20
  const getRequestBody_js_1 = require("./getRequestBody.js");
20
21
  const getResponseBody_js_1 = require("./getResponseBody.js");
@@ -55,11 +56,10 @@ function fetcherImpl(args) {
55
56
  const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
56
57
  return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, yield getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
57
58
  }), args.maxRetries);
58
- const responseBody = yield (0, getResponseBody_js_1.getResponseBody)(response, args.responseType);
59
59
  if (response.status >= 200 && response.status < 400) {
60
60
  return {
61
61
  ok: true,
62
- body: responseBody,
62
+ body: (yield (0, getResponseBody_js_1.getResponseBody)(response, args.responseType)),
63
63
  headers: response.headers,
64
64
  rawResponse: (0, RawResponse_js_1.toRawResponse)(response),
65
65
  };
@@ -70,7 +70,7 @@ function fetcherImpl(args) {
70
70
  error: {
71
71
  reason: "status-code",
72
72
  statusCode: response.status,
73
- body: responseBody,
73
+ body: yield (0, getErrorResponseBody_js_1.getErrorResponseBody)(response),
74
74
  },
75
75
  rawResponse: (0, RawResponse_js_1.toRawResponse)(response),
76
76
  };
@@ -0,0 +1 @@
1
+ export declare function getErrorResponseBody(response: Response): Promise<unknown>;