ultrasafeai 1.0.1

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 (485) hide show
  1. package/BaseClient.ts +107 -0
  2. package/Client.ts +203 -0
  3. package/api/errors/BadRequestError.ts +22 -0
  4. package/api/errors/PaymentRequiredError.ts +22 -0
  5. package/api/errors/UnauthorizedError.ts +22 -0
  6. package/api/errors/index.ts +3 -0
  7. package/api/index.ts +3 -0
  8. package/api/resources/admin/client/Client.ts +4834 -0
  9. package/api/resources/admin/client/index.ts +1 -0
  10. package/api/resources/admin/client/requests/ActivateProjectCertificatesRequest.ts +16 -0
  11. package/api/resources/admin/client/requests/AddUserToGroupRequest.ts +14 -0
  12. package/api/resources/admin/client/requests/AddUserToProjectRequest.ts +14 -0
  13. package/api/resources/admin/client/requests/ArchiveProjectRequest.ts +12 -0
  14. package/api/resources/admin/client/requests/CreateAdminApiKeyRequest.ts +9 -0
  15. package/api/resources/admin/client/requests/CreateCertificateRequest.ts +9 -0
  16. package/api/resources/admin/client/requests/CreateGroupRequest.ts +11 -0
  17. package/api/resources/admin/client/requests/CreateGroupRoleRequest.ts +14 -0
  18. package/api/resources/admin/client/requests/CreateInviteRequest.ts +11 -0
  19. package/api/resources/admin/client/requests/CreateProjectGroupRequest.ts +16 -0
  20. package/api/resources/admin/client/requests/CreateProjectRequest.ts +11 -0
  21. package/api/resources/admin/client/requests/CreateRoleRequest.ts +12 -0
  22. package/api/resources/admin/client/requests/CreateServiceAccountRequest.ts +16 -0
  23. package/api/resources/admin/client/requests/CreateUserRoleRequest.ts +14 -0
  24. package/api/resources/admin/client/requests/DeactivateProjectCertificatesRequest.ts +16 -0
  25. package/api/resources/admin/client/requests/DeleteAdminApiKeyRequest.ts +11 -0
  26. package/api/resources/admin/client/requests/DeleteCertificateRequest.ts +11 -0
  27. package/api/resources/admin/client/requests/DeleteGroupRequest.ts +12 -0
  28. package/api/resources/admin/client/requests/DeleteGroupRoleRequest.ts +15 -0
  29. package/api/resources/admin/client/requests/DeleteInviteRequest.ts +11 -0
  30. package/api/resources/admin/client/requests/DeleteOrganizationUserRequest.ts +12 -0
  31. package/api/resources/admin/client/requests/DeleteProjectApiKeyRequest.ts +14 -0
  32. package/api/resources/admin/client/requests/DeleteProjectGroupRequest.ts +15 -0
  33. package/api/resources/admin/client/requests/DeleteRoleRequest.ts +12 -0
  34. package/api/resources/admin/client/requests/DeleteServiceAccountRequest.ts +14 -0
  35. package/api/resources/admin/client/requests/DeleteUserRoleRequest.ts +15 -0
  36. package/api/resources/admin/client/requests/GetAudioSpeechesUsageRequest.ts +12 -0
  37. package/api/resources/admin/client/requests/GetAudioTranscriptionsUsageRequest.ts +12 -0
  38. package/api/resources/admin/client/requests/GetCodeInterpreterSessionsUsageRequest.ts +12 -0
  39. package/api/resources/admin/client/requests/GetCompletionsUsageRequest.ts +12 -0
  40. package/api/resources/admin/client/requests/GetEmbeddingsUsageRequest.ts +12 -0
  41. package/api/resources/admin/client/requests/GetImagesUsageRequest.ts +12 -0
  42. package/api/resources/admin/client/requests/GetModerationsUsageRequest.ts +12 -0
  43. package/api/resources/admin/client/requests/GetOrganizationCostsRequest.ts +12 -0
  44. package/api/resources/admin/client/requests/GetVectorStoresUsageRequest.ts +12 -0
  45. package/api/resources/admin/client/requests/ListAdminApiKeysRequest.ts +12 -0
  46. package/api/resources/admin/client/requests/ListAuditLogsRequest.ts +12 -0
  47. package/api/resources/admin/client/requests/ListCertificatesRequest.ts +12 -0
  48. package/api/resources/admin/client/requests/ListGroupRolesRequest.ts +16 -0
  49. package/api/resources/admin/client/requests/ListGroupUsersRequest.ts +16 -0
  50. package/api/resources/admin/client/requests/ListGroupsRequest.ts +12 -0
  51. package/api/resources/admin/client/requests/ListInvitesRequest.ts +12 -0
  52. package/api/resources/admin/client/requests/ListOrganizationUsersRequest.ts +12 -0
  53. package/api/resources/admin/client/requests/ListProjectApiKeysRequest.ts +16 -0
  54. package/api/resources/admin/client/requests/ListProjectCertificatesRequest.ts +16 -0
  55. package/api/resources/admin/client/requests/ListProjectGroupsRequest.ts +16 -0
  56. package/api/resources/admin/client/requests/ListProjectUsersRequest.ts +16 -0
  57. package/api/resources/admin/client/requests/ListProjectsRequest.ts +12 -0
  58. package/api/resources/admin/client/requests/ListRateLimitsRequest.ts +16 -0
  59. package/api/resources/admin/client/requests/ListRolesRequest.ts +12 -0
  60. package/api/resources/admin/client/requests/ListServiceAccountsRequest.ts +16 -0
  61. package/api/resources/admin/client/requests/ListUserRolesRequest.ts +16 -0
  62. package/api/resources/admin/client/requests/RemoveUserFromGroupRequest.ts +15 -0
  63. package/api/resources/admin/client/requests/RemoveUserFromProjectRequest.ts +15 -0
  64. package/api/resources/admin/client/requests/RetrieveAdminApiKeyRequest.ts +11 -0
  65. package/api/resources/admin/client/requests/RetrieveCertificateRequest.ts +11 -0
  66. package/api/resources/admin/client/requests/RetrieveInviteRequest.ts +11 -0
  67. package/api/resources/admin/client/requests/RetrieveOrganizationUserRequest.ts +12 -0
  68. package/api/resources/admin/client/requests/RetrieveProjectApiKeyRequest.ts +14 -0
  69. package/api/resources/admin/client/requests/RetrieveProjectRequest.ts +12 -0
  70. package/api/resources/admin/client/requests/RetrieveProjectUserRequest.ts +15 -0
  71. package/api/resources/admin/client/requests/RetrieveServiceAccountRequest.ts +14 -0
  72. package/api/resources/admin/client/requests/UpdateCertificateRequest.ts +15 -0
  73. package/api/resources/admin/client/requests/UpdateGroupRequest.ts +16 -0
  74. package/api/resources/admin/client/requests/UpdateOrganizationUserRequest.ts +16 -0
  75. package/api/resources/admin/client/requests/UpdateProjectRequest.ts +16 -0
  76. package/api/resources/admin/client/requests/UpdateProjectUserRequest.ts +19 -0
  77. package/api/resources/admin/client/requests/UpdateRateLimitRequest.ts +18 -0
  78. package/api/resources/admin/client/requests/UpdateRoleRequest.ts +16 -0
  79. package/api/resources/admin/client/requests/index.ts +69 -0
  80. package/api/resources/admin/exports.ts +4 -0
  81. package/api/resources/admin/index.ts +1 -0
  82. package/api/resources/assistants/client/Client.ts +272 -0
  83. package/api/resources/assistants/client/index.ts +1 -0
  84. package/api/resources/assistants/client/requests/CreateAssistantsRequest.ts +20 -0
  85. package/api/resources/assistants/client/requests/DeleteAssistantsRequest.ts +12 -0
  86. package/api/resources/assistants/client/requests/ListAssistantsRequest.ts +12 -0
  87. package/api/resources/assistants/client/requests/RetrieveAssistantsRequest.ts +12 -0
  88. package/api/resources/assistants/client/requests/index.ts +4 -0
  89. package/api/resources/assistants/exports.ts +4 -0
  90. package/api/resources/assistants/index.ts +1 -0
  91. package/api/resources/audio/client/Client.ts +117 -0
  92. package/api/resources/audio/client/index.ts +1 -0
  93. package/api/resources/audio/client/requests/TranslateAudioRequest.ts +15 -0
  94. package/api/resources/audio/client/requests/index.ts +1 -0
  95. package/api/resources/audio/exports.ts +5 -0
  96. package/api/resources/audio/index.ts +2 -0
  97. package/api/resources/audio/resources/index.ts +9 -0
  98. package/api/resources/audio/resources/speech/client/Client.ts +132 -0
  99. package/api/resources/audio/resources/speech/client/index.ts +1 -0
  100. package/api/resources/audio/resources/speech/client/requests/CreateSpeechRequest.ts +12 -0
  101. package/api/resources/audio/resources/speech/client/requests/StreamSpeechRequest.ts +25 -0
  102. package/api/resources/audio/resources/speech/client/requests/index.ts +2 -0
  103. package/api/resources/audio/resources/speech/exports.ts +4 -0
  104. package/api/resources/audio/resources/speech/index.ts +1 -0
  105. package/api/resources/audio/resources/stream/client/Client.ts +232 -0
  106. package/api/resources/audio/resources/stream/client/index.ts +4 -0
  107. package/api/resources/audio/resources/stream/client/requests/ConnectRequest.ts +26 -0
  108. package/api/resources/audio/resources/stream/client/requests/index.ts +4 -0
  109. package/api/resources/audio/resources/stream/exports.ts +5 -0
  110. package/api/resources/audio/resources/stream/index.ts +5 -0
  111. package/api/resources/audio/resources/transcriptions/client/Client.ts +101 -0
  112. package/api/resources/audio/resources/transcriptions/client/index.ts +1 -0
  113. package/api/resources/audio/resources/transcriptions/client/requests/CreateTranscriptionsRequest.ts +21 -0
  114. package/api/resources/audio/resources/transcriptions/client/requests/index.ts +1 -0
  115. package/api/resources/audio/resources/transcriptions/exports.ts +4 -0
  116. package/api/resources/audio/resources/transcriptions/index.ts +1 -0
  117. package/api/resources/audio/resources/voices/client/Client.ts +165 -0
  118. package/api/resources/audio/resources/voices/client/index.ts +1 -0
  119. package/api/resources/audio/resources/voices/client/requests/CloneVoicesRequest.ts +23 -0
  120. package/api/resources/audio/resources/voices/client/requests/index.ts +1 -0
  121. package/api/resources/audio/resources/voices/exports.ts +4 -0
  122. package/api/resources/audio/resources/voices/index.ts +2 -0
  123. package/api/resources/audio/resources/voices/types/CloneVoicesResponse.ts +7 -0
  124. package/api/resources/audio/resources/voices/types/ListVoicesResponse.ts +18 -0
  125. package/api/resources/audio/resources/voices/types/index.ts +2 -0
  126. package/api/resources/audioStream/exports.ts +3 -0
  127. package/api/resources/audioStream/index.ts +1 -0
  128. package/api/resources/audioStream/types/AudioStreamAudioFormat.ts +8 -0
  129. package/api/resources/audioStream/types/index.ts +1 -0
  130. package/api/resources/batches/client/Client.ts +274 -0
  131. package/api/resources/batches/client/index.ts +1 -0
  132. package/api/resources/batches/client/requests/CancelBatchRequest.ts +12 -0
  133. package/api/resources/batches/client/requests/CreateBatchRequest.ts +15 -0
  134. package/api/resources/batches/client/requests/ListBatchesRequest.ts +12 -0
  135. package/api/resources/batches/client/requests/RetrieveBatchRequest.ts +12 -0
  136. package/api/resources/batches/client/requests/index.ts +4 -0
  137. package/api/resources/batches/exports.ts +4 -0
  138. package/api/resources/batches/index.ts +1 -0
  139. package/api/resources/chat/client/Client.ts +370 -0
  140. package/api/resources/chat/client/index.ts +1 -0
  141. package/api/resources/chat/client/requests/DeleteChatCompletionRequest.ts +12 -0
  142. package/api/resources/chat/client/requests/ListChatCompletionMessagesRequest.ts +16 -0
  143. package/api/resources/chat/client/requests/ListChatCompletionsRequest.ts +12 -0
  144. package/api/resources/chat/client/requests/RetrieveChatCompletionRequest.ts +12 -0
  145. package/api/resources/chat/client/requests/UpdateChatCompletionRequest.ts +16 -0
  146. package/api/resources/chat/client/requests/index.ts +5 -0
  147. package/api/resources/chat/exports.ts +5 -0
  148. package/api/resources/chat/index.ts +2 -0
  149. package/api/resources/chat/resources/completions/client/Client.ts +172 -0
  150. package/api/resources/chat/resources/completions/client/index.ts +1 -0
  151. package/api/resources/chat/resources/completions/client/requests/CreateCompletionsRequest.ts +78 -0
  152. package/api/resources/chat/resources/completions/client/requests/CreateCompletionsStreamRequest.ts +78 -0
  153. package/api/resources/chat/resources/completions/client/requests/index.ts +2 -0
  154. package/api/resources/chat/resources/completions/exports.ts +4 -0
  155. package/api/resources/chat/resources/completions/index.ts +2 -0
  156. package/api/resources/chat/resources/completions/types/CreateCompletionsRequestResponseFormat.ts +25 -0
  157. package/api/resources/chat/resources/completions/types/CreateCompletionsStreamRequestResponseFormat.ts +25 -0
  158. package/api/resources/chat/resources/completions/types/index.ts +2 -0
  159. package/api/resources/chat/resources/index.ts +3 -0
  160. package/api/resources/completions/client/Client.ts +87 -0
  161. package/api/resources/completions/client/index.ts +1 -0
  162. package/api/resources/completions/client/requests/CreateCompletionRequest.ts +13 -0
  163. package/api/resources/completions/client/requests/index.ts +1 -0
  164. package/api/resources/completions/exports.ts +4 -0
  165. package/api/resources/completions/index.ts +1 -0
  166. package/api/resources/containers/client/Client.ts +605 -0
  167. package/api/resources/containers/client/index.ts +1 -0
  168. package/api/resources/containers/client/requests/CreateContainerRequest.ts +9 -0
  169. package/api/resources/containers/client/requests/DeleteContainerFileRequest.ts +15 -0
  170. package/api/resources/containers/client/requests/DeleteContainerRequest.ts +12 -0
  171. package/api/resources/containers/client/requests/GetContainerFileContentRequest.ts +8 -0
  172. package/api/resources/containers/client/requests/ListContainerFilesRequest.ts +16 -0
  173. package/api/resources/containers/client/requests/ListContainersRequest.ts +12 -0
  174. package/api/resources/containers/client/requests/RetrieveContainerFileRequest.ts +15 -0
  175. package/api/resources/containers/client/requests/RetrieveContainerRequest.ts +12 -0
  176. package/api/resources/containers/client/requests/UploadContainerFileRequest.ts +16 -0
  177. package/api/resources/containers/client/requests/index.ts +9 -0
  178. package/api/resources/containers/exports.ts +4 -0
  179. package/api/resources/containers/index.ts +1 -0
  180. package/api/resources/embeddings/client/Client.ts +97 -0
  181. package/api/resources/embeddings/client/index.ts +1 -0
  182. package/api/resources/embeddings/client/requests/CreateEmbeddingsRequest.ts +34 -0
  183. package/api/resources/embeddings/client/requests/index.ts +1 -0
  184. package/api/resources/embeddings/exports.ts +4 -0
  185. package/api/resources/embeddings/index.ts +1 -0
  186. package/api/resources/evals/client/Client.ts +811 -0
  187. package/api/resources/evals/client/index.ts +1 -0
  188. package/api/resources/evals/client/requests/CancelEvalRunRequest.ts +15 -0
  189. package/api/resources/evals/client/requests/CreateEvalRequest.ts +12 -0
  190. package/api/resources/evals/client/requests/CreateEvalRunRequest.ts +16 -0
  191. package/api/resources/evals/client/requests/DeleteEvalRequest.ts +12 -0
  192. package/api/resources/evals/client/requests/DeleteEvalRunRequest.ts +15 -0
  193. package/api/resources/evals/client/requests/ListEvalRunsRequest.ts +16 -0
  194. package/api/resources/evals/client/requests/ListEvalsRequest.ts +12 -0
  195. package/api/resources/evals/client/requests/ListOutputItemsRequest.ts +19 -0
  196. package/api/resources/evals/client/requests/RetrieveEvalRequest.ts +12 -0
  197. package/api/resources/evals/client/requests/RetrieveEvalRunRequest.ts +15 -0
  198. package/api/resources/evals/client/requests/RetrieveOutputItemRequest.ts +17 -0
  199. package/api/resources/evals/client/requests/UpdateEvalRequest.ts +16 -0
  200. package/api/resources/evals/client/requests/index.ts +12 -0
  201. package/api/resources/evals/exports.ts +4 -0
  202. package/api/resources/evals/index.ts +1 -0
  203. package/api/resources/files/client/Client.ts +338 -0
  204. package/api/resources/files/client/index.ts +1 -0
  205. package/api/resources/files/client/requests/DeleteFilesRequest.ts +12 -0
  206. package/api/resources/files/client/requests/ListFilesRequest.ts +16 -0
  207. package/api/resources/files/client/requests/RetrieveFileContentRequest.ts +6 -0
  208. package/api/resources/files/client/requests/RetrieveFilesRequest.ts +12 -0
  209. package/api/resources/files/client/requests/UploadFilesRequest.ts +23 -0
  210. package/api/resources/files/client/requests/index.ts +5 -0
  211. package/api/resources/files/exports.ts +4 -0
  212. package/api/resources/files/index.ts +2 -0
  213. package/api/resources/files/types/ListFilesRequestOrder.ts +7 -0
  214. package/api/resources/files/types/index.ts +1 -0
  215. package/api/resources/fineTuning/client/Client.ts +693 -0
  216. package/api/resources/fineTuning/client/index.ts +1 -0
  217. package/api/resources/fineTuning/client/requests/CancelFineTuningJobRequest.ts +11 -0
  218. package/api/resources/fineTuning/client/requests/CreateFineTuningJobRequest.ts +13 -0
  219. package/api/resources/fineTuning/client/requests/ListFineTuningCheckpointsRequest.ts +15 -0
  220. package/api/resources/fineTuning/client/requests/ListFineTuningJobEventsRequest.ts +15 -0
  221. package/api/resources/fineTuning/client/requests/ListFineTuningJobsRequest.ts +12 -0
  222. package/api/resources/fineTuning/client/requests/PauseFineTuningJobRequest.ts +11 -0
  223. package/api/resources/fineTuning/client/requests/ResumeFineTuningJobRequest.ts +11 -0
  224. package/api/resources/fineTuning/client/requests/RetrieveFineTuningJobRequest.ts +11 -0
  225. package/api/resources/fineTuning/client/requests/index.ts +8 -0
  226. package/api/resources/fineTuning/exports.ts +4 -0
  227. package/api/resources/fineTuning/index.ts +1 -0
  228. package/api/resources/images/client/Client.ts +239 -0
  229. package/api/resources/images/client/index.ts +1 -0
  230. package/api/resources/images/client/requests/CreateImageVariationsRequest.ts +12 -0
  231. package/api/resources/images/client/requests/EditImageRequest.ts +14 -0
  232. package/api/resources/images/client/requests/GenerateImagesRequest.ts +37 -0
  233. package/api/resources/images/client/requests/index.ts +3 -0
  234. package/api/resources/images/exports.ts +4 -0
  235. package/api/resources/images/index.ts +1 -0
  236. package/api/resources/index.ts +55 -0
  237. package/api/resources/models/client/Client.ts +138 -0
  238. package/api/resources/models/client/index.ts +1 -0
  239. package/api/resources/models/client/requests/RetrieveModelsRequest.ts +12 -0
  240. package/api/resources/models/client/requests/index.ts +1 -0
  241. package/api/resources/models/exports.ts +4 -0
  242. package/api/resources/models/index.ts +2 -0
  243. package/api/resources/models/types/ListModelsResponse.ts +9 -0
  244. package/api/resources/models/types/index.ts +1 -0
  245. package/api/resources/moderations/client/Client.ts +87 -0
  246. package/api/resources/moderations/client/index.ts +1 -0
  247. package/api/resources/moderations/client/requests/CreateModerationRequest.ts +17 -0
  248. package/api/resources/moderations/client/requests/index.ts +1 -0
  249. package/api/resources/moderations/exports.ts +4 -0
  250. package/api/resources/moderations/index.ts +1 -0
  251. package/api/resources/ocr/client/Client.ts +300 -0
  252. package/api/resources/ocr/client/index.ts +1 -0
  253. package/api/resources/ocr/client/requests/ExtractOcrRequest.ts +31 -0
  254. package/api/resources/ocr/client/requests/GenerateSchemaOcrRequest.ts +16 -0
  255. package/api/resources/ocr/client/requests/StreamOcrRequest.ts +25 -0
  256. package/api/resources/ocr/client/requests/index.ts +3 -0
  257. package/api/resources/ocr/exports.ts +4 -0
  258. package/api/resources/ocr/index.ts +1 -0
  259. package/api/resources/parser/client/Client.ts +560 -0
  260. package/api/resources/parser/client/index.ts +1 -0
  261. package/api/resources/parser/client/requests/ClassifyParserRequest.ts +17 -0
  262. package/api/resources/parser/client/requests/GenerateInstructionParserRequest.ts +16 -0
  263. package/api/resources/parser/client/requests/ParseParserRequest.ts +39 -0
  264. package/api/resources/parser/client/requests/SheetsParserRequest.ts +22 -0
  265. package/api/resources/parser/client/requests/SplitParserRequest.ts +21 -0
  266. package/api/resources/parser/client/requests/StreamParserRequest.ts +37 -0
  267. package/api/resources/parser/client/requests/index.ts +6 -0
  268. package/api/resources/parser/exports.ts +4 -0
  269. package/api/resources/parser/index.ts +2 -0
  270. package/api/resources/parser/types/ClassifyParserResponse.ts +7 -0
  271. package/api/resources/parser/types/GenerateInstructionParserResponse.ts +6 -0
  272. package/api/resources/parser/types/SheetsParserResponse.ts +16 -0
  273. package/api/resources/parser/types/SplitParserResponse.ts +16 -0
  274. package/api/resources/parser/types/index.ts +4 -0
  275. package/api/resources/realtime/client/Client.ts +149 -0
  276. package/api/resources/realtime/client/index.ts +1 -0
  277. package/api/resources/realtime/client/requests/CreateRealtimeSessionRequest.ts +9 -0
  278. package/api/resources/realtime/client/requests/CreateTranscriptionSessionRequest.ts +9 -0
  279. package/api/resources/realtime/client/requests/index.ts +2 -0
  280. package/api/resources/realtime/exports.ts +4 -0
  281. package/api/resources/realtime/index.ts +1 -0
  282. package/api/resources/rerank/client/Client.ts +88 -0
  283. package/api/resources/rerank/client/index.ts +1 -0
  284. package/api/resources/rerank/client/requests/CreateRerankRequest.ts +20 -0
  285. package/api/resources/rerank/client/requests/index.ts +1 -0
  286. package/api/resources/rerank/exports.ts +4 -0
  287. package/api/resources/rerank/index.ts +2 -0
  288. package/api/resources/rerank/types/CreateRerankResponse.ts +29 -0
  289. package/api/resources/rerank/types/index.ts +1 -0
  290. package/api/resources/skills/client/Client.ts +390 -0
  291. package/api/resources/skills/client/index.ts +1 -0
  292. package/api/resources/skills/client/requests/CreateSkillRequest.ts +12 -0
  293. package/api/resources/skills/client/requests/DeleteSkillRequest.ts +12 -0
  294. package/api/resources/skills/client/requests/GetSkillContentRequest.ts +6 -0
  295. package/api/resources/skills/client/requests/ListSkillsRequest.ts +12 -0
  296. package/api/resources/skills/client/requests/RetrieveSkillRequest.ts +12 -0
  297. package/api/resources/skills/client/requests/UpdateSkillRequest.ts +16 -0
  298. package/api/resources/skills/client/requests/index.ts +6 -0
  299. package/api/resources/skills/exports.ts +4 -0
  300. package/api/resources/skills/index.ts +1 -0
  301. package/api/resources/threads/client/Client.ts +478 -0
  302. package/api/resources/threads/client/index.ts +1 -0
  303. package/api/resources/threads/client/requests/AddMessageThreadsRequest.ts +18 -0
  304. package/api/resources/threads/client/requests/CreateThreadsRequest.ts +10 -0
  305. package/api/resources/threads/client/requests/GetRunThreadsRequest.ts +15 -0
  306. package/api/resources/threads/client/requests/ListMessagesThreadsRequest.ts +16 -0
  307. package/api/resources/threads/client/requests/ListThreadsRequest.ts +12 -0
  308. package/api/resources/threads/client/requests/RetrieveThreadsRequest.ts +12 -0
  309. package/api/resources/threads/client/requests/RunThreadsRequest.ts +18 -0
  310. package/api/resources/threads/client/requests/index.ts +7 -0
  311. package/api/resources/threads/exports.ts +4 -0
  312. package/api/resources/threads/index.ts +1 -0
  313. package/api/resources/ultraparser/client/Client.ts +753 -0
  314. package/api/resources/ultraparser/client/index.ts +1 -0
  315. package/api/resources/ultraparser/client/requests/CreateCollectionRequest.ts +16 -0
  316. package/api/resources/ultraparser/client/requests/DeleteCollectionRequest.ts +12 -0
  317. package/api/resources/ultraparser/client/requests/DeleteFileUltraparserRequest.ts +12 -0
  318. package/api/resources/ultraparser/client/requests/FilesearchRequest.ts +45 -0
  319. package/api/resources/ultraparser/client/requests/GetCollectionRequest.ts +12 -0
  320. package/api/resources/ultraparser/client/requests/PreviewFileUltraparserRequest.ts +12 -0
  321. package/api/resources/ultraparser/client/requests/RunBenchmarkUltraparserRequest.ts +25 -0
  322. package/api/resources/ultraparser/client/requests/UploadFilesUltraparserRequest.ts +14 -0
  323. package/api/resources/ultraparser/client/requests/index.ts +8 -0
  324. package/api/resources/ultraparser/exports.ts +4 -0
  325. package/api/resources/ultraparser/index.ts +2 -0
  326. package/api/resources/ultraparser/types/ListCollectionsResponse.ts +15 -0
  327. package/api/resources/ultraparser/types/RunBenchmarkUltraparserResponse.ts +19 -0
  328. package/api/resources/ultraparser/types/UploadFilesUltraparserResponse.ts +5 -0
  329. package/api/resources/ultraparser/types/index.ts +3 -0
  330. package/api/resources/uploads/client/Client.ts +284 -0
  331. package/api/resources/uploads/client/index.ts +1 -0
  332. package/api/resources/uploads/client/requests/CancelUploadRequest.ts +12 -0
  333. package/api/resources/uploads/client/requests/CompleteUploadRequest.ts +14 -0
  334. package/api/resources/uploads/client/requests/CreateUploadRequest.ts +13 -0
  335. package/api/resources/uploads/client/requests/UploadPartRequest.ts +16 -0
  336. package/api/resources/uploads/client/requests/index.ts +4 -0
  337. package/api/resources/uploads/exports.ts +4 -0
  338. package/api/resources/uploads/index.ts +1 -0
  339. package/api/resources/vectorStores/client/Client.ts +1122 -0
  340. package/api/resources/vectorStores/client/index.ts +1 -0
  341. package/api/resources/vectorStores/client/requests/CancelVectorStoreFileBatchRequest.ts +15 -0
  342. package/api/resources/vectorStores/client/requests/CreateVectorStoreFileBatchRequest.ts +13 -0
  343. package/api/resources/vectorStores/client/requests/CreateVectorStoresRequest.ts +14 -0
  344. package/api/resources/vectorStores/client/requests/DeleteVectorStoreFileRequest.ts +15 -0
  345. package/api/resources/vectorStores/client/requests/DeleteVectorStoresRequest.ts +12 -0
  346. package/api/resources/vectorStores/client/requests/GetVectorStoreFileContentRequest.ts +15 -0
  347. package/api/resources/vectorStores/client/requests/ListVectorStoreBatchFilesRequest.ts +19 -0
  348. package/api/resources/vectorStores/client/requests/ListVectorStoreFilesRequest.ts +16 -0
  349. package/api/resources/vectorStores/client/requests/ListVectorStoresRequest.ts +12 -0
  350. package/api/resources/vectorStores/client/requests/RetrieveVectorStoreFileBatchRequest.ts +15 -0
  351. package/api/resources/vectorStores/client/requests/RetrieveVectorStoreFileRequest.ts +15 -0
  352. package/api/resources/vectorStores/client/requests/RetrieveVectorStoresRequest.ts +12 -0
  353. package/api/resources/vectorStores/client/requests/SearchVectorStoreRequest.ts +13 -0
  354. package/api/resources/vectorStores/client/requests/UpdateVectorStoreFileRequest.ts +19 -0
  355. package/api/resources/vectorStores/client/requests/UpdateVectorStoreRequest.ts +16 -0
  356. package/api/resources/vectorStores/client/requests/UploadVectorStoreFileRequest.ts +16 -0
  357. package/api/resources/vectorStores/client/requests/index.ts +16 -0
  358. package/api/resources/vectorStores/exports.ts +4 -0
  359. package/api/resources/vectorStores/index.ts +1 -0
  360. package/api/resources/videos/client/Client.ts +272 -0
  361. package/api/resources/videos/client/index.ts +1 -0
  362. package/api/resources/videos/client/requests/DeleteVideoRequest.ts +11 -0
  363. package/api/resources/videos/client/requests/ListVideosRequest.ts +12 -0
  364. package/api/resources/videos/client/requests/RetrieveVideoRequest.ts +11 -0
  365. package/api/resources/videos/client/requests/index.ts +3 -0
  366. package/api/resources/videos/exports.ts +4 -0
  367. package/api/resources/videos/index.ts +1 -0
  368. package/api/types/Assistant.ts +12 -0
  369. package/api/types/Batch.ts +21 -0
  370. package/api/types/ChatCompletion.ts +124 -0
  371. package/api/types/ChatCompletionAssistantMessageParam.ts +45 -0
  372. package/api/types/ChatCompletionAssistantMessageParamToolCallsItem.ts +17 -0
  373. package/api/types/ChatCompletionChoicesItemMessageToolCallsItem.ts +17 -0
  374. package/api/types/ChatCompletionChunk.ts +140 -0
  375. package/api/types/ChatCompletionCustomTool.ts +29 -0
  376. package/api/types/ChatCompletionCustomToolCustomFormat.ts +43 -0
  377. package/api/types/ChatCompletionMessageCustomToolCall.ts +19 -0
  378. package/api/types/ChatCompletionMessageToolCall.ts +19 -0
  379. package/api/types/ChatCompletionTool.ts +15 -0
  380. package/api/types/ChatCompletionToolChoiceOption.ts +35 -0
  381. package/api/types/ChatCompletionToolMessageParam.ts +28 -0
  382. package/api/types/Completion.ts +10 -0
  383. package/api/types/Container.ts +8 -0
  384. package/api/types/DeletedResponse.ts +7 -0
  385. package/api/types/Embedding.ts +21 -0
  386. package/api/types/EmbeddingResponse.ts +28 -0
  387. package/api/types/Error_.ts +13 -0
  388. package/api/types/Eval.ts +9 -0
  389. package/api/types/EvalRun.ts +9 -0
  390. package/api/types/FileObject.ts +10 -0
  391. package/api/types/FineTuningJob.ts +11 -0
  392. package/api/types/FunctionDefinition.ts +15 -0
  393. package/api/types/Group.ts +8 -0
  394. package/api/types/ImageResponse.ts +17 -0
  395. package/api/types/ListResponse.ts +7 -0
  396. package/api/types/Message.ts +13 -0
  397. package/api/types/Model.ts +28 -0
  398. package/api/types/ModerationResponse.ts +7 -0
  399. package/api/types/Organization.ts +8 -0
  400. package/api/types/PaginationParams.ts +10 -0
  401. package/api/types/Project.ts +8 -0
  402. package/api/types/ResponseFormatJsonObject.ts +3 -0
  403. package/api/types/ResponseFormatJsonSchema.ts +18 -0
  404. package/api/types/ResponseFormatText.ts +3 -0
  405. package/api/types/Role.ts +8 -0
  406. package/api/types/Run.ts +19 -0
  407. package/api/types/RunStep.ts +17 -0
  408. package/api/types/Skill.ts +9 -0
  409. package/api/types/Thread.ts +8 -0
  410. package/api/types/TranscriptEvent.ts +38 -0
  411. package/api/types/TranscriptSegment.ts +19 -0
  412. package/api/types/TranscriptionResponse.ts +7 -0
  413. package/api/types/TranslationResponse.ts +5 -0
  414. package/api/types/UltraparserCollection.ts +25 -0
  415. package/api/types/UltraparserError.ts +6 -0
  416. package/api/types/UltraparserFilesearchResponse.ts +51 -0
  417. package/api/types/UltraparserGenerateSchemaResponse.ts +13 -0
  418. package/api/types/UltraparserHealthResponse.ts +11 -0
  419. package/api/types/UltraparserOcrResponse.ts +58 -0
  420. package/api/types/UltraparserParseResponse.ts +33 -0
  421. package/api/types/UltraparserSseEvent.ts +40 -0
  422. package/api/types/Upload.ts +10 -0
  423. package/api/types/User.ts +9 -0
  424. package/api/types/VectorStore.ts +10 -0
  425. package/api/types/index.ts +57 -0
  426. package/auth/HeaderAuthProvider.ts +48 -0
  427. package/auth/index.ts +1 -0
  428. package/core/auth/AuthProvider.ts +15 -0
  429. package/core/auth/AuthRequest.ts +9 -0
  430. package/core/auth/BasicAuth.ts +37 -0
  431. package/core/auth/BearerToken.ts +20 -0
  432. package/core/auth/NoOpAuthProvider.ts +8 -0
  433. package/core/auth/index.ts +5 -0
  434. package/core/base64.ts +27 -0
  435. package/core/exports.ts +2 -0
  436. package/core/fetcher/APIResponse.ts +23 -0
  437. package/core/fetcher/BinaryResponse.ts +34 -0
  438. package/core/fetcher/EndpointMetadata.ts +13 -0
  439. package/core/fetcher/EndpointSupplier.ts +14 -0
  440. package/core/fetcher/Fetcher.ts +413 -0
  441. package/core/fetcher/Headers.ts +93 -0
  442. package/core/fetcher/HttpResponsePromise.ts +116 -0
  443. package/core/fetcher/RawResponse.ts +61 -0
  444. package/core/fetcher/Supplier.ts +11 -0
  445. package/core/fetcher/createRequestUrl.ts +6 -0
  446. package/core/fetcher/getErrorResponseBody.ts +33 -0
  447. package/core/fetcher/getFetchFn.ts +3 -0
  448. package/core/fetcher/getHeader.ts +8 -0
  449. package/core/fetcher/getRequestBody.ts +20 -0
  450. package/core/fetcher/getResponseBody.ts +70 -0
  451. package/core/fetcher/index.ts +13 -0
  452. package/core/fetcher/makePassthroughRequest.ts +189 -0
  453. package/core/fetcher/makeRequest.ts +70 -0
  454. package/core/fetcher/requestWithRetries.ts +68 -0
  455. package/core/fetcher/signals.ts +35 -0
  456. package/core/file/exports.ts +1 -0
  457. package/core/file/file.ts +217 -0
  458. package/core/file/index.ts +2 -0
  459. package/core/file/types.ts +81 -0
  460. package/core/form-data-utils/FormDataWrapper.ts +140 -0
  461. package/core/form-data-utils/encodeAsFormParameter.ts +12 -0
  462. package/core/form-data-utils/index.ts +2 -0
  463. package/core/headers.ts +33 -0
  464. package/core/index.ts +9 -0
  465. package/core/json.ts +27 -0
  466. package/core/logging/exports.ts +19 -0
  467. package/core/logging/index.ts +1 -0
  468. package/core/logging/logger.ts +203 -0
  469. package/core/runtime/index.ts +1 -0
  470. package/core/runtime/runtime.ts +134 -0
  471. package/core/stream/Stream.ts +235 -0
  472. package/core/stream/index.ts +1 -0
  473. package/core/url/QueryStringBuilder.ts +87 -0
  474. package/core/url/encodePathParam.ts +18 -0
  475. package/core/url/index.ts +4 -0
  476. package/core/url/join.ts +79 -0
  477. package/core/url/qs.ts +87 -0
  478. package/environments.ts +15 -0
  479. package/errors/UltrasafeaiApiError.ts +64 -0
  480. package/errors/UltrasafeaiApiTimeoutError.ts +18 -0
  481. package/errors/handleNonStatusCodeError.ts +40 -0
  482. package/errors/index.ts +2 -0
  483. package/exports.ts +1 -0
  484. package/index.ts +6 -0
  485. package/package.json +11 -0
package/BaseClient.ts ADDED
@@ -0,0 +1,107 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js";
4
+ import { mergeHeaders } from "./core/headers.js";
5
+ import * as core from "./core/index.js";
6
+ import type * as environments from "./environments.js";
7
+
8
+ export type AuthOption =
9
+ | false
10
+ | core.AuthProvider["getAuthRequest"]
11
+ | core.AuthProvider
12
+ | HeaderAuthProvider.AuthOptions;
13
+
14
+ export type BaseClientOptions = {
15
+ environment?: core.Supplier<environments.UltrasafeaiApiEnvironment | environments.UltrasafeaiApiEnvironmentUrls>;
16
+ /** Specify a custom URL to connect the client to. */
17
+ baseUrl?: core.Supplier<string>;
18
+ /** Additional headers to include in requests. */
19
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
20
+ /** The default maximum time to wait for a response in seconds. */
21
+ timeoutInSeconds?: number;
22
+ /** The default number of times to retry the request. Defaults to 2. */
23
+ maxRetries?: number;
24
+ /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
25
+ fetch?: typeof fetch;
26
+ /** Configure logging for the client. */
27
+ logging?: core.logging.LogConfig | core.logging.Logger;
28
+ /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
29
+ auth?: AuthOption;
30
+ } & HeaderAuthProvider.AuthOptions;
31
+
32
+ export interface BaseRequestOptions {
33
+ /** The maximum time to wait for a response in seconds. */
34
+ timeoutInSeconds?: number;
35
+ /** The number of times to retry the request. Defaults to 2. */
36
+ maxRetries?: number;
37
+ /** A hook to abort the request. */
38
+ abortSignal?: AbortSignal;
39
+ /** Additional query string parameters to include in the request. */
40
+ queryParams?: Record<string, unknown>;
41
+ /** Additional headers to include in the request. */
42
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
43
+ }
44
+
45
+ export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
46
+ logging: core.logging.Logger;
47
+ authProvider?: core.AuthProvider;
48
+ };
49
+
50
+ export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> =
51
+ NormalizedClientOptions<T> & {
52
+ authProvider: core.AuthProvider;
53
+ };
54
+
55
+ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(
56
+ options: T,
57
+ ): NormalizedClientOptions<T> {
58
+ const headers = mergeHeaders(
59
+ {
60
+ "X-Fern-Language": "JavaScript",
61
+ "X-Fern-Runtime": core.RUNTIME.type,
62
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
63
+ },
64
+ options?.headers,
65
+ );
66
+
67
+ return {
68
+ ...options,
69
+ logging: core.logging.createLogger(options?.logging),
70
+ headers,
71
+ } as NormalizedClientOptions<T>;
72
+ }
73
+
74
+ export function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(
75
+ options: T,
76
+ ): NormalizedClientOptionsWithAuth<T> {
77
+ const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;
78
+
79
+ if (options.auth === false) {
80
+ normalized.authProvider = new core.NoOpAuthProvider();
81
+ return normalized;
82
+ }
83
+ if (options.auth != null) {
84
+ if (typeof options.auth === "function") {
85
+ normalized.authProvider = { getAuthRequest: options.auth };
86
+ return normalized;
87
+ }
88
+ if (core.isAuthProvider(options.auth)) {
89
+ normalized.authProvider = options.auth;
90
+ return normalized;
91
+ }
92
+ Object.assign(normalized, options.auth);
93
+ }
94
+
95
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
96
+ normalized.authProvider ??= new HeaderAuthProvider(normalizedWithNoOpAuthProvider);
97
+ return normalized;
98
+ }
99
+
100
+ function withNoOpAuthProvider<T extends BaseClientOptions = BaseClientOptions>(
101
+ options: NormalizedClientOptions<T>,
102
+ ): NormalizedClientOptionsWithAuth<T> {
103
+ return {
104
+ ...options,
105
+ authProvider: new core.NoOpAuthProvider(),
106
+ };
107
+ }
package/Client.ts ADDED
@@ -0,0 +1,203 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import { AdminClient } from "./api/resources/admin/client/Client.js";
4
+ import { AssistantsClient } from "./api/resources/assistants/client/Client.js";
5
+ import { AudioClient } from "./api/resources/audio/client/Client.js";
6
+ import { BatchesClient } from "./api/resources/batches/client/Client.js";
7
+ import { ChatClient } from "./api/resources/chat/client/Client.js";
8
+ import { CompletionsClient } from "./api/resources/completions/client/Client.js";
9
+ import { ContainersClient } from "./api/resources/containers/client/Client.js";
10
+ import { EmbeddingsClient } from "./api/resources/embeddings/client/Client.js";
11
+ import { EvalsClient } from "./api/resources/evals/client/Client.js";
12
+ import { FilesClient } from "./api/resources/files/client/Client.js";
13
+ import { FineTuningClient } from "./api/resources/fineTuning/client/Client.js";
14
+ import { ImagesClient } from "./api/resources/images/client/Client.js";
15
+ import { ModelsClient } from "./api/resources/models/client/Client.js";
16
+ import { ModerationsClient } from "./api/resources/moderations/client/Client.js";
17
+ import { OcrClient } from "./api/resources/ocr/client/Client.js";
18
+ import { ParserClient } from "./api/resources/parser/client/Client.js";
19
+ import { RealtimeClient } from "./api/resources/realtime/client/Client.js";
20
+ import { RerankClient } from "./api/resources/rerank/client/Client.js";
21
+ import { SkillsClient } from "./api/resources/skills/client/Client.js";
22
+ import { ThreadsClient } from "./api/resources/threads/client/Client.js";
23
+ import { UltraparserClient } from "./api/resources/ultraparser/client/Client.js";
24
+ import { UploadsClient } from "./api/resources/uploads/client/Client.js";
25
+ import { VectorStoresClient } from "./api/resources/vectorStores/client/Client.js";
26
+ import { VideosClient } from "./api/resources/videos/client/Client.js";
27
+ import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
28
+ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js";
29
+ import * as core from "./core/index.js";
30
+ import * as environments from "./environments.js";
31
+
32
+ export declare namespace UltrasafeaiApiClient {
33
+ export type Options = BaseClientOptions;
34
+
35
+ export interface RequestOptions extends BaseRequestOptions {}
36
+ }
37
+
38
+ export class UltrasafeaiApiClient {
39
+ protected readonly _options: NormalizedClientOptionsWithAuth<UltrasafeaiApiClient.Options>;
40
+ protected _chat: ChatClient | undefined;
41
+ protected _completions: CompletionsClient | undefined;
42
+ protected _embeddings: EmbeddingsClient | undefined;
43
+ protected _files: FilesClient | undefined;
44
+ protected _images: ImagesClient | undefined;
45
+ protected _audio: AudioClient | undefined;
46
+ protected _moderations: ModerationsClient | undefined;
47
+ protected _models: ModelsClient | undefined;
48
+ protected _fineTuning: FineTuningClient | undefined;
49
+ protected _vectorStores: VectorStoresClient | undefined;
50
+ protected _batches: BatchesClient | undefined;
51
+ protected _uploads: UploadsClient | undefined;
52
+ protected _assistants: AssistantsClient | undefined;
53
+ protected _threads: ThreadsClient | undefined;
54
+ protected _realtime: RealtimeClient | undefined;
55
+ protected _evals: EvalsClient | undefined;
56
+ protected _containers: ContainersClient | undefined;
57
+ protected _skills: SkillsClient | undefined;
58
+ protected _admin: AdminClient | undefined;
59
+ protected _rerank: RerankClient | undefined;
60
+ protected _videos: VideosClient | undefined;
61
+ protected _parser: ParserClient | undefined;
62
+ protected _ocr: OcrClient | undefined;
63
+ protected _ultraparser: UltraparserClient | undefined;
64
+
65
+ constructor(options: UltrasafeaiApiClient.Options = {}) {
66
+ this._options = normalizeClientOptionsWithAuth(options);
67
+ }
68
+
69
+ public get chat(): ChatClient {
70
+ return (this._chat ??= new ChatClient(this._options));
71
+ }
72
+
73
+ public get completions(): CompletionsClient {
74
+ return (this._completions ??= new CompletionsClient(this._options));
75
+ }
76
+
77
+ public get embeddings(): EmbeddingsClient {
78
+ return (this._embeddings ??= new EmbeddingsClient(this._options));
79
+ }
80
+
81
+ public get files(): FilesClient {
82
+ return (this._files ??= new FilesClient(this._options));
83
+ }
84
+
85
+ public get images(): ImagesClient {
86
+ return (this._images ??= new ImagesClient(this._options));
87
+ }
88
+
89
+ public get audio(): AudioClient {
90
+ return (this._audio ??= new AudioClient(this._options));
91
+ }
92
+
93
+ public get moderations(): ModerationsClient {
94
+ return (this._moderations ??= new ModerationsClient(this._options));
95
+ }
96
+
97
+ public get models(): ModelsClient {
98
+ return (this._models ??= new ModelsClient(this._options));
99
+ }
100
+
101
+ public get fineTuning(): FineTuningClient {
102
+ return (this._fineTuning ??= new FineTuningClient(this._options));
103
+ }
104
+
105
+ public get vectorStores(): VectorStoresClient {
106
+ return (this._vectorStores ??= new VectorStoresClient(this._options));
107
+ }
108
+
109
+ public get batches(): BatchesClient {
110
+ return (this._batches ??= new BatchesClient(this._options));
111
+ }
112
+
113
+ public get uploads(): UploadsClient {
114
+ return (this._uploads ??= new UploadsClient(this._options));
115
+ }
116
+
117
+ public get assistants(): AssistantsClient {
118
+ return (this._assistants ??= new AssistantsClient(this._options));
119
+ }
120
+
121
+ public get threads(): ThreadsClient {
122
+ return (this._threads ??= new ThreadsClient(this._options));
123
+ }
124
+
125
+ public get realtime(): RealtimeClient {
126
+ return (this._realtime ??= new RealtimeClient(this._options));
127
+ }
128
+
129
+ public get evals(): EvalsClient {
130
+ return (this._evals ??= new EvalsClient(this._options));
131
+ }
132
+
133
+ public get containers(): ContainersClient {
134
+ return (this._containers ??= new ContainersClient(this._options));
135
+ }
136
+
137
+ public get skills(): SkillsClient {
138
+ return (this._skills ??= new SkillsClient(this._options));
139
+ }
140
+
141
+ public get admin(): AdminClient {
142
+ return (this._admin ??= new AdminClient(this._options));
143
+ }
144
+
145
+ public get rerank(): RerankClient {
146
+ return (this._rerank ??= new RerankClient(this._options));
147
+ }
148
+
149
+ public get videos(): VideosClient {
150
+ return (this._videos ??= new VideosClient(this._options));
151
+ }
152
+
153
+ public get parser(): ParserClient {
154
+ return (this._parser ??= new ParserClient(this._options));
155
+ }
156
+
157
+ public get ocr(): OcrClient {
158
+ return (this._ocr ??= new OcrClient(this._options));
159
+ }
160
+
161
+ public get ultraparser(): UltraparserClient {
162
+ return (this._ultraparser ??= new UltraparserClient(this._options));
163
+ }
164
+
165
+ /**
166
+ * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
167
+ * This is useful for making requests to endpoints not yet supported in the SDK.
168
+ * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
169
+ *
170
+ * @param {Request | string | URL} input - The URL, path, or Request object.
171
+ * @param {RequestInit} init - Standard fetch RequestInit options.
172
+ * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
173
+ * @returns {Promise<Response>} A standard Response object.
174
+ */
175
+ public async fetch(
176
+ input: Request | string | URL,
177
+ init?: RequestInit,
178
+ requestOptions?: core.PassthroughRequest.RequestOptions,
179
+ ): Promise<Response> {
180
+ return core.makePassthroughRequest(
181
+ input,
182
+ init,
183
+ {
184
+ baseUrl:
185
+ this._options.baseUrl ??
186
+ (async () => {
187
+ const env = await core.Supplier.get(this._options.environment);
188
+ return typeof env === "string"
189
+ ? env
190
+ : ((env as Record<string, string>)?.base ??
191
+ environments.UltrasafeaiApiEnvironment.Default.base);
192
+ }),
193
+ headers: this._options.headers,
194
+ timeoutInSeconds: this._options.timeoutInSeconds,
195
+ maxRetries: this._options.maxRetries,
196
+ fetch: this._options.fetch,
197
+ logging: this._options.logging,
198
+ getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers,
199
+ },
200
+ requestOptions,
201
+ );
202
+ }
203
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as UltrasafeaiApi from "../index.js";
6
+
7
+ export class BadRequestError extends errors.UltrasafeaiApiError {
8
+ constructor(body: UltrasafeaiApi.Error_, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "BadRequestError",
11
+ statusCode: 400,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as UltrasafeaiApi from "../index.js";
6
+
7
+ export class PaymentRequiredError extends errors.UltrasafeaiApiError {
8
+ constructor(body: UltrasafeaiApi.UltraparserError, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "PaymentRequiredError",
11
+ statusCode: 402,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as UltrasafeaiApi from "../index.js";
6
+
7
+ export class UnauthorizedError extends errors.UltrasafeaiApiError {
8
+ constructor(body: UltrasafeaiApi.UltraparserError, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "UnauthorizedError",
11
+ statusCode: 401,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./BadRequestError.js";
2
+ export * from "./PaymentRequiredError.js";
3
+ export * from "./UnauthorizedError.js";
package/api/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./errors/index.js";
2
+ export * from "./resources/index.js";
3
+ export * from "./types/index.js";