@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.
- package/dist/Client.d.ts +2 -2
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +4 -4
- package/dist/Client.js.map +1 -1
- package/dist/api/errors/BadRequestError.d.ts +7 -0
- package/dist/api/errors/BadRequestError.d.ts.map +1 -0
- package/dist/api/errors/BadRequestError.js +18 -0
- package/dist/api/errors/BadRequestError.js.map +1 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.d.ts.map +1 -1
- package/dist/api/errors/index.js +1 -0
- package/dist/api/errors/index.js.map +1 -1
- package/dist/api/resources/audio/client/Client.d.ts +5 -41
- package/dist/api/resources/audio/client/Client.d.ts.map +1 -1
- package/dist/api/resources/audio/client/Client.js +16 -127
- package/dist/api/resources/audio/client/Client.js.map +1 -1
- package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts +10 -0
- package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.d.ts.map +1 -0
- package/dist/api/resources/{segments/client/requests/ListPodcastSegmentsRequest.js → audio/client/requests/GenerateAudioUploadUrlRequest.js} +1 -1
- package/dist/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.js.map +1 -0
- package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts +2 -0
- package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts.map +1 -1
- package/dist/api/resources/audio/client/requests/index.d.ts +1 -2
- package/dist/api/resources/audio/client/requests/index.d.ts.map +1 -1
- package/dist/api/resources/audio/index.d.ts +1 -0
- package/dist/api/resources/audio/index.d.ts.map +1 -1
- package/dist/api/resources/audio/index.js +1 -0
- package/dist/api/resources/audio/index.js.map +1 -1
- package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts +7 -0
- package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.d.ts.map +1 -0
- package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js +7 -0
- package/dist/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.js.map +1 -0
- package/dist/api/resources/audio/types/index.d.ts +2 -0
- package/dist/api/resources/audio/types/index.d.ts.map +1 -0
- package/dist/api/resources/audio/types/index.js +2 -0
- package/dist/api/resources/audio/types/index.js.map +1 -0
- package/dist/api/resources/episodes/client/Client.d.ts +4 -1
- package/dist/api/resources/episodes/client/Client.d.ts.map +1 -1
- package/dist/api/resources/episodes/client/Client.js +4 -1
- package/dist/api/resources/episodes/client/Client.js.map +1 -1
- package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts +1 -1
- package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts.map +1 -1
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.d.ts.map +1 -1
- package/dist/api/resources/index.js +2 -0
- package/dist/api/resources/index.js.map +1 -1
- package/dist/api/resources/organizations/client/Client.d.ts +0 -13
- package/dist/api/resources/organizations/client/Client.d.ts.map +1 -1
- package/dist/api/resources/organizations/client/Client.js +0 -56
- package/dist/api/resources/organizations/client/Client.js.map +1 -1
- package/dist/api/resources/podcasts/client/Client.d.ts +5 -3
- package/dist/api/resources/podcasts/client/Client.d.ts.map +1 -1
- package/dist/api/resources/podcasts/client/Client.js +4 -2
- package/dist/api/resources/podcasts/client/Client.js.map +1 -1
- package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts +6 -4
- package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts.map +1 -1
- package/dist/api/resources/podcasts/client/requests/PodcastCreate.js.map +1 -1
- package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts +4 -1
- package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts.map +1 -1
- package/dist/api/resources/podcasts/client/requests/PodcastUpdate.js.map +1 -1
- package/dist/api/resources/segments/client/Client.d.ts +7 -21
- package/dist/api/resources/segments/client/Client.d.ts.map +1 -1
- package/dist/api/resources/segments/client/Client.js +18 -65
- package/dist/api/resources/segments/client/Client.js.map +1 -1
- package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts +12 -0
- package/dist/api/resources/segments/client/requests/ListSegmentsRequest.d.ts.map +1 -0
- package/dist/api/{types/EpisodeSearchParams.js → resources/segments/client/requests/ListSegmentsRequest.js} +1 -1
- package/dist/api/resources/segments/client/requests/ListSegmentsRequest.js.map +1 -0
- package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts +25 -4
- package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts.map +1 -1
- package/dist/api/resources/segments/client/requests/SegmentCreate.js +8 -1
- package/dist/api/resources/segments/client/requests/SegmentCreate.js.map +1 -1
- package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts +25 -4
- package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts.map +1 -1
- package/dist/api/resources/segments/client/requests/SegmentUpdate.js +8 -1
- package/dist/api/resources/segments/client/requests/SegmentUpdate.js.map +1 -1
- package/dist/api/resources/segments/client/requests/index.d.ts +1 -1
- package/dist/api/resources/segments/client/requests/index.d.ts.map +1 -1
- package/dist/api/resources/segments/index.d.ts +1 -0
- package/dist/api/resources/segments/index.d.ts.map +1 -1
- package/dist/api/resources/segments/index.js +1 -0
- package/dist/api/resources/segments/index.js.map +1 -1
- package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts +7 -0
- package/dist/api/resources/segments/types/ListSegmentsRequestScope.d.ts.map +1 -0
- package/dist/api/resources/segments/types/ListSegmentsRequestScope.js +7 -0
- package/dist/api/resources/segments/types/ListSegmentsRequestScope.js.map +1 -0
- package/dist/api/resources/segments/types/index.d.ts +2 -0
- package/dist/api/resources/segments/types/index.d.ts.map +1 -0
- package/dist/api/resources/segments/types/index.js +2 -0
- package/dist/api/resources/segments/types/index.js.map +1 -0
- package/dist/api/resources/users/client/Client.d.ts +3 -0
- package/dist/api/resources/users/client/Client.d.ts.map +1 -1
- package/dist/api/resources/users/client/Client.js +3 -0
- package/dist/api/resources/users/client/Client.js.map +1 -1
- package/dist/api/types/Audio.d.ts +11 -2
- package/dist/api/types/Audio.d.ts.map +1 -1
- package/dist/api/types/Audio.js +1 -0
- package/dist/api/types/Audio.js.map +1 -1
- package/dist/api/types/BadRequestErrorBody.d.ts +9 -0
- package/dist/api/types/BadRequestErrorBody.d.ts.map +1 -0
- package/dist/api/{resources/audio/client/requests/GetAudioPullStatusRequest.js → types/BadRequestErrorBody.js} +1 -1
- package/dist/api/types/BadRequestErrorBody.js.map +1 -0
- package/dist/api/types/Chapter.d.ts +3 -0
- package/dist/api/types/Chapter.d.ts.map +1 -1
- package/dist/api/types/LinkTo.d.ts +13 -0
- package/dist/api/types/LinkTo.d.ts.map +1 -0
- package/dist/api/types/LinkTo.js +10 -0
- package/dist/api/types/LinkTo.js.map +1 -0
- package/dist/api/types/Podcast.d.ts +2 -1
- package/dist/api/types/Podcast.d.ts.map +1 -1
- package/dist/api/types/Podcast.js.map +1 -1
- package/dist/api/types/PodcastCreateResponseData.d.ts +2 -1
- package/dist/api/types/PodcastCreateResponseData.d.ts.map +1 -1
- package/dist/api/types/PodcastCreateResponseData.js.map +1 -1
- package/dist/api/types/PublishPodcastResponse.d.ts +7 -0
- package/dist/api/types/PublishPodcastResponse.d.ts.map +1 -0
- package/dist/api/{resources/audio/client/requests/FinalizeAudioUploadRequest.js → types/PublishPodcastResponse.js} +1 -1
- package/dist/api/types/PublishPodcastResponse.js.map +1 -0
- package/dist/api/types/{EpisodeSearchParams.d.ts → SearchParams.d.ts} +4 -4
- package/dist/api/types/SearchParams.d.ts.map +1 -0
- package/dist/api/types/{AudioEntityLink.js → SearchParams.js} +1 -1
- package/dist/api/types/SearchParams.js.map +1 -0
- package/dist/api/types/Segment.d.ts +1 -2
- package/dist/api/types/Segment.d.ts.map +1 -1
- package/dist/api/types/Segment.js +1 -1
- package/dist/api/types/Segment.js.map +1 -1
- package/dist/api/types/index.d.ts +4 -3
- package/dist/api/types/index.d.ts.map +1 -1
- package/dist/api/types/index.js +4 -3
- package/dist/api/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Client.ts +5 -5
- package/src/api/errors/BadRequestError.ts +22 -0
- package/src/api/errors/index.ts +1 -0
- package/src/api/resources/audio/client/Client.ts +18 -182
- package/src/api/resources/audio/client/requests/GenerateAudioUploadUrlRequest.ts +12 -0
- package/src/api/resources/audio/client/requests/PullAudioDto.ts +3 -0
- package/src/api/resources/audio/client/requests/index.ts +1 -2
- package/src/api/resources/audio/index.ts +1 -0
- package/src/api/resources/audio/types/GenerateAudioUploadUrlRequestLinkTo.ts +9 -0
- package/src/api/resources/audio/types/index.ts +1 -0
- package/src/api/resources/episodes/client/Client.ts +4 -1
- package/src/api/resources/episodes/client/requests/EpisodeUpdate.ts +1 -1
- package/src/api/resources/index.ts +2 -0
- package/src/api/resources/organizations/client/Client.ts +0 -89
- package/src/api/resources/podcasts/client/Client.ts +7 -5
- package/src/api/resources/podcasts/client/requests/PodcastCreate.ts +6 -4
- package/src/api/resources/podcasts/client/requests/PodcastUpdate.ts +4 -1
- package/src/api/resources/segments/client/Client.ts +22 -98
- package/src/api/resources/segments/client/requests/ListSegmentsRequest.ts +14 -0
- package/src/api/resources/segments/client/requests/SegmentCreate.ts +26 -4
- package/src/api/resources/segments/client/requests/SegmentUpdate.ts +26 -4
- package/src/api/resources/segments/client/requests/index.ts +1 -1
- package/src/api/resources/segments/index.ts +1 -0
- package/src/api/resources/segments/types/ListSegmentsRequestScope.ts +8 -0
- package/src/api/resources/segments/types/index.ts +1 -0
- package/src/api/resources/users/client/Client.ts +3 -0
- package/src/api/types/Audio.ts +11 -2
- package/src/api/types/BadRequestErrorBody.ts +10 -0
- package/src/api/types/Chapter.ts +3 -0
- package/src/api/types/LinkTo.ts +15 -0
- package/src/api/types/Podcast.ts +2 -1
- package/src/api/types/PodcastCreateResponseData.ts +2 -1
- package/src/api/types/PublishPodcastResponse.ts +9 -0
- package/src/api/types/{EpisodeSearchParams.ts → SearchParams.ts} +3 -3
- package/src/api/types/Segment.ts +1 -2
- package/src/api/types/index.ts +4 -3
- package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts +0 -17
- package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts.map +0 -1
- package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.js.map +0 -1
- package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts +0 -11
- package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts.map +0 -1
- package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.js.map +0 -1
- package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts +0 -11
- package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts.map +0 -1
- package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.js.map +0 -1
- package/dist/api/types/AudioEntityLink.d.ts +0 -17
- package/dist/api/types/AudioEntityLink.d.ts.map +0 -1
- package/dist/api/types/AudioEntityLink.js.map +0 -1
- package/dist/api/types/AudioPullStatusResponse.d.ts +0 -23
- package/dist/api/types/AudioPullStatusResponse.d.ts.map +0 -1
- package/dist/api/types/AudioPullStatusResponse.js +0 -16
- package/dist/api/types/AudioPullStatusResponse.js.map +0 -1
- package/dist/api/types/EpisodeSearchParams.d.ts.map +0 -1
- package/dist/api/types/EpisodeSearchParams.js.map +0 -1
- package/src/api/resources/audio/client/requests/FinalizeAudioUploadRequest.ts +0 -19
- package/src/api/resources/audio/client/requests/GetAudioPullStatusRequest.ts +0 -12
- package/src/api/resources/segments/client/requests/ListPodcastSegmentsRequest.ts +0 -12
- package/src/api/types/AudioEntityLink.ts +0 -22
- 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,6 +1,5 @@
|
|
|
1
1
|
export type { DeleteAudioRequest } from "./DeleteAudioRequest.js";
|
|
2
|
-
export type {
|
|
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";
|
|
@@ -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
|
-
*
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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;
|