Skip to content

Commit b0afeef

Browse files
release: 11.0.2 (#575)
* docs: Document add-asset-track requirements a little more (#338) (#574) * fix(client): send `X-Stainless-Timeout` in seconds (#576) * chore(internal): add aliases for Record and Array (#577) * fix(api): improve type resolution when importing as a package (#578) * fix(mcp): remove unused tools.ts (#579) * chore(tests): improve enum examples (#580) * fix: add `audio-only` enum option in `resolution_tier` for Static Rendition responses (#339) (#581) * chore(internal): upload builds and expand CI branch coverage (#582) * chore(internal): reduce CI branch coverage * docs: change video to asset in metadata docs (#340) * chore(client): minor internal fixes * release: 11.0.2 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent c3abe37 commit b0afeef

File tree

12 files changed

+124
-46
lines changed

12 files changed

+124
-46
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
16-
1715
steps:
1816
- uses: actions/checkout@v4
1917

@@ -31,8 +29,9 @@ jobs:
3129
build:
3230
name: build
3331
runs-on: ubuntu-latest
34-
35-
32+
permissions:
33+
contents: read
34+
id-token: write
3635
steps:
3736
- uses: actions/checkout@v4
3837

@@ -46,10 +45,24 @@ jobs:
4645

4746
- name: Check build
4847
run: ./scripts/build
48+
49+
- name: Get GitHub OIDC Token
50+
if: github.repository == 'stainless-sdks/mux-node'
51+
id: github-oidc
52+
uses: actions/github-script@v6
53+
with:
54+
script: core.setOutput('github_token', await core.getIDToken());
55+
56+
- name: Upload tarball
57+
if: github.repository == 'stainless-sdks/mux-node'
58+
env:
59+
URL: https://pkg.stainless.com/s
60+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
61+
SHA: ${{ github.sha }}
62+
run: ./scripts/utils/upload-artifact.sh
4963
test:
5064
name: test
5165
runs-on: ubuntu-latest
52-
5366
steps:
5467
- uses: actions/checkout@v4
5568

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "11.0.1"
2+
".": "11.0.2"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 88
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-c82f962313c7a8512450ffab731fffa6a295de3cb666cf3afcebc56191439e19.yml
3-
openapi_spec_hash: a9cee3d6aa6af1fe8b0c1de7b713a8fc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-7f3ef26966f06eab76abd513d5654c7059b84e47125b834fa8073d46ff005eb3.yml
3+
openapi_spec_hash: 648e3026f149d4a0291ee04915e26aea
44
config_hash: f941b9f1f7c0d16e4e150799bd13f5b1

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## 11.0.2 (2025-04-14)
4+
5+
Full Changelog: [v11.0.1...v11.0.2](https://github.com/muxinc/mux-node-sdk/compare/v11.0.1...v11.0.2)
6+
7+
### Bug Fixes
8+
9+
* add `audio-only` enum option in `resolution_tier` for Static Rendition responses ([#339](https://github.com/muxinc/mux-node-sdk/issues/339)) ([#581](https://github.com/muxinc/mux-node-sdk/issues/581)) ([08a6aed](https://github.com/muxinc/mux-node-sdk/commit/08a6aedb36689e9857603405a8f680ea00874215))
10+
* **api:** improve type resolution when importing as a package ([#578](https://github.com/muxinc/mux-node-sdk/issues/578)) ([eaa6190](https://github.com/muxinc/mux-node-sdk/commit/eaa6190a2d8615cae7497076b5b484bf7a17bbd0))
11+
* **client:** send `X-Stainless-Timeout` in seconds ([#576](https://github.com/muxinc/mux-node-sdk/issues/576)) ([365f84d](https://github.com/muxinc/mux-node-sdk/commit/365f84d3950de97ddf05d1e417d2284dfb7063b6))
12+
* **mcp:** remove unused tools.ts ([#579](https://github.com/muxinc/mux-node-sdk/issues/579)) ([65b514b](https://github.com/muxinc/mux-node-sdk/commit/65b514bf697ba0de7d144174d516940c91e53869))
13+
14+
15+
### Chores
16+
17+
* **client:** minor internal fixes ([b991d1e](https://github.com/muxinc/mux-node-sdk/commit/b991d1eaae02f6a368c5fcbc7aef615ab24c7726))
18+
* **internal:** add aliases for Record and Array ([#577](https://github.com/muxinc/mux-node-sdk/issues/577)) ([ae647ce](https://github.com/muxinc/mux-node-sdk/commit/ae647ced0dc096d78d0487c5aab272424bb7a9ae))
19+
* **internal:** reduce CI branch coverage ([e015341](https://github.com/muxinc/mux-node-sdk/commit/e01534171f4e55eba0602782a75aef917461c3ed))
20+
* **internal:** upload builds and expand CI branch coverage ([#582](https://github.com/muxinc/mux-node-sdk/issues/582)) ([e61097a](https://github.com/muxinc/mux-node-sdk/commit/e61097a30d72011f248e13ef15c53ba6c8ff5803))
21+
* **tests:** improve enum examples ([#580](https://github.com/muxinc/mux-node-sdk/issues/580)) ([9519087](https://github.com/muxinc/mux-node-sdk/commit/9519087018d6aacf81981a9c0785cd7747661f2c))
22+
23+
24+
### Documentation
25+
26+
* change video to asset in metadata docs ([#340](https://github.com/muxinc/mux-node-sdk/issues/340)) ([cc9a980](https://github.com/muxinc/mux-node-sdk/commit/cc9a98088586e56872af9923154f0c4f7c1be5f4))
27+
* Document add-asset-track requirements a little more ([#338](https://github.com/muxinc/mux-node-sdk/issues/338)) ([#574](https://github.com/muxinc/mux-node-sdk/issues/574)) ([21bbfa3](https://github.com/muxinc/mux-node-sdk/commit/21bbfa3f2a531229b8ef80bab877849eb0c6ff35))
28+
329
## 11.0.1 (2025-04-01)
430

531
Full Changelog: [v11.0.0...v11.0.1](https://github.com/muxinc/mux-node-sdk/compare/v11.0.0...v11.0.1)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mux/mux-node",
3-
"version": "11.0.1",
3+
"version": "11.0.2",
44
"description": "The official TypeScript library for the Mux API",
55
"author": "Mux <[email protected]>",
66
"types": "dist/index.d.ts",

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21+
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/mux-node/$SHA'\033[0m"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/core.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ export {
3333

3434
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
3535

36+
/**
37+
* An alias to the builtin `Array` type so we can
38+
* easily alias it in import statements if there are name clashes.
39+
*/
40+
type _Array<T> = Array<T>;
41+
42+
/**
43+
* An alias to the builtin `Record` type so we can
44+
* easily alias it in import statements if there are name clashes.
45+
*/
46+
type _Record<K extends keyof any, T> = Record<K, T>;
47+
48+
export type { _Array as Array, _Record as Record };
49+
3650
type PromiseOrValue<T> = T | Promise<T>;
3751

3852
type APIResponseProps = {
@@ -270,10 +284,10 @@ export abstract class APIClient {
270284
}
271285

272286
buildRequest<Req>(
273-
options: FinalRequestOptions<Req>,
287+
inputOptions: FinalRequestOptions<Req>,
274288
{ retryCount = 0 }: { retryCount?: number } = {},
275289
): { req: RequestInit; url: string; timeout: number } {
276-
options = { ...options };
290+
const options = { ...inputOptions };
277291
const { method, path, query, headers: headers = {} } = options;
278292

279293
const body =
@@ -299,8 +313,8 @@ export abstract class APIClient {
299313
}
300314

301315
if (this.idempotencyHeader && method !== 'get') {
302-
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
303-
headers[this.idempotencyHeader] = options.idempotencyKey;
316+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
317+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
304318
}
305319

306320
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
@@ -357,7 +371,7 @@ export abstract class APIClient {
357371
getHeader(headers, 'x-stainless-timeout') === undefined &&
358372
options.timeout
359373
) {
360-
reqHeaders['x-stainless-timeout'] = String(options.timeout);
374+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
361375
}
362376

363377
this.validateHeaders(reqHeaders, headers);

src/resources/video/assets.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Assets extends APIResource {
8282

8383
/**
8484
* Adds an asset track (for example, subtitles, or an alternate audio track) to an
85-
* asset.
85+
* asset. Assets must be in the `ready` state before tracks can be added.
8686
*/
8787
createTrack(
8888
assetId: string,
@@ -449,19 +449,19 @@ export namespace Asset {
449449
*/
450450
export interface Meta {
451451
/**
452-
* This is an identifier you provide to keep track of the creator of the video. Max
452+
* This is an identifier you provide to keep track of the creator of the asset. Max
453453
* 128 code points.
454454
*/
455455
creator_id?: string;
456456

457457
/**
458-
* This is an identifier you provide to link the video to your own data. Max 128
458+
* This is an identifier you provide to link the asset to your own data. Max 128
459459
* code points.
460460
*/
461461
external_id?: string;
462462

463463
/**
464-
* The video title. Max 512 code points.
464+
* The asset title. Max 512 code points.
465465
*/
466466
title?: string;
467467
}
@@ -655,7 +655,7 @@ export namespace Asset {
655655
* Indicates the resolution tier of this specific MP4 version of this asset. This
656656
* field is only valid for `static_renditions`, not for `mp4_support`.
657657
*/
658-
resolution_tier?: '2160p' | '1440p' | '1080p' | '720p';
658+
resolution_tier?: '2160p' | '1440p' | '1080p' | '720p' | 'audio-only';
659659

660660
/**
661661
* Indicates the status of this specific MP4 version of this asset. This field is
@@ -1288,19 +1288,19 @@ export namespace AssetOptions {
12881288
*/
12891289
export interface Meta {
12901290
/**
1291-
* This is an identifier you provide to keep track of the creator of the video. Max
1291+
* This is an identifier you provide to keep track of the creator of the asset. Max
12921292
* 128 code points.
12931293
*/
12941294
creator_id?: string;
12951295

12961296
/**
1297-
* This is an identifier you provide to link the video to your own data. Max 128
1297+
* This is an identifier you provide to link the asset to your own data. Max 128
12981298
* code points.
12991299
*/
13001300
external_id?: string;
13011301

13021302
/**
1303-
* The video title. Max 512 code points.
1303+
* The asset title. Max 512 code points.
13041304
*/
13051305
title?: string;
13061306
}
@@ -2305,19 +2305,19 @@ export namespace AssetCreateParams {
23052305
*/
23062306
export interface Meta {
23072307
/**
2308-
* This is an identifier you provide to keep track of the creator of the video. Max
2308+
* This is an identifier you provide to keep track of the creator of the asset. Max
23092309
* 128 code points.
23102310
*/
23112311
creator_id?: string;
23122312

23132313
/**
2314-
* This is an identifier you provide to link the video to your own data. Max 128
2314+
* This is an identifier you provide to link the asset to your own data. Max 128
23152315
* code points.
23162316
*/
23172317
external_id?: string;
23182318

23192319
/**
2320-
* The video title. Max 512 code points.
2320+
* The asset title. Max 512 code points.
23212321
*/
23222322
title?: string;
23232323
}
@@ -2371,19 +2371,19 @@ export namespace AssetUpdateParams {
23712371
*/
23722372
export interface Meta {
23732373
/**
2374-
* This is an identifier you provide to keep track of the creator of the video. Max
2374+
* This is an identifier you provide to keep track of the creator of the asset. Max
23752375
* 128 code points.
23762376
*/
23772377
creator_id?: string;
23782378

23792379
/**
2380-
* This is an identifier you provide to link the video to your own data. Max 128
2380+
* This is an identifier you provide to link the asset to your own data. Max 128
23812381
* code points.
23822382
*/
23832383
external_id?: string;
23842384

23852385
/**
2386-
* The video title. Max 512 code points.
2386+
* The asset title. Max 512 code points.
23872387
*/
23882388
title?: string;
23892389
}

src/resources/video/live-streams.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,19 +929,19 @@ export namespace LiveStreamUpdateParams {
929929
*/
930930
export interface Meta {
931931
/**
932-
* This is an identifier you provide to keep track of the creator of the video. Max
932+
* This is an identifier you provide to keep track of the creator of the asset. Max
933933
* 128 code points.
934934
*/
935935
creator_id?: string;
936936

937937
/**
938-
* This is an identifier you provide to link the video to your own data. Max 128
938+
* This is an identifier you provide to link the asset to your own data. Max 128
939939
* code points.
940940
*/
941941
external_id?: string;
942942

943943
/**
944-
* The video title. Max 512 code points.
944+
* The asset title. Max 512 code points.
945945
*/
946946
title?: string;
947947
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '11.0.1'; // x-release-please-version
1+
export const VERSION = '11.0.2'; // x-release-please-version

0 commit comments

Comments
 (0)