@ichos/sdk 1.0.10 → 1.0.11

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 (185) hide show
  1. package/dist/api/errors/BadRequestError.d.ts +7 -0
  2. package/dist/api/errors/BadRequestError.d.ts.map +1 -0
  3. package/dist/api/errors/BadRequestError.js +18 -0
  4. package/dist/api/errors/BadRequestError.js.map +1 -0
  5. package/dist/api/errors/index.d.ts +1 -0
  6. package/dist/api/errors/index.d.ts.map +1 -1
  7. package/dist/api/errors/index.js +1 -0
  8. package/dist/api/errors/index.js.map +1 -1
  9. package/dist/api/resources/audio/client/Client.d.ts +5 -41
  10. package/dist/api/resources/audio/client/Client.d.ts.map +1 -1
  11. package/dist/api/resources/audio/client/Client.js +16 -127
  12. package/dist/api/resources/audio/client/Client.js.map +1 -1
  13. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts +10 -0
  14. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts.map +1 -0
  15. package/dist/api/resources/{segments/client/requests/ListPodcastSegmentsRequest.js → audio/client/requests/GenerateAudioUploadUrlRequest.js} +1 -1
  16. package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.js.map +1 -0
  17. package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts +2 -0
  18. package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts.map +1 -1
  19. package/dist/api/resources/audio/client/requests/index.d.ts +1 -2
  20. package/dist/api/resources/audio/client/requests/index.d.ts.map +1 -1
  21. package/dist/api/resources/audio/index.d.ts +1 -0
  22. package/dist/api/resources/audio/index.d.ts.map +1 -1
  23. package/dist/api/resources/audio/index.js +1 -0
  24. package/dist/api/resources/audio/index.js.map +1 -1
  25. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts +7 -0
  26. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts.map +1 -0
  27. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js +7 -0
  28. package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js.map +1 -0
  29. package/dist/api/resources/audio/types/index.d.ts +2 -0
  30. package/dist/api/resources/audio/types/index.d.ts.map +1 -0
  31. package/dist/api/resources/audio/types/index.js +2 -0
  32. package/dist/api/resources/audio/types/index.js.map +1 -0
  33. package/dist/api/resources/episodes/client/Client.d.ts +4 -1
  34. package/dist/api/resources/episodes/client/Client.d.ts.map +1 -1
  35. package/dist/api/resources/episodes/client/Client.js +4 -1
  36. package/dist/api/resources/episodes/client/Client.js.map +1 -1
  37. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts +1 -1
  38. package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts.map +1 -1
  39. package/dist/api/resources/index.d.ts +2 -0
  40. package/dist/api/resources/index.d.ts.map +1 -1
  41. package/dist/api/resources/index.js +2 -0
  42. package/dist/api/resources/index.js.map +1 -1
  43. package/dist/api/resources/organizations/client/Client.d.ts +0 -13
  44. package/dist/api/resources/organizations/client/Client.d.ts.map +1 -1
  45. package/dist/api/resources/organizations/client/Client.js +0 -56
  46. package/dist/api/resources/organizations/client/Client.js.map +1 -1
  47. package/dist/api/resources/podcasts/client/Client.d.ts +5 -3
  48. package/dist/api/resources/podcasts/client/Client.d.ts.map +1 -1
  49. package/dist/api/resources/podcasts/client/Client.js +4 -2
  50. package/dist/api/resources/podcasts/client/Client.js.map +1 -1
  51. package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts +6 -4
  52. package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts.map +1 -1
  53. package/dist/api/resources/podcasts/client/requests/PodcastCreate.js.map +1 -1
  54. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts +4 -1
  55. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts.map +1 -1
  56. package/dist/api/resources/podcasts/client/requests/PodcastUpdate.js.map +1 -1
  57. package/dist/api/resources/segments/client/Client.d.ts +7 -21
  58. package/dist/api/resources/segments/client/Client.d.ts.map +1 -1
  59. package/dist/api/resources/segments/client/Client.js +18 -65
  60. package/dist/api/resources/segments/client/Client.js.map +1 -1
  61. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts +12 -0
  62. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts.map +1 -0
  63. package/dist/api/{types/EpisodeSearchParams.js → resources/segments/client/requests/ListSegmentsRequest.js} +1 -1
  64. package/dist/api/resources/segments/client/requests/ListSegmentsRequest.js.map +1 -0
  65. package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts +25 -4
  66. package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts.map +1 -1
  67. package/dist/api/resources/segments/client/requests/SegmentCreate.js +8 -1
  68. package/dist/api/resources/segments/client/requests/SegmentCreate.js.map +1 -1
  69. package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts +25 -4
  70. package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts.map +1 -1
  71. package/dist/api/resources/segments/client/requests/SegmentUpdate.js +8 -1
  72. package/dist/api/resources/segments/client/requests/SegmentUpdate.js.map +1 -1
  73. package/dist/api/resources/segments/client/requests/index.d.ts +1 -1
  74. package/dist/api/resources/segments/client/requests/index.d.ts.map +1 -1
  75. package/dist/api/resources/segments/index.d.ts +1 -0
  76. package/dist/api/resources/segments/index.d.ts.map +1 -1
  77. package/dist/api/resources/segments/index.js +1 -0
  78. package/dist/api/resources/segments/index.js.map +1 -1
  79. package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts +7 -0
  80. package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts.map +1 -0
  81. package/dist/api/resources/segments/types/ListSegmentsRequestScope.js +7 -0
  82. package/dist/api/resources/segments/types/ListSegmentsRequestScope.js.map +1 -0
  83. package/dist/api/resources/segments/types/index.d.ts +2 -0
  84. package/dist/api/resources/segments/types/index.d.ts.map +1 -0
  85. package/dist/api/resources/segments/types/index.js +2 -0
  86. package/dist/api/resources/segments/types/index.js.map +1 -0
  87. package/dist/api/resources/users/client/Client.d.ts +3 -0
  88. package/dist/api/resources/users/client/Client.d.ts.map +1 -1
  89. package/dist/api/resources/users/client/Client.js +3 -0
  90. package/dist/api/resources/users/client/Client.js.map +1 -1
  91. package/dist/api/types/Audio.d.ts +11 -2
  92. package/dist/api/types/Audio.d.ts.map +1 -1
  93. package/dist/api/types/Audio.js +1 -0
  94. package/dist/api/types/Audio.js.map +1 -1
  95. package/dist/api/types/BadRequestErrorBody.d.ts +9 -0
  96. package/dist/api/types/BadRequestErrorBody.d.ts.map +1 -0
  97. package/dist/api/{resources/audio/client/requests/GetAudioPullStatusRequest.js → types/BadRequestErrorBody.js} +1 -1
  98. package/dist/api/types/BadRequestErrorBody.js.map +1 -0
  99. package/dist/api/types/Chapter.d.ts +3 -0
  100. package/dist/api/types/Chapter.d.ts.map +1 -1
  101. package/dist/api/types/LinkTo.d.ts +13 -0
  102. package/dist/api/types/LinkTo.d.ts.map +1 -0
  103. package/dist/api/types/LinkTo.js +10 -0
  104. package/dist/api/types/LinkTo.js.map +1 -0
  105. package/dist/api/types/Podcast.d.ts +2 -1
  106. package/dist/api/types/Podcast.d.ts.map +1 -1
  107. package/dist/api/types/Podcast.js.map +1 -1
  108. package/dist/api/types/PodcastCreateResponseData.d.ts +2 -1
  109. package/dist/api/types/PodcastCreateResponseData.d.ts.map +1 -1
  110. package/dist/api/types/PodcastCreateResponseData.js.map +1 -1
  111. package/dist/api/types/PublishPodcastResponse.d.ts +7 -0
  112. package/dist/api/types/PublishPodcastResponse.d.ts.map +1 -0
  113. package/dist/api/{resources/audio/client/requests/FinalizeAudioUploadRequest.js → types/PublishPodcastResponse.js} +1 -1
  114. package/dist/api/types/PublishPodcastResponse.js.map +1 -0
  115. package/dist/api/types/{EpisodeSearchParams.d.ts → SearchParams.d.ts} +4 -4
  116. package/dist/api/types/SearchParams.d.ts.map +1 -0
  117. package/dist/api/types/{AudioEntityLink.js → SearchParams.js} +1 -1
  118. package/dist/api/types/SearchParams.js.map +1 -0
  119. package/dist/api/types/Segment.d.ts +1 -2
  120. package/dist/api/types/Segment.d.ts.map +1 -1
  121. package/dist/api/types/Segment.js +1 -1
  122. package/dist/api/types/Segment.js.map +1 -1
  123. package/dist/api/types/index.d.ts +4 -3
  124. package/dist/api/types/index.d.ts.map +1 -1
  125. package/dist/api/types/index.js +4 -3
  126. package/dist/api/types/index.js.map +1 -1
  127. package/package.json +1 -1
  128. package/src/api/errors/BadRequestError.ts +22 -0
  129. package/src/api/errors/index.ts +1 -0
  130. package/src/api/resources/audio/client/Client.ts +18 -182
  131. package/src/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.ts +12 -0
  132. package/src/api/resources/audio/client/requests/PullAudioDto.ts +3 -0
  133. package/src/api/resources/audio/client/requests/index.ts +1 -2
  134. package/src/api/resources/audio/index.ts +1 -0
  135. package/src/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.ts +9 -0
  136. package/src/api/resources/audio/types/index.ts +1 -0
  137. package/src/api/resources/episodes/client/Client.ts +4 -1
  138. package/src/api/resources/episodes/client/requests/EpisodeUpdate.ts +1 -1
  139. package/src/api/resources/index.ts +2 -0
  140. package/src/api/resources/organizations/client/Client.ts +0 -89
  141. package/src/api/resources/podcasts/client/Client.ts +7 -5
  142. package/src/api/resources/podcasts/client/requests/PodcastCreate.ts +6 -4
  143. package/src/api/resources/podcasts/client/requests/PodcastUpdate.ts +4 -1
  144. package/src/api/resources/segments/client/Client.ts +22 -98
  145. package/src/api/resources/segments/client/requests/ListSegmentsRequest.ts +14 -0
  146. package/src/api/resources/segments/client/requests/SegmentCreate.ts +26 -4
  147. package/src/api/resources/segments/client/requests/SegmentUpdate.ts +26 -4
  148. package/src/api/resources/segments/client/requests/index.ts +1 -1
  149. package/src/api/resources/segments/index.ts +1 -0
  150. package/src/api/resources/segments/types/ListSegmentsRequestScope.ts +8 -0
  151. package/src/api/resources/segments/types/index.ts +1 -0
  152. package/src/api/resources/users/client/Client.ts +3 -0
  153. package/src/api/types/Audio.ts +11 -2
  154. package/src/api/types/BadRequestErrorBody.ts +10 -0
  155. package/src/api/types/Chapter.ts +3 -0
  156. package/src/api/types/LinkTo.ts +15 -0
  157. package/src/api/types/Podcast.ts +2 -1
  158. package/src/api/types/PodcastCreateResponseData.ts +2 -1
  159. package/src/api/types/PublishPodcastResponse.ts +9 -0
  160. package/src/api/types/{EpisodeSearchParams.ts → SearchParams.ts} +3 -3
  161. package/src/api/types/Segment.ts +1 -2
  162. package/src/api/types/index.ts +4 -3
  163. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts +0 -17
  164. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts.map +0 -1
  165. package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.js.map +0 -1
  166. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts +0 -11
  167. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts.map +0 -1
  168. package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.js.map +0 -1
  169. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts +0 -11
  170. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts.map +0 -1
  171. package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.js.map +0 -1
  172. package/dist/api/types/AudioEntityLink.d.ts +0 -17
  173. package/dist/api/types/AudioEntityLink.d.ts.map +0 -1
  174. package/dist/api/types/AudioEntityLink.js.map +0 -1
  175. package/dist/api/types/AudioPullStatusResponse.d.ts +0 -23
  176. package/dist/api/types/AudioPullStatusResponse.d.ts.map +0 -1
  177. package/dist/api/types/AudioPullStatusResponse.js +0 -16
  178. package/dist/api/types/AudioPullStatusResponse.js.map +0 -1
  179. package/dist/api/types/EpisodeSearchParams.d.ts.map +0 -1
  180. package/dist/api/types/EpisodeSearchParams.js.map +0 -1
  181. package/src/api/resources/audio/client/requests/FinalizeAudioUploadRequest.ts +0 -19
  182. package/src/api/resources/audio/client/requests/GetAudioPullStatusRequest.ts +0 -12
  183. package/src/api/resources/segments/client/requests/ListPodcastSegmentsRequest.ts +0 -12
  184. package/src/api/types/AudioEntityLink.ts +0 -22
  185. package/src/api/types/AudioPullStatusResponse.ts +0 -27
@@ -23,27 +23,40 @@ export class SegmentsClient {
23
23
  }
24
24
 
25
25
  /**
26
- * Retrieve all segments for the authenticated context (Virtual User or Organization).
26
+ * Retrieve all segments for the given scope.
27
27
  *
28
+ * @param {Ichos.ListSegmentsRequest} request
28
29
  * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
29
30
  *
31
+ * @throws {@link Ichos.BadRequestError}
30
32
  * @throws {@link Ichos.UnauthorizedError}
31
33
  * @throws {@link Ichos.ForbiddenError}
32
34
  * @throws {@link Ichos.NotFoundError}
33
35
  * @throws {@link Ichos.InternalServerError}
34
36
  *
35
37
  * @example
36
- * await client.segments.listSegments()
38
+ * await client.segments.listSegments({
39
+ * scope: "organization"
40
+ * })
37
41
  */
38
42
  public listSegments(
43
+ request: Ichos.ListSegmentsRequest,
39
44
  requestOptions?: SegmentsClient.RequestOptions,
40
45
  ): core.HttpResponsePromise<Ichos.SegmentListResponse> {
41
- return core.HttpResponsePromise.fromPromise(this.__listSegments(requestOptions));
46
+ return core.HttpResponsePromise.fromPromise(this.__listSegments(request, requestOptions));
42
47
  }
43
48
 
44
49
  private async __listSegments(
50
+ request: Ichos.ListSegmentsRequest,
45
51
  requestOptions?: SegmentsClient.RequestOptions,
46
52
  ): Promise<core.WithRawResponse<Ichos.SegmentListResponse>> {
53
+ const { scope, id } = request;
54
+ const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
55
+ _queryParams.scope = scope;
56
+ if (id != null) {
57
+ _queryParams.id = id;
58
+ }
59
+
47
60
  const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
48
61
  const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
49
62
  _authRequest.headers,
@@ -60,7 +73,7 @@ export class SegmentsClient {
60
73
  ),
61
74
  method: "GET",
62
75
  headers: _headers,
63
- queryParameters: requestOptions?.queryParams,
76
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
64
77
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
65
78
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
66
79
  abortSignal: requestOptions?.abortSignal,
@@ -73,6 +86,11 @@ export class SegmentsClient {
73
86
 
74
87
  if (_response.error.reason === "status-code") {
75
88
  switch (_response.error.statusCode) {
89
+ case 400:
90
+ throw new Ichos.BadRequestError(
91
+ _response.error.body as Ichos.BadRequestErrorBody,
92
+ _response.rawResponse,
93
+ );
76
94
  case 401:
77
95
  throw new Ichos.UnauthorizedError(
78
96
  _response.error.body as Ichos.UnauthorizedErrorResponse,
@@ -284,100 +302,6 @@ export class SegmentsClient {
284
302
  );
285
303
  }
286
304
 
287
- /**
288
- * Retrieve all segments for a specific podcast.
289
- *
290
- * @param {Ichos.ListPodcastSegmentsRequest} request
291
- * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
292
- *
293
- * @throws {@link Ichos.UnauthorizedError}
294
- * @throws {@link Ichos.ForbiddenError}
295
- * @throws {@link Ichos.NotFoundError}
296
- * @throws {@link Ichos.InternalServerError}
297
- *
298
- * @example
299
- * await client.segments.listPodcastSegments({
300
- * podcastId: "podcastId"
301
- * })
302
- */
303
- public listPodcastSegments(
304
- request: Ichos.ListPodcastSegmentsRequest,
305
- requestOptions?: SegmentsClient.RequestOptions,
306
- ): core.HttpResponsePromise<Ichos.SegmentListResponse> {
307
- return core.HttpResponsePromise.fromPromise(this.__listPodcastSegments(request, requestOptions));
308
- }
309
-
310
- private async __listPodcastSegments(
311
- request: Ichos.ListPodcastSegmentsRequest,
312
- requestOptions?: SegmentsClient.RequestOptions,
313
- ): Promise<core.WithRawResponse<Ichos.SegmentListResponse>> {
314
- const { podcastId } = request;
315
- const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
316
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
317
- _authRequest.headers,
318
- this._options?.headers,
319
- mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }),
320
- requestOptions?.headers,
321
- );
322
- const _response = await core.fetcher({
323
- url: core.url.join(
324
- (await core.Supplier.get(this._options.baseUrl)) ??
325
- (await core.Supplier.get(this._options.environment)) ??
326
- environments.IchosEnvironment.Default,
327
- `v1/segments/podcast/${core.url.encodePathParam(podcastId)}`,
328
- ),
329
- method: "GET",
330
- headers: _headers,
331
- queryParameters: requestOptions?.queryParams,
332
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
333
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
334
- abortSignal: requestOptions?.abortSignal,
335
- fetchFn: this._options?.fetch,
336
- logging: this._options.logging,
337
- });
338
- if (_response.ok) {
339
- return { data: _response.body as Ichos.SegmentListResponse, rawResponse: _response.rawResponse };
340
- }
341
-
342
- if (_response.error.reason === "status-code") {
343
- switch (_response.error.statusCode) {
344
- case 401:
345
- throw new Ichos.UnauthorizedError(
346
- _response.error.body as Ichos.UnauthorizedErrorResponse,
347
- _response.rawResponse,
348
- );
349
- case 403:
350
- throw new Ichos.ForbiddenError(
351
- _response.error.body as Ichos.ForbiddenErrorResponse,
352
- _response.rawResponse,
353
- );
354
- case 404:
355
- throw new Ichos.NotFoundError(
356
- _response.error.body as Ichos.NotFoundErrorResponse,
357
- _response.rawResponse,
358
- );
359
- case 500:
360
- throw new Ichos.InternalServerError(
361
- _response.error.body as Ichos.InternalServerErrorResponse,
362
- _response.rawResponse,
363
- );
364
- default:
365
- throw new errors.IchosError({
366
- statusCode: _response.error.statusCode,
367
- body: _response.error.body,
368
- rawResponse: _response.rawResponse,
369
- });
370
- }
371
- }
372
-
373
- return handleNonStatusCodeError(
374
- _response.error,
375
- _response.rawResponse,
376
- "GET",
377
- "/v1/segments/podcast/{podcastId}",
378
- );
379
- }
380
-
381
305
  /**
382
306
  * Delete a segment.
383
307
  * Optionally delete the associated audio file.
@@ -0,0 +1,14 @@
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
+ * scope: "organization"
9
+ * }
10
+ */
11
+ export interface ListSegmentsRequest {
12
+ scope: Ichos.ListSegmentsRequestScope;
13
+ id?: string;
14
+ }
@@ -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,22 +10,42 @@
8
10
  * }
9
11
  */
10
12
  export interface SegmentCreate {
13
+ /**
14
+ * The scope of the segment, which can be 'organization', 'virtualUser', or 'podcast'. This determines the ownership and applicability of the segment.
15
+ * - 'organization': The segment applies to all podcasts within the organization.
16
+ * - 'virtualUser': The segment applies to all podcasts associated with a specific virtual user.
17
+ * - 'podcast': The segment applies only to a specific podcast.
18
+ */
11
19
  scope: SegmentCreate.Scope;
20
+ /** The type of segment, which can be either 'intro' or 'outro'. */
12
21
  type: SegmentCreate.Type;
22
+ /** Whether or not the segment will be actively used. */
13
23
  active?: boolean;
14
- organizationId?: string | null;
15
- virtualUserId?: string | null;
16
- podcastId?: string | null;
24
+ /**
25
+ * The ID to the virtualUser or podcast this segment belongs to, depending on the scope.
26
+ * For an organization-scoped segment, this is not required.
27
+ */
28
+ entityId?: string;
29
+ /** Optional metadata object that can store additional information about the segment. */
30
+ metadata?: Ichos.Metadata;
31
+ /** The ID of the audio file associated with this segment, if any. */
17
32
  audioId?: string | null;
18
33
  }
19
34
 
20
35
  export namespace SegmentCreate {
36
+ /**
37
+ * The scope of the segment, which can be 'organization', 'virtualUser', or 'podcast'. This determines the ownership and applicability of the segment.
38
+ * - 'organization': The segment applies to all podcasts within the organization.
39
+ * - 'virtualUser': The segment applies to all podcasts associated with a specific virtual user.
40
+ * - 'podcast': The segment applies only to a specific podcast.
41
+ */
21
42
  export const Scope = {
22
43
  Organization: "organization",
23
- VirtualUser: "virtual_user",
44
+ VirtualUser: "virtualUser",
24
45
  Podcast: "podcast",
25
46
  } as const;
26
47
  export type Scope = (typeof Scope)[keyof typeof Scope];
48
+ /** The type of segment, which can be either 'intro' or 'outro'. */
27
49
  export const Type = {
28
50
  Intro: "intro",
29
51
  Outro: "outro",
@@ -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,22 +10,42 @@
8
10
  */
9
11
  export interface SegmentUpdate {
10
12
  segmentId: string;
13
+ /**
14
+ * The scope of the segment, which can be 'organization', 'virtualUser', or 'podcast'. This determines the ownership and applicability of the segment.
15
+ * - 'organization': The segment applies to all podcasts within the organization.
16
+ * - 'virtualUser': The segment applies to all podcasts associated with a specific virtual user.
17
+ * - 'podcast': The segment applies only to a specific podcast.
18
+ */
11
19
  scope?: SegmentUpdate.Scope;
20
+ /** The type of segment, which can be either 'intro' or 'outro'. */
12
21
  type?: SegmentUpdate.Type;
22
+ /** Whether or not the segment will be actively used. */
13
23
  active?: boolean;
14
- organizationId?: string;
15
- virtualUserId?: string;
16
- podcastId?: string;
24
+ /**
25
+ * The ID to the virtualUser or podcast this segment belongs to, depending on the scope.
26
+ * For an organization-scoped segment, this is not required.
27
+ */
28
+ entityId?: string;
29
+ /** Optional metadata object that can store additional information about the segment. */
30
+ metadata?: Ichos.Metadata;
31
+ /** The ID of the audio file associated with this segment, if any. */
17
32
  audioId?: string;
18
33
  }
19
34
 
20
35
  export namespace SegmentUpdate {
36
+ /**
37
+ * The scope of the segment, which can be 'organization', 'virtualUser', or 'podcast'. This determines the ownership and applicability of the segment.
38
+ * - 'organization': The segment applies to all podcasts within the organization.
39
+ * - 'virtualUser': The segment applies to all podcasts associated with a specific virtual user.
40
+ * - 'podcast': The segment applies only to a specific podcast.
41
+ */
21
42
  export const Scope = {
22
43
  Organization: "organization",
23
- VirtualUser: "virtual_user",
44
+ VirtualUser: "virtualUser",
24
45
  Podcast: "podcast",
25
46
  } as const;
26
47
  export type Scope = (typeof Scope)[keyof typeof Scope];
48
+ /** The type of segment, which can be either 'intro' or 'outro'. */
27
49
  export const Type = {
28
50
  Intro: "intro",
29
51
  Outro: "outro",
@@ -1,5 +1,5 @@
1
1
  export type { DeleteSegmentRequest } from "./DeleteSegmentRequest.js";
2
2
  export type { LinkSegmentAudioRequest } from "./LinkSegmentAudioRequest.js";
3
- export type { ListPodcastSegmentsRequest } from "./ListPodcastSegmentsRequest.js";
3
+ export type { ListSegmentsRequest } from "./ListSegmentsRequest.js";
4
4
  export type { SegmentCreate } from "./SegmentCreate.js";
5
5
  export type { SegmentUpdate } from "./SegmentUpdate.js";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export const ListSegmentsRequestScope = {
4
+ Organization: "organization",
5
+ VirtualUser: "virtualUser",
6
+ Podcast: "podcast",
7
+ } as const;
8
+ export type ListSegmentsRequestScope = (typeof ListSegmentsRequestScope)[keyof typeof ListSegmentsRequestScope];
@@ -0,0 +1 @@
1
+ export * from "./ListSegmentsRequestScope.js";
@@ -15,6 +15,9 @@ export declare namespace UsersClient {
15
15
  export interface RequestOptions extends BaseRequestOptions {}
16
16
  }
17
17
 
18
+ /**
19
+ * Endpoints for managing user accounts and profiles.
20
+ */
18
21
  export class UsersClient {
19
22
  protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
20
23
 
@@ -3,22 +3,31 @@
3
3
  import type * as Ichos from "../index.js";
4
4
 
5
5
  export interface Audio {
6
+ /** Unique identifier for the audio record. */
6
7
  id: string;
7
- rawKey: string | null;
8
+ /** Original file size of the raw file uploaded by the user. Null if the raw audio has been deleted. */
8
9
  rawSize: number | null;
10
+ /** Processing status of the audio file. Will be 'uploading' while the user is uploading the file, then transition to 'processing' while we analyze and process the audio, and finally 'done' when the audio is ready to be used. If any errors occur during upload or processing, the status will be 'pull_failed' or 'failed' respectively. */
9
11
  status: Audio.Status;
10
- processedKey: string | null;
12
+ /** Duration in seconds for the processed audio. Null if unknown. */
11
13
  duration: number | null;
14
+ /** Size in bytes for the processed audio. Null if unknown. */
12
15
  size: number | null;
16
+ /** MIME type of the processed audio (e.g. "audio/mpeg"). Null if unknown. */
13
17
  type: string | null;
18
+ /** Bitrate in kbps for the processed audio. Null if unknown. */
14
19
  bitrate: number | null;
20
+ /** Sample rate in Hz for the processed audio. Null if unknown. */
15
21
  sampleRate: number | null;
22
+ /** Number of audio channels (e.g. 1 for mono, 2 for stereo) for the processed audio. Null if unknown. */
16
23
  channels: number | null;
17
24
  chapters: Ichos.Chapter[];
25
+ /** URL to access the audio file. This URL is temporary and will expire after 1 hour. */
18
26
  url: string | null;
19
27
  }
20
28
 
21
29
  export namespace Audio {
30
+ /** Processing status of the audio file. Will be 'uploading' while the user is uploading the file, then transition to 'processing' while we analyze and process the audio, and finally 'done' when the audio is ready to be used. If any errors occur during upload or processing, the status will be 'pull_failed' or 'failed' respectively. */
22
31
  export const Status = {
23
32
  Uploading: "uploading",
24
33
  Pulling: "pulling",
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface BadRequestErrorBody {
4
+ name: string;
5
+ message: string;
6
+ stack?: string;
7
+ statusCode: number;
8
+ errorCode: string;
9
+ errorMessage: string;
10
+ }
@@ -1,7 +1,10 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  export interface Chapter {
4
+ /** Start time of the chapter in seconds. Must be less than endTime. */
4
5
  startTime: number;
6
+ /** End time of the chapter in seconds. Must be greater than startTime. */
5
7
  endTime: number;
8
+ /** Title of the chapter. */
6
9
  title: string;
7
10
  }
@@ -0,0 +1,15 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface LinkTo {
4
+ linkTo: LinkTo.LinkTo;
5
+ id: string;
6
+ }
7
+
8
+ export namespace LinkTo {
9
+ export const LinkTo = {
10
+ Episode: "episode",
11
+ Ad: "ad",
12
+ Segment: "segment",
13
+ } as const;
14
+ export type LinkTo = (typeof LinkTo)[keyof typeof LinkTo];
15
+ }
@@ -20,10 +20,11 @@ export interface Podcast {
20
20
  description: string | null;
21
21
  /** The language of the podcast (ISO 639-1 code). */
22
22
  language: string | null;
23
+ coverUrl: string | null;
23
24
  /** Current cover upload status. */
24
25
  coverUploadStatus: Podcast.CoverUploadStatus | null;
25
26
  /** Whether ads are enabled for the podcast. */
26
- adsEnabled?: boolean;
27
+ adsEnabled: boolean;
27
28
  /** Categories associated with the podcast. */
28
29
  categories: Ichos.ApplePodcastCategory[] | null;
29
30
  /** Whether the podcast contains explicit content. */
@@ -20,10 +20,11 @@ export interface PodcastCreateResponseData {
20
20
  description: string | null;
21
21
  /** The language of the podcast (ISO 639-1 code). */
22
22
  language: string | null;
23
+ coverUrl: string | null;
23
24
  /** Current cover upload status. */
24
25
  coverUploadStatus: PodcastCreateResponseData.CoverUploadStatus | null;
25
26
  /** Whether ads are enabled for the podcast. */
26
- adsEnabled?: boolean;
27
+ adsEnabled: boolean;
27
28
  /** Categories associated with the podcast. */
28
29
  categories: Ichos.ApplePodcastCategory[] | null;
29
30
  /** Whether the podcast contains explicit content. */
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as Ichos from "../index.js";
4
+
5
+ export interface PublishPodcastResponse {
6
+ success: boolean;
7
+ data: Ichos.PublishPodcastOutput;
8
+ meta: Ichos.ApiMetaSuccess;
9
+ }
@@ -1,12 +1,12 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
 
3
- export interface EpisodeSearchParams {
3
+ export interface SearchParams {
4
4
  /** JSON object string to match against metadata (JSONB containment). */
5
5
  metadataJson?: string;
6
6
  /** Metadata key to filter by. */
7
7
  metadataKey?: string;
8
8
  /** Metadata value to filter by (string, number, boolean, or null). */
9
- metadataValue?: EpisodeSearchParams.MetadataValue | null;
9
+ metadataValue?: SearchParams.MetadataValue | null;
10
10
  /** Search query string. Searches across episode fields and metadata. */
11
11
  query?: string;
12
12
  /** Max number of records to return. */
@@ -15,7 +15,7 @@ export interface EpisodeSearchParams {
15
15
  offset?: number;
16
16
  }
17
17
 
18
- export namespace EpisodeSearchParams {
18
+ export namespace SearchParams {
19
19
  /**
20
20
  * Metadata value to filter by (string, number, boolean, or null).
21
21
  */
@@ -7,7 +7,6 @@ export interface Segment {
7
7
  scope: Segment.Scope;
8
8
  active: boolean;
9
9
  type: Segment.Type;
10
- organizationId?: string | null;
11
10
  virtualUserId?: string | null;
12
11
  podcastId?: string | null;
13
12
  audioId?: string | null;
@@ -19,7 +18,7 @@ export interface Segment {
19
18
  export namespace Segment {
20
19
  export const Scope = {
21
20
  Organization: "organization",
22
- VirtualUser: "virtual_user",
21
+ VirtualUser: "virtualUser",
23
22
  Podcast: "podcast",
24
23
  } as const;
25
24
  export type Scope = (typeof Scope)[keyof typeof Scope];
@@ -10,15 +10,14 @@ export * from "./ApiMeta.js";
10
10
  export * from "./ApiMetaSuccess.js";
11
11
  export * from "./ApplePodcastCategory.js";
12
12
  export * from "./Audio.js";
13
- export * from "./AudioEntityLink.js";
14
13
  export * from "./AudioProcessedPayload.js";
15
14
  export * from "./AudioPulledPayload.js";
16
15
  export * from "./AudioPullResponse.js";
17
- export * from "./AudioPullStatusResponse.js";
18
16
  export * from "./AudioResponse.js";
19
17
  export * from "./AudioUploadOptions.js";
20
18
  export * from "./AudioUploadResponse.js";
21
19
  export * from "./AuthenticatedOrganizationResponse.js";
20
+ export * from "./BadRequestErrorBody.js";
22
21
  export * from "./Chapter.js";
23
22
  export * from "./CoverUploadOptions.js";
24
23
  export * from "./CoverUploadResponse.js";
@@ -26,13 +25,13 @@ export * from "./Episode.js";
26
25
  export * from "./EpisodeCreateResponse.js";
27
26
  export * from "./EpisodeCreateResponseData.js";
28
27
  export * from "./EpisodeResponse.js";
29
- export * from "./EpisodeSearchParams.js";
30
28
  export * from "./EpisodesResponse.js";
31
29
  export * from "./EpisodeTranscript.js";
32
30
  export * from "./ForbiddenErrorBody.js";
33
31
  export * from "./ForbiddenErrorResponse.js";
34
32
  export * from "./InternalServerErrorBody.js";
35
33
  export * from "./InternalServerErrorResponse.js";
34
+ export * from "./LinkTo.js";
36
35
  export * from "./Listeners.js";
37
36
  export * from "./ListenersReport.js";
38
37
  export * from "./ListenersReportResponse.js";
@@ -56,6 +55,8 @@ export * from "./PodcastResponse.js";
56
55
  export * from "./PodcastSearchParams.js";
57
56
  export * from "./PodcastsResponse.js";
58
57
  export * from "./PublishPodcastOutput.js";
58
+ export * from "./PublishPodcastResponse.js";
59
+ export * from "./SearchParams.js";
59
60
  export * from "./Segment.js";
60
61
  export * from "./SegmentListResponse.js";
61
62
  export * from "./SegmentResponse.js";
@@ -1,17 +0,0 @@
1
- import type * as Ichos from "../../../../index.js";
2
- /**
3
- * @example
4
- * {
5
- * audioId: "audioId",
6
- * body: {
7
- * type: "episode",
8
- * id: "id"
9
- * }
10
- * }
11
- */
12
- export interface FinalizeAudioUploadRequest {
13
- /** - The ID of the audio resource (returned by /put) */
14
- audioId: string;
15
- body: Ichos.AudioEntityLink | null;
16
- }
17
- //# sourceMappingURL=FinalizeAudioUploadRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FinalizeAudioUploadRequest.d.ts","sourceRoot":"","sources":["../../../../../../src/api/resources/audio/client/requests/FinalizeAudioUploadRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,WAAW,0BAA0B;IACvC,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;CACtC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FinalizeAudioUploadRequest.js","sourceRoot":"","sources":["../../../../../../src/api/resources/audio/client/requests/FinalizeAudioUploadRequest.ts"],"names":[],"mappings":"AAAA,gEAAgE"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * audioId: "audioId"
5
- * }
6
- */
7
- export interface GetAudioPullStatusRequest {
8
- /** - The ID of the audio being pulled */
9
- audioId: string;
10
- }
11
- //# sourceMappingURL=GetAudioPullStatusRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetAudioPullStatusRequest.d.ts","sourceRoot":"","sources":["../../../../../../src/api/resources/audio/client/requests/GetAudioPullStatusRequest.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACtC,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetAudioPullStatusRequest.js","sourceRoot":"","sources":["../../../../../../src/api/resources/audio/client/requests/GetAudioPullStatusRequest.ts"],"names":[],"mappings":"AAAA,gEAAgE"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * podcastId: "podcastId"
5
- * }
6
- */
7
- export interface ListPodcastSegmentsRequest {
8
- /** - The ID of the podcast */
9
- podcastId: string;
10
- }
11
- //# sourceMappingURL=ListPodcastSegmentsRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPodcastSegmentsRequest.d.ts","sourceRoot":"","sources":["../../../../../../src/api/resources/segments/client/requests/ListPodcastSegmentsRequest.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACvC,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;CACrB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPodcastSegmentsRequest.js","sourceRoot":"","sources":["../../../../../../src/api/resources/segments/client/requests/ListPodcastSegmentsRequest.ts"],"names":[],"mappings":"AAAA,gEAAgE"}
@@ -1,17 +0,0 @@
1
- import type * as Ichos from "../index.js";
2
- export type AudioEntityLink = Ichos.AudioEntityLink.Episode | Ichos.AudioEntityLink.Ad | Ichos.AudioEntityLink.Segment;
3
- export declare namespace AudioEntityLink {
4
- interface Episode {
5
- type: "episode";
6
- id: string;
7
- }
8
- interface Ad {
9
- type: "ad";
10
- id: string;
11
- }
12
- interface Segment {
13
- type: "segment";
14
- id: string;
15
- }
16
- }
17
- //# sourceMappingURL=AudioEntityLink.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioEntityLink.d.ts","sourceRoot":"","sources":["../../../src/api/types/AudioEntityLink.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC;AAEvH,yBAAiB,eAAe,CAAC;IAC7B,UAAiB,OAAO;QACpB,IAAI,EAAE,SAAS,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,EAAE;QACf,IAAI,EAAE,IAAI,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,OAAO;QACpB,IAAI,EAAE,SAAS,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACd;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioEntityLink.js","sourceRoot":"","sources":["../../../src/api/types/AudioEntityLink.ts"],"names":[],"mappings":"AAAA,gEAAgE"}
@@ -1,23 +0,0 @@
1
- import type * as Ichos from "../index.js";
2
- export interface AudioPullStatusResponse {
3
- success: boolean;
4
- data: AudioPullStatusResponse.Data;
5
- meta: Ichos.ApiMetaSuccess;
6
- }
7
- export declare namespace AudioPullStatusResponse {
8
- interface Data {
9
- status: Data.Status;
10
- }
11
- namespace Data {
12
- const Status: {
13
- readonly Uploading: "uploading";
14
- readonly Pulling: "pulling";
15
- readonly PullFailed: "pull_failed";
16
- readonly Processing: "processing";
17
- readonly Done: "done";
18
- readonly Failed: "failed";
19
- };
20
- type Status = (typeof Status)[keyof typeof Status];
21
- }
22
- }
23
- //# sourceMappingURL=AudioPullStatusResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioPullStatusResponse.d.ts","sourceRoot":"","sources":["../../../src/api/types/AudioPullStatusResponse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IACnC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;CAC9B;AAED,yBAAiB,uBAAuB,CAAC;IACrC,UAAiB,IAAI;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;KACvB;IAED,UAAiB,IAAI,CAAC;QACX,MAAM,MAAM;;;;;;;SAOT,CAAC;QACX,KAAY,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;KAC7D;CACJ"}