@ichos/sdk 1.0.10 → 1.0.12

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 (190) hide show
  1. package/dist/Client.d.ts +2 -2
  2. package/dist/Client.d.ts.map +1 -1
  3. package/dist/Client.js +4 -4
  4. package/dist/Client.js.map +1 -1
  5. package/dist/api/errors/BadRequestError.d.ts +7 -0
  6. package/dist/api/errors/BadRequestError.d.ts.map +1 -0
  7. package/dist/api/errors/BadRequestError.js +18 -0
  8. package/dist/api/errors/BadRequestError.js.map +1 -0
  9. package/dist/api/errors/index.d.ts +1 -0
  10. package/dist/api/errors/index.d.ts.map +1 -1
  11. package/dist/api/errors/index.js +1 -0
  12. package/dist/api/errors/index.js.map +1 -1
  13. package/dist/api/resources/audio/client/Client.d.ts +5 -41
  14. package/dist/api/resources/audio/client/Client.d.ts.map +1 -1
  15. package/dist/api/resources/audio/client/Client.js +16 -127
  16. package/dist/api/resources/audio/client/Client.js.map +1 -1
  17. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts +10 -0
  18. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts.map +1 -0
  19. package/dist/api/resources/{segments/client/requests/ListPodcastSegmentsRequest.js → audio/client/requests/GenerateAudioUploadUrlRequest.js} +1 -1
  20. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.js.map +1 -0
  21. package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts +2 -0
  22. package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts.map +1 -1
  23. package/dist/api/resources/audio/client/requests/index.d.ts +1 -2
  24. package/dist/api/resources/audio/client/requests/index.d.ts.map +1 -1
  25. package/dist/api/resources/audio/index.d.ts +1 -0
  26. package/dist/api/resources/audio/index.d.ts.map +1 -1
  27. package/dist/api/resources/audio/index.js +1 -0
  28. package/dist/api/resources/audio/index.js.map +1 -1
  29. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts +7 -0
  30. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts.map +1 -0
  31. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js +7 -0
  32. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js.map +1 -0
  33. package/dist/api/resources/audio/types/index.d.ts +2 -0
  34. package/dist/api/resources/audio/types/index.d.ts.map +1 -0
  35. package/dist/api/resources/audio/types/index.js +2 -0
  36. package/dist/api/resources/audio/types/index.js.map +1 -0
  37. package/dist/api/resources/episodes/client/Client.d.ts +4 -1
  38. package/dist/api/resources/episodes/client/Client.d.ts.map +1 -1
  39. package/dist/api/resources/episodes/client/Client.js +4 -1
  40. package/dist/api/resources/episodes/client/Client.js.map +1 -1
  41. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts +1 -1
  42. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts.map +1 -1
  43. package/dist/api/resources/index.d.ts +2 -0
  44. package/dist/api/resources/index.d.ts.map +1 -1
  45. package/dist/api/resources/index.js +2 -0
  46. package/dist/api/resources/index.js.map +1 -1
  47. package/dist/api/resources/organizations/client/Client.d.ts +0 -13
  48. package/dist/api/resources/organizations/client/Client.d.ts.map +1 -1
  49. package/dist/api/resources/organizations/client/Client.js +0 -56
  50. package/dist/api/resources/organizations/client/Client.js.map +1 -1
  51. package/dist/api/resources/podcasts/client/Client.d.ts +5 -3
  52. package/dist/api/resources/podcasts/client/Client.d.ts.map +1 -1
  53. package/dist/api/resources/podcasts/client/Client.js +4 -2
  54. package/dist/api/resources/podcasts/client/Client.js.map +1 -1
  55. package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts +6 -4
  56. package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts.map +1 -1
  57. package/dist/api/resources/podcasts/client/requests/PodcastCreate.js.map +1 -1
  58. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts +4 -1
  59. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts.map +1 -1
  60. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.js.map +1 -1
  61. package/dist/api/resources/segments/client/Client.d.ts +7 -21
  62. package/dist/api/resources/segments/client/Client.d.ts.map +1 -1
  63. package/dist/api/resources/segments/client/Client.js +18 -65
  64. package/dist/api/resources/segments/client/Client.js.map +1 -1
  65. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts +12 -0
  66. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts.map +1 -0
  67. package/dist/api/{types/EpisodeSearchParams.js → resources/segments/client/requests/ListSegmentsRequest.js} +1 -1
  68. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.js.map +1 -0
  69. package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts +25 -4
  70. package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts.map +1 -1
  71. package/dist/api/resources/segments/client/requests/SegmentCreate.js +8 -1
  72. package/dist/api/resources/segments/client/requests/SegmentCreate.js.map +1 -1
  73. package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts +25 -4
  74. package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts.map +1 -1
  75. package/dist/api/resources/segments/client/requests/SegmentUpdate.js +8 -1
  76. package/dist/api/resources/segments/client/requests/SegmentUpdate.js.map +1 -1
  77. package/dist/api/resources/segments/client/requests/index.d.ts +1 -1
  78. package/dist/api/resources/segments/client/requests/index.d.ts.map +1 -1
  79. package/dist/api/resources/segments/index.d.ts +1 -0
  80. package/dist/api/resources/segments/index.d.ts.map +1 -1
  81. package/dist/api/resources/segments/index.js +1 -0
  82. package/dist/api/resources/segments/index.js.map +1 -1
  83. package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts +7 -0
  84. package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts.map +1 -0
  85. package/dist/api/resources/segments/types/ListSegmentsRequestScope.js +7 -0
  86. package/dist/api/resources/segments/types/ListSegmentsRequestScope.js.map +1 -0
  87. package/dist/api/resources/segments/types/index.d.ts +2 -0
  88. package/dist/api/resources/segments/types/index.d.ts.map +1 -0
  89. package/dist/api/resources/segments/types/index.js +2 -0
  90. package/dist/api/resources/segments/types/index.js.map +1 -0
  91. package/dist/api/resources/users/client/Client.d.ts +3 -0
  92. package/dist/api/resources/users/client/Client.d.ts.map +1 -1
  93. package/dist/api/resources/users/client/Client.js +3 -0
  94. package/dist/api/resources/users/client/Client.js.map +1 -1
  95. package/dist/api/types/Audio.d.ts +11 -2
  96. package/dist/api/types/Audio.d.ts.map +1 -1
  97. package/dist/api/types/Audio.js +1 -0
  98. package/dist/api/types/Audio.js.map +1 -1
  99. package/dist/api/types/BadRequestErrorBody.d.ts +9 -0
  100. package/dist/api/types/BadRequestErrorBody.d.ts.map +1 -0
  101. package/dist/api/{resources/audio/client/requests/GetAudioPullStatusRequest.js → types/BadRequestErrorBody.js} +1 -1
  102. package/dist/api/types/BadRequestErrorBody.js.map +1 -0
  103. package/dist/api/types/Chapter.d.ts +3 -0
  104. package/dist/api/types/Chapter.d.ts.map +1 -1
  105. package/dist/api/types/LinkTo.d.ts +13 -0
  106. package/dist/api/types/LinkTo.d.ts.map +1 -0
  107. package/dist/api/types/LinkTo.js +10 -0
  108. package/dist/api/types/LinkTo.js.map +1 -0
  109. package/dist/api/types/Podcast.d.ts +2 -1
  110. package/dist/api/types/Podcast.d.ts.map +1 -1
  111. package/dist/api/types/Podcast.js.map +1 -1
  112. package/dist/api/types/PodcastCreateResponseData.d.ts +2 -1
  113. package/dist/api/types/PodcastCreateResponseData.d.ts.map +1 -1
  114. package/dist/api/types/PodcastCreateResponseData.js.map +1 -1
  115. package/dist/api/types/PublishPodcastResponse.d.ts +7 -0
  116. package/dist/api/types/PublishPodcastResponse.d.ts.map +1 -0
  117. package/dist/api/{resources/audio/client/requests/FinalizeAudioUploadRequest.js → types/PublishPodcastResponse.js} +1 -1
  118. package/dist/api/types/PublishPodcastResponse.js.map +1 -0
  119. package/dist/api/types/{EpisodeSearchParams.d.ts → SearchParams.d.ts} +4 -4
  120. package/dist/api/types/SearchParams.d.ts.map +1 -0
  121. package/dist/api/types/{AudioEntityLink.js → SearchParams.js} +1 -1
  122. package/dist/api/types/SearchParams.js.map +1 -0
  123. package/dist/api/types/Segment.d.ts +1 -2
  124. package/dist/api/types/Segment.d.ts.map +1 -1
  125. package/dist/api/types/Segment.js +1 -1
  126. package/dist/api/types/Segment.js.map +1 -1
  127. package/dist/api/types/index.d.ts +4 -3
  128. package/dist/api/types/index.d.ts.map +1 -1
  129. package/dist/api/types/index.js +4 -3
  130. package/dist/api/types/index.js.map +1 -1
  131. package/package.json +1 -1
  132. package/src/Client.ts +5 -5
  133. package/src/api/errors/BadRequestError.ts +22 -0
  134. package/src/api/errors/index.ts +1 -0
  135. package/src/api/resources/audio/client/Client.ts +18 -182
  136. package/src/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.ts +12 -0
  137. package/src/api/resources/audio/client/requests/PullAudioDto.ts +3 -0
  138. package/src/api/resources/audio/client/requests/index.ts +1 -2
  139. package/src/api/resources/audio/index.ts +1 -0
  140. package/src/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.ts +9 -0
  141. package/src/api/resources/audio/types/index.ts +1 -0
  142. package/src/api/resources/episodes/client/Client.ts +4 -1
  143. package/src/api/resources/episodes/client/requests/EpisodeUpdate.ts +1 -1
  144. package/src/api/resources/index.ts +2 -0
  145. package/src/api/resources/organizations/client/Client.ts +0 -89
  146. package/src/api/resources/podcasts/client/Client.ts +7 -5
  147. package/src/api/resources/podcasts/client/requests/PodcastCreate.ts +6 -4
  148. package/src/api/resources/podcasts/client/requests/PodcastUpdate.ts +4 -1
  149. package/src/api/resources/segments/client/Client.ts +22 -98
  150. package/src/api/resources/segments/client/requests/ListSegmentsRequest.ts +14 -0
  151. package/src/api/resources/segments/client/requests/SegmentCreate.ts +26 -4
  152. package/src/api/resources/segments/client/requests/SegmentUpdate.ts +26 -4
  153. package/src/api/resources/segments/client/requests/index.ts +1 -1
  154. package/src/api/resources/segments/index.ts +1 -0
  155. package/src/api/resources/segments/types/ListSegmentsRequestScope.ts +8 -0
  156. package/src/api/resources/segments/types/index.ts +1 -0
  157. package/src/api/resources/users/client/Client.ts +3 -0
  158. package/src/api/types/Audio.ts +11 -2
  159. package/src/api/types/BadRequestErrorBody.ts +10 -0
  160. package/src/api/types/Chapter.ts +3 -0
  161. package/src/api/types/LinkTo.ts +15 -0
  162. package/src/api/types/Podcast.ts +2 -1
  163. package/src/api/types/PodcastCreateResponseData.ts +2 -1
  164. package/src/api/types/PublishPodcastResponse.ts +9 -0
  165. package/src/api/types/{EpisodeSearchParams.ts → SearchParams.ts} +3 -3
  166. package/src/api/types/Segment.ts +1 -2
  167. package/src/api/types/index.ts +4 -3
  168. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts +0 -17
  169. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts.map +0 -1
  170. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.js.map +0 -1
  171. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts +0 -11
  172. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts.map +0 -1
  173. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.js.map +0 -1
  174. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts +0 -11
  175. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts.map +0 -1
  176. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.js.map +0 -1
  177. package/dist/api/types/AudioEntityLink.d.ts +0 -17
  178. package/dist/api/types/AudioEntityLink.d.ts.map +0 -1
  179. package/dist/api/types/AudioEntityLink.js.map +0 -1
  180. package/dist/api/types/AudioPullStatusResponse.d.ts +0 -23
  181. package/dist/api/types/AudioPullStatusResponse.d.ts.map +0 -1
  182. package/dist/api/types/AudioPullStatusResponse.js +0 -16
  183. package/dist/api/types/AudioPullStatusResponse.js.map +0 -1
  184. package/dist/api/types/EpisodeSearchParams.d.ts.map +0 -1
  185. package/dist/api/types/EpisodeSearchParams.js.map +0 -1
  186. package/src/api/resources/audio/client/requests/FinalizeAudioUploadRequest.ts +0 -19
  187. package/src/api/resources/audio/client/requests/GetAudioPullStatusRequest.ts +0 -12
  188. package/src/api/resources/segments/client/requests/ListPodcastSegmentsRequest.ts +0 -12
  189. package/src/api/types/AudioEntityLink.ts +0 -22
  190. package/src/api/types/AudioPullStatusResponse.ts +0 -27
@@ -15,6 +15,9 @@ export declare namespace AudioClient {
15
15
  export interface RequestOptions extends BaseRequestOptions {}
16
16
  }
17
17
 
18
+ /**
19
+ * Endpoints for managing audio.
20
+ */
18
21
  export class AudioClient {
19
22
  protected readonly _options: NormalizedClientOptionsWithAuth<AudioClient.Options>;
20
23
 
@@ -112,6 +115,7 @@ export class AudioClient {
112
115
  * Generate a signed URL for uploading an audio file.
113
116
  * Use the returned URL to PUT the audio file content.
114
117
  *
118
+ * @param {Ichos.GenerateAudioUploadUrlRequest} request
115
119
  * @param {AudioClient.RequestOptions} requestOptions - Request-specific configuration.
116
120
  *
117
121
  * @throws {@link Ichos.UnauthorizedError}
@@ -122,14 +126,26 @@ export class AudioClient {
122
126
  * await client.audio.generateAudioUploadUrl()
123
127
  */
124
128
  public generateAudioUploadUrl(
129
+ request: Ichos.GenerateAudioUploadUrlRequest = {},
125
130
  requestOptions?: AudioClient.RequestOptions,
126
131
  ): core.HttpResponsePromise<Ichos.UserUploadAudioResponse> {
127
- return core.HttpResponsePromise.fromPromise(this.__generateAudioUploadUrl(requestOptions));
132
+ return core.HttpResponsePromise.fromPromise(this.__generateAudioUploadUrl(request, requestOptions));
128
133
  }
129
134
 
130
135
  private async __generateAudioUploadUrl(
136
+ request: Ichos.GenerateAudioUploadUrlRequest = {},
131
137
  requestOptions?: AudioClient.RequestOptions,
132
138
  ): Promise<core.WithRawResponse<Ichos.UserUploadAudioResponse>> {
139
+ const { linkTo, linkToId } = request;
140
+ const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
141
+ if (linkTo != null) {
142
+ _queryParams.linkTo = linkTo;
143
+ }
144
+
145
+ if (linkToId != null) {
146
+ _queryParams.linkToId = linkToId;
147
+ }
148
+
133
149
  const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
134
150
  const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
135
151
  _authRequest.headers,
@@ -146,7 +162,7 @@ export class AudioClient {
146
162
  ),
147
163
  method: "GET",
148
164
  headers: _headers,
149
- queryParameters: requestOptions?.queryParams,
165
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
150
166
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
151
167
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
152
168
  abortSignal: requestOptions?.abortSignal,
@@ -275,97 +291,6 @@ export class AudioClient {
275
291
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/audio/{audioId}");
276
292
  }
277
293
 
278
- /**
279
- * Finalize the creation of an audio resource after the file has been uploaded.
280
- * Upload completion is detected via storage events.
281
- *
282
- * @param {Ichos.FinalizeAudioUploadRequest} request
283
- * @param {AudioClient.RequestOptions} requestOptions - Request-specific configuration.
284
- *
285
- * @throws {@link Ichos.UnauthorizedError}
286
- * @throws {@link Ichos.TooManyRequestsError}
287
- * @throws {@link Ichos.InternalServerError}
288
- *
289
- * @example
290
- * await client.audio.finalizeAudioUpload({
291
- * audioId: "audioId",
292
- * body: {
293
- * type: "episode",
294
- * id: "id"
295
- * }
296
- * })
297
- */
298
- public finalizeAudioUpload(
299
- request: Ichos.FinalizeAudioUploadRequest,
300
- requestOptions?: AudioClient.RequestOptions,
301
- ): core.HttpResponsePromise<Ichos.AudioResponse> {
302
- return core.HttpResponsePromise.fromPromise(this.__finalizeAudioUpload(request, requestOptions));
303
- }
304
-
305
- private async __finalizeAudioUpload(
306
- request: Ichos.FinalizeAudioUploadRequest,
307
- requestOptions?: AudioClient.RequestOptions,
308
- ): Promise<core.WithRawResponse<Ichos.AudioResponse>> {
309
- const { audioId, body: _body } = request;
310
- const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
311
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
312
- _authRequest.headers,
313
- this._options?.headers,
314
- mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }),
315
- requestOptions?.headers,
316
- );
317
- const _response = await core.fetcher({
318
- url: core.url.join(
319
- (await core.Supplier.get(this._options.baseUrl)) ??
320
- (await core.Supplier.get(this._options.environment)) ??
321
- environments.IchosEnvironment.Default,
322
- `v1/audio/${core.url.encodePathParam(audioId)}`,
323
- ),
324
- method: "POST",
325
- headers: _headers,
326
- contentType: "application/json",
327
- queryParameters: requestOptions?.queryParams,
328
- requestType: "json",
329
- body: _body != null ? _body : undefined,
330
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
331
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
332
- abortSignal: requestOptions?.abortSignal,
333
- fetchFn: this._options?.fetch,
334
- logging: this._options.logging,
335
- });
336
- if (_response.ok) {
337
- return { data: _response.body as Ichos.AudioResponse, rawResponse: _response.rawResponse };
338
- }
339
-
340
- if (_response.error.reason === "status-code") {
341
- switch (_response.error.statusCode) {
342
- case 401:
343
- throw new Ichos.UnauthorizedError(
344
- _response.error.body as Ichos.UnauthorizedErrorResponse,
345
- _response.rawResponse,
346
- );
347
- case 429:
348
- throw new Ichos.TooManyRequestsError(
349
- _response.error.body as Ichos.TooManyRequestsErrorResponse,
350
- _response.rawResponse,
351
- );
352
- case 500:
353
- throw new Ichos.InternalServerError(
354
- _response.error.body as Ichos.InternalServerErrorResponse,
355
- _response.rawResponse,
356
- );
357
- default:
358
- throw new errors.IchosError({
359
- statusCode: _response.error.statusCode,
360
- body: _response.error.body,
361
- rawResponse: _response.rawResponse,
362
- });
363
- }
364
- }
365
-
366
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/audio/{audioId}");
367
- }
368
-
369
294
  /**
370
295
  * Delete an audio resource.
371
296
  *
@@ -455,95 +380,6 @@ export class AudioClient {
455
380
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/audio/{audioId}");
456
381
  }
457
382
 
458
- /**
459
- * Get the status of an ongoing audio pull operation.
460
- *
461
- * @param {Ichos.GetAudioPullStatusRequest} request
462
- * @param {AudioClient.RequestOptions} requestOptions - Request-specific configuration.
463
- *
464
- * @throws {@link Ichos.UnauthorizedError}
465
- * @throws {@link Ichos.NotFoundError}
466
- * @throws {@link Ichos.TooManyRequestsError}
467
- * @throws {@link Ichos.InternalServerError}
468
- *
469
- * @example
470
- * await client.audio.getAudioPullStatus({
471
- * audioId: "audioId"
472
- * })
473
- */
474
- public getAudioPullStatus(
475
- request: Ichos.GetAudioPullStatusRequest,
476
- requestOptions?: AudioClient.RequestOptions,
477
- ): core.HttpResponsePromise<Ichos.AudioPullStatusResponse> {
478
- return core.HttpResponsePromise.fromPromise(this.__getAudioPullStatus(request, requestOptions));
479
- }
480
-
481
- private async __getAudioPullStatus(
482
- request: Ichos.GetAudioPullStatusRequest,
483
- requestOptions?: AudioClient.RequestOptions,
484
- ): Promise<core.WithRawResponse<Ichos.AudioPullStatusResponse>> {
485
- const { audioId } = request;
486
- const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
487
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
488
- _authRequest.headers,
489
- this._options?.headers,
490
- mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }),
491
- requestOptions?.headers,
492
- );
493
- const _response = await core.fetcher({
494
- url: core.url.join(
495
- (await core.Supplier.get(this._options.baseUrl)) ??
496
- (await core.Supplier.get(this._options.environment)) ??
497
- environments.IchosEnvironment.Default,
498
- `v1/audio/${core.url.encodePathParam(audioId)}/pull`,
499
- ),
500
- method: "GET",
501
- headers: _headers,
502
- queryParameters: requestOptions?.queryParams,
503
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
504
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
505
- abortSignal: requestOptions?.abortSignal,
506
- fetchFn: this._options?.fetch,
507
- logging: this._options.logging,
508
- });
509
- if (_response.ok) {
510
- return { data: _response.body as Ichos.AudioPullStatusResponse, rawResponse: _response.rawResponse };
511
- }
512
-
513
- if (_response.error.reason === "status-code") {
514
- switch (_response.error.statusCode) {
515
- case 401:
516
- throw new Ichos.UnauthorizedError(
517
- _response.error.body as Ichos.UnauthorizedErrorResponse,
518
- _response.rawResponse,
519
- );
520
- case 404:
521
- throw new Ichos.NotFoundError(
522
- _response.error.body as Ichos.NotFoundErrorResponse,
523
- _response.rawResponse,
524
- );
525
- case 429:
526
- throw new Ichos.TooManyRequestsError(
527
- _response.error.body as Ichos.TooManyRequestsErrorResponse,
528
- _response.rawResponse,
529
- );
530
- case 500:
531
- throw new Ichos.InternalServerError(
532
- _response.error.body as Ichos.InternalServerErrorResponse,
533
- _response.rawResponse,
534
- );
535
- default:
536
- throw new errors.IchosError({
537
- statusCode: _response.error.statusCode,
538
- body: _response.error.body,
539
- rawResponse: _response.rawResponse,
540
- });
541
- }
542
- }
543
-
544
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/audio/{audioId}/pull");
545
- }
546
-
547
383
  /**
548
384
  * @param {Ichos.TextToSpeechRequest} request
549
385
  * @param {AudioClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,12 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as Ichos from "../../../../index.js";
4
+
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface GenerateAudioUploadUrlRequest {
10
+ linkTo?: Ichos.GenerateAudioUploadUrlRequestLinkTo;
11
+ linkToId?: string;
12
+ }
@@ -1,5 +1,7 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import type * as Ichos from "../../../../index.js";
4
+
3
5
  /**
4
6
  * @example
5
7
  * {
@@ -8,4 +10,5 @@
8
10
  */
9
11
  export interface PullAudioDto {
10
12
  url: string;
13
+ linkTo?: Ichos.LinkTo;
11
14
  }
@@ -1,6 +1,5 @@
1
1
  export type { DeleteAudioRequest } from "./DeleteAudioRequest.js";
2
- export type { FinalizeAudioUploadRequest } from "./FinalizeAudioUploadRequest.js";
3
- export type { GetAudioPullStatusRequest } from "./GetAudioPullStatusRequest.js";
2
+ export type { GenerateAudioUploadUrlRequest } from "./GenerateAudioUploadUrlRequest.js";
4
3
  export type { GetAudioRequest } from "./GetAudioRequest.js";
5
4
  export type { PullAudioDto } from "./PullAudioDto.js";
6
5
  export type { TextToSpeechRequest } from "./TextToSpeechRequest.js";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export const GenerateAudioUploadUrlRequestLinkTo = {
4
+ Episode: "episode",
5
+ Ad: "ad",
6
+ Segment: "segment",
7
+ } as const;
8
+ export type GenerateAudioUploadUrlRequestLinkTo =
9
+ (typeof GenerateAudioUploadUrlRequestLinkTo)[keyof typeof GenerateAudioUploadUrlRequestLinkTo];
@@ -0,0 +1 @@
1
+ export * from "./GenerateAudioUploadUrlRequestLinkTo.js";
@@ -15,6 +15,9 @@ export declare namespace EpisodesClient {
15
15
  export interface RequestOptions extends BaseRequestOptions {}
16
16
  }
17
17
 
18
+ /**
19
+ * Endpoints for managing podcast episodes.
20
+ */
18
21
  export class EpisodesClient {
19
22
  protected readonly _options: NormalizedClientOptionsWithAuth<EpisodesClient.Options>;
20
23
 
@@ -1039,7 +1042,7 @@ export class EpisodesClient {
1039
1042
  }
1040
1043
 
1041
1044
  /**
1042
- * List audio records for a specific episode.
1045
+ * Get audio record for a specific episode.
1043
1046
  *
1044
1047
  * @param {Ichos.GetEpisodeAudioRequest} request
1045
1048
  * @param {EpisodesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -11,13 +11,13 @@ import type * as Ichos from "../../../../index.js";
11
11
  export interface EpisodeUpdate {
12
12
  /** - The ID of the episode to update */
13
13
  episodeId: string;
14
+ metadata?: Ichos.Metadata;
14
15
  title?: string;
15
16
  link?: string;
16
17
  description?: string;
17
18
  adsEnabled?: boolean;
18
19
  explicit?: boolean;
19
20
  block?: boolean;
20
- metadata?: Ichos.Metadata;
21
21
  coverOptions?: Ichos.CoverUploadOptions;
22
22
  season?: number;
23
23
  episode?: number;
@@ -2,6 +2,7 @@ export * from "./ads/client/requests/index.js";
2
2
  export * as ads from "./ads/index.js";
3
3
  export * from "./audio/client/requests/index.js";
4
4
  export * as audio from "./audio/index.js";
5
+ export * from "./audio/types/index.js";
5
6
  export * from "./episodes/client/requests/index.js";
6
7
  export * as episodes from "./episodes/index.js";
7
8
  export * as organizations from "./organizations/index.js";
@@ -9,6 +10,7 @@ export * from "./podcasts/client/requests/index.js";
9
10
  export * as podcasts from "./podcasts/index.js";
10
11
  export * from "./segments/client/requests/index.js";
11
12
  export * as segments from "./segments/index.js";
13
+ export * from "./segments/types/index.js";
12
14
  export * from "./users/client/requests/index.js";
13
15
  export * as users from "./users/index.js";
14
16
  export * from "./webhooks/client/requests/index.js";
@@ -201,93 +201,4 @@ export class OrganizationsClient {
201
201
  "/v1/organizations/analytics/listens",
202
202
  );
203
203
  }
204
-
205
- /**
206
- * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
207
- *
208
- * @throws {@link Ichos.UnauthorizedError}
209
- * @throws {@link Ichos.ForbiddenError}
210
- * @throws {@link Ichos.TooManyRequestsError}
211
- * @throws {@link Ichos.InternalServerError}
212
- *
213
- * @example
214
- * await client.organizations.getOrganizationWhitelabelConfiguration()
215
- */
216
- public getOrganizationWhitelabelConfiguration(
217
- requestOptions?: OrganizationsClient.RequestOptions,
218
- ): core.HttpResponsePromise<Ichos.OrganizationWhitelabelConfigurationResponse> {
219
- return core.HttpResponsePromise.fromPromise(this.__getOrganizationWhitelabelConfiguration(requestOptions));
220
- }
221
-
222
- private async __getOrganizationWhitelabelConfiguration(
223
- requestOptions?: OrganizationsClient.RequestOptions,
224
- ): Promise<core.WithRawResponse<Ichos.OrganizationWhitelabelConfigurationResponse>> {
225
- const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
226
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
227
- _authRequest.headers,
228
- this._options?.headers,
229
- mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }),
230
- requestOptions?.headers,
231
- );
232
- const _response = await core.fetcher({
233
- url: core.url.join(
234
- (await core.Supplier.get(this._options.baseUrl)) ??
235
- (await core.Supplier.get(this._options.environment)) ??
236
- environments.IchosEnvironment.Default,
237
- "v1/organizations/whitelabel-configuration",
238
- ),
239
- method: "GET",
240
- headers: _headers,
241
- queryParameters: requestOptions?.queryParams,
242
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
243
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
244
- abortSignal: requestOptions?.abortSignal,
245
- fetchFn: this._options?.fetch,
246
- logging: this._options.logging,
247
- });
248
- if (_response.ok) {
249
- return {
250
- data: _response.body as Ichos.OrganizationWhitelabelConfigurationResponse,
251
- rawResponse: _response.rawResponse,
252
- };
253
- }
254
-
255
- if (_response.error.reason === "status-code") {
256
- switch (_response.error.statusCode) {
257
- case 401:
258
- throw new Ichos.UnauthorizedError(
259
- _response.error.body as Ichos.UnauthorizedErrorResponse,
260
- _response.rawResponse,
261
- );
262
- case 403:
263
- throw new Ichos.ForbiddenError(
264
- _response.error.body as Ichos.ForbiddenErrorResponse,
265
- _response.rawResponse,
266
- );
267
- case 429:
268
- throw new Ichos.TooManyRequestsError(
269
- _response.error.body as Ichos.TooManyRequestsErrorResponse,
270
- _response.rawResponse,
271
- );
272
- case 500:
273
- throw new Ichos.InternalServerError(
274
- _response.error.body as Ichos.InternalServerErrorResponse,
275
- _response.rawResponse,
276
- );
277
- default:
278
- throw new errors.IchosError({
279
- statusCode: _response.error.statusCode,
280
- body: _response.error.body,
281
- rawResponse: _response.rawResponse,
282
- });
283
- }
284
- }
285
-
286
- return handleNonStatusCodeError(
287
- _response.error,
288
- _response.rawResponse,
289
- "GET",
290
- "/v1/organizations/whitelabel-configuration",
291
- );
292
- }
293
204
  }
@@ -15,6 +15,9 @@ export declare namespace PodcastsClient {
15
15
  export interface RequestOptions extends BaseRequestOptions {}
16
16
  }
17
17
 
18
+ /**
19
+ * Endpoints related to podcast management.
20
+ */
18
21
  export class PodcastsClient {
19
22
  protected readonly _options: NormalizedClientOptionsWithAuth<PodcastsClient.Options>;
20
23
 
@@ -119,8 +122,7 @@ export class PodcastsClient {
119
122
  *
120
123
  * @example
121
124
  * await client.podcasts.createPodcast({
122
- * title: "The Tech Wave",
123
- * explicit: false
125
+ * title: "The Tech Wave"
124
126
  * })
125
127
  */
126
128
  public createPodcast(
@@ -1124,14 +1126,14 @@ export class PodcastsClient {
1124
1126
  public publishPodcast(
1125
1127
  request: Ichos.PublishPodcastRequest,
1126
1128
  requestOptions?: PodcastsClient.RequestOptions,
1127
- ): core.HttpResponsePromise<Ichos.PublishPodcastOutput> {
1129
+ ): core.HttpResponsePromise<Ichos.PublishPodcastResponse> {
1128
1130
  return core.HttpResponsePromise.fromPromise(this.__publishPodcast(request, requestOptions));
1129
1131
  }
1130
1132
 
1131
1133
  private async __publishPodcast(
1132
1134
  request: Ichos.PublishPodcastRequest,
1133
1135
  requestOptions?: PodcastsClient.RequestOptions,
1134
- ): Promise<core.WithRawResponse<Ichos.PublishPodcastOutput>> {
1136
+ ): Promise<core.WithRawResponse<Ichos.PublishPodcastResponse>> {
1135
1137
  const { podcastId } = request;
1136
1138
  const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
1137
1139
  const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
@@ -1157,7 +1159,7 @@ export class PodcastsClient {
1157
1159
  logging: this._options.logging,
1158
1160
  });
1159
1161
  if (_response.ok) {
1160
- return { data: _response.body as Ichos.PublishPodcastOutput, rawResponse: _response.rawResponse };
1162
+ return { data: _response.body as Ichos.PublishPodcastResponse, rawResponse: _response.rawResponse };
1161
1163
  }
1162
1164
 
1163
1165
  if (_response.error.reason === "status-code") {
@@ -5,8 +5,7 @@ import type * as Ichos from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * title: "The Tech Wave",
9
- * explicit: false
8
+ * title: "The Tech Wave"
10
9
  * }
11
10
  */
12
11
  export interface PodcastCreate {
@@ -21,14 +20,17 @@ export interface PodcastCreate {
21
20
  link?: string | null;
22
21
  /** A detailed description of the podcast. */
23
22
  description?: string | null;
24
- /** The language of the podcast (ISO 639-1 code). */
23
+ /**
24
+ * The language of the podcast (ISO 639-1 code). Will default to
25
+ * the organization's default language if not provided.
26
+ */
25
27
  language?: string | null;
26
28
  /** Whether ads are enabled for the podcast. */
27
29
  adsEnabled?: boolean;
28
30
  /** Categories associated with the podcast. */
29
31
  categories?: Ichos.ApplePodcastCategory[] | null;
30
32
  /** Whether the podcast contains explicit content. */
31
- explicit: boolean;
33
+ explicit?: boolean;
32
34
  /** The author of the podcast. */
33
35
  author?: string | null;
34
36
  /** The name of the podcast owner. */
@@ -22,7 +22,10 @@ export interface PodcastUpdate {
22
22
  link?: string;
23
23
  /** A detailed description of the podcast. */
24
24
  description?: string;
25
- /** The language of the podcast (ISO 639-1 code). */
25
+ /**
26
+ * The language of the podcast (ISO 639-1 code). Will default to
27
+ * the organization's default language if not provided.
28
+ */
26
29
  language?: string;
27
30
  /** Whether ads are enabled for the podcast. */
28
31
  adsEnabled?: boolean;