@ichos/sdk 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 (436) hide show
  1. package/README.md +5 -0
  2. package/dist/BaseClient.d.ts +43 -0
  3. package/dist/BaseClient.js +29 -0
  4. package/dist/Client.d.ts +38 -0
  5. package/dist/Client.js +53 -0
  6. package/dist/api/errors/ForbiddenError.d.ts +6 -0
  7. package/dist/api/errors/ForbiddenError.js +17 -0
  8. package/dist/api/errors/InternalServerError.d.ts +6 -0
  9. package/dist/api/errors/InternalServerError.js +17 -0
  10. package/dist/api/errors/NotFoundError.d.ts +6 -0
  11. package/dist/api/errors/NotFoundError.js +17 -0
  12. package/dist/api/errors/UnauthorizedError.d.ts +6 -0
  13. package/dist/api/errors/UnauthorizedError.js +17 -0
  14. package/dist/api/errors/UnprocessableEntityError.d.ts +6 -0
  15. package/dist/api/errors/UnprocessableEntityError.js +17 -0
  16. package/dist/api/errors/index.d.ts +5 -0
  17. package/dist/api/errors/index.js +5 -0
  18. package/dist/api/index.d.ts +3 -0
  19. package/dist/api/index.js +3 -0
  20. package/dist/api/resources/ads/client/Client.d.ts +226 -0
  21. package/dist/api/resources/ads/client/Client.js +732 -0
  22. package/dist/api/resources/ads/client/index.d.ts +1 -0
  23. package/dist/api/resources/ads/client/index.js +1 -0
  24. package/dist/api/resources/ads/client/requests/AdCreate.d.ts +24 -0
  25. package/dist/api/resources/ads/client/requests/AdCreate.js +8 -0
  26. package/dist/api/resources/ads/client/requests/AdInsertionPointCreate.d.ts +11 -0
  27. package/dist/api/resources/ads/client/requests/AdInsertionPointCreate.js +2 -0
  28. package/dist/api/resources/ads/client/requests/AdUpdate.d.ts +23 -0
  29. package/dist/api/resources/ads/client/requests/AdUpdate.js +8 -0
  30. package/dist/api/resources/ads/client/requests/DeleteAdRequest.d.ts +12 -0
  31. package/dist/api/resources/ads/client/requests/DeleteAdRequest.js +2 -0
  32. package/dist/api/resources/ads/client/requests/LinkAdAudioRequest.d.ts +13 -0
  33. package/dist/api/resources/ads/client/requests/LinkAdAudioRequest.js +2 -0
  34. package/dist/api/resources/ads/client/requests/ListAdInsertionPointsRequest.d.ts +10 -0
  35. package/dist/api/resources/ads/client/requests/ListAdInsertionPointsRequest.js +2 -0
  36. package/dist/api/resources/ads/client/requests/ListVirtualUserAdsRequest.d.ts +8 -0
  37. package/dist/api/resources/ads/client/requests/ListVirtualUserAdsRequest.js +2 -0
  38. package/dist/api/resources/ads/client/requests/UpdateAdWeightRequest.d.ts +9 -0
  39. package/dist/api/resources/ads/client/requests/UpdateAdWeightRequest.js +2 -0
  40. package/dist/api/resources/ads/client/requests/index.d.ts +8 -0
  41. package/dist/api/resources/ads/client/requests/index.js +1 -0
  42. package/dist/api/resources/ads/index.d.ts +1 -0
  43. package/dist/api/resources/ads/index.js +1 -0
  44. package/dist/api/resources/analytics/client/Client.d.ts +28 -0
  45. package/dist/api/resources/analytics/client/Client.js +68 -0
  46. package/dist/api/resources/analytics/client/index.d.ts +1 -0
  47. package/dist/api/resources/analytics/client/index.js +1 -0
  48. package/dist/api/resources/analytics/client/requests/GetAverageMonthlyListenersRequest.d.ts +9 -0
  49. package/dist/api/resources/analytics/client/requests/GetAverageMonthlyListenersRequest.js +2 -0
  50. package/dist/api/resources/analytics/client/requests/index.d.ts +1 -0
  51. package/dist/api/resources/analytics/client/requests/index.js +1 -0
  52. package/dist/api/resources/analytics/index.d.ts +1 -0
  53. package/dist/api/resources/analytics/index.js +1 -0
  54. package/dist/api/resources/audio/client/Client.d.ts +130 -0
  55. package/dist/api/resources/audio/client/Client.js +402 -0
  56. package/dist/api/resources/audio/client/index.d.ts +1 -0
  57. package/dist/api/resources/audio/client/index.js +1 -0
  58. package/dist/api/resources/audio/client/requests/DeleteAudioRequest.d.ts +10 -0
  59. package/dist/api/resources/audio/client/requests/DeleteAudioRequest.js +2 -0
  60. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts +16 -0
  61. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.js +2 -0
  62. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts +10 -0
  63. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.js +2 -0
  64. package/dist/api/resources/audio/client/requests/GetAudioRequest.d.ts +10 -0
  65. package/dist/api/resources/audio/client/requests/GetAudioRequest.js +2 -0
  66. package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts +9 -0
  67. package/dist/api/resources/audio/client/requests/PullAudioDto.js +2 -0
  68. package/dist/api/resources/audio/client/requests/TextToSpeechRequest.d.ts +10 -0
  69. package/dist/api/resources/audio/client/requests/TextToSpeechRequest.js +2 -0
  70. package/dist/api/resources/audio/client/requests/index.d.ts +6 -0
  71. package/dist/api/resources/audio/client/requests/index.js +1 -0
  72. package/dist/api/resources/audio/index.d.ts +1 -0
  73. package/dist/api/resources/audio/index.js +1 -0
  74. package/dist/api/resources/episodes/client/Client.d.ts +234 -0
  75. package/dist/api/resources/episodes/client/Client.js +746 -0
  76. package/dist/api/resources/episodes/client/index.d.ts +1 -0
  77. package/dist/api/resources/episodes/client/index.js +1 -0
  78. package/dist/api/resources/episodes/client/requests/DeleteEpisodeRequest.d.ts +12 -0
  79. package/dist/api/resources/episodes/client/requests/DeleteEpisodeRequest.js +2 -0
  80. package/dist/api/resources/episodes/client/requests/EpisodeCreate.d.ts +45 -0
  81. package/dist/api/resources/episodes/client/requests/EpisodeCreate.js +15 -0
  82. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts +45 -0
  83. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.js +15 -0
  84. package/dist/api/resources/episodes/client/requests/GenerateEpisodeCoverUploadUrlRequest.d.ts +10 -0
  85. package/dist/api/resources/episodes/client/requests/GenerateEpisodeCoverUploadUrlRequest.js +2 -0
  86. package/dist/api/resources/episodes/client/requests/GetEpisodeAudioRequest.d.ts +10 -0
  87. package/dist/api/resources/episodes/client/requests/GetEpisodeAudioRequest.js +2 -0
  88. package/dist/api/resources/episodes/client/requests/GetEpisodeCoverRequest.d.ts +10 -0
  89. package/dist/api/resources/episodes/client/requests/GetEpisodeCoverRequest.js +2 -0
  90. package/dist/api/resources/episodes/client/requests/GetEpisodeListenersReportRequest.d.ts +10 -0
  91. package/dist/api/resources/episodes/client/requests/GetEpisodeListenersReportRequest.js +2 -0
  92. package/dist/api/resources/episodes/client/requests/GetEpisodeRequest.d.ts +10 -0
  93. package/dist/api/resources/episodes/client/requests/GetEpisodeRequest.js +2 -0
  94. package/dist/api/resources/episodes/client/requests/LinkEpisodeAudioRequest.d.ts +13 -0
  95. package/dist/api/resources/episodes/client/requests/LinkEpisodeAudioRequest.js +2 -0
  96. package/dist/api/resources/episodes/client/requests/ListPodcastEpisodesRequest.d.ts +10 -0
  97. package/dist/api/resources/episodes/client/requests/ListPodcastEpisodesRequest.js +2 -0
  98. package/dist/api/resources/episodes/client/requests/PublishEpisodeRequest.d.ts +10 -0
  99. package/dist/api/resources/episodes/client/requests/PublishEpisodeRequest.js +2 -0
  100. package/dist/api/resources/episodes/client/requests/PullEpisodeCoverFromUrlRequest.d.ts +12 -0
  101. package/dist/api/resources/episodes/client/requests/PullEpisodeCoverFromUrlRequest.js +2 -0
  102. package/dist/api/resources/episodes/client/requests/index.d.ts +12 -0
  103. package/dist/api/resources/episodes/client/requests/index.js +1 -0
  104. package/dist/api/resources/episodes/index.d.ts +1 -0
  105. package/dist/api/resources/episodes/index.js +1 -0
  106. package/dist/api/resources/index.d.ts +17 -0
  107. package/dist/api/resources/index.js +17 -0
  108. package/dist/api/resources/organizations/client/Client.d.ts +40 -0
  109. package/dist/api/resources/organizations/client/Client.js +122 -0
  110. package/dist/api/resources/organizations/client/index.d.ts +1 -0
  111. package/dist/api/resources/organizations/client/index.js +1 -0
  112. package/dist/api/resources/organizations/index.d.ts +1 -0
  113. package/dist/api/resources/organizations/index.js +1 -0
  114. package/dist/api/resources/podcasts/client/Client.d.ts +246 -0
  115. package/dist/api/resources/podcasts/client/Client.js +787 -0
  116. package/dist/api/resources/podcasts/client/index.d.ts +1 -0
  117. package/dist/api/resources/podcasts/client/index.js +1 -0
  118. package/dist/api/resources/podcasts/client/requests/DeletePodcastRequest.d.ts +10 -0
  119. package/dist/api/resources/podcasts/client/requests/DeletePodcastRequest.js +2 -0
  120. package/dist/api/resources/podcasts/client/requests/GeneratePodcastCoverUploadUrlRequest.d.ts +10 -0
  121. package/dist/api/resources/podcasts/client/requests/GeneratePodcastCoverUploadUrlRequest.js +2 -0
  122. package/dist/api/resources/podcasts/client/requests/GetPodcastCoverRequest.d.ts +10 -0
  123. package/dist/api/resources/podcasts/client/requests/GetPodcastCoverRequest.js +2 -0
  124. package/dist/api/resources/podcasts/client/requests/GetPodcastListenersReportRequest.d.ts +10 -0
  125. package/dist/api/resources/podcasts/client/requests/GetPodcastListenersReportRequest.js +2 -0
  126. package/dist/api/resources/podcasts/client/requests/GetPodcastRequest.d.ts +10 -0
  127. package/dist/api/resources/podcasts/client/requests/GetPodcastRequest.js +2 -0
  128. package/dist/api/resources/podcasts/client/requests/GetPodcastRssRequest.d.ts +10 -0
  129. package/dist/api/resources/podcasts/client/requests/GetPodcastRssRequest.js +2 -0
  130. package/dist/api/resources/podcasts/client/requests/ImportPodcastFromRssRequest.d.ts +10 -0
  131. package/dist/api/resources/podcasts/client/requests/ImportPodcastFromRssRequest.js +2 -0
  132. package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts +59 -0
  133. package/dist/api/resources/podcasts/client/requests/PodcastCreate.js +9 -0
  134. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts +60 -0
  135. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.js +9 -0
  136. package/dist/api/resources/podcasts/client/requests/PublishPodcastRequest.d.ts +10 -0
  137. package/dist/api/resources/podcasts/client/requests/PublishPodcastRequest.js +2 -0
  138. package/dist/api/resources/podcasts/client/requests/PullPodcastCoverFromUrlRequest.d.ts +12 -0
  139. package/dist/api/resources/podcasts/client/requests/PullPodcastCoverFromUrlRequest.js +2 -0
  140. package/dist/api/resources/podcasts/client/requests/ValidatePodcastRequest.d.ts +10 -0
  141. package/dist/api/resources/podcasts/client/requests/ValidatePodcastRequest.js +2 -0
  142. package/dist/api/resources/podcasts/client/requests/index.d.ts +12 -0
  143. package/dist/api/resources/podcasts/client/requests/index.js +1 -0
  144. package/dist/api/resources/podcasts/index.d.ts +1 -0
  145. package/dist/api/resources/podcasts/index.js +1 -0
  146. package/dist/api/resources/segments/client/Client.d.ts +120 -0
  147. package/dist/api/resources/segments/client/Client.js +374 -0
  148. package/dist/api/resources/segments/client/index.d.ts +1 -0
  149. package/dist/api/resources/segments/client/index.js +1 -0
  150. package/dist/api/resources/segments/client/requests/DeleteSegmentRequest.d.ts +12 -0
  151. package/dist/api/resources/segments/client/requests/DeleteSegmentRequest.js +2 -0
  152. package/dist/api/resources/segments/client/requests/LinkSegmentAudioRequest.d.ts +13 -0
  153. package/dist/api/resources/segments/client/requests/LinkSegmentAudioRequest.js +2 -0
  154. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts +10 -0
  155. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.js +2 -0
  156. package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts +29 -0
  157. package/dist/api/resources/segments/client/requests/SegmentCreate.js +13 -0
  158. package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts +29 -0
  159. package/dist/api/resources/segments/client/requests/SegmentUpdate.js +13 -0
  160. package/dist/api/resources/segments/client/requests/index.d.ts +5 -0
  161. package/dist/api/resources/segments/client/requests/index.js +1 -0
  162. package/dist/api/resources/segments/index.d.ts +1 -0
  163. package/dist/api/resources/segments/index.js +1 -0
  164. package/dist/api/resources/users/client/Client.d.ts +89 -0
  165. package/dist/api/resources/users/client/Client.js +293 -0
  166. package/dist/api/resources/users/client/index.d.ts +1 -0
  167. package/dist/api/resources/users/client/index.js +1 -0
  168. package/dist/api/resources/users/client/requests/UpdateCurrentVirtualUserRequest.d.ts +7 -0
  169. package/dist/api/resources/users/client/requests/UpdateCurrentVirtualUserRequest.js +2 -0
  170. package/dist/api/resources/users/client/requests/index.d.ts +1 -0
  171. package/dist/api/resources/users/client/requests/index.js +1 -0
  172. package/dist/api/resources/users/index.d.ts +1 -0
  173. package/dist/api/resources/users/index.js +1 -0
  174. package/dist/api/resources/webhooks/client/Client.d.ts +76 -0
  175. package/dist/api/resources/webhooks/client/Client.js +236 -0
  176. package/dist/api/resources/webhooks/client/index.d.ts +1 -0
  177. package/dist/api/resources/webhooks/client/index.js +1 -0
  178. package/dist/api/resources/webhooks/client/requests/CreateWebhookDestinationRequest.d.ts +10 -0
  179. package/dist/api/resources/webhooks/client/requests/CreateWebhookDestinationRequest.js +2 -0
  180. package/dist/api/resources/webhooks/client/requests/DeleteWebhookDestinationRequest.d.ts +10 -0
  181. package/dist/api/resources/webhooks/client/requests/DeleteWebhookDestinationRequest.js +2 -0
  182. package/dist/api/resources/webhooks/client/requests/index.d.ts +2 -0
  183. package/dist/api/resources/webhooks/client/requests/index.js +1 -0
  184. package/dist/api/resources/webhooks/index.d.ts +1 -0
  185. package/dist/api/resources/webhooks/index.js +1 -0
  186. package/dist/api/types/Ad.d.ts +16 -0
  187. package/dist/api/types/Ad.js +8 -0
  188. package/dist/api/types/AdId.d.ts +9 -0
  189. package/dist/api/types/AdId.js +7 -0
  190. package/dist/api/types/AdInsertionPoint.d.ts +5 -0
  191. package/dist/api/types/AdInsertionPoint.js +2 -0
  192. package/dist/api/types/AdInsertionPointListResponse.d.ts +6 -0
  193. package/dist/api/types/AdInsertionPointListResponse.js +2 -0
  194. package/dist/api/types/AdInsertionPointResponse.d.ts +6 -0
  195. package/dist/api/types/AdInsertionPointResponse.js +2 -0
  196. package/dist/api/types/AdListResponse.d.ts +6 -0
  197. package/dist/api/types/AdListResponse.js +2 -0
  198. package/dist/api/types/AdResponse.d.ts +6 -0
  199. package/dist/api/types/AdResponse.js +2 -0
  200. package/dist/api/types/AdWeight.d.ts +5 -0
  201. package/dist/api/types/AdWeight.js +2 -0
  202. package/dist/api/types/AdWeightListResponse.d.ts +6 -0
  203. package/dist/api/types/AdWeightListResponse.js +2 -0
  204. package/dist/api/types/ApiMeta.d.ts +3 -0
  205. package/dist/api/types/ApiMeta.js +2 -0
  206. package/dist/api/types/ApiMetaSuccess.d.ts +5 -0
  207. package/dist/api/types/ApiMetaSuccess.js +2 -0
  208. package/dist/api/types/ApplePodcastCategory.d.ts +113 -0
  209. package/dist/api/types/ApplePodcastCategory.js +113 -0
  210. package/dist/api/types/Audio.d.ts +27 -0
  211. package/dist/api/types/Audio.js +12 -0
  212. package/dist/api/types/AudioEntityLink.d.ts +16 -0
  213. package/dist/api/types/AudioEntityLink.js +2 -0
  214. package/dist/api/types/AudioProcessedPayload.d.ts +3 -0
  215. package/dist/api/types/AudioProcessedPayload.js +2 -0
  216. package/dist/api/types/AudioPullResponse.d.ts +12 -0
  217. package/dist/api/types/AudioPullResponse.js +2 -0
  218. package/dist/api/types/AudioPullStatusResponse.d.ts +22 -0
  219. package/dist/api/types/AudioPullStatusResponse.js +15 -0
  220. package/dist/api/types/AudioPulledPayload.d.ts +3 -0
  221. package/dist/api/types/AudioPulledPayload.js +2 -0
  222. package/dist/api/types/AudioResponse.d.ts +6 -0
  223. package/dist/api/types/AudioResponse.js +2 -0
  224. package/dist/api/types/AudioUploadOptions.d.ts +11 -0
  225. package/dist/api/types/AudioUploadOptions.js +2 -0
  226. package/dist/api/types/AudioUploadResponse.d.ts +24 -0
  227. package/dist/api/types/AudioUploadResponse.js +10 -0
  228. package/dist/api/types/AuthenticatedOrganizationResponse.d.ts +6 -0
  229. package/dist/api/types/AuthenticatedOrganizationResponse.js +2 -0
  230. package/dist/api/types/Chapter.d.ts +5 -0
  231. package/dist/api/types/Chapter.js +2 -0
  232. package/dist/api/types/CoverUploadOptions.d.ts +11 -0
  233. package/dist/api/types/CoverUploadOptions.js +2 -0
  234. package/dist/api/types/CoverUploadResponse.d.ts +23 -0
  235. package/dist/api/types/CoverUploadResponse.js +10 -0
  236. package/dist/api/types/Episode.d.ts +42 -0
  237. package/dist/api/types/Episode.js +15 -0
  238. package/dist/api/types/EpisodeCreateResponse.d.ts +6 -0
  239. package/dist/api/types/EpisodeCreateResponse.js +2 -0
  240. package/dist/api/types/EpisodeCreatedResponseData.d.ts +44 -0
  241. package/dist/api/types/EpisodeCreatedResponseData.js +15 -0
  242. package/dist/api/types/EpisodeId.d.ts +9 -0
  243. package/dist/api/types/EpisodeId.js +7 -0
  244. package/dist/api/types/EpisodeResponse.d.ts +6 -0
  245. package/dist/api/types/EpisodeResponse.js +2 -0
  246. package/dist/api/types/EpisodeTranscript.d.ts +6 -0
  247. package/dist/api/types/EpisodeTranscript.js +2 -0
  248. package/dist/api/types/EpisodesResponse.d.ts +6 -0
  249. package/dist/api/types/EpisodesResponse.js +2 -0
  250. package/dist/api/types/InternalServerErrorBody.d.ts +8 -0
  251. package/dist/api/types/InternalServerErrorBody.js +2 -0
  252. package/dist/api/types/InternalServerErrorResponse.d.ts +6 -0
  253. package/dist/api/types/InternalServerErrorResponse.js +2 -0
  254. package/dist/api/types/ListWebhookDestinationsResponse.d.ts +6 -0
  255. package/dist/api/types/ListWebhookDestinationsResponse.js +2 -0
  256. package/dist/api/types/ListWebhookEventsResponse.d.ts +6 -0
  257. package/dist/api/types/ListWebhookEventsResponse.js +2 -0
  258. package/dist/api/types/Listeners.d.ts +4 -0
  259. package/dist/api/types/Listeners.js +2 -0
  260. package/dist/api/types/ListenersReport.d.ts +5 -0
  261. package/dist/api/types/ListenersReport.js +2 -0
  262. package/dist/api/types/ListenersReportResponse.d.ts +6 -0
  263. package/dist/api/types/ListenersReportResponse.js +2 -0
  264. package/dist/api/types/MonthlyListenersResponse.d.ts +6 -0
  265. package/dist/api/types/MonthlyListenersResponse.js +2 -0
  266. package/dist/api/types/NotFoundErrorBody.d.ts +8 -0
  267. package/dist/api/types/NotFoundErrorBody.js +2 -0
  268. package/dist/api/types/NotFoundErrorResponse.d.ts +6 -0
  269. package/dist/api/types/NotFoundErrorResponse.js +2 -0
  270. package/dist/api/types/NullResponse.d.ts +6 -0
  271. package/dist/api/types/NullResponse.js +2 -0
  272. package/dist/api/types/Organization.d.ts +19 -0
  273. package/dist/api/types/Organization.js +12 -0
  274. package/dist/api/types/Person.d.ts +7 -0
  275. package/dist/api/types/Person.js +2 -0
  276. package/dist/api/types/Podcast.d.ts +65 -0
  277. package/dist/api/types/Podcast.js +15 -0
  278. package/dist/api/types/PodcastImportCompletedPayload.d.ts +3 -0
  279. package/dist/api/types/PodcastImportCompletedPayload.js +2 -0
  280. package/dist/api/types/PodcastImportFailedPayload.d.ts +5 -0
  281. package/dist/api/types/PodcastImportFailedPayload.js +2 -0
  282. package/dist/api/types/PodcastResponse.d.ts +6 -0
  283. package/dist/api/types/PodcastResponse.js +2 -0
  284. package/dist/api/types/PodcastsResponse.d.ts +6 -0
  285. package/dist/api/types/PodcastsResponse.js +2 -0
  286. package/dist/api/types/PublishPodcastOutput.d.ts +3 -0
  287. package/dist/api/types/PublishPodcastOutput.js +2 -0
  288. package/dist/api/types/RetrieveCoverResponse.d.ts +11 -0
  289. package/dist/api/types/RetrieveCoverResponse.js +2 -0
  290. package/dist/api/types/Segment.d.ts +25 -0
  291. package/dist/api/types/Segment.js +13 -0
  292. package/dist/api/types/SegmentId.d.ts +9 -0
  293. package/dist/api/types/SegmentId.js +7 -0
  294. package/dist/api/types/SegmentListResponse.d.ts +6 -0
  295. package/dist/api/types/SegmentListResponse.js +2 -0
  296. package/dist/api/types/SegmentResponse.d.ts +6 -0
  297. package/dist/api/types/SegmentResponse.js +2 -0
  298. package/dist/api/types/StringOrNullResponse.d.ts +6 -0
  299. package/dist/api/types/StringOrNullResponse.js +2 -0
  300. package/dist/api/types/StringResponse.d.ts +6 -0
  301. package/dist/api/types/StringResponse.js +2 -0
  302. package/dist/api/types/TranscriptCompletedPayload.d.ts +4 -0
  303. package/dist/api/types/TranscriptCompletedPayload.js +2 -0
  304. package/dist/api/types/UnauthenticatedError.d.ts +8 -0
  305. package/dist/api/types/UnauthenticatedError.js +2 -0
  306. package/dist/api/types/UnauthenticatedErrorResponse.d.ts +6 -0
  307. package/dist/api/types/UnauthenticatedErrorResponse.js +2 -0
  308. package/dist/api/types/UnauthorizedErrorBody.d.ts +8 -0
  309. package/dist/api/types/UnauthorizedErrorBody.js +2 -0
  310. package/dist/api/types/UnauthorizedErrorResponse.d.ts +6 -0
  311. package/dist/api/types/UnauthorizedErrorResponse.js +2 -0
  312. package/dist/api/types/UserUploadAudioResponse.d.ts +6 -0
  313. package/dist/api/types/UserUploadAudioResponse.js +2 -0
  314. package/dist/api/types/UserUploadAudioResult.d.ts +5 -0
  315. package/dist/api/types/UserUploadAudioResult.js +2 -0
  316. package/dist/api/types/UserUploadCoverResponse.d.ts +6 -0
  317. package/dist/api/types/UserUploadCoverResponse.js +2 -0
  318. package/dist/api/types/UserUploadCoverResult.d.ts +5 -0
  319. package/dist/api/types/UserUploadCoverResult.js +2 -0
  320. package/dist/api/types/UserUploadCoverResultResponse.d.ts +6 -0
  321. package/dist/api/types/UserUploadCoverResultResponse.js +2 -0
  322. package/dist/api/types/ValidationErrorResponse.d.ts +6 -0
  323. package/dist/api/types/ValidationErrorResponse.js +2 -0
  324. package/dist/api/types/ValidationIssue.d.ts +17 -0
  325. package/dist/api/types/ValidationIssue.js +11 -0
  326. package/dist/api/types/VirtualUser.d.ts +10 -0
  327. package/dist/api/types/VirtualUser.js +2 -0
  328. package/dist/api/types/VirtualUserListResponse.d.ts +6 -0
  329. package/dist/api/types/VirtualUserListResponse.js +2 -0
  330. package/dist/api/types/VirtualUserResponse.d.ts +6 -0
  331. package/dist/api/types/VirtualUserResponse.js +2 -0
  332. package/dist/api/types/WebhookDestination.d.ts +7 -0
  333. package/dist/api/types/WebhookDestination.js +2 -0
  334. package/dist/api/types/WebhookDestinationResponse.d.ts +6 -0
  335. package/dist/api/types/WebhookDestinationResponse.js +2 -0
  336. package/dist/api/types/WebhookEvent.d.ts +28 -0
  337. package/dist/api/types/WebhookEvent.js +16 -0
  338. package/dist/api/types/index.d.ts +76 -0
  339. package/dist/api/types/index.js +76 -0
  340. package/dist/auth/BearerAuthProvider.d.ts +16 -0
  341. package/dist/auth/BearerAuthProvider.js +23 -0
  342. package/dist/auth/index.d.ts +1 -0
  343. package/dist/auth/index.js +1 -0
  344. package/dist/core/auth/AuthProvider.d.ts +7 -0
  345. package/dist/core/auth/AuthProvider.js +1 -0
  346. package/dist/core/auth/AuthRequest.d.ts +9 -0
  347. package/dist/core/auth/AuthRequest.js +1 -0
  348. package/dist/core/auth/BasicAuth.d.ts +8 -0
  349. package/dist/core/auth/BasicAuth.js +24 -0
  350. package/dist/core/auth/BearerToken.d.ts +7 -0
  351. package/dist/core/auth/BearerToken.js +13 -0
  352. package/dist/core/auth/NoOpAuthProvider.d.ts +5 -0
  353. package/dist/core/auth/NoOpAuthProvider.js +5 -0
  354. package/dist/core/auth/index.d.ts +5 -0
  355. package/dist/core/auth/index.js +3 -0
  356. package/dist/core/base64.d.ts +2 -0
  357. package/dist/core/base64.js +22 -0
  358. package/dist/core/exports.d.ts +1 -0
  359. package/dist/core/exports.js +1 -0
  360. package/dist/core/fetcher/APIResponse.d.ts +20 -0
  361. package/dist/core/fetcher/APIResponse.js +1 -0
  362. package/dist/core/fetcher/BinaryResponse.d.ts +19 -0
  363. package/dist/core/fetcher/BinaryResponse.js +14 -0
  364. package/dist/core/fetcher/EndpointMetadata.d.ts +13 -0
  365. package/dist/core/fetcher/EndpointMetadata.js +1 -0
  366. package/dist/core/fetcher/EndpointSupplier.d.ts +12 -0
  367. package/dist/core/fetcher/EndpointSupplier.js +10 -0
  368. package/dist/core/fetcher/Fetcher.d.ts +49 -0
  369. package/dist/core/fetcher/Fetcher.js +295 -0
  370. package/dist/core/fetcher/Headers.d.ts +2 -0
  371. package/dist/core/fetcher/Headers.js +83 -0
  372. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  373. package/dist/core/fetcher/HttpResponsePromise.js +90 -0
  374. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  375. package/dist/core/fetcher/RawResponse.js +40 -0
  376. package/dist/core/fetcher/Supplier.d.ts +4 -0
  377. package/dist/core/fetcher/Supplier.js +10 -0
  378. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  379. package/dist/core/fetcher/createRequestUrl.js +5 -0
  380. package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
  381. package/dist/core/fetcher/getErrorResponseBody.js +30 -0
  382. package/dist/core/fetcher/getFetchFn.d.ts +1 -0
  383. package/dist/core/fetcher/getFetchFn.js +3 -0
  384. package/dist/core/fetcher/getHeader.d.ts +1 -0
  385. package/dist/core/fetcher/getHeader.js +8 -0
  386. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  387. package/dist/core/fetcher/getRequestBody.js +13 -0
  388. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  389. package/dist/core/fetcher/getResponseBody.js +55 -0
  390. package/dist/core/fetcher/index.d.ts +11 -0
  391. package/dist/core/fetcher/index.js +6 -0
  392. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  393. package/dist/core/fetcher/makeRequest.js +27 -0
  394. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  395. package/dist/core/fetcher/requestWithRetries.js +53 -0
  396. package/dist/core/fetcher/signals.d.ts +5 -0
  397. package/dist/core/fetcher/signals.js +20 -0
  398. package/dist/core/headers.d.ts +2 -0
  399. package/dist/core/headers.js +27 -0
  400. package/dist/core/index.d.ts +6 -0
  401. package/dist/core/index.js +6 -0
  402. package/dist/core/json.d.ts +15 -0
  403. package/dist/core/json.js +19 -0
  404. package/dist/core/logging/exports.d.ts +18 -0
  405. package/dist/core/logging/exports.js +9 -0
  406. package/dist/core/logging/index.d.ts +1 -0
  407. package/dist/core/logging/index.js +1 -0
  408. package/dist/core/logging/logger.d.ts +126 -0
  409. package/dist/core/logging/logger.js +140 -0
  410. package/dist/core/runtime/index.d.ts +1 -0
  411. package/dist/core/runtime/index.js +1 -0
  412. package/dist/core/runtime/runtime.d.ts +9 -0
  413. package/dist/core/runtime/runtime.js +99 -0
  414. package/dist/core/url/encodePathParam.d.ts +1 -0
  415. package/dist/core/url/encodePathParam.js +18 -0
  416. package/dist/core/url/index.d.ts +3 -0
  417. package/dist/core/url/index.js +3 -0
  418. package/dist/core/url/join.d.ts +1 -0
  419. package/dist/core/url/join.js +65 -0
  420. package/dist/core/url/qs.d.ts +6 -0
  421. package/dist/core/url/qs.js +64 -0
  422. package/dist/environments.d.ts +4 -0
  423. package/dist/environments.js +4 -0
  424. package/dist/errors/IchosError.d.ts +12 -0
  425. package/dist/errors/IchosError.js +31 -0
  426. package/dist/errors/IchosTimeoutError.d.ts +3 -0
  427. package/dist/errors/IchosTimeoutError.js +11 -0
  428. package/dist/errors/handleNonStatusCodeError.d.ts +2 -0
  429. package/dist/errors/handleNonStatusCodeError.js +29 -0
  430. package/dist/errors/index.d.ts +2 -0
  431. package/dist/errors/index.js +2 -0
  432. package/dist/exports.d.ts +1 -0
  433. package/dist/exports.js +1 -0
  434. package/dist/index.d.ts +6 -0
  435. package/dist/index.js +5 -0
  436. package/package.json +23 -0
@@ -0,0 +1,126 @@
1
+ export declare const LogLevel: {
2
+ readonly Debug: "debug";
3
+ readonly Info: "info";
4
+ readonly Warn: "warn";
5
+ readonly Error: "error";
6
+ };
7
+ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
8
+ export interface ILogger {
9
+ /**
10
+ * Logs a debug message.
11
+ * @param message - The message to log
12
+ * @param args - Additional arguments to log
13
+ */
14
+ debug(message: string, ...args: unknown[]): void;
15
+ /**
16
+ * Logs an info message.
17
+ * @param message - The message to log
18
+ * @param args - Additional arguments to log
19
+ */
20
+ info(message: string, ...args: unknown[]): void;
21
+ /**
22
+ * Logs a warning message.
23
+ * @param message - The message to log
24
+ * @param args - Additional arguments to log
25
+ */
26
+ warn(message: string, ...args: unknown[]): void;
27
+ /**
28
+ * Logs an error message.
29
+ * @param message - The message to log
30
+ * @param args - Additional arguments to log
31
+ */
32
+ error(message: string, ...args: unknown[]): void;
33
+ }
34
+ /**
35
+ * Configuration for logger initialization.
36
+ */
37
+ export interface LogConfig {
38
+ /**
39
+ * Minimum log level to output.
40
+ * @default LogLevel.Info
41
+ */
42
+ level?: LogLevel;
43
+ /**
44
+ * Logger implementation to use.
45
+ * @default new ConsoleLogger()
46
+ */
47
+ logger?: ILogger;
48
+ /**
49
+ * Whether logging should be silenced.
50
+ * @default true
51
+ */
52
+ silent?: boolean;
53
+ }
54
+ /**
55
+ * Default console-based logger implementation.
56
+ */
57
+ export declare class ConsoleLogger implements ILogger {
58
+ debug(message: string, ...args: unknown[]): void;
59
+ info(message: string, ...args: unknown[]): void;
60
+ warn(message: string, ...args: unknown[]): void;
61
+ error(message: string, ...args: unknown[]): void;
62
+ }
63
+ /**
64
+ * Logger class that provides level-based logging functionality.
65
+ */
66
+ export declare class Logger {
67
+ private readonly level;
68
+ private readonly logger;
69
+ private readonly silent;
70
+ /**
71
+ * Creates a new logger instance.
72
+ * @param config - Logger configuration
73
+ */
74
+ constructor(config: Required<LogConfig>);
75
+ /**
76
+ * Checks if a log level should be output based on configuration.
77
+ * @param level - The log level to check
78
+ * @returns True if the level should be logged
79
+ */
80
+ shouldLog(level: LogLevel): boolean;
81
+ /**
82
+ * Checks if debug logging is enabled.
83
+ * @returns True if debug logs should be output
84
+ */
85
+ isDebug(): boolean;
86
+ /**
87
+ * Logs a debug message if debug logging is enabled.
88
+ * @param message - The message to log
89
+ * @param args - Additional arguments to log
90
+ */
91
+ debug(message: string, ...args: unknown[]): void;
92
+ /**
93
+ * Checks if info logging is enabled.
94
+ * @returns True if info logs should be output
95
+ */
96
+ isInfo(): boolean;
97
+ /**
98
+ * Logs an info message if info logging is enabled.
99
+ * @param message - The message to log
100
+ * @param args - Additional arguments to log
101
+ */
102
+ info(message: string, ...args: unknown[]): void;
103
+ /**
104
+ * Checks if warning logging is enabled.
105
+ * @returns True if warning logs should be output
106
+ */
107
+ isWarn(): boolean;
108
+ /**
109
+ * Logs a warning message if warning logging is enabled.
110
+ * @param message - The message to log
111
+ * @param args - Additional arguments to log
112
+ */
113
+ warn(message: string, ...args: unknown[]): void;
114
+ /**
115
+ * Checks if error logging is enabled.
116
+ * @returns True if error logs should be output
117
+ */
118
+ isError(): boolean;
119
+ /**
120
+ * Logs an error message if error logging is enabled.
121
+ * @param message - The message to log
122
+ * @param args - Additional arguments to log
123
+ */
124
+ error(message: string, ...args: unknown[]): void;
125
+ }
126
+ export declare function createLogger(config?: LogConfig | Logger): Logger;
@@ -0,0 +1,140 @@
1
+ export const LogLevel = {
2
+ Debug: "debug",
3
+ Info: "info",
4
+ Warn: "warn",
5
+ Error: "error",
6
+ };
7
+ const logLevelMap = {
8
+ [LogLevel.Debug]: 1,
9
+ [LogLevel.Info]: 2,
10
+ [LogLevel.Warn]: 3,
11
+ [LogLevel.Error]: 4,
12
+ };
13
+ /**
14
+ * Default console-based logger implementation.
15
+ */
16
+ export class ConsoleLogger {
17
+ debug(message, ...args) {
18
+ console.debug(message, ...args);
19
+ }
20
+ info(message, ...args) {
21
+ console.info(message, ...args);
22
+ }
23
+ warn(message, ...args) {
24
+ console.warn(message, ...args);
25
+ }
26
+ error(message, ...args) {
27
+ console.error(message, ...args);
28
+ }
29
+ }
30
+ /**
31
+ * Logger class that provides level-based logging functionality.
32
+ */
33
+ export class Logger {
34
+ level;
35
+ logger;
36
+ silent;
37
+ /**
38
+ * Creates a new logger instance.
39
+ * @param config - Logger configuration
40
+ */
41
+ constructor(config) {
42
+ this.level = logLevelMap[config.level];
43
+ this.logger = config.logger;
44
+ this.silent = config.silent;
45
+ }
46
+ /**
47
+ * Checks if a log level should be output based on configuration.
48
+ * @param level - The log level to check
49
+ * @returns True if the level should be logged
50
+ */
51
+ shouldLog(level) {
52
+ return !this.silent && this.level <= logLevelMap[level];
53
+ }
54
+ /**
55
+ * Checks if debug logging is enabled.
56
+ * @returns True if debug logs should be output
57
+ */
58
+ isDebug() {
59
+ return this.shouldLog(LogLevel.Debug);
60
+ }
61
+ /**
62
+ * Logs a debug message if debug logging is enabled.
63
+ * @param message - The message to log
64
+ * @param args - Additional arguments to log
65
+ */
66
+ debug(message, ...args) {
67
+ if (this.isDebug()) {
68
+ this.logger.debug(message, ...args);
69
+ }
70
+ }
71
+ /**
72
+ * Checks if info logging is enabled.
73
+ * @returns True if info logs should be output
74
+ */
75
+ isInfo() {
76
+ return this.shouldLog(LogLevel.Info);
77
+ }
78
+ /**
79
+ * Logs an info message if info logging is enabled.
80
+ * @param message - The message to log
81
+ * @param args - Additional arguments to log
82
+ */
83
+ info(message, ...args) {
84
+ if (this.isInfo()) {
85
+ this.logger.info(message, ...args);
86
+ }
87
+ }
88
+ /**
89
+ * Checks if warning logging is enabled.
90
+ * @returns True if warning logs should be output
91
+ */
92
+ isWarn() {
93
+ return this.shouldLog(LogLevel.Warn);
94
+ }
95
+ /**
96
+ * Logs a warning message if warning logging is enabled.
97
+ * @param message - The message to log
98
+ * @param args - Additional arguments to log
99
+ */
100
+ warn(message, ...args) {
101
+ if (this.isWarn()) {
102
+ this.logger.warn(message, ...args);
103
+ }
104
+ }
105
+ /**
106
+ * Checks if error logging is enabled.
107
+ * @returns True if error logs should be output
108
+ */
109
+ isError() {
110
+ return this.shouldLog(LogLevel.Error);
111
+ }
112
+ /**
113
+ * Logs an error message if error logging is enabled.
114
+ * @param message - The message to log
115
+ * @param args - Additional arguments to log
116
+ */
117
+ error(message, ...args) {
118
+ if (this.isError()) {
119
+ this.logger.error(message, ...args);
120
+ }
121
+ }
122
+ }
123
+ export function createLogger(config) {
124
+ if (config == null) {
125
+ return defaultLogger;
126
+ }
127
+ if (config instanceof Logger) {
128
+ return config;
129
+ }
130
+ config = config ?? {};
131
+ config.level ??= LogLevel.Info;
132
+ config.logger ??= new ConsoleLogger();
133
+ config.silent ??= true;
134
+ return new Logger(config);
135
+ }
136
+ const defaultLogger = new Logger({
137
+ level: LogLevel.Info,
138
+ logger: new ConsoleLogger(),
139
+ silent: true,
140
+ });
@@ -0,0 +1 @@
1
+ export { RUNTIME } from "./runtime.js";
@@ -0,0 +1 @@
1
+ export { RUNTIME } from "./runtime.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A constant that indicates which environment and version the SDK is running in.
3
+ */
4
+ export declare const RUNTIME: Runtime;
5
+ export interface Runtime {
6
+ type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
7
+ version?: string;
8
+ parsedVersion?: number;
9
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * A constant that indicates which environment and version the SDK is running in.
3
+ */
4
+ export const RUNTIME = evaluateRuntime();
5
+ function evaluateRuntime() {
6
+ /**
7
+ * A constant that indicates whether the environment the code is running is a Web Browser.
8
+ */
9
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
10
+ if (isBrowser) {
11
+ return {
12
+ type: "browser",
13
+ version: window.navigator.userAgent,
14
+ };
15
+ }
16
+ /**
17
+ * A constant that indicates whether the environment the code is running is Cloudflare.
18
+ * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
19
+ */
20
+ const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers";
21
+ if (isCloudflare) {
22
+ return {
23
+ type: "workerd",
24
+ };
25
+ }
26
+ /**
27
+ * A constant that indicates whether the environment the code is running is Edge Runtime.
28
+ * https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
29
+ */
30
+ const isEdgeRuntime = typeof EdgeRuntime === "string";
31
+ if (isEdgeRuntime) {
32
+ return {
33
+ type: "edge-runtime",
34
+ };
35
+ }
36
+ /**
37
+ * A constant that indicates whether the environment the code is running is a Web Worker.
38
+ */
39
+ const isWebWorker = typeof self === "object" &&
40
+ typeof self?.importScripts === "function" &&
41
+ (self.constructor?.name === "DedicatedWorkerGlobalScope" ||
42
+ self.constructor?.name === "ServiceWorkerGlobalScope" ||
43
+ self.constructor?.name === "SharedWorkerGlobalScope");
44
+ if (isWebWorker) {
45
+ return {
46
+ type: "web-worker",
47
+ };
48
+ }
49
+ /**
50
+ * A constant that indicates whether the environment the code is running is Deno.
51
+ * FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
52
+ */
53
+ const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
54
+ if (isDeno) {
55
+ return {
56
+ type: "deno",
57
+ version: Deno.version.deno,
58
+ };
59
+ }
60
+ /**
61
+ * A constant that indicates whether the environment the code is running is Bun.sh.
62
+ */
63
+ const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
64
+ if (isBun) {
65
+ return {
66
+ type: "bun",
67
+ version: Bun.version,
68
+ };
69
+ }
70
+ /**
71
+ * A constant that indicates whether the environment the code is running is in React-Native.
72
+ * This check should come before Node.js detection since React Native may have a process polyfill.
73
+ * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
74
+ */
75
+ const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative";
76
+ if (isReactNative) {
77
+ return {
78
+ type: "react-native",
79
+ };
80
+ }
81
+ /**
82
+ * A constant that indicates whether the environment the code is running is Node.JS.
83
+ */
84
+ const isNode = typeof process !== "undefined" &&
85
+ "version" in process &&
86
+ !!process.version &&
87
+ "versions" in process &&
88
+ !!process.versions?.node;
89
+ if (isNode) {
90
+ return {
91
+ type: "node",
92
+ version: process.versions.node,
93
+ parsedVersion: Number(process.versions.node.split(".")[0]),
94
+ };
95
+ }
96
+ return {
97
+ type: "unknown",
98
+ };
99
+ }
@@ -0,0 +1 @@
1
+ export declare function encodePathParam(param: unknown): string;
@@ -0,0 +1,18 @@
1
+ export function encodePathParam(param) {
2
+ if (param === null) {
3
+ return "null";
4
+ }
5
+ const typeofParam = typeof param;
6
+ switch (typeofParam) {
7
+ case "undefined":
8
+ return "undefined";
9
+ case "string":
10
+ case "number":
11
+ case "boolean":
12
+ break;
13
+ default:
14
+ param = String(param);
15
+ break;
16
+ }
17
+ return encodeURIComponent(param);
18
+ }
@@ -0,0 +1,3 @@
1
+ export { encodePathParam } from "./encodePathParam.js";
2
+ export { join } from "./join.js";
3
+ export { toQueryString } from "./qs.js";
@@ -0,0 +1,3 @@
1
+ export { encodePathParam } from "./encodePathParam.js";
2
+ export { join } from "./join.js";
3
+ export { toQueryString } from "./qs.js";
@@ -0,0 +1 @@
1
+ export declare function join(base: string, ...segments: string[]): string;
@@ -0,0 +1,65 @@
1
+ export function join(base, ...segments) {
2
+ if (!base) {
3
+ return "";
4
+ }
5
+ if (segments.length === 0) {
6
+ return base;
7
+ }
8
+ if (base.includes("://")) {
9
+ let url;
10
+ try {
11
+ url = new URL(base);
12
+ }
13
+ catch {
14
+ return joinPath(base, ...segments);
15
+ }
16
+ const lastSegment = segments[segments.length - 1];
17
+ const shouldPreserveTrailingSlash = lastSegment?.endsWith("/");
18
+ for (const segment of segments) {
19
+ const cleanSegment = trimSlashes(segment);
20
+ if (cleanSegment) {
21
+ url.pathname = joinPathSegments(url.pathname, cleanSegment);
22
+ }
23
+ }
24
+ if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
25
+ url.pathname += "/";
26
+ }
27
+ return url.toString();
28
+ }
29
+ return joinPath(base, ...segments);
30
+ }
31
+ function joinPath(base, ...segments) {
32
+ if (segments.length === 0) {
33
+ return base;
34
+ }
35
+ let result = base;
36
+ const lastSegment = segments[segments.length - 1];
37
+ const shouldPreserveTrailingSlash = lastSegment?.endsWith("/");
38
+ for (const segment of segments) {
39
+ const cleanSegment = trimSlashes(segment);
40
+ if (cleanSegment) {
41
+ result = joinPathSegments(result, cleanSegment);
42
+ }
43
+ }
44
+ if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
45
+ result += "/";
46
+ }
47
+ return result;
48
+ }
49
+ function joinPathSegments(left, right) {
50
+ if (left.endsWith("/")) {
51
+ return left + right;
52
+ }
53
+ return `${left}/${right}`;
54
+ }
55
+ function trimSlashes(str) {
56
+ if (!str)
57
+ return str;
58
+ let start = 0;
59
+ let end = str.length;
60
+ if (str.startsWith("/"))
61
+ start = 1;
62
+ if (str.endsWith("/"))
63
+ end = str.length - 1;
64
+ return start === 0 && end === str.length ? str : str.slice(start, end);
65
+ }
@@ -0,0 +1,6 @@
1
+ interface QueryStringOptions {
2
+ arrayFormat?: "indices" | "repeat";
3
+ encode?: boolean;
4
+ }
5
+ export declare function toQueryString(obj: unknown, options?: QueryStringOptions): string;
6
+ export {};
@@ -0,0 +1,64 @@
1
+ const defaultQsOptions = {
2
+ arrayFormat: "indices",
3
+ encode: true,
4
+ };
5
+ function encodeValue(value, shouldEncode) {
6
+ if (value === undefined) {
7
+ return "";
8
+ }
9
+ if (value === null) {
10
+ return "";
11
+ }
12
+ const stringValue = String(value);
13
+ return shouldEncode ? encodeURIComponent(stringValue) : stringValue;
14
+ }
15
+ function stringifyObject(obj, prefix = "", options) {
16
+ const parts = [];
17
+ for (const [key, value] of Object.entries(obj)) {
18
+ const fullKey = prefix ? `${prefix}[${key}]` : key;
19
+ if (value === undefined) {
20
+ continue;
21
+ }
22
+ if (Array.isArray(value)) {
23
+ if (value.length === 0) {
24
+ continue;
25
+ }
26
+ for (let i = 0; i < value.length; i++) {
27
+ const item = value[i];
28
+ if (item === undefined) {
29
+ continue;
30
+ }
31
+ if (typeof item === "object" && !Array.isArray(item) && item !== null) {
32
+ const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
33
+ parts.push(...stringifyObject(item, arrayKey, options));
34
+ }
35
+ else {
36
+ const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
37
+ const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
38
+ parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
39
+ }
40
+ }
41
+ }
42
+ else if (typeof value === "object" && value !== null) {
43
+ if (Object.keys(value).length === 0) {
44
+ continue;
45
+ }
46
+ parts.push(...stringifyObject(value, fullKey, options));
47
+ }
48
+ else {
49
+ const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
50
+ parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`);
51
+ }
52
+ }
53
+ return parts;
54
+ }
55
+ export function toQueryString(obj, options) {
56
+ if (obj == null || typeof obj !== "object") {
57
+ return "";
58
+ }
59
+ const parts = stringifyObject(obj, "", {
60
+ ...defaultQsOptions,
61
+ ...options,
62
+ });
63
+ return parts.join("&");
64
+ }
@@ -0,0 +1,4 @@
1
+ export declare const IchosEnvironment: {
2
+ readonly Default: "";
3
+ };
4
+ export type IchosEnvironment = typeof IchosEnvironment.Default;
@@ -0,0 +1,4 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const IchosEnvironment = {
3
+ Default: "",
4
+ };
@@ -0,0 +1,12 @@
1
+ import type * as core from "../core/index.js";
2
+ export declare class IchosError extends Error {
3
+ readonly statusCode?: number;
4
+ readonly body?: unknown;
5
+ readonly rawResponse?: core.RawResponse;
6
+ constructor({ message, statusCode, body, rawResponse, }: {
7
+ message?: string;
8
+ statusCode?: number;
9
+ body?: unknown;
10
+ rawResponse?: core.RawResponse;
11
+ });
12
+ }
@@ -0,0 +1,31 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import { toJson } from "../core/json.js";
3
+ export class IchosError extends Error {
4
+ statusCode;
5
+ body;
6
+ rawResponse;
7
+ constructor({ message, statusCode, body, rawResponse, }) {
8
+ super(buildMessage({ message, statusCode, body }));
9
+ Object.setPrototypeOf(this, new.target.prototype);
10
+ if (Error.captureStackTrace) {
11
+ Error.captureStackTrace(this, this.constructor);
12
+ }
13
+ this.name = this.constructor.name;
14
+ this.statusCode = statusCode;
15
+ this.body = body;
16
+ this.rawResponse = rawResponse;
17
+ }
18
+ }
19
+ function buildMessage({ message, statusCode, body, }) {
20
+ const lines = [];
21
+ if (message != null) {
22
+ lines.push(message);
23
+ }
24
+ if (statusCode != null) {
25
+ lines.push(`Status code: ${statusCode.toString()}`);
26
+ }
27
+ if (body != null) {
28
+ lines.push(`Body: ${toJson(body, undefined, 2)}`);
29
+ }
30
+ return lines.join("\n");
31
+ }
@@ -0,0 +1,3 @@
1
+ export declare class IchosTimeoutError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -0,0 +1,11 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export class IchosTimeoutError extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ Object.setPrototypeOf(this, new.target.prototype);
6
+ if (Error.captureStackTrace) {
7
+ Error.captureStackTrace(this, this.constructor);
8
+ }
9
+ this.name = this.constructor.name;
10
+ }
11
+ }
@@ -0,0 +1,2 @@
1
+ import type * as core from "../core/index.js";
2
+ export declare function handleNonStatusCodeError(error: core.Fetcher.Error, rawResponse: core.RawResponse, method: string, path: string): never;
@@ -0,0 +1,29 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "./index.js";
3
+ export function handleNonStatusCodeError(error, rawResponse, method, path) {
4
+ switch (error.reason) {
5
+ case "non-json":
6
+ throw new errors.IchosError({
7
+ statusCode: error.statusCode,
8
+ body: error.rawBody,
9
+ rawResponse: rawResponse,
10
+ });
11
+ case "body-is-null":
12
+ throw new errors.IchosError({
13
+ statusCode: error.statusCode,
14
+ rawResponse: rawResponse,
15
+ });
16
+ case "timeout":
17
+ throw new errors.IchosTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
18
+ case "unknown":
19
+ throw new errors.IchosError({
20
+ message: error.errorMessage,
21
+ rawResponse: rawResponse,
22
+ });
23
+ default:
24
+ throw new errors.IchosError({
25
+ message: "Unknown error",
26
+ rawResponse: rawResponse,
27
+ });
28
+ }
29
+ }
@@ -0,0 +1,2 @@
1
+ export { IchosError } from "./IchosError.js";
2
+ export { IchosTimeoutError } from "./IchosTimeoutError.js";
@@ -0,0 +1,2 @@
1
+ export { IchosError } from "./IchosError.js";
2
+ export { IchosTimeoutError } from "./IchosTimeoutError.js";
@@ -0,0 +1 @@
1
+ export * from "./core/exports.js";
@@ -0,0 +1 @@
1
+ export * from "./core/exports.js";