@corti/sdk 0.1.3-alpha → 0.1.3-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 (271) hide show
  1. package/README.md +29 -16
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
  4. package/dist/cjs/api/index.d.ts +4 -0
  5. package/dist/cjs/api/index.js +4 -0
  6. package/dist/cjs/api/resources/documents/client/Client.d.ts +3 -3
  7. package/dist/cjs/api/resources/documents/client/Client.js +4 -10
  8. package/dist/cjs/api/resources/facts/client/Client.d.ts +6 -4
  9. package/dist/cjs/api/resources/facts/client/Client.js +6 -4
  10. package/dist/cjs/api/resources/facts/client/requests/FactsUpdateRequest.d.ts +2 -2
  11. package/dist/cjs/api/resources/index.d.ts +1 -2
  12. package/dist/cjs/api/resources/index.js +2 -3
  13. package/dist/cjs/api/resources/interactions/client/Client.d.ts +5 -5
  14. package/dist/cjs/api/resources/interactions/client/Client.js +5 -5
  15. package/dist/cjs/api/resources/recordings/client/Client.d.ts +6 -8
  16. package/dist/cjs/api/resources/recordings/client/Client.js +13 -24
  17. package/dist/cjs/api/resources/templates/client/Client.d.ts +2 -2
  18. package/dist/cjs/api/resources/templates/client/Client.js +2 -2
  19. package/dist/cjs/api/resources/transcripts/client/Client.d.ts +5 -6
  20. package/dist/cjs/api/resources/transcripts/client/Client.js +5 -6
  21. package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -4
  22. package/dist/cjs/api/resources/transcripts/index.d.ts +0 -1
  23. package/dist/cjs/api/resources/transcripts/index.js +0 -1
  24. package/dist/cjs/api/types/CommonTranscriptRequest.d.ts +17 -0
  25. package/dist/cjs/api/types/{CommonTranscript.d.ts → CommonTranscriptResponse.d.ts} +1 -1
  26. package/dist/cjs/api/types/DocumentsContext.d.ts +11 -5
  27. package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +8 -0
  28. package/dist/cjs/api/types/DocumentsContextWithString.d.ts +7 -0
  29. package/dist/cjs/api/types/DocumentsContextWithString.js +5 -0
  30. package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +8 -0
  31. package/dist/cjs/api/types/DocumentsContextWithTranscript.js +5 -0
  32. package/dist/cjs/api/types/DocumentsCreateRequest.d.ts +7 -1
  33. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplate.d.ts +2 -4
  34. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateKey.d.ts +2 -4
  35. package/dist/cjs/api/types/DocumentsTemplate.d.ts +1 -10
  36. package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.d.ts +11 -0
  37. package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.js +5 -0
  38. package/dist/cjs/api/types/FactsBatchUpdateInput.d.ts +1 -1
  39. package/dist/cjs/api/types/FactsCreateItem.d.ts +1 -1
  40. package/dist/cjs/api/types/FactsListItem.d.ts +1 -1
  41. package/dist/cjs/api/types/TemplatesSection.d.ts +1 -1
  42. package/dist/cjs/api/types/TemplatesSectionTranslation.d.ts +11 -0
  43. package/dist/cjs/api/types/TemplatesSectionTranslation.js +5 -0
  44. package/dist/cjs/api/types/TemplatesTranslation.d.ts +2 -2
  45. package/dist/cjs/api/types/TranscriptsData.d.ts +1 -1
  46. package/dist/cjs/api/types/TranscriptsResponse.d.ts +1 -1
  47. package/dist/cjs/api/types/index.d.ts +7 -4
  48. package/dist/cjs/api/types/index.js +7 -4
  49. package/dist/cjs/core/exports.d.ts +1 -0
  50. package/dist/cjs/{api/resources/transcripts/types/index.js → core/exports.js} +1 -1
  51. package/dist/cjs/core/file/exports.d.ts +1 -0
  52. package/dist/cjs/core/file/exports.js +2 -0
  53. package/dist/cjs/core/file/file.d.ts +5 -0
  54. package/dist/cjs/core/file/file.js +203 -0
  55. package/dist/cjs/core/file/index.d.ts +2 -0
  56. package/dist/cjs/core/file/index.js +18 -0
  57. package/dist/cjs/core/file/types.d.ts +66 -0
  58. package/dist/cjs/core/file/types.js +2 -0
  59. package/dist/cjs/core/index.d.ts +1 -0
  60. package/dist/cjs/core/index.js +2 -1
  61. package/dist/cjs/core/schemas/utils/maybeSkipValidation.js +1 -1
  62. package/dist/cjs/core/websocket/ws.js +1 -1
  63. package/dist/cjs/custom/CortiAuth.d.ts +8 -0
  64. package/dist/cjs/custom/CortiAuth.js +7 -0
  65. package/dist/cjs/custom/CortiClient.js +6 -11
  66. package/dist/cjs/custom/RefreshBearerProvider.d.ts +10 -5
  67. package/dist/cjs/custom/RefreshBearerProvider.js +1 -1
  68. package/dist/cjs/custom/index.d.ts +1 -0
  69. package/dist/cjs/{serialization/resources/transcripts/types → custom}/index.js +1 -1
  70. package/dist/cjs/custom/utils/getEnvironmentFromString.d.ts +6 -0
  71. package/dist/cjs/custom/utils/getEnvironmentFromString.js +13 -0
  72. package/dist/cjs/environments.d.ts +4 -6
  73. package/dist/cjs/environments.js +2 -5
  74. package/dist/cjs/exports.d.ts +1 -0
  75. package/dist/cjs/exports.js +17 -0
  76. package/dist/cjs/serialization/resources/index.d.ts +1 -2
  77. package/dist/cjs/serialization/resources/index.js +2 -3
  78. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +0 -2
  79. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +0 -2
  80. package/dist/cjs/serialization/resources/transcripts/index.d.ts +0 -1
  81. package/dist/cjs/serialization/resources/transcripts/index.js +0 -1
  82. package/dist/cjs/serialization/types/CommonTranscriptRequest.d.ts +17 -0
  83. package/dist/cjs/serialization/types/CommonTranscriptRequest.js +48 -0
  84. package/dist/cjs/serialization/types/{CommonTranscript.d.ts → CommonTranscriptResponse.d.ts} +2 -2
  85. package/dist/cjs/serialization/types/{CommonTranscript.js → CommonTranscriptResponse.js} +2 -2
  86. package/dist/cjs/serialization/types/DocumentsContext.d.ts +13 -6
  87. package/dist/cjs/serialization/types/DocumentsContext.js +12 -5
  88. package/dist/cjs/serialization/types/DocumentsContextWithFacts.d.ts +13 -0
  89. package/dist/cjs/serialization/{resources/transcripts/types/TranscriptsCreateRequestModelName.js → types/DocumentsContextWithFacts.js} +6 -3
  90. package/dist/cjs/serialization/types/DocumentsContextWithString.d.ts +12 -0
  91. package/dist/cjs/serialization/types/{DocumentsContextTypeEnum.js → DocumentsContextWithString.js} +4 -2
  92. package/dist/cjs/serialization/types/DocumentsContextWithTranscript.d.ts +13 -0
  93. package/dist/cjs/serialization/types/{DocumentsContextData.js → DocumentsContextWithTranscript.js} +5 -8
  94. package/dist/cjs/serialization/types/DocumentsCreateRequest.d.ts +1 -2
  95. package/dist/cjs/serialization/types/DocumentsCreateRequest.js +0 -2
  96. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplate.d.ts +0 -1
  97. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplate.js +0 -1
  98. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateKey.d.ts +0 -1
  99. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateKey.js +0 -1
  100. package/dist/cjs/serialization/types/DocumentsTemplate.d.ts +2 -7
  101. package/dist/cjs/serialization/types/DocumentsTemplate.js +2 -41
  102. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.d.ts +14 -0
  103. package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.js +45 -0
  104. package/dist/cjs/serialization/types/TemplatesSection.d.ts +2 -2
  105. package/dist/cjs/serialization/types/TemplatesSection.js +2 -2
  106. package/dist/cjs/serialization/types/TemplatesSectionTranslation.d.ts +14 -0
  107. package/dist/cjs/serialization/types/TemplatesSectionTranslation.js +45 -0
  108. package/dist/cjs/serialization/types/TemplatesTranslation.d.ts +2 -2
  109. package/dist/cjs/serialization/types/TemplatesTranslation.js +2 -2
  110. package/dist/cjs/serialization/types/TranscriptsData.d.ts +2 -2
  111. package/dist/cjs/serialization/types/TranscriptsData.js +2 -2
  112. package/dist/cjs/serialization/types/TranscriptsResponse.d.ts +2 -2
  113. package/dist/cjs/serialization/types/TranscriptsResponse.js +2 -2
  114. package/dist/cjs/serialization/types/index.d.ts +7 -4
  115. package/dist/cjs/serialization/types/index.js +7 -4
  116. package/dist/cjs/version.d.ts +1 -1
  117. package/dist/cjs/version.js +1 -1
  118. package/dist/esm/Client.mjs +2 -2
  119. package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
  120. package/dist/esm/api/index.d.mts +4 -0
  121. package/dist/esm/api/index.mjs +4 -0
  122. package/dist/esm/api/resources/documents/client/Client.d.mts +3 -3
  123. package/dist/esm/api/resources/documents/client/Client.mjs +4 -10
  124. package/dist/esm/api/resources/facts/client/Client.d.mts +6 -4
  125. package/dist/esm/api/resources/facts/client/Client.mjs +6 -4
  126. package/dist/esm/api/resources/facts/client/requests/FactsUpdateRequest.d.mts +2 -2
  127. package/dist/esm/api/resources/index.d.mts +1 -2
  128. package/dist/esm/api/resources/index.mjs +1 -2
  129. package/dist/esm/api/resources/interactions/client/Client.d.mts +5 -5
  130. package/dist/esm/api/resources/interactions/client/Client.mjs +5 -5
  131. package/dist/esm/api/resources/recordings/client/Client.d.mts +6 -8
  132. package/dist/esm/api/resources/recordings/client/Client.mjs +13 -24
  133. package/dist/esm/api/resources/templates/client/Client.d.mts +2 -2
  134. package/dist/esm/api/resources/templates/client/Client.mjs +2 -2
  135. package/dist/esm/api/resources/transcripts/client/Client.d.mts +5 -6
  136. package/dist/esm/api/resources/transcripts/client/Client.mjs +5 -6
  137. package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -4
  138. package/dist/esm/api/resources/transcripts/index.d.mts +0 -1
  139. package/dist/esm/api/resources/transcripts/index.mjs +0 -1
  140. package/dist/esm/api/types/CommonTranscriptRequest.d.mts +17 -0
  141. package/dist/esm/api/types/{CommonTranscript.d.mts → CommonTranscriptResponse.d.mts} +1 -1
  142. package/dist/esm/api/types/DocumentsContext.d.mts +11 -5
  143. package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +8 -0
  144. package/dist/esm/api/types/DocumentsContextWithString.d.mts +7 -0
  145. package/dist/esm/api/types/DocumentsContextWithString.mjs +4 -0
  146. package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +8 -0
  147. package/dist/esm/api/types/DocumentsContextWithTranscript.mjs +4 -0
  148. package/dist/esm/api/types/DocumentsCreateRequest.d.mts +7 -1
  149. package/dist/esm/api/types/DocumentsCreateRequestWithTemplate.d.mts +2 -4
  150. package/dist/esm/api/types/DocumentsCreateRequestWithTemplateKey.d.mts +2 -4
  151. package/dist/esm/api/types/DocumentsTemplate.d.mts +1 -10
  152. package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.d.mts +11 -0
  153. package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.mjs +4 -0
  154. package/dist/esm/api/types/FactsBatchUpdateInput.d.mts +1 -1
  155. package/dist/esm/api/types/FactsCreateItem.d.mts +1 -1
  156. package/dist/esm/api/types/FactsListItem.d.mts +1 -1
  157. package/dist/esm/api/types/TemplatesSection.d.mts +1 -1
  158. package/dist/esm/api/types/TemplatesSectionTranslation.d.mts +11 -0
  159. package/dist/esm/api/types/TemplatesSectionTranslation.mjs +4 -0
  160. package/dist/esm/api/types/TemplatesTranslation.d.mts +2 -2
  161. package/dist/esm/api/types/TranscriptsData.d.mts +1 -1
  162. package/dist/esm/api/types/TranscriptsResponse.d.mts +1 -1
  163. package/dist/esm/api/types/index.d.mts +7 -4
  164. package/dist/esm/api/types/index.mjs +7 -4
  165. package/dist/esm/core/exports.d.mts +1 -0
  166. package/dist/esm/core/exports.mjs +1 -0
  167. package/dist/esm/core/file/exports.d.mts +1 -0
  168. package/dist/esm/core/file/exports.mjs +1 -0
  169. package/dist/esm/core/file/file.d.mts +5 -0
  170. package/dist/esm/core/file/file.mjs +167 -0
  171. package/dist/esm/core/file/index.d.mts +2 -0
  172. package/dist/esm/core/file/index.mjs +2 -0
  173. package/dist/esm/core/file/types.d.mts +66 -0
  174. package/dist/esm/core/file/types.mjs +1 -0
  175. package/dist/esm/core/index.d.mts +1 -0
  176. package/dist/esm/core/index.mjs +1 -0
  177. package/dist/esm/core/schemas/utils/maybeSkipValidation.mjs +1 -1
  178. package/dist/esm/core/websocket/ws.mjs +1 -1
  179. package/dist/esm/custom/CortiAuth.d.mts +8 -0
  180. package/dist/esm/custom/CortiAuth.mjs +7 -0
  181. package/dist/esm/custom/CortiClient.mjs +6 -11
  182. package/dist/esm/custom/RefreshBearerProvider.d.mts +10 -5
  183. package/dist/esm/custom/RefreshBearerProvider.mjs +1 -1
  184. package/dist/esm/custom/index.d.mts +1 -0
  185. package/dist/esm/custom/index.mjs +1 -0
  186. package/dist/esm/custom/utils/getEnvironmentFromString.d.mts +6 -0
  187. package/dist/esm/custom/utils/getEnvironmentFromString.mjs +10 -0
  188. package/dist/esm/environments.d.mts +4 -6
  189. package/dist/esm/environments.mjs +2 -5
  190. package/dist/esm/exports.d.mts +1 -0
  191. package/dist/esm/exports.mjs +1 -0
  192. package/dist/esm/serialization/resources/index.d.mts +1 -2
  193. package/dist/esm/serialization/resources/index.mjs +1 -2
  194. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +0 -2
  195. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +0 -2
  196. package/dist/esm/serialization/resources/transcripts/index.d.mts +0 -1
  197. package/dist/esm/serialization/resources/transcripts/index.mjs +0 -1
  198. package/dist/esm/serialization/types/CommonTranscriptRequest.d.mts +17 -0
  199. package/dist/esm/serialization/types/CommonTranscriptRequest.mjs +12 -0
  200. package/dist/esm/serialization/types/{CommonTranscript.d.mts → CommonTranscriptResponse.d.mts} +2 -2
  201. package/dist/esm/serialization/types/{CommonTranscript.mjs → CommonTranscriptResponse.mjs} +1 -1
  202. package/dist/esm/serialization/types/DocumentsContext.d.mts +13 -6
  203. package/dist/esm/serialization/types/DocumentsContext.mjs +12 -5
  204. package/dist/esm/serialization/types/DocumentsContextWithFacts.d.mts +13 -0
  205. package/dist/esm/serialization/types/DocumentsContextWithFacts.mjs +8 -0
  206. package/dist/esm/serialization/types/DocumentsContextWithString.d.mts +12 -0
  207. package/dist/esm/serialization/types/{DocumentsContextTypeEnum.mjs → DocumentsContextWithString.mjs} +3 -1
  208. package/dist/esm/serialization/types/DocumentsContextWithTranscript.d.mts +13 -0
  209. package/dist/esm/serialization/types/DocumentsContextWithTranscript.mjs +8 -0
  210. package/dist/esm/serialization/types/DocumentsCreateRequest.d.mts +1 -2
  211. package/dist/esm/serialization/types/DocumentsCreateRequest.mjs +0 -2
  212. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplate.d.mts +0 -1
  213. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplate.mjs +0 -1
  214. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateKey.d.mts +0 -1
  215. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateKey.mjs +0 -1
  216. package/dist/esm/serialization/types/DocumentsTemplate.d.mts +2 -7
  217. package/dist/esm/serialization/types/DocumentsTemplate.mjs +2 -8
  218. package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.d.mts +14 -0
  219. package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.mjs +9 -0
  220. package/dist/esm/serialization/types/TemplatesSection.d.mts +2 -2
  221. package/dist/esm/serialization/types/TemplatesSection.mjs +2 -2
  222. package/dist/esm/serialization/types/TemplatesSectionTranslation.d.mts +14 -0
  223. package/dist/esm/serialization/types/TemplatesSectionTranslation.mjs +9 -0
  224. package/dist/esm/serialization/types/TemplatesTranslation.d.mts +2 -2
  225. package/dist/esm/serialization/types/TemplatesTranslation.mjs +2 -2
  226. package/dist/esm/serialization/types/TranscriptsData.d.mts +2 -2
  227. package/dist/esm/serialization/types/TranscriptsData.mjs +2 -2
  228. package/dist/esm/serialization/types/TranscriptsResponse.d.mts +2 -2
  229. package/dist/esm/serialization/types/TranscriptsResponse.mjs +2 -2
  230. package/dist/esm/serialization/types/index.d.mts +7 -4
  231. package/dist/esm/serialization/types/index.mjs +7 -4
  232. package/dist/esm/version.d.mts +1 -1
  233. package/dist/esm/version.mjs +1 -1
  234. package/package.json +4 -3
  235. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestModelName.d.ts +0 -12
  236. package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestModelName.js +0 -11
  237. package/dist/cjs/api/resources/transcripts/types/index.d.ts +0 -1
  238. package/dist/cjs/api/types/DocumentsContextData.d.ts +0 -14
  239. package/dist/cjs/api/types/DocumentsContextTypeEnum.d.ts +0 -9
  240. package/dist/cjs/api/types/DocumentsContextTypeEnum.js +0 -11
  241. package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateId.d.ts +0 -16
  242. package/dist/cjs/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.d.ts +0 -10
  243. package/dist/cjs/serialization/resources/transcripts/types/index.d.ts +0 -1
  244. package/dist/cjs/serialization/types/DocumentsContextData.d.ts +0 -12
  245. package/dist/cjs/serialization/types/DocumentsContextTypeEnum.d.ts +0 -10
  246. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateId.d.ts +0 -18
  247. package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateId.js +0 -49
  248. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestModelName.d.mts +0 -12
  249. package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestModelName.mjs +0 -8
  250. package/dist/esm/api/resources/transcripts/types/index.d.mts +0 -1
  251. package/dist/esm/api/resources/transcripts/types/index.mjs +0 -1
  252. package/dist/esm/api/types/DocumentsContextData.d.mts +0 -14
  253. package/dist/esm/api/types/DocumentsContextTypeEnum.d.mts +0 -9
  254. package/dist/esm/api/types/DocumentsContextTypeEnum.mjs +0 -8
  255. package/dist/esm/api/types/DocumentsCreateRequestWithTemplateId.d.mts +0 -16
  256. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.d.mts +0 -10
  257. package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.mjs +0 -5
  258. package/dist/esm/serialization/resources/transcripts/types/index.d.mts +0 -1
  259. package/dist/esm/serialization/resources/transcripts/types/index.mjs +0 -1
  260. package/dist/esm/serialization/types/DocumentsContextData.d.mts +0 -12
  261. package/dist/esm/serialization/types/DocumentsContextData.mjs +0 -11
  262. package/dist/esm/serialization/types/DocumentsContextTypeEnum.d.mts +0 -10
  263. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateId.d.mts +0 -18
  264. package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateId.mjs +0 -13
  265. package/reference.md +0 -1706
  266. /package/dist/cjs/api/types/{CommonTranscript.js → CommonTranscriptRequest.js} +0 -0
  267. /package/dist/cjs/api/types/{DocumentsContextData.js → CommonTranscriptResponse.js} +0 -0
  268. /package/dist/cjs/api/types/{DocumentsCreateRequestWithTemplateId.js → DocumentsContextWithFacts.js} +0 -0
  269. /package/dist/esm/api/types/{CommonTranscript.mjs → CommonTranscriptRequest.mjs} +0 -0
  270. /package/dist/esm/api/types/{DocumentsContextData.mjs → CommonTranscriptResponse.mjs} +0 -0
  271. /package/dist/esm/api/types/{DocumentsCreateRequestWithTemplateId.mjs → DocumentsContextWithFacts.mjs} +0 -0
@@ -32,7 +32,7 @@ export declare class Transcripts {
32
32
  protected readonly _options: Transcripts.Options;
33
33
  constructor(_options: Transcripts.Options);
34
34
  /**
35
- * Retrieves a list of transcripts for a given interaction.
35
+ * Retrieves a list of transcripts for a given interaction.
36
36
  *
37
37
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
38
38
  * @param {Corti.TranscriptsListRequest} request
@@ -50,7 +50,7 @@ export declare class Transcripts {
50
50
  list(id: Corti.Uuid, request?: Corti.TranscriptsListRequest, requestOptions?: Transcripts.RequestOptions): core.HttpResponsePromise<Corti.TranscriptsListResponse>;
51
51
  private __list;
52
52
  /**
53
- * Creates a new transcript for an interaction.
53
+ * Creates a new transcript for an interaction.
54
54
  *
55
55
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
56
56
  * @param {Corti.TranscriptsCreateRequest} request
@@ -65,14 +65,13 @@ export declare class Transcripts {
65
65
  * @example
66
66
  * await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", {
67
67
  * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
68
- * primaryLanguage: "en",
69
- * modelName: "base"
68
+ * primaryLanguage: "en"
70
69
  * })
71
70
  */
72
71
  create(id: Corti.Uuid, request: Corti.TranscriptsCreateRequest, requestOptions?: Transcripts.RequestOptions): core.HttpResponsePromise<Corti.TranscriptsResponse>;
73
72
  private __create;
74
73
  /**
75
- * Retrieves the transcript for a specific interaction.
74
+ * Retrieves the transcript for a specific interaction.
76
75
  *
77
76
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
78
77
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -90,7 +89,7 @@ export declare class Transcripts {
90
89
  get(id: Corti.Uuid, transcriptId: Corti.Uuid, requestOptions?: Transcripts.RequestOptions): core.HttpResponsePromise<Corti.TranscriptsResponse>;
91
90
  private __get;
92
91
  /**
93
- * Deletes a specific transcript associated with an interaction.
92
+ * Deletes a specific transcript associated with an interaction.
94
93
  *
95
94
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
96
95
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -20,7 +20,7 @@ export class Transcripts {
20
20
  this._options = _options;
21
21
  }
22
22
  /**
23
- * Retrieves a list of transcripts for a given interaction.
23
+ * Retrieves a list of transcripts for a given interaction.
24
24
  *
25
25
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
26
26
  * @param {Corti.TranscriptsListRequest} request
@@ -120,7 +120,7 @@ export class Transcripts {
120
120
  });
121
121
  }
122
122
  /**
123
- * Creates a new transcript for an interaction.
123
+ * Creates a new transcript for an interaction.
124
124
  *
125
125
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
126
126
  * @param {Corti.TranscriptsCreateRequest} request
@@ -135,8 +135,7 @@ export class Transcripts {
135
135
  * @example
136
136
  * await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", {
137
137
  * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
138
- * primaryLanguage: "en",
139
- * modelName: "base"
138
+ * primaryLanguage: "en"
140
139
  * })
141
140
  */
142
141
  create(id, request, requestOptions) {
@@ -224,7 +223,7 @@ export class Transcripts {
224
223
  });
225
224
  }
226
225
  /**
227
- * Retrieves the transcript for a specific interaction.
226
+ * Retrieves the transcript for a specific interaction.
228
227
  *
229
228
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
230
229
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -318,7 +317,7 @@ export class Transcripts {
318
317
  });
319
318
  }
320
319
  /**
321
- * Deletes a specific transcript associated with an interaction.
320
+ * Deletes a specific transcript associated with an interaction.
322
321
  *
323
322
  * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID.
324
323
  * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID.
@@ -6,8 +6,7 @@ import * as Corti from "../../../../index.mjs";
6
6
  * @example
7
7
  * {
8
8
  * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
9
- * primaryLanguage: "en",
10
- * modelName: "base"
9
+ * primaryLanguage: "en"
11
10
  * }
12
11
  */
13
12
  export interface TranscriptsCreateRequest {
@@ -23,6 +22,4 @@ export interface TranscriptsCreateRequest {
23
22
  diarize?: boolean;
24
23
  /** An array of participants, each specifying a role and an assigned audio channel in the recording. Leave empty when shouldDiarize: true */
25
24
  participants?: Corti.TranscriptsParticipant[];
26
- /** The model name for transcription. By default, only the highest tier is accessible. Check https://docs.corti.ai/about/languages for more. */
27
- modelName: Corti.TranscriptsCreateRequestModelName;
28
25
  }
@@ -1,2 +1 @@
1
- export * from "./types/index.mjs";
2
1
  export * from "./client/index.mjs";
@@ -1,2 +1 @@
1
- export * from "./types/index.mjs";
2
1
  export * from "./client/index.mjs";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CommonTranscriptRequest {
5
+ /** The channel associated with this phrase/utterance. */
6
+ channel?: number;
7
+ /** The identifier of the participant. */
8
+ participant?: number;
9
+ /** Id to tag an identified speaker. Auto-increments. */
10
+ speakerId?: number;
11
+ /** The spoken phrase or utterance extracted from the audio. */
12
+ text: string;
13
+ /** Start time in milliseconds for phrase/utterance. */
14
+ start?: number;
15
+ /** End time in milliseconds for phrase/utterance. */
16
+ end?: number;
17
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface CommonTranscript {
4
+ export interface CommonTranscriptResponse {
5
5
  /** The channel associated with this phrase/utterance. */
6
6
  channel: number;
7
7
  /** The identifier of the participant. */
@@ -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.mjs";
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.mjs";
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 can include any text to be reasoned over for document generation: Transcript text, facts, or other narrative information. */
6
+ data: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Corti from "../index.mjs";
5
+ export interface DocumentsContextWithTranscript {
6
+ /** Transcript object can accept the full transcript in one string, or individual transcript segments. */
7
+ data: Corti.CommonTranscriptRequest;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -2,4 +2,10 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
- export type DocumentsCreateRequest = Corti.DocumentsCreateRequestWithTemplateKey | Corti.DocumentsCreateRequestWithTemplateId | Corti.DocumentsCreateRequestWithTemplate;
5
+ export type DocumentsCreateRequest =
6
+ /**
7
+ * Standard method for document generation: Use template key to generate document based on pre-defined template. */
8
+ Corti.DocumentsCreateRequestWithTemplateKey
9
+ /**
10
+ * Advanced method for document generation: Define sectionKeys in the request to build a template dynamically. See a detailed example [here](/templates/documents-advanced#assemble-a-template-with-extra-instructions). */
11
+ | Corti.DocumentsCreateRequestWithTemplate;
@@ -3,14 +3,12 @@
3
3
  */
4
4
  import * as Corti from "../index.mjs";
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;
10
10
  /** An optional name for the document. */
11
11
  name?: string;
12
- /** The model or documentation mode to use for summarization. */
13
- modelName?: string;
14
- /** The language in which the document will be generated. Check https://docs.corti.ai/about/languages for more. */
12
+ /** The language in which the document will be generated. Check [languages page](/about/languages) for more. */
15
13
  outputLanguage: string;
16
14
  }
@@ -3,14 +3,12 @@
3
3
  */
4
4
  import * as Corti from "../index.mjs";
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;
10
10
  /** An optional name for the document. */
11
11
  name?: string;
12
- /** The model or documentation mode to use for summarization. */
13
- modelName?: string;
14
- /** The language in which the document will be generated. Check https://docs.corti.ai/about/languages for more. */
12
+ /** The language in which the document will be generated. Check [languages page](/about/languages) for more. */
15
13
  outputLanguage: string;
16
14
  }
@@ -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.mjs";
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;
@@ -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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -5,7 +5,7 @@ import * as Corti from "../index.mjs";
5
5
  export interface FactsBatchUpdateInput {
6
6
  /** The unique identifier of the fact to be updated. */
7
7
  factId: Corti.Uuid;
8
- /** Indicates whether the fact should be discarded. */
8
+ /** Set this to true for facts discarded by an end-user, then filter those out from the document generation request. */
9
9
  isDiscarded?: boolean;
10
10
  /** The updated text content of the fact. */
11
11
  text?: string;
@@ -13,7 +13,7 @@ export interface FactsCreateItem {
13
13
  groupId?: Corti.Uuid;
14
14
  /** The origin of the fact, such as 'USER' or 'SYSTEM'. */
15
15
  source?: Corti.CommonSourceEnum;
16
- /** Indicates whether the fact has been marked as discarded. */
16
+ /** Indicates whether the fact has been marked as discarded by an end-user. */
17
17
  isDiscarded?: boolean;
18
18
  /** The timestamp when the fact was last updated. */
19
19
  updatedAt?: Date;
@@ -11,7 +11,7 @@ export interface FactsListItem {
11
11
  group?: string;
12
12
  /** The unique identifier of the group to which the fact belongs. */
13
13
  groupId?: Corti.Uuid;
14
- /** Indicates whether the fact has been marked as discarded. */
14
+ /** Indicates whether the fact has been marked as discarded by an end-user. */
15
15
  isDiscarded?: boolean;
16
16
  /** The origin of the fact. */
17
17
  source?: Corti.CommonSourceEnum;
@@ -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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -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
  }
@@ -6,5 +6,5 @@ export interface TranscriptsData {
6
6
  /** Additional information about the participants involved in the transcript. */
7
7
  metadata: Corti.TranscriptsMetadata;
8
8
  /** An array of transcripts. */
9
- transcripts: Corti.CommonTranscript[];
9
+ transcripts: Corti.CommonTranscriptResponse[];
10
10
  }
@@ -8,6 +8,6 @@ export interface TranscriptsResponse {
8
8
  /** Additional information about the participants involved in the transcript. */
9
9
  metadata: Corti.TranscriptsMetadata;
10
10
  /** An array of transcripts. */
11
- transcripts: Corti.CommonTranscript[];
11
+ transcripts?: Corti.CommonTranscriptResponse[] | null;
12
12
  usageInfo: Corti.CommonUsageInfo;
13
13
  }
@@ -1,7 +1,10 @@
1
1
  export * from "./DocumentsContext.mjs";
2
- export * from "./DocumentsContextData.mjs";
2
+ export * from "./DocumentsContextWithFacts.mjs";
3
+ export * from "./DocumentsContextWithTranscript.mjs";
4
+ export * from "./DocumentsContextWithString.mjs";
3
5
  export * from "./DocumentsSection.mjs";
4
6
  export * from "./DocumentsTemplate.mjs";
7
+ export * from "./DocumentsTemplateWithSectionKeys.mjs";
5
8
  export * from "./InteractionsEncounterCreateRequest.mjs";
6
9
  export * from "./InteractionsEncounterUpdateRequest.mjs";
7
10
  export * from "./InteractionsEncounterResponse.mjs";
@@ -12,7 +15,6 @@ export * from "./FactsFactGroupsItemTranslationsItem.mjs";
12
15
  export * from "./FactsFactGroupsItem.mjs";
13
16
  export * from "./InteractionsPatient.mjs";
14
17
  export * from "./DocumentsCreateRequest.mjs";
15
- export * from "./DocumentsCreateRequestWithTemplateId.mjs";
16
18
  export * from "./DocumentsCreateRequestWithTemplateKey.mjs";
17
19
  export * from "./DocumentsCreateRequestWithTemplate.mjs";
18
20
  export * from "./DocumentsSectionInput.mjs";
@@ -46,16 +48,17 @@ export * from "./TemplatesSection.mjs";
46
48
  export * from "./CommonSortingDirectionEnum.mjs";
47
49
  export * from "./TemplatesItem.mjs";
48
50
  export * from "./TemplatesSectionSorted.mjs";
49
- export * from "./CommonTranscript.mjs";
51
+ export * from "./CommonTranscriptRequest.mjs";
52
+ export * from "./CommonTranscriptResponse.mjs";
50
53
  export * from "./Uuid.mjs";
51
54
  export * from "./CommonUsageInfo.mjs";
52
- export * from "./DocumentsContextTypeEnum.mjs";
53
55
  export * from "./InteractionsEncounterStatusEnum.mjs";
54
56
  export * from "./InteractionsEncounterTypeEnum.mjs";
55
57
  export * from "./InteractionsGenderEnum.mjs";
56
58
  export * from "./CommonSourceEnum.mjs";
57
59
  export * from "./TranscriptsParticipantRoleEnum.mjs";
58
60
  export * from "./TemplatesWritingStyle.mjs";
61
+ export * from "./TemplatesSectionTranslation.mjs";
59
62
  export * from "./TemplatesTranslation.mjs";
60
63
  export * from "./StreamConfigMessage.mjs";
61
64
  export * from "./StreamConfig.mjs";
@@ -1,7 +1,10 @@
1
1
  export * from "./DocumentsContext.mjs";
2
- export * from "./DocumentsContextData.mjs";
2
+ export * from "./DocumentsContextWithFacts.mjs";
3
+ export * from "./DocumentsContextWithTranscript.mjs";
4
+ export * from "./DocumentsContextWithString.mjs";
3
5
  export * from "./DocumentsSection.mjs";
4
6
  export * from "./DocumentsTemplate.mjs";
7
+ export * from "./DocumentsTemplateWithSectionKeys.mjs";
5
8
  export * from "./InteractionsEncounterCreateRequest.mjs";
6
9
  export * from "./InteractionsEncounterUpdateRequest.mjs";
7
10
  export * from "./InteractionsEncounterResponse.mjs";
@@ -12,7 +15,6 @@ export * from "./FactsFactGroupsItemTranslationsItem.mjs";
12
15
  export * from "./FactsFactGroupsItem.mjs";
13
16
  export * from "./InteractionsPatient.mjs";
14
17
  export * from "./DocumentsCreateRequest.mjs";
15
- export * from "./DocumentsCreateRequestWithTemplateId.mjs";
16
18
  export * from "./DocumentsCreateRequestWithTemplateKey.mjs";
17
19
  export * from "./DocumentsCreateRequestWithTemplate.mjs";
18
20
  export * from "./DocumentsSectionInput.mjs";
@@ -46,16 +48,17 @@ export * from "./TemplatesSection.mjs";
46
48
  export * from "./CommonSortingDirectionEnum.mjs";
47
49
  export * from "./TemplatesItem.mjs";
48
50
  export * from "./TemplatesSectionSorted.mjs";
49
- export * from "./CommonTranscript.mjs";
51
+ export * from "./CommonTranscriptRequest.mjs";
52
+ export * from "./CommonTranscriptResponse.mjs";
50
53
  export * from "./Uuid.mjs";
51
54
  export * from "./CommonUsageInfo.mjs";
52
- export * from "./DocumentsContextTypeEnum.mjs";
53
55
  export * from "./InteractionsEncounterStatusEnum.mjs";
54
56
  export * from "./InteractionsEncounterTypeEnum.mjs";
55
57
  export * from "./InteractionsGenderEnum.mjs";
56
58
  export * from "./CommonSourceEnum.mjs";
57
59
  export * from "./TranscriptsParticipantRoleEnum.mjs";
58
60
  export * from "./TemplatesWritingStyle.mjs";
61
+ export * from "./TemplatesSectionTranslation.mjs";
59
62
  export * from "./TemplatesTranslation.mjs";
60
63
  export * from "./StreamConfigMessage.mjs";
61
64
  export * from "./StreamConfig.mjs";
@@ -0,0 +1 @@
1
+ export * from "./file/exports.mjs";
@@ -0,0 +1 @@
1
+ export * from "./file/exports.mjs";
@@ -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";