Skip to content

Commit 48ea1b5

Browse files
release: 12.0.0 (#586)
* feat: Add progress API fields to the asset model (#328) * chore(docs): grammar improvements * chore: configure new SDK language * chore(api): remove webhooks from mcp * feat: Add live stream metadata (#351) * chore: improve docs for MCP servers * fix(mcp): fix cursor schema transformation issue with recursive references * fix(mcp): include description in dynamic tool search * chore: improve publish-npm script --latest tag logic * feat(mcp): include http information in tools * chore(mcp): remove duplicate assignment * chore(api): mark some methods as deprecated * docs(pagination): improve naming * chore(docs): use top-level-await in example snippets * feat(mcp): implement support for binary responses * chore(mcp): provides high-level initMcpServer function and exports known clients * fix: publish script — handle NPM errors correctly * chore(internal): make base APIResource abstract * feat(mcp): set X-Stainless-MCP header * feat(client): add support for endpoint-specific base URLs * chore(ci): enable for pull requests * fix(client): correct webhooks types * refactor(types): replace Record with mapped types * fix(ci): release-doctor — report correct token name * feat(mcp): fallback for void-typed methods * chore: upgrade node in upload step (#354) * codegen metadata * chore(ci): only run for pushes and fork pull requests * codegen metadata * feat(api): expose playback APIs * codegen metadata * codegen metadata * chore: bump node to 22 in tool-versions * feat: add new copy_overlays asset option (#355) * update node in actions steps * chore: update mcp package name * release: 12.0.0 * update changelog --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Justin Sanford <[email protected]>
1 parent 9cd9b86 commit 48ea1b5

File tree

169 files changed

+15837
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+15837
-266
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,24 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/mux-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

1924
- name: Set up Node
2025
uses: actions/setup-node@v4
2126
with:
22-
node-version: '18'
27+
node-version: '22'
2328

2429
- name: Bootstrap
2530
run: ./scripts/bootstrap
@@ -31,6 +36,7 @@ jobs:
3136
timeout-minutes: 5
3237
name: build
3338
runs-on: ${{ github.repository == 'stainless-sdks/mux-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3440
permissions:
3541
contents: read
3642
id-token: write
@@ -40,7 +46,7 @@ jobs:
4046
- name: Set up Node
4147
uses: actions/setup-node@v4
4248
with:
43-
node-version: '18'
49+
node-version: '22'
4450

4551
- name: Bootstrap
4652
run: ./scripts/bootstrap
@@ -66,16 +72,20 @@ jobs:
6672
timeout-minutes: 10
6773
name: test
6874
runs-on: ${{ github.repository == 'stainless-sdks/mux-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
75+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
6976
steps:
7077
- uses: actions/checkout@v4
7178

7279
- name: Set up Node
7380
uses: actions/setup-node@v4
7481
with:
75-
node-version: '20'
82+
node-version: '22'
7683

7784
- name: Bootstrap
7885
run: ./scripts/bootstrap
7986

87+
- name: Build
88+
run: ./scripts/build
89+
8090
- name: Run tests
8191
run: ./scripts/test

.github/workflows/publish-npm.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
name: Publish NPM
55
on:
66
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
711

812
release:
913
types: [published]
@@ -17,16 +21,21 @@ jobs:
1721
- uses: actions/checkout@v4
1822

1923
- name: Set up Node
20-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2125
with:
22-
node-version: '20'
26+
node-version: '22'
2327

2428
- name: Install dependencies
2529
run: |
2630
yarn install
2731
2832
- name: Publish to NPM
2933
run: |
30-
bash ./bin/publish-npm
34+
if [ -n "${{ github.event.inputs.path }}" ]; then
35+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
36+
else
37+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
38+
fi
39+
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
3140
env:
3241
NPM_TOKEN: ${{ secrets.MUX_NPM_TOKEN || secrets.NPM_TOKEN }}

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ CHANGELOG.md
44
/deno
55

66
# don't format tsc output, will break source maps
7-
/dist
7+
dist

.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.1.0"
2+
".": "12.0.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-fe7095c6cd410ecd391f6810083a35d9411a2d9772042eaefed534fd51cd9599.yml
3-
openapi_spec_hash: 104a03331ba4c7f753f583fdb852de11
4-
config_hash: 1ca6806e9f62696760dac4321fce849b
1+
configured_endpoints: 106
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-d4d7fca3b738848f0ecb2658b7a8ee82f51886dae8014266671954b980f5fdac.yml
3+
openapi_spec_hash: 0db43f6551ec879686631abbc738c9b4
4+
config_hash: 82eb9b770c0e6a5db21fab2794a26a69

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nodejs 18.17.0
1+
nodejs 22
22
yarn 1.22.22

CHANGELOG.md

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

3+
## 12.0.0 (2025-07-02)
4+
5+
Full Changelog: [v11.1.0...v12.0.0](https://github.com/muxinc/mux-node-sdk/compare/v11.1.0...v12.0.0)
6+
7+
### Features
8+
9+
* Expose methods for playback, images, captions, and transcripts
10+
* Expose MCP server in build
11+
* Add live stream metadata ([#351](https://github.com/muxinc/mux-node-sdk/issues/351)) ([4bb8e63](https://github.com/muxinc/mux-node-sdk/commit/4bb8e63a3a45330fd1a414148665796750d58eb1))
12+
* add new copy_overlays asset option ([#355](https://github.com/muxinc/mux-node-sdk/issues/355)) ([7c24f4a](https://github.com/muxinc/mux-node-sdk/commit/7c24f4a9f350568ee1a1dc8c4df54b1e4efe857d))
13+
* Add progress API fields to the asset model ([#328](https://github.com/muxinc/mux-node-sdk/issues/328)) ([0137bee](https://github.com/muxinc/mux-node-sdk/commit/0137bee04847d310dd74f957de110dda37c28891))
14+
* **api:** expose playback APIs ([8609c47](https://github.com/muxinc/mux-node-sdk/commit/8609c471e8fbfccc2a34a4e33de23fdd9e76f7ca))
15+
* **client:** add support for endpoint-specific base URLs ([e3f4bdc](https://github.com/muxinc/mux-node-sdk/commit/e3f4bdca804a846b4a87dac8c04fac26dce6798d))
16+
* **mcp:** fallback for void-typed methods ([9a9f95f](https://github.com/muxinc/mux-node-sdk/commit/9a9f95fb407f45125a4dbd052852f955f06e5115))
17+
* **mcp:** implement support for binary responses ([58d6395](https://github.com/muxinc/mux-node-sdk/commit/58d6395935e9a62463578a8c56fd861ef1bc258c))
18+
* **mcp:** include http information in tools ([24bfa89](https://github.com/muxinc/mux-node-sdk/commit/24bfa892c33d92c2ef84e5b400376f9edb979db6))
19+
* **mcp:** set X-Stainless-MCP header ([3fc5387](https://github.com/muxinc/mux-node-sdk/commit/3fc53874c819871245e6f8fe32ff4922d0d9683b))
20+
21+
22+
### Bug Fixes
23+
24+
* **ci:** release-doctor — report correct token name ([828e709](https://github.com/muxinc/mux-node-sdk/commit/828e7097c6ccc20296d02693664ec7021b835c50))
25+
* **client:** correct webhooks types ([1c7a3f2](https://github.com/muxinc/mux-node-sdk/commit/1c7a3f27cf9747801429e19d450f1103ff649599))
26+
* **mcp:** fix cursor schema transformation issue with recursive references ([f02fd01](https://github.com/muxinc/mux-node-sdk/commit/f02fd01050ad69d37110a9f7c5e2e0d4c31775ba))
27+
* **mcp:** include description in dynamic tool search ([784bb2d](https://github.com/muxinc/mux-node-sdk/commit/784bb2dc1459f2a2066a374281a8a9636d688cb7))
28+
* publish script — handle NPM errors correctly ([877dd7a](https://github.com/muxinc/mux-node-sdk/commit/877dd7afa69cc0fb4c9105c5bbacd4e0a966aa56))
29+
30+
31+
### Chores
32+
33+
* **api:** mark some methods as deprecated ([217c45e](https://github.com/muxinc/mux-node-sdk/commit/217c45e22fd03fb70bcb85c9abf2a0396eed9fe9))
34+
* **api:** remove webhooks from mcp ([f994bab](https://github.com/muxinc/mux-node-sdk/commit/f994bab88e16aaa5cfb83e58e124fbfff7e25ee3))
35+
* bump node to 22 in tool-versions ([f80b9be](https://github.com/muxinc/mux-node-sdk/commit/f80b9be030460d3808f3ffa4b2c573e280b7f6b4))
36+
* **ci:** enable for pull requests ([5c8229d](https://github.com/muxinc/mux-node-sdk/commit/5c8229dc453dc76d98c6786a0b1b39bd4385699d))
37+
* **ci:** only run for pushes and fork pull requests ([e2d4018](https://github.com/muxinc/mux-node-sdk/commit/e2d40187fdec6354f4ebb0160c352cad8b3c3b25))
38+
* configure new SDK language ([a4e9260](https://github.com/muxinc/mux-node-sdk/commit/a4e9260a4c79340fa81a77fdf98d16f373f5f1c1))
39+
* **docs:** grammar improvements ([9735730](https://github.com/muxinc/mux-node-sdk/commit/973573020303420bf493e5cb96a9fa9707a23c76))
40+
* **docs:** use top-level-await in example snippets ([20bf891](https://github.com/muxinc/mux-node-sdk/commit/20bf8915251e6cb3a6154f476de1a4198043cc6a))
41+
* improve docs for MCP servers ([252617d](https://github.com/muxinc/mux-node-sdk/commit/252617d0a4d44f5a84a4f16a082ec36bfc380208))
42+
* improve publish-npm script --latest tag logic ([ac97f0b](https://github.com/muxinc/mux-node-sdk/commit/ac97f0baca1d2feb0446b036538b7855ebaa0700))
43+
* **internal:** make base APIResource abstract ([d8287a6](https://github.com/muxinc/mux-node-sdk/commit/d8287a6f16341d3dd7e8619f85275d5b124e8c51))
44+
* **mcp:** provides high-level initMcpServer function and exports known clients ([ff89d71](https://github.com/muxinc/mux-node-sdk/commit/ff89d718e02f7b0992ef4f05752dbab01dcf0c12))
45+
* **mcp:** remove duplicate assignment ([cec01d6](https://github.com/muxinc/mux-node-sdk/commit/cec01d63d581bb35cc0588150ed3f3c7ff513b94))
46+
* update mcp package name ([3269450](https://github.com/muxinc/mux-node-sdk/commit/3269450a5a1eb57f791d93e90e7c7f098e17ff5c))
47+
* upgrade node in upload step ([#354](https://github.com/muxinc/mux-node-sdk/issues/354)) ([5873d7b](https://github.com/muxinc/mux-node-sdk/commit/5873d7bd5f855208b163f90c933f4bec8617e0d4))
48+
49+
50+
### Documentation
51+
52+
* **pagination:** improve naming ([289ee67](https://github.com/muxinc/mux-node-sdk/commit/289ee67158efa899084ffe3576c7725111014be7))
53+
54+
55+
### Refactors
56+
57+
* **types:** replace Record with mapped types ([8d7ea9c](https://github.com/muxinc/mux-node-sdk/commit/8d7ea9c1ffe3f481a70b8e883d809fd2697500e0))
58+
359
## 11.1.0 (2025-05-09)
460

561
Full Changelog: [v11.0.2...v11.1.0](https://github.com/muxinc/mux-node-sdk/compare/v11.0.2...v11.1.0)

README.md

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,14 @@ The full API of this library can be found in [api.md](api.md).
2323
```js
2424
import Mux from '@mux/mux-node';
2525

26-
const client = new Mux({
27-
tokenId: process.env['MUX_TOKEN_ID'], // This is the default and can be omitted
28-
tokenSecret: process.env['MUX_TOKEN_SECRET'], // This is the default and can be omitted
29-
});
30-
31-
async function main() {
32-
const asset = await client.video.assets.create({
33-
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
34-
playback_policies: ['public'],
35-
});
26+
const client = new Mux();
3627

37-
console.log(asset.id);
38-
}
28+
const asset = await client.video.assets.create({
29+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
30+
playback_policies: ['public'],
31+
});
3932

40-
main();
33+
console.log(asset.id);
4134
```
4235

4336
### Request & Response types
@@ -48,20 +41,13 @@ This library includes TypeScript definitions for all request params and response
4841
```ts
4942
import Mux from '@mux/mux-node';
5043

51-
const client = new Mux({
52-
tokenId: process.env['MUX_TOKEN_ID'], // This is the default and can be omitted
53-
tokenSecret: process.env['MUX_TOKEN_SECRET'], // This is the default and can be omitted
54-
});
55-
56-
async function main() {
57-
const params: Mux.Video.AssetCreateParams = {
58-
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
59-
playback_policies: ['public'],
60-
};
61-
const asset: Mux.Video.Asset = await client.video.assets.create(params);
62-
}
44+
const client = new Mux();
6345

64-
main();
46+
const params: Mux.Video.AssetCreateParams = {
47+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
48+
playback_policies: ['public'],
49+
};
50+
const asset: Mux.Video.Asset = await client.video.assets.create(params);
6551
```
6652

6753
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -283,21 +269,17 @@ a subclass of `APIError` will be thrown:
283269

284270
<!-- prettier-ignore -->
285271
```ts
286-
async function main() {
287-
const liveStream = await client.video.liveStreams
288-
.create({ playback_policies: ['public'] })
289-
.catch(async (err) => {
290-
if (err instanceof Mux.APIError) {
291-
console.log(err.status); // 400
292-
console.log(err.name); // BadRequestError
293-
console.log(err.headers); // {server: 'nginx', ...}
294-
} else {
295-
throw err;
296-
}
297-
});
298-
}
299-
300-
main();
272+
const liveStream = await client.video.liveStreams
273+
.create({ playback_policies: ['public'] })
274+
.catch(async (err) => {
275+
if (err instanceof Mux.APIError) {
276+
console.log(err.status); // 400
277+
console.log(err.name); // BadRequestError
278+
console.log(err.headers); // {server: 'nginx', ...}
279+
} else {
280+
throw err;
281+
}
282+
});
301283
```
302284

303285
Error codes are as follows:
@@ -361,13 +343,13 @@ List methods in the Mux API are paginated.
361343
You can use the `for await … of` syntax to iterate through items across all pages:
362344

363345
```ts
364-
async function fetchAllVideoDeliveryUsages(params) {
365-
const allVideoDeliveryUsages = [];
346+
async function fetchAllDeliveryReports(params) {
347+
const allDeliveryReports = [];
366348
// Automatically fetches more pages as needed.
367349
for await (const deliveryReport of client.video.deliveryUsage.list()) {
368-
allVideoDeliveryUsages.push(deliveryReport);
350+
allDeliveryReports.push(deliveryReport);
369351
}
370-
return allVideoDeliveryUsages;
352+
return allDeliveryReports;
371353
}
372354
```
373355

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Mux please follow the respective company's security reporting guidelines.
19+
or products provided by Mux, please follow the respective company's security reporting guidelines.
2020

2121
### Mux Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,27 @@ Methods:
167167
- <code title="get /video/v1/drm-configurations/{DRM_CONFIGURATION_ID}">client.video.drmConfigurations.<a href="./src/resources/video/drm-configurations.ts">retrieve</a>(drmConfigurationId) -> DRMConfiguration</code>
168168
- <code title="get /video/v1/drm-configurations">client.video.drmConfigurations.<a href="./src/resources/video/drm-configurations.ts">list</a>({ ...params }) -> DRMConfigurationsBasePage</code>
169169

170+
## Playback
171+
172+
Types:
173+
174+
- <code><a href="./src/resources/video/playback.ts">PlaybackStoryboardMetaResponse</a></code>
175+
- <code><a href="./src/resources/video/playback.ts">PlaybackStoryboardVttResponse</a></code>
176+
- <code><a href="./src/resources/video/playback.ts">PlaybackTrackResponse</a></code>
177+
- <code><a href="./src/resources/video/playback.ts">PlaybackTranscriptResponse</a></code>
178+
179+
Methods:
180+
181+
- <code title="get /{PLAYBACK_ID}/animated.{EXTENSION}">client.video.playback.<a href="./src/resources/video/playback.ts">animated</a>(playbackId, extension, { ...params }) -> Response</code>
182+
- <code title="get /{PLAYBACK_ID}.m3u8">client.video.playback.<a href="./src/resources/video/playback.ts">hls</a>(playbackId, { ...params }) -> Response</code>
183+
- <code title="get /{PLAYBACK_ID}/{FILENAME}">client.video.playback.<a href="./src/resources/video/playback.ts">staticRendition</a>(playbackId, filename, { ...params }) -> Response</code>
184+
- <code title="get /{PLAYBACK_ID}/storyboard.{EXTENSION}">client.video.playback.<a href="./src/resources/video/playback.ts">storyboard</a>(playbackId, extension, { ...params }) -> Response</code>
185+
- <code title="get /{PLAYBACK_ID}/storyboard.json">client.video.playback.<a href="./src/resources/video/playback.ts">storyboardMeta</a>(playbackId, { ...params }) -> string</code>
186+
- <code title="get /{PLAYBACK_ID}/storyboard.vtt">client.video.playback.<a href="./src/resources/video/playback.ts">storyboardVtt</a>(playbackId, { ...params }) -> string</code>
187+
- <code title="get /{PLAYBACK_ID}/thumbnail.{EXTENSION}">client.video.playback.<a href="./src/resources/video/playback.ts">thumbnail</a>(playbackId, extension, { ...params }) -> Response</code>
188+
- <code title="get /{PLAYBACK_ID}/text/{TRACK_ID}.vtt">client.video.playback.<a href="./src/resources/video/playback.ts">track</a>(playbackId, trackId, { ...params }) -> string</code>
189+
- <code title="get /{PLAYBACK_ID}/text/{TRACK_ID}.txt">client.video.playback.<a href="./src/resources/video/playback.ts">transcript</a>(playbackId, trackId, { ...params }) -> string</code>
190+
170191
# Data
171192

172193
## Dimensions

0 commit comments

Comments
 (0)