diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index d03365a..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d55fc4d..43fd5a7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,15 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/debian { - "name": "Debian", - "build": { - "dockerfile": "Dockerfile" + "name": "Development", + "image": "mcr.microsoft.com/devcontainers/typescript-node:latest", + "features": { + "ghcr.io/devcontainers/features/node:1": {} + }, + "postCreateCommand": "yarn install", + "customizations": { + "vscode": { + "extensions": ["esbenp.prettier-vscode"] + } } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e6d1af..1e95b75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,29 +2,93 @@ name: CI on: push: branches: - - main + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: - branches: - - main + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: + timeout-minutes: 10 name: lint - runs-on: ubuntu-latest - - + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '18' - - name: Install dependencies - run: | - yarn install + - name: Bootstrap + run: ./scripts/bootstrap - name: Check types - run: | - yarn build + run: ./scripts/lint + + build: + timeout-minutes: 5 + name: build + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: '18' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Check build + run: ./scripts/build + + - name: Get GitHub OIDC Token + if: |- + github.repository == 'stainless-sdks/maisa-node' && + !startsWith(github.ref, 'refs/heads/stl/') + id: github-oidc + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: |- + github.repository == 'stainless-sdks/maisa-node' && + !startsWith(github.ref, 'refs/heads/stl/') + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: + timeout-minutes: 10 + name: test + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: '20' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 5244216..ff6dfb1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 02a9c33..3f8d4ad 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,8 @@ name: Release Doctor on: pull_request: + branches: + - main workflow_dispatch: jobs: @@ -10,10 +12,11 @@ jobs: if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.MAISA_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.gitignore b/.gitignore index 58b3944..c85fe68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,12 @@ +.prism.log +.stdy.log node_modules yarn-error.log codegen.log +Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ +.eslintcache + diff --git a/.prettierignore b/.prettierignore index fc6160f..3548c5a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,5 @@ CHANGELOG.md -/ecosystem-tests +/ecosystem-tests/*/** /node_modules /deno diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c5e8a3e..17473a2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } diff --git a/.stats.yml b/.stats.yml index c254947..cfa854a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,4 @@ -configured_endpoints: 15 +configured_endpoints: 13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa/maisa-d1dd8e6736faa244dcf5cd516d0e2463cb22f1aba163ab329430582d7bd0d8c7.yml +openapi_spec_hash: 67e2baafe7455c2a734ac0b0ea699719 +config_hash: d6a8d922bf8b98716e3f55b9c829cd45 diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..e4feee6 --- /dev/null +++ b/Brewfile @@ -0,0 +1 @@ +brew "node" diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c8347..3f32b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,134 @@ # Changelog +## 0.1.0-alpha.3 (2026-07-18) + +Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/maisaai/node-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) + +### Features + +* add SKIP_BREW env var to ./scripts/bootstrap ([#28](https://github.com/maisaai/node-sdk/issues/28)) ([3565f73](https://github.com/maisaai/node-sdk/commit/3565f732457bbe4e5e0267b46de0f48b0f0b25b4)) +* **api:** OpenAPI spec update via Stainless API ([#12](https://github.com/maisaai/node-sdk/issues/12)) ([70eaf21](https://github.com/maisaai/node-sdk/commit/70eaf210a89697c46c5cf5ce1677d61f4815917b)) +* **api:** OpenAPI spec update via Stainless API ([#14](https://github.com/maisaai/node-sdk/issues/14)) ([39d7ac0](https://github.com/maisaai/node-sdk/commit/39d7ac0350a854f3aeb0d8c19df2cffba70ef001)) +* clean up environment call outs ([9650bfb](https://github.com/maisaai/node-sdk/commit/9650bfba397d7496178b3416983a7e50c7605a46)) +* **client:** accept RFC6838 JSON content types ([#29](https://github.com/maisaai/node-sdk/issues/29)) ([e18ddd3](https://github.com/maisaai/node-sdk/commit/e18ddd3331647b0c25aed3f6b24d3428df5a64ee)) +* **client:** add support for endpoint-specific base URLs ([d3cec19](https://github.com/maisaai/node-sdk/commit/d3cec191d768c173919950d80367d2e78888dde7)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([a0c5ab4](https://github.com/maisaai/node-sdk/commit/a0c5ab4c7bad46eb93bc0c3c3b6ac82d2d54e25e)) +* support setting headers via env ([73cd33f](https://github.com/maisaai/node-sdk/commit/73cd33fef5fd01323711be99cc3534df5f8479f9)) + + +### Bug Fixes + +* **api:** improve type resolution when importing as a package ([#38](https://github.com/maisaai/node-sdk/issues/38)) ([837d599](https://github.com/maisaai/node-sdk/commit/837d599f19c3d9b7e57802e72bc258c338d6db9c)) +* avoid type error in certain environments ([#34](https://github.com/maisaai/node-sdk/issues/34)) ([4a5837e](https://github.com/maisaai/node-sdk/commit/4a5837edd9fa1738b823777841874c6106eeba82)) +* **ci:** release-doctor — report correct token name ([2683b03](https://github.com/maisaai/node-sdk/commit/2683b03ddccdf2dede541acdded547ab985d5419)) +* **client:** don't send `Content-Type` for bodyless methods ([1bebaad](https://github.com/maisaai/node-sdk/commit/1bebaad2866e7910bdd0a28362f72caeaa942425)) +* **client:** preserve URL params already embedded in path ([48d3a76](https://github.com/maisaai/node-sdk/commit/48d3a7617a90a7ae1565e029482d0118f515780f)) +* **client:** send `X-Stainless-Timeout` in seconds ([#36](https://github.com/maisaai/node-sdk/issues/36)) ([b0e7faa](https://github.com/maisaai/node-sdk/commit/b0e7faa8126499453343390a7be1bb0c9d63dda5)) +* coerce nullable values to undefined ([8abc12e](https://github.com/maisaai/node-sdk/commit/8abc12ec8cecb9f44e631323bd5a790f0d2e7d85)) +* **docs/contributing:** correct pnpm link command ([87e0ce7](https://github.com/maisaai/node-sdk/commit/87e0ce781aa392df571fa9673b036fff02c17f7d)) +* **exports:** ensure resource imports don't require /index ([#31](https://github.com/maisaai/node-sdk/issues/31)) ([af90af8](https://github.com/maisaai/node-sdk/commit/af90af83d326d512b81019f04f9bba84e939c4e4)) +* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#35](https://github.com/maisaai/node-sdk/issues/35)) ([633b99a](https://github.com/maisaai/node-sdk/commit/633b99a727dfdf145a1c2f2f6a7244a6576d13d9)) +* **mcp:** correct code tool API endpoint ([2175f4a](https://github.com/maisaai/node-sdk/commit/2175f4adac573b5cd2b2050d472b5174a83307d7)) +* **mcp:** remove unused tools.ts ([#39](https://github.com/maisaai/node-sdk/issues/39)) ([9a32b34](https://github.com/maisaai/node-sdk/commit/9a32b3417bdebbde3a678e5768107c07d023442f)) +* **mcp:** return correct lines on typescript errors ([39e09fb](https://github.com/maisaai/node-sdk/commit/39e09fbcb3ba8ace9a5e959c10c48dfcbe9484f1)) +* publish script — handle NPM errors correctly ([9fcc1d6](https://github.com/maisaai/node-sdk/commit/9fcc1d6feeb78995559669a6812fa0a44a10afe0)) + + +### Performance Improvements + +* faster formatting ([17f089f](https://github.com/maisaai/node-sdk/commit/17f089f418f965225fc2590d9bbf471c31d0663c)) + + +### Chores + +* break long lines in snippets into multiline ([db72364](https://github.com/maisaai/node-sdk/commit/db723646328bd135e924415412ce62cc9271599c)) +* ci build action ([eb696f7](https://github.com/maisaai/node-sdk/commit/eb696f73f16d7b7494811905a18131f7b741d263)) +* **ci:** add timeout thresholds for CI jobs ([959262c](https://github.com/maisaai/node-sdk/commit/959262c3ac17fceccc76a32ef23c977fa8689201)) +* **ci:** bump node version for release workflows ([202d49b](https://github.com/maisaai/node-sdk/commit/202d49b4ae927a582b8b40c5e28c0593f17f5886)) +* **ci:** enable for pull requests ([554bc43](https://github.com/maisaai/node-sdk/commit/554bc435bf0c35ccbdf153d9e3d90c92c8020075)) +* **ci:** only run for pushes and fork pull requests ([411abab](https://github.com/maisaai/node-sdk/commit/411ababaa9cb6fd7c35bdb28891f6c2ccbfb4c6a)) +* **ci:** only use depot for staging repos ([4016e99](https://github.com/maisaai/node-sdk/commit/4016e99d9c7d17947730fbae49b242e039753d5f)) +* **ci:** skip lint on metadata-only changes ([70b2d9e](https://github.com/maisaai/node-sdk/commit/70b2d9e3abf1ea056f4ef8ff688ac86cc9331c8c)) +* **ci:** skip uploading artifacts on stainless-internal branches ([2795477](https://github.com/maisaai/node-sdk/commit/279547720bd1f3359028096cded81cf15f8c0282)) +* **ci:** upgrade `actions/github-script` ([26b60fa](https://github.com/maisaai/node-sdk/commit/26b60fa45899c30f717c5cf979e954422a81b771)) +* **client:** do not parse responses with empty content-length ([2146bde](https://github.com/maisaai/node-sdk/commit/2146bde4a683159ec08b047d2a1227fbf0937242)) +* **client:** minor internal fixes ([0924cf6](https://github.com/maisaai/node-sdk/commit/0924cf64d7d97376b782168885e8076fa410b1cc)) +* **deps:** update dependency node-fetch to v2.6.13 ([fc9ab23](https://github.com/maisaai/node-sdk/commit/fc9ab238c88204698c6e2ecc66d17938e6fd66a4)) +* do not install brew dependencies in ./scripts/bootstrap by default ([16353ab](https://github.com/maisaai/node-sdk/commit/16353ab3eff92358d99e16d11df1097c496e7965)) +* **docs:** grammar improvements ([2966ec5](https://github.com/maisaai/node-sdk/commit/2966ec5dbf5ce47edd2814ca2645608706d56a27)) +* **docs:** use top-level-await in example snippets ([cb12043](https://github.com/maisaai/node-sdk/commit/cb120430cdf94f774ec6d49500ad57d9fde5622a)) +* **exports:** cleaner resource index imports ([#32](https://github.com/maisaai/node-sdk/issues/32)) ([b97f68a](https://github.com/maisaai/node-sdk/commit/b97f68a49579b5ef2ea73c4c7989ad7776b3585f)) +* **exports:** stop using path fallbacks ([#33](https://github.com/maisaai/node-sdk/issues/33)) ([2282a64](https://github.com/maisaai/node-sdk/commit/2282a64da90602664be9ed9e57a7feec170bb88f)) +* fix typo in descriptions ([bab57e2](https://github.com/maisaai/node-sdk/commit/bab57e2971bdc8786ada51ef0c992b05c1a852b0)) +* improve publish-npm script --latest tag logic ([2a38060](https://github.com/maisaai/node-sdk/commit/2a38060be33b58fd6d298881574aed704834c2a8)) +* **internal:** add aliases for Record and Array ([#37](https://github.com/maisaai/node-sdk/issues/37)) ([bff89be](https://github.com/maisaai/node-sdk/commit/bff89bef422def683f609dfe2b002a183d48e872)) +* **internal:** codegen related update ([007bf40](https://github.com/maisaai/node-sdk/commit/007bf403afeef5fdee5ee5c05bf82bace33301a5)) +* **internal:** codegen related update ([ad7909c](https://github.com/maisaai/node-sdk/commit/ad7909c20b87c65781c087ea3e8e1976f0abd87e)) +* **internal:** codegen related update ([ceb4f95](https://github.com/maisaai/node-sdk/commit/ceb4f952168bcdac7e1080ff682f0c2984bd33e4)) +* **internal:** codegen related update ([59ebea3](https://github.com/maisaai/node-sdk/commit/59ebea3adcbae40ec8bb1c92de3b4899a298fbae)) +* **internal:** codegen related update ([a0eff02](https://github.com/maisaai/node-sdk/commit/a0eff02ff7bb1962dcb3ca2403b0bb0bf3f6b21d)) +* **internal:** codegen related update ([51d8020](https://github.com/maisaai/node-sdk/commit/51d80209aa956a6ea5fdc5b4cc485db8267be626)) +* **internal:** codegen related update ([618a3aa](https://github.com/maisaai/node-sdk/commit/618a3aa37451f0a7724ca0d5f1655174eb737c32)) +* **internal:** codegen related update ([#24](https://github.com/maisaai/node-sdk/issues/24)) ([987a383](https://github.com/maisaai/node-sdk/commit/987a383228232a8d312ec782149d80593ff9ff08)) +* **internal:** codegen related update ([#27](https://github.com/maisaai/node-sdk/issues/27)) ([694c674](https://github.com/maisaai/node-sdk/commit/694c6745b6a2c622e597ce249746f26f62352f38)) +* **internal:** fix incremental formatting in some cases ([d3f62b4](https://github.com/maisaai/node-sdk/commit/d3f62b4156c77ee1040f582bb0342af287fc11d9)) +* **internal:** formatting change ([846300a](https://github.com/maisaai/node-sdk/commit/846300a68c239046ea51be523514afcf453a07d4)) +* **internal:** ignore .eslintcache ([638db23](https://github.com/maisaai/node-sdk/commit/638db23350725cad7aca39687d46d02e36c027d7)) +* **internal:** make base APIResource abstract ([eef6cdc](https://github.com/maisaai/node-sdk/commit/eef6cdcf1d8c744254b9cfb402b08b0f311cdce6)) +* **internal:** more robust bootstrap script ([e6a079e](https://github.com/maisaai/node-sdk/commit/e6a079e6bbe8303c59c56ae38d9906c222bb75da)) +* **internal:** move publish config ([151270b](https://github.com/maisaai/node-sdk/commit/151270b19b0ae322989ad049a1d0907beb000ab6)) +* **internal:** move stringifyQuery implementation to internal function ([9b1e546](https://github.com/maisaai/node-sdk/commit/9b1e546ec712a2f2fdf239cd357694b674f6391b)) +* **internal:** reduce CI branch coverage ([94b6670](https://github.com/maisaai/node-sdk/commit/94b6670329550c6a11860790403bd1b2cdcbd602)) +* **internal:** remove .eslintcache ([34ca6c3](https://github.com/maisaai/node-sdk/commit/34ca6c3b4bbf8e0e59f54c2e9d64bfcfa3f6e98a)) +* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([accffdb](https://github.com/maisaai/node-sdk/commit/accffdbb5b22c3ae02df8f4f50589dde5b6223ca)) +* **internal:** remove extra empty newlines ([#30](https://github.com/maisaai/node-sdk/issues/30)) ([de5ba3f](https://github.com/maisaai/node-sdk/commit/de5ba3faf8605c664970d642cfa3d0d0b2aa3f57)) +* **internal:** remove redundant imports config ([11a7948](https://github.com/maisaai/node-sdk/commit/11a794845c180a0760d5d67d7cdcb24c50571cfb)) +* **internal:** tweak CI branches ([454a3b2](https://github.com/maisaai/node-sdk/commit/454a3b267522c0a8b0509ee9346a992668ed2b29)) +* **internal:** update `actions/checkout` version ([1b1a007](https://github.com/maisaai/node-sdk/commit/1b1a007aff2bcd038f500b22330ecf22fdfcf8d7)) +* **internal:** update comment in script ([ca84bfc](https://github.com/maisaai/node-sdk/commit/ca84bfcaed7cdd34b121078037ce616be6b5b1c6)) +* **internal:** update gitignore ([ad82170](https://github.com/maisaai/node-sdk/commit/ad821701c21bca695d20b641f0a35a5c72626907)) +* **internal:** update multipart form array serialization ([d2be5a4](https://github.com/maisaai/node-sdk/commit/d2be5a41f5983f7a06e3b0091df28e89494bab16)) +* **internal:** upgrade babel, qs, js-yaml ([725bccb](https://github.com/maisaai/node-sdk/commit/725bccbe7669485dd8a30db75ac48c4304d39472)) +* **internal:** upload builds and expand CI branch coverage ([730ed99](https://github.com/maisaai/node-sdk/commit/730ed99464ca7b778e0fa030eb6b7b6b9f26d61e)) +* **internal:** use npm pack for build uploads ([c3fd8cd](https://github.com/maisaai/node-sdk/commit/c3fd8cd1f78b13db1ddc1f956a463649742d901f)) +* make some internal functions async ([8ea868a](https://github.com/maisaai/node-sdk/commit/8ea868af815cf48c7df8a2c8930b484903e9db1c)) +* mention unit type in timeout docs ([d5641f8](https://github.com/maisaai/node-sdk/commit/d5641f81cf1e6ee1399a6055133f888da1db620c)) +* rebuild project due to codegen change ([#16](https://github.com/maisaai/node-sdk/issues/16)) ([df79224](https://github.com/maisaai/node-sdk/commit/df79224bb82acaee52c77de6bbc473be110e97d2)) +* rebuild project due to codegen change ([#18](https://github.com/maisaai/node-sdk/issues/18)) ([036b17d](https://github.com/maisaai/node-sdk/commit/036b17d968f6a3171cd2994a004d8d8bfad79af5)) +* rebuild project due to codegen change ([#19](https://github.com/maisaai/node-sdk/issues/19)) ([c8a77bf](https://github.com/maisaai/node-sdk/commit/c8a77bff486ef066c96de6d35246efa96212dbbf)) +* rebuild project due to codegen change ([#20](https://github.com/maisaai/node-sdk/issues/20)) ([424c10e](https://github.com/maisaai/node-sdk/commit/424c10e00a0cd21b51295535d875a57b6330c877)) +* rebuild project due to codegen change ([#21](https://github.com/maisaai/node-sdk/issues/21)) ([31e045e](https://github.com/maisaai/node-sdk/commit/31e045e7b6edf51a329a2687ced65d2e278a6cb0)) +* rebuild project due to oas spec rename ([#15](https://github.com/maisaai/node-sdk/issues/15)) ([9d62f64](https://github.com/maisaai/node-sdk/commit/9d62f6432e15ec16cdcb8b4f8e62ba54a6df3ba0)) +* remove redundant word in comment ([#23](https://github.com/maisaai/node-sdk/issues/23)) ([487943a](https://github.com/maisaai/node-sdk/commit/487943aa4079151535a7fd19ea4246cb1607df2b)) +* **test:** do not count install time for mock server timeout ([c86bbfc](https://github.com/maisaai/node-sdk/commit/c86bbfc5343ec69a6ae193d484f8e8039cb3c69e)) +* **tests:** bump steady to v0.19.4 ([b5d7d9f](https://github.com/maisaai/node-sdk/commit/b5d7d9f6eb306f51af0ae4c4ace9feaebdb9ea49)) +* **tests:** bump steady to v0.19.5 ([f72c552](https://github.com/maisaai/node-sdk/commit/f72c5526b6ed5cea736e3f33677deb2fcaed8b24)) +* **tests:** bump steady to v0.19.6 ([ca75a49](https://github.com/maisaai/node-sdk/commit/ca75a498a0791a74d12bc54085bad27ecaccb238)) +* **tests:** bump steady to v0.19.7 ([ad262cf](https://github.com/maisaai/node-sdk/commit/ad262cf972b2171d2546ff2dbac4f92aaff85595)) +* **tests:** bump steady to v0.20.1 ([30bf325](https://github.com/maisaai/node-sdk/commit/30bf325267b8c555aea1777fb25876f01ac1ed29)) +* **tests:** bump steady to v0.20.2 ([7f5ab97](https://github.com/maisaai/node-sdk/commit/7f5ab979d3b67b1e34df3be7d04f8f8e906df29d)) +* **tests:** bump steady to v0.22.1 ([eceb8f0](https://github.com/maisaai/node-sdk/commit/eceb8f02dc30bdc1594ddcb37a386015828f36ce)) +* **tests:** improve enum examples ([#40](https://github.com/maisaai/node-sdk/issues/40)) ([50475c4](https://github.com/maisaai/node-sdk/commit/50475c4c257096ca8c8b06d6cdb970f383c1b3bf)) +* **types:** nicer error class types + jsdocs ([#26](https://github.com/maisaai/node-sdk/issues/26)) ([eeae75a](https://github.com/maisaai/node-sdk/commit/eeae75a631ce110cada808b8ad0609b0553a7738)) +* update @stainless-api/prism-cli to v5.15.0 ([15c1948](https://github.com/maisaai/node-sdk/commit/15c19485981e9a85f9d9a8e22fce255abcc60708)) +* update CI script ([695a63b](https://github.com/maisaai/node-sdk/commit/695a63b5c02e36b9b2469986dd4d27b923b83821)) +* update mock server docs ([ec98593](https://github.com/maisaai/node-sdk/commit/ec985936ba0034dd1a2f5afd03feea8c064e8f20)) +* update placeholder string ([194604e](https://github.com/maisaai/node-sdk/commit/194604e309f974a187879e781151eca87c3854f8)) + + +### Documentation + +* add examples to tsdocs ([c89ae8d](https://github.com/maisaai/node-sdk/commit/c89ae8d485ad35edf887a691dba66f1730f7f714)) +* **readme:** fix typo ([9d4ca9a](https://github.com/maisaai/node-sdk/commit/9d4ca9a8d674e96e4897fb4a54c66664e5493bb6)) +* remove suggestion to use `npm` call out ([#22](https://github.com/maisaai/node-sdk/issues/22)) ([0331bba](https://github.com/maisaai/node-sdk/commit/0331bbaf7ace3113e9bf4d2ba1220813a40e6a28)) +* update examples ([c2857cd](https://github.com/maisaai/node-sdk/commit/c2857cd7168a6ab787ecf0c83883e9cda18d2075)) + + +### Refactors + +* **tests:** switch from prism to steady ([31ba293](https://github.com/maisaai/node-sdk/commit/31ba2930540fe4c6b256cf0021f3c6ea81722bd7)) +* **types:** replace Record with mapped types ([affc927](https://github.com/maisaai/node-sdk/commit/affc92743d1fac0b927a20f155ef51d6df4c88a8)) + ## 0.1.0-alpha.2 (2024-03-05) Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/maisaai/node-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2d7b5d4..d2e5b3f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,38 +1,38 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: -```bash -yarn -yarn build +```sh +$ yarn +$ yarn build ``` This will install all the required dependencies and build output files to `dist/`. ## Modifying/Adding code -Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/lib/` and `examples/` directories are exceptions and will never be overridden. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/lib/` and `examples/` directories. ## Adding and running examples -All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or -added to. +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. -```bash +```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source @@ -41,40 +41,38 @@ If you’d like to use the repository from source, you can either install from g To install via git: -```bash -npm install --save git+ssh://git@github.com:maisaai/node-sdk.git -# or -yarn add git+ssh://git@github.com:maisaai/node-sdk.git +```sh +$ npm install git+ssh://git@github.com:maisaai/node-sdk.git ``` Alternatively, to link a local copy of the repo: -```bash +```sh # Clone -git clone https://www.github.com/maisaai/node-sdk -cd node-sdk +$ git clone https://www.github.com/maisaai/node-sdk +$ cd node-sdk # With yarn -yarn link -cd ../my-package -yarn link maisa +$ yarn link +$ cd ../my-package +$ yarn link maisa # With pnpm -pnpm link --global -cd ../my-package -pnpm link -—global maisa +$ pnpm link --global +$ cd ../my-package +$ pnpm link --global maisa ``` ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. -```bash -npx prism path/to/your/openapi.yml +```sh +$ ./scripts/mock ``` -```bash -yarn run test +```sh +$ yarn run test ``` ## Linting and formatting @@ -84,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and To lint: -```bash -yarn lint +```sh +$ yarn lint ``` To format and fix all lint issues automatically: -```bash -yarn fix +```sh +$ yarn fix ``` ## Publishing and releases diff --git a/LICENSE b/LICENSE index 34d7846..4f7064a 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Maisa + Copyright 2026 Maisa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index e3bb179..73c3a04 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,17 @@ # Maisa Node API Library -[![NPM version](https://img.shields.io/npm/v/maisa.svg)](https://npmjs.org/package/maisa) +[![NPM version](https://img.shields.io/npm/v/maisa.svg)](https://npmjs.org/package/maisa) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/maisa) This library provides convenient access to the Maisa REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). + +It is generated with [Stainless](https://www.stainless.com/). ## Installation ```sh -# install from NPM -npm install --save maisa -# or -yarn add maisa +npm install maisa ``` ## Usage @@ -23,15 +22,13 @@ The full API of this library can be found in [api.md](api.md). ```js import Maisa from 'maisa'; -const maisa = new Maisa(); - -async function main() { - const textSummary = await maisa.capabilities.summarize({ text: 'Example long text...' }); +const client = new Maisa({ + apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted +}); - console.log(textSummary.summary); -} +const textSummary = await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }); -main(); +console.log(textSummary.summary); ``` ### Request & Response types @@ -42,18 +39,61 @@ This library includes TypeScript definitions for all request params and response ```ts import Maisa from 'maisa'; -const maisa = new Maisa(); - -async function main() { - const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; - const textSummary: Maisa.TextSummary = await maisa.capabilities.summarize(params); -} +const client = new Maisa({ + apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted +}); -main(); +const params: Maisa.CapabilitySummarizeParams = { text: 'Lorem Ipsum dolor sit amet' }; +const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. +## File uploads + +Request parameters that correspond to file uploads can be passed in many different forms: + +- `File` (or an object with the same structure) +- a `fetch` `Response` (or an object with the same structure) +- an `fs.ReadStream` +- the return value of our `toFile` helper + +```ts +import fs from 'fs'; +import fetch from 'node-fetch'; +import Maisa, { toFile } from 'maisa'; + +const client = new Maisa(); + +// If you have access to Node `fs` we recommend using `fs.createReadStream()`: +await client.capabilities.media.compare({ + file1: fs.createReadStream('/path/to/file'), + file2: fs.createReadStream('path/to/file'), +}); + +// Or if you have the web `File` API you can pass a `File` instance: +await client.capabilities.media.compare({ + file1: new File(['my bytes'], 'file'), + file2: fs.createReadStream('path/to/file'), +}); + +// You can also pass a `fetch` `Response`: +await client.capabilities.media.compare({ + file1: await fetch('https://somesite/file'), + file2: fs.createReadStream('path/to/file'), +}); + +// Finally, if none of the above are convenient, you can use our `toFile` helper: +await client.capabilities.media.compare({ + file1: await toFile(Buffer.from('my bytes'), 'file'), + file2: fs.createReadStream('path/to/file'), +}); +await client.capabilities.media.compare({ + file1: await toFile(new Uint8Array([0, 1, 2]), 'file'), + file2: fs.createReadStream('path/to/file'), +}); +``` + ## Handling errors When the library is unable to connect to the API, @@ -62,24 +102,20 @@ a subclass of `APIError` will be thrown: ```ts -async function main() { - const textSummary = await maisa.capabilities - .summarize({ text: 'Example long text...' }) - .catch(async (err) => { - if (err instanceof Maisa.APIError) { - console.log(err.status); // 400 - console.log(err.name); // BadRequestError - console.log(err.headers); // {server: 'nginx', ...} - } else { - throw err; - } - }); -} - -main(); +const textSummary = await client.capabilities + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) + .catch(async (err) => { + if (err instanceof Maisa.APIError) { + console.log(err.status); // 400 + console.log(err.name); // BadRequestError + console.log(err.headers); // {server: 'nginx', ...} + } else { + throw err; + } + }); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | @@ -103,12 +139,12 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ maxRetries: 0, // default is 2 }); // Or, configure per-request: -await maisa.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }, { maxRetries: 5, }); ``` @@ -120,12 +156,12 @@ Requests time out after 1 minute by default. You can configure this with a `time ```ts // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); // Override per-request: -await maisa.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }, { timeout: 5 * 1000, }); ``` @@ -144,20 +180,66 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const maisa = new Maisa(); +const client = new Maisa(); -const response = await maisa.capabilities.summarize({ text: 'Example long text...' }).asResponse(); +const response = await client.capabilities + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) + .asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object -const { data: textSummary, response: raw } = await maisa.capabilities - .summarize({ text: 'Example long text...' }) +const { data: textSummary, response: raw } = await client.capabilities + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) .withResponse(); console.log(raw.headers.get('X-My-Header')); console.log(textSummary.summary); ``` -## Customizing the fetch client +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. If you need to access undocumented +endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs. +Options on the client, such as retries, will be respected when making these requests. + +```ts +await client.post('/some/path', { + body: { some_prop: 'foo' }, + query: { some_query_arg: 'bar' }, +}); +``` + +#### Undocumented request params + +To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented +parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you +send will be sent as-is. + +```ts +client.foo.create({ + foo: 'my_param', + bar: 12, + // @ts-expect-error baz is not yet public + baz: 'undocumented option', +}); +``` + +For requests with the `GET` verb, any extra params will be in the query, all other requests will send the +extra param in the body. + +If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request +options. + +#### Undocumented response properties + +To access undocumented response properties, you may access the response object with `// @ts-expect-error` on +the response object, or cast the response object to the requisite type. Like the request params, we do not +validate or strip extra properties from the response from the API. + +### Customizing the fetch client By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments. @@ -175,6 +257,8 @@ import Maisa from 'maisa'; To do the inverse, add `import "maisa/shims/node"` (which does import polyfills). This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/maisaai/node-sdk/tree/main/src/_shims#readme)). +### Logging and middleware + You may also provide a custom `fetch` function when instantiating the client, which can be used to inspect or alter the `Request` or `Response` before/after each request: @@ -195,7 +279,7 @@ const client = new Maisa({ Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically. This is intended for debugging purposes only and may change in the future without notice. -## Configuring an HTTP(S) Agent (e.g., for proxies) +### Configuring an HTTP(S) Agent (e.g., for proxies) By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests. @@ -207,25 +291,25 @@ import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); // Override per-request: -await maisa.capabilities.summarize( - { text: 'Example long text...' }, +await client.capabilities.summarize( + { text: 'Lorem Ipsum dolor sit amet' }, { httpAgent: new http.Agent({ keepAlive: false }), }, ); ``` -## Semantic Versioning +## Semantic versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. @@ -238,8 +322,9 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Maisa from "npm:maisa"`. +- Deno v1.28.0 or higher. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. @@ -249,3 +334,7 @@ The following runtimes are supported: Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..f7e8253 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Maisa, please follow the respective company's security reporting guidelines. + +### Maisa Terms and Policies + +Please contact support@maisa.ai for any questions or concerns regarding the security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/api.md b/api.md index 2106a57..eeb4e12 100644 --- a/api.md +++ b/api.md @@ -36,14 +36,6 @@ Methods: ## Rerank -Types: - -- Rerank - -Methods: - -- client.models.rerank.create({ ...params }) -> Rerank - # Kpu Types: @@ -52,7 +44,7 @@ Types: Methods: -- client.kpu.run({ ...params }) -> KpuRunResponse +- client.kpu.run({ ...params }) -> unknown # FileInterpreter @@ -66,6 +58,8 @@ Methods: - client.fileInterpreter.fromPdf.create({ ...params }) -> unknown +## FromPdfScanned + ## FromDocx Types: @@ -90,11 +84,11 @@ Methods: Types: -- FromImage +- FromImageCreateResponse Methods: -- client.fileInterpreter.fromImage.create({ ...params }) -> FromImage +- client.fileInterpreter.fromImage.create({ ...params }) -> unknown ## FromAudio @@ -109,11 +103,3 @@ Methods: # Mainet ## Search - -Types: - -- Search - -Methods: - -- client.mainet.search.create({ ...params }) -> Search diff --git a/bin/check-release-environment b/bin/check-release-environment index c87f23b..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${NPM_TOKEN}" ]; then - warnings+=("The MAISA_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - -lenWarnings=${#warnings[@]} - -if [[ lenWarnings -gt 0 ]]; then - echo -e "Found the following warnings in the release environment:\n" - - for warning in "${warnings[@]}"; do - echo -e "- $warning\n" - done + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} @@ -30,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then fi echo "The environment is ready to push releases!" + diff --git a/bin/check-test-server b/bin/check-test-server deleted file mode 100755 index a6fa349..0000000 --- a/bin/check-test-server +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color - -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if is_overriding_api_base_url ; then - # If someone is running the tests against the live API, we can trust they know - # what they're doing and exit early. - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - - exit 0 -elif prism_is_running ; then - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo - - exit 0 -else - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "${YELLOW}To fix:${NC}" - echo - echo -e "1. Install Prism (requires Node 16+):" - echo - echo -e " With npm:" - echo -e " \$ ${YELLOW}npm install -g @stoplight/prism-cli${NC}" - echo - echo -e " With yarn:" - echo -e " \$ ${YELLOW}yarn global add @stoplight/prism-cli${NC}" - echo - echo -e "2. Run the mock server" - echo - echo -e " To run the server, pass in the path of your OpenAPI" - echo -e " spec to the prism command:" - echo - echo -e " \$ ${YELLOW}prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -fi diff --git a/bin/publish-npm b/bin/publish-npm index 4d6c9f3..45e8aa8 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,8 +2,60 @@ set -eux -npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN +npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" yarn build cd dist -yarn publish --access public + +# Get package name and version from package.json +PACKAGE_NAME="$(jq -r -e '.name' ./package.json)" +VERSION="$(jq -r -e '.version' ./package.json)" + +# Get latest version from npm +# +# If the package doesn't exist, npm will return: +# { +# "error": { +# "code": "E404", +# "summary": "Unpublished on 2025-06-05T09:54:53.528Z", +# "detail": "'the_package' is not in this registry..." +# } +# } +NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)" + +# Check if we got an E404 error +if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then + # Package doesn't exist yet, no last version + LAST_VERSION="" +elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then + # Report other errors + echo "ERROR: npm returned unexpected data:" + echo "$NPM_INFO" + exit 1 +else + # Success - get the version + LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes +fi + +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false +if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" +else + TAG="latest" +fi + +# Publish with the appropriate tag +yarn publish --tag "$TAG" diff --git a/jest.config.ts b/jest.config.ts index 1299213..dd3c6f5 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,6 +3,9 @@ import type { JestConfigWithTsJest } from 'ts-jest'; const config: JestConfigWithTsJest = { preset: 'ts-jest/presets/default-esm', testEnvironment: 'node', + transform: { + '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], + }, moduleNameMapper: { '^maisa$': '/src/index.ts', '^maisa/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', @@ -14,6 +17,7 @@ const config: JestConfigWithTsJest = { '/deno/', '/deno_tests/', ], + testPathIgnorePatterns: ['scripts'], }; export default config; diff --git a/package.json b/package.json index df9922a..ca8e518 100644 --- a/package.json +++ b/package.json @@ -1,51 +1,53 @@ { "name": "maisa", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "The official TypeScript library for the Maisa API", - "author": "Maisa ", + "author": "Maisa ", "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", "repository": "github:maisaai/node-sdk", "license": "Apache-2.0", - "packageManager": "yarn@1.22.21", + "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { - "test": "bin/check-test-server && yarn jest", - "build": "bash ./build", - "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", + "test": "./scripts/test", + "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/check-is-in-git-install.sh; then npm run build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", - "lint": "eslint --ext ts,js .", - "fix": "eslint --fix --ext ts,js ." + "lint": "./scripts/lint", + "fix": "./scripts/format" }, "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7", - "web-streams-polyfill": "^3.2.1" + "node-fetch": "^2.6.7" }, "devDependencies": { + "@swc/core": "^1.3.102", + "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "eslint": "^8.49.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-unused-imports": "^3.0.0", + "iconv-lite": "^0.6.3", "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", @@ -59,10 +61,6 @@ "./shims/web.js", "./shims/web.mjs" ], - "imports": { - "maisa": ".", - "maisa/*": "./src/*" - }, "exports": { "./_shims/auto/*": { "deno": { diff --git a/release-please-config.json b/release-please-config.json index 624ed99..1ebd0bd 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -60,8 +60,5 @@ } ], "release-type": "node", - "extra-files": [ - "src/version.ts", - "README.md" - ] + "extra-files": ["src/version.ts", "README.md"] } diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..28b5985 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then + brew bundle check >/dev/null 2>&1 || { + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo + } +fi + +echo "==> Installing Node dependencies…" + +PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm") + +$PACKAGE_MANAGER install diff --git a/build b/scripts/build similarity index 81% rename from build rename to scripts/build index e04ebb4..21e4d5a 100755 --- a/build +++ b/scripts/build @@ -1,7 +1,10 @@ #!/usr/bin/env bash + set -exuo pipefail -node scripts/check-version.cjs +cd "$(dirname "$0")/.." + +node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js @@ -22,17 +25,17 @@ if [ -e "bin/cli" ]; then fi # this converts the export map paths for the dist directory # and does a few other minor things -node scripts/make-dist-package-json.cjs > dist/package.json +node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files -npm exec tsc-multi +./node_modules/.bin/tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto -# we need to add exports = module.exports = Maisa Node to index.js; +# we need to add exports = module.exports = Maisa to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs -node scripts/fix-index-exports.cjs +node scripts/utils/fix-index-exports.cjs # with "moduleResolution": "nodenext", if ESM resolves to index.d.ts, # it'll have TS errors on the default import. But if it resolves to # index.d.mts the default import will work (even though both files have @@ -40,14 +43,14 @@ node scripts/fix-index-exports.cjs cp dist/index.d.ts dist/index.d.mts cp tsconfig.dist-src.json dist/src/tsconfig.json -node scripts/postprocess-files.cjs +node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM (cd dist && node -e 'require("maisa")') (cd dist && node -e 'import("maisa")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./build-deno ] +if [ -e ./scripts/build-deno ] then - ./build-deno + ./scripts/build-deno fi diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000..8a8e9d5 --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | ESLINT_USE_FLAT_CONFIG="false" xargs ./node_modules/.bin/eslint --cache --fix +fi + +echo "==> Running prettier --write" +# format things eslint didn't +PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" +if ! [ -z "$PRETTIER_FILES" ]; then + echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ + '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +fi diff --git a/scripts/format b/scripts/format new file mode 100755 index 0000000..a6bb9d0 --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint --fix" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js . diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000..6ba75df --- /dev/null +++ b/scripts/lint @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js . + +echo "==> Running tsc" +./node_modules/.bin/tsc --noEmit diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 0000000..feebe5e --- /dev/null +++ b/scripts/mock @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run steady mock on the given spec +if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.22.1 -- steady --version + + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) + echo -n "Waiting for server" + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi + echo -n "." + sleep 0.1 + done + + echo +else + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..19b8d0c --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! steady_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the steady command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +./node_modules/.bin/jest "$@" diff --git a/scripts/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh similarity index 95% rename from scripts/check-is-in-git-install.sh rename to scripts/utils/check-is-in-git-install.sh index 36bcedc..1354eb4 100755 --- a/scripts/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/check-version.cjs b/scripts/utils/check-version.cjs similarity index 82% rename from scripts/check-version.cjs rename to scripts/utils/check-version.cjs index 50a8566..86c56df 100644 --- a/scripts/check-version.cjs +++ b/scripts/utils/check-version.cjs @@ -2,14 +2,14 @@ const fs = require('fs'); const path = require('path'); const main = () => { - const pkg = require('../package.json'); + const pkg = require('../../package.json'); const version = pkg['version']; if (!version) throw 'The version property is not set in the package.json file'; if (typeof version !== 'string') { throw `Unexpected type for the package.json version field; got ${typeof version}, expected string`; } - const versionFile = path.resolve(__dirname, '..', 'src', 'version.ts'); + const versionFile = path.resolve(__dirname, '..', '..', 'src', 'version.ts'); const contents = fs.readFileSync(versionFile, 'utf8'); const output = contents.replace(/(export const VERSION = ')(.*)(')/g, `$1${version}$3`); fs.writeFileSync(versionFile, output); diff --git a/scripts/fix-index-exports.cjs b/scripts/utils/fix-index-exports.cjs similarity index 86% rename from scripts/fix-index-exports.cjs rename to scripts/utils/fix-index-exports.cjs index b61b2ea..72b0b8f 100644 --- a/scripts/fix-index-exports.cjs +++ b/scripts/utils/fix-index-exports.cjs @@ -4,7 +4,7 @@ const path = require('path'); const indexJs = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH'], 'index.js') - : path.resolve(__dirname, '..', 'dist', 'index.js'); + : path.resolve(__dirname, '..', '..', 'dist', 'index.js'); let before = fs.readFileSync(indexJs, 'utf8'); let after = before.replace( diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 0000000..79d1888 --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist diff --git a/scripts/make-dist-package-json.cjs b/scripts/utils/make-dist-package-json.cjs similarity index 87% rename from scripts/make-dist-package-json.cjs rename to scripts/utils/make-dist-package-json.cjs index d4a0a69..7c24f56 100644 --- a/scripts/make-dist-package-json.cjs +++ b/scripts/utils/make-dist-package-json.cjs @@ -1,4 +1,4 @@ -const pkgJson = require(process.env['PKG_JSON_PATH'] || '../package.json'); +const pkgJson = require(process.env['PKG_JSON_PATH'] || '../../package.json'); function processExportMap(m) { for (const key in m) { diff --git a/scripts/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs similarity index 97% rename from scripts/postprocess-files.cjs rename to scripts/utils/postprocess-files.cjs index c049563..32d670b 100644 --- a/scripts/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,12 +2,12 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'maisa/' +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'maisa/'; const distDir = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH']) - : path.resolve(__dirname, '..', 'dist'); + : path.resolve(__dirname, '..', '..', 'dist'); const distSrcDir = path.join(distDir, 'src'); /** @@ -103,7 +103,7 @@ async function* walk(dir) { } async function postprocess() { - for await (const file of walk(path.resolve(__dirname, '..', 'dist'))) { + for await (const file of walk(path.resolve(__dirname, '..', '..', 'dist'))) { if (!/\.([cm]?js|(\.d)?[cm]?ts)$/.test(file)) continue; const code = await fs.promises.readFile(file, 'utf8'); diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000..52700b9 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/maisa-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index f83d9a2..321a93e 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 7c1618b..e390617 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index b8f47cd..85acd63 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('maisa/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 5f93ce1..172405e 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from 'maisa/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts index a9c42eb..ab9f2ab 100644 --- a/src/_shims/node-runtime.ts +++ b/src/_shims/node-runtime.ts @@ -13,9 +13,7 @@ import { Readable } from 'node:stream'; import { type RequestOptions } from '../core'; import { MultipartBody } from './MultipartBody'; import { type Shims } from './registry'; - -// @ts-ignore (this package does not have proper export maps for this export) -import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js'; +import { ReadableStream } from 'node:stream/web'; type FileFromPathOptions = Omit; diff --git a/src/_shims/node-types.d.ts b/src/_shims/node-types.d.ts index b31698f..c159e5f 100644 --- a/src/_shims/node-types.d.ts +++ b/src/_shims/node-types.d.ts @@ -7,7 +7,7 @@ import * as fd from 'formdata-node'; export { type Agent } from 'node:http'; export { type Readable } from 'node:stream'; export { type ReadStream as FsReadStream } from 'node:fs'; -export { ReadableStream } from 'web-streams-polyfill'; +export { ReadableStream } from 'node:stream/web'; export const fetch: typeof nf.default; diff --git a/src/core.ts b/src/core.ts index e3e7b7c..022fc24 100644 --- a/src/core.ts +++ b/src/core.ts @@ -6,6 +6,7 @@ import { APIConnectionTimeoutError, APIUserAbortError, } from './error'; +import { stringifyQuery } from './internal/utils/query'; import { kind as shimsKind, type Readable, @@ -16,9 +17,14 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; -import { isMultipartBody } from './uploads'; +import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { maybeMultipartFormRequestOptions, multipartFormRequestOptions, @@ -28,6 +34,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { @@ -48,9 +68,15 @@ async function defaultParseResponse(props: APIResponseProps): Promise { } const contentType = response.headers.get('content-type'); - const isJSON = - contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + const mediaType = contentType?.split(';')[0]?.trim(); + const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { + const contentLength = response.headers.get('content-length'); + if (contentLength === '0') { + // if there is no content we can't do anything + return undefined as T; + } + const json = await response.json(); debug('response', response.status, response.url, response.headers, json); @@ -84,8 +110,10 @@ export class APIPromise extends Promise { }); } - _thenUnwrap(transform: (data: T) => U): APIPromise { - return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props))); + _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise { + return new APIPromise(this.responsePromise, async (props) => + transform(await this.parseResponse(props), props), + ); } /** @@ -149,6 +177,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + #baseURLOverridden: boolean; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -158,23 +187,26 @@ export abstract class APIClient { constructor({ baseURL, + baseURLOverridden, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, - fetch: overridenFetch, + fetch: overriddenFetch, }: { baseURL: string; + baseURLOverridden: boolean; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.#baseURLOverridden = baseURLOverridden; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; - this.fetch = overridenFetch ?? fetch; + this.fetch = overriddenFetch ?? fetch; } protected authHeaders(opts: FinalRequestOptions): Headers { @@ -192,7 +224,7 @@ export abstract class APIClient { protected defaultHeaders(opts: FinalRequestOptions): Headers { return { Accept: 'application/json', - 'Content-Type': 'application/json', + ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }), 'User-Agent': this.getUserAgent(), ...getPlatformHeaders(), ...this.authHeaders(opts), @@ -235,7 +267,17 @@ export abstract class APIClient { path: string, opts?: PromiseOrValue>, ): APIPromise { - return this.request(Promise.resolve(opts).then((opts) => ({ method, path, ...opts }))); + return this.request( + Promise.resolve(opts).then(async (opts) => { + const body = + opts && isBlobLike(opts?.body) ? new DataView(await opts.body.arrayBuffer()) + : opts?.body instanceof DataView ? opts.body + : opts?.body instanceof ArrayBuffer ? new DataView(opts.body) + : opts && ArrayBuffer.isView(opts?.body) ? new DataView(opts.body.buffer) + : opts?.body; + return { method, path, ...opts, body }; + }), + ); } getAPIList = AbstractPage>( @@ -257,25 +299,33 @@ export abstract class APIClient { const encoded = encoder.encode(body); return encoded.length.toString(); } + } else if (ArrayBuffer.isView(body)) { + return body.byteLength.toString(); } return null; } - buildRequest(options: FinalRequestOptions): { req: RequestInit; url: string; timeout: number } { - const { method, path, query, headers: headers = {} } = options; + async buildRequest( + inputOptions: FinalRequestOptions, + { retryCount = 0 }: { retryCount?: number } = {}, + ): Promise<{ req: RequestInit; url: string; timeout: number }> { + const options = { ...inputOptions }; + const { method, path, query, defaultBaseURL, headers: headers = {} } = options; const body = - isMultipartBody(options.body) ? options.body.body + ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? + options.body + : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url = this.buildURL(path!, query); + const url = this.buildURL(path!, query, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -288,11 +338,11 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } - const reqHeaders = this.buildHeaders({ options, headers, contentLength }); + const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); const req: RequestInit = { method, @@ -304,17 +354,19 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ options, headers, contentLength, + retryCount, }: { options: FinalRequestOptions; headers: Record; contentLength: string | null | undefined; + retryCount: number; }): Record { const reqHeaders: Record = {}; if (contentLength) { @@ -330,6 +382,23 @@ export abstract class APIClient { delete reqHeaders['content-type']; } + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. + if ( + getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && + getHeader(headers, 'x-stainless-retry-count') === undefined + ) { + reqHeaders['x-stainless-retry-count'] = String(retryCount); + } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); + } + this.validateHeaders(reqHeaders, headers); return reqHeaders; @@ -356,7 +425,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } @@ -365,7 +434,7 @@ export abstract class APIClient { error: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { return APIError.generate(status, error, message, headers); } @@ -381,13 +450,16 @@ export abstract class APIClient { retriesRemaining: number | null, ): Promise { const options = await optionsInput; + const maxRetries = options.maxRetries ?? this.maxRetries; if (retriesRemaining == null) { - retriesRemaining = options.maxRetries ?? this.maxRetries; + retriesRemaining = maxRetries; } await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); @@ -444,39 +516,28 @@ export abstract class APIClient { return new PagePromise(this, request, Page); } - buildURL(path: string, query: Req | null | undefined): string { + buildURL(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string { + const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query } as Req; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query } as Req; } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); } - protected stringifyQuery(query: Record): string { - return Object.entries(query) - .filter(([_, value]) => typeof value !== 'undefined') - .map(([key, value]) => { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new MaisaError( - `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, - ); - }) - .join('&'); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } async fetchWithTimeout( @@ -490,20 +551,24 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, fetchOptions).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); @@ -554,9 +619,9 @@ export abstract class APIClient { } } - // If the API asks us to wait a certain amount of time (and it's a reasonable amount), - // just do what it says, but otherwise calculate a default - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { + // If the API asks us to wait a certain amount of time, do what it says. + // Otherwise calculate a default. + if (timeoutMillis === undefined) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } @@ -636,9 +701,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -646,7 +711,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -689,7 +754,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; @@ -721,12 +786,15 @@ export type Headers = Record; export type DefaultQuery = Record; export type KeysEnum = { [P in keyof Required]: true }; -export type RequestOptions | Readable> = { +export type RequestOptions< + Req = unknown | Record | Readable | BlobLike | ArrayBufferView | ArrayBuffer, +> = { method?: HTTPMethod; path?: string; query?: Req | undefined; body?: Req | null | undefined; headers?: Headers | undefined; + defaultBaseURL?: string | undefined; maxRetries?: number; stream?: boolean | undefined; @@ -735,6 +803,7 @@ export type RequestOptions | Readable> = signal?: AbortSignal | undefined | null; idempotencyKey?: string; + __binaryRequest?: boolean | undefined; __binaryResponse?: boolean | undefined; }; @@ -747,6 +816,7 @@ const requestOptionsKeys: KeysEnum = { query: true, body: true, headers: true, + defaultBaseURL: true, maxRetries: true, stream: true, @@ -755,6 +825,7 @@ const requestOptionsKeys: KeysEnum = { signal: true, idempotencyKey: true, + __binaryRequest: true, __binaryResponse: true, }; @@ -767,10 +838,11 @@ export const isRequestOptions = (obj: unknown): obj is RequestOptions => { ); }; -export type FinalRequestOptions | Readable> = RequestOptions & { - method: HTTPMethod; - path: string; -}; +export type FinalRequestOptions | Readable | DataView> = + RequestOptions & { + method: HTTPMethod; + path: string; + }; declare const Deno: any; declare const EdgeRuntime: any; @@ -802,7 +874,8 @@ const getPlatformProperties = (): PlatformProperties => { 'X-Stainless-OS': normalizePlatform(Deno.build.os), 'X-Stainless-Arch': normalizeArch(Deno.build.arch), 'X-Stainless-Runtime': 'deno', - 'X-Stainless-Runtime-Version': Deno.version, + 'X-Stainless-Runtime-Version': + typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown', }; } if (typeof EdgeRuntime !== 'undefined') { @@ -938,8 +1011,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; @@ -958,6 +1031,11 @@ const validatePositiveInteger = (name: string, n: unknown): number => { export const castToError = (err: any): Error => { if (err instanceof Error) return err; + if (typeof err === 'object' && err !== null) { + try { + return new Error(JSON.stringify(err)); + } catch {} + } return new Error(err); }; @@ -975,10 +1053,10 @@ export const ensurePresent = (value: T | null | undefined): T => { */ export const readEnv = (env: string): string | undefined => { if (typeof process !== 'undefined') { - return process.env?.[env]?.trim() ?? undefined; + return process.env?.[env]?.trim() || undefined; } if (typeof Deno !== 'undefined') { - return Deno.env?.get?.(env)?.trim(); + return Deno.env?.get?.(env)?.trim() || undefined; } return undefined; }; @@ -1004,21 +1082,21 @@ export const coerceBoolean = (value: unknown): boolean => { }; export const maybeCoerceInteger = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceInteger(value); }; export const maybeCoerceFloat = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceFloat(value); }; export const maybeCoerceBoolean = (value: unknown): boolean | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceBoolean(value); @@ -1059,7 +1137,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void { } export function debug(action: string, ...args: any[]) { - if (typeof process !== 'undefined' && process.env['DEBUG'] === 'true') { + if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') { console.log(`Maisa:DEBUG:${action}`, ...args); } } @@ -1095,7 +1173,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => { return typeof headers?.get === 'function'; }; -export const getRequiredHeader = (headers: HeadersLike, header: string): string => { +export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => { + const foundHeader = getHeader(headers, header); + if (foundHeader === undefined) { + throw new Error(`Could not find ${header} header`); + } + return foundHeader; +}; + +export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => { const lowerCasedHeader = header.toLowerCase(); if (isHeadersProtocol(headers)) { // to deal with the case where the header looks like Stainless-Event-Id @@ -1121,7 +1207,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string } } - throw new Error(`Could not find ${header} header`); + return undefined; }; /** diff --git a/src/error.ts b/src/error.ts index 4f5e748..2ed28f6 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,20 +1,22 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { castToError, Headers } from './core'; export class MaisaError extends Error {} -export class APIError extends MaisaError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends MaisaError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; @@ -47,9 +49,9 @@ export class APIError extends MaisaError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { - if (!status) { - return new APIConnectionError({ cause: castToError(errorResponse) }); + ): APIError { + if (!status || !headers) { + return new APIConnectionError({ message, cause: castToError(errorResponse) }); } const error = errorResponse as Record; @@ -90,18 +92,14 @@ export class APIError extends MaisaError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - - constructor({ message, cause }: { message?: string; cause?: Error | undefined }) { +export class APIConnectionError extends APIError { + constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared // @ts-ignore @@ -115,32 +113,18 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} diff --git a/src/index.ts b/src/index.ts index 6cb1346..dcf2fd4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,20 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import { type Agent } from './_shims/index'; import * as Core from './core'; import * as Errors from './error'; -import { type Agent } from './_shims/index'; import * as Uploads from './uploads'; -import * as API from 'maisa/resources/index'; +import * as API from './resources/index'; +import { Kpu, KpuRunParams, KpuRunResponse } from './resources/kpu'; +import { + Capabilities, + CapabilityCompareParams, + CapabilityExtractParams, + CapabilitySummarizeParams, +} from './resources/capabilities/capabilities'; +import { FileInterpreter } from './resources/file-interpreter/file-interpreter'; +import { Mainet } from './resources/mainet/mainet'; +import { Models } from './resources/models/models'; export interface ClientOptions { /** @@ -25,8 +35,10 @@ 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. + * + * @unit milliseconds */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -34,7 +46,7 @@ export interface ClientOptions { * 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. @@ -50,7 +62,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -58,7 +70,7 @@ export interface ClientOptions { * 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. @@ -66,10 +78,12 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } -/** API Client for interfacing with the Maisa API. */ +/** + * API Client for interfacing with the Maisa API. + */ export class Maisa extends Core.APIClient { apiKey: string; @@ -106,11 +120,25 @@ export class Maisa extends Core.APIClient { super({ baseURL: options.baseURL!, + baseURLOverridden: baseURL ? baseURL !== 'https://api.maisa.ai' : false, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, fetch: options.fetch, }); + + const customHeadersEnv = Core.readEnv('MAISA_CUSTOM_HEADERS'); + if (customHeadersEnv) { + const parsed: Record = {}; + for (const line of customHeadersEnv.split('\n')) { + const colon = line.indexOf(':'); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + this._options = options; this.apiKey = apiKey; @@ -122,6 +150,13 @@ export class Maisa extends Core.APIClient { fileInterpreter: API.FileInterpreter = new API.FileInterpreter(this); mainet: API.Mainet = new API.Mainet(this); + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://api.maisa.ai'; + } + protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; } @@ -138,6 +173,7 @@ export class Maisa extends Core.APIClient { } static Maisa = this; + static DEFAULT_TIMEOUT = 60000; // 1 minute static MaisaError = Errors.MaisaError; static APIError = Errors.APIError; @@ -152,9 +188,42 @@ export class Maisa extends Core.APIClient { static InternalServerError = Errors.InternalServerError; static PermissionDeniedError = Errors.PermissionDeniedError; static UnprocessableEntityError = Errors.UnprocessableEntityError; + + static toFile = Uploads.toFile; + static fileFromPath = Uploads.fileFromPath; +} + +Maisa.Capabilities = Capabilities; +Maisa.Models = Models; +Maisa.Kpu = Kpu; +Maisa.FileInterpreter = FileInterpreter; +Maisa.Mainet = Mainet; + +export declare namespace Maisa { + export type RequestOptions = Core.RequestOptions; + + export { + Capabilities as Capabilities, + type CapabilityCompareParams as CapabilityCompareParams, + type CapabilityExtractParams as CapabilityExtractParams, + type CapabilitySummarizeParams as CapabilitySummarizeParams, + }; + + export { Models as Models }; + + export { Kpu as Kpu, type KpuRunResponse as KpuRunResponse, type KpuRunParams as KpuRunParams }; + + export { FileInterpreter as FileInterpreter }; + + export { Mainet as Mainet }; + + export type TextComparator = API.TextComparator; + export type TextExtractor = API.TextExtractor; + export type TextSummary = API.TextSummary; } -export const { +export { toFile, fileFromPath } from './uploads'; +export { MaisaError, APIError, APIConnectionError, @@ -168,36 +237,6 @@ export const { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} = Errors; - -export import toFile = Uploads.toFile; -export import fileFromPath = Uploads.fileFromPath; - -export namespace Maisa { - // Helper functions - export import toFile = Uploads.toFile; - export import fileFromPath = Uploads.fileFromPath; - - export import RequestOptions = Core.RequestOptions; - - export import Capabilities = API.Capabilities; - export import CapabilityCompareParams = API.CapabilityCompareParams; - export import CapabilityExtractParams = API.CapabilityExtractParams; - export import CapabilitySummarizeParams = API.CapabilitySummarizeParams; - - export import Models = API.Models; - - export import Kpu = API.Kpu; - export import KpuRunResponse = API.KpuRunResponse; - export import KpuRunParams = API.KpuRunParams; - - export import FileInterpreter = API.FileInterpreter; - - export import Mainet = API.Mainet; - - export import TextComparator = API.TextComparator; - export import TextExtractor = API.TextExtractor; - export import TextSummary = API.TextSummary; -} +} from './error'; export default Maisa; diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 0000000..99c33b1 --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { MaisaError } from '../../error'; + +/** + * Basic re-implementation of `qs.stringify` for primitive types. + */ +export function stringifyQuery(query: object | Record) { + return Object.entries(query) + .filter(([_, value]) => typeof value !== 'undefined') + .map(([key, value]) => { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + } + if (value === null) { + return `${encodeURIComponent(key)}=`; + } + throw new MaisaError( + `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, + ); + }) + .join('&'); +} diff --git a/src/resource.ts b/src/resource.ts index bafec39..75bbec9 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -1,8 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import type { Maisa } from './index'; -export class APIResource { +export abstract class APIResource { protected _client: Maisa; constructor(client: Maisa) { diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000..b283d57 --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; diff --git a/src/resources/capabilities.ts b/src/resources/capabilities.ts new file mode 100644 index 0000000..f756863 --- /dev/null +++ b/src/resources/capabilities.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './capabilities/index'; diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index 21f0af5..e41828c 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -1,16 +1,30 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as CapabilitiesAPI from 'maisa/resources/capabilities/capabilities'; -import * as Shared from 'maisa/resources/shared'; -import * as MediaAPI from 'maisa/resources/capabilities/media'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import * as MediaAPI from './media'; +import { Media, MediaCompareParams, MediaExtractParams, MediaSummarizeParams } from './media'; export class Capabilities extends APIResource { media: MediaAPI.Media = new MediaAPI.Media(this._client); /** * Compare extracts of text based on a specific data. + * + * @example + * ```ts + * const textComparator = await client.capabilities.compare({ + * text1: 'Lorem Ipsum dolor sit amet', + * text2: 'Sed ut perspiciatis unde omnis', + * variables: { + * name: { + * description: 'The name of the person.', + * type: 'string', + * }, + * }, + * }); + * ``` */ compare( body: CapabilityCompareParams, @@ -22,6 +36,19 @@ export class Capabilities extends APIResource { /** * Extracts structured data from text. The text is analyzed and the variables are * extracted. + * + * @example + * ```ts + * const textExtractor = await client.capabilities.extract({ + * text: 'My name is John Doe', + * variables: { + * name: { + * description: 'The name of the person.', + * type: 'string', + * }, + * }, + * }); + * ``` */ extract( body: CapabilityExtractParams, @@ -32,6 +59,13 @@ export class Capabilities extends APIResource { /** * Summarizes a text. The summary is returned in the format and length specified. + * + * @example + * ```ts + * const textSummary = await client.capabilities.summarize({ + * text: 'Lorem Ipsum dolor sit amet', + * }); + * ``` */ summarize( body: CapabilitySummarizeParams, @@ -55,7 +89,7 @@ export interface CapabilityCompareParams { /** * The variables to be compared. */ - variables: Record; + variables: { [key: string]: CapabilityCompareParams.Variables }; /** * The language of the output. If not provided, the language used will be the same @@ -92,7 +126,7 @@ export interface CapabilityExtractParams { /** * The variables to be extracted from the text. */ - variables: Record; + variables: { [key: string]: CapabilityExtractParams.Variables }; /** * The language of the output. If not provided, the language used will be the same @@ -147,12 +181,19 @@ export interface CapabilitySummarizeParams { summary_hint?: string; } -export namespace Capabilities { - export import CapabilityCompareParams = CapabilitiesAPI.CapabilityCompareParams; - export import CapabilityExtractParams = CapabilitiesAPI.CapabilityExtractParams; - export import CapabilitySummarizeParams = CapabilitiesAPI.CapabilitySummarizeParams; - export import Media = MediaAPI.Media; - export import MediaCompareParams = MediaAPI.MediaCompareParams; - export import MediaExtractParams = MediaAPI.MediaExtractParams; - export import MediaSummarizeParams = MediaAPI.MediaSummarizeParams; +Capabilities.Media = Media; + +export declare namespace Capabilities { + export { + type CapabilityCompareParams as CapabilityCompareParams, + type CapabilityExtractParams as CapabilityExtractParams, + type CapabilitySummarizeParams as CapabilitySummarizeParams, + }; + + export { + Media as Media, + type MediaCompareParams as MediaCompareParams, + type MediaExtractParams as MediaExtractParams, + type MediaSummarizeParams as MediaSummarizeParams, + }; } diff --git a/src/resources/capabilities/index.ts b/src/resources/capabilities/index.ts index 94c7780..44372af 100644 --- a/src/resources/capabilities/index.ts +++ b/src/resources/capabilities/index.ts @@ -1,9 +1,9 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - CapabilityCompareParams, - CapabilityExtractParams, - CapabilitySummarizeParams, Capabilities, + type CapabilityCompareParams, + type CapabilityExtractParams, + type CapabilitySummarizeParams, } from './capabilities'; -export { MediaCompareParams, MediaExtractParams, MediaSummarizeParams, Media } from './media'; +export { Media, type MediaCompareParams, type MediaExtractParams, type MediaSummarizeParams } from './media'; diff --git a/src/resources/capabilities/media.ts b/src/resources/capabilities/media.ts index cfdc57d..d603ac8 100644 --- a/src/resources/capabilities/media.ts +++ b/src/resources/capabilities/media.ts @@ -1,54 +1,76 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as MediaAPI from 'maisa/resources/capabilities/media'; -import * as Shared from 'maisa/resources/shared'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; export class Media extends APIResource { /** * Compare extracts of media files based on a specific data. This endpoint supports * an additional field `model` documented in this url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textComparator = + * await client.capabilities.media.compare({ + * file1: fs.createReadStream('path/to/file'), + * file2: fs.createReadStream('path/to/file'), + * }); + * ``` */ compare(body: MediaCompareParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/compare/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } /** * Extracts structured data from a file. The text is analyzed and the variables are * extracted. This endpoint supports an additional field `model` documented in this - * url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * url: https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textExtractor = + * await client.capabilities.media.extract({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` */ extract(body: MediaExtractParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/extract/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } /** * Summarizes a media file. This endpoint supports an additional field `model` * documented in this url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textSummary = + * await client.capabilities.media.summarize({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` */ summarize(body: MediaSummarizeParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/summarize/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } export interface MediaCompareParams { - file1: Uploadable; + file1: Core.Uploadable; - file2: Uploadable; + file2: Core.Uploadable; /** * The language of the output. If not provided, the language used will be the same @@ -123,7 +145,7 @@ export interface MediaCompareParams { } export interface MediaExtractParams { - file: Uploadable; + file: Core.Uploadable; /** * The language of the output. If not provided, the language used will be the same @@ -193,7 +215,7 @@ export interface MediaExtractParams { } export interface MediaSummarizeParams { - file: Uploadable; + file: Core.Uploadable; /** * Text Summary Request Format. @@ -217,8 +239,10 @@ export interface MediaSummarizeParams { summary_hint?: string; } -export namespace Media { - export import MediaCompareParams = MediaAPI.MediaCompareParams; - export import MediaExtractParams = MediaAPI.MediaExtractParams; - export import MediaSummarizeParams = MediaAPI.MediaSummarizeParams; +export declare namespace Media { + export { + type MediaCompareParams as MediaCompareParams, + type MediaExtractParams as MediaExtractParams, + type MediaSummarizeParams as MediaSummarizeParams, + }; } diff --git a/src/resources/file-interpreter.ts b/src/resources/file-interpreter.ts new file mode 100644 index 0000000..1771c08 --- /dev/null +++ b/src/resources/file-interpreter.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './file-interpreter/index'; diff --git a/src/resources/file-interpreter/file-interpreter.ts b/src/resources/file-interpreter/file-interpreter.ts index 18c8820..9dcb7e8 100644 --- a/src/resources/file-interpreter/file-interpreter.ts +++ b/src/resources/file-interpreter/file-interpreter.ts @@ -1,34 +1,65 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as FromAudioAPI from 'maisa/resources/file-interpreter/from-audio'; -import * as FromDocxAPI from 'maisa/resources/file-interpreter/from-docx'; -import * as FromHTMLAPI from 'maisa/resources/file-interpreter/from-html'; -import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; -import * as FromPdfAPI from 'maisa/resources/file-interpreter/from-pdf'; +import { APIResource } from '../../resource'; +import * as FromAudioAPI from './from-audio'; +import { FromAudio, FromAudioCreateParams, FromAudioCreateResponse } from './from-audio'; +import * as FromDocxAPI from './from-docx'; +import { FromDocx, FromDocxCreateParams, FromDocxCreateResponse } from './from-docx'; +import * as FromHTMLAPI from './from-html'; +import { FromHTML, FromHTMLCreateParams, FromHTMLCreateResponse } from './from-html'; +import * as FromImageAPI from './from-image'; +import { FromImage, FromImageCreateParams, FromImageCreateResponse } from './from-image'; +import * as FromPdfAPI from './from-pdf'; +import { FromPdf, FromPdfCreateParams, FromPdfCreateResponse } from './from-pdf'; +import * as FromPdfScannedAPI from './from-pdf-scanned'; +import { FromPdfScanned } from './from-pdf-scanned'; export class FileInterpreter extends APIResource { fromPdf: FromPdfAPI.FromPdf = new FromPdfAPI.FromPdf(this._client); + fromPdfScanned: FromPdfScannedAPI.FromPdfScanned = new FromPdfScannedAPI.FromPdfScanned(this._client); fromDocx: FromDocxAPI.FromDocx = new FromDocxAPI.FromDocx(this._client); fromHTML: FromHTMLAPI.FromHTML = new FromHTMLAPI.FromHTML(this._client); - fromImage: FromImageAPI.FromImageResource = new FromImageAPI.FromImageResource(this._client); + fromImage: FromImageAPI.FromImage = new FromImageAPI.FromImage(this._client); fromAudio: FromAudioAPI.FromAudio = new FromAudioAPI.FromAudio(this._client); } -export namespace FileInterpreter { - export import FromPdf = FromPdfAPI.FromPdf; - export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; - export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; - export import FromDocx = FromDocxAPI.FromDocx; - export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; - export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; - export import FromHTML = FromHTMLAPI.FromHTML; - export import FromHTMLCreateResponse = FromHTMLAPI.FromHTMLCreateResponse; - export import FromHTMLCreateParams = FromHTMLAPI.FromHTMLCreateParams; - export import FromImageResource = FromImageAPI.FromImageResource; - export import FromImage = FromImageAPI.FromImage; - export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; - export import FromAudio = FromAudioAPI.FromAudio; - export import FromAudioCreateResponse = FromAudioAPI.FromAudioCreateResponse; - export import FromAudioCreateParams = FromAudioAPI.FromAudioCreateParams; +FileInterpreter.FromPdf = FromPdf; +FileInterpreter.FromPdfScanned = FromPdfScanned; +FileInterpreter.FromDocx = FromDocx; +FileInterpreter.FromHTML = FromHTML; +FileInterpreter.FromImage = FromImage; +FileInterpreter.FromAudio = FromAudio; + +export declare namespace FileInterpreter { + export { + FromPdf as FromPdf, + type FromPdfCreateResponse as FromPdfCreateResponse, + type FromPdfCreateParams as FromPdfCreateParams, + }; + + export { FromPdfScanned as FromPdfScanned }; + + export { + FromDocx as FromDocx, + type FromDocxCreateResponse as FromDocxCreateResponse, + type FromDocxCreateParams as FromDocxCreateParams, + }; + + export { + FromHTML as FromHTML, + type FromHTMLCreateResponse as FromHTMLCreateResponse, + type FromHTMLCreateParams as FromHTMLCreateParams, + }; + + export { + FromImage as FromImage, + type FromImageCreateResponse as FromImageCreateResponse, + type FromImageCreateParams as FromImageCreateParams, + }; + + export { + FromAudio as FromAudio, + type FromAudioCreateResponse as FromAudioCreateResponse, + type FromAudioCreateParams as FromAudioCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-audio.ts b/src/resources/file-interpreter/from-audio.ts index 8dd0cb9..b311eb5 100644 --- a/src/resources/file-interpreter/from-audio.ts +++ b/src/resources/file-interpreter/from-audio.ts @@ -1,9 +1,7 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromAudioAPI from 'maisa/resources/file-interpreter/from-audio'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromAudio extends APIResource { /** @@ -12,7 +10,7 @@ export class FromAudio extends APIResource { create(body: FromAudioCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-audio', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromAudio extends APIResource { export type FromAudioCreateResponse = unknown; export interface FromAudioCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromAudio { - export import FromAudioCreateResponse = FromAudioAPI.FromAudioCreateResponse; - export import FromAudioCreateParams = FromAudioAPI.FromAudioCreateParams; +export declare namespace FromAudio { + export { + type FromAudioCreateResponse as FromAudioCreateResponse, + type FromAudioCreateParams as FromAudioCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-docx.ts b/src/resources/file-interpreter/from-docx.ts index 8794d02..e0245a9 100644 --- a/src/resources/file-interpreter/from-docx.ts +++ b/src/resources/file-interpreter/from-docx.ts @@ -1,9 +1,7 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromDocxAPI from 'maisa/resources/file-interpreter/from-docx'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromDocx extends APIResource { /** @@ -12,7 +10,7 @@ export class FromDocx extends APIResource { create(body: FromDocxCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-docx', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromDocx extends APIResource { export type FromDocxCreateResponse = unknown; export interface FromDocxCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromDocx { - export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; - export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; +export declare namespace FromDocx { + export { + type FromDocxCreateResponse as FromDocxCreateResponse, + type FromDocxCreateParams as FromDocxCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-html.ts b/src/resources/file-interpreter/from-html.ts index 77ca141..b3bbd40 100644 --- a/src/resources/file-interpreter/from-html.ts +++ b/src/resources/file-interpreter/from-html.ts @@ -1,9 +1,7 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromHTMLAPI from 'maisa/resources/file-interpreter/from-html'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromHTML extends APIResource { /** @@ -12,7 +10,7 @@ export class FromHTML extends APIResource { create(body: FromHTMLCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-html', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromHTML extends APIResource { export type FromHTMLCreateResponse = unknown; export interface FromHTMLCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromHTML { - export import FromHTMLCreateResponse = FromHTMLAPI.FromHTMLCreateResponse; - export import FromHTMLCreateParams = FromHTMLAPI.FromHTMLCreateParams; +export declare namespace FromHTML { + export { + type FromHTMLCreateResponse as FromHTMLCreateResponse, + type FromHTMLCreateParams as FromHTMLCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-image.ts b/src/resources/file-interpreter/from-image.ts index c5cb15e..f41c79e 100644 --- a/src/resources/file-interpreter/from-image.ts +++ b/src/resources/file-interpreter/from-image.ts @@ -1,31 +1,29 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class FromImageResource extends APIResource { +export class FromImage extends APIResource { /** * Interprets an image file and returns a description of the image. */ - create(body: FromImageCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(body: FromImageCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-image', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } -export interface FromImage { - imageCaption: string; -} +export type FromImageCreateResponse = unknown; export interface FromImageCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromImageResource { - export import FromImage = FromImageAPI.FromImage; - export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; +export declare namespace FromImage { + export { + type FromImageCreateResponse as FromImageCreateResponse, + type FromImageCreateParams as FromImageCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-pdf-scanned.ts b/src/resources/file-interpreter/from-pdf-scanned.ts new file mode 100644 index 0000000..c0ebdc1 --- /dev/null +++ b/src/resources/file-interpreter/from-pdf-scanned.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class FromPdfScanned extends APIResource {} diff --git a/src/resources/file-interpreter/from-pdf.ts b/src/resources/file-interpreter/from-pdf.ts index 845a318..2d49b2d 100644 --- a/src/resources/file-interpreter/from-pdf.ts +++ b/src/resources/file-interpreter/from-pdf.ts @@ -1,9 +1,7 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromPdfAPI from 'maisa/resources/file-interpreter/from-pdf'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromPdf extends APIResource { /** @@ -13,7 +11,7 @@ export class FromPdf extends APIResource { const { max_pages, ...body } = params; return this._client.post( '/v1/file-interpreter/from-pdf', - multipartFormRequestOptions({ query: { max_pages }, body, ...options }), + Core.multipartFormRequestOptions({ query: { max_pages }, body, ...options }), ); } } @@ -22,17 +20,19 @@ export type FromPdfCreateResponse = unknown; export interface FromPdfCreateParams { /** - * Body param: + * Body param */ - file: Uploadable; + file: Core.Uploadable; /** - * Query param: + * Query param */ max_pages?: number | null; } -export namespace FromPdf { - export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; - export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; +export declare namespace FromPdf { + export { + type FromPdfCreateResponse as FromPdfCreateResponse, + type FromPdfCreateParams as FromPdfCreateParams, + }; } diff --git a/src/resources/file-interpreter/index.ts b/src/resources/file-interpreter/index.ts index 686c1cf..6971d74 100644 --- a/src/resources/file-interpreter/index.ts +++ b/src/resources/file-interpreter/index.ts @@ -1,8 +1,9 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { FileInterpreter } from './file-interpreter'; -export { FromAudioCreateResponse, FromAudioCreateParams, FromAudio } from './from-audio'; -export { FromDocxCreateResponse, FromDocxCreateParams, FromDocx } from './from-docx'; -export { FromHTMLCreateResponse, FromHTMLCreateParams, FromHTML } from './from-html'; -export { FromImage, FromImageCreateParams, FromImageResource } from './from-image'; -export { FromPdfCreateResponse, FromPdfCreateParams, FromPdf } from './from-pdf'; +export { FromAudio, type FromAudioCreateResponse, type FromAudioCreateParams } from './from-audio'; +export { FromDocx, type FromDocxCreateResponse, type FromDocxCreateParams } from './from-docx'; +export { FromHTML, type FromHTMLCreateResponse, type FromHTMLCreateParams } from './from-html'; +export { FromImage, type FromImageCreateResponse, type FromImageCreateParams } from './from-image'; +export { FromPdf, type FromPdfCreateResponse, type FromPdfCreateParams } from './from-pdf'; +export { FromPdfScanned } from './from-pdf-scanned'; diff --git a/src/resources/index.ts b/src/resources/index.ts index ebb2d3a..6fbde78 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,13 +1,13 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export * from './shared'; export { - CapabilityCompareParams, - CapabilityExtractParams, - CapabilitySummarizeParams, Capabilities, + type CapabilityCompareParams, + type CapabilityExtractParams, + type CapabilitySummarizeParams, } from './capabilities/capabilities'; export { FileInterpreter } from './file-interpreter/file-interpreter'; -export { KpuRunResponse, KpuRunParams, Kpu } from './kpu'; +export { Kpu, type KpuRunResponse, type KpuRunParams } from './kpu'; export { Mainet } from './mainet/mainet'; export { Models } from './models/models'; diff --git a/src/resources/kpu.ts b/src/resources/kpu.ts index d9f30e7..dd64522 100644 --- a/src/resources/kpu.ts +++ b/src/resources/kpu.ts @@ -1,70 +1,24 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as KpuAPI from 'maisa/resources/kpu'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../resource'; +import * as Core from '../core'; export class Kpu extends APIResource { /** * Executes the KPU in sync, sending the response when the KPU execution is done. + * The KPU beta is currently available for selected users. Submit your request to + * be granted access: https://maisa.ai */ - run(params: KpuRunParams, options?: Core.RequestOptions): Core.APIPromise { + run(params: KpuRunParams, options?: Core.RequestOptions): Core.APIPromise { const { explain_steps, retries, ...body } = params; return this._client.post( '/v1/kpu/run', - multipartFormRequestOptions({ query: { explain_steps, retries }, body, ...options }), + Core.multipartFormRequestOptions({ query: { explain_steps, retries }, body, ...options }), ); } } -export interface KpuRunResponse { - /** - * Array of the intents executed by the KPU. - */ - intents: Array; - - /** - * The result of the KPU execution. The result may be invalid if none of the - * intents were successful. - */ - result: string; - - /** - * Key-value of the files generated by the KPU. - */ - downloadable_files?: Record; -} - -export namespace KpuRunResponse { - export interface Intent { - /** - * Array of the steps of the intent explained in natural language. This field is an - * ampty array if `explain_steps` param is set to `false` - */ - explain_steps: Array; - - /** - * Intent number, starting from 0. - */ - intent: number; - - /** - * The result of the intent. - */ - result: string; - - /** - * Whether the intent was interpreted as solved by the KPU or not. - */ - solved: boolean; - - /** - * Key-value of the files generated by the KPU. - */ - downloadable_files?: Record; - } -} +export type KpuRunResponse = unknown; export interface KpuRunParams { /** @@ -89,10 +43,28 @@ export interface KpuRunParams { /** * Body param: Files to be used in the KPU execution. Files can be of any type. */ - file?: Array; + file?: Array; + + /** + * Body param + */ + reasoner_model?: + | 'gpt-4-turbo' + | 'mistral-large' + | 'gpt-3.5-turbo' + | 'claude-3-sonnet' + | 'claude-3-opus' + | 'gemini-pro' + | 'azure/gpt-4-turbo' + | 'openai/gpt-4-turbo' + | null; + + /** + * Body param + */ + reasoner_prompt?: string | null; } -export namespace Kpu { - export import KpuRunResponse = KpuAPI.KpuRunResponse; - export import KpuRunParams = KpuAPI.KpuRunParams; +export declare namespace Kpu { + export { type KpuRunResponse as KpuRunResponse, type KpuRunParams as KpuRunParams }; } diff --git a/src/resources/mainet.ts b/src/resources/mainet.ts new file mode 100644 index 0000000..72ada94 --- /dev/null +++ b/src/resources/mainet.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './mainet/index'; diff --git a/src/resources/mainet/index.ts b/src/resources/mainet/index.ts index bed9ddb..38ae44a 100644 --- a/src/resources/mainet/index.ts +++ b/src/resources/mainet/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Mainet } from './mainet'; -export { Search, SearchCreateParams, SearchResource } from './search'; +export { Search } from './search'; diff --git a/src/resources/mainet/mainet.ts b/src/resources/mainet/mainet.ts index 83c2034..78f0ed9 100644 --- a/src/resources/mainet/mainet.ts +++ b/src/resources/mainet/mainet.ts @@ -1,14 +1,15 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as SearchAPI from 'maisa/resources/mainet/search'; +import { APIResource } from '../../resource'; +import * as SearchAPI from './search'; +import { Search } from './search'; export class Mainet extends APIResource { - search: SearchAPI.SearchResource = new SearchAPI.SearchResource(this._client); + search: SearchAPI.Search = new SearchAPI.Search(this._client); } -export namespace Mainet { - export import SearchResource = SearchAPI.SearchResource; - export import Search = SearchAPI.Search; - export import SearchCreateParams = SearchAPI.SearchCreateParams; +Mainet.Search = Search; + +export declare namespace Mainet { + export { Search as Search }; } diff --git a/src/resources/mainet/search.ts b/src/resources/mainet/search.ts index c4c8f5e..72dd2c1 100644 --- a/src/resources/mainet/search.ts +++ b/src/resources/mainet/search.ts @@ -1,52 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as SearchAPI from 'maisa/resources/mainet/search'; +import { APIResource } from '../../resource'; -export class SearchResource extends APIResource { - /** - * Finds content in mainet network - */ - create(body: SearchCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/v1/mainet/search', { body, ...options }); - } -} - -export interface Search { - /** - * The list of documents found. - */ - docs: Array; -} - -export namespace Search { - export interface Doc { - /** - * The id of the document. - */ - id: string; - - /** - * The content of the document. - */ - content: string; - - /** - * The source of the document. - */ - source: string; - } -} - -export interface SearchCreateParams { - /** - * The text or query to search for. - */ - text: string; -} - -export namespace SearchResource { - export import Search = SearchAPI.Search; - export import SearchCreateParams = SearchAPI.SearchCreateParams; -} +export class Search extends APIResource {} diff --git a/src/resources/models.ts b/src/resources/models.ts new file mode 100644 index 0000000..8ce5add --- /dev/null +++ b/src/resources/models.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './models/index'; diff --git a/src/resources/models/embeddings.ts b/src/resources/models/embeddings.ts index 31359bc..5d91496 100644 --- a/src/resources/models/embeddings.ts +++ b/src/resources/models/embeddings.ts @@ -1,12 +1,21 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as EmbeddingsAPI from 'maisa/resources/models/embeddings'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class Embeddings extends APIResource { /** * Creates embeddings from pieces of text. + * + * @example + * ```ts + * const embeddings = await client.models.embeddings.create({ + * texts: [ + * 'Who invented the light bulb?', + * 'Hey, how are you?', + * ], + * }); + * ``` */ create(body: EmbeddingCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/v1/models/embeddings', { body, ...options }); @@ -27,7 +36,6 @@ export interface EmbeddingCreateParams { texts: Array; } -export namespace Embeddings { - export import Embeddings = EmbeddingsAPI.Embeddings; - export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; +export declare namespace Embeddings { + export { type Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams }; } diff --git a/src/resources/models/index.ts b/src/resources/models/index.ts index 71c6e7a..2adeb18 100644 --- a/src/resources/models/index.ts +++ b/src/resources/models/index.ts @@ -1,5 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Embeddings, EmbeddingCreateParams } from './embeddings'; +export { Embeddings, type EmbeddingCreateParams } from './embeddings'; export { Models } from './models'; -export { Rerank, RerankCreateParams, RerankResource } from './rerank'; +export { Rerank } from './rerank'; diff --git a/src/resources/models/models.ts b/src/resources/models/models.ts index adfe565..8ab7dc6 100644 --- a/src/resources/models/models.ts +++ b/src/resources/models/models.ts @@ -1,18 +1,20 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as EmbeddingsAPI from 'maisa/resources/models/embeddings'; -import * as RerankAPI from 'maisa/resources/models/rerank'; +import { APIResource } from '../../resource'; +import * as EmbeddingsAPI from './embeddings'; +import { EmbeddingCreateParams, Embeddings } from './embeddings'; +import * as RerankAPI from './rerank'; +import { Rerank } from './rerank'; export class Models extends APIResource { embeddings: EmbeddingsAPI.Embeddings = new EmbeddingsAPI.Embeddings(this._client); - rerank: RerankAPI.RerankResource = new RerankAPI.RerankResource(this._client); + rerank: RerankAPI.Rerank = new RerankAPI.Rerank(this._client); } -export namespace Models { - export import Embeddings = EmbeddingsAPI.Embeddings; - export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; - export import RerankResource = RerankAPI.RerankResource; - export import Rerank = RerankAPI.Rerank; - export import RerankCreateParams = RerankAPI.RerankCreateParams; +Models.Rerank = Rerank; + +export declare namespace Models { + export { type Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams }; + + export { Rerank as Rerank }; } diff --git a/src/resources/models/rerank.ts b/src/resources/models/rerank.ts index 8e49676..9c014bd 100644 --- a/src/resources/models/rerank.ts +++ b/src/resources/models/rerank.ts @@ -1,35 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as RerankAPI from 'maisa/resources/models/rerank'; +import { APIResource } from '../../resource'; -export class RerankResource extends APIResource { - /** - * Rerank the sentences based on the similarity with the source sentence. - */ - create(body: RerankCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/v1/models/rerank', { body, ...options }); - } -} - -export interface Rerank { - sorted_sentences: Array; -} - -export interface RerankCreateParams { - /** - * A list of sentences to be reranked. - */ - sentences: Array; - - /** - * The sentence to be used as a reference to rerank the sentences. - */ - source_sentence: string; -} - -export namespace RerankResource { - export import Rerank = RerankAPI.Rerank; - export import RerankCreateParams = RerankAPI.RerankCreateParams; -} +export class Rerank extends APIResource {} diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 5660544..e6b315e 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. /** * Texts Comparator Response. diff --git a/src/uploads.ts b/src/uploads.ts index 2398baf..8fd2154 100644 --- a/src/uploads.ts +++ b/src/uploads.ts @@ -102,23 +102,33 @@ export type ToFileInput = Uploadable | Exclude | AsyncIter export async function toFile( value: ToFileInput | PromiseLike, name?: string | null | undefined, - options: FilePropertyBag | undefined = {}, + options?: FilePropertyBag | undefined, ): Promise { // If it's a promise, resolve it. value = await value; + // If we've been given a `File` we don't need to do anything + if (isFileLike(value)) { + return value; + } + if (isResponseLike(value)) { const blob = await value.blob(); name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file'; - return new File([blob as any], name, options); + // we need to convert the `Blob` into an array buffer because the `Blob` class + // that `node-fetch` defines is incompatible with the web standard which results + // in `new File` interpreting it as a string instead of binary data. + const data = isBlobLike(blob) ? [(await blob.arrayBuffer()) as any] : [blob]; + + return new File(data, name, options); } const bits = await getBytes(value); name ||= getName(value) ?? 'unknown_file'; - if (!options.type) { + if (!options?.type) { const type = (bits[0] as any)?.type; if (typeof type === 'string') { options = { ...options, type }; diff --git a/src/version.ts b/src/version.ts index a528f63..a64b06c 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.2'; // x-release-please-version +export const VERSION = '0.1.0-alpha.3'; // x-release-please-version diff --git a/tests/api-resources/capabilities/capabilities.test.ts b/tests/api-resources/capabilities/capabilities.test.ts index 3f12ed2..ff0a76f 100644 --- a/tests/api-resources/capabilities/capabilities.test.ts +++ b/tests/api-resources/capabilities/capabilities.test.ts @@ -1,19 +1,19 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource capabilities', () => { test('compare: only required params', async () => { - const responsePromise = maisa.capabilities.compare({ + const responsePromise = client.capabilities.compare({ text1: 'Lorem Ipsum dolor sit amet', text2: 'Sed ut perspiciatis unde omnis', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,19 +25,19 @@ describe('resource capabilities', () => { }); test('compare: required and optional params', async () => { - const response = await maisa.capabilities.compare({ + const response = await client.capabilities.compare({ text1: 'Lorem Ipsum dolor sit amet', text2: 'Sed ut perspiciatis unde omnis', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, lang: 'en', prompt: 'Compare the value for end customer.', }); }); test('extract: only required params', async () => { - const responsePromise = maisa.capabilities.extract({ - text: 'Example long text...', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + const responsePromise = client.capabilities.extract({ + text: 'My name is John Doe', + variables: { name: { description: 'The name of the person.', type: 'string' } }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -49,15 +49,15 @@ describe('resource capabilities', () => { }); test('extract: required and optional params', async () => { - const response = await maisa.capabilities.extract({ - text: 'Example long text...', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + const response = await client.capabilities.extract({ + text: 'My name is John Doe', + variables: { name: { description: 'The name of the person.', type: 'string' } }, lang: 'en', }); }); test('summarize: only required params', async () => { - const responsePromise = maisa.capabilities.summarize({ text: 'Example long text...' }); + const responsePromise = client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -68,11 +68,11 @@ describe('resource capabilities', () => { }); test('summarize: required and optional params', async () => { - const response = await maisa.capabilities.summarize({ - text: 'Example long text...', + const response = await client.capabilities.summarize({ + text: 'Lorem Ipsum dolor sit amet', format: 'paragraph', lang: 'en', - length: 'medium', + length: 'long', summary_hint: 'Example summary of the text...', }); }); diff --git a/tests/api-resources/capabilities/media.test.ts b/tests/api-resources/capabilities/media.test.ts index 52226ab..f948f32 100644 --- a/tests/api-resources/capabilities/media.test.ts +++ b/tests/api-resources/capabilities/media.test.ts @@ -1,18 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource media', () => { test('compare: only required params', async () => { - const responsePromise = maisa.capabilities.media.compare({ - file1: await toFile(Buffer.from('# my file contents'), 'README.md'), - file2: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.capabilities.media.compare({ + file1: await toFile(Buffer.from('Example data'), 'README.md'), + file2: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,9 +24,9 @@ describe('resource media', () => { }); test('compare: required and optional params', async () => { - const response = await maisa.capabilities.media.compare({ - file1: await toFile(Buffer.from('# my file contents'), 'README.md'), - file2: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.capabilities.media.compare({ + file1: await toFile(Buffer.from('Example data'), 'README.md'), + file2: await toFile(Buffer.from('Example data'), 'README.md'), lang: 'en', prompt: 'Compare the value for end customer.', variable1_description: 'The name of the person.', @@ -45,8 +45,8 @@ describe('resource media', () => { }); test('extract: only required params', async () => { - const responsePromise = maisa.capabilities.media.extract({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.capabilities.media.extract({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -58,8 +58,8 @@ describe('resource media', () => { }); test('extract: required and optional params', async () => { - const response = await maisa.capabilities.media.extract({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.capabilities.media.extract({ + file: await toFile(Buffer.from('Example data'), 'README.md'), lang: 'en', variable1_description: 'The name of the person.', variable1_name: 'Name', @@ -77,8 +77,8 @@ describe('resource media', () => { }); test('summarize: only required params', async () => { - const responsePromise = maisa.capabilities.media.summarize({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.capabilities.media.summarize({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -90,8 +90,8 @@ describe('resource media', () => { }); test('summarize: required and optional params', async () => { - const response = await maisa.capabilities.media.summarize({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.capabilities.media.summarize({ + file: await toFile(Buffer.from('Example data'), 'README.md'), format: 'paragraph', lang: 'en', length: 'short', diff --git a/tests/api-resources/file-interpreter/from-audio.test.ts b/tests/api-resources/file-interpreter/from-audio.test.ts index 5536b9e..3278ebf 100644 --- a/tests/api-resources/file-interpreter/from-audio.test.ts +++ b/tests/api-resources/file-interpreter/from-audio.test.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromAudio', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromAudio.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.fileInterpreter.fromAudio.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,8 +23,8 @@ describe('resource fromAudio', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromAudio.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.fileInterpreter.fromAudio.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-docx.test.ts b/tests/api-resources/file-interpreter/from-docx.test.ts index a9875f8..9e9820f 100644 --- a/tests/api-resources/file-interpreter/from-docx.test.ts +++ b/tests/api-resources/file-interpreter/from-docx.test.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromDocx', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromDocx.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.fileInterpreter.fromDocx.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,8 +23,8 @@ describe('resource fromDocx', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromDocx.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.fileInterpreter.fromDocx.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-html.test.ts b/tests/api-resources/file-interpreter/from-html.test.ts index fece251..855019f 100644 --- a/tests/api-resources/file-interpreter/from-html.test.ts +++ b/tests/api-resources/file-interpreter/from-html.test.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromHTML', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromHTML.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.fileInterpreter.fromHTML.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,8 +23,8 @@ describe('resource fromHTML', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromHTML.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.fileInterpreter.fromHTML.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-image.test.ts b/tests/api-resources/file-interpreter/from-image.test.ts index 4376ed4..adaac75 100644 --- a/tests/api-resources/file-interpreter/from-image.test.ts +++ b/tests/api-resources/file-interpreter/from-image.test.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromImage', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromImage.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.fileInterpreter.fromImage.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,8 +23,8 @@ describe('resource fromImage', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromImage.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.fileInterpreter.fromImage.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-pdf.test.ts b/tests/api-resources/file-interpreter/from-pdf.test.ts index d680c9a..d58ce17 100644 --- a/tests/api-resources/file-interpreter/from-pdf.test.ts +++ b/tests/api-resources/file-interpreter/from-pdf.test.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromPdf', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromPdf.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const responsePromise = client.fileInterpreter.fromPdf.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,8 +23,8 @@ describe('resource fromPdf', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromPdf.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + const response = await client.fileInterpreter.fromPdf.create({ + file: await toFile(Buffer.from('Example data'), 'README.md'), max_pages: 0, }); }); diff --git a/tests/api-resources/kpu.test.ts b/tests/api-resources/kpu.test.ts index 1369973..5a2da2d 100644 --- a/tests/api-resources/kpu.test.ts +++ b/tests/api-resources/kpu.test.ts @@ -1,16 +1,16 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource kpu', () => { test('run: only required params', async () => { - const responsePromise = maisa.kpu.run({ query: 'string' }); + const responsePromise = client.kpu.run({ query: 'query' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,15 +21,13 @@ describe('resource kpu', () => { }); test('run: required and optional params', async () => { - const response = await maisa.kpu.run({ - query: 'string', + const response = await client.kpu.run({ + query: 'query', explain_steps: true, retries: 1, - file: [ - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ], + file: [await toFile(Buffer.from('Example data'), 'README.md')], + reasoner_model: 'gpt-4-turbo', + reasoner_prompt: 'reasoner_prompt', }); }); }); diff --git a/tests/api-resources/mainet/search.test.ts b/tests/api-resources/mainet/search.test.ts deleted file mode 100644 index 7c6293e..0000000 --- a/tests/api-resources/mainet/search.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Maisa from 'maisa'; -import { Response } from 'node-fetch'; - -const maisa = new Maisa({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource search', () => { - test('create: only required params', async () => { - const responsePromise = maisa.mainet.search.create({ - text: 'Plato, the philosopher, was born in Athens.', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await maisa.mainet.search.create({ - text: 'Plato, the philosopher, was born in Athens.', - }); - }); -}); diff --git a/tests/api-resources/models/embeddings.test.ts b/tests/api-resources/models/embeddings.test.ts index 583b402..57dcf7a 100644 --- a/tests/api-resources/models/embeddings.test.ts +++ b/tests/api-resources/models/embeddings.test.ts @@ -1,16 +1,18 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource embeddings', () => { test('create: only required params', async () => { - const responsePromise = maisa.models.embeddings.create({ texts: ['string'] }); + const responsePromise = client.models.embeddings.create({ + texts: ['Who invented the light bulb?', 'Hey, how are you?'], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,6 +23,8 @@ describe('resource embeddings', () => { }); test('create: required and optional params', async () => { - const response = await maisa.models.embeddings.create({ texts: ['string'] }); + const response = await client.models.embeddings.create({ + texts: ['Who invented the light bulb?', 'Hey, how are you?'], + }); }); }); diff --git a/tests/api-resources/models/rerank.test.ts b/tests/api-resources/models/rerank.test.ts deleted file mode 100644 index 63e1ded..0000000 --- a/tests/api-resources/models/rerank.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Maisa from 'maisa'; -import { Response } from 'node-fetch'; - -const maisa = new Maisa({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource rerank', () => { - test('create: only required params', async () => { - const responsePromise = maisa.models.rerank.create({ - sentences: ['The light bulb was invented by Thomas Edison', "It's a nice day, isn't it"], - source_sentence: 'Who invented the light bulb?', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await maisa.models.rerank.create({ - sentences: ['The light bulb was invented by Thomas Edison', "It's a nice day, isn't it"], - source_sentence: 'Who invented the light bulb?', - }); - }); -}); diff --git a/tests/index.test.ts b/tests/index.test.ts index 50d6d7f..2ac1e2e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { APIUserAbortError } from 'maisa'; @@ -26,13 +26,13 @@ describe('instantiate client', () => { apiKey: 'My API Key', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -40,8 +40,8 @@ describe('instantiate client', () => { expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -96,6 +96,15 @@ 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 Maisa({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: defaultFetch, + }); + }); + test('custom signal', async () => { const client = new Maisa({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', @@ -122,6 +131,23 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); + test('normalized method', async () => { + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + capturedRequest = init; + return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Maisa({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: testFetch, + }); + + await client.patch('/foo'); + expect(capturedRequest?.method).toEqual('PATCH'); + }); + describe('baseUrl', () => { test('trailing slash', () => { const client = new Maisa({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); @@ -159,6 +185,28 @@ describe('instantiate client', () => { const client = new Maisa({ apiKey: 'My API Key' }); expect(client.baseURL).toEqual('https://api.maisa.ai'); }); + + test('in request options', () => { + const client = new Maisa({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/option/foo', + ); + }); + + test('in request options overridden by client options', () => { + const client = new Maisa({ apiKey: 'My API Key', baseURL: 'http://localhost:5000/client' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/client/foo', + ); + }); + + test('in request options overridden by env variable', () => { + process.env['MAISA_BASE_URL'] = 'http://localhost:5000/env'; + const client = new Maisa({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/env/foo', + ); + }); }); test('maxRetries option is correctly set', () => { @@ -177,7 +225,7 @@ describe('instantiate client', () => { expect(client.apiKey).toBe('My API Key'); }); - test('with overriden environment variable arguments', () => { + test('with overridden environment variable arguments', () => { // set options via env var process.env['MAISA_API_KEY'] = 'another My API Key'; const client = new Maisa({ apiKey: 'My API Key' }); @@ -189,20 +237,20 @@ describe('request building', () => { const client = new Maisa({ apiKey: 'My API Key' }); describe('Content-Length', () => { - test('handles multi-byte characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); + test('handles multi-byte characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); expect((req.headers as Record)['content-length']).toEqual('20'); }); - test('handles standard characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); + test('handles standard characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); expect((req.headers as Record)['content-length']).toEqual('22'); }); }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' }, @@ -228,7 +276,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new Maisa({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -241,6 +293,134 @@ describe('retries', () => { expect(count).toEqual(3); }); + test('retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); + + expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); + + expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toEqual('2'); + expect(count).toEqual(3); + }); + + test('omit retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + headers: { 'X-Stainless-Retry-Count': null }, + }), + ).toEqual({ a: 1 }); + + expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); + }); + + test('omit retry count header by default', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + defaultHeaders: { 'X-Stainless-Retry-Count': null }, + }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + }), + ).toEqual({ a: 1 }); + + expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); + }); + + test('overwrite retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + headers: { 'X-Stainless-Retry-Count': '42' }, + }), + ).toEqual({ a: 1 }); + + expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toBe('42'); + }); + test('retry on 429 with retry-after', async () => { let count = 0; const testFetch = async (url: RequestInfo, { signal }: RequestInit = {}): Promise => { diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index faa6d83..fa8d585 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,8 @@ -import { APIClient } from 'maisa/core'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -const { stringifyQuery } = APIClient.prototype as any; +import { stringifyQuery } from 'maisa/internal/utils/query'; -describe('APIClient.stringifyQuery', () => { +describe(stringifyQuery, () => { for (const [input, expected] of [ [{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'], [{ a: null, b: false, c: undefined }, 'a=&b=false'], @@ -13,11 +13,12 @@ describe('APIClient.stringifyQuery', () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); }); } + for (const value of [[], {}, new Date()]) { it(`${JSON.stringify(value)} -> `, () => { expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`); diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 3b4d30e..2daff1f 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -54,4 +54,12 @@ describe('toFile', () => { const file = await toFile(input); expect(file.name).toEqual('uploads.test.ts'); }); + + it('does not copy File objects', async () => { + const input = new File(['foo'], 'input.jsonl', { type: 'jsonl' }); + const file = await toFile(input); + expect(file).toBe(input); + expect(file.name).toEqual('input.jsonl'); + expect(file.type).toBe('jsonl'); + }); }); diff --git a/tsconfig.build.json b/tsconfig.build.json index 217ca4c..bafbf71 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,9 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "maisa/*": ["dist/src/*"], - "maisa": ["dist/src/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] + "maisa/*": ["./dist/src/*"], + "maisa": ["./dist/src/index.ts"] }, "noEmit": false, "declaration": true, diff --git a/tsconfig.deno.json b/tsconfig.deno.json index b881c28..849e070 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -1,20 +1,14 @@ { "extends": "./tsconfig.json", - "include": ["deno"], + "include": ["dist-deno"], "exclude": [], "compilerOptions": { - "rootDir": "./deno", + "rootDir": "./dist-deno", "lib": ["es2020", "DOM"], - "paths": { - "maisa/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "maisa/*": ["deno/*"], - "maisa": ["deno/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] - }, "noEmit": true, "declaration": true, "declarationMap": true, - "outDir": "deno", + "outDir": "dist-deno", "pretty": true, "sourceMap": true } diff --git a/tsconfig.json b/tsconfig.json index 9a4b047..aa0e734 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,12 +7,10 @@ "module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, - "baseUrl": "./", "paths": { - "maisa/_shims/auto/*": ["src/_shims/auto/*-node"], - "maisa/*": ["src/*"], - "maisa": ["src/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] + "maisa/_shims/auto/*": ["./src/_shims/auto/*-node"], + "maisa/*": ["./src/*"], + "maisa": ["./src/index.ts"] }, "noEmit": true, @@ -33,6 +31,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, + "isolatedModules": false, "skipLibCheck": true } diff --git a/typings/digest-fetch/index.d.ts b/typings/digest-fetch/index.d.ts deleted file mode 100644 index f6bcbfd..0000000 --- a/typings/digest-fetch/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -declare module 'digest-fetch'; - -import type { RequestInfo, RequestInit, Response } from 'node-fetch'; - -type Algorithm = 'MD5' | 'MD5-sess'; - -type Options = { - algorithm?: Algorithm; - statusCode?: number; - cnonceSize?: number; - basic?: boolean; - precomputeHash?: boolean; - logger?: typeof console; -}; - -class DigestClient { - user: string; - password: string; - - private nonceRaw: string; - private logger?: typeof console; - private precomputedHash?: boolean; - private statusCode?: number; - private basic: boolean; - private cnonceSize: number; - private hasAuth: boolean; - private digest: { nc: number; algorithm: Algorithm; realm: string }; - - constructor(user: string, password: string, options: Options = {}); - async fetch(url: RequestInfo, options: RequestInit = {}): Promise; -} - -export default DigestClient; diff --git a/yarn.lock b/yarn.lock index b3447b1..d6c83fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,163 +7,119 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" - integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" + integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== dependencies: - "@babel/highlight" "^7.23.4" - chalk "^2.4.2" + "@babel/helper-validator-identifier" "^7.28.5" + js-tokens "^4.0.0" + picocolors "^1.1.1" -"@babel/compat-data@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" - integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== +"@babel/compat-data@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" + integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.6.tgz#8be77cd77c55baadcc1eae1c33df90ab6d2151d4" - integrity sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.23.6" - "@babel/parser" "^7.23.6" - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" + integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-compilation-targets" "^7.28.6" + "@babel/helper-module-transforms" "^7.28.6" + "@babel/helpers" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.23.6", "@babel/generator@^7.7.2": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" - integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== +"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" + integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== + dependencies: + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" + jsesc "^3.0.2" + +"@babel/helper-compilation-targets@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" + integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== + dependencies: + "@babel/compat-data" "^7.28.6" + "@babel/helper-validator-option" "^7.27.1" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + +"@babel/helper-module-imports@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== dependencies: - "@babel/types" "^7.23.6" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== +"@babel/helper-module-transforms@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" + integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" - lru-cache "^5.1.1" - semver "^6.3.1" + "@babel/helper-module-imports" "^7.28.6" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/traverse" "^7.28.6" -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-module-imports@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" - integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" - integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== - -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== - -"@babel/helpers@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.6.tgz#d03af2ee5fb34691eec0cda90f5ecbb4d4da145a" - integrity sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA== - dependencies: - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" - -"@babel/highlight@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" - integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" + integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== + +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== + +"@babel/helper-validator-option@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" + integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== + +"@babel/helpers@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" + integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== + dependencies: + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" - integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" + integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== + dependencies: + "@babel/types" "^7.28.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -179,14 +135,28 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-attributes@^7.24.7": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" + integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -201,13 +171,13 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" - integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" + integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.28.6" -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -221,7 +191,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -249,7 +219,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== @@ -257,45 +234,41 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" - integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/template@^7.22.15", "@babel/template@^7.3.3": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" - integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== - dependencies: - "@babel/code-frame" "^7.22.13" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" - -"@babel/traverse@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" - integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" + integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/template@^7.28.6", "@babel/template@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + +"@babel/traverse@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" + integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" debug "^4.3.1" - globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.3.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" - integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.6", "@babel/types@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" + integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -322,9 +295,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.5.1": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.0.tgz#7ccb5f58703fa61ffdcbf39e2c604a109e781162" - integrity sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ== + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== "@eslint-community/regexpp@^4.6.1": version "4.6.2" @@ -432,6 +405,13 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/create-cache-key-function@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-29.7.0.tgz#793be38148fab78e65f40ae30c36785f4ad859f0" + integrity sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA== + dependencies: + "@jest/types" "^29.6.3" + "@jest/environment@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" @@ -578,31 +558,38 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" - integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== +"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/remapping@^2.3.5": + version "2.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" + integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": +"@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18": version "0.3.20" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== @@ -610,6 +597,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -662,15 +657,95 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== +"@swc/core-darwin-arm64@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.16.tgz#2cd45d709ce76d448d96bf8d0006849541436611" + integrity sha512-UOCcH1GvjRnnM/LWT6VCGpIk0OhHRq6v1U6QXuPt5wVsgXnXQwnf5k3sG5Cm56hQHDvhRPY6HCsHi/p0oek8oQ== + +"@swc/core-darwin-x64@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.4.16.tgz#a5bc7d8b1dd850adb0bb95c6b5c742b92201fd01" + integrity sha512-t3bgqFoYLWvyVtVL6KkFNCINEoOrIlyggT/kJRgi1y0aXSr0oVgcrQ4ezJpdeahZZ4N+Q6vT3ffM30yIunELNA== + +"@swc/core-linux-arm-gnueabihf@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.16.tgz#961744908ee5cbb79bc009dcf58cc8b831111f38" + integrity sha512-DvHuwvEF86YvSd0lwnzVcjOTZ0jcxewIbsN0vc/0fqm9qBdMMjr9ox6VCam1n3yYeRtj4VFgrjeNFksqbUejdQ== + +"@swc/core-linux-arm64-gnu@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.16.tgz#43713be3f26757d82d2745dc25f8b63400e0a3d0" + integrity sha512-9Uu5YlPbyCvbidjKtYEsPpyZlu16roOZ5c2tP1vHfnU9bgf5Tz5q5VovSduNxPHx+ed2iC1b1URODHvDzbbDuQ== + +"@swc/core-linux-arm64-musl@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.16.tgz#394a7d030f3a61902bd3947bb9d70d26d42f3c81" + integrity sha512-/YZq/qB1CHpeoL0eMzyqK5/tYZn/rzKoCYDviFU4uduSUIJsDJQuQA/skdqUzqbheOXKAd4mnJ1hT04RbJ8FPQ== + +"@swc/core-linux-x64-gnu@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.16.tgz#71eb108b784f9d551ee8a35ebcdaed972f567981" + integrity sha512-UUjaW5VTngZYDcA8yQlrFmqs1tLi1TxbKlnaJwoNhel9zRQ0yG1YEVGrzTvv4YApSuIiDK18t+Ip927bwucuVQ== + +"@swc/core-linux-x64-musl@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.16.tgz#10dbaedb4e3dfc7268e3a9a66ad3431471ef035b" + integrity sha512-aFhxPifevDTwEDKPi4eRYWzC0p/WYJeiFkkpNU5Uc7a7M5iMWPAbPFUbHesdlb9Jfqs5c07oyz86u+/HySBNPQ== + +"@swc/core-win32-arm64-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.16.tgz#80247adff6c245ff32b44d773c1a148858cd655f" + integrity sha512-bTD43MbhIHL2s5QgCwyleaGwl96Gk/scF2TaVKdUe4QlJCDV/YK9h5oIBAp63ckHtE8GHlH4c8dZNBiAXn4Org== + +"@swc/core-win32-ia32-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.16.tgz#e540afc3ccf3224267b4ddfb408f9d9737984686" + integrity sha512-/lmZeAN/qV5XbK2SEvi8e2RkIg8FQNYiSA8y2/Zb4gTUMKVO5JMLH0BSWMiIKMstKDPDSxMWgwJaQHF8UMyPmQ== + +"@swc/core-win32-x64-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.16.tgz#f880939fca32c181adfe7e3abd2b6b7857bd3489" + integrity sha512-BPAfFfODWXtUu6SwaTTftDHvcbDyWBSI/oanUeRbQR5vVWkXoQ3cxLTsDluc3H74IqXS5z1Uyoe0vNo2hB1opA== + +"@swc/core@^1.3.102": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.4.16.tgz#d175bae2acfecd53bcbd4293f1fba5ec316634a0" + integrity sha512-Xaf+UBvW6JNuV131uvSNyMXHn+bh6LyKN4tbv7tOUFQpXyz/t9YWRE04emtlUW9Y0qrm/GKFCbY8n3z6BpZbTA== + dependencies: + "@swc/counter" "^0.1.2" + "@swc/types" "^0.1.5" + optionalDependencies: + "@swc/core-darwin-arm64" "1.4.16" + "@swc/core-darwin-x64" "1.4.16" + "@swc/core-linux-arm-gnueabihf" "1.4.16" + "@swc/core-linux-arm64-gnu" "1.4.16" + "@swc/core-linux-arm64-musl" "1.4.16" + "@swc/core-linux-x64-gnu" "1.4.16" + "@swc/core-linux-x64-musl" "1.4.16" + "@swc/core-win32-arm64-msvc" "1.4.16" + "@swc/core-win32-ia32-msvc" "1.4.16" + "@swc/core-win32-x64-msvc" "1.4.16" + +"@swc/counter@^0.1.2", "@swc/counter@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" + integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== + +"@swc/jest@^0.2.29": + version "0.2.36" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.36.tgz#2797450a30d28b471997a17e901ccad946fe693e" + integrity sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw== dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" + "@jest/create-cache-key-function" "^29.7.0" + "@swc/counter" "^0.1.3" + jsonc-parser "^3.2.0" + +"@swc/types@^0.1.5": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.6.tgz#2f13f748995b247d146de2784d3eb7195410faba" + integrity sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg== + dependencies: + "@swc/counter" "^0.1.3" "@tsconfig/node10@^1.0.7": version "1.0.8" @@ -760,24 +835,24 @@ pretty-format "^29.0.0" "@types/json-schema@^7.0.12": - version "7.0.13" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" - integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.13" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" + integrity sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.4" "@types/node@*": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + version "24.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" + integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== dependencies: - undici-types "~5.26.4" + undici-types "~7.10.0" "@types/node@^18.11.18": version "18.11.18" @@ -785,9 +860,9 @@ integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/semver@^7.5.0": - version "7.5.3" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" - integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== "@types/stack-utils@^2.0.0": version "2.0.3" @@ -807,15 +882,15 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz#d98046e9f7102d49a93d944d413c6055c47fafd7" - integrity sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA== + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" + integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/type-utils" "6.7.3" - "@typescript-eslint/utils" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/type-utils" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -824,71 +899,72 @@ ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.3.tgz#aaf40092a32877439e5957e18f2d6a91c82cc2fd" - integrity sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ== - dependencies: - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz#07e5709c9bdae3eaf216947433ef97b3b8b7d755" - integrity sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ== +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/type-utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz#c2c165c135dda68a5e70074ade183f5ad68f3400" - integrity sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw== +"@typescript-eslint/type-utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" + integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== dependencies: - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/utils" "6.7.3" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/utils" "6.21.0" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.3.tgz#0402b5628a63f24f2dc9d4a678e9a92cc50ea3e9" - integrity sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw== +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/typescript-estree@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz#ec5bb7ab4d3566818abaf0e4a8fa1958561b7279" - integrity sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g== +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" + minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.3.tgz#96c655816c373135b07282d67407cb577f62e143" - integrity sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg== +"@typescript-eslint/utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" + integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz#83809631ca12909bd2083558d2f93f5747deebb2" - integrity sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg== +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== dependencies: - "@typescript-eslint/types" "6.7.3" + "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" abort-controller@^3.0.0: @@ -957,13 +1033,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -1009,7 +1078,7 @@ array-union@^2.1.0: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== babel-jest@^29.7.0: version "29.7.0" @@ -1046,22 +1115,25 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" + integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" babel-preset-jest@^29.6.3: version "29.6.3" @@ -1076,10 +1148,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== +baseline-browser-mapping@^2.9.0: + version "2.9.14" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" + integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== big-integer@^1.6.44: version "1.6.52" @@ -1094,17 +1166,17 @@ bplist-parser@^0.2.0: big-integer "^1.6.44" brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + version "1.1.12" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" + integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" + integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== dependencies: balanced-match "^1.0.0" @@ -1115,15 +1187,16 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.22.2: - version "4.22.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.2.tgz#704c4943072bd81ea18997f3bd2180e89c77874b" - integrity sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A== +browserslist@^4.24.0: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - caniuse-lite "^1.0.30001565" - electron-to-chromium "^1.4.601" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" bs-logger@0.x: version "0.2.6" @@ -1151,6 +1224,14 @@ bundle-name@^3.0.0: dependencies: run-applescript "^5.0.0" +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1166,19 +1247,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001565: - version "1.0.30001570" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz#b4e5c1fa786f733ab78fc70f592df6b3f23244ca" - integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" +caniuse-lite@^1.0.30001759: + version "1.0.30001764" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" + integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== chalk@^4.0.0: version "4.1.2" @@ -1193,11 +1265,6 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -charenc@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - ci-info@^3.2.0: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" @@ -1227,23 +1294,11 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - collect-v8-coverage@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -1251,11 +1306,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -1297,26 +1347,28 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" -crypt@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + dedent@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" @@ -1358,7 +1410,7 @@ define-lazy-prop@^3.0.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== depd@^1.1.2: version "1.1.2" @@ -1380,14 +1432,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -digest-fetch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661" - integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA== - dependencies: - base-64 "^0.1.0" - md5 "^2.3.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1402,10 +1446,19 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.601: - version "1.4.614" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" - integrity sha512-X4ze/9Sc3QWs6h92yerwqv7aB/uU8vCjZcrMjA8N9R1pjMFRe44dLsck5FzLilOYvcXuDn93B+bpGYyufc70gQ== +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== emittery@^0.13.1: version "0.13.1" @@ -1424,15 +1477,42 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^2.0.0: version "2.0.0" @@ -1472,12 +1552,7 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" - integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== - -eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -1635,18 +1710,7 @@ fast-glob@^3.2.12: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.3.0: +fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1668,9 +1732,9 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== dependencies: reusify "^1.0.4" @@ -1729,13 +1793,15 @@ form-data-encoder@1.7.2: resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" formdata-node@^4.3.2: @@ -1771,11 +1837,35 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" @@ -1812,11 +1902,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - globals@^13.19.0: version "13.20.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" @@ -1836,6 +1921,11 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -1846,16 +1936,23 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + hasown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" @@ -1863,6 +1960,13 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -1885,10 +1989,17 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" +iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== import-fresh@^3.2.1: version "3.3.0" @@ -1934,11 +2045,6 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-buffer@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - is-core-module@^2.13.0: version "2.13.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" @@ -2434,24 +2540,24 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" + integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== dependencies: argparse "^1.0.7" esprima "^4.0.0" js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== json-parse-even-better-errors@^2.3.0: version "2.3.1" @@ -2473,6 +2579,11 @@ json5@^2.2.2, json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" + integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2553,14 +2664,10 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -md5@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" - integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g== - dependencies: - charenc "0.0.2" - crypt "0.0.2" - is-buffer "~1.1.6" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== merge-stream@^2.0.0: version "2.0.0" @@ -2580,17 +2687,17 @@ micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2602,6 +2709,13 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2609,29 +2723,17 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -2647,9 +2749,9 @@ node-domexception@1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7: - version "2.6.11" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -2658,10 +2760,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== normalize-path@^3.0.0: version "3.0.0" @@ -2789,11 +2891,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -2829,6 +2926,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -2976,18 +3078,28 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3108,13 +3220,6 @@ superstruct@^1.0.3: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046" integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -3166,11 +3271,6 @@ tmpl@1.0.5: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3181,12 +3281,12 @@ to-regex-range@^5.0.1: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-api-utils@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" - integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.1.0: version "29.1.1" @@ -3202,14 +3302,6 @@ ts-jest@^29.1.0: semver "^7.5.3" yargs-parser "^21.0.1" -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - ts-node@^10.5.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" @@ -3291,23 +3383,23 @@ typescript@^4.8.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== untildify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" uri-js@^4.2.2: version "4.4.1" @@ -3347,20 +3439,15 @@ web-streams-polyfill@4.0.0-beta.1: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ== -web-streams-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0"