Skip to content

Commit c3abe37

Browse files
release: 11.0.1 (#571)
* fix: Fix validation on `input` / `inputs` when creating an asset (#337) (#570) * fix: Fix README to match asset and live stream settings (#572) * fix: Fix example to also use inputs & policies * release: 11.0.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Phil <[email protected]>
1 parent f304429 commit c3abe37

File tree

9 files changed

+51
-31
lines changed

9 files changed

+51
-31
lines changed

.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.0"
2+
".": "11.0.1"
33
}

.stats.yml

Lines changed: 3 additions & 3 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-2689f5dc4d269f2e3c35e7775b2f342d0a790d5c70f2baf4ddf779cf35a45473.yml
3-
openapi_spec_hash: 538747fd9fd542128cba80f547dfa1a3
4-
config_hash: 46f10626d043984a33d2324b9409c702
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-c82f962313c7a8512450ffab731fffa6a295de3cb666cf3afcebc56191439e19.yml
3+
openapi_spec_hash: a9cee3d6aa6af1fe8b0c1de7b713a8fc
4+
config_hash: f941b9f1f7c0d16e4e150799bd13f5b1

CHANGELOG.md

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

3+
## 11.0.1 (2025-04-01)
4+
5+
Full Changelog: [v11.0.0...v11.0.1](https://github.com/muxinc/mux-node-sdk/compare/v11.0.0...v11.0.1)
6+
7+
### Bug Fixes
8+
9+
* Fix example to also use inputs & policies ([fef7268](https://github.com/muxinc/mux-node-sdk/commit/fef72687669c6d77152d7c1f572de276528aabcd))
10+
* Fix README to match asset and live stream settings ([#572](https://github.com/muxinc/mux-node-sdk/issues/572)) ([92e8e26](https://github.com/muxinc/mux-node-sdk/commit/92e8e264fec6810c09a475b8845488356e9c34d3))
11+
* Fix validation on `input` / `inputs` when creating an asset ([#337](https://github.com/muxinc/mux-node-sdk/issues/337)) ([#570](https://github.com/muxinc/mux-node-sdk/issues/570)) ([4186f78](https://github.com/muxinc/mux-node-sdk/commit/4186f7828f4663df68e1d4ff23982ea569bfaddf))
12+
313
## 11.0.0 (2025-03-27)
414

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

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const client = new Mux({
3030

3131
async function main() {
3232
const asset = await client.video.assets.create({
33-
input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
33+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
34+
playback_policies: ['public'],
3435
});
3536

3637
console.log(asset.id);
@@ -54,7 +55,8 @@ const client = new Mux({
5455

5556
async function main() {
5657
const params: Mux.Video.AssetCreateParams = {
57-
input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
58+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
59+
playback_policies: ['public'],
5860
};
5961
const asset: Mux.Video.Asset = await client.video.assets.create(params);
6062
}
@@ -282,15 +284,17 @@ a subclass of `APIError` will be thrown:
282284
<!-- prettier-ignore -->
283285
```ts
284286
async function main() {
285-
const liveStream = await client.video.liveStreams.create().catch(async (err) => {
286-
if (err instanceof Mux.APIError) {
287-
console.log(err.status); // 400
288-
console.log(err.name); // BadRequestError
289-
console.log(err.headers); // {server: 'nginx', ...}
290-
} else {
291-
throw err;
292-
}
293-
});
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+
});
294298
}
295299

296300
main();
@@ -395,13 +399,19 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
395399
const client = new Mux();
396400

397401
const response = await client.video.assets
398-
.create({ input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }] })
402+
.create({
403+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
404+
playback_policies: ['public'],
405+
})
399406
.asResponse();
400407
console.log(response.headers.get('X-My-Header'));
401408
console.log(response.statusText); // access the underlying Response object
402409

403410
const { data: asset, response: raw } = await client.video.assets
404-
.create({ input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }] })
411+
.create({
412+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
413+
playback_policies: ['public'],
414+
})
405415
.withResponse();
406416
console.log(raw.headers.get('X-My-Header'));
407417
console.log(asset.id);

examples/create-asset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const mux = new Mux({
99

1010
async function main() {
1111
const asset = await mux.video.assets.create({
12-
input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
13-
playback_policy: ['public'],
12+
inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
13+
playback_policies: ['public'],
1414
});
1515
console.log(asset);
1616

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.0",
3+
"version": "11.0.1",
44
"description": "The official TypeScript library for the Mux API",
55
"author": "Mux <[email protected]>",
66
"types": "dist/index.d.ts",

src/resources/video/assets.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,9 +1709,11 @@ export type AssetRetrieveInputInfoResponse = Array<InputInfo>;
17091709

17101710
export interface AssetCreateParams {
17111711
/**
1712-
* Deprecated. Use `inputs` instead, which accepts an identical type.
1712+
* An array of objects that each describe an input file to be used to create the
1713+
* asset. As a shortcut, input can also be a string URL for a file when only one
1714+
* input file is used. See `input[].url` for requirements.
17131715
*/
1714-
input: Array<AssetCreateParams.Input>;
1716+
inputs: Array<AssetCreateParams.Input>;
17151717

17161718
/**
17171719
* An array of playback policy objects that you want applied to this asset and
@@ -1729,11 +1731,9 @@ export interface AssetCreateParams {
17291731
encoding_tier?: 'smart' | 'baseline' | 'premium';
17301732

17311733
/**
1732-
* An array of objects that each describe an input file to be used to create the
1733-
* asset. As a shortcut, input can also be a string URL for a file when only one
1734-
* input file is used. See `input[].url` for requirements.
1734+
* Deprecated. Use `inputs` instead, which accepts an identical type.
17351735
*/
1736-
inputs?: Array<AssetCreateParams.Input>;
1736+
input?: Array<AssetCreateParams.Input>;
17371737

17381738
/**
17391739
* Specify what level (if any) of support for master access. Master access can be

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.0'; // x-release-please-version
1+
export const VERSION = '11.0.1'; // x-release-please-version

tests/api-resources/video/assets.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const client = new Mux({
1111

1212
describe('resource assets', () => {
1313
test('create: only required params', async () => {
14-
const responsePromise = client.video.assets.create({ input: [{}] });
14+
const responsePromise = client.video.assets.create({ inputs: [{}] });
1515
const rawResponse = await responsePromise.asResponse();
1616
expect(rawResponse).toBeInstanceOf(Response);
1717
const response = await responsePromise;
@@ -23,7 +23,7 @@ describe('resource assets', () => {
2323

2424
test('create: required and optional params', async () => {
2525
const response = await client.video.assets.create({
26-
input: [
26+
inputs: [
2727
{
2828
closed_captions: true,
2929
end_time: 0,
@@ -43,12 +43,12 @@ describe('resource assets', () => {
4343
start_time: 0,
4444
text_type: 'subtitles',
4545
type: 'video',
46-
url: 'url',
46+
url: 'https://muxed.s3.amazonaws.com/leds.mp4',
4747
},
4848
],
4949
advanced_playback_policies: [{ drm_configuration_id: 'drm_configuration_id', policy: 'public' }],
5050
encoding_tier: 'smart',
51-
inputs: [
51+
input: [
5252
{
5353
closed_captions: true,
5454
end_time: 0,

0 commit comments

Comments
 (0)