Skip to content

Commit

Permalink
chore(internal): codegen related update (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Feb 4, 2025
1 parent 1ca421c commit 81fe307
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ export interface ClientOptions {
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
* much longer than this timeout before the promise succeeds or fails.
*/
timeout?: number;
timeout?: number | undefined;

/**
* An HTTP agent used to manage HTTP(S) connections.
*
* If not provided, an agent will be constructed by default in the Node.js environment,
* otherwise no agent is used.
*/
httpAgent?: Agent;
httpAgent?: Agent | undefined;

/**
* Specify a custom `fetch` function implementation.
Expand All @@ -82,23 +82,23 @@ export interface ClientOptions {
*
* @default 2
*/
maxRetries?: number;
maxRetries?: number | undefined;

/**
* Default headers to include with every request to the API.
*
* These can be removed in individual requests by explicitly setting the
* header to `undefined` or `null` in request options.
*/
defaultHeaders?: Core.Headers;
defaultHeaders?: Core.Headers | undefined;

/**
* Default query parameters to include with every request to the API.
*
* These can be removed in individual requests by explicitly setting the
* param to `undefined` in request options.
*/
defaultQuery?: Core.DefaultQuery;
defaultQuery?: Core.DefaultQuery | undefined;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/resources/video/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export interface Asset {
created_at: string;

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

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

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

/**
* @deprecated: Only set for the `audio` type track.
* @deprecated Only set for the `audio` type track.
*/
max_channel_layout?: string;

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/delivery-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface DeliveryReport {
asset_duration: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* @deprecated This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
*/
Expand Down
17 changes: 8 additions & 9 deletions src/resources/video/live-streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ export interface LiveStream {
generated_subtitles?: Array<LiveStream.GeneratedSubtitle>;

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

Expand Down Expand Up @@ -415,10 +415,9 @@ export interface LiveStream {
reconnect_window?: number;

/**
* @deprecated: This field is deprecated. Please use `latency_mode` instead.
* Latency is the time from when the streamer transmits a frame of video to when
* you see it in the player. Set this if you want lower latency for your live
* stream. See the
* @deprecated This field is deprecated. Please use `latency_mode` instead. Latency
* is the time from when the streamer transmits a frame of video to when you see it
* in the player. Set this if you want lower latency for your live stream. See the
* [Reduce live stream latency guide](https://docs.mux.com/guides/reduce-live-stream-latency)
* to understand the tradeoffs.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/resources/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
asset_duration?: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* @deprecated This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('resource transcriptionVocabularies', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.video.transcriptionVocabularies.list(
{ limit: 0, page: 0 },
{ limit: 10, page: 0 },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Mux.NotFoundError);
Expand Down
10 changes: 10 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ describe('instantiate client', () => {
expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true });
});

test('explicit global fetch', async () => {
// make sure the global fetch type is assignable to our Fetch type
const client = new Mux({
baseURL: 'http://localhost:5000/',
tokenId: 'my token id',
tokenSecret: 'my secret',
fetch: defaultFetch,
});
});

test('custom signal', async () => {
const client = new Mux({
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
Expand Down

0 comments on commit 81fe307

Please sign in to comment.