Skip to content

Commit 432a33e

Browse files
luwesstainless-botdylanjha
authored
v8.0.0 (#326)
* refactor: rename top level params types * feat(docs): add more doc comments * chore(internal): update tsconfig * chore(internal): improve check-version script * chore(internal): improve check-version script * chore(internal): improve test case names * chore(internal): improve support for streaming responses * fix(client): properly expose `maxRetries` option * chore(internal): add prettierignore * feat(client): handle trailing slash in base url properly * fix(sse): handle server-sent events more robustly * feat(api): updates * chore(internal): add empty request preparation method * feat(client): add support for specifying client-level default headers * chore(internal): restructure core streaming implementation * chore(internal): updates to type formatting & remove duplicated types * docs: point to github repo instead of email contact * chore(internal): improve SSE decoding of lines * refactor: move error type definitions to error.ts * fix(internal): improve stream cancellation handling of abort controllers * docs!: drop official support for EOL Node versions (Node 12, 13, 14, 15) * build: add `.github` folder to `.npmignore` * docs!: drop official support for EOL Node versions (Node 12, 13, 14, 15) # Migration We no longer officially support Node 12+, as our policy is to support only [non-EOL](https://endoflife.date/nodejs) language runtime versions. We have not made any code changes that would cause the library to break on older versions of node; this is a documentation-only change. Note that we expect to move to Node 18+ in a few months, when Node 16 reaches EOL. We recommend upgrading your Node version to the latest LTS. * build: add `.github` folder to `.npmignore` * docs(readme): update main example * feat(api/data): add `video-startup-failure-percentage` enum member * fix(form-data): strip out undefined properties * feat(types): export nested types through the root client export * feat(api): add video startup failure to metrics * refactor(types)!: singularize array item types * refactor: make `SimulcastTarget` its own type * feat: support ESM and web platform runtimes; easier file uploads * style: minor reordering of types and properties * chore: speed up build script slightly * docs: rearrange sections in api.md * fix(types): remove incorrect duplicated `Promise` from some return types * refactor: move to src directory, improve ecosystem compatibility * feat(client): add support for `defaultQuery` option * docs(api.md): fix links not referencing `src` directory * fix!: import issue with ESM * docs(client): improve documentation for client options * chore(internal): fix tsc usage * refactor: mark `.responseHeaders` and `.response` as deprecated * chore: set `noEmit: true` in `tsconfig.json`, since it's for typechecking only * fix: fix link to README file uploads in fileFromPath * fix: fix link to README file uploads in fileFromPath * docs(readme): fix typescript usage example response types * fix(streaming): polyfill ReadableStream async iterator and text decoding * fix: include README.md, LICENSE and CHANGELOG.md in published package * refactor: improve streaming implementation * fix: support `PromiseLike` input to `toFile` * refactor: improve streaming implementation * Bump for 91f53a3 * fix: fix errors in package source files when users go to definition in VSCode * feat(client): improve timeout handling to reuse agent * fix(streaming): fix response body streaming in non-Chrome environments * refactor(streaming): make response body streaming polyfill more spec-compliant * feat(client): support passing a custom `fetch` function * fix(client): properly handle multi-byte characters in Content-Length * docs(readme): minor improvements * fix(streaming): do not abort successfully completed streams * docs: rename package * feat(client): add support for passing a `signal` request option * feat(api): add resolution_tier propery * chore(internal): remove unused streaming implementation * feat: improvements to ecosystem compatibility * chore(internal): let `toFile` helper accept promises to objects with name/type properties * chore(internal): add `codegen.log` to `.gitignore` and use caching for prettier * fix: fix errors with "named" client export in CJS * fix: fix error in environments without `TextEncoder` * chore(internal): restructure code to stringify query * fix: fix export map order * feat(client): export ClientOptions interface * fix(client): fix errors with file uploads in the browser * feat(streaming): make requests immediately throw an error if an aborted signal is passed in * feat(api): deprecate video spaces * feat(client): add webhook verification helpers * fix(client): set client options argument as optional * fix: fix undefined message in errors * fix(client): handle undefined process in more places * Created automatically from stainless-api/stainless#1866. * Bump for d43c42cc * feat(api): add `asset_resolution_tier` property * refactor: use destructuring arguments in client constructor and respect false values * chore(internal): allow the build script to be run without yarn installed * refactor: create build for deno.land * feat(api): updates * chore(internal): fix deno build * feat: read environment variables in Deno * chore(internal): use deno_qs in place of npm:qs in deno build * fix(client): fix query array format * docs(readme): remove beta status + document versioning policy * feat(client): detect browser usage * refactor(deno): use mod.ts files instead of index.ts files * feat(api): add JWT signing methods * feat(streaming): add `.toReadableStream()` method * chore(internal): update typescript * chore(internal): update eslint * chore(internal): update tsconfig-paths dep * feat(client): support JWT signing methods in Deno, Web, and other environments * feat(api): add `"minute"` to `timeseries_group_by parameter` enum * Bump for 59b76e48ddc3bdfc800656b6e70a55aa6f393f6b * feat(api): add `"minute"` to `timeseries_group_by parameter` enum * feat(client)!: support accessing raw response + remove deprecated features * docs(readme): minor updates * docs(readme): minor updates * chore(docs): fix typo in deprecation message * chore(internal): conditionally include bin during build output * fix(api): fix array query param names * fix(client): fix array query param serialization * feat: allow a default timeout to be set for clients * feat(webhooks): add typed webhook unwrapper (with timestamp fixes) * chore(internal): fix error happening in CloudFlare pages * chore(internal): improve error message when option is missing * chore(internal): fix error happening in CloudFlare pages * chore(internal): improve error message when option is missing * fix(client): fix TypeError when a request gets retried * feat(docs): add documentation to the client constructor * feat(api): add video.assets.retrieve_input_info method * feat(client): improve compatibility with Bun * chore(internal): add missing eslint-plugin-prettier * wip * chore(internal): add missing eslint-plugin-prettier * fix(core): fix navigator check for strange environments * feat(types): export RequestOptions type * chore(internal): export HeadersInit type shim * chore(internal): add helper method * fix(types): improve getNextPage() return type * feat(package): add Bun export map * chore: remove unneeded type * fix(client): use explicit file extensions in _shims imports * fix(client): fix TS errors that appear when users Go to Source in VSCode * fix(client): handle case where the client is instantiated with a undefined baseURL * feat: fixes tests where an array has to have unique enum values * docs(readme): add link to api.md * fix(readme): update link to api.md to use the correct branch * chore(internal): export helper from core * chore(internal): minor formatting changes * fix: fix module not found errors in Vercel edge * fix: fix module not found errors in Vercel edge * feat(client): retry on 408 Request Timeout * docs: declare Bun 1.0 officially supported * feat(errors): add status code to error message * docs(readme): remove incorrect wording in opening * feat(client): support importing node or web shims manually * feat(client): support importing node or web shims manually * docs(README): fix variable names in some examples * chore(internal): add postpublish script to push deno build to a branch and tag * chore(internal): add postpublish script to push deno build to a branch and tag * chore(internal): add postpublish script to push deno build to a branch and tag * docs(api.md): add shared models * feat(package): export a root error type * feat(client): handle retry-after with a date * chore(internal): update lock file * test: use `TEST_API_BASE_URL` in tests * chore(tests): update test examples * fix: prevent ReferenceError, update compatibility to ES2020 and Node 18+ * fix(client): eliminate circular imports, which cause runtime errors in webpack dev bundles * fix: fix namespace exports regression * chore: update README * chore(internal): refactor status code printing in error * chore(internal): refactor status code printing in error * refactor(test): refactor authentication tests * chore: add case insensitive get header function * chore: update comment * fix: improve status code in error messages * fix: import web-streams-polyfill without overriding globals * feat: handle 204 No Content gracefully * feat(client): adjust retry behavior to be exponential backoff * ci: add lint workflow * feat(client): adjust retry behavior to be exponential backoff * ci: add lint workflow * fix: typo in build script * fix: deploy deno in a github workflow instead of postpublish step * Bump for 3b68b4b4893566886887a45525480191f1f8a9df * fix: deploy deno in a github workflow instead of postpublish step * chore(internal): update gitignore * feat(github): include a devcontainer setup * feat(client): allow binary returns * docs: document customizing fetch * ci: improve deno releases * fix: improve deno releases * docs(readme): remove redundant whitespace * fix: improve deno readme * docs: update deno link in more places * docs: deno version * ci: deno improvement * chore(internal): update tsconfig * chore(docs): fix github links * chore(docs): fix github links * chore(internal): update tsconfig * ci: fix deno version bump * chore(internal): update jest config * chore(internal): update APIResource structure * chore(internal): add publish script * feat: update required fields (#327) * feat: update required fields * feat: update required fields * feat: update required fields * feat: update required fields * bump 8.0.0-canary.1 --------- Co-authored-by: Dylan Jhaveri <dylanjha@users.noreply.github.com> * feat: update required fields * fix(types): asset create required params * chore(internal): update stats file * chore(ci): fix publish-npm * feat: allow installing package directly from github * chore(internal): don't call prepare in dist * chore(internal): remove file import and conditionally run prepare * ci: bump node version from 16 to 18 since 16 is no longer supported * docs(readme): update example snippets * feat(client): support reading the base url from an env variable * ci: ensure PR titles use conventional commits * ci: remove PR title linter * build: specify `packageManager: yarn` * chore: update prettier * chore: update dependencies * chore(deps): update dependency ts-jest to v29.1.1 * chore(deps): update jest * Created automatically from stainless-api/stainless#3325. * chore(deps): update jest * Created automatically from stainless-api/stainless#3324. * refactor: write jest config in typescript * chore(internal): minor updates to pagination * docs: reformat README.md * Bump for b0411082434eeb218ea81c7bb90def24645c888d * fix(headers): always send lowercase headers and strip undefined (BREAKING in rare cases) * chore(internal): improve type signatures * chore: add .keep files for examples and custom code directories * chore(internal): minor improvements to auth code * fix: use default base url if BASE_URL env var is blank Previously, a blank BASE_URL environment variable would cause an invalid URL error. Now it uses the default. * fix: use default base url if BASE_URL env var is blank * chore(internal): narrow type into stringifyQuery * docs(readme): improve api reference * feat!: remove old SDK * cd: add CD GH action workflow * 8.0.0-beta.0 * cd: upgrade wet-run releaser * update README with beta language and update package.json to canary.3 * docs: fix missing async in readme code sample * fix: use `Accept: */*` as a default Header for void endpoints * chore(internal): debug logging for retries; speculative retry-after-ms support * fix(types): accept undefined for optional client options * fix: allow body type in RequestOptions to be null * chore(internal): add internal helpers & improve build scripts * 8.0.0-canary.4 * Update README.md links to api.md * chore(internal): re-order pagination import * chore(internal): enable building when git installed * fix(api): fix `live_stream` enum value on JWT `DataTypeClaim` * docs: add a CONTRIBUTING.md * 8.0.0-canary.5 * update README and add Upgrading to 8.x md file * bump versions to 8.0.0 * add note about Documentation --------- Co-authored-by: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Co-authored-by: Stainless Bot <dev@stainlessapi.com> Co-authored-by: Dylan Jhaveri <dylanjha@users.noreply.github.com> Co-authored-by: Dylan Jhaveri <djhaveri@mux.com>
1 parent 9979150 commit 432a33e

File tree

295 files changed

+19213
-19450
lines changed

Some content is hidden

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

295 files changed

+19213
-19450
lines changed

.devcontainer/Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1
2+
FROM debian:bookworm-slim AS stainless
3+
4+
RUN apt-get update && apt-get install -y \
5+
nodejs \
6+
npm \
7+
yarnpkg \
8+
&& apt-get clean autoclean
9+
10+
# Yarn
11+
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn
12+
13+
WORKDIR /workspace
14+
15+
COPY package.json yarn.lock /workspace/
16+
17+
RUN yarn install
18+
19+
COPY . /workspace

.devcontainer/devcontainer.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
}
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Configure tool-specific properties.
16+
// "customizations": {},
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

.editorconfig

-40
This file was deleted.

.esdoc.json

-40
This file was deleted.

.eslintignore

-1
This file was deleted.

.eslintrc.js

+5-47
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,10 @@
11
module.exports = {
2-
extends: ['airbnb-base', 'prettier'],
3-
root: true,
4-
env: {
5-
node: true,
6-
mocha: true,
7-
},
8-
plugins: ['@typescript-eslint', 'prettier', 'chai-friendly'],
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'],
94
rules: {
10-
'no-unused-expressions': 0,
11-
'chai-friendly/no-unused-expressions': 2,
5+
'no-unused-vars': 'off',
126
'prettier/prettier': 'error',
13-
'import/extensions': [
14-
1,
15-
{
16-
js: 'ignorePackages',
17-
json: 'ignorePackages',
18-
mjs: 'ignorePackages',
19-
cjs: 'ignorePackages',
20-
},
21-
],
22-
'import/no-unresolved': 0,
7+
'unused-imports/no-unused-imports': 'error',
238
},
24-
overrides: [
25-
{
26-
files: ['*.ts'],
27-
settings: {
28-
'import/resolver': {
29-
node: {
30-
extensions: ['.ts'],
31-
},
32-
},
33-
},
34-
rules: {
35-
camelcase: 'off',
36-
'no-useless-constructor': 'off', // https://github.com/typescript-eslint/typescript-eslint/issues/420
37-
'no-unused-vars': 'off', // https://github.com/typescript-eslint/typescript-eslint/issues/363
38-
'import/extensions': [
39-
'error',
40-
'ignorePackages',
41-
{
42-
ts: 'never',
43-
},
44-
],
45-
'import/prefer-default-export': 'off',
46-
'lines-between-class-members': 'off',
47-
'max-classes-per-file': 'off',
48-
},
49-
},
50-
],
51-
parser: '@typescript-eslint/parser',
9+
root: true,
5210
};

.github/dependabot.yml

-11
This file was deleted.

.github/workflows/cd.yml

+47
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,50 @@ on:
1616
- minor
1717
- major
1818
- prerelease
19+
- from-package
20+
- from-git
21+
prerelease:
22+
type: choice
23+
description: Pre-release
24+
options:
25+
-
26+
- canary
27+
- beta
28+
dryrun:
29+
description: 'Dry-run'
30+
type: boolean
31+
32+
run-name: Deploy ${{ inputs.version }} ${{ inputs.dryrun && '--dry-run' || '' }} ${{ inputs.prerelease && format('--prerelease {0}', inputs.prerelease) || '' }}
33+
34+
jobs:
35+
deploy:
36+
runs-on: ubuntu-latest
37+
environment: production
38+
permissions:
39+
contents: write
40+
id-token: write
41+
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0 # Fetch all history for all tags and branches
50+
- uses: actions/setup-node@v4
51+
with:
52+
node-version: 20
53+
# this line is required for the setup-node action to be able to run the npm publish below.
54+
registry-url: 'https://registry.npmjs.org'
55+
- uses: fregante/setup-git-user@v1
56+
- run: yarn install --frozen-lockfile
57+
- run: yarn lint
58+
# - run: yarn test
59+
- run: yarn build
60+
- run: (cd dist && npx --yes wet-run@1.0.3 release ${{ inputs.version }} ${{ inputs.dryrun && '--dry-run' || '' }} ${{ inputs.prerelease && format('--prerelease {0}', inputs.prerelease) || '' }} --provenance --changelog --github-release --verbose)
61+
- name: Get NPM version
62+
id: npm-version
63+
uses: martinbeentjes/npm-get-version-action@v1.3.1
64+
- name: Released ${{ steps.npm-version.outputs.current-version}} ✨
65+
run: echo ${{ steps.npm-version.outputs.current-version}}

.github/workflows/ci.yml

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
name: CI
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
49

510
jobs:
6-
build:
11+
lint:
12+
name: lint
713
runs-on: ubuntu-latest
8-
9-
strategy:
10-
matrix:
11-
node-version: [14.x, 16.x, 18.x]
14+
if: github.repository == 'muxinc/mux-node-sdk'
1215

1316
steps:
14-
- uses: actions/checkout@v2
15-
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v1
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
1721
with:
18-
node-version: ${{ matrix.node-version }}
19-
- run: yarn install --frozen-lockfile
20-
- run: yarn build
21-
- run: yarn format
22-
- run: NOCK_BACK_MODE=lockdown yarn test
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: |
26+
yarn install
27+
28+
- name: Check types
29+
run: |
30+
yarn build

.github/workflows/npm-publish.yml

-33
This file was deleted.

.github/workflows/update-docs.yml

-27
This file was deleted.

.gitignore

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Configurations
9-
.env
10-
11-
# Dependency directories
12-
node_modules/
13-
14-
# IDE generated files
15-
*.iws
16-
*.iml
17-
*.ipr
1+
node_modules
2+
yarn-error.log
3+
codegen.log
4+
dist
5+
/deno
6+
/*.tgz
187
.idea/
19-
20-
# builds
21-
dist/
22-
tsconfig.tsbuildinfo

0 commit comments

Comments
 (0)