Skip to content

Commit c8aedba

Browse files
chore(internal): codegen related update (#541)
1 parent 39c5363 commit c8aedba

File tree

7 files changed

+30
-21
lines changed

7 files changed

+30
-21
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ export interface ClientOptions {
5858
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
5959
* much longer than this timeout before the promise succeeds or fails.
6060
*/
61-
timeout?: number;
61+
timeout?: number | undefined;
6262

6363
/**
6464
* An HTTP agent used to manage HTTP(S) connections.
6565
*
6666
* If not provided, an agent will be constructed by default in the Node.js environment,
6767
* otherwise no agent is used.
6868
*/
69-
httpAgent?: Agent;
69+
httpAgent?: Agent | undefined;
7070

7171
/**
7272
* Specify a custom `fetch` function implementation.
@@ -82,23 +82,23 @@ export interface ClientOptions {
8282
*
8383
* @default 2
8484
*/
85-
maxRetries?: number;
85+
maxRetries?: number | undefined;
8686

8787
/**
8888
* Default headers to include with every request to the API.
8989
*
9090
* These can be removed in individual requests by explicitly setting the
9191
* header to `undefined` or `null` in request options.
9292
*/
93-
defaultHeaders?: Core.Headers;
93+
defaultHeaders?: Core.Headers | undefined;
9494

9595
/**
9696
* Default query parameters to include with every request to the API.
9797
*
9898
* These can be removed in individual requests by explicitly setting the
9999
* param to `undefined` in request options.
100100
*/
101-
defaultQuery?: Core.DefaultQuery;
101+
defaultQuery?: Core.DefaultQuery | undefined;
102102
}
103103

104104
/**

src/resources/video/assets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export interface Asset {
225225
created_at: string;
226226

227227
/**
228-
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
228+
* @deprecated This field is deprecated. Please use `video_quality` instead. The
229229
* encoding tier informs the cost, quality, and available platform features for the
230230
* asset. The default encoding tier for an account can be set in the Mux Dashboard.
231231
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
@@ -297,7 +297,7 @@ export interface Asset {
297297
max_stored_frame_rate?: number;
298298

299299
/**
300-
* @deprecated: This field is deprecated. Please use `resolution_tier` instead. The
300+
* @deprecated This field is deprecated. Please use `resolution_tier` instead. The
301301
* maximum resolution that has been stored for the asset. The asset may be
302302
* delivered at lower resolutions depending on the device and bandwidth, however it
303303
* cannot be delivered at a higher value than is stored.
@@ -581,7 +581,7 @@ export interface AssetOptions {
581581
advanced_playback_policies?: Array<AssetOptions.AdvancedPlaybackPolicy>;
582582

583583
/**
584-
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
584+
* @deprecated This field is deprecated. Please use `video_quality` instead. The
585585
* encoding tier informs the cost, quality, and available platform features for the
586586
* asset. The default encoding tier for an account can be set in the Mux Dashboard.
587587
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
@@ -1210,7 +1210,7 @@ export interface Track {
12101210
language_code?: string;
12111211

12121212
/**
1213-
* @deprecated: Only set for the `audio` type track.
1213+
* @deprecated Only set for the `audio` type track.
12141214
*/
12151215
max_channel_layout?: string;
12161216

src/resources/video/delivery-usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface DeliveryReport {
3838
asset_duration: number;
3939

4040
/**
41-
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
41+
* @deprecated This field is deprecated. Please use `asset_video_quality` instead.
4242
* The encoding tier that the asset was ingested at.
4343
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
4444
*/

src/resources/video/live-streams.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ export interface LiveStream {
358358
generated_subtitles?: Array<LiveStream.GeneratedSubtitle>;
359359

360360
/**
361-
* @deprecated: This field is deprecated. Please use `latency_mode` instead.
362-
* Latency is the time from when the streamer transmits a frame of video to when
363-
* you see it in the player. Setting this option will enable compatibility with the
364-
* LL-HLS specification for low-latency streaming. This typically has lower latency
365-
* than Reduced Latency streams, and cannot be combined with Reduced Latency.
361+
* @deprecated This field is deprecated. Please use `latency_mode` instead. Latency
362+
* is the time from when the streamer transmits a frame of video to when you see it
363+
* in the player. Setting this option will enable compatibility with the LL-HLS
364+
* specification for low-latency streaming. This typically has lower latency than
365+
* Reduced Latency streams, and cannot be combined with Reduced Latency.
366366
*/
367367
low_latency?: boolean;
368368

@@ -415,10 +415,9 @@ export interface LiveStream {
415415
reconnect_window?: number;
416416

417417
/**
418-
* @deprecated: This field is deprecated. Please use `latency_mode` instead.
419-
* Latency is the time from when the streamer transmits a frame of video to when
420-
* you see it in the player. Set this if you want lower latency for your live
421-
* stream. See the
418+
* @deprecated This field is deprecated. Please use `latency_mode` instead. Latency
419+
* is the time from when the streamer transmits a frame of video to when you see it
420+
* in the player. Set this if you want lower latency for your live stream. See the
422421
* [Reduce live stream latency guide](https://docs.mux.com/guides/reduce-live-stream-latency)
423422
* to understand the tradeoffs.
424423
*/

src/resources/webhooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
393393
asset_duration?: number;
394394

395395
/**
396-
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
396+
* @deprecated This field is deprecated. Please use `asset_video_quality` instead.
397397
* The encoding tier that the asset was ingested at.
398398
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
399399
*/

tests/api-resources/video/transcription-vocabularies.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('resource transcriptionVocabularies', () => {
9494
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9595
await expect(
9696
client.video.transcriptionVocabularies.list(
97-
{ limit: 0, page: 0 },
97+
{ limit: 10, page: 0 },
9898
{ path: '/_stainless_unknown_path' },
9999
),
100100
).rejects.toThrow(Mux.NotFoundError);

tests/index.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ describe('instantiate client', () => {
101101
expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true });
102102
});
103103

104+
test('explicit global fetch', async () => {
105+
// make sure the global fetch type is assignable to our Fetch type
106+
const client = new Mux({
107+
baseURL: 'http://localhost:5000/',
108+
tokenId: 'my token id',
109+
tokenSecret: 'my secret',
110+
fetch: defaultFetch,
111+
});
112+
});
113+
104114
test('custom signal', async () => {
105115
const client = new Mux({
106116
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',

0 commit comments

Comments
 (0)