diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 00000000..e5b6d8d6 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/blue-hounds-sort.md b/.changeset/blue-hounds-sort.md new file mode 100644 index 00000000..350243c3 --- /dev/null +++ b/.changeset/blue-hounds-sort.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +add fetch package diff --git a/.changeset/chilled-emus-own.md b/.changeset/chilled-emus-own.md new file mode 100644 index 00000000..31a79699 --- /dev/null +++ b/.changeset/chilled-emus-own.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(fetcher): change fetcher model to factory diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..99119101 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": true, + "fixed": [["@zodios/*"]], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.changeset/curly-shrimps-destroy.md b/.changeset/curly-shrimps-destroy.md new file mode 100644 index 00000000..01eba10d --- /dev/null +++ b/.changeset/curly-shrimps-destroy.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat: improve typings diff --git a/.changeset/famous-rules-drop.md b/.changeset/famous-rules-drop.md new file mode 100644 index 00000000..ce7187ce --- /dev/null +++ b/.changeset/famous-rules-drop.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(react): migrate react to v11 diff --git a/.changeset/few-icons-march.md b/.changeset/few-icons-march.md new file mode 100644 index 00000000..7d0dbe2c --- /dev/null +++ b/.changeset/few-icons-march.md @@ -0,0 +1,10 @@ +--- +"@zodios/express": major +"@zodios/testing": major +"@zodios/axios": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/core": major +--- + +migrate to typescript v11 diff --git a/.changeset/five-apricots-breathe.md b/.changeset/five-apricots-breathe.md new file mode 100644 index 00000000..0cec17bc --- /dev/null +++ b/.changeset/five-apricots-breathe.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update zod diff --git a/.changeset/gentle-ligers-mix.md b/.changeset/gentle-ligers-mix.md new file mode 100644 index 00000000..7cf20528 --- /dev/null +++ b/.changeset/gentle-ligers-mix.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +fix(testing): safely export hooks diff --git a/.changeset/good-tigers-tie.md b/.changeset/good-tigers-tie.md new file mode 100644 index 00000000..683ffa0c --- /dev/null +++ b/.changeset/good-tigers-tie.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update fp-ts diff --git a/.changeset/gorgeous-dolls-fry.md b/.changeset/gorgeous-dolls-fry.md new file mode 100644 index 00000000..63a430ec --- /dev/null +++ b/.changeset/gorgeous-dolls-fry.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +fix(react): do not double fetch if react-query signal is not used diff --git a/.changeset/long-fans-dress.md b/.changeset/long-fans-dress.md new file mode 100644 index 00000000..9055b49e --- /dev/null +++ b/.changeset/long-fans-dress.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +chore(deps): upgrade axios diff --git a/.changeset/lucky-brooms-fry.md b/.changeset/lucky-brooms-fry.md new file mode 100644 index 00000000..b37568b9 --- /dev/null +++ b/.changeset/lucky-brooms-fry.md @@ -0,0 +1,6 @@ +--- +"@zodios/axios": major +"@zodios/core": major +--- + +fix axios tests diff --git a/.changeset/nervous-kings-bow.md b/.changeset/nervous-kings-bow.md new file mode 100644 index 00000000..01eba10d --- /dev/null +++ b/.changeset/nervous-kings-bow.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat: improve typings diff --git a/.changeset/nice-kids-attend.md b/.changeset/nice-kids-attend.md new file mode 100644 index 00000000..9b877540 --- /dev/null +++ b/.changeset/nice-kids-attend.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +feat(testing): add testing package diff --git a/.changeset/nice-wombats-boil.md b/.changeset/nice-wombats-boil.md new file mode 100644 index 00000000..30ee71b7 --- /dev/null +++ b/.changeset/nice-wombats-boil.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +feat(testing): add response testing handlers diff --git a/.changeset/odd-avocados-prove.md b/.changeset/odd-avocados-prove.md new file mode 100644 index 00000000..2933adcc --- /dev/null +++ b/.changeset/odd-avocados-prove.md @@ -0,0 +1,11 @@ +--- +"@zodios/express": major +"@zodios/openapi": major +"@zodios/testing": major +"@zodios/axios": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/core": major +--- + +feat(openapi): add openapi diff --git a/.changeset/polite-bugs-confess.md b/.changeset/polite-bugs-confess.md new file mode 100644 index 00000000..f68777d6 --- /dev/null +++ b/.changeset/polite-bugs-confess.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +feat(fetch): remove qs dependency diff --git a/.changeset/polite-points-float.md b/.changeset/polite-points-float.md new file mode 100644 index 00000000..335a0fce --- /dev/null +++ b/.changeset/polite-points-float.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +fix(testing): import types from core instead of relaive directory diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..69e29fde --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,43 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "@zodios/core": "11.0.0-beta.0", + "@zodios/axios": "11.0.0-beta.0", + "@zodios/fetch": "11.0.0-beta.5", + "@zodios/testing": "11.0.0-beta.8", + "@zodios/react": "11.0.0-beta.12", + "@zodios/express": "11.0.0-beta.17", + "@zodios/openapi": "10.4.7" + }, + "changesets": [ + "blue-hounds-sort", + "chilled-emus-own", + "curly-shrimps-destroy", + "famous-rules-drop", + "few-icons-march", + "five-apricots-breathe", + "gentle-ligers-mix", + "good-tigers-tie", + "gorgeous-dolls-fry", + "long-fans-dress", + "lucky-brooms-fry", + "nervous-kings-bow", + "nice-kids-attend", + "nice-wombats-boil", + "odd-avocados-prove", + "polite-bugs-confess", + "polite-points-float", + "quiet-rockets-dream", + "rare-zoos-serve", + "rich-pigs-thank", + "short-hounds-mix", + "silent-garlics-scream", + "slimy-pugs-melt", + "slow-worms-destroy", + "small-horses-laugh", + "soft-seas-lie", + "tasty-bags-happen", + "twelve-dingos-cover" + ] +} diff --git a/.changeset/quiet-rockets-dream.md b/.changeset/quiet-rockets-dream.md new file mode 100644 index 00000000..e1f7571e --- /dev/null +++ b/.changeset/quiet-rockets-dream.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(plugin): add new zodios plugin system diff --git a/.changeset/rare-zoos-serve.md b/.changeset/rare-zoos-serve.md new file mode 100644 index 00000000..92d4bb31 --- /dev/null +++ b/.changeset/rare-zoos-serve.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update typescript diff --git a/.changeset/rich-pigs-thank.md b/.changeset/rich-pigs-thank.md new file mode 100644 index 00000000..edd7998f --- /dev/null +++ b/.changeset/rich-pigs-thank.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +fix(react): bump version diff --git a/.changeset/short-hounds-mix.md b/.changeset/short-hounds-mix.md new file mode 100644 index 00000000..d8422aee --- /dev/null +++ b/.changeset/short-hounds-mix.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +add basic mocks helpers diff --git a/.changeset/silent-garlics-scream.md b/.changeset/silent-garlics-scream.md new file mode 100644 index 00000000..3dd43a4c --- /dev/null +++ b/.changeset/silent-garlics-scream.md @@ -0,0 +1,6 @@ +--- +"@zodios/axios": major +"@zodios/core": major +--- + +sync axios and core versions diff --git a/.changeset/slimy-pugs-melt.md b/.changeset/slimy-pugs-melt.md new file mode 100644 index 00000000..c66680b1 --- /dev/null +++ b/.changeset/slimy-pugs-melt.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +tests(core): fix tests diff --git a/.changeset/slow-worms-destroy.md b/.changeset/slow-worms-destroy.md new file mode 100644 index 00000000..092f0a99 --- /dev/null +++ b/.changeset/slow-worms-destroy.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +refactor: factor http verbs diff --git a/.changeset/small-horses-laugh.md b/.changeset/small-horses-laugh.md new file mode 100644 index 00000000..9c04282d --- /dev/null +++ b/.changeset/small-horses-laugh.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore: fix type exports for nodenext diff --git a/.changeset/soft-seas-lie.md b/.changeset/soft-seas-lie.md new file mode 100644 index 00000000..ac75425e --- /dev/null +++ b/.changeset/soft-seas-lie.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +refactor(testing): move base hooks to testing diff --git a/.changeset/tasty-bags-happen.md b/.changeset/tasty-bags-happen.md new file mode 100644 index 00000000..116d6243 --- /dev/null +++ b/.changeset/tasty-bags-happen.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +chore(fetch): fix deps diff --git a/.changeset/twelve-dingos-cover.md b/.changeset/twelve-dingos-cover.md new file mode 100644 index 00000000..90835623 --- /dev/null +++ b/.changeset/twelve-dingos-cover.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(react): simplify exported instance diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4edc70f1..17f80cdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,17 +7,17 @@ on: push: branches: [main] paths: - - src/** - - yarn.lock + - packages/** + - pnpm-lock.yaml - package.json - - tsconfig.json + - .github/workflows/ci.yml pull_request: branches: [main] paths: - - src/** - - yarn.lock + - packages/** + - pnpm-lock.yaml - package.json - - tsconfig.json + - .github/workflows/ci.yml jobs: build: @@ -29,15 +29,20 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - - run: yarn install --ignore-engines - - run: yarn build - - run: yarn test + cache: "pnpm" + - run: pnpm install + - run: pnpm build + - run: pnpm test analyze: name: Analyze runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2e39c9cf..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,66 +0,0 @@ -# publish on npm when there is a new version tag - -name: publish -on: - push: - tags: [v*] - -jobs: - publish: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - registry-url: "https://registry.npmjs.org" - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: install dependencies - run: yarn install - - name: build - run: yarn build - - name: run test - run: yarn test - - name: publish to npm - # only run when tag has no 'rc' in it - if: ${{ !contains(github.ref, 'rc') }} - run: yarn publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: publish beta to npm - # only run when tag has 'rc' in it - if: ${{ contains(github.ref, 'rc') }} - run: yarn publish --access public --tag beta - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: generate changelog - uses: orhun/git-cliff-action@v2 - id: cliff - with: - args: --latest --strip footer - env: - OUTPUT: CHANGES.md - - name: save changelog - id: changelog - shell: bash - run: | - changelog=$(cat ${{ steps.cliff.outputs.changelog }}) - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A'}" - changelog="${changelog//$'\r'/'%0D'}" - echo "changelog=$changelog" >> $GITHUB_OUTPUT - - name: create release - id: release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: false diff --git a/.gitignore b/.gitignore index 325cfc22..0af2e3cc 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,8 @@ lib # Developpement directory .devcontainer +# Turbo +.turbo + +# Output +lib/** diff --git a/examples/next-turbo/.eslintrc.js b/examples/next-turbo/.eslintrc.js new file mode 100644 index 00000000..5b999efa --- /dev/null +++ b/examples/next-turbo/.eslintrc.js @@ -0,0 +1,10 @@ +module.exports = { + root: true, + // This tells ESLint to load the config from the package `eslint-config-custom` + extends: ["custom"], + settings: { + next: { + rootDir: ["apps/*/"], + }, + }, +}; diff --git a/examples/next-turbo/.gitignore b/examples/next-turbo/.gitignore new file mode 100644 index 00000000..849425fe --- /dev/null +++ b/examples/next-turbo/.gitignore @@ -0,0 +1,33 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +.pnp +.pnp.js + +# testing +coverage + +# next.js +.next/ +out/ +build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo diff --git a/examples/next-turbo/README.md b/examples/next-turbo/README.md new file mode 100644 index 00000000..760edf2b --- /dev/null +++ b/examples/next-turbo/README.md @@ -0,0 +1,73 @@ +# Turborepo starter + +This is an official pnpm starter turborepo. + +## What's inside? + +This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes the following packages/apps: + +### Apps and Packages + +- `docs`: a [Next.js](https://nextjs.org) app +- `web`: another [Next.js](https://nextjs.org) app +- `ui`: a stub React component library shared by both `web` and `docs` applications +- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) +- `tsconfig`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This turborepo has some additional tools already setup for you: + +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [ESLint](https://eslint.org/) for code linting +- [Prettier](https://prettier.io) for code formatting + +### Build + +To build all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm run build +``` + +### Develop + +To develop all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm run dev +``` + +### Remote Caching + +Turborepo can use a technique known as [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. + +By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands: + +``` +cd my-turborepo +pnpm dlx turbo login +``` + +This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). + +Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo: + +``` +pnpm dlx turbo link +``` + +## Useful Links + +Learn more about the power of Turborepo: + +- [Pipelines](https://turborepo.org/docs/core-concepts/pipelines) +- [Caching](https://turborepo.org/docs/core-concepts/caching) +- [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) +- [Scoped Tasks](https://turborepo.org/docs/core-concepts/scopes) +- [Configuration Options](https://turborepo.org/docs/reference/configuration) +- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference) diff --git a/examples/next-turbo/apps/docs/.eslintrc.js b/examples/next-turbo/apps/docs/.eslintrc.js new file mode 100644 index 00000000..c8df6075 --- /dev/null +++ b/examples/next-turbo/apps/docs/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/examples/next-turbo/apps/docs/README.md b/examples/next-turbo/apps/docs/README.md new file mode 100644 index 00000000..1d67ece7 --- /dev/null +++ b/examples/next-turbo/apps/docs/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next-turbo/apps/docs/next-env.d.ts b/examples/next-turbo/apps/docs/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/examples/next-turbo/apps/docs/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/next-turbo/apps/docs/next.config.js b/examples/next-turbo/apps/docs/next.config.js new file mode 100644 index 00000000..5e578c4f --- /dev/null +++ b/examples/next-turbo/apps/docs/next.config.js @@ -0,0 +1,6 @@ +module.exports = { + reactStrictMode: true, + experimental: { + transpilePackages: ["ui"], + }, +}; diff --git a/examples/next-turbo/apps/docs/package.json b/examples/next-turbo/apps/docs/package.json new file mode 100644 index 00000000..4c1d7760 --- /dev/null +++ b/examples/next-turbo/apps/docs/package.json @@ -0,0 +1,27 @@ +{ + "name": "docs", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "next dev --port 3001", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "12.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "ui": "workspace:*" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "eslint-config-custom": "workspace:*", + "eslint": "7.32.0", + "tsconfig": "workspace:*", + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "typescript": "5.0.2" + } +} diff --git a/examples/next-turbo/apps/docs/pages/index.tsx b/examples/next-turbo/apps/docs/pages/index.tsx new file mode 100644 index 00000000..0d1dabc1 --- /dev/null +++ b/examples/next-turbo/apps/docs/pages/index.tsx @@ -0,0 +1,10 @@ +import { Button } from "ui"; + +export default function Docs() { + return ( +
+

Docs

+
+ ); +} diff --git a/examples/next-turbo/apps/docs/tsconfig.json b/examples/next-turbo/apps/docs/tsconfig.json new file mode 100644 index 00000000..a355365b --- /dev/null +++ b/examples/next-turbo/apps/docs/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/apps/web/.eslintrc.js b/examples/next-turbo/apps/web/.eslintrc.js new file mode 100644 index 00000000..c8df6075 --- /dev/null +++ b/examples/next-turbo/apps/web/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/examples/next-turbo/apps/web/README.md b/examples/next-turbo/apps/web/README.md new file mode 100644 index 00000000..1d67ece7 --- /dev/null +++ b/examples/next-turbo/apps/web/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next-turbo/apps/web/common/api.ts b/examples/next-turbo/apps/web/common/api.ts new file mode 100644 index 00000000..f97e053b --- /dev/null +++ b/examples/next-turbo/apps/web/common/api.ts @@ -0,0 +1,13 @@ +import { makeApi } from "@zodios/core"; +import z from "zod"; + +export const api = makeApi([ + { + method: "get", + path: "/health", + alias: "health", + response: z.object({ + status: z.literal("ok"), + }), + }, +]); diff --git a/examples/next-turbo/apps/web/next-env.d.ts b/examples/next-turbo/apps/web/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/examples/next-turbo/apps/web/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/next-turbo/apps/web/next.config.js b/examples/next-turbo/apps/web/next.config.js new file mode 100644 index 00000000..5e578c4f --- /dev/null +++ b/examples/next-turbo/apps/web/next.config.js @@ -0,0 +1,6 @@ +module.exports = { + reactStrictMode: true, + experimental: { + transpilePackages: ["ui"], + }, +}; diff --git a/examples/next-turbo/apps/web/package.json b/examples/next-turbo/apps/web/package.json new file mode 100644 index 00000000..8b068186 --- /dev/null +++ b/examples/next-turbo/apps/web/package.json @@ -0,0 +1,35 @@ +{ + "name": "web", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@tanstack/react-query": "^4.13.0", + "@zodios/core": "^10.4.3", + "@zodios/express": "^10.4.2", + "@zodios/react": "^10.3.3", + "axios": "^1.1.3", + "express": "^4.18.2", + "next": "12.3.2-canary.40", + "react": "18.2.0", + "react-dom": "18.2.0", + "ui": "workspace:0.0.0", + "zod": "^3.19.1" + }, + "devDependencies": { + "@babel/core": "^7.19.6", + "@types/express": "^4.17.14", + "@types/node": "^17.0.45", + "@types/react": "^18.0.24", + "@types/react-dom": "^18.0.8", + "eslint": "7.32.0", + "eslint-config-custom": "workspace:0.0.0", + "tsconfig": "workspace:0.0.0", + "typescript": "5.0.2" + } +} diff --git a/examples/next-turbo/apps/web/pages/_app.tsx b/examples/next-turbo/apps/web/pages/_app.tsx new file mode 100644 index 00000000..3c79ddbb --- /dev/null +++ b/examples/next-turbo/apps/web/pages/_app.tsx @@ -0,0 +1,14 @@ +import type { AppProps } from "next/app"; +import { QueryClientProvider, QueryClient } from "@tanstack/react-query"; + +const queryClient = new QueryClient(); + +function MyApp({ Component, pageProps }: AppProps) { + return ( + + + + ); +} + +export default MyApp; diff --git a/examples/next-turbo/apps/web/pages/api/[...zodios].ts b/examples/next-turbo/apps/web/pages/api/[...zodios].ts new file mode 100644 index 00000000..0d172f46 --- /dev/null +++ b/examples/next-turbo/apps/web/pages/api/[...zodios].ts @@ -0,0 +1,3 @@ +import { app } from "../../server/routers/app"; + +export default app; diff --git a/examples/next-turbo/apps/web/pages/index.tsx b/examples/next-turbo/apps/web/pages/index.tsx new file mode 100644 index 00000000..62496a53 --- /dev/null +++ b/examples/next-turbo/apps/web/pages/index.tsx @@ -0,0 +1,23 @@ +import { Button } from "ui"; +import { api } from "../common/api"; +import { Zodios } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; + +const zodios = new Zodios("/api", api); +const zodiosHooks = new ZodiosHooks("health", zodios); + +export default function Web() { + const { data: health, isLoading } = zodiosHooks.useHealth(); + return ( +
+

Health Status

+ {isLoading ? ( +

Loading...

+ ) : ( +

+ Status: {health?.status} +

+ )} +
+ ); +} diff --git a/examples/next-turbo/apps/web/server/context.ts b/examples/next-turbo/apps/web/server/context.ts new file mode 100644 index 00000000..5583411e --- /dev/null +++ b/examples/next-turbo/apps/web/server/context.ts @@ -0,0 +1,11 @@ +import { zodiosContext } from "@zodios/express"; +import z from "zod"; + +export const ctx = zodiosContext( + z.object({ + user: z.object({ + id: z.string(), + name: z.string(), + }), + }) +); diff --git a/examples/next-turbo/apps/web/server/routers/app.ts b/examples/next-turbo/apps/web/server/routers/app.ts new file mode 100644 index 00000000..c8c53357 --- /dev/null +++ b/examples/next-turbo/apps/web/server/routers/app.ts @@ -0,0 +1,10 @@ +import { ctx } from "../context"; +import { api } from "../../common/api"; + +export const app = ctx.nextApp(); +const router = ctx.router(api); +app.use("/api", router); + +router.get("/health", (req, res) => { + res.status(200).json({ status: "ok" }); +}); diff --git a/examples/next-turbo/apps/web/tsconfig.json b/examples/next-turbo/apps/web/tsconfig.json new file mode 100644 index 00000000..a355365b --- /dev/null +++ b/examples/next-turbo/apps/web/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/package.json b/examples/next-turbo/package.json new file mode 100644 index 00000000..c49485d1 --- /dev/null +++ b/examples/next-turbo/package.json @@ -0,0 +1,25 @@ +{ + "name": "zodios-turbo", + "version": "0.0.0", + "private": true, + "workspaces": [ + "apps/*", + "packages/*" + ], + "scripts": { + "build": "turbo run build", + "dev": "turbo run dev --parallel", + "lint": "turbo run lint", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" + }, + "devDependencies": { + "eslint-config-custom": "workspace:*", + "prettier": "latest", + "turbo": "latest" + }, + "engines": { + "node": ">=14.0.0" + }, + "dependencies": {}, + "packageManager": "pnpm@7.14.0" +} \ No newline at end of file diff --git a/examples/next-turbo/packages/eslint-config-custom/index.js b/examples/next-turbo/packages/eslint-config-custom/index.js new file mode 100644 index 00000000..2ea526a5 --- /dev/null +++ b/examples/next-turbo/packages/eslint-config-custom/index.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ["next", "turbo", "prettier"], + rules: { + "@next/next/no-html-link-for-pages": "off", + "react/jsx-key": "off", + }, +}; diff --git a/examples/next-turbo/packages/eslint-config-custom/package.json b/examples/next-turbo/packages/eslint-config-custom/package.json new file mode 100644 index 00000000..ee80e8fb --- /dev/null +++ b/examples/next-turbo/packages/eslint-config-custom/package.json @@ -0,0 +1,19 @@ +{ + "name": "eslint-config-custom", + "version": "0.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "eslint": "^7.23.0", + "eslint-config-next": "^12.0.8", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-react": "7.31.8", + "eslint-config-turbo": "latest" + }, + "devDependencies": { + "typescript": "5.0.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/examples/next-turbo/packages/tsconfig/README.md b/examples/next-turbo/packages/tsconfig/README.md new file mode 100644 index 00000000..0da79cf2 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/README.md @@ -0,0 +1,3 @@ +# `tsconfig` + +These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from. diff --git a/examples/next-turbo/packages/tsconfig/base.json b/examples/next-turbo/packages/tsconfig/base.json new file mode 100644 index 00000000..d72a9f3a --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/base.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Default", + "compilerOptions": { + "composite": false, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "inlineSources": false, + "isolatedModules": true, + "moduleResolution": "node", + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "skipLibCheck": true, + "strict": true + }, + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/packages/tsconfig/nextjs.json b/examples/next-turbo/packages/tsconfig/nextjs.json new file mode 100644 index 00000000..cd9cd38f --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/nextjs.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Next.js", + "extends": "./base.json", + "compilerOptions": { + "target": "ES6", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve" + }, + "include": ["src", "next-env.d.ts"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/packages/tsconfig/package.json b/examples/next-turbo/packages/tsconfig/package.json new file mode 100644 index 00000000..f4810fc3 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/package.json @@ -0,0 +1,10 @@ +{ + "name": "tsconfig", + "version": "0.0.0", + "private": true, + "files": [ + "base.json", + "nextjs.json", + "react-library.json" + ] +} diff --git a/examples/next-turbo/packages/tsconfig/react-library.json b/examples/next-turbo/packages/tsconfig/react-library.json new file mode 100644 index 00000000..af8711c5 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/react-library.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "React Library", + "extends": "./base.json", + "compilerOptions": { + "jsx": "react-jsx", + "lib": ["ES2015"], + "module": "ESNext", + "target": "es6" + } +} diff --git a/examples/next-turbo/packages/ui/Button.tsx b/examples/next-turbo/packages/ui/Button.tsx new file mode 100644 index 00000000..7d5c6a73 --- /dev/null +++ b/examples/next-turbo/packages/ui/Button.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +export const Button = () => { + return ; +}; diff --git a/examples/next-turbo/packages/ui/index.tsx b/examples/next-turbo/packages/ui/index.tsx new file mode 100644 index 00000000..916730e8 --- /dev/null +++ b/examples/next-turbo/packages/ui/index.tsx @@ -0,0 +1,2 @@ +import * as React from "react"; +export * from "./Button"; diff --git a/examples/next-turbo/packages/ui/package.json b/examples/next-turbo/packages/ui/package.json new file mode 100644 index 00000000..9cd2ee44 --- /dev/null +++ b/examples/next-turbo/packages/ui/package.json @@ -0,0 +1,19 @@ +{ + "name": "ui", + "version": "0.0.0", + "main": "./index.tsx", + "types": "./index.tsx", + "license": "MIT", + "scripts": { + "lint": "eslint *.ts*" + }, + "devDependencies": { + "@types/react": "^18.0.17", + "@types/react-dom": "^18.0.6", + "eslint": "^7.32.0", + "eslint-config-custom": "workspace:*", + "react": "^18.2.0", + "tsconfig": "workspace:*", + "typescript": "5.0.2" + } +} diff --git a/examples/next-turbo/packages/ui/tsconfig.json b/examples/next-turbo/packages/ui/tsconfig.json new file mode 100644 index 00000000..cd6c94d6 --- /dev/null +++ b/examples/next-turbo/packages/ui/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/examples/next-turbo/pnpm-lock.yaml b/examples/next-turbo/pnpm-lock.yaml new file mode 100644 index 00000000..019267c5 --- /dev/null +++ b/examples/next-turbo/pnpm-lock.yaml @@ -0,0 +1,3019 @@ +lockfileVersion: 5.4 + +importers: + + .: + specifiers: + eslint-config-custom: workspace:* + prettier: latest + turbo: latest + devDependencies: + eslint-config-custom: link:packages/eslint-config-custom + prettier: 2.7.1 + turbo: 1.6.2 + + apps/docs: + specifiers: + '@babel/core': ^7.0.0 + '@types/node': ^17.0.12 + '@types/react': ^18.0.22 + '@types/react-dom': ^18.0.7 + eslint: 7.32.0 + eslint-config-custom: workspace:* + next: 12.3.1 + react: 18.2.0 + react-dom: 18.2.0 + tsconfig: workspace:* + typescript: ^4.5.3 + ui: workspace:* + dependencies: + next: 12.3.1_qtpcxnaaarbm4ws7ughq6oxfve + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + ui: link:../../packages/ui + devDependencies: + '@babel/core': 7.19.6 + '@types/node': 17.0.45 + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../../packages/eslint-config-custom + tsconfig: link:../../packages/tsconfig + typescript: 4.8.4 + + apps/web: + specifiers: + '@babel/core': ^7.19.6 + '@tanstack/react-query': ^4.13.0 + '@types/express': ^4.17.14 + '@types/node': ^17.0.45 + '@types/react': ^18.0.24 + '@types/react-dom': ^18.0.8 + '@zodios/core': ^10.4.3 + '@zodios/express': ^10.4.2 + '@zodios/react': ^10.3.3 + axios: ^1.1.3 + eslint: 7.32.0 + eslint-config-custom: workspace:0.0.0 + express: ^4.18.2 + next: 12.3.2-canary.40 + react: 18.2.0 + react-dom: 18.2.0 + tsconfig: workspace:0.0.0 + typescript: ^4.8.4 + ui: workspace:0.0.0 + zod: ^3.19.1 + dependencies: + '@tanstack/react-query': 4.13.0_biqbaboplfbrettd7655fr4n2y + '@types/express': 4.17.14 + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + '@zodios/express': 10.4.2_za6leqvtaqdjr5gzlbrsemzpwi + '@zodios/react': 10.3.3_tbpsitbqmenqxmwimr6kvnccvq + axios: 1.1.3 + express: 4.18.2 + next: 12.3.2-canary.40_qtpcxnaaarbm4ws7ughq6oxfve + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + ui: link:../../packages/ui + zod: 3.19.1 + devDependencies: + '@babel/core': 7.19.6 + '@types/node': 17.0.45 + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../../packages/eslint-config-custom + tsconfig: link:../../packages/tsconfig + typescript: 4.8.4 + + packages/eslint-config-custom: + specifiers: + eslint: ^7.23.0 + eslint-config-next: ^12.0.8 + eslint-config-prettier: ^8.3.0 + eslint-config-turbo: latest + eslint-plugin-react: 7.31.8 + typescript: ^4.7.4 + dependencies: + eslint: 7.32.0 + eslint-config-next: 12.3.1_3rubbgt5ekhqrcgx4uwls3neim + eslint-config-prettier: 8.5.0_eslint@7.32.0 + eslint-config-turbo: 0.0.4_eslint@7.32.0 + eslint-plugin-react: 7.31.8_eslint@7.32.0 + devDependencies: + typescript: 4.8.4 + + packages/tsconfig: + specifiers: {} + + packages/ui: + specifiers: + '@types/react': ^18.0.17 + '@types/react-dom': ^18.0.6 + eslint: ^7.32.0 + eslint-config-custom: workspace:* + react: ^18.2.0 + tsconfig: workspace:* + typescript: ^4.5.2 + devDependencies: + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../eslint-config-custom + react: 18.2.0 + tsconfig: link:../tsconfig + typescript: 4.8.4 + +packages: + + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.1.1 + '@jridgewell/trace-mapping': 0.3.17 + + /@babel/code-frame/7.12.11: + resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} + dependencies: + '@babel/highlight': 7.18.6 + + /@babel/code-frame/7.18.6: + resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + + /@babel/compat-data/7.20.0: + resolution: {integrity: sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==} + engines: {node: '>=6.9.0'} + + /@babel/core/7.19.6: + resolution: {integrity: sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helpers': 7.20.0 + '@babel/parser': 7.20.0 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + + /@babel/generator/7.20.0: + resolution: {integrity: sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.19.6: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.4 + semver: 6.3.0 + + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.0 + + /@babel/helper-hoist-variables/7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-module-imports/7.18.6: + resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-module-transforms/7.19.6: + resolution: {integrity: sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.19.4 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + + /@babel/helper-simple-access/7.19.4: + resolution: {integrity: sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-split-export-declaration/7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-option/7.18.6: + resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} + engines: {node: '>=6.9.0'} + + /@babel/helpers/7.20.0: + resolution: {integrity: sha512-aGMjYraN0zosCEthoGLdqot1oRsmxVTQRHadsUPz5QM44Zej2PYRz7XiDE7GqnkZnNtLbOuxqoZw42vkU7+XEQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + + /@babel/highlight/7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + + /@babel/parser/7.20.0: + resolution: {integrity: sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.0 + + /@babel/runtime-corejs3/7.20.0: + resolution: {integrity: sha512-v1JH7PeAAGBEyTQM9TqojVl+b20zXtesFKCJHu50xMxZKD1fX0TKaKHPsZfFkXfs7D1M9M6Eeqg1FkJ3a0x2dA==} + engines: {node: '>=6.9.0'} + dependencies: + core-js-pure: 3.26.0 + regenerator-runtime: 0.13.10 + dev: false + + /@babel/runtime/7.20.0: + resolution: {integrity: sha512-NDYdls71fTXoU8TZHfbBWg7DiZfNzClcKui/+kyi6ppD2L1qnWW3VV6CjtaBXSUGGhiTWJ6ereOIkUvenif66Q==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.10 + dev: false + + /@babel/template/7.18.10: + resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 + + /@babel/traverse/7.20.0: + resolution: {integrity: sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + /@babel/types/7.20.0: + resolution: {integrity: sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + + /@eslint/eslintrc/0.4.3: + resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 7.3.1 + globals: 13.17.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + js-yaml: 3.14.1 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + /@humanwhocodes/config-array/0.5.0: + resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + /@humanwhocodes/object-schema/1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@next/env/12.3.1: + resolution: {integrity: sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==} + dev: false + + /@next/env/12.3.2-canary.40: + resolution: {integrity: sha512-Fd6ZDf07ESDJ/C3IvmeWsXNyb6/BvlEM6KHoZU9l+Z/mqSH83T3AnVo44Rj7Pbr9K1aQvEq2qKW1zcsM4pZVwg==} + dev: false + + /@next/eslint-plugin-next/12.3.1: + resolution: {integrity: sha512-sw+lTf6r6P0j+g/n9y4qdWWI2syPqZx+uc0+B/fRENqfR3KpSid6MIKqc9gNwGhJASazEQ5b3w8h4cAET213jw==} + dependencies: + glob: 7.1.7 + dev: false + + /@next/swc-android-arm-eabi/12.3.1: + resolution: {integrity: sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm-eabi/12.3.2-canary.40: + resolution: {integrity: sha512-8WVCejEFzPeEouLd6DMjNLMVvVbG+Pw6S7QWPqxNPl5cCI4yem9zl+Niv5SI/DAQu6yBsRXBA50in/vx7NWKUA==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm64/12.3.1: + resolution: {integrity: sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm64/12.3.2-canary.40: + resolution: {integrity: sha512-IG044VjmSwXV+zIgRFqgx9wX24M4IIhJgSnTwnTyE5fsbL0eA3VJ2s2Skb40/2y3PTG4EwNZDkpOzpNRWJ8o1A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-arm64/12.3.1: + resolution: {integrity: sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-arm64/12.3.2-canary.40: + resolution: {integrity: sha512-P3BrKMqSm2t330VbpdIKHnMjMrxGPEvjosYDh5boQu8+4KgdCcTEHhdrTRwf7hXVZB8ais9I4+YDFe92WY6sqQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64/12.3.1: + resolution: {integrity: sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64/12.3.2-canary.40: + resolution: {integrity: sha512-3l2LNNrB/elk12ij7J6/SQHgpdWnrCZQgk501Hrtw7MoRW4Gu8Gee2FwubYGoL3dDe8cloVW04XlHrSAStS/Pg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-freebsd-x64/12.3.1: + resolution: {integrity: sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@next/swc-freebsd-x64/12.3.2-canary.40: + resolution: {integrity: sha512-ImJje/zx/07rreE6+MwKsSlYr0j+8MSIBWbHrKZ7Y2kUVA5bAIYPVj+BPLj1ckt9ezf1n4aDt7BSzbEc3mXMBw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm-gnueabihf/12.3.1: + resolution: {integrity: sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm-gnueabihf/12.3.2-canary.40: + resolution: {integrity: sha512-7D80PEpsfYg0Cmjd530p0s2ald0p7u+jmgcZ3rCkW3uDWr27ve95vm/MnY2sC/DD8Lo7obFc9NQraKYtR8l9tg==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu/12.3.1: + resolution: {integrity: sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu/12.3.2-canary.40: + resolution: {integrity: sha512-xu7dNJdJj4R61j5uHK/AGaQorLCD9CGq/SM2eKoXHvVHqffelKVAjflqXL2HzP6yQpHAIz4zIY20B/vIyIWHBA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl/12.3.1: + resolution: {integrity: sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl/12.3.2-canary.40: + resolution: {integrity: sha512-eIqCjajoHAQAerQFiH0jMXjcDLcvL4a685JwKg1zr72eVLf/y0WVjLOtV43WmjcxPu369IJIztN8Y/5gti5wzg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu/12.3.1: + resolution: {integrity: sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu/12.3.2-canary.40: + resolution: {integrity: sha512-yVdX9ZVfhHQ9ltsL4t2MllWyk0/RPg0rsCwx49df8eD56Q0PwHcsjfr7/+6RAOMVqDvek22u0QpedINTzSDH/g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl/12.3.1: + resolution: {integrity: sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl/12.3.2-canary.40: + resolution: {integrity: sha512-49WG2OIPT+FD8wc0junhRBvGAMLIKjwBf7Hrb0cX4Iev+Z/SIseXrASO8l5ADHM/DsGrb1tcVLjpQ/gPCdT48Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc/12.3.1: + resolution: {integrity: sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-8tLK6AjioExFX67BJ8lPQF7Rr+uqnMSIzAnQElDsBPGNORcrix6QMwNhiMCiqsPBwza3InAZ4qbz5E6bV1Y/fA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc/12.3.1: + resolution: {integrity: sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-FCjSpNzKuH8LV0BuG49P9OoR7Yd+Tr1dgKv5zSEYqBgLuCmNEPcFZxcGMd7EidmeAh2Oz1IELk18pwgeNeW9IA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc/12.3.1: + resolution: {integrity: sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-SNFJcSDvWq5p+3g0TqC7PPfpLIOwP5pBLBNg1i9LSEeULULMWzdnquPBnlEjKwgdqj7B34gHzTK8rApVJ1obVQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: false + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: false + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.13.0 + dev: false + + /@rushstack/eslint-patch/1.2.0: + resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} + dev: false + + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} + dependencies: + tslib: 2.4.0 + dev: false + + /@tanstack/query-core/4.13.0: + resolution: {integrity: sha512-PzmLQcEgC4rl2OzkiPHYPC9O79DFcMGaKsOzDEP+U4PJ+tbkcEP+Z+FQDlfvX8mCwYC7UNH7hXrQ5EdkGlJjVg==} + dev: false + + /@tanstack/react-query/4.13.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-dI/5hJ/pGQ74P5hxBLC9h6K0/Cap2T3k0ZjjjFLBCNnohDYgl7LNmMopzrRzBHk2mMjf2hgXHIzcKNG8GOZ5hg==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.13.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + use-sync-external-store: 1.2.0_react@18.2.0 + dev: false + + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 17.0.45 + dev: false + + /@types/connect/3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 17.0.45 + dev: false + + /@types/express-serve-static-core/4.17.31: + resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + dependencies: + '@types/node': 17.0.45 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: false + + /@types/express/4.17.14: + resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.31 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.0 + dev: false + + /@types/json5/0.0.29: + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + dev: false + + /@types/mime/3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: false + + /@types/node/17.0.45: + resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + + /@types/prop-types/15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true + + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: false + + /@types/range-parser/1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: false + + /@types/react-dom/18.0.8: + resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} + dependencies: + '@types/react': 18.0.24 + dev: true + + /@types/react/18.0.24: + resolution: {integrity: sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.1 + dev: true + + /@types/scheduler/0.16.2: + resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + dev: true + + /@types/serve-static/1.15.0: + resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 17.0.45 + dev: false + + /@typescript-eslint/parser/5.41.0_3rubbgt5ekhqrcgx4uwls3neim: + resolution: {integrity: sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.41.0 + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/typescript-estree': 5.41.0_typescript@4.8.4 + debug: 4.3.4 + eslint: 7.32.0 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/scope-manager/5.41.0: + resolution: {integrity: sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/visitor-keys': 5.41.0 + dev: false + + /@typescript-eslint/types/5.41.0: + resolution: {integrity: sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@typescript-eslint/typescript-estree/5.41.0_typescript@4.8.4: + resolution: {integrity: sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/visitor-keys': 5.41.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.8.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/visitor-keys/5.41.0: + resolution: {integrity: sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.41.0 + eslint-visitor-keys: 3.3.0 + dev: false + + /@zodios/core/10.4.3_axios@1.1.3+zod@3.19.1: + resolution: {integrity: sha512-ejXyMMX8lOELFOlfsCpuHYhAE37UhCYKXBi75ifaWtObvdxuO2kcex5X2B6UOi6wmUKpcKOgbwlSZ96uZP53Fg==} + peerDependencies: + axios: ^0.x || ^1.0.0 + zod: ^3.x + dependencies: + axios: 1.1.3 + zod: 3.19.1 + dev: false + + /@zodios/express/10.4.2_za6leqvtaqdjr5gzlbrsemzpwi: + resolution: {integrity: sha512-s8hxGlVQZHpArPKFbnXbecj/HqTnbOOnYRIHgKBFbZouq9jhh41rmw9hxmTqjnMI6nK6U5gVkkN8u36OPBsyRQ==} + peerDependencies: + '@zodios/core': ^10.x + express: 4.x + zod: ^3.x + dependencies: + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + express: 4.18.2 + zod: 3.19.1 + dev: false + + /@zodios/react/10.3.3_tbpsitbqmenqxmwimr6kvnccvq: + resolution: {integrity: sha512-QAnlZVowIlSa0ezQtjr5wI84lJK7HifBtMTxmaEUiwrlOespdsz39IuojwUB+3G66kGTSbZLQcOhBPsiFPCvpQ==} + peerDependencies: + '@tanstack/react-query': 4.x + '@zodios/core': '>=10.2.0 <11.0.0' + react: '>=16.8.0' + dependencies: + '@tanstack/react-query': 4.13.0_biqbaboplfbrettd7655fr4n2y + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + react: 18.2.0 + dev: false + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: false + + /acorn-jsx/5.3.2_acorn@7.4.1: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 7.4.1 + + /acorn/7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} + engines: {node: '>=0.4.0'} + hasBin: true + + /ajv/6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + /ajv/8.11.0: + resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + + /ansi-colors/4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + /ansi-styles/3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + + /argparse/1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + + /aria-query/4.2.2: + resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==} + engines: {node: '>=6.0'} + dependencies: + '@babel/runtime': 7.20.0 + '@babel/runtime-corejs3': 7.20.0 + dev: false + + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: false + + /array-includes/3.1.5: + resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + get-intrinsic: 1.1.3 + is-string: 1.0.7 + dev: false + + /array-union/2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: false + + /array.prototype.flat/1.3.0: + resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + es-shim-unscopables: 1.0.0 + dev: false + + /array.prototype.flatmap/1.3.0: + resolution: {integrity: sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + es-shim-unscopables: 1.0.0 + dev: false + + /ast-types-flow/0.0.7: + resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==} + dev: false + + /astral-regex/2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + /asynckit/0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axe-core/4.5.0: + resolution: {integrity: sha512-4+rr8eQ7+XXS5nZrKcMO/AikHL0hVqy+lHWAnE3xdHl+aguag8SOQ6eEqLexwLNWgXIMfunGuD3ON1/6Kyet0A==} + engines: {node: '>=4'} + dev: false + + /axios/1.1.3: + resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + + /axobject-query/2.2.0: + resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} + dev: false + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + /body-parser/1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.4 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: false + + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001426 + electron-to-chromium: 1.4.284 + node-releases: 2.0.6 + update-browserslist-db: 1.0.10_browserslist@4.21.4 + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: false + + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.3 + dev: false + + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + /caniuse-lite/1.0.30001426: + resolution: {integrity: sha512-n7cosrHLl8AWt0wwZw/PJZgUg3lV0gk9LMI7ikGJwhyhgsd2Nb65vKvmSexCqq/J7rbH3mFG6yZZiPR5dLPW5A==} + + /chalk/2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + /client-only/0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + dev: false + + /color-convert/1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + + /color-name/1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + /combined-stream/1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: false + + /content-type/1.0.4: + resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} + engines: {node: '>= 0.6'} + dev: false + + /convert-source-map/1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: false + + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: false + + /core-js-pure/3.26.0: + resolution: {integrity: sha512-LiN6fylpVBVwT8twhhluD9TzXmZQQsr2I2eIKtWNbZI1XMfBT7CV18itaN6RA7EtQd/SDdRx/wzvAShX2HvhQA==} + requiresBuild: true + dev: false + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + /csstype/3.1.1: + resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + dev: true + + /damerau-levenshtein/1.0.8: + resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} + dev: false + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: false + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + + /deep-is/0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: false + + /delayed-stream/1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: false + + /destroy/1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: false + + /dir-glob/3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: false + + /doctrine/2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + dependencies: + esutils: 2.0.3 + dev: false + + /doctrine/3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: false + + /electron-to-chromium/1.4.284: + resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + /emoji-regex/9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: false + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: false + + /enquirer/2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + + /es-abstract/1.20.4: + resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-weakref: 1.0.2 + object-inspect: 1.12.2 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.5 + string.prototype.trimstart: 1.0.5 + unbox-primitive: 1.0.2 + dev: false + + /es-shim-unscopables/1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: false + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: false + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: false + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + /escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + /eslint-config-next/12.3.1_3rubbgt5ekhqrcgx4uwls3neim: + resolution: {integrity: sha512-EN/xwKPU6jz1G0Qi6Bd/BqMnHLyRAL0VsaQaWA7F3KkjAgZHi4f1uL1JKGWNxdQpHTW/sdGONBd0bzxUka/DJg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + typescript: '>=3.3.1' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@next/eslint-plugin-next': 12.3.1 + '@rushstack/eslint-patch': 1.2.0 + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy + eslint-plugin-import: 2.26.0_r6mdt2nwtavxychxvtdgpnclqq + eslint-plugin-jsx-a11y: 6.6.1_eslint@7.32.0 + eslint-plugin-react: 7.31.8_eslint@7.32.0 + eslint-plugin-react-hooks: 4.6.0_eslint@7.32.0 + typescript: 4.8.4 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - supports-color + dev: false + + /eslint-config-prettier/8.5.0_eslint@7.32.0: + resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-config-turbo/0.0.4_eslint@7.32.0: + resolution: {integrity: sha512-HErPS/wfWkSdV9Yd2dDkhZt3W2B78Ih/aWPFfaHmCMjzPalh+5KxRRGTf8MOBQLCebcWJX0lP1Zvc1rZIHlXGg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + dependencies: + eslint: 7.32.0 + eslint-plugin-turbo: 0.0.4_eslint@7.32.0 + dev: false + + /eslint-import-resolver-node/0.3.6: + resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==} + dependencies: + debug: 3.2.7 + resolve: 1.22.1 + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-import-resolver-typescript/2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy: + resolution: {integrity: sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==} + engines: {node: '>=4'} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + dependencies: + debug: 4.3.4 + eslint: 7.32.0 + eslint-plugin-import: 2.26.0_r6mdt2nwtavxychxvtdgpnclqq + glob: 7.2.3 + is-glob: 4.0.3 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-module-utils/2.7.4_hc2d46adw36jouofggb76llgoi: + resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + debug: 3.2.7 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-plugin-import/2.26.0_r6mdt2nwtavxychxvtdgpnclqq: + resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + array-includes: 3.1.5 + array.prototype.flat: 1.3.0 + debug: 2.6.9 + doctrine: 2.1.0 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-module-utils: 2.7.4_hc2d46adw36jouofggb76llgoi + has: 1.0.3 + is-core-module: 2.11.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.5 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: false + + /eslint-plugin-jsx-a11y/6.6.1_eslint@7.32.0: + resolution: {integrity: sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + '@babel/runtime': 7.20.0 + aria-query: 4.2.2 + array-includes: 3.1.5 + ast-types-flow: 0.0.7 + axe-core: 4.5.0 + axobject-query: 2.2.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + eslint: 7.32.0 + has: 1.0.3 + jsx-ast-utils: 3.3.3 + language-tags: 1.0.5 + minimatch: 3.1.2 + semver: 6.3.0 + dev: false + + /eslint-plugin-react-hooks/4.6.0_eslint@7.32.0: + resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-plugin-react/7.31.8_eslint@7.32.0: + resolution: {integrity: sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + array-includes: 3.1.5 + array.prototype.flatmap: 1.3.0 + doctrine: 2.1.0 + eslint: 7.32.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.5 + object.fromentries: 2.0.5 + object.hasown: 1.1.1 + object.values: 1.1.5 + prop-types: 15.8.1 + resolve: 2.0.0-next.4 + semver: 6.3.0 + string.prototype.matchall: 4.0.7 + dev: false + + /eslint-plugin-turbo/0.0.4_eslint@7.32.0: + resolution: {integrity: sha512-dfmYE/iPvoJInQq+5E/0mj140y/rYwKtzZkn3uVK8+nvwC5zmWKQ6ehMWrL4bYBkGzSgpOndZM+jOXhPQ2m8Cg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-scope/5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + + /eslint-utils/2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} + engines: {node: '>=6'} + dependencies: + eslint-visitor-keys: 1.3.0 + + /eslint-visitor-keys/1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} + + /eslint-visitor-keys/2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + + /eslint-visitor-keys/3.3.0: + resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /eslint/7.32.0: + resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} + engines: {node: ^10.12.0 || >=12.0.0} + hasBin: true + dependencies: + '@babel/code-frame': 7.12.11 + '@eslint/eslintrc': 0.4.3 + '@humanwhocodes/config-array': 0.5.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + enquirer: 2.3.6 + escape-string-regexp: 4.0.0 + eslint-scope: 5.1.1 + eslint-utils: 2.1.0 + eslint-visitor-keys: 2.1.0 + espree: 7.3.1 + esquery: 1.4.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + functional-red-black-tree: 1.0.1 + glob-parent: 5.1.2 + globals: 13.17.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + js-yaml: 3.14.1 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.1 + progress: 2.0.3 + regexpp: 3.2.0 + semver: 7.3.8 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + table: 6.8.0 + text-table: 0.2.0 + v8-compile-cache: 2.3.0 + transitivePeerDependencies: + - supports-color + + /espree/7.3.1: + resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + acorn: 7.4.1 + acorn-jsx: 5.3.2_acorn@7.4.1 + eslint-visitor-keys: 1.3.0 + + /esprima/4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + /esquery/1.4.0: + resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + + /esrecurse/4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + + /estraverse/4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + + /estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: false + + /express/4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.4 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /fast-deep-equal/3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + /fast-glob/3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: false + + /fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + /fast-levenshtein/2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + /fastq/1.13.0: + resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} + dependencies: + reusify: 1.0.4 + dev: false + + /file-entry-cache/6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.0.4 + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: false + + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /flat-cache/3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.7 + rimraf: 3.0.2 + + /flatted/3.2.7: + resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data/4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: false + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: false + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: false + + /function.prototype.name/1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + functions-have-names: 1.2.3 + dev: false + + /functional-red-black-tree/1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: false + + /gensync/1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + /get-intrinsic/1.1.3: + resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: false + + /get-symbol-description/1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: false + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + + /glob/7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + /globals/11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + /globals/13.17.0: + resolution: {integrity: sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + + /globby/11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: false + + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: false + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.1.3 + dev: false + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: false + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: false + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: false + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + + /ignore/4.0.6: + resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} + engines: {node: '>= 4'} + + /ignore/5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + engines: {node: '>= 4'} + dev: false + + /import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + /internal-slot/1.0.3: + resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.1.3 + has: 1.0.3 + side-channel: 1.0.4 + dev: false + + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: false + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: false + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: false + + /is-core-module/2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: false + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: false + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: false + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 + dev: false + + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: false + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + /js-tokens/4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + /js-yaml/3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + /jsesc/2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + + /json-schema-traverse/0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + /json-schema-traverse/1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + /json-stable-stringify-without-jsonify/1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + /json5/1.0.1: + resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} + hasBin: true + dependencies: + minimist: 1.2.7 + dev: false + + /json5/2.2.1: + resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} + engines: {node: '>=6'} + hasBin: true + + /jsx-ast-utils/3.3.3: + resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} + engines: {node: '>=4.0'} + dependencies: + array-includes: 3.1.5 + object.assign: 4.1.4 + dev: false + + /language-subtag-registry/0.3.22: + resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} + dev: false + + /language-tags/1.0.5: + resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==} + dependencies: + language-subtag-registry: 0.3.22 + dev: false + + /levn/0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + /lodash.merge/4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + /lodash.truncate/4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + + /loose-envify/1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + + /media-typer/0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: false + + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: false + + /merge2/1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: false + + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: false + + /micromatch/4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: false + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: false + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + + /minimist/1.2.7: + resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + dev: false + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: false + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: false + + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: false + + /natural-compare/1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: false + + /next/12.3.1_qtpcxnaaarbm4ws7ughq6oxfve: + resolution: {integrity: sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==} + engines: {node: '>=12.22.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^17.0.2 || ^18.0.0-0 + react-dom: ^17.0.2 || ^18.0.0-0 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 12.3.1 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001426 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.0.7_otspjrsspon4ofp37rshhlhp2y + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 12.3.1 + '@next/swc-android-arm64': 12.3.1 + '@next/swc-darwin-arm64': 12.3.1 + '@next/swc-darwin-x64': 12.3.1 + '@next/swc-freebsd-x64': 12.3.1 + '@next/swc-linux-arm-gnueabihf': 12.3.1 + '@next/swc-linux-arm64-gnu': 12.3.1 + '@next/swc-linux-arm64-musl': 12.3.1 + '@next/swc-linux-x64-gnu': 12.3.1 + '@next/swc-linux-x64-musl': 12.3.1 + '@next/swc-win32-arm64-msvc': 12.3.1 + '@next/swc-win32-ia32-msvc': 12.3.1 + '@next/swc-win32-x64-msvc': 12.3.1 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + + /next/12.3.2-canary.40_qtpcxnaaarbm4ws7ughq6oxfve: + resolution: {integrity: sha512-TDIosDIpEC3IaRwwUuQ8ypUxYG7zyIGEN14UW0Y77/gpO20BwbR/0q3ZzHt+4W5JRF7vXZly62xTMMH1hVJHFA==} + engines: {node: '>=14.0.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^18.0.0-0 + react-dom: ^18.0.0-0 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 12.3.2-canary.40 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001426 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.1.0_otspjrsspon4ofp37rshhlhp2y + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 12.3.2-canary.40 + '@next/swc-android-arm64': 12.3.2-canary.40 + '@next/swc-darwin-arm64': 12.3.2-canary.40 + '@next/swc-darwin-x64': 12.3.2-canary.40 + '@next/swc-freebsd-x64': 12.3.2-canary.40 + '@next/swc-linux-arm-gnueabihf': 12.3.2-canary.40 + '@next/swc-linux-arm64-gnu': 12.3.2-canary.40 + '@next/swc-linux-arm64-musl': 12.3.2-canary.40 + '@next/swc-linux-x64-gnu': 12.3.2-canary.40 + '@next/swc-linux-x64-musl': 12.3.2-canary.40 + '@next/swc-win32-arm64-msvc': 12.3.2-canary.40 + '@next/swc-win32-ia32-msvc': 12.3.2-canary.40 + '@next/swc-win32-x64-msvc': 12.3.2-canary.40 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + + /node-releases/2.0.6: + resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: false + + /object-inspect/1.12.2: + resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: false + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: false + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: false + + /object.entries/1.1.5: + resolution: {integrity: sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.fromentries/2.0.5: + resolution: {integrity: sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.hasown/1.1.1: + resolution: {integrity: sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==} + dependencies: + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.values/1.1.5: + resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /on-finished/2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: false + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + + /optionator/0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.3 + + /parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: false + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: false + + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: false + + /path-type/4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: false + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: false + + /postcss/8.4.14: + resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: false + + /prelude-ls/1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + /prettier/2.7.1: + resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /progress/2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + + /prop-types/15.8.1: + resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + dependencies: + loose-envify: 1.4.0 + object-assign: 4.1.1 + react-is: 16.13.1 + dev: false + + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: false + + /proxy-from-env/1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + + /punycode/2.1.1: + resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + engines: {node: '>=6'} + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: false + + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: false + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: false + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: false + + /react-dom/18.2.0_react@18.2.0: + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: false + + /react-is/16.13.1: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + dev: false + + /react/18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + + /regenerator-runtime/0.13.10: + resolution: {integrity: sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==} + dev: false + + /regexp.prototype.flags/1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + functions-have-names: 1.2.3 + dev: false + + /regexpp/3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} + + /require-from-string/2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + /resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + + /resolve/2.0.0-next.4: + resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: false + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: false + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: false + + /safe-regex-test/1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + is-regex: 1.1.4 + dev: false + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: false + + /scheduler/0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: false + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: false + + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: false + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: false + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + object-inspect: 1.12.2 + dev: false + + /slash/3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: false + + /slice-ansi/4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: false + + /sprintf-js/1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: false + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + /string.prototype.matchall/4.0.7: + resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + get-intrinsic: 1.1.3 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + regexp.prototype.flags: 1.4.3 + side-channel: 1.0.4 + dev: false + + /string.prototype.trimend/1.0.5: + resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /string.prototype.trimstart/1.0.5: + resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: false + + /strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + /styled-jsx/5.0.7_otspjrsspon4ofp37rshhlhp2y: + resolution: {integrity: sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.19.6 + react: 18.2.0 + dev: false + + /styled-jsx/5.1.0_otspjrsspon4ofp37rshhlhp2y: + resolution: {integrity: sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.19.6 + client-only: 0.0.1 + react: 18.2.0 + dev: false + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: false + + /table/6.8.0: + resolution: {integrity: sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==} + engines: {node: '>=10.0.0'} + dependencies: + ajv: 8.11.0 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + /text-table/0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: false + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: false + + /tsconfig-paths/3.14.1: + resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.1 + minimist: 1.2.7 + strip-bom: 3.0.0 + dev: false + + /tslib/1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: false + + /tslib/2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: false + + /tsutils/3.21.0_typescript@4.8.4: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.8.4 + dev: false + + /turbo-darwin-64/1.6.2: + resolution: {integrity: sha512-qzqVdJZcVeu1d0mzeSxffgeOToSgM+Hl1y9yDiJQ4QQjiR/WGCzS9FtydLnk0ori8T1j/lxiiQz2sHjHYfLCTg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64/1.6.2: + resolution: {integrity: sha512-EJvgWSjLwzJbAsqRuqeaYSdXNKwyiUfOfEOPerYCvwxC+ILiqpladjteMCzzF/z2OmIbPzuqZpyik30TfpIC9A==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64/1.6.2: + resolution: {integrity: sha512-SJ5ThDApOyOavjvkYb6a1MKJbOvX4JEvSYxoZv+ZpN8g7A7x1SE9b7EnxFl26S4eyy0J4+r+YJBDBZ7sFkqRWQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64/1.6.2: + resolution: {integrity: sha512-0vHojVlvAelsYZo6p/xE9H9Dg8spNjXx+PO5RwP12ui8GuEqHb3Vomdb7AKDnWkIH7bpysNb9GbKEk7awQpGSg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64/1.6.2: + resolution: {integrity: sha512-j4mJmY5pEt7OaBXDM99BpDnJuSpiLVbVbUl4Ezp8w3gyIcGuxy3wAfLbQyZSLu8ke6R9SdmXIBAM2Y0MjS/Z1g==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64/1.6.2: + resolution: {integrity: sha512-AlDYjxPU21YSefP3qMl/Zys5spglXtaBt2ZF5N2+OWcjiJZ/0mIIc69oFdzuAuiyoYkyWMdkoCSGwuljtl31vg==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo/1.6.2: + resolution: {integrity: sha512-a6UM9HaAjM5ai+vxDFI/z0l4Bf6zWjf7wCf9Ip2iyd4XZkZZnhRtM6FpaUWzorjz9Dsqnfwu3nkWY3wPdH02IQ==} + hasBin: true + requiresBuild: true + optionalDependencies: + turbo-darwin-64: 1.6.2 + turbo-darwin-arm64: 1.6.2 + turbo-linux-64: 1.6.2 + turbo-linux-arm64: 1.6.2 + turbo-windows-64: 1.6.2 + turbo-windows-arm64: 1.6.2 + dev: true + + /type-check/0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + + /type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + /type-is/1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: false + + /typescript/4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: false + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: false + + /update-browserslist-db/1.0.10_browserslist@4.21.4: + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.4 + escalade: 3.1.1 + picocolors: 1.0.0 + + /uri-js/4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.1.1 + + /use-sync-external-store/1.2.0_react@18.2.0: + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: false + + /v8-compile-cache/2.3.0: + resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: false + + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: false + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + + /word-wrap/1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + + /zod/3.19.1: + resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} + dev: false diff --git a/examples/next-turbo/pnpm-workspace.yaml b/examples/next-turbo/pnpm-workspace.yaml new file mode 100644 index 00000000..3ff5faaa --- /dev/null +++ b/examples/next-turbo/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - "apps/*" + - "packages/*" diff --git a/examples/next-turbo/turbo.json b/examples/next-turbo/turbo.json new file mode 100644 index 00000000..c2601a49 --- /dev/null +++ b/examples/next-turbo/turbo.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**", ".next/**"] + }, + "lint": { + "outputs": [] + }, + "dev": { + "cache": false + } + } +} diff --git a/examples/next/.eslintrc.json b/examples/next/.eslintrc.json new file mode 100644 index 00000000..bffb357a --- /dev/null +++ b/examples/next/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/examples/next/.gitignore b/examples/next/.gitignore new file mode 100644 index 00000000..c87c9b39 --- /dev/null +++ b/examples/next/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/examples/next/README.md b/examples/next/README.md new file mode 100644 index 00000000..c87e0421 --- /dev/null +++ b/examples/next/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next/client/api.ts b/examples/next/client/api.ts new file mode 100644 index 00000000..4e1032d7 --- /dev/null +++ b/examples/next/client/api.ts @@ -0,0 +1,6 @@ +import { Zodios } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; +import { userApi } from "../common/api"; + +export const userClientApi = new Zodios("/api", userApi); +export const userClientHooks = new ZodiosHooks("users", userClientApi); diff --git a/examples/next/common/api.ts b/examples/next/common/api.ts new file mode 100644 index 00000000..1297ee2f --- /dev/null +++ b/examples/next/common/api.ts @@ -0,0 +1,55 @@ +import z from "zod"; +import { makeApi } from "@zodios/core"; + +const user = z.object({ + id: z.number(), + name: z.string(), + age: z.number().positive(), + email: z.string().email(), +}); + +export const userApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + response: z.array(user), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors: [ + { + status: "default", + schema: z.object({ + error: z.object({ + code: z.number(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "user", + type: "Body", + schema: user.omit({ id: true }), + }, + ], + response: user, + }, +]); diff --git a/examples/next/next.config.js b/examples/next/next.config.js new file mode 100644 index 00000000..3d3bc999 --- /dev/null +++ b/examples/next/next.config.js @@ -0,0 +1,7 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + swcMinify: true, +}; + +module.exports = nextConfig; diff --git a/examples/next/package.json b/examples/next/package.json new file mode 100644 index 00000000..5b20c79b --- /dev/null +++ b/examples/next/package.json @@ -0,0 +1,32 @@ +{ + "name": "zodios-next-app", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@tanstack/react-query": "4.13.0", + "@zodios/core": "10.7.3", + "@zodios/express": "10.4.4", + "@zodios/react": "10.4.3", + "axios": "1.2.6", + "express": "4.18.2", + "next": "12.2.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "zod": "3.20.2" + }, + "devDependencies": { + "@types/express": "4.17.16", + "@types/node": "18.11.18", + "@types/react": "18.0.27", + "@types/react-dom": "18.0.10", + "eslint": "8.32.0", + "eslint-config-next": "12.2.5", + "typescript": "5.0.2" + } +} diff --git a/examples/next/pages/_app.tsx b/examples/next/pages/_app.tsx new file mode 100644 index 00000000..efb90d6a --- /dev/null +++ b/examples/next/pages/_app.tsx @@ -0,0 +1,15 @@ +import "../styles/globals.css"; +import type { AppProps } from "next/app"; +import { QueryClientProvider, QueryClient } from "@tanstack/react-query"; + +const queryClient = new QueryClient(); + +function MyApp({ Component, pageProps }: AppProps) { + return ( + + + + ); +} + +export default MyApp; diff --git a/examples/next/pages/api/[...zodios].ts b/examples/next/pages/api/[...zodios].ts new file mode 100644 index 00000000..0d172f46 --- /dev/null +++ b/examples/next/pages/api/[...zodios].ts @@ -0,0 +1,3 @@ +import { app } from "../../server/routers/app"; + +export default app; diff --git a/examples/next/pages/index.tsx b/examples/next/pages/index.tsx new file mode 100644 index 00000000..143fa8e4 --- /dev/null +++ b/examples/next/pages/index.tsx @@ -0,0 +1,62 @@ +import type { NextPage } from "next"; +import { useState } from "react"; +import Head from "next/head"; +import styles from "../styles/Home.module.css"; +import { userClientHooks } from "../client/api"; + +const Users = () => { + const [count, setCount] = useState(1); + const { + data: users, + error, + isLoading, + invalidate, + } = userClientHooks.useGetUsers(); + const { mutate } = userClientHooks.useMutation("post", "/users", undefined, { + onSuccess: () => invalidate(), + }); + if (isLoading) { + return
Loading...
; + } + if (error) { + return
{JSON.stringify(error)}
; + } + + return ( +
+ + {users?.map((user) => ( +
+ {user.name} - {user.email} +
+ ))} +
+ ); +}; + +const Home: NextPage = () => { + return ( +
+ + Zodios Example App + + + +

Users

+ +
+ ); +}; + +export default Home; diff --git a/examples/next/public/favicon.ico b/examples/next/public/favicon.ico new file mode 100644 index 00000000..718d6fea Binary files /dev/null and b/examples/next/public/favicon.ico differ diff --git a/examples/next/public/vercel.svg b/examples/next/public/vercel.svg new file mode 100644 index 00000000..fbf0e25a --- /dev/null +++ b/examples/next/public/vercel.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/examples/next/server/context.ts b/examples/next/server/context.ts new file mode 100644 index 00000000..0fa7e09d --- /dev/null +++ b/examples/next/server/context.ts @@ -0,0 +1,10 @@ +import { zodiosContext } from "@zodios/express"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), +}); + +export const ctx = zodiosContext(z.object({ user })); diff --git a/examples/next/server/routers/app.ts b/examples/next/server/routers/app.ts new file mode 100644 index 00000000..cf8a07b2 --- /dev/null +++ b/examples/next/server/routers/app.ts @@ -0,0 +1,5 @@ +import { ctx } from "../context"; +import { userRouter } from "./users"; + +export const app = ctx.nextApp(); +app.use("/api", userRouter); diff --git a/examples/next/server/routers/users.ts b/examples/next/server/routers/users.ts new file mode 100644 index 00000000..6929bd1b --- /dev/null +++ b/examples/next/server/routers/users.ts @@ -0,0 +1,37 @@ +import { ctx } from "../context"; +import { userApi } from "../../common/api"; + +const users = [ + { + id: 1, + name: "John Doe", + age: 30, + email: "john.doe@test.com", + }, +]; + +export const userRouter = ctx.router(userApi); + +userRouter.get("/users", (req, res) => { + return res.status(200).json(users); +}); + +userRouter.get("/users/:id", (req, res) => { + const user = users.find((u) => u.id === req.params.id); + if (!user) { + return res.status(404).json({ + error: { + code: 404, + message: "User not found", + }, + }); + } + return res.status(200).json(user); +}); + +userRouter.post("/users", (req, res) => { + const id = users.length + 1; + const user = { ...req.body, id }; + users.push(user); + return res.status(201).json(user); +}); diff --git a/examples/next/styles/Home.module.css b/examples/next/styles/Home.module.css new file mode 100644 index 00000000..bd50f42f --- /dev/null +++ b/examples/next/styles/Home.module.css @@ -0,0 +1,129 @@ +.container { + padding: 0 2rem; +} + +.main { + min-height: 100vh; + padding: 4rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.footer { + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; +} + +.footer a { + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; +} + +.title a { + color: #0070f3; + text-decoration: none; +} + +.title a:hover, +.title a:focus, +.title a:active { + text-decoration: underline; +} + +.title { + margin: 0; + line-height: 1.15; + font-size: 4rem; +} + +.title, +.description { + text-align: center; +} + +.description { + margin: 4rem 0; + line-height: 1.5; + font-size: 1.5rem; +} + +.code { + background: #fafafa; + border-radius: 5px; + padding: 0.75rem; + font-size: 1.1rem; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} + +.grid { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + max-width: 800px; +} + +.card { + margin: 1rem; + padding: 1.5rem; + text-align: left; + color: inherit; + text-decoration: none; + border: 1px solid #eaeaea; + border-radius: 10px; + transition: color 0.15s ease, border-color 0.15s ease; + max-width: 300px; +} + +.card:hover, +.card:focus, +.card:active { + color: #0070f3; + border-color: #0070f3; +} + +.card h2 { + margin: 0 0 1rem 0; + font-size: 1.5rem; +} + +.card p { + margin: 0; + font-size: 1.25rem; + line-height: 1.5; +} + +.logo { + height: 1em; + margin-left: 0.5rem; +} + +@media (max-width: 600px) { + .grid { + width: 100%; + flex-direction: column; + } +} + +@media (prefers-color-scheme: dark) { + .card, + .footer { + border-color: #222; + } + .code { + background: #111; + } + .logo img { + filter: invert(1); + } +} diff --git a/examples/next/styles/globals.css b/examples/next/styles/globals.css new file mode 100644 index 00000000..4f184216 --- /dev/null +++ b/examples/next/styles/globals.css @@ -0,0 +1,26 @@ +html, +body { + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, + Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; +} + +a { + color: inherit; + text-decoration: none; +} + +* { + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + html { + color-scheme: dark; + } + body { + color: white; + background: black; + } +} diff --git a/examples/next/tsconfig.json b/examples/next/tsconfig.json new file mode 100644 index 00000000..99710e85 --- /dev/null +++ b/examples/next/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next/yarn.lock b/examples/next/yarn.lock new file mode 100644 index 00000000..449d1523 --- /dev/null +++ b/examples/next/yarn.lock @@ -0,0 +1,2225 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime-corejs3@^7.10.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.9.tgz#7bacecd1cb2dd694eacd32a91fcf7021c20770ae" + integrity sha512-qZEWeccZCrHA2Au4/X05QW5CMdm4VjUDCrGq5gf1ZDcM4hRqreKrtwAn7yci9zfgAS9apvnsFXiGBHBAxZdK9A== + dependencies: + core-js-pure "^3.20.2" + regenerator-runtime "^0.13.4" + +"@babel/runtime@^7.10.2", "@babel/runtime@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + dependencies: + regenerator-runtime "^0.13.4" + +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@next/env@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.5.tgz#d908c57b35262b94db3e431e869b72ac3e1ad3e3" + integrity sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw== + +"@next/eslint-plugin-next@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.2.5.tgz#4f3acccd2ed4f9300fbf9fd480cc8a0b261889a8" + integrity sha512-VBjVbmqEzGiOTBq4+wpeVXt/KgknnGB6ahvC/AxiIGnN93/RCSyXhFRI4uSfftM2Ba3w7ZO7076bfKasZsA0fw== + dependencies: + glob "7.1.7" + +"@next/swc-android-arm-eabi@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.5.tgz#903a5479ab4c2705d9c08d080907475f7bacf94d" + integrity sha512-cPWClKxGhgn2dLWnspW+7psl3MoLQUcNqJqOHk2BhNcou9ARDtC0IjQkKe5qcn9qg7I7U83Gp1yh2aesZfZJMA== + +"@next/swc-android-arm64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.5.tgz#2f9a98ec4166c7860510963b31bda1f57a77c792" + integrity sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg== + +"@next/swc-darwin-arm64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.5.tgz#31b1c3c659d54be546120c488a1e1bad21c24a1d" + integrity sha512-VOPWbO5EFr6snla/WcxUKtvzGVShfs302TEMOtzYyWni6f9zuOetijJvVh9CCTzInnXAZMtHyNhefijA4HMYLg== + +"@next/swc-darwin-x64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.5.tgz#2e44dd82b2b7fef88238d1bc4d3bead5884cedfd" + integrity sha512-5o8bTCgAmtYOgauO/Xd27vW52G2/m3i5PX7MUYePquxXAnX73AAtqA3WgPXBRitEB60plSKZgOTkcpqrsh546A== + +"@next/swc-freebsd-x64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.5.tgz#e24e75d8c2581bfebc75e4f08f6ddbd116ce9dbd" + integrity sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw== + +"@next/swc-linux-arm-gnueabihf@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.5.tgz#46d8c514d834d2b5f67086013f0bd5e3081e10b9" + integrity sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg== + +"@next/swc-linux-arm64-gnu@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.5.tgz#91f725ac217d3a1f4f9f53b553615ba582fd3d9f" + integrity sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ== + +"@next/swc-linux-arm64-musl@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.5.tgz#e627e8c867920995810250303cd9b8e963598383" + integrity sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg== + +"@next/swc-linux-x64-gnu@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.5.tgz#83a5e224fbc4d119ef2e0f29d0d79c40cc43887e" + integrity sha512-0szyAo8jMCClkjNK0hknjhmAngUppoRekW6OAezbEYwHXN/VNtsXbfzgYOqjKWxEx3OoAzrT3jLwAF0HdX2MEw== + +"@next/swc-linux-x64-musl@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.5.tgz#be700d48471baac1ec2e9539396625584a317e95" + integrity sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g== + +"@next/swc-win32-arm64-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.5.tgz#a93e958133ad3310373fda33a79aa10af2a0aa97" + integrity sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw== + +"@next/swc-win32-ia32-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.5.tgz#4f5f7ba0a98ff89a883625d4af0125baed8b2e19" + integrity sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw== + +"@next/swc-win32-x64-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.5.tgz#20fed129b04a0d3f632c6d0de135345bb623b1e4" + integrity sha512-7h5/ahY7NeaO2xygqVrSG/Y8Vs4cdjxIjowTZ5W6CKoTKn7tmnuxlUc2h74x06FKmbhAd9agOjr/AOKyxYYm9Q== + +"@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" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@rushstack/eslint-patch@^1.1.3": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" + integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA== + +"@swc/helpers@0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.3.tgz#16593dfc248c53b699d4b5026040f88ddb497012" + integrity sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA== + dependencies: + tslib "^2.4.0" + +"@tanstack/query-core@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.13.0.tgz#89153096d1fce42c0294fa1d1ae4b3e72aa5353b" + integrity sha512-PzmLQcEgC4rl2OzkiPHYPC9O79DFcMGaKsOzDEP+U4PJ+tbkcEP+Z+FQDlfvX8mCwYC7UNH7hXrQ5EdkGlJjVg== + +"@tanstack/react-query@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.13.0.tgz#13797d590a6c0708545881e38aea5eb39b960c28" + integrity sha512-dI/5hJ/pGQ74P5hxBLC9h6K0/Cap2T3k0ZjjjFLBCNnohDYgl7LNmMopzrRzBHk2mMjf2hgXHIzcKNG8GOZ5hg== + dependencies: + "@tanstack/query-core" "4.13.0" + use-sync-external-store "^1.2.0" + +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/express-serve-static-core@^4.17.31": + version "4.17.33" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz#de35d30a9d637dc1450ad18dd583d75d5733d543" + integrity sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@4.17.16": + version "4.17.16" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.16.tgz#986caf0b4b850611254505355daa24e1b8323de8" + integrity sha512-LkKpqRZ7zqXJuvoELakaFYuETHjZkSol8EV6cNnyishutDBCCdv6+dsKPbKkCcIk57qRphOLY5sEgClw1bO3gA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.31" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/mime@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" + integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== + +"@types/node@*": + version "18.7.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" + integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw== + +"@types/node@18.11.18": + version "18.11.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + +"@types/prop-types@*": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/react-dom@18.0.10": + version "18.0.10" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.10.tgz#3b66dec56aa0f16a6cc26da9e9ca96c35c0b4352" + integrity sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/react@18.0.27": + version "18.0.27" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.27.tgz#d9425abe187a00f8a5ec182b010d4fd9da703b71" + integrity sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== + +"@types/serve-static@*": + version "1.15.0" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155" + integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== + dependencies: + "@types/mime" "*" + "@types/node" "*" + +"@typescript-eslint/parser@^5.21.0": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.35.1.tgz#bf2ee2ebeaa0a0567213748243fb4eec2857f04f" + integrity sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg== + dependencies: + "@typescript-eslint/scope-manager" "5.35.1" + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/typescript-estree" "5.35.1" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e" + integrity sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q== + dependencies: + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + +"@typescript-eslint/types@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61" + integrity sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ== + +"@typescript-eslint/typescript-estree@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211" + integrity sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA== + dependencies: + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6" + integrity sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g== + dependencies: + "@typescript-eslint/types" "5.35.1" + eslint-visitor-keys "^3.3.0" + +"@zodios/core@10.7.3": + version "10.7.3" + resolved "https://registry.yarnpkg.com/@zodios/core/-/core-10.7.3.tgz#813f3c27d42f00ece960941b61626b8d47317554" + integrity sha512-O28q7FbamQP6vkdRH1rRh1JEDGVilDmFBW4HAJKs2DNt/Q25yZHqsegb+plfAMcbVuvU7rfnS0e0pK0LLAOT+g== + +"@zodios/express@10.4.4": + version "10.4.4" + resolved "https://registry.yarnpkg.com/@zodios/express/-/express-10.4.4.tgz#dc21666bb99d1cc18ddcfa97f37767040c0d1590" + integrity sha512-hOVkorK/ORQ5yHQdflhI9mvNG+Pzhp1ZJuL9C39FE8qiIVz0orFAzUAYdBLVAwFptg77bAFcIF2RUx5OuetqKw== + +"@zodios/react@10.4.3": + version "10.4.3" + resolved "https://registry.yarnpkg.com/@zodios/react/-/react-10.4.3.tgz#08c346c859a635a39c9f59bbcc607959aeccbfc6" + integrity sha512-J3Rgnlhr5p+Hv3EFUgeLhg4/YQta3+yMLU+bHw1CH+7tECmVvn1In5Q9Z4TDzczLMArINIGevjAuiNQ/Dwbwfw== + +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +array-includes@^3.1.4, array-includes@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" + integrity sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + get-intrinsic "^1.1.1" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.5: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" + integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz#a7e8ed4225f4788a70cd910abcf0791e76a5534f" + integrity sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-shim-unscopables "^1.0.0" + +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axe-core@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.3.tgz#11c74d23d5013c0fa5d183796729bc3482bd2f6f" + integrity sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w== + +axios@1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.6.tgz#eacb6d065baa11bad5959e7ffa0cb6745c65f392" + integrity sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +axobject-query@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" + integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +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== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001332: + version "1.0.30001383" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz#aecf317ccd940690725ae3ae4f28293c5fb8050e" + integrity sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg== + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +core-js-pure@^3.20.2: + version "3.25.0" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.25.0.tgz#f8d1f176ff29abbfeb610110de891d5ae5a361d4" + integrity sha512-IeHpLwk3uoci37yoI2Laty59+YqH9x5uR65/yiA0ARAJrTrN4YU0rmauLWfvqOuk77SlNJXj2rM6oT/dBD87+A== + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +csstype@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== + +debug@2.6.9, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: + 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" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +define-properties@^1.1.3, define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5: + version "1.20.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" + integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-weakref "^1.0.2" + object-inspect "^1.12.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + regexp.prototype.flags "^1.4.3" + string.prototype.trimend "^1.0.5" + string.prototype.trimstart "^1.0.5" + unbox-primitive "^1.0.2" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-next@12.2.5: + version "12.2.5" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.2.5.tgz#76ce83f18cc02f6f42ed407a127f83db54fabd3c" + integrity sha512-SOowilkqPzW6DxKp3a3SYlrfPi5Ajs9MIzp9gVfUDxxH9QFM5ElkR1hX5m/iICJuvCbWgQqFBiA3mCMozluniw== + dependencies: + "@next/eslint-plugin-next" "12.2.5" + "@rushstack/eslint-patch" "^1.1.3" + "@typescript-eslint/parser" "^5.21.0" + eslint-import-resolver-node "^0.3.6" + eslint-import-resolver-typescript "^2.7.1" + eslint-plugin-import "^2.26.0" + eslint-plugin-jsx-a11y "^6.5.1" + eslint-plugin-react "^7.29.4" + eslint-plugin-react-hooks "^4.5.0" + +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-import-resolver-typescript@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz#a90a4a1c80da8d632df25994c4c5fdcdd02b8751" + integrity sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ== + dependencies: + debug "^4.3.4" + glob "^7.2.0" + is-glob "^4.0.3" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" + +eslint-module-utils@^2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" + integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.26.0: + version "2.26.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" + integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.3" + has "^1.0.3" + is-core-module "^2.8.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.5" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" + +eslint-plugin-jsx-a11y@^6.5.1: + version "6.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.1.tgz#93736fc91b83fdc38cc8d115deedfc3091aef1ff" + integrity sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q== + dependencies: + "@babel/runtime" "^7.18.9" + aria-query "^4.2.2" + array-includes "^3.1.5" + ast-types-flow "^0.0.7" + axe-core "^4.4.3" + axobject-query "^2.2.0" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.3.2" + language-tags "^1.0.5" + minimatch "^3.1.2" + semver "^6.3.0" + +eslint-plugin-react-hooks@^4.5.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" + integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== + +eslint-plugin-react@^7.29.4: + version "7.31.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.1.tgz#d29793ed27743f3ed8a473c347b1bf5a0a8fb9af" + integrity sha512-j4/2xWqt/R7AZzG8CakGHA6Xa/u7iR8Q3xCxY+AUghdT92bnIDOBEefV456OeH0QvBcroVc0eyvrrLSyQGYIfg== + dependencies: + array-includes "^3.1.5" + array.prototype.flatmap "^1.3.0" + doctrine "^2.1.0" + estraverse "^5.3.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.1" + object.values "^1.1.5" + prop-types "^15.8.1" + resolve "^2.0.0-next.3" + semver "^6.3.0" + string.prototype.matchall "^4.0.7" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@8.32.0: + version "8.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" + integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== + dependencies: + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +express@4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.11.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + 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-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" + integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3, glob@^7.2.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^13.19.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +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-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.8.1, is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +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== + dependencies: + argparse "^2.0.1" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" + integrity sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw== + dependencies: + array-includes "^3.1.5" + object.assign "^4.1.3" + +language-subtag-registry@~0.3.2: + version "0.3.22" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" + integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + +language-tags@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== + dependencies: + language-subtag-registry "~0.3.2" + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +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, mime-types@~2.1.24, mime-types@~2.1.34: + 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.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +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" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, 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== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +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.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +next@12.2.5: + version "12.2.5" + resolved "https://registry.yarnpkg.com/next/-/next-12.2.5.tgz#14fb5975e8841fad09553b8ef41fe1393602b717" + integrity sha512-tBdjqX5XC/oFs/6gxrZhjmiq90YWizUYU6qOWAfat7zJwrwapJ+BYgX2PmiacunXMaRpeVT4vz5MSPSLgNkrpA== + dependencies: + "@next/env" "12.2.5" + "@swc/helpers" "0.4.3" + caniuse-lite "^1.0.30001332" + postcss "8.4.14" + styled-jsx "5.0.4" + use-sync-external-store "1.2.0" + optionalDependencies: + "@next/swc-android-arm-eabi" "12.2.5" + "@next/swc-android-arm64" "12.2.5" + "@next/swc-darwin-arm64" "12.2.5" + "@next/swc-darwin-x64" "12.2.5" + "@next/swc-freebsd-x64" "12.2.5" + "@next/swc-linux-arm-gnueabihf" "12.2.5" + "@next/swc-linux-arm64-gnu" "12.2.5" + "@next/swc-linux-arm64-musl" "12.2.5" + "@next/swc-linux-x64-gnu" "12.2.5" + "@next/swc-linux-x64-musl" "12.2.5" + "@next/swc-win32-arm64-msvc" "12.2.5" + "@next/swc-win32-ia32-msvc" "12.2.5" + "@next/swc-win32-x64-msvc" "12.2.5" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2, object.assign@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.hasown@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.1.tgz#ad1eecc60d03f49460600430d97f23882cf592a3" + integrity sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A== + dependencies: + define-properties "^1.1.4" + es-abstract "^1.19.5" + +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +postcss@8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-dom@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + +react-is@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.20.0, resolve@^1.22.0: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^2.0.0-next.3: + version "2.0.0-next.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" + integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@5.2.1: + version "5.2.1" + 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": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.7: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +string.prototype.matchall@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" + integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.4.1" + side-channel "^1.0.4" + +string.prototype.trimend@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" + integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +string.prototype.trimstart@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" + integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +styled-jsx@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.4.tgz#5b1bd0b9ab44caae3dd1361295559706e044aa53" + integrity sha512-sDFWLbg4zR+UkNzfk5lPilyIgtpddfxXEULxhujorr5jtePTUqiPDc5BC0v1NRqTr/WaFBGQQUoYToGlF4B2KQ== + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +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" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tsconfig-paths@^3.14.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typescript@4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zod@3.20.2: + version "3.20.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.20.2.tgz#068606642c8f51b3333981f91c0a8ab37dfc2807" + integrity sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ== diff --git a/examples/server.ts b/examples/server.ts new file mode 100644 index 00000000..13d7f51a --- /dev/null +++ b/examples/server.ts @@ -0,0 +1,41 @@ +import { makeApi } from "@zodios/core"; +import { zodiosApp } from "../packages/express/src/index"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + { + name: "filter", + type: "Query", + schema: z.string().array().default([]), + }, + ], + response: z.object({ + id: z.number(), + name: z.string().nullable(), + }), + }, +]); + +const app = zodiosApp(userApi); + +app.get("/users/:id", async (req, res) => { + const { id } = req.params; + // ^? + const { filter } = req.query; + // ^? + return res.json({ + id: req.params.id, + name: "example", + }); +}); diff --git a/package.json b/package.json index ef9682cc..f1389263 100644 --- a/package.json +++ b/package.json @@ -1,74 +1,22 @@ { - "name": "@zodios/core", - "description": "Typescript API client with autocompletion and zod validations", - "version": "10.9.0", - "main": "lib/index.js", - "module": "lib/index.mjs", - "typings": "lib/index.d.ts", - "exports": { - ".": { - "import": "./lib/index.mjs", - "require": "./lib/index.js", - "types": "./lib/index.d.ts" - }, - "./lib/*.types": { - "import": "./lib/*.types.mjs", - "require": "./lib/*.types.js", - "types": "./lib/*.types.d.ts" - }, - "./package.json": "./package.json" - }, - "files": [ - "lib" - ], - "author": { - "name": "ecyrbe", - "email": "ecyrbe@gmail.com" - }, - "homepage": "https://github.com/ecyrbe/zodios", - "repository": { - "type": "git", - "url": "https://github.com/ecyrbe/zodios.git" - }, - "license": "MIT", - "keywords": [ - "axios", - "openapi", - "zod", - "autocomplete", - "validation" - ], + "name": "zodios", + "version": "11.0.0-rc.0", "scripts": { - "prebuild": "rimraf lib", - "example": "ts-node examples/jsonplaceholder.ts", - "example:dev.to": "ts-node examples/dev.to/example.ts", - "major-rc": "npm version premajor --preid=rc", - "minor-rc": "npm version preminor --preid=rc", - "patch-rc": "npm version prepatch --preid=rc", - "rc": "npm version prerelease --preid=rc", - "build": "tsup", - "test": "jest --coverage" - }, - "peerDependencies": { - "axios": "^0.x || ^1.0.0", - "zod": "^3.x" + "build": "turbo run build", + "test": "turbo run test", + "dev": "turbo run dev", + "lint": "turbo run lint", + "pub": "turbo run build test && changeset version && changeset publish" }, + "private": true, "devDependencies": { - "@jest/types": "29.5.0", - "@types/express": "4.17.17", - "@types/jest": "29.5.0", - "@types/multer": "1.4.7", - "@types/node": "18.15.11", - "axios": "1.3.5", - "express": "4.18.2", - "form-data": "4.0.0", - "jest": "29.5.0", - "multer": "1.4.5-lts.1", - "rimraf": "5.0.0", - "ts-jest": "29.1.0", - "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.4", - "zod": "3.21.4" + "@changesets/cli": "2.26.1", + "turbo": "1.8.8", + "typescript": "5.0.4" + }, + "pnpm": { + "overrides": { + "esbuild": "0.17.14" + } } -} \ No newline at end of file +} diff --git a/packages/axios/.gitignore b/packages/axios/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/axios/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/.npmignore b/packages/axios/.npmignore similarity index 100% rename from .npmignore rename to packages/axios/.npmignore diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md new file mode 100644 index 00000000..eb55e9c1 --- /dev/null +++ b/packages/axios/CHANGELOG.md @@ -0,0 +1,227 @@ +# @zodios/core + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +### Patch Changes + +- Updated dependencies [e67fa49] +- Updated dependencies [731e399] + - @zodios/core@11.0.0-beta.8 + +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +### Patch Changes + +- Updated dependencies [7dcbb0c] + - @zodios/core@11.0.0-beta.7 + +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +### Patch Changes + +- Updated dependencies [da4ddab] +- Updated dependencies [535c76b] + - @zodios/core@11.0.0-beta.6 + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +### Patch Changes + +- Updated dependencies [1b67309] +- Updated dependencies [c7c03bc] + - @zodios/core@11.0.0-beta.5 + +## 11.0.0-beta.4 + +### Major Changes + +- 679a267: update axios + +### Patch Changes + +- Updated dependencies [14ce00b] +- Updated dependencies [c9cae0a] +- Updated dependencies [3ac25a1] +- Updated dependencies [6c10dc2] +- Updated dependencies [679a267] +- Updated dependencies [90108a5] + - @zodios/core@11.0.0-beta.4 + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/axios/LICENSE b/packages/axios/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/axios/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/axios/README.md b/packages/axios/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/axios/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/axios/SECURITY.md b/packages/axios/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/axios/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/examples/define-types.ts b/packages/axios/examples/define-types.ts similarity index 100% rename from examples/define-types.ts rename to packages/axios/examples/define-types.ts diff --git a/examples/dev.to/api-key-plugin.ts b/packages/axios/examples/dev.to/api-key-plugin.ts similarity index 84% rename from examples/dev.to/api-key-plugin.ts rename to packages/axios/examples/dev.to/api-key-plugin.ts index 27bd9e43..ba768056 100644 --- a/examples/dev.to/api-key-plugin.ts +++ b/packages/axios/examples/dev.to/api-key-plugin.ts @@ -1,5 +1,3 @@ -import { AxiosRequestConfig } from "axios"; -import { config } from "process"; import { ZodiosPlugin } from "../../src/index"; export interface ApiKeyPluginConfig { diff --git a/examples/dev.to/articles.ts b/packages/axios/examples/dev.to/articles.ts similarity index 100% rename from examples/dev.to/articles.ts rename to packages/axios/examples/dev.to/articles.ts diff --git a/examples/dev.to/comments.ts b/packages/axios/examples/dev.to/comments.ts similarity index 100% rename from examples/dev.to/comments.ts rename to packages/axios/examples/dev.to/comments.ts diff --git a/examples/dev.to/example.ts b/packages/axios/examples/dev.to/example.ts similarity index 100% rename from examples/dev.to/example.ts rename to packages/axios/examples/dev.to/example.ts diff --git a/examples/dev.to/followers.ts b/packages/axios/examples/dev.to/followers.ts similarity index 100% rename from examples/dev.to/followers.ts rename to packages/axios/examples/dev.to/followers.ts diff --git a/examples/dev.to/follows.ts b/packages/axios/examples/dev.to/follows.ts similarity index 100% rename from examples/dev.to/follows.ts rename to packages/axios/examples/dev.to/follows.ts diff --git a/examples/dev.to/params.ts b/packages/axios/examples/dev.to/params.ts similarity index 100% rename from examples/dev.to/params.ts rename to packages/axios/examples/dev.to/params.ts diff --git a/examples/dev.to/users.ts b/packages/axios/examples/dev.to/users.ts similarity index 100% rename from examples/dev.to/users.ts rename to packages/axios/examples/dev.to/users.ts diff --git a/packages/axios/examples/io-ts-types.ts b/packages/axios/examples/io-ts-types.ts new file mode 100644 index 00000000..a2d64de4 --- /dev/null +++ b/packages/axios/examples/io-ts-types.ts @@ -0,0 +1,78 @@ +import { + Zodios, + makeApi, + ApiOf, + TypeProviderOf, + FetcherProviderOf, + ioTsTypeProvider, +} from "../src/index"; +import * as t from "io-ts"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/examples/jsonplaceholder.ts b/packages/axios/examples/jsonplaceholder.ts similarity index 98% rename from examples/jsonplaceholder.ts rename to packages/axios/examples/jsonplaceholder.ts index d4d08b20..5bd28b12 100644 --- a/examples/jsonplaceholder.ts +++ b/packages/axios/examples/jsonplaceholder.ts @@ -42,7 +42,7 @@ async function bootstrap() { path: "/users/:id", alias: "deleteUser", description: "Delete a user", - response: z.object({ }), + response: z.void(), }, { method: "post", diff --git a/examples/types-from-definition.ts b/packages/axios/examples/types-from-definition.ts similarity index 100% rename from examples/types-from-definition.ts rename to packages/axios/examples/types-from-definition.ts diff --git a/packages/axios/examples/typescript-types.ts b/packages/axios/examples/typescript-types.ts new file mode 100644 index 00000000..fdf8e533 --- /dev/null +++ b/packages/axios/examples/typescript-types.ts @@ -0,0 +1,77 @@ +import { + Zodios, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, + FetcherProviderOf, +} from "../src"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/jest.config.ts b/packages/axios/jest.config.ts similarity index 100% rename from jest.config.ts rename to packages/axios/jest.config.ts diff --git a/packages/axios/package.json b/packages/axios/package.json new file mode 100644 index 00000000..d779b33d --- /dev/null +++ b/packages/axios/package.json @@ -0,0 +1,82 @@ +{ + "name": "@zodios/axios", + "description": "Typescript API client with axios", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "axios", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "example": "ts-node examples/jsonplaceholder.ts", + "example:dev.to": "ts-node examples/dev.to/example.ts", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.19", + "axios": "^0.x || ^1.0.0", + "fp-ts": "2.x", + "io-ts": "2.x", + "zod": "^3.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/multer": "1.4.7", + "@types/node": "18.15.11", + "@zodios/core": "workspace:*", + "axios": "1.3.5", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", + "jest": "29.5.0", + "multer": "1.4.5-lts.1", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/axios/src/axios-provider.ts b/packages/axios/src/axios-provider.ts new file mode 100644 index 00000000..1987337a --- /dev/null +++ b/packages/axios/src/axios-provider.ts @@ -0,0 +1,67 @@ +import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; +import { + AnyZodiosRequestOptions, + AnyZodiosFetcherProvider, + ZodiosFetcherFactory, + ZodiosFetcher, +} from "@zodios/core"; +import { Merge } from "@zodios/core/lib/utils.types"; +import { omit, replacePathParams } from "./utils"; + +type AxiosErrorStatus = Merge< + Omit, + { + response: Merge< + AxiosError["response"], + { + status: Status extends "default" ? 0 & { error: "default" } : Status; + } + >; + } +>; + +type AxiosRequestConfig = Parameters[0]; +type AxiosCreateConfig = Parameters[0]; + +type AxiosProviderOptions = { + axiosInstance?: AxiosInstance; + axiosConfig?: AxiosCreateConfig; +}; + +export interface AxiosProvider extends AnyZodiosFetcherProvider { + options: AxiosProviderOptions; + config: Omit; + response: AxiosResponse; + + // provider for TypeOfError + error: AxiosErrorStatus; +} + +class Fetcher implements ZodiosFetcher { + instance: AxiosInstance; + constructor( + baseURL: string | undefined, + config: AxiosCreateConfig | undefined, + instance: AxiosInstance | undefined + ) { + this.instance = instance || axios.create(config); + if (baseURL) this.instance.defaults.baseURL = baseURL; + } + + fetch(config: AnyZodiosRequestOptions) { + return this.instance.request({ + ...omit(config, ["params", "queries", "body"]), + url: replacePathParams(config), + params: config.queries, + data: config.body, + }); + } +} + +export const axiosFactory: ZodiosFetcherFactory = (options) => { + return new Fetcher( + options?.baseURL, + options?.axiosConfig, + options?.axiosInstance + ); +}; diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts new file mode 100644 index 00000000..c1057dfb --- /dev/null +++ b/packages/axios/src/index.ts @@ -0,0 +1,3 @@ +export { Zodios } from "./zodios"; +export type { AxiosProvider } from "./axios-provider"; +export * from "@zodios/core"; diff --git a/packages/axios/src/utils.ts b/packages/axios/src/utils.ts new file mode 100644 index 00000000..b84e6338 --- /dev/null +++ b/packages/axios/src/utils.ts @@ -0,0 +1,33 @@ +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; + +/** + * omit properties from an object + * @param obj - the object to omit properties from + * @param keys - the keys to omit + * @returns the object with the omitted properties + */ +export function omit( + obj: T | undefined, + keys: K[] +): Omit { + const ret = { ...obj } as T; + for (const key of keys) { + delete ret[key]; + } + return ret; +} + +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function replacePathParams( + config: ReadonlyDeep<{ url: string; params?: Record }> +) { + let result: string = config.url; + const params = config.params; + if (params) { + result = result.replace(paramsRegExp, (match, key) => + key in params ? `${params[key]}` : match + ); + } + return result; +} diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts new file mode 100644 index 00000000..2c49d2d6 --- /dev/null +++ b/packages/axios/src/zodios.test.ts @@ -0,0 +1,958 @@ +/// +import { AxiosError } from "axios"; +import express from "express"; +import { AddressInfo } from "net"; +import { z, ZodError } from "zod"; +//if (globalThis.FormData === undefined) { +globalThis.FormData = require("form-data"); +//} +import { Zodios } from "./zodios"; +import { + ZodiosError, + AnyZodiosFetcherProvider, + ZodiosPlugin, + apiBuilder, +} from "@zodios/core"; +import multer from "multer"; +import { Assert } from "@zodios/core/lib/utils.types"; +import { AxiosProvider } from "./axios-provider"; + +const multipart = multer({ storage: multer.memoryStorage() }); + +describe("Zodios", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(async () => { + app = express(); + app.use(express.json()); + app.get("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.post("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.get("/error401", (req, res) => { + res.status(401).json({}); + }); + app.get("/error502", (req, res) => { + res.status(502).json({ error: { message: "bad gateway" } }); + }); + app.get("/queries", (req, res) => { + res.status(200).json({ + queries: req.query.id, + }); + }); + app.get("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + app.get("/path/:uuid", (req, res) => { + res.status(200).json({ uuid: req.params.uuid }); + }); + app.get("/:id/address/:address", (req, res) => { + res + .status(200) + .json({ id: Number(req.params.id), address: req.params.address }); + }); + app.post("/", (req, res) => { + res.status(200).json({ id: 3, name: req.body.name }); + }); + app.put("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.patch("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.delete("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id) }); + }); + app.post("/form-data", multipart.none(), (req, res) => { + res.status(200).json(req.body); + }); + app.post( + "/form-url", + express.urlencoded({ extended: false }), + (req, res) => { + res.status(200).json(req.body); + } + ); + app.post("/text", express.text(), (req, res) => { + res.status(200).send(req.body); + }); + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should be defined", () => { + expect(Zodios).toBeDefined(); + }); + + it("should throw if baseUrl is not provided", () => { + // @ts-ignore + expect(() => new Zodios(undefined, [])).toThrowError( + "Zodios: missing base url" + ); + }); + + it("should throw if api is not provided", () => { + // @ts-ignore + expect(() => new Zodios()).toThrowError("Zodios: missing api description"); + }); + + it("should throw if api is not an array", () => { + // @ts-ignore + expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); + }); + + it("should create a new instance of Zodios", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + expect(zodios).toBeDefined(); + }); + it("should create a new instance when providing an api", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should should throw with duplicate api endpoints", () => { + expect( + () => + new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /:id'"); + }); + + it("should create a new instance whithout base URL", () => { + const zodios = new Zodios([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should make an http request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ]); + const response = await zodios.request({ + method: "get", + url: "/:id", + params: { id: 7 }, + }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http get with standard query arrays", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/queries", + parameters: [ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ], + response: z.object({ + queries: z.array(z.string()), + }), + }, + ]); + const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); + expect(response).toEqual({ queries: ["1", "2"] }); + }); + + it("should make an http get with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id", { params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http alias request with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should work with api builder", async () => { + const api = apiBuilder({ + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }).build(); + const zodios = new Zodios(`http://localhost:${port}`, api); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make a get request with forgotten params and get back a zod error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + // @ts-ignore + await zodios.get("/:id"); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + } + }); + + it("should make an http get with multiples path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id/address/:address", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id/address/:address", { + params: { id: 7, address: "address" }, + }); + expect(response).toEqual({ id: 7, address: "address" }); + }); + + it("should make an http post with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/", { body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http post with transformed body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + firstname: z.string(), + lastname: z.string(), + }) + .transform((data) => ({ + name: `${data.firstname} ${data.lastname}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const config = { + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + } as const; + const response = await zodios.request(config); + expect(config).toEqual({ + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + }); + expect(response).toEqual({ id: 3, name: "post test" }); + }); + + it("should throw a zodios error if params are not correct", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + email: z.string().email(), + }) + .transform((data) => ({ + name: `${data.email.split("@")[0]}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + let response; + let error: ZodiosError | undefined; + try { + response = await zodios.post("/", { + body: { + email: "post", + }, + }); + } catch (err) { + error = err as ZodiosError; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect(error!.cause).toBeInstanceOf(ZodError); + expect(error!.message).toBe("Zodios: Invalid Body parameter 'name'"); + }); + + it("should make an http mutation alias request with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + alias: "create", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.create({ body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http put", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http put alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + alias: "update", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http patch", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http patch alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + alias: "update", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http delete", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.delete("/:id", { + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should make an http delete alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + alias: "remove", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.remove({ + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should validate uuid in path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + const response = await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1d-3967-4518-bc89-75a901aee128" }, + }); + expect(response).toEqual({ + uuid: "e9e09a1d-3967-4518-bc89-75a901aee128", + }); + }); + + it("should not validate bad path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + let error; + try { + await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1-3967-4518-bc89-75a901aee128" }, + }); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toBe( + "Zodios: Invalid Path parameter 'uuid'" + ); + }); + + it("should not validate bad formatted responses", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ]); + try { + await zodios.get("/:id", { params: { id: 1 } }); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + expect((e as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((e as ZodiosError).message) + .toBe(`Zodios: Invalid response from endpoint 'get /:id' +status: 200 OK +cause: +[ + { + "code": "invalid_type", + "expected": "string", + "received": "undefined", + "path": [ + "more" + ], + "message": "Required" + } +] +received: +{ + "id": 1, + "name": "test" +}`); + expect((e as ZodiosError).data).toEqual({ + id: 1, + name: "test", + }); + expect((e as ZodiosError).config).toEqual({ + method: "get", + url: "/:id", + params: { id: 1 }, + }); + } + }); + + it("should match Expected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), + }), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), + }), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), + }), + }, + ], + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + if (zodios.isErrorFromPath("get", "/error502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + const test: Assert = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + if (zodios.isErrorFromAlias("getError502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + // ^? + const test: Assert = true; + } else if (error.response.status === 401) { + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _401: true } } + > = true; + } else { + const testStatus = error.response.status; + // ^? + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _default: true } } + > = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + }); + + it("should match Unexpected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); + }); + + it("should return response when disabling validation", async () => { + const zodios = new Zodios( + `http://localhost:${port}`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { validate: false } + ); + const response = await zodios.get("/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "test", + }); + }); + + it("should trigger an axios error with error response", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/error502", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + await zodios.get("/error502"); + } catch (e) { + expect((e as AxiosError).response?.data).toEqual({ + error: { + message: "bad gateway", + }, + }); + } + }); + + it("should send a form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-data", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: multipart/form-data body must be an object" + ); + }); + + it("should send a form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-url", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: application/x-www-form-urlencoded body must be an object" + ); + }); + + it("should send a text request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/text", + requestFormat: "text", + parameters: [ + { + name: "body", + type: "Body", + schema: z.string(), + }, + ], + response: z.string(), + }, + ]); + const response = await zodios.post("/text", { body: "test" }); + expect(response).toEqual("test"); + }); +}); diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts new file mode 100644 index 00000000..f01087ca --- /dev/null +++ b/packages/axios/src/zodios.ts @@ -0,0 +1,61 @@ +import type { + ZodiosEndpointDefinition, + ZodiosOptions, + AnyZodiosTypeProvider, + TypeOfFetcherOptions, + ZodiosInstance, + ZodTypeProvider, +} from "@zodios/core"; +import { ZodiosCore } from "@zodios/core"; +import { axiosFactory, AxiosProvider } from "./axios-provider"; + +function isZodiosOptions( + lastArg: unknown +): lastArg is ZodiosOptions { + return !Array.isArray(lastArg) && typeof lastArg === "object"; +} + +const ZodiosAxios = new Proxy(ZodiosCore, { + construct(target, args) { + if (args.length !== 0) { + let lastArg = args[args.length - 1]; + if (isZodiosOptions(lastArg)) { + lastArg.fetcherFactory = axiosFactory; + } else { + args.push({ fetcherFactory: axiosFactory }); + } + } + // @ts-ignore + return new target(...args); + }, +}); + +export interface Zodios { + new < + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + api: Api, + options?: Omit< + ZodiosOptions, + "fetcherFactory" + > & + TypeOfFetcherOptions + ): ZodiosInstance; + new < + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + baseUrl: string, + api: Api, + options?: Omit< + ZodiosOptions, + "fetcherFactory" + > & + TypeOfFetcherOptions + ): ZodiosInstance; +} + +const Zodios = ZodiosAxios as Zodios; + +export { Zodios }; diff --git a/tsconfig.build.json b/packages/axios/tsconfig.build.json similarity index 100% rename from tsconfig.build.json rename to packages/axios/tsconfig.build.json diff --git a/packages/axios/tsconfig.json b/packages/axios/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/axios/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/axios/tsup.config.js b/packages/axios/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/axios/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/core/.gitignore b/packages/core/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/core/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/core/.npmignore b/packages/core/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/core/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md new file mode 100644 index 00000000..3315087c --- /dev/null +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,137 @@ +# @zodios/core + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +## 11.0.0-beta.4 + +### Major Changes + +- 6c10dc2: rename exports +- 679a267: update axios + +### Patch Changes + +- 14ce00b: add fetch implementation +- c9cae0a: autocommit on changesets +- 3ac25a1: add fetcher provider and axios impl +- 90108a5: body is now part of the config + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/core/SECURITY.md b/packages/core/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/core/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/core/examples/airbytes-api.ts b/packages/core/examples/airbytes-api.ts new file mode 100644 index 00000000..9030c662 --- /dev/null +++ b/packages/core/examples/airbytes-api.ts @@ -0,0 +1,3019 @@ +import { makeApi, ZodiosCore, type ZodiosOptions } from "../src"; +import { z } from "zod"; + +const NotificationType = z.enum(["slack", "customerio"]); +const SlackNotificationConfiguration = z.object({ webhook: z.string() }); +const CustomerioNotificationConfiguration = z.object({}).partial(); +const Notification = z.object({ + notificationType: NotificationType, + sendOnSuccess: z.boolean(), + sendOnFailure: z.boolean().default(true), + slackConfiguration: SlackNotificationConfiguration.optional(), + customerioConfiguration: CustomerioNotificationConfiguration.optional(), +}); +const Geography = z.enum(["auto", "us", "eu"]); +const WebhookConfigWrite = z + .object({ + name: z.string(), + authToken: z.string(), + validationUrl: z.string(), + }) + .partial(); +const WorkspaceCreate = z.object({ + email: z.string().email().optional(), + anonymousDataCollection: z.boolean().optional(), + name: z.string(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + displaySetupWizard: z.boolean().optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigWrite).optional(), +}); +const WorkspaceId = z.string(); +const CustomerId = z.string(); +const WebhookConfigRead = z.object({ + id: z.string().uuid(), + name: z.string().optional(), +}); +const WorkspaceRead = z.object({ + workspaceId: WorkspaceId.uuid(), + customerId: CustomerId.uuid(), + email: z.string().email().optional(), + name: z.string(), + slug: z.string(), + initialSetupComplete: z.boolean(), + displaySetupWizard: z.boolean().optional(), + anonymousDataCollection: z.boolean().optional(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + firstCompletedSync: z.boolean().optional(), + feedbackDone: z.boolean().optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigRead).optional(), +}); +const WorkspaceIdRequestBody = z.object({ workspaceId: WorkspaceId.uuid() }); +const WorkspaceReadList = z.object({ workspaces: z.array(WorkspaceRead) }); +const SlugRequestBody = z.object({ slug: z.string() }); +const ConnectionId = z.string(); +const ConnectionIdRequestBody = z.object({ connectionId: ConnectionId.uuid() }); +const WorkspaceUpdate = z.object({ + workspaceId: WorkspaceId.uuid(), + email: z.string().email().optional(), + initialSetupComplete: z.boolean().optional(), + displaySetupWizard: z.boolean().optional(), + anonymousDataCollection: z.boolean().optional(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigWrite).optional(), +}); +const WorkspaceUpdateName = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), +}); +const WorkspaceGiveFeedback = z.object({ workspaceId: WorkspaceId.uuid() }); +const NotificationRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), +}); +const SourceDefinitionId = z.string(); +const ResourceRequirements = z + .object({ + cpu_request: z.string(), + cpu_limit: z.string(), + memory_request: z.string(), + memory_limit: z.string(), + }) + .partial(); +const JobType = z.enum([ + "get_spec", + "check_connection", + "discover_schema", + "sync", + "reset_connection", + "connection_updater", + "replicate", +]); +const JobTypeResourceLimit = z.object({ + jobType: JobType, + resourceRequirements: ResourceRequirements, +}); +const ActorDefinitionResourceRequirements = z + .object({ + default: ResourceRequirements, + jobSpecific: z.array(JobTypeResourceLimit), + }) + .partial(); +const SourceDefinitionUpdate = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + dockerImageTag: z.string(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const ReleaseStage = z.enum(["alpha", "beta", "generally_available", "custom"]); +const SourceDefinitionRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url().optional(), + icon: z.string().optional(), + protocolVersion: z.string().optional(), + releaseStage: ReleaseStage.optional(), + releaseDate: z.string().optional(), + sourceType: z.enum(["api", "file", "database", "custom"]).optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const SourceDefinitionReadList = z.object({ + sourceDefinitions: z.array(SourceDefinitionRead), +}); +const SourceDefinitionIdRequestBody = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), +}); +const PrivateSourceDefinitionRead = z.object({ + sourceDefinition: SourceDefinitionRead, + granted: z.boolean(), +}); +const PrivateSourceDefinitionReadList = z.object({ + sourceDefinitions: z.array(PrivateSourceDefinitionRead), +}); +const SourceDefinitionCreate = z.object({ + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const CustomSourceDefinitionCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + sourceDefinition: SourceDefinitionCreate, +}); +const SourceDefinitionIdWithWorkspaceId = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), +}); +const SourceDefinitionSpecification = z.object({}).partial(); +const OAuth2Specification = z.object({ + rootObject: z.array(z.unknown()), + oauthFlowInitParameters: z.array(z.array(z.string())), + oauthFlowOutputParameters: z.array(z.array(z.string())), +}); +const AuthSpecification = z + .object({ + auth_type: z.literal("oauth2.0"), + oauth2Specification: OAuth2Specification, + }) + .partial(); +const SourceAuthSpecification = AuthSpecification; +const OAuthConfiguration = z.unknown(); +const OAuthConfigSpecification = z + .object({ + oauthUserInputFromConnectorConfigSpecification: OAuthConfiguration, + completeOAuthOutputSpecification: OAuthConfiguration, + completeOAuthServerInputSpecification: OAuthConfiguration, + completeOAuthServerOutputSpecification: OAuthConfiguration, + }) + .partial(); +const AdvancedAuth = z + .object({ + authFlowType: z.enum(["oauth2.0", "oauth1.0"]), + predicateKey: z.array(z.string()), + predicateValue: z.string(), + oauthConfigSpecification: OAuthConfigSpecification, + }) + .partial(); +const JobConfigType = z.enum([ + "check_connection_source", + "check_connection_destination", + "discover_schema", + "get_spec", + "sync", + "reset_connection", +]); +const LogRead = z.object({ logLines: z.array(z.string()) }); +const SynchronousJobRead = z.object({ + id: z.string().uuid(), + configType: JobConfigType, + configId: z.string().optional(), + createdAt: z.number().int(), + endedAt: z.number().int(), + succeeded: z.boolean(), + connectorConfigurationUpdated: z.boolean().optional(), + logs: LogRead.optional(), +}); +const SourceDefinitionSpecificationRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + documentationUrl: z.string().optional(), + connectionSpecification: SourceDefinitionSpecification.optional(), + authSpecification: SourceAuthSpecification.optional(), + advancedAuth: AdvancedAuth.optional(), + jobInfo: SynchronousJobRead, +}); +const SourceConfiguration = z.unknown(); +const SourceCreate = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + connectionConfiguration: SourceConfiguration, + workspaceId: WorkspaceId.uuid(), + name: z.string(), +}); +const SourceId = z.string(); +const SourceRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceId: SourceId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), + sourceName: z.string(), + icon: z.string().optional(), +}); +const SourceUpdate = z.object({ + sourceId: SourceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), +}); +const SourceReadList = z.object({ sources: z.array(SourceRead) }); +const SourceIdRequestBody = z.object({ sourceId: SourceId.uuid() }); +const ActorCatalogWithUpdatedAt = z + .object({ updatedAt: z.number().int(), catalog: z.object({}).partial() }) + .partial(); +const SourceSearch = z + .object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceId: SourceId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), + sourceName: z.string(), + }) + .partial(); +const SourceCloneConfiguration = z + .object({ connectionConfiguration: SourceConfiguration, name: z.string() }) + .partial(); +const SourceCloneRequestBody = z.object({ + sourceCloneId: SourceId.uuid(), + sourceConfiguration: SourceCloneConfiguration.optional(), +}); +const CheckConnectionRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), + jobInfo: SynchronousJobRead, +}); +const SourceDiscoverSchemaRequestBody = z.object({ + sourceId: SourceId.uuid(), + connectionId: z.string().uuid().optional(), + disable_cache: z.boolean().optional(), + notifySchemaChange: z.boolean().optional(), +}); +const StreamJsonSchema = z.object({}).partial(); +const SyncMode = z.enum(["full_refresh", "incremental"]); +const AirbyteStream = z.object({ + name: z.string(), + jsonSchema: StreamJsonSchema.optional(), + supportedSyncModes: z.array(SyncMode).optional(), + sourceDefinedCursor: z.boolean().optional(), + defaultCursorField: z.array(z.string()).optional(), + sourceDefinedPrimaryKey: z.array(z.array(z.string())).optional(), + namespace: z.string().optional(), +}); +const DestinationSyncMode = z.enum(["append", "overwrite", "append_dedup"]); +const SelectedFieldInfo = z + .object({ fieldPath: z.array(z.string()) }) + .partial(); +const AirbyteStreamConfiguration = z.object({ + syncMode: SyncMode, + cursorField: z.array(z.string()).optional(), + destinationSyncMode: DestinationSyncMode, + primaryKey: z.array(z.array(z.string())).optional(), + aliasName: z.string().optional(), + selected: z.boolean().optional(), + suggested: z.boolean().optional(), + fieldSelectionEnabled: z.boolean().optional(), + selectedFields: z.array(SelectedFieldInfo).optional(), +}); +const AirbyteStreamAndConfiguration = z + .object({ stream: AirbyteStream, config: AirbyteStreamConfiguration }) + .partial(); +const AirbyteCatalog = z.object({ + streams: z.array(AirbyteStreamAndConfiguration), +}); +const StreamDescriptor = z.object({ + name: z.string(), + namespace: z.string().optional(), +}); +const FieldName = z.array(z.string()); +const FieldSchema = z.object({}).partial(); +const FieldAdd = z.object({ schema: FieldSchema }).partial(); +const FieldRemove = z.object({ schema: FieldSchema }).partial(); +const FieldSchemaUpdate = z.object({ + oldSchema: FieldSchema, + newSchema: FieldSchema, +}); +const FieldTransform = z.object({ + transformType: z.enum(["add_field", "remove_field", "update_field_schema"]), + fieldName: FieldName, + breaking: z.boolean(), + addField: FieldAdd.optional(), + removeField: FieldRemove.optional(), + updateFieldSchema: FieldSchemaUpdate.optional(), +}); +const StreamTransform = z.object({ + transformType: z.enum(["add_stream", "remove_stream", "update_stream"]), + streamDescriptor: StreamDescriptor, + updateStream: z.array(FieldTransform).optional(), +}); +const CatalogDiff = z.object({ transforms: z.array(StreamTransform) }); +const ConnectionStatus = z.enum(["active", "inactive", "deprecated"]); +const SourceDiscoverSchemaRead = z.object({ + catalog: AirbyteCatalog.optional(), + jobInfo: SynchronousJobRead, + catalogId: z.string().uuid().optional(), + catalogDiff: CatalogDiff.optional(), + breakingChange: z.boolean().optional(), + connectionStatus: ConnectionStatus.optional(), +}); +const SourceDiscoverSchemaWriteRequestBody = z.object({ + catalog: AirbyteCatalog, + sourceId: SourceId.uuid().optional(), + connectorVersion: z.string().optional(), + configurationHash: z.string().optional(), +}); +const DiscoverCatalogResult = z.object({ catalogId: z.string().uuid() }); +const DestinationDefinitionId = z.string(); +const DestinationDefinitionUpdate = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + dockerImageTag: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const NormalizationDestinationDefinitionConfig = z.object({ + supported: z.boolean(), + normalizationRepository: z.string().optional(), + normalizationTag: z.string().optional(), + normalizationIntegrationType: z.string().optional(), +}); +const DestinationDefinitionRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + protocolVersion: z.string().optional(), + releaseStage: ReleaseStage.optional(), + releaseDate: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), + supportsDbt: z.boolean(), + normalizationConfig: NormalizationDestinationDefinitionConfig, +}); +const DestinationDefinitionReadList = z.object({ + destinationDefinitions: z.array(DestinationDefinitionRead), +}); +const DestinationDefinitionIdRequestBody = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), +}); +const PrivateDestinationDefinitionRead = z.object({ + destinationDefinition: DestinationDefinitionRead, + granted: z.boolean(), +}); +const PrivateDestinationDefinitionReadList = z.object({ + destinationDefinitions: z.array(PrivateDestinationDefinitionRead), +}); +const DestinationDefinitionCreate = z.object({ + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const CustomDestinationDefinitionCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + destinationDefinition: DestinationDefinitionCreate, +}); +const DestinationDefinitionIdWithWorkspaceId = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), +}); +const DestinationDefinitionSpecification = z.unknown(); +const DestinationAuthSpecification = AuthSpecification; +const DestinationDefinitionSpecificationRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + documentationUrl: z.string().optional(), + connectionSpecification: DestinationDefinitionSpecification.optional(), + authSpecification: DestinationAuthSpecification.optional(), + advancedAuth: AdvancedAuth.optional(), + jobInfo: SynchronousJobRead, + supportedDestinationSyncModes: z.array(DestinationSyncMode).optional(), +}); +const DestinationConfiguration = z.unknown(); +const DestinationCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + connectionConfiguration: DestinationConfiguration, +}); +const DestinationId = z.string(); +const DestinationRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationId: DestinationId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), + destinationName: z.string(), + icon: z.string().optional(), +}); +const DestinationUpdate = z.object({ + destinationId: DestinationId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), +}); +const DestinationReadList = z.object({ + destinations: z.array(DestinationRead), +}); +const DestinationIdRequestBody = z.object({ + destinationId: DestinationId.uuid(), +}); +const DestinationSearch = z + .object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationId: DestinationId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), + destinationName: z.string(), + }) + .partial(); +const DestinationCloneConfiguration = z + .object({ + connectionConfiguration: DestinationConfiguration, + name: z.string(), + }) + .partial(); +const DestinationCloneRequestBody = z.object({ + destinationCloneId: DestinationId.uuid(), + destinationConfiguration: DestinationCloneConfiguration.optional(), +}); +const NamespaceDefinitionType = z.enum([ + "source", + "destination", + "customformat", +]); +const OperationId = z.string(); +const ConnectionSchedule = z.object({ + units: z.number().int(), + timeUnit: z.enum(["minutes", "hours", "days", "weeks", "months"]), +}); +const ConnectionScheduleType = z.enum(["manual", "basic", "cron"]); +const ConnectionScheduleData = z + .object({ + basicSchedule: z.object({ + timeUnit: z.enum(["minutes", "hours", "days", "weeks", "months"]), + units: z.number().int(), + }), + cron: z.object({ cronExpression: z.string(), cronTimeZone: z.string() }), + }) + .partial(); +const NonBreakingChangesPreference = z.enum(["ignore", "disable"]); +const ConnectionCreate = z.object({ + name: z.string().optional(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const ConnectionRead = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog, + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + breakingChange: z.boolean(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const ConnectionUpdate = z.object({ + connectionId: ConnectionId.uuid(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + name: z.string().optional(), + prefix: z.string().optional(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus.optional(), + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), + breakingChange: z.boolean().optional(), +}); +const ConnectionReadList = z.object({ connections: z.array(ConnectionRead) }); +const ConnectionStateType = z.enum(["global", "stream", "legacy", "not_set"]); +const StateBlob = z.object({}).partial(); +const StreamState = z.object({ + streamDescriptor: StreamDescriptor, + streamState: StateBlob.optional(), +}); +const GlobalState = z.object({ + shared_state: StateBlob.optional(), + streamStates: z.array(StreamState), +}); +const ConnectionState = z.object({ + stateType: ConnectionStateType, + connectionId: ConnectionId.uuid(), + state: StateBlob.optional(), + streamState: z.array(StreamState).optional(), + globalState: GlobalState.optional(), +}); +const ConnectionStateCreateOrUpdate = z.object({ + connectionId: ConnectionId.uuid(), + connectionState: ConnectionState, +}); +const ConnectionSearch = z + .object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType, + namespaceFormat: z.string(), + prefix: z.string(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + schedule: ConnectionSchedule, + scheduleType: ConnectionScheduleType, + scheduleData: ConnectionScheduleData, + status: ConnectionStatus, + source: SourceSearch, + destination: DestinationSearch, + }) + .partial(); +const JobId = z.number(); +const JobStatus = z.enum([ + "pending", + "running", + "incomplete", + "failed", + "succeeded", + "cancelled", +]); +const ResetConfig = z + .object({ streamsToReset: z.array(StreamDescriptor) }) + .partial(); +const JobRead = z.object({ + id: JobId.int(), + configType: JobConfigType, + configId: z.string(), + createdAt: z.number().int(), + updatedAt: z.number().int(), + startedAt: z.number().int().optional(), + status: JobStatus, + resetConfig: ResetConfig.optional(), +}); +const AttemptStatus = z.enum(["running", "failed", "succeeded"]); +const AttemptStats = z + .object({ + recordsEmitted: z.number().int(), + bytesEmitted: z.number().int(), + stateMessagesEmitted: z.number().int(), + recordsCommitted: z.number().int(), + estimatedRecords: z.number().int(), + estimatedBytes: z.number().int(), + }) + .partial(); +const AttemptStreamStats = z.object({ + streamName: z.string(), + streamNamespace: z.string().optional(), + stats: AttemptStats, +}); +const AttemptFailureOrigin = z.enum([ + "source", + "destination", + "replication", + "persistence", + "normalization", + "dbt", + "airbyte_platform", + "unknown", +]); +const AttemptFailureType = z.enum([ + "config_error", + "system_error", + "manual_cancellation", + "refresh_schema", +]); +const AttemptFailureReason = z.object({ + failureOrigin: AttemptFailureOrigin.optional(), + failureType: AttemptFailureType.optional(), + externalMessage: z.string().optional(), + internalMessage: z.string().optional(), + stacktrace: z.string().optional(), + retryable: z.boolean().optional(), + timestamp: z.number().int(), +}); +const AttemptFailureSummary = z.object({ + failures: z.array(AttemptFailureReason), + partialSuccess: z.boolean().optional(), +}); +const AttemptRead = z.object({ + id: z.number().int(), + status: AttemptStatus, + createdAt: z.number().int(), + updatedAt: z.number().int(), + endedAt: z.number().int().optional(), + bytesSynced: z.number().int().optional(), + recordsSynced: z.number().int().optional(), + totalStats: AttemptStats.optional(), + streamStats: z.array(AttemptStreamStats).optional(), + failureSummary: AttemptFailureSummary.optional(), +}); +const AttemptInfoRead = z.object({ attempt: AttemptRead, logs: LogRead }); +const JobInfoRead = z.object({ + job: JobRead, + attempts: z.array(AttemptInfoRead), +}); +const OperatorType = z.enum(["normalization", "dbt", "webhook"]); +const OperatorNormalization = z + .object({ option: z.literal("basic") }) + .partial(); +const OperatorDbt = z.object({ + gitRepoUrl: z.string(), + gitRepoBranch: z.string().optional(), + dockerImage: z.string().optional(), + dbtArguments: z.string().optional(), +}); +const OperatorWebhook = z + .object({ + webhookConfigId: z.string().uuid(), + webhookType: z.literal("dbtCloud"), + dbtCloud: z.object({ + accountId: z.number().int(), + jobId: z.number().int(), + }), + executionUrl: z.string(), + executionBody: z.string(), + }) + .partial(); +const OperatorConfiguration = z.object({ + operatorType: OperatorType, + normalization: OperatorNormalization.optional(), + dbt: OperatorDbt.optional(), + webhook: OperatorWebhook.optional(), +}); +const CheckOperationRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), +}); +const OperationCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationRead = z.object({ + workspaceId: WorkspaceId.uuid(), + operationId: OperationId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationUpdate = z.object({ + operationId: OperationId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationReadList = z.object({ operations: z.array(OperationRead) }); +const OperationIdRequestBody = z.object({ operationId: OperationId.uuid() }); +const SourceCoreConfig = z.object({ + sourceId: SourceId.uuid().optional(), + sourceDefinitionId: SourceDefinitionId.uuid(), + connectionConfiguration: SourceConfiguration, + workspaceId: WorkspaceId.uuid(), +}); +const DestinationCoreConfig = z.object({ + destinationId: DestinationId.uuid().optional(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + connectionConfiguration: DestinationConfiguration, + workspaceId: WorkspaceId.uuid(), +}); +const SetInstancewideSourceOauthParamsRequestBody = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + params: z.object({}).partial().passthrough(), +}); +const OAuthInputConfiguration = OAuthConfiguration; +const SourceOauthConsentRequest = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + sourceId: SourceId.uuid().optional(), +}); +const OAuthConsentRead = z.object({ consentUrl: z.string() }); +const CompleteSourceOauthRequest = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string().optional(), + queryParams: z.object({}).partial().passthrough().optional(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + sourceId: SourceId.uuid().optional(), +}); +const CompleteOAuthResponse = z.object({}).partial().passthrough(); +const DestinationOauthConsentRequest = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + destinationId: DestinationId.uuid().optional(), +}); +const CompleteDestinationOAuthRequest = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string().optional(), + queryParams: z.object({}).partial().passthrough().optional(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + destinationId: DestinationId.uuid().optional(), +}); +const SetInstancewideDestinationOauthParamsRequestBody = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + params: z.object({}).partial().passthrough(), +}); +const WebBackendCheckUpdatesRead = z.object({ + destinationDefinitions: z.number().int(), + sourceDefinitions: z.number().int(), +}); +const WebBackendConnectionListRequestBody = z.object({ + workspaceId: WorkspaceId.uuid(), + sourceId: z.array(SourceId).optional(), + destinationId: z.array(DestinationId).optional(), +}); +const SourceSnippetRead = z.object({ + sourceId: SourceId.uuid(), + name: z.string(), + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceName: z.string(), + icon: z.string().optional(), +}); +const DestinationSnippetRead = z.object({ + destinationId: DestinationId.uuid(), + name: z.string(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationName: z.string(), + icon: z.string().optional(), +}); +const JobCreatedAt = z.number(); +const SchemaChange = z.enum(["no_change", "non_breaking", "breaking"]); +const WebBackendConnectionListItem = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + source: SourceSnippetRead, + destination: DestinationSnippetRead, + latestSyncJobCreatedAt: JobCreatedAt.int().optional(), + latestSyncJobStatus: JobStatus.optional(), + isSyncing: z.boolean(), + schemaChange: SchemaChange, +}); +const WebBackendConnectionReadList = z.object({ + connections: z.array(WebBackendConnectionListItem), +}); +const WebBackendConnectionRequestBody = z.object({ + withRefreshedCatalog: z.boolean().optional(), + connectionId: ConnectionId.uuid(), +}); +const WebBackendConnectionRead = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + syncCatalog: AirbyteCatalog, + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + operationIds: z.array(OperationId).optional(), + source: SourceRead, + destination: DestinationRead, + operations: z.array(OperationRead).optional(), + latestSyncJobCreatedAt: JobCreatedAt.int().optional(), + latestSyncJobStatus: JobStatus.optional(), + isSyncing: z.boolean(), + resourceRequirements: ResourceRequirements.optional(), + catalogId: z.string().uuid().optional(), + catalogDiff: CatalogDiff.optional(), + geography: Geography.optional(), + schemaChange: SchemaChange, + notifySchemaChanges: z.boolean(), + nonBreakingChangesPreference: NonBreakingChangesPreference, +}); +const WebBackendConnectionCreate = z.object({ + name: z.string().optional(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + operations: z.array(OperationCreate).optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const WebBackendOperationCreateOrUpdate = z.object({ + operationId: OperationId.uuid().optional(), + workspaceId: WorkspaceId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const WebBackendConnectionUpdate = z.object({ + name: z.string().optional(), + connectionId: ConnectionId.uuid(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus.optional(), + resourceRequirements: ResourceRequirements.optional(), + skipReset: z.boolean().optional(), + operations: z.array(WebBackendOperationCreateOrUpdate).optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const WebBackendWorkspaceState = z.object({ workspaceId: WorkspaceId.uuid() }); +const WebBackendWorkspaceStateResult = z.object({ + hasConnections: z.boolean(), + hasSources: z.boolean(), + hasDestinations: z.boolean(), +}); +const WebBackendGeographiesListResult = z.object({ + geographies: z.array(Geography), +}); +const Pagination = z + .object({ pageSize: z.number().int(), rowOffset: z.number().int() }) + .partial(); +const JobListRequestBody = z.object({ + configTypes: z.array(JobConfigType), + configId: z.string(), + includingJobId: JobId.int().optional(), + pagination: Pagination.optional(), +}); +const JobWithAttemptsRead = z + .object({ job: JobRead, attempts: z.array(AttemptRead) }) + .partial(); +const JobReadList = z.object({ + jobs: z.array(JobWithAttemptsRead), + totalJobCount: z.number().int(), +}); +const JobIdRequestBody = z.object({ id: JobId.int() }); +const JobOptionalRead = z.object({ job: JobRead }).partial(); +const JobInfoLightRead = z.object({ job: JobRead }); +const JobDebugRead = z.object({ + id: JobId.int(), + configType: JobConfigType, + configId: z.string(), + status: JobStatus, + airbyteVersion: z.string(), + sourceDefinition: SourceDefinitionRead, + destinationDefinition: DestinationDefinitionRead, +}); +const WorkflowStateRead = z.object({ running: z.boolean() }); +const JobDebugInfoRead = z.object({ + job: JobDebugRead, + attempts: z.array(AttemptInfoRead), + workflowState: WorkflowStateRead.optional(), +}); +const AttemptNumber = z.number(); +const AttemptNormalizationStatusRead = z + .object({ + attemptNumber: AttemptNumber.int(), + hasRecordsCommitted: z.boolean(), + recordsCommitted: z.number().int(), + hasNormalizationFailed: z.boolean(), + }) + .partial(); +const AttemptNormalizationStatusReadList = z + .object({ + attemptNormalizationStatuses: z.array(AttemptNormalizationStatusRead), + }) + .partial(); +const HealthCheckRead = z.object({ available: z.boolean() }); +const LogType = z.enum(["server", "scheduler"]); +const LogsRequestBody = z.object({ logType: LogType }); +const WorkflowId = z.string(); +const SetWorkflowInAttemptRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + workflowId: WorkflowId, + processingTaskQueue: z.string().optional(), +}); +const InternalOperationResult = z.object({ succeeded: z.boolean() }); +const SaveStatsRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + stats: AttemptStats, + streamStats: z.array(AttemptStreamStats).optional(), +}); +const AttemptSyncConfig = z.object({ + sourceConfiguration: SourceConfiguration, + destinationConfiguration: DestinationConfiguration, + state: ConnectionState.optional(), +}); +const SaveAttemptSyncConfigRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + syncConfig: AttemptSyncConfig, +}); + +const endpoints = makeApi([ + { + method: "post", + path: "/v1/attempt/save_stats", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SaveStatsRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/attempt/save_sync_config", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SaveAttemptSyncConfigRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/attempt/set_workflow_in_attempt", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetWorkflowInAttemptRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/connections/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionCreate, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/list", + description: `List connections for workspace. Does not return deleted connections.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/list_all", + description: `List connections for workspace, including deleted connections.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/reset", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionSearch, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/sync", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/update", + description: `Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Note that if a catalog is present in the request body, the connection's entire catalog will be replaced +with the catalog from the request. This means that to modify a single stream, the entire new catalog +containing the updated stream needs to be sent. +`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionUpdate, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definition_specifications/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: DestinationDefinitionSpecificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/create_custom", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CustomDestinationDefinitionCreate, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdRequestBody, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/get_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/grant_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: PrivateDestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/list", + requestFormat: "json", + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_latest", + description: `Guaranteed to retrieve the latest information on supported destinations.`, + requestFormat: "json", + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_private", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: PrivateDestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/revoke_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionUpdate, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/complete_oauth", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CompleteDestinationOAuthRequest, + }, + ], + response: z.object({}).partial().passthrough(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/get_consent_url", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationOauthConsentRequest, + }, + ], + response: z.object({ consentUrl: z.string() }), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/oauth_params/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetInstancewideDestinationOauthParamsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 400, + schema: z.void(), + }, + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/check_connection_for_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationUpdate, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/clone", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCloneRequestBody, + }, + ], + response: DestinationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCreate, + }, + ], + response: DestinationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: DestinationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: DestinationReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationSearch, + }, + ], + response: DestinationReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationUpdate, + }, + ], + response: DestinationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "get", + path: "/v1/health", + requestFormat: "json", + response: z.object({ available: z.boolean() }), + }, + { + method: "post", + path: "/v1/jobs/cancel", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_debug_info", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobDebugInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_last_replication_job", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobOptionalRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_light", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoLightRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_normalization_status", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: AttemptNormalizationStatusReadList, + }, + { + method: "post", + path: "/v1/jobs/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobListRequestBody, + }, + ], + response: JobReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/logs/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: LogsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/notifications/try", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: Notification, + }, + ], + response: NotificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "get", + path: "/v1/openapi", + requestFormat: "json", + response: z.void(), + }, + { + method: "post", + path: "/v1/operations/check", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperatorConfiguration, + }, + ], + response: CheckOperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationCreate, + }, + ], + response: OperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationIdRequestBody, + }, + ], + response: OperationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/list", + description: `List operations for connection.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: OperationReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationUpdate, + }, + ], + response: OperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/destinations/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCoreConfig, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/sources/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCoreConfig, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/sources/discover_schema", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCoreConfig, + }, + ], + response: SourceDiscoverSchemaRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definition_specifications/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: SourceDefinitionSpecificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/create_custom", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CustomSourceDefinitionCreate, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdRequestBody, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/get_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/grant_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: PrivateSourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/list", + requestFormat: "json", + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_latest", + description: `Guaranteed to retrieve the latest information on supported sources.`, + requestFormat: "json", + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_private", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: PrivateSourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/revoke_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionUpdate, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/complete_oauth", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CompleteSourceOauthRequest, + }, + ], + response: z.object({}).partial().passthrough(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/get_consent_url", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceOauthConsentRequest, + }, + ], + response: z.object({ consentUrl: z.string() }), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/oauth_params/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetInstancewideSourceOauthParamsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 400, + schema: z.void(), + }, + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/check_connection_for_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceUpdate, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/clone", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCloneRequestBody, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCreate, + }, + ], + response: SourceRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/discover_schema", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDiscoverSchemaRequestBody, + }, + ], + response: SourceDiscoverSchemaRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/list", + description: `List sources for workspace. Does not return deleted sources.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: SourceReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/most_recent_source_actor_catalog", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: ActorCatalogWithUpdatedAt, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceSearch, + }, + ], + response: SourceReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceUpdate, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/write_discover_catalog_result", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDiscoverSchemaWriteRequestBody, + }, + ], + response: z.object({ catalogId: z.string().uuid() }), + }, + { + method: "post", + path: "/v1/state/create_or_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionStateCreateOrUpdate, + }, + ], + response: ConnectionState, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/state/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: ConnectionState, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/check_updates", + requestFormat: "json", + response: WebBackendCheckUpdatesRead, + }, + { + method: "post", + path: "/v1/web_backend/connections/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionCreate, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionRequestBody, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionListRequestBody, + }, + ], + response: WebBackendConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/update", + description: `Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Any operations that lack an ID will be created. Then, the newly created operationId will be applied to the +connection along with the rest of the operationIds in the request body. +Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Note that if a catalog is present in the request body, the connection's entire catalog will be replaced +with the catalog from the request. This means that to modify a single stream, the entire new catalog +containing the updated stream needs to be sent. +`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionUpdate, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/geographies/list", + description: `Returns all available geographies in which a data sync can run.`, + requestFormat: "json", + response: WebBackendGeographiesListResult, + }, + { + method: "post", + path: "/v1/web_backend/state/get_type", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: z.enum(["global", "stream", "legacy", "not_set"]), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/workspace/state", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendWorkspaceState, + }, + ], + response: WebBackendWorkspaceStateResult, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceCreate, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get_by_connection_id", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get_by_slug", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ slug: z.string() }), + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/list", + requestFormat: "json", + response: WorkspaceReadList, + }, + { + method: "post", + path: "/v1/workspaces/tag_feedback_status_as_done", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceGiveFeedback, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceUpdate, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/update_name", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceUpdateName, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, +]); + +export const api = new ZodiosCore(endpoints); +const result = api.post("/v1/connections/create", { + body: { + destinationId: "123", + sourceId: "123", + status: "active", + }, +}); diff --git a/packages/core/examples/aitbytes.ts b/packages/core/examples/aitbytes.ts new file mode 100644 index 00000000..83db1d60 --- /dev/null +++ b/packages/core/examples/aitbytes.ts @@ -0,0 +1,11 @@ +import { api } from "./airbytes-api"; + +api + .post("/v1/connections/list", { + body: { + workspaceId: "123", + }, + }) + .then((res) => { + console.log(res); + }); diff --git a/packages/core/examples/dev.to/api-key-plugin.ts b/packages/core/examples/dev.to/api-key-plugin.ts new file mode 100644 index 00000000..ba768056 --- /dev/null +++ b/packages/core/examples/dev.to/api-key-plugin.ts @@ -0,0 +1,19 @@ +import { ZodiosPlugin } from "../../src/index"; + +export interface ApiKeyPluginConfig { + getApiKey: () => Promise; +} + +export function pluginApiKey(provider: ApiKeyPluginConfig): ZodiosPlugin { + return { + request: async (_, config) => { + return { + ...config, + headers: { + ...config.headers, + "api-key": await provider.getApiKey(), + }, + }; + }, + }; +} diff --git a/packages/core/examples/dev.to/articles.ts b/packages/core/examples/dev.to/articles.ts new file mode 100644 index 00000000..96714c78 --- /dev/null +++ b/packages/core/examples/dev.to/articles.ts @@ -0,0 +1,167 @@ +import { apiBuilder, makeApi } from "../../src/index"; +import { z } from "zod"; +import { devUser } from "./users"; +import { paramPages } from "./params"; + +const devArticle = z.object({ + id: z.number(), + type_of: z.string(), + title: z.string(), + description: z.string(), + cover_image: z.string().or(z.null()), + readable_publish_date: z.string().optional(), + social_image: z.string().optional(), + tag_list: z.array(z.string()).or(z.string()), + tags: z.array(z.string()).or(z.string()).optional(), + slug: z.string(), + path: z.string(), + url: z.string(), + canonical_url: z.string(), + comments_count: z.number(), + positive_reactions_count: z.number(), + public_reactions_count: z.number(), + collection_id: z.number().or(z.null()).optional(), + created_at: z.string().optional(), + edited_at: z.string().optional(), + crossposted_at: z.string().or(z.null()).optional(), + published_at: z.string().or(z.null()).optional(), + last_comment_at: z.string().optional(), + published_timestamp: z.string(), + reading_time_minutes: z.number(), + user: devUser.partial(), + read_time_minutes: z.number().optional(), + organization: z + .object({ + name: z.string(), + username: z.string(), + slug: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), + }) + .optional(), + flare_tag: z + .object({ + name: z.string(), + bg_color_hex: z.string(), + text_color_hex: z.string(), + }) + .optional(), +}); + +const devArticles = z.array(devArticle); + +export type Article = z.infer; +export type Articles = z.infer; + +export const articlesApi = apiBuilder({ + method: "get", + path: "/articles", + alias: "getAllArticles", + description: "Get all articles", + parameters: [ + ...paramPages, + { + name: "tag", + description: "Filter by tag", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags", + description: "Filter by tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags_exclude", + description: "Exclude tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "username", + description: "Filter by username", + type: "Query", + schema: z.string().optional(), + }, + { + name: "state", + description: "Filter by state", + type: "Query", + schema: z.string().optional(), + }, + { + name: "top", + type: "Query", + schema: z.number().optional(), + }, + { + name: "collection_id", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devArticles, +}) + .addEndpoint({ + method: "get", + path: "/articles/latest", + alias: "getLatestArticle", + description: "Get latest articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/:id", + alias: "getArticle", + description: "Get an article by id", + response: devArticle, + }) + .addEndpoint({ + method: "put", + path: "/articles/:id", + alias: "updateArticle", + description: "Update an article", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/:username/:slug", + alias: "getArticleByUsernameAndSlug", + description: "Get an article by username and slug", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/me", + alias: "getMyArticles", + description: "Get current user's articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/published", + alias: "getMyPublishedArticles", + description: "Get current user's published articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/unpublished", + alias: "getMyUnpublishedArticles", + description: "Get current user's unpublished articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/all", + alias: "getAllMyArticles", + description: "Get current user's all articles", + parameters: paramPages, + response: devArticles, + }) + .build(); diff --git a/packages/core/examples/dev.to/comments.ts b/packages/core/examples/dev.to/comments.ts new file mode 100644 index 00000000..7f749319 --- /dev/null +++ b/packages/core/examples/dev.to/comments.ts @@ -0,0 +1,61 @@ +import { makeApi, makeEndpoint } from "../../src/index"; +import { z } from "zod"; +import { devUser, User } from "./users"; + +/** + * zod does not handle recusive well, so we need to manually define the schema + */ +export type Comment = { + type_of: string; + id_code: string; + created_at: string; + body_html: string; + user: User; + children: Comment[]; +}; + +export const devComment: z.ZodSchema = z.lazy(() => + z.object({ + type_of: z.string(), + id_code: z.string(), + created_at: z.string(), + body_html: z.string(), + user: devUser, + children: z.array(devComment), + }) +); +export const devComments = z.array(devComment); + +export type Comments = z.infer; + +const getAllComments = makeEndpoint({ + method: "get", + path: "/comments", + alias: "getAllComments", + description: "Get all comments", + parameters: [ + { + name: "a_id", + description: "Article ID", + type: "Query", + schema: z.number().optional(), + }, + { + name: "p_id", + description: "Podcast comment ID", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devComments, +}); + +const getComment = makeEndpoint({ + method: "get", + path: "/comments/:id", + alias: "getComment", + description: "Get a comment", + response: devComment, +}); + +export const commentsApi = makeApi([getAllComments, getComment]); diff --git a/packages/core/examples/dev.to/example.ts b/packages/core/examples/dev.to/example.ts new file mode 100644 index 00000000..79c65ef9 --- /dev/null +++ b/packages/core/examples/dev.to/example.ts @@ -0,0 +1,27 @@ +import { ZodiosCore } from "../../src"; +import { articlesApi } from "./articles"; +import { commentsApi } from "./comments"; +import { followsApi } from "./follows"; +import { followersApi } from "./followers"; +import { userApi } from "./users"; +import { pluginApiKey } from "./api-key-plugin"; + +export const devTo = new ZodiosCore("https://dev.to/api", [ + ...articlesApi, + ...commentsApi, + ...followsApi, + ...followersApi, + ...userApi, +]); + +devTo.use( + pluginApiKey({ + getApiKey: async () => "", + }) +); + +const result = devTo.get("/comments/:id", { + params: { + id: "7", + }, +}); diff --git a/packages/core/examples/dev.to/followers.ts b/packages/core/examples/dev.to/followers.ts new file mode 100644 index 00000000..db9e7d5b --- /dev/null +++ b/packages/core/examples/dev.to/followers.ts @@ -0,0 +1,33 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; +import { paramPages } from "./params"; + +const devFollower = z.object({ + type_of: z.string(), + created_at: z.string(), + id: z.number(), + name: z.string(), + path: z.string(), + username: z.string(), + profile_image: z.string(), +}); + +const devFollowers = z.array(devFollower); + +export const followersApi = makeApi([ + { + method: "get", + path: "/followers/users", + alias: "getAllFollowers", + parameters: [ + ...paramPages, + { + name: "sort", + description: "Sort by. defaults to created_at", + type: "Query", + schema: z.string().optional(), + }, + ], + response: devFollowers, + }, +]); diff --git a/packages/core/examples/dev.to/follows.ts b/packages/core/examples/dev.to/follows.ts new file mode 100644 index 00000000..3aa7cae6 --- /dev/null +++ b/packages/core/examples/dev.to/follows.ts @@ -0,0 +1,23 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devFollow = z.object({ + id: z.number(), + name: z.string(), + points: z.number(), +}); + +export const devFollows = z.array(devFollow); + +export type Follow = z.infer; +export type Follows = z.infer; + +export const followsApi = makeApi([ + { + method: "get", + path: "/follows/tags", + alias: "getAllFollowedTags", + description: "Get all followed tags", + response: devFollows, + }, +]); diff --git a/packages/core/examples/dev.to/params.ts b/packages/core/examples/dev.to/params.ts new file mode 100644 index 00000000..c07e5a80 --- /dev/null +++ b/packages/core/examples/dev.to/params.ts @@ -0,0 +1,16 @@ +import { z } from "zod"; +import { makeParameters } from "../../src/api"; + +export const paramPages = makeParameters([ + { + name: "page", + type: "Query", + description: "Page number", + schema: z.number().optional(), + }, + { + name: "per_page", + type: "Query", + schema: z.number().optional(), + }, +]); diff --git a/packages/core/examples/dev.to/users.ts b/packages/core/examples/dev.to/users.ts new file mode 100644 index 00000000..1c74bc1b --- /dev/null +++ b/packages/core/examples/dev.to/users.ts @@ -0,0 +1,64 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devUser = z.object({ + id: z.number(), + type_of: z.string(), + name: z.string(), + username: z.string(), + summary: z.string().or(z.null()), + twitter_username: z.string().or(z.null()), + github_username: z.string().or(z.null()), + website_url: z.string().or(z.null()), + location: z.string().or(z.null()), + joined_at: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type User = z.infer; + +export const devProfileImage = z.object({ + type_of: z.string(), + image_of: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type ProfileImage = z.infer; + +export const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: devUser, + errors: [ + { + status: "default", + description: "Default error", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "get", + path: "/users/me", + alias: "getMe", + description: "Get current user", + response: devUser, + }, + { + method: "get", + path: "/profile_image/:username", + alias: "getProfileImage", + description: "Get a user's profile image", + response: devProfileImage, + }, +]); diff --git a/packages/core/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts new file mode 100644 index 00000000..41bf3ad8 --- /dev/null +++ b/packages/core/examples/io-ts-types.ts @@ -0,0 +1,80 @@ +import { + ZodiosCore, + makeApi, + ApiOf, + TypeProviderOf, + ioTsTypeProvider, +} from "../src/index"; +import * as t from "io-ts"; +import { FetcherProviderOf } from "../src/zodios"; +import { mockFetchFactory } from "../src/fetcher-providers/mock-provider"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + fetcherFactory: mockFetchFactory, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/core/examples/jsonplaceholder.ts b/packages/core/examples/jsonplaceholder.ts new file mode 100644 index 00000000..401cf085 --- /dev/null +++ b/packages/core/examples/jsonplaceholder.ts @@ -0,0 +1,94 @@ +import { + ApiOf, + ZodiosResponseByAlias, + ZodiosHeaderParamsByAlias, + ZodiosCore, +} from "../src/index"; +import { z } from "zod"; + +async function bootstrap() { + const apiClient = new ZodiosCore("https://jsonplaceholder.typicode.com", [ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: z.array(z.object({ id: z.number(), name: z.string() })), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.object({}), + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string() }), + }, + { + name: "Content-Type", + type: "Header", + schema: z.string(), + }, + ], + response: z.object({ id: z.number(), name: z.string() }), + }, + ]); + + type UserResponseAlias = ZodiosResponseByAlias< + ApiOf, + "getUsers" + >; + + type Test = ZodiosHeaderParamsByAlias, "createUser">; + + const users: UserResponseAlias = await apiClient.getUsers({ + queries: { q: "Nicholas" }, + }); + console.log(users); + const user = await apiClient.getUser({ params: { id: 7 } }); + console.log(user); + const createdUser = await apiClient.createUser({ + body: { name: "john doe" }, + headers: { + "Content-Type": "application/json", + }, + }); + console.log(createdUser); + const deletedUser = await apiClient.deleteUser({ + params: { id: 7 }, + }); + console.log(deletedUser); +} + +bootstrap(); diff --git a/packages/core/examples/large-api.ts b/packages/core/examples/large-api.ts new file mode 100644 index 00000000..3375ac6b --- /dev/null +++ b/packages/core/examples/large-api.ts @@ -0,0 +1,4914 @@ +import { makeApi, ZodiosCore, type ZodiosOptions } from "../src"; +import { z } from "zod"; + +const CategoryEnum = z.enum([ + "hris", + "ats", + "accounting", + "ticketing", + "crm", + "mktg", + "filestorage", +]); +const AccountDetails = z + .object({ + id: z.string().uuid(), + integration: z.string(), + integration_slug: z.string(), + category: CategoryEnum.nullable(), + end_user_origin_id: z.string(), + end_user_organization_name: z.string(), + end_user_email_address: z.string().email(), + status: z.string(), + webhook_listener_url: z.string().url(), + is_duplicate: z.boolean().nullable(), + }) + .partial(); +const CategoriesEnum = z.enum([ + "hris", + "ats", + "accounting", + "ticketing", + "crm", + "mktg", + "filestorage", +]); +const AccountIntegration = z.object({ + name: z.string(), + categories: z.array(CategoriesEnum).optional(), + image: z.string().url().nullish(), + square_image: z.string().url().nullish(), + color: z + .string() + .max(18) + .regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/) + .optional(), + slug: z.string().optional(), +}); +const AccountToken = z.object({ + account_token: z.string(), + integration: AccountIntegration, +}); +const ClassificationEnum = z.enum([ + "ASSET", + "EQUITY", + "EXPENSE", + "LIABILITY", + "REVENUE", +]); +const AccountStatusEnum = z.enum(["ACTIVE", "PENDING", "INACTIVE"]); +const CurrencyEnum = z.enum([ + "XUA", + "AFN", + "AFA", + "ALL", + "ALK", + "DZD", + "ADP", + "AOA", + "AOK", + "AON", + "AOR", + "ARA", + "ARS", + "ARM", + "ARP", + "ARL", + "AMD", + "AWG", + "AUD", + "ATS", + "AZN", + "AZM", + "BSD", + "BHD", + "BDT", + "BBD", + "BYN", + "BYB", + "BYR", + "BEF", + "BEC", + "BEL", + "BZD", + "BMD", + "BTN", + "BOB", + "BOL", + "BOV", + "BOP", + "BAM", + "BAD", + "BAN", + "BWP", + "BRC", + "BRZ", + "BRE", + "BRR", + "BRN", + "BRB", + "BRL", + "GBP", + "BND", + "BGL", + "BGN", + "BGO", + "BGM", + "BUK", + "BIF", + "XPF", + "KHR", + "CAD", + "CVE", + "KYD", + "XAF", + "CLE", + "CLP", + "CLF", + "CNX", + "CNY", + "CNH", + "COP", + "COU", + "KMF", + "CDF", + "CRC", + "HRD", + "HRK", + "CUC", + "CUP", + "CYP", + "CZK", + "CSK", + "DKK", + "DJF", + "DOP", + "NLG", + "XCD", + "DDM", + "ECS", + "ECV", + "EGP", + "GQE", + "ERN", + "EEK", + "ETB", + "EUR", + "XBA", + "XEU", + "XBB", + "XBC", + "XBD", + "FKP", + "FJD", + "FIM", + "FRF", + "XFO", + "XFU", + "GMD", + "GEK", + "GEL", + "DEM", + "GHS", + "GHC", + "GIP", + "XAU", + "GRD", + "GTQ", + "GWP", + "GNF", + "GNS", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "IMP", + "ISK", + "ISJ", + "INR", + "IDR", + "IRR", + "IQD", + "IEP", + "ILS", + "ILP", + "ILR", + "ITL", + "JMD", + "JPY", + "JOD", + "KZT", + "KES", + "KWD", + "KGS", + "LAK", + "LVL", + "LVR", + "LBP", + "LSL", + "LRD", + "LYD", + "LTL", + "LTT", + "LUL", + "LUC", + "LUF", + "MOP", + "MKD", + "MKN", + "MGA", + "MGF", + "MWK", + "MYR", + "MVR", + "MVP", + "MLF", + "MTL", + "MTP", + "MRU", + "MRO", + "MUR", + "MXV", + "MXN", + "MXP", + "MDC", + "MDL", + "MCF", + "MNT", + "MAD", + "MAF", + "MZE", + "MZN", + "MZM", + "MMK", + "NAD", + "NPR", + "ANG", + "TWD", + "NZD", + "NIO", + "NIC", + "NGN", + "KPW", + "NOK", + "OMR", + "PKR", + "XPD", + "PAB", + "PGK", + "PYG", + "PEI", + "PEN", + "PES", + "PHP", + "XPT", + "PLN", + "PLZ", + "PTE", + "GWE", + "QAR", + "XRE", + "RHD", + "RON", + "ROL", + "RUB", + "RUR", + "RWF", + "SVC", + "WST", + "SAR", + "RSD", + "CSD", + "SCR", + "SLL", + "XAG", + "SGD", + "SKK", + "SIT", + "SBD", + "SOS", + "ZAR", + "ZAL", + "KRH", + "KRW", + "KRO", + "SSP", + "SUR", + "ESP", + "ESA", + "ESB", + "XDR", + "LKR", + "SHP", + "XSU", + "SDD", + "SDG", + "SDP", + "SRD", + "SRG", + "SZL", + "SEK", + "CHF", + "SYP", + "STN", + "STD", + "TVD", + "TJR", + "TJS", + "TZS", + "XTS", + "THB", + "XXX", + "TPE", + "TOP", + "TTD", + "TND", + "TRY", + "TRL", + "TMT", + "TMM", + "USD", + "USN", + "USS", + "UGX", + "UGS", + "UAH", + "UAK", + "AED", + "UYW", + "UYU", + "UYP", + "UYI", + "UZS", + "VUV", + "VES", + "VEB", + "VEF", + "VND", + "VNN", + "CHE", + "CHW", + "XOF", + "YDD", + "YER", + "YUN", + "YUD", + "YUM", + "YUR", + "ZWN", + "ZRN", + "ZRZ", + "ZMW", + "ZMK", + "ZWD", + "ZWR", + "ZWL", +]); +const RemoteData = z.object({ + path: z.string(), + data: z.object({}).partial().passthrough().optional(), +}); +const Account = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + description: z.string().nullable(), + classification: ClassificationEnum.nullable(), + type: z.string().nullable(), + status: AccountStatusEnum.nullable(), + current_balance: z.number().nullable(), + currency: CurrencyEnum.nullable(), + account_number: z.string().nullable(), + parent_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedAccountList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Account), + }) + .partial(); +const AccountRequest = z + .object({ + name: z.string().nullable(), + description: z.string().nullable(), + classification: ClassificationEnum.nullable(), + type: z.string().nullable(), + status: AccountStatusEnum.nullable(), + current_balance: z.number().nullable(), + currency: CurrencyEnum.nullable(), + account_number: z.string().nullable(), + parent_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const AccountEndpointRequest = z.object({ model: AccountRequest }); +const ValidationProblemSource = z.object({ pointer: z.string() }); +const WarningValidationProblem = z.object({ + source: ValidationProblemSource.optional(), + title: z.string(), + detail: z.string(), + problem_type: z.string(), +}); +const ErrorValidationProblem = z.object({ + source: ValidationProblemSource.optional(), + title: z.string(), + detail: z.string(), + problem_type: z.string(), +}); +const DebugModelLogSummary = z.object({ + url: z.string(), + method: z.string(), + status_code: z.number().int(), +}); +const DebugModeLog = z.object({ + log_id: z.string(), + dashboard_view: z.string(), + log_summary: DebugModelLogSummary, +}); +const AccountResponse = z.object({ + model: Account, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const LinkedAccountStatus = z.object({ + linked_account_status: z.string(), + can_make_request: z.boolean(), +}); +const MetaResponse = z.object({ + request_schema: z.object({}).partial().passthrough(), + remote_field_classes: z.object({}).partial().passthrough().optional(), + status: LinkedAccountStatus.optional(), + has_conditional_params: z.boolean(), + has_required_linked_account_params: z.boolean(), +}); +const AddressTypeEnum = z.enum(["BILLING", "SHIPPING"]); +const CountryEnum = z.enum([ + "AF", + "AX", + "AL", + "DZ", + "AS", + "AD", + "AO", + "AI", + "AQ", + "AG", + "AR", + "AM", + "AW", + "AU", + "AT", + "AZ", + "BS", + "BH", + "BD", + "BB", + "BY", + "BE", + "BZ", + "BJ", + "BM", + "BT", + "BO", + "BQ", + "BA", + "BW", + "BV", + "BR", + "IO", + "BN", + "BG", + "BF", + "BI", + "CV", + "KH", + "CM", + "CA", + "KY", + "CF", + "TD", + "CL", + "CN", + "CX", + "CC", + "CO", + "KM", + "CG", + "CD", + "CK", + "CR", + "CI", + "HR", + "CU", + "CW", + "CY", + "CZ", + "DK", + "DJ", + "DM", + "DO", + "EC", + "EG", + "SV", + "GQ", + "ER", + "EE", + "SZ", + "ET", + "FK", + "FO", + "FJ", + "FI", + "FR", + "GF", + "PF", + "TF", + "GA", + "GM", + "GE", + "DE", + "GH", + "GI", + "GR", + "GL", + "GD", + "GP", + "GU", + "GT", + "GG", + "GN", + "GW", + "GY", + "HT", + "HM", + "VA", + "HN", + "HK", + "HU", + "IS", + "IN", + "ID", + "IR", + "IQ", + "IE", + "IM", + "IL", + "IT", + "JM", + "JP", + "JE", + "JO", + "KZ", + "KE", + "KI", + "KW", + "KG", + "LA", + "LV", + "LB", + "LS", + "LR", + "LY", + "LI", + "LT", + "LU", + "MO", + "MG", + "MW", + "MY", + "MV", + "ML", + "MT", + "MH", + "MQ", + "MR", + "MU", + "YT", + "MX", + "FM", + "MD", + "MC", + "MN", + "ME", + "MS", + "MA", + "MZ", + "MM", + "NA", + "NR", + "NP", + "NL", + "NC", + "NZ", + "NI", + "NE", + "NG", + "NU", + "NF", + "KP", + "MK", + "MP", + "NO", + "OM", + "PK", + "PW", + "PS", + "PA", + "PG", + "PY", + "PE", + "PH", + "PN", + "PL", + "PT", + "PR", + "QA", + "RE", + "RO", + "RU", + "RW", + "BL", + "SH", + "KN", + "LC", + "MF", + "PM", + "VC", + "WS", + "SM", + "ST", + "SA", + "SN", + "RS", + "SC", + "SL", + "SG", + "SX", + "SK", + "SI", + "SB", + "SO", + "ZA", + "GS", + "KR", + "SS", + "ES", + "LK", + "SD", + "SR", + "SJ", + "SE", + "CH", + "SY", + "TW", + "TJ", + "TZ", + "TH", + "TL", + "TG", + "TK", + "TO", + "TT", + "TN", + "TR", + "TM", + "TC", + "TV", + "UG", + "UA", + "AE", + "GB", + "UM", + "US", + "UY", + "UZ", + "VU", + "VE", + "VN", + "VG", + "VI", + "WF", + "EH", + "YE", + "ZM", + "ZW", +]); +const Address = z + .object({ + type: AddressTypeEnum.nullable(), + street_1: z.string().nullable(), + street_2: z.string().nullable(), + city: z.string().nullable(), + state: z.unknown().nullable(), + country_subdivision: z.string().nullable(), + country: CountryEnum.nullable(), + zip_code: z.string().nullable(), + }) + .partial(); +const AccountingAttachment = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + file_name: z.string().nullable(), + file_url: z.string().max(2000).url().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedAccountingAttachmentList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(AccountingAttachment), + }) + .partial(); +const AccountingAttachmentRequest = z + .object({ + file_name: z.string().nullable(), + file_url: z.string().max(2000).url().nullable(), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const AccountingAttachmentEndpointRequest = z.object({ + model: AccountingAttachmentRequest, +}); +const AccountingAttachmentResponse = z.object({ + model: AccountingAttachment, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const ModelOperation = z.object({ + model_name: z.string(), + available_operations: z.array(z.string()), + required_post_parameters: z.array(z.string()), + supported_fields: z.array(z.string()), +}); +const AvailableActions = z.object({ + integration: AccountIntegration, + passthrough_available: z.boolean(), + available_model_operations: z.array(ModelOperation).optional(), +}); +const ReportItem = z + .object({ + remote_id: z.string().nullable(), + name: z.string().nullable(), + value: z.number().nullable(), + sub_items: z.object({}).partial().passthrough(), + company: z.string().uuid().nullable(), + }) + .partial(); +const BalanceSheet = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + date: z.string().datetime().nullable(), + net_assets: z.number().nullable(), + assets: z.array(ReportItem), + liabilities: z.array(ReportItem), + equity: z.array(ReportItem), + remote_generated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedBalanceSheetList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(BalanceSheet), + }) + .partial(); +const CashFlowStatement = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + start_period: z.string().datetime().nullable(), + end_period: z.string().datetime().nullable(), + cash_at_beginning_of_period: z.number().nullable(), + cash_at_end_of_period: z.number().nullable(), + operating_activities: z.array(ReportItem), + investing_activities: z.array(ReportItem), + financing_activities: z.array(ReportItem), + remote_generated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCashFlowStatementList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CashFlowStatement), + }) + .partial(); +const CommonModelScopesDisabledModelsEnabledActionsEnum = z.enum([ + "ENABLED_ACTION_READ", + "ENABLED_ACTION_WRITE", +]); +const CommonModelScopesDisabledModels = z.object({ + model_name: z.string(), + model_id: z.string(), + enabled_actions: z.array(CommonModelScopesDisabledModelsEnabledActionsEnum), + is_disabled: z.boolean(), + disabled_fields: z.array(z.string()), +}); +const CommonModelScopeData = z.object({ + common_models: z.array(CommonModelScopesDisabledModels), + linked_account_id: z.string().uuid().optional(), +}); +const CommonModelScopes = z.object({ + organization_level_scopes: CommonModelScopeData.optional(), + scope_overrides: z.array(CommonModelScopeData), +}); +const EnabledActionsEnum = z.enum(["READ", "WRITE"]); +const CommonModelScopesPostInnerDeserializerRequest = z.object({ + model_id: z.string().min(1), + enabled_actions: z.array(EnabledActionsEnum), + disabled_fields: z.array(z.string()), +}); +const CommonModelScopesUpdateSerializer = z.object({ + common_models: z.array(CommonModelScopesPostInnerDeserializerRequest), +}); +const AccountingPhoneNumber = z + .object({ number: z.string().nullable(), type: z.string().nullable() }) + .partial(); +const CompanyInfo = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + legal_name: z.string().nullable(), + tax_number: z.string().nullable(), + fiscal_year_end_month: z.number().int().gte(1).lte(12).nullable(), + fiscal_year_end_day: z.number().int().gte(1).lte(31).nullable(), + currency: CurrencyEnum.nullable(), + remote_created_at: z.string().datetime().nullable(), + urls: z.array(z.string()).nullable(), + addresses: z.array(Address), + phone_numbers: z.array(AccountingPhoneNumber), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCompanyInfoList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CompanyInfo), + }) + .partial(); +const Status7d1Enum = z.enum(["ACTIVE", "ARCHIVED"]); +const Contact = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + is_supplier: z.boolean().nullable(), + is_customer: z.boolean().nullable(), + email_address: z.string().nullable(), + tax_number: z.string().nullable(), + status: Status7d1Enum.nullable(), + currency: z.string().nullable(), + remote_updated_at: z.string().datetime().nullable(), + company: z.string().uuid().nullable(), + addresses: z.array(z.string()), + phone_numbers: z.array(AccountingPhoneNumber), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedContactList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Contact), + }) + .partial(); +const AccountingPhoneNumberRequest = z + .object({ + number: z.string().nullable(), + type: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ContactRequest = z + .object({ + name: z.string().nullable(), + is_supplier: z.boolean().nullable(), + is_customer: z.boolean().nullable(), + email_address: z.string().nullable(), + tax_number: z.string().nullable(), + status: Status7d1Enum.nullable(), + currency: z.string().nullable(), + company: z.string().uuid().nullable(), + addresses: z.array(z.string()), + phone_numbers: z.array(AccountingPhoneNumberRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ContactEndpointRequest = z.object({ model: ContactRequest }); +const ContactResponse = z.object({ + model: Contact, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const CreditNoteStatusEnum = z.enum(["SUBMITTED", "AUTHORIZED", "PAID"]); +const CreditNoteLineItem = z.object({ + item: z.string().uuid().nullish(), + name: z.string().nullish(), + description: z.string().nullish(), + quantity: z + .string() + .regex(/^-?\d{0,24}(?:\.\d{0,8})?$/) + .nullish(), + memo: z.string().nullish(), + unit_price: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tax_rate: z.string().uuid().nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + account: z.string().uuid().nullish(), + company: z.string().uuid().nullish(), + remote_id: z.string().nullish(), +}); +const CreditNote = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + status: CreditNoteStatusEnum.nullable(), + number: z.string().nullable(), + contact: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + remaining_credit: z.number().nullable(), + line_items: z.array(CreditNoteLineItem), + currency: CurrencyEnum.nullable(), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCreditNoteList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CreditNote), + }) + .partial(); +const ExpenseLine = z + .object({ + remote_id: z.string().nullable(), + item: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + }) + .partial(); +const Expense = z + .object({ + transaction_date: z.string().datetime().nullable(), + remote_created_at: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + memo: z.string().nullable(), + lines: z.array(ExpenseLine), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedExpenseList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Expense), + }) + .partial(); +const ExpenseLineRequest = z + .object({ + remote_id: z.string().nullable(), + item: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ExpenseRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + memo: z.string().nullable(), + lines: z.array(ExpenseLineRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ExpenseEndpointRequest = z.object({ model: ExpenseRequest }); +const ExpenseResponse = z.object({ + model: Expense, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const GenerateRemoteKeyRequest = z.object({ name: z.string().min(1) }); +const RemoteKey = z.object({ name: z.string(), key: z.string() }); +const IncomeStatement = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + start_period: z.string().datetime().nullable(), + end_period: z.string().datetime().nullable(), + income: z.array(ReportItem), + cost_of_sales: z.array(ReportItem), + gross_profit: z.number().nullable(), + operating_expenses: z.array(ReportItem), + net_operating_income: z.number().nullable(), + non_operating_expenses: z.array(ReportItem), + net_income: z.number().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedIncomeStatementList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(IncomeStatement), + }) + .partial(); +const InvoiceTypeEnum = z.enum(["ACCOUNTS_RECEIVABLE", "ACCOUNTS_PAYABLE"]); +const InvoiceLineItem = z + .object({ + remote_id: z.string().nullable(), + description: z.string().nullable(), + unit_price: z.number().nullable(), + quantity: z.number().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + item: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + id: z.string().uuid(), + field_mappings: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const Invoice = z + .object({ + type: InvoiceTypeEnum.nullable(), + contact: z.string().uuid().nullable(), + number: z.string().nullable(), + issue_date: z.string().datetime().nullable(), + due_date: z.string().datetime().nullable(), + paid_on_date: z.string().datetime().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + total_discount: z.number().nullable(), + sub_total: z.number().nullable(), + total_tax_amount: z.number().nullable(), + total_amount: z.number().nullable(), + balance: z.number().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + line_items: z.array(InvoiceLineItem), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedInvoiceList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Invoice), + }) + .partial(); +const InvoiceLineItemRequest = z + .object({ + remote_id: z.string().nullable(), + description: z.string().nullable(), + unit_price: z.number().nullable(), + quantity: z.number().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + item: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const InvoiceRequest = z + .object({ + type: InvoiceTypeEnum.nullable(), + contact: z.string().uuid().nullable(), + number: z.string().nullable(), + issue_date: z.string().datetime().nullable(), + due_date: z.string().datetime().nullable(), + paid_on_date: z.string().datetime().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + total_discount: z.number().nullable(), + sub_total: z.number().nullable(), + total_tax_amount: z.number().nullable(), + total_amount: z.number().nullable(), + balance: z.number().nullable(), + payments: z.array(z.string()), + line_items: z.array(InvoiceLineItemRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const InvoiceEndpointRequest = z.object({ model: InvoiceRequest }); +const InvoiceResponse = z.object({ + model: Invoice, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const IssueStatusEnum = z.enum(["ONGOING", "RESOLVED"]); +const Issue = z.object({ + id: z.string().uuid().optional(), + status: IssueStatusEnum.optional(), + error_description: z.string(), + end_user: z.object({}).partial().passthrough().optional(), + first_incident_time: z.string().datetime().nullish(), + last_incident_time: z.string().datetime().nullish(), + is_muted: z.boolean().optional(), + error_details: z.array(z.string()).optional(), +}); +const PaginatedIssueList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Issue), + }) + .partial(); +const Item = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + status: Status7d1Enum.nullable(), + unit_price: z.number().nullable(), + purchase_price: z.number().nullable(), + purchase_account: z.string().uuid().nullable(), + sales_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedItemList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Item), + }) + .partial(); +const JournalLine = z + .object({ + remote_id: z.string().nullable(), + account: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + }) + .partial(); +const PostingStatusEnum = z.enum(["UNPOSTED", "POSTED"]); +const JournalEntry = z + .object({ + transaction_date: z.string().datetime().nullable(), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + memo: z.string().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(JournalLine), + remote_was_deleted: z.boolean(), + posting_status: PostingStatusEnum.nullable(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedJournalEntryList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(JournalEntry), + }) + .partial(); +const JournalLineRequest = z + .object({ + remote_id: z.string().nullable(), + account: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const JournalEntryRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + payments: z.array(z.string()), + memo: z.string().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(JournalLineRequest), + posting_status: PostingStatusEnum.nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const JournalEntryEndpointRequest = z.object({ model: JournalEntryRequest }); +const JournalEntryResponse = z.object({ + model: JournalEntry, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const CommonModelScopesBodyRequest = z.object({ + model_id: z.string().min(1), + enabled_actions: z.array(EnabledActionsEnum), + disabled_fields: z.array(z.string()), +}); +const EndUserDetailsRequest = z.object({ + end_user_email_address: z.string().min(1).max(100), + end_user_organization_name: z.string().min(1).max(100), + end_user_origin_id: z.string().min(1).max(100), + categories: z.array(CategoriesEnum), + integration: z.string().min(1).nullish(), + link_expiry_mins: z.number().int().gte(30).lte(10080).optional().default(30), + should_create_magic_link_url: z.boolean().nullish(), + common_models: z.array(CommonModelScopesBodyRequest).nullish(), +}); +const LinkToken = z.object({ + link_token: z.string(), + integration_name: z.string().optional(), + magic_link_url: z.string().optional(), +}); +const AccountDetailsAndActionsStatusEnum = z.enum([ + "COMPLETE", + "INCOMPLETE", + "RELINK_NEEDED", +]); +const AccountDetailsAndActionsIntegration = z.object({ + name: z.string(), + categories: z.array(CategoriesEnum), + image: z.string().optional(), + square_image: z.string().optional(), + color: z.string(), + slug: z.string(), + passthrough_available: z.boolean(), + available_model_operations: z.array(ModelOperation).optional(), +}); +const AccountDetailsAndActions = z.object({ + id: z.string(), + category: CategoryEnum.optional(), + status: AccountDetailsAndActionsStatusEnum, + status_detail: z.string().optional(), + end_user_origin_id: z.string().optional(), + end_user_organization_name: z.string(), + end_user_email_address: z.string(), + webhook_listener_url: z.string(), + is_duplicate: z.boolean().nullish(), + integration: AccountDetailsAndActionsIntegration.optional(), +}); +const PaginatedAccountDetailsAndActionsList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(AccountDetailsAndActions), + }) + .partial(); +const MethodEnum = z.enum([ + "GET", + "OPTIONS", + "HEAD", + "POST", + "PUT", + "PATCH", + "DELETE", +]); +const EncodingEnum = z.enum(["RAW", "BASE64", "GZIP_BASE64"]); +const MultipartFormFieldRequest = z.object({ + name: z.string().min(1), + data: z.string().min(1), + encoding: EncodingEnum.nullish().default("RAW"), + file_name: z.string().min(1).nullish(), + content_type: z.string().min(1).nullish(), +}); +const RequestFormatEnum = z.enum(["JSON", "XML", "MULTIPART"]); +const DataPassthroughRequest = z.object({ + method: MethodEnum, + path: z.string().min(1), + base_url_override: z.string().min(1).nullish(), + data: z.string().min(1).nullish(), + multipart_form_data: z.array(MultipartFormFieldRequest).nullish(), + headers: z.object({}).partial().passthrough().nullish(), + request_format: RequestFormatEnum.nullish(), + normalize_response: z.boolean().optional(), +}); +const ResponseTypeEnum = z.enum(["JSON", "BASE64_GZIP"]); +const RemoteResponse = z.object({ + method: z.string(), + path: z.string(), + status: z.number().int(), + response: z.unknown(), + response_headers: z.object({}).partial().passthrough().optional(), + response_type: ResponseTypeEnum.optional(), + headers: z.object({}).partial().passthrough().optional(), +}); +const Payment = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + contact: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedPaymentList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Payment), + }) + .partial(); +const PaymentRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + contact: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const PaymentEndpointRequest = z.object({ model: PaymentRequest }); +const PaymentResponse = z.object({ + model: Payment, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const PurchaseOrderStatusEnum = z.enum([ + "DRAFT", + "SUBMITTED", + "AUTHORIZED", + "BILLED", + "DELETED", +]); +const PurchaseOrderLineItem = z.object({ + remote_id: z.string().nullish(), + description: z.string().nullish(), + unit_price: z.number().nullish(), + quantity: z.number().nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + tax_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), +}); +const PurchaseOrder = z + .object({ + status: PurchaseOrderStatusEnum.nullable(), + issue_date: z.string().datetime().nullable(), + delivery_date: z.string().datetime().nullable(), + delivery_address: z.string().uuid().nullable(), + customer: z.string().uuid().nullable(), + vendor: z.string().uuid().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + line_items: z.array(PurchaseOrderLineItem), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedPurchaseOrderList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(PurchaseOrder), + }) + .partial(); +const PurchaseOrderLineItemRequest = z.object({ + remote_id: z.string().nullish(), + description: z.string().nullish(), + unit_price: z.number().nullish(), + quantity: z.number().nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + tax_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), + integration_params: z.object({}).partial().passthrough().nullish(), + linked_account_params: z.object({}).partial().passthrough().nullish(), +}); +const PurchaseOrderRequest = z + .object({ + status: PurchaseOrderStatusEnum.nullable(), + issue_date: z.string().datetime().nullable(), + delivery_date: z.string().datetime().nullable(), + delivery_address: z.string().uuid().nullable(), + customer: z.string().uuid().nullable(), + vendor: z.string().uuid().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + line_items: z.array(PurchaseOrderLineItemRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const PurchaseOrderEndpointRequest = z.object({ model: PurchaseOrderRequest }); +const PurchaseOrderResponse = z.object({ + model: PurchaseOrder, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const RemoteKeyForRegenerationRequest = z.object({ name: z.string().min(1) }); +const LinkedAccountCondition = z.object({ + condition_schema_id: z.string().uuid(), + common_model: z.string().optional(), + native_name: z.string().nullable(), + operator: z.string(), + value: z.unknown().optional(), + field_name: z.string().nullable(), +}); +const LinkedAccountSelectiveSyncConfiguration = z + .object({ linked_account_conditions: z.array(LinkedAccountCondition) }) + .partial(); +const LinkedAccountConditionRequest = z.object({ + condition_schema_id: z.string().uuid(), + operator: z.string().min(1), + value: z.unknown(), +}); +const LinkedAccountSelectiveSyncConfigurationRequest = z.object({ + linked_account_conditions: z.array(LinkedAccountConditionRequest), +}); +const LinkedAccountSelectiveSyncConfigurationListRequest = z.object({ + sync_configurations: z.array(LinkedAccountSelectiveSyncConfigurationRequest), +}); +const ConditionTypeEnum = z.enum([ + "BOOLEAN", + "DATE", + "DATE_TIME", + "INTEGER", + "FLOAT", + "STRING", + "LIST_OF_STRINGS", +]); +const OperatorSchema = z + .object({ operator: z.string(), is_unique: z.boolean() }) + .partial(); +const ConditionSchema = z.object({ + id: z.string().uuid(), + common_model: z.string().optional(), + native_name: z.string().nullable(), + field_name: z.string().nullable(), + is_unique: z.boolean().optional(), + condition_type: ConditionTypeEnum, + operators: z.array(OperatorSchema), +}); +const PaginatedConditionSchemaList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(ConditionSchema), + }) + .partial(); +const SyncStatusStatusEnum = z.enum([ + "SYNCING", + "DONE", + "FAILED", + "DISABLED", + "PAUSED", +]); +const SelectiveSyncConfigurationsUsageEnum = z.enum([ + "IN_NEXT_SYNC", + "IN_LAST_SYNC", +]); +const SyncStatus = z.object({ + model_name: z.string(), + model_id: z.string(), + last_sync_start: z.string().datetime().optional(), + next_sync_start: z.string().datetime().optional(), + status: SyncStatusStatusEnum, + is_initial_sync: z.boolean(), + selective_sync_configurations_usage: + SelectiveSyncConfigurationsUsageEnum.optional(), +}); +const PaginatedSyncStatusList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(SyncStatus), + }) + .partial(); +const TaxRate = z + .object({ + description: z.string().nullable(), + total_tax_rate: z.number().nullable(), + effective_tax_rate: z.number().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTaxRateList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(TaxRate), + }) + .partial(); +const CategoryTypeEnum = z.enum(["CLASS", "DEPARTMENT"]); +const TrackingCategory = z + .object({ + name: z.string().nullable(), + status: Status7d1Enum.nullable(), + category_type: CategoryTypeEnum.nullable(), + parent_category: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTrackingCategoryList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(TrackingCategory), + }) + .partial(); +const TransactionLineItem = z.object({ + remote_id: z.string().nullish(), + memo: z.string().nullish(), + unit_price: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + quantity: z + .string() + .regex(/^-?\d{0,24}(?:\.\d{0,8})?$/) + .nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tax_rate: z.string().uuid().nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), +}); +const Transaction = z + .object({ + transaction_type: z.string().nullable(), + number: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + line_items: z.array(TransactionLineItem), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTransactionList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Transaction), + }) + .partial(); +const VendorCreditLine = z.object({ + remote_id: z.string().nullish(), + net_amount: z.number().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + description: z.string().nullish(), + account: z.string().uuid().nullish(), + company: z.string().uuid().nullish(), +}); +const VendorCredit = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + number: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + vendor: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(VendorCreditLine), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedVendorCreditList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(VendorCredit), + }) + .partial(); +const WebhookReceiver = z.object({ + event: z.string(), + is_active: z.boolean(), + key: z.string().optional(), +}); +const WebhookReceiverRequest = z.object({ + event: z.string().min(1), + is_active: z.boolean(), + key: z.string().min(1).optional(), +}); + +const endpoints = makeApi([ + { + method: "get", + path: "/account-details", + description: `Get details for a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: AccountDetails, + }, + { + method: "get", + path: "/account-token/:public_token", + description: `Returns the account token for the end user with the provided public token.`, + requestFormat: "json", + parameters: [ + { + name: "public_token", + type: "Path", + schema: z.string(), + }, + ], + response: AccountToken, + }, + { + method: "get", + path: "/accounts", + description: `Returns a list of `Account` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + ], + response: PaginatedAccountList, + }, + { + method: "post", + path: "/accounts", + description: `Creates an `Account` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: AccountEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountResponse, + }, + { + method: "get", + path: "/accounts/:id", + description: `Returns an `Account` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + ], + response: Account, + }, + { + method: "get", + path: "/accounts/meta/post", + description: `Returns metadata for `Account` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/addresses/:id", + description: `Returns an `Address` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + ], + response: Address, + }, + { + method: "get", + path: "/attachments", + description: `Returns a list of `AccountingAttachment` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedAccountingAttachmentList, + }, + { + method: "post", + path: "/attachments", + description: `Creates an `AccountingAttachment` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: AccountingAttachmentEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingAttachmentResponse, + }, + { + method: "get", + path: "/attachments/:id", + description: `Returns an `AccountingAttachment` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingAttachment, + }, + { + method: "get", + path: "/attachments/meta/post", + description: `Returns metadata for `AccountingAttachment` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/available-actions", + description: `Returns a list of models and actions available for an account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: AvailableActions, + }, + { + method: "get", + path: "/balance-sheets", + description: `Returns a list of `BalanceSheet` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedBalanceSheetList, + }, + { + method: "get", + path: "/balance-sheets/:id", + description: `Returns a `BalanceSheet` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: BalanceSheet, + }, + { + method: "get", + path: "/cash-flow-statements", + description: `Returns a list of `CashFlowStatement` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedCashFlowStatementList, + }, + { + method: "get", + path: "/cash-flow-statements/:id", + description: `Returns a `CashFlowStatement` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: CashFlowStatement, + }, + { + method: "get", + path: "/common-model-scopes", + description: `Fetch the configuration of what data is saved by Merge when syncing. Common model scopes are set as a default across all linked accounts, but can be updated to have greater granularity per account.`, + requestFormat: "json", + parameters: [ + { + name: "linked_account_id", + type: "Query", + schema: z.string().optional(), + }, + ], + response: CommonModelScopes, + }, + { + method: "post", + path: "/common-model-scopes", + description: `Update the configuration of what data is saved by Merge when syncing. Common model scopes are set as a default across all linked accounts, but can be updated to have greater granularity per account.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CommonModelScopesUpdateSerializer, + }, + { + name: "linked_account_id", + type: "Query", + schema: z.string().optional(), + }, + ], + response: CommonModelScopes, + }, + { + method: "get", + path: "/company-info", + description: `Returns a list of `CompanyInfo` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["addresses", "addresses,phone_numbers", "phone_numbers"]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedCompanyInfoList, + }, + { + method: "get", + path: "/company-info/:id", + description: `Returns a `CompanyInfo` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["addresses", "addresses,phone_numbers", "phone_numbers"]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: CompanyInfo, + }, + { + method: "get", + path: "/contacts", + description: `Returns a list of `Contact` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "addresses", + "addresses,company", + "addresses,phone_numbers", + "addresses,phone_numbers,company", + "company", + "phone_numbers", + "phone_numbers,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedContactList, + }, + { + method: "post", + path: "/contacts", + description: `Creates a `Contact` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ContactEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: ContactResponse, + }, + { + method: "get", + path: "/contacts/:id", + description: `Returns a `Contact` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "addresses", + "addresses,company", + "addresses,phone_numbers", + "addresses,phone_numbers,company", + "company", + "phone_numbers", + "phone_numbers,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: Contact, + }, + { + method: "get", + path: "/contacts/meta/post", + description: `Returns metadata for `Contact` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/credit-notes", + description: `Returns a list of `CreditNote` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["line_items", "payments", "payments,line_items"]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedCreditNoteList, + }, + { + method: "get", + path: "/credit-notes/:id", + description: `Returns a `CreditNote` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["line_items", "payments", "payments,line_items"]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + ], + response: CreditNote, + }, + { + method: "post", + path: "/delete-account", + description: `Delete a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.void(), + }, + { + method: "get", + path: "/expenses", + description: `Returns a list of `Expense` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "account,contact", + "account,contact,company", + "company", + "contact", + "contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedExpenseList, + }, + { + method: "post", + path: "/expenses", + description: `Creates an `Expense` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ExpenseEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: ExpenseResponse, + }, + { + method: "get", + path: "/expenses/:id", + description: `Returns an `Expense` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "account,contact", + "account,contact,company", + "company", + "contact", + "contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Expense, + }, + { + method: "get", + path: "/expenses/meta/post", + description: `Returns metadata for `Expense` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/generate-key", + description: `Create a remote key.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string().min(1) }), + }, + ], + response: RemoteKey, + }, + { + method: "get", + path: "/income-statements", + description: `Returns a list of `IncomeStatement` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedIncomeStatementList, + }, + { + method: "get", + path: "/income-statements/:id", + description: `Returns an `IncomeStatement` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: IncomeStatement, + }, + { + method: "get", + path: "/invoices", + description: `Returns a list of `Invoice` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "contact_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "contact", + "contact,company", + "line_items", + "line_items,company", + "line_items,contact", + "line_items,contact,company", + "payments", + "payments,company", + "payments,contact", + "payments,contact,company", + "payments,line_items", + "payments,line_items,company", + "payments,line_items,contact", + "payments,line_items,contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "issue_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "issue_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "type", + type: "Query", + schema: z.enum(["ACCOUNTS_PAYABLE", "ACCOUNTS_RECEIVABLE"]).nullish(), + }, + ], + response: PaginatedInvoiceList, + }, + { + method: "post", + path: "/invoices", + description: `Creates an `Invoice` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: InvoiceEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: InvoiceResponse, + }, + { + method: "get", + path: "/invoices/:id", + description: `Returns an `Invoice` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "contact", + "contact,company", + "line_items", + "line_items,company", + "line_items,contact", + "line_items,contact,company", + "payments", + "payments,company", + "payments,contact", + "payments,contact,company", + "payments,line_items", + "payments,line_items,company", + "payments,line_items,contact", + "payments,line_items,contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + ], + response: Invoice, + }, + { + method: "get", + path: "/invoices/meta/post", + description: `Returns metadata for `Invoice` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/issues", + description: `Gets issues.`, + requestFormat: "json", + parameters: [ + { + name: "account_token", + type: "Query", + schema: z.string().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_date", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_organization_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "first_incident_time_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "first_incident_time_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "include_muted", + type: "Query", + schema: z.string().optional(), + }, + { + name: "integration_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "last_incident_time_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "last_incident_time_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "start_date", + type: "Query", + schema: z.string().optional(), + }, + { + name: "status", + type: "Query", + schema: z.enum(["ONGOING", "RESOLVED"]).optional(), + }, + ], + response: PaginatedIssueList, + }, + { + method: "get", + path: "/issues/:id", + description: `Get a specific issue.`, + requestFormat: "json", + parameters: [ + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: Issue, + }, + { + method: "get", + path: "/items", + description: `Returns a list of `Item` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "purchase_account", + "purchase_account,company", + "purchase_account,sales_account", + "purchase_account,sales_account,company", + "sales_account", + "sales_account,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedItemList, + }, + { + method: "get", + path: "/items/:id", + description: `Returns an `Item` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "purchase_account", + "purchase_account,company", + "purchase_account,sales_account", + "purchase_account,sales_account,company", + "sales_account", + "sales_account,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: Item, + }, + { + method: "get", + path: "/journal-entries", + description: `Returns a list of `JournalEntry` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,payments", + "lines,payments,company", + "payments", + "payments,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedJournalEntryList, + }, + { + method: "post", + path: "/journal-entries", + description: `Creates a `JournalEntry` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JournalEntryEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: JournalEntryResponse, + }, + { + method: "get", + path: "/journal-entries/:id", + description: `Returns a `JournalEntry` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,payments", + "lines,payments,company", + "payments", + "payments,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: JournalEntry, + }, + { + method: "get", + path: "/journal-entries/meta/post", + description: `Returns metadata for `JournalEntry` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/link-token", + description: `Creates a link token to be used when linking a new end user.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: EndUserDetailsRequest, + }, + ], + response: LinkToken, + }, + { + method: "get", + path: "/linked-accounts", + description: `List linked accounts for your organization.`, + requestFormat: "json", + parameters: [ + { + name: "category", + type: "Query", + schema: z + .enum([ + "accounting", + "ats", + "crm", + "filestorage", + "hris", + "mktg", + "ticketing", + ]) + .nullish(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_email_address", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_organization_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_origin_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_origin_ids", + type: "Query", + schema: z.string().optional(), + }, + { + name: "id", + type: "Query", + schema: z.string().uuid().optional(), + }, + { + name: "ids", + type: "Query", + schema: z.string().optional(), + }, + { + name: "include_duplicates", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "integration_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "is_test_account", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "status", + type: "Query", + schema: z.string().optional(), + }, + ], + response: PaginatedAccountDetailsAndActionsList, + }, + { + method: "post", + path: "/passthrough", + description: `Pull data from an endpoint not currently supported by Merge.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DataPassthroughRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: RemoteResponse, + }, + { + method: "get", + path: "/payments", + description: `Returns a list of `Payment` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "account_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "contact_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "company", + "contact", + "contact,account", + "contact,account,company", + "contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedPaymentList, + }, + { + method: "post", + path: "/payments", + description: `Creates a `Payment` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: PaymentEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: PaymentResponse, + }, + { + method: "get", + path: "/payments/:id", + description: `Returns a `Payment` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "company", + "contact", + "contact,account", + "contact,account,company", + "contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Payment, + }, + { + method: "get", + path: "/payments/meta/post", + description: `Returns metadata for `Payment` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/phone-numbers/:id", + description: `Returns an `AccountingPhoneNumber` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingPhoneNumber, + }, + { + method: "get", + path: "/purchase-orders", + description: `Returns a list of `PurchaseOrder` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "delivery_address", + "delivery_address,company", + "delivery_address,vendor", + "delivery_address,vendor,company", + "line_items", + "line_items,company", + "line_items,delivery_address", + "line_items,delivery_address,company", + "line_items,delivery_address,vendor", + "line_items,delivery_address,vendor,company", + "line_items,vendor", + "line_items,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "issue_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "issue_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedPurchaseOrderList, + }, + { + method: "post", + path: "/purchase-orders", + description: `Creates a `PurchaseOrder` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: PurchaseOrderEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: PurchaseOrderResponse, + }, + { + method: "get", + path: "/purchase-orders/:id", + description: `Returns a `PurchaseOrder` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "delivery_address", + "delivery_address,company", + "delivery_address,vendor", + "delivery_address,vendor,company", + "line_items", + "line_items,company", + "line_items,delivery_address", + "line_items,delivery_address,company", + "line_items,delivery_address,vendor", + "line_items,delivery_address,vendor,company", + "line_items,vendor", + "line_items,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PurchaseOrder, + }, + { + method: "get", + path: "/purchase-orders/meta/post", + description: `Returns metadata for `PurchaseOrder` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/regenerate-key", + description: `Exchange remote keys.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string().min(1) }), + }, + ], + response: RemoteKey, + }, + { + method: "get", + path: "/selective-sync/configurations", + description: `Get a linked account's selective syncs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(LinkedAccountSelectiveSyncConfiguration), + }, + { + method: "put", + path: "/selective-sync/configurations", + description: `Replace a linked account's selective syncs.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: LinkedAccountSelectiveSyncConfigurationListRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(LinkedAccountSelectiveSyncConfiguration), + }, + { + method: "get", + path: "/selective-sync/meta", + description: `Get metadata for the conditions available to a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "common_model", + type: "Query", + schema: z.string().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + ], + response: PaginatedConditionSchemaList, + }, + { + method: "get", + path: "/sync-status", + description: `Get syncing status. Possible values: `DISABLED`, `DONE`, `FAILED`, `PAUSED`, `SYNCING``, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + ], + response: PaginatedSyncStatusList, + }, + { + method: "post", + path: "/sync-status/resync", + description: `Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available for monthly and quarterly sync frequency customers on the Core, Professional, or Enterprise plans.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(SyncStatus), + }, + { + method: "get", + path: "/tax-rates", + description: `Returns a list of `TaxRate` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedTaxRateList, + }, + { + method: "get", + path: "/tax-rates/:id", + description: `Returns a `TaxRate` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: TaxRate, + }, + { + method: "get", + path: "/tracking-categories", + description: `Returns a list of `TrackingCategory` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedTrackingCategoryList, + }, + { + method: "get", + path: "/tracking-categories/:id", + description: `Returns a `TrackingCategory` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: TrackingCategory, + }, + { + method: "get", + path: "/transactions", + description: `Returns a list of `Transaction` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "contact", + "contact,account", + "line_items", + "line_items,account", + "line_items,contact", + "line_items,contact,account", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedTransactionList, + }, + { + method: "get", + path: "/transactions/:id", + description: `Returns a `Transaction` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "contact", + "contact,account", + "line_items", + "line_items,account", + "line_items,contact", + "line_items,contact,account", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Transaction, + }, + { + method: "get", + path: "/vendor-credits", + description: `Returns a list of `VendorCredit` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,vendor", + "lines,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedVendorCreditList, + }, + { + method: "get", + path: "/vendor-credits/:id", + description: `Returns a `VendorCredit` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,vendor", + "lines,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: VendorCredit, + }, + { + method: "get", + path: "/webhook-receivers", + description: `Returns a list of `WebhookReceiver` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(WebhookReceiver), + }, + { + method: "post", + path: "/webhook-receivers", + description: `Creates a `WebhookReceiver` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebhookReceiverRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: WebhookReceiver, + }, +]); + +export const api = new ZodiosCore(endpoints); + +async function main() { + const result = await api.get("/accounts/:id", { + // ^? + params: { id: "123" }, + headers: { "X-Account-Token": "abc" }, + }); +} diff --git a/packages/core/examples/types-from-definition.ts b/packages/core/examples/types-from-definition.ts new file mode 100644 index 00000000..bc25cf30 --- /dev/null +++ b/packages/core/examples/types-from-definition.ts @@ -0,0 +1,128 @@ +import { + ZodiosResponseByPath, + ZodiosBodyByPath, + ZodiosPathParamsByPath, + ZodiosQueryParamsByPath, + makeApi, + ZodiosPathParamByAlias, + makeErrors, +} from "../src/index"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + phone: z.string(), +}); + +const errors = makeErrors([ + { + status: 404, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 401, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 500, + schema: z.object({ + message: z.string(), + cause: z.record(z.string()), + }), + }, +]); + +const api = makeApi([ + { + path: "/users", + method: "get", + response: z.array(user), + }, + { + path: "/users/:id", + method: "get", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors, + }, + { + path: "/users", + method: "post", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "put", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "patch", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "delete", + response: z.object({}), + }, +]); + +type User = z.infer; +type Api = typeof api; + +type Users = ZodiosResponseByPath; +// ^? +type UserById = ZodiosResponseByPath; +// ^? +type GetUserParams = ZodiosPathParamsByPath; +// ^? +type GetUserParamsByAlias = ZodiosPathParamByAlias; +// ^? +type GetUsersParams = ZodiosPathParamsByPath; +// ^? +type GetUserQueries = ZodiosQueryParamsByPath; +// ^? +type CreateUserBody = ZodiosBodyByPath; +// ^? +type CreateUserResponse = ZodiosResponseByPath; +// ^? +type UpdateUserBody = ZodiosBodyByPath; +// ^? +type PatchUserBody = ZodiosBodyByPath; +// ^? +type DeleteUserResponse = ZodiosResponseByPath; +// ^? diff --git a/packages/core/examples/typescript-types.ts b/packages/core/examples/typescript-types.ts new file mode 100644 index 00000000..1393c1a3 --- /dev/null +++ b/packages/core/examples/typescript-types.ts @@ -0,0 +1,74 @@ +import { + ZodiosCore, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, +} from "../src/index"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/core/examples/zod-types.ts b/packages/core/examples/zod-types.ts new file mode 100644 index 00000000..4969efe1 --- /dev/null +++ b/packages/core/examples/zod-types.ts @@ -0,0 +1,75 @@ +import { ZodiosCore, ZodiosErrorByAlias, makeApi } from "../src/index"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: z.string(), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: z.number().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + alias: "getUser", + response: userSchema, + errors: [ + { + status: "default", + schema: z.object({ error: z.string(), message: z.string() }), + }, + { + status: 400, + schema: z.object({ + error: z.string(), + message: z.literal("Bad Request"), + }), + }, + ], + }, +]); + +type Error400 = ZodiosErrorByAlias; + +// and then use them in your API +async function bootstrap() { + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi); + + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + console.log(user); +} + +bootstrap(); diff --git a/packages/core/jest.config.ts b/packages/core/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/core/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 00000000..d40e2f5c --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,79 @@ +{ + "name": "@zodios/core", + "description": "Typescript API client with autocompletion and zod validations", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./lib/*.types": { + "import": "./lib/*.types.mjs", + "require": "./lib/*.types.js", + "types": "./lib/*.types.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "example": "ts-node examples/jsonplaceholder.ts", + "example:dev.to": "ts-node examples/dev.to/example.ts", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "fp-ts": "2.x", + "io-ts": "2.x", + "zod": "^3.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "form-data": "^4.0.0", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/core/src/__snapshots__/zodios.test.ts.snap b/packages/core/src/__snapshots__/zodios.test.ts.snap new file mode 100644 index 00000000..1ec8bbce --- /dev/null +++ b/packages/core/src/__snapshots__/zodios.test.ts.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Zodios should not validate bad formatted responses 1`] = ` +"Zodios: Invalid response from endpoint 'get /:id' +status: 200 OK +cause: +[ + { + "code": "invalid_type", + "expected": "string", + "received": "undefined", + "path": [ + "more" + ], + "message": "Required" + } +] +received: +{ + "id": 1, + "name": "test" +}" +`; diff --git a/packages/core/src/api.test.ts b/packages/core/src/api.test.ts new file mode 100644 index 00000000..567b00f9 --- /dev/null +++ b/packages/core/src/api.test.ts @@ -0,0 +1,315 @@ +import z from "zod"; +import { makeApi, mergeApis, parametersBuilder } from "./index"; +import { Assert } from "./utils.types"; + +const userSchema = z.object({ + id: z.number(), + name: z.string(), +}); + +describe("makeApi", () => { + it("should throw on duplicate path", () => { + expect(() => + makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + { + method: "get", + path: "/users", + alias: "getUsers2", + description: "Get all users", + response: z.array(userSchema), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /users'"); + }); + + it("should throw on duplicate alias", () => { + expect(() => + makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + { + method: "get", + path: "/users2", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + ]) + ).toThrowError("Zodios: Duplicate alias 'getUsers'"); + }); + + it("should throw on duplicate Body", () => { + expect(() => + makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "first", + type: "Body", + description: "The object to create", + schema: userSchema.partial(), + }, + { + name: "second", + type: "Body", + description: "The object to create", + schema: userSchema.partial(), + }, + ], + response: userSchema, + }, + ]) + ).toThrowError("Zodios: Multiple body parameters in endpoint '/users'"); + }); + + it("should build with parameters (Path,Query,Body,Header)", () => { + // get users api with query filter for user name, and path parameter for user id and header parameter for user token + const optionalTrueSchema = z.boolean().default(true).optional(); + const partialUserSchema = userSchema.partial(); + const bearerSchema = z.string().transform((s) => `Bearer ${s}`); + const api = makeApi([ + { + method: "post", + path: "/users/:id", + alias: "createtUser", + description: "Create a user", + parameters: [ + { + name: "id", + type: "Path", + description: "The user id", + schema: z.number(), + }, + { + name: "homonyms", + type: "Query", + description: "Allow homonyms", + schema: optionalTrueSchema, + }, + { + name: "email", + type: "Query", + description: "create an email account for the user", + schema: optionalTrueSchema, + }, + { + name: "body", + type: "Body", + description: "The object to create", + schema: partialUserSchema, + }, + { + name: "Authorization", + type: "Header", + description: "The user token", + schema: bearerSchema, + }, + { + name: "x-custom-header", + type: "Header", + description: "A custom header", + schema: z.string(), + }, + ], + response: userSchema, + }, + ]); + // check narrowing works + const test: Assert< + typeof api, + readonly [ + { + readonly method: "post"; + readonly path: "/users/:id"; + readonly alias: "createtUser"; + readonly description: "Create a user"; + readonly parameters: readonly [ + { + readonly name: "id"; + readonly type: "Path"; + readonly description: "The user id"; + readonly schema: z.ZodNumber; + }, + { + readonly name: "homonyms"; + readonly type: "Query"; + readonly description: "Allow homonyms"; + readonly schema: typeof optionalTrueSchema; + }, + { + readonly name: "email"; + readonly type: "Query"; + readonly description: "create an email account for the user"; + readonly schema: typeof optionalTrueSchema; + }, + { + readonly name: "body"; + readonly type: "Body"; + readonly description: "The object to create"; + readonly schema: typeof partialUserSchema; + }, + { + readonly name: "Authorization"; + readonly type: "Header"; + readonly description: "The user token"; + readonly schema: typeof bearerSchema; + }, + { + readonly name: "x-custom-header"; + readonly type: "Header"; + readonly description: "A custom header"; + readonly schema: z.ZodString; + } + ]; + readonly response: typeof userSchema; + } + ] + > = true; + }); +}); + +describe("parametersBuilder", () => { + it("should build parameters (Path,Query,Body,Header)", () => { + // get users api with query filter for user name, and path parameter for user id and header parameter for user token + const optionalTrueSchema = z.boolean().default(true).optional(); + const partialUserSchema = userSchema.partial(); + const bearerSchema = z.string().transform((s) => `Bearer ${s}`); + + const parameters = parametersBuilder() + .addParameters("Path", { + id: z.number(), + }) + .addQueries({ + homonyms: optionalTrueSchema, + email: optionalTrueSchema, + }) + .addBody(partialUserSchema) + .addHeaders({ + Authorization: bearerSchema, + "x-custom-header": z.string(), + }) + .build(); + + const test: Assert< + (typeof parameters)[number], + | { + name: "id"; + type: "Path"; + description?: string; + schema: z.ZodNumber; + } + | { + name: "homonyms"; + type: "Query"; + description?: string; + schema: typeof optionalTrueSchema; + } + | { + name: "email"; + type: "Query"; + description?: string; + schema: typeof optionalTrueSchema; + } + | { + name: "body"; + type: "Body"; + description?: string; + schema: typeof partialUserSchema; + } + | { + name: "Authorization"; + type: "Header"; + description?: string; + schema: typeof bearerSchema; + } + | { + name: "x-custom-header"; + type: "Header"; + description?: string; + schema: z.ZodString; + } + > = true; + }); +}); + +describe("mergeApis", () => { + it("should merge two apis", () => { + const usersSchema = z.array(userSchema); + const api1 = makeApi([ + { + method: "get", + path: "/", + alias: "getUsers", + description: "Get all users", + response: usersSchema, + }, + { + method: "get", + path: "/:id", + alias: "getUser", + description: "Get a user", + response: userSchema, + }, + ]); + + const api2 = makeApi([ + { + method: "get", + path: "/", + alias: "getAdmins", + description: "Get all admins", + response: usersSchema, + }, + ]); + const merged = mergeApis({ + "/users": api1, + "/admins": api2, + }); + expect(merged).toHaveLength(3); + expect(merged[0].path).toEqual("/users"); + expect(merged[1].path).toEqual("/users/:id"); + expect(merged[2].path).toEqual("/admins"); + const test1: Assert< + typeof merged, + [ + { + readonly method: "get"; + readonly path: "/users"; + readonly alias: "getUsers"; + readonly description: "Get all users"; + readonly response: typeof usersSchema; + }, + { + readonly method: "get"; + readonly path: "/users/:id"; + readonly alias: "getUser"; + readonly description: "Get a user"; + readonly response: typeof userSchema; + }, + { + readonly method: "get"; + readonly path: "/admins"; + readonly alias: "getAdmins"; + readonly description: "Get all admins"; + readonly response: typeof usersSchema; + } + ] + > = true; + }); +}); diff --git a/src/api.ts b/packages/core/src/api.ts similarity index 53% rename from src/api.ts rename to packages/core/src/api.ts index cbe21159..b92ee2a8 100644 --- a/src/api.ts +++ b/packages/core/src/api.ts @@ -1,15 +1,9 @@ -// disable type checking for this file as we need to defer type checking when using these utility types -// indeed typescript seems to have a bug, where it tries to infer the type of an undecidable generic type -// but when using the functions, types are inferred correctly -import { +import { TupleFlat, UnionToTuple } from "./utils.types"; +import type { ZodiosEndpointDefinition, ZodiosEndpointParameter, - ZodiosEndpointDefinitions, ZodiosEndpointError, } from "./zodios.types"; -import z, { ZodRawShape } from "zod"; -import { capitalize } from "./utils"; -import { Narrow, TupleFlat, UnionToTuple } from "./utils.types"; /** * check api for non unique paths @@ -17,8 +11,9 @@ import { Narrow, TupleFlat, UnionToTuple } from "./utils.types"; * @return - nothing * @throws - error if api has non unique paths */ -export function checkApi(api: T) { - // check if no duplicate path +export function checkApi( + api: T +) { const paths = new Set(); for (let endpoint of api) { const fullpath = `${endpoint.method} ${endpoint.path}`; @@ -58,13 +53,21 @@ export function checkApi(api: T) { * @param api - api definitions * @returns the api definitions */ -export function makeApi( - api: Narrow +export function makeApi( + api: Api ): Api { checkApi(api); - return api as Api; + return api; } +const test = makeApi([ + { + method: "get", + path: "/test", + response: {}, + }, +]); + /** * Simple helper to split your parameter definitions into multiple files * Mandatory to be used when declaring parameters appart from your endpoint definitions @@ -73,9 +76,9 @@ export function makeApi( * @returns the api parameter definitions */ export function makeParameters< - ParameterDescriptions extends ZodiosEndpointParameter[] ->(params: Narrow): ParameterDescriptions { - return params as ParameterDescriptions; + const ParameterDescriptions extends readonly ZodiosEndpointParameter[] +>(params: ParameterDescriptions) { + return params; } export function parametersBuilder() { @@ -84,7 +87,7 @@ export function parametersBuilder() { type ObjectToQueryParameters< Type extends "Query" | "Path" | "Header", - T extends Record>, + T extends Record, Keys = UnionToTuple > = { [Index in keyof Keys]: { @@ -101,24 +104,20 @@ class ParametersBuilder { addParameter< Name extends string, Type extends "Path" | "Query" | "Body" | "Header", - Schema extends z.ZodType - >(name: Name, type: Type, schema: Schema) { + Schema + >(name: Name, type: Type, schema: Schema, description?: string) { return new ParametersBuilder< [...T, { name: Name; type: Type; description?: string; schema: Schema }] - >([ - ...this.params, - { name, type, description: schema.description, schema }, - ]); + >([...this.params, { name, type, description, schema }]); } addParameters< Type extends "Query" | "Path" | "Header", - Schemas extends Record> + Schemas extends Record >(type: Type, schemas: Schemas) { const parameters = Object.keys(schemas).map((key) => ({ name: key, type, - description: schemas[key].description, schema: schemas[key], })); return new ParametersBuilder< @@ -132,46 +131,31 @@ class ParametersBuilder { >([...this.params, ...parameters] as any); } - addBody>(schema: Schema) { + addBody(schema: Schema) { return this.addParameter("body", "Body", schema); } - addQuery>( - name: Name, - schema: Schema - ) { + addQuery(name: Name, schema: Schema) { return this.addParameter(name, "Query", schema); } - addPath>( - name: Name, - schema: Schema - ) { + addPath(name: Name, schema: Schema) { return this.addParameter(name, "Path", schema); } - addHeader>( - name: Name, - schema: Schema - ) { + addHeader(name: Name, schema: Schema) { return this.addParameter(name, "Header", schema); } - addQueries>>( - schemas: Schemas - ) { + addQueries>(schemas: Schemas) { return this.addParameters("Query", schemas); } - addPaths>>( - schemas: Schemas - ) { + addPaths>(schemas: Schemas) { return this.addParameters("Path", schemas); } - addHeaders>>( - schemas: Schemas - ) { + addHeaders>(schemas: Schemas) { return this.addParameters("Header", schemas); } @@ -187,10 +171,10 @@ class ParametersBuilder { * @param errors - api error definitions * @returns the error definitions */ -export function makeErrors( - errors: Narrow -): ErrorDescription { - return errors as ErrorDescription; +export function makeErrors< + const ErrorDescription extends readonly ZodiosEndpointError[] +>(errors: ErrorDescription) { + return errors; } /** @@ -200,14 +184,15 @@ export function makeErrors( * @param endpoint - api endpoint definition * @returns the endpoint definition */ -export function makeEndpoint>( - endpoint: Narrow -): T { - return endpoint as T; +export function makeEndpoint< + const EndpointDescription extends ZodiosEndpointDefinition +>(endpoint: EndpointDescription) { + return endpoint; } -export class Builder { + +export class Builder { constructor(private api: T) {} - addEndpoint(endpoint: Narrow) { + addEndpoint(endpoint: E) { return new Builder<[...T, E]>([...this.api, endpoint] as [...T, E]); } build(): T { @@ -222,112 +207,12 @@ export class Builder { * @param endpoint * @returns - a builder to build your api definitions */ -export function apiBuilder>( - endpoint: Narrow +export function apiBuilder( + endpoint: T ): Builder<[T]> { return new Builder([endpoint] as [T]); } -/** - * Helper to generate a basic CRUD api for a given resource - * @param resource - the resource to generate the api for - * @param schema - the schema of the resource - * @returns - the api definitions - */ -export function makeCrudApi< - T extends string, - S extends z.ZodObject ->(resource: T, schema: S) { - type Schema = z.input; - const capitalizedResource = capitalize(resource); - return makeApi([ - { - method: "get", - // @ts-expect-error - path: `/${resource}s`, - // @ts-expect-error - alias: `get${capitalizedResource}s`, - description: `Get all ${resource}s`, - response: z.array(schema), - }, - { - method: "get", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `get${capitalizedResource}`, - description: `Get a ${resource}`, - // @ts-expect-error - response: schema, - }, - { - method: "post", - // @ts-expect-error - path: `/${resource}s`, - // @ts-expect-error - alias: `create${capitalizedResource}`, - description: `Create a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to create", - schema: schema.partial() as z.Schema>, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "put", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `update${capitalizedResource}`, - description: `Update a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to update", - // @ts-expect-error - schema: schema, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "patch", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `patch${capitalizedResource}`, - description: `Patch a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to patch", - schema: schema.partial() as z.Schema>, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "delete", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `delete${capitalizedResource}`, - description: `Delete a ${resource}`, - // @ts-expect-error - response: schema, - }, - ]); -} - type CleanPath = Path extends `${infer PClean}/` ? PClean : Path; @@ -354,7 +239,7 @@ type MapApiPath< : Acc; type MergeApis< - Apis extends Record, + Apis extends Record, MergedPathApis = UnionToTuple< { [K in keyof Apis]: K extends string ? MapApiPath : never; @@ -374,7 +259,7 @@ function cleanPath(path: string) { */ export function prefixApi< Prefix extends string, - Api extends ZodiosEndpointDefinition[] + const Api extends readonly ZodiosEndpointDefinition[] >(prefix: Prefix, api: Api) { return api.map((endpoint) => ({ ...endpoint, @@ -396,7 +281,7 @@ export function prefixApi< * ``` */ export function mergeApis< - Apis extends Record + const Apis extends Record >(apis: Apis): MergeApis { return Object.keys(apis).flatMap((key) => prefixApi(key, apis[key])) as any; } diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts new file mode 100644 index 00000000..26e957f4 --- /dev/null +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -0,0 +1,67 @@ +import { Merge, ReadonlyDeep } from "../utils.types"; +import { AnyZodiosRequestOptions } from "../zodios.types"; + +/** + * A type provider for Fetcher + * allows to define request, response and error types for a fetcher + */ +export interface AnyZodiosFetcherProvider { + /** + * inputs types to call fetcher + */ + arg1: unknown; + arg2: unknown; + + /** + * config types to call fetcher + */ + options: unknown; + config: unknown; + response: any; + error: any; +} + +export type TypeOfFetcherConfig< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["config"]; + +export type TypeOfFetcherError< + FetcherProvider extends AnyZodiosFetcherProvider, + Response, + Status +> = (FetcherProvider & { + arg1: Response; + arg2: Status; +})["error"]; + +export type TypeOfFetcherResponse< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["response"]; + +export type TypeOfFetcherOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["options"]; + +export interface ZodiosFetcher< + FetcherProvider extends AnyZodiosFetcherProvider +> { + baseURL?: string; + fetch( + config: ReadonlyDeep> + ): Promise>; +} + +export type ZodiosFetcherFactoryOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + { + baseURL?: string; + }, + TypeOfFetcherOptions +>; + +export type ZodiosFetcherFactory< + FetcherProvider extends AnyZodiosFetcherProvider +> = ( + options?: ZodiosFetcherFactoryOptions +) => ZodiosFetcher; diff --git a/packages/core/src/fetcher-providers/index.ts b/packages/core/src/fetcher-providers/index.ts new file mode 100644 index 00000000..0d65dafe --- /dev/null +++ b/packages/core/src/fetcher-providers/index.ts @@ -0,0 +1 @@ +export * from "./fetcher-provider.types"; diff --git a/packages/core/src/fetcher-providers/mock-provider.ts b/packages/core/src/fetcher-providers/mock-provider.ts new file mode 100644 index 00000000..451c9698 --- /dev/null +++ b/packages/core/src/fetcher-providers/mock-provider.ts @@ -0,0 +1,130 @@ +import { setFetcherHook, clearFetcherHook } from "../index"; + +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosFetcherFactory, +} from "../index"; + +interface MockError { + status: S; + response: { + status: S; + data: T; + }; +} + +export interface MockProvider extends AnyZodiosFetcherProvider { + options: {}; + config: { + baseURL?: string; + body?: unknown; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; + }; + response: unknown; + error: MockError; +} + +export const mockFetchFactory: ZodiosFetcherFactory = ( + options +) => ({ + async fetch(config) { + const requestConfig = { + ...config, + baseURL: options?.baseURL, + }; + for (const [{ method, url }, callback] of registeredMocks) { + if (method === requestConfig.method && url === requestConfig.url) { + const result = { + status: 200, + statusText: "OK", + headers: {}, + data: {}, + ...(await callback(requestConfig)), + } as Required; + if ( + (config.validateStatus && !config.validateStatus(result.status)) || + result.status > 299 + ) { + const err = new Error( + `Request failed with status code ${result.status}` + ) as Error & { code: string; config: any; response: any }; + err.code = `ERR_STATUS_${result.status}`; + err.config = requestConfig; + err.response = result; + throw err; + } + return result; + } + } + throw new Error(`No mocks found for ${requestConfig.url}`); + }, +}); + +type MockResponse = { + readonly headers?: Record; + readonly status?: number; + readonly statusText?: string; + readonly data?: Data; +}; + +interface ZodiosMockBase { + install(): void; + uninstall(): void; + reset(): void; + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ): void; + mockResponse(method: string, path: string, response: MockResponse): void; +} + +const registeredMocks = new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => Promise +>(); + +export const zodiosMocks: ZodiosMockBase = { + install() { + const fetcher = mockFetchFactory(); + setFetcherHook(fetcher); + }, + uninstall() { + registeredMocks.clear(); + clearFetcherHook(); + }, + reset() { + registeredMocks.clear(); + }, + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ) { + registeredMocks.set({ method, url: path }, callback); + }, + mockResponse(method: string, path: string, response: MockResponse) { + registeredMocks.set( + { + method, + url: path, + }, + () => + Promise.resolve({ + headers: {}, + data: {}, + status: 200, + statusText: "OK", + ...response, + }) + ); + }, +}; diff --git a/packages/core/src/hooks.ts b/packages/core/src/hooks.ts new file mode 100644 index 00000000..f4570c31 --- /dev/null +++ b/packages/core/src/hooks.ts @@ -0,0 +1,18 @@ +import { + AnyZodiosFetcherProvider, + ZodiosFetcher, +} from "./fetcher-providers/fetcher-provider.types"; + +export const hooks: { + fetcher?: ZodiosFetcher; +} = {}; + +export function setFetcherHook( + fetcher: ZodiosFetcher +) { + hooks.fetcher = fetcher; +} + +export function clearFetcherHook() { + hooks.fetcher = undefined; +} diff --git a/src/index.ts b/packages/core/src/index.ts similarity index 50% rename from src/index.ts rename to packages/core/src/index.ts index e1b36f0a..127e094b 100644 --- a/src/index.ts +++ b/packages/core/src/index.ts @@ -1,8 +1,12 @@ -export { Zodios } from "./zodios"; -export type { ApiOf } from "./zodios"; -export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; +export { ZodiosCore } from "./zodios"; +export type { + ApiOf, + TypeProviderOf, + FetcherProviderOf, + ZodiosInstance, + ZodiosBase, +} from "./zodios"; export { ZodiosError } from "./zodios-error"; -export { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; export type { AnyZodiosMethodOptions, AnyZodiosRequestOptions, @@ -24,27 +28,58 @@ export type { ZodiosQueryParamsForEndpoint, ZodiosQueryParamsByPath, ZodiosQueryParamsByAlias, - ZodiosEndpointDefinitionByPath, - ZodiosEndpointDefinitionByAlias, + FindZodiosEndpointDefinitionByPath, + FindZodiosEndpointDefinitionByAlias, ZodiosErrorForEndpoint, ZodiosErrorByPath, ZodiosErrorByAlias, + ZodiosErrorsByPath, + ZodiosErrorsByAlias, ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, ZodiosEndpointParameter, - ZodiosEndpointParameters, ZodiosEndpointError, - ZodiosEndpointErrors, ZodiosOptions, ZodiosRequestOptions, - ZodiosMethodOptions, ZodiosRequestOptionsByPath, ZodiosRequestOptionsByAlias, ZodiosPlugin, } from "./zodios.types"; export { - PluginId, - zodValidationPlugin, + HTTP_METHODS, + HTTP_MUTATION_METHODS, + HTTP_QUERY_METHODS, +} from "./zodios.types"; +export type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + IoTsTypeProvider, + TsTypeProvider, + ZodiosRuntimeTypeProvider, + ZodiosValidateResult, + ZodTypeProvider, +} from "./type-providers"; +export { + ioTsTypeProvider, + tsTypeProvider, + zodTypeProvider, + tsSchema, + tsFnSchema, +} from "./type-providers"; +export type { + AnyZodiosFetcherProvider, + TypeOfFetcherConfig, + TypeOfFetcherError, + TypeOfFetcherOptions, + TypeOfFetcherResponse, + ZodiosFetcherFactoryOptions, + ZodiosFetcherFactory, + ZodiosFetcher, +} from "./fetcher-providers"; +export { setFetcherHook, clearFetcherHook } from "./hooks"; +export type { PluginId } from "./plugins"; +export { + schemaValidationPlugin, formDataPlugin, formURLPlugin, headerPlugin, @@ -52,7 +87,6 @@ export { export { makeApi, - makeCrudApi, apiBuilder, parametersBuilder, makeParameters, diff --git a/src/plugins/form-data.plugin.ts b/packages/core/src/plugins/form-data.plugin.ts similarity index 54% rename from src/plugins/form-data.plugin.ts rename to packages/core/src/plugins/form-data.plugin.ts index 65d84e07..987eb39d 100644 --- a/src/plugins/form-data.plugin.ts +++ b/packages/core/src/plugins/form-data.plugin.ts @@ -1,27 +1,7 @@ import { getFormDataStream } from "./form-data.utils"; import { ZodiosError } from "../zodios-error"; import type { ZodiosPlugin } from "../zodios.types"; - -const plugin: ZodiosPlugin = { - name: "form-data", - request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { - throw new ZodiosError( - "Zodios: multipart/form-data body must be an object", - config - ); - } - const result = getFormDataStream(config.data as any); - return { - ...config, - data: result.data, - headers: { - ...config.headers, - ...result.headers, - }, - }; - }, -}; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; /** * form-data plugin used internally by Zodios. @@ -53,6 +33,31 @@ const plugin: ZodiosPlugin = { * ``` * @returns form-data plugin */ -export function formDataPlugin(): ZodiosPlugin { - return plugin; +export function formDataPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +>(): ZodiosPlugin { + return { + name: "form-data", + request: async (_, config) => { + if ( + !config.body || + typeof config.body !== "object" || + Array.isArray(config.body) + ) { + throw new ZodiosError( + "Zodios: multipart/form-data body must be an object", + config + ); + } + const result = getFormDataStream(config.body as any); + return { + ...config, + body: result.data, + headers: { + ...config.headers, + ...result.headers, + }, + }; + }, + }; } diff --git a/src/plugins/form-data.utils.ts b/packages/core/src/plugins/form-data.utils.ts similarity index 100% rename from src/plugins/form-data.utils.ts rename to packages/core/src/plugins/form-data.utils.ts diff --git a/src/plugins/form-url.plugin.ts b/packages/core/src/plugins/form-url.plugin.ts similarity index 52% rename from src/plugins/form-url.plugin.ts rename to packages/core/src/plugins/form-url.plugin.ts index 7cee181c..c553474c 100644 --- a/src/plugins/form-url.plugin.ts +++ b/packages/core/src/plugins/form-url.plugin.ts @@ -1,27 +1,7 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import { ZodiosError } from "../zodios-error"; import type { ZodiosPlugin } from "../zodios.types"; -const plugin: ZodiosPlugin = { - name: "form-url", - request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { - throw new ZodiosError( - "Zodios: application/x-www-form-urlencoded body must be an object", - config - ); - } - - return { - ...config, - data: new URLSearchParams(config.data as any).toString(), - headers: { - ...config.headers, - "Content-Type": "application/x-www-form-urlencoded", - }, - }; - }, -}; - /** * form-url plugin used internally by Zodios. * @example @@ -53,6 +33,31 @@ const plugin: ZodiosPlugin = { * ``` * @returns form-url plugin */ -export function formURLPlugin(): ZodiosPlugin { - return plugin; +export function formURLPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +>(): ZodiosPlugin { + return { + name: "form-url", + request: async (_, config) => { + if ( + !config.body || + typeof config.body !== "object" || + Array.isArray(config.body) + ) { + throw new ZodiosError( + "Zodios: application/x-www-form-urlencoded body must be an object", + config + ); + } + + return { + ...config, + body: new URLSearchParams(config.body as any).toString(), + headers: { + ...config.headers, + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + }, + }; } diff --git a/src/plugins/header.plugin.ts b/packages/core/src/plugins/header.plugin.ts similarity index 50% rename from src/plugins/header.plugin.ts rename to packages/core/src/plugins/header.plugin.ts index ea9d7234..580b51f7 100644 --- a/src/plugins/header.plugin.ts +++ b/packages/core/src/plugins/header.plugin.ts @@ -1,6 +1,9 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import type { ZodiosPlugin } from "../zodios.types"; -export function headerPlugin(key: string, value: string): ZodiosPlugin { +export function headerPlugin< + FetcherProvider extends AnyZodiosFetcherProvider = AnyZodiosFetcherProvider +>(key: string, value: string): ZodiosPlugin { return { request: async (_, config) => { return { diff --git a/src/plugins/index.ts b/packages/core/src/plugins/index.ts similarity index 59% rename from src/plugins/index.ts rename to packages/core/src/plugins/index.ts index be1f6cdf..09b66505 100644 --- a/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -1,5 +1,6 @@ export * from "./form-data.plugin"; export * from "./form-url.plugin"; export * from "./header.plugin"; -export * from "./zod-validation.plugin"; +export * from "./validation.plugin"; export * from "./zodios-plugins"; +export type { PluginId } from "./zodios-plugins.types"; diff --git a/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/validation.plugin.test.ts similarity index 81% rename from src/plugins/zod-validation.plugin.test.ts rename to packages/core/src/plugins/validation.plugin.test.ts index ec12250f..4a59b3d1 100644 --- a/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/validation.plugin.test.ts @@ -1,25 +1,29 @@ -import type { AxiosResponse } from "axios"; import { z } from "zod"; import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; -import { zodValidationPlugin } from "./zod-validation.plugin"; +import { schemaValidationPlugin } from "./validation.plugin"; +import { zodTypeProvider } from "../type-providers"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; -describe("zodValidationPlugin", () => { - const plugin = zodValidationPlugin({ +describe("schemaValidationPlugin", () => { + const plugin = schemaValidationPlugin({ validate: true, transform: true, sendDefaults: false, + typeProvider: zodTypeProvider, }); - const pluginWithDefaults = zodValidationPlugin({ + const pluginWithDefaults = schemaValidationPlugin({ validate: true, transform: true, sendDefaults: true, + typeProvider: zodTypeProvider, }); - const pluginWithoutTransform = zodValidationPlugin({ + const pluginWithoutTransform = schemaValidationPlugin({ validate: true, transform: false, sendDefaults: false, + typeProvider: zodTypeProvider, }); describe("request", () => { @@ -27,19 +31,13 @@ describe("zodValidationPlugin", () => { expect(plugin.request).toBeDefined(); }); - it("should throw if endpoint is not found", async () => { - await expect( - plugin.request!(api, notExistingConfig) - ).rejects.toThrowError("No endpoint found for get /notExisting"); - }); - it("should verify parameters", async () => { const transformed = await plugin.request!( - api, + api[0], createSampleConfig("/parse") ); - expect(transformed.data).toBe("123"); + expect(transformed.body).toBe("123"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -50,11 +48,11 @@ describe("zodValidationPlugin", () => { it("should transform parameters", async () => { const transformed = await plugin.request!( - api, + api[2], createSampleConfig("/transform") ); - expect(transformed.data).toBe("123_transformed"); + expect(transformed.body).toBe("123_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456_transformed", }); @@ -65,11 +63,11 @@ describe("zodValidationPlugin", () => { it("should transform empty string parameters", async () => { const transformed = await plugin.request!( - api, + api[2], createEmptySampleConfig("/transform") ); - expect(transformed.data).toBe("_transformed"); + expect(transformed.body).toBe("_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "_transformed", }); @@ -80,7 +78,7 @@ describe("zodValidationPlugin", () => { it("should generate default parameter when generateDefaults is activated", async () => { const defaulted = await pluginWithDefaults.request!( - api, + api[1], createUndefinedSampleConfig("/defaults") ); @@ -94,11 +92,11 @@ describe("zodValidationPlugin", () => { it("should not transform parameters when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.request!( - api, + api[2], createSampleConfig("/transform") ); - expect(notTransformed.data).toBe("123"); + expect(notTransformed.body).toBe("123"); expect(notTransformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -109,11 +107,11 @@ describe("zodValidationPlugin", () => { it("should transform parameters (async)", async () => { const transformed = await plugin.request!( - api, + api[3], createSampleConfig("/transformAsync") ); - expect(transformed.data).toBe("123_transformed"); + expect(transformed.body).toBe("123_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456_transformed", }); @@ -124,11 +122,11 @@ describe("zodValidationPlugin", () => { it("should not transform parameters (async) when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.request!( - api, + api[3], createSampleConfig("/transformAsync") ); - expect(notTransformed.data).toBe("123"); + expect(notTransformed.body).toBe("123"); expect(notTransformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -143,7 +141,7 @@ describe("zodValidationPlugin", () => { sampleQueryParam: 123, }; - await expect(plugin.request!(api, badConfig)).rejects.toThrowError( + await expect(plugin.request!(api[0], badConfig)).rejects.toThrowError( "Zodios: Invalid Query parameter 'sampleQueryParam'" ); }); @@ -154,15 +152,9 @@ describe("zodValidationPlugin", () => { expect(plugin.response).toBeDefined(); }); - it("should throw if endpoint is not found", async () => { - await expect( - plugin.response!(api, notExistingConfig, createSampleResponse()) - ).rejects.toThrowError("No endpoint found for get /notExisting"); - }); - it("should verify body", async () => { const transformed = await plugin.response!( - api, + api[0], createSampleConfig("/parse"), createSampleResponse() ); @@ -175,7 +167,7 @@ describe("zodValidationPlugin", () => { it("should transform body", async () => { const transformed = await plugin.response!( - api, + api[2], createSampleConfig("/transform"), createSampleResponse() ); @@ -188,7 +180,7 @@ describe("zodValidationPlugin", () => { it("should not transform body when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.response!( - api, + api[2], createSampleConfig("/transform"), createSampleResponse() ); @@ -201,7 +193,7 @@ describe("zodValidationPlugin", () => { it("should transform body (async)", async () => { const transformed = await plugin.response!( - api, + api[3], createSampleConfig("/transformAsync"), createSampleResponse() ); @@ -214,7 +206,7 @@ describe("zodValidationPlugin", () => { it("should not transform body (async) when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.response!( - api, + api[3], createSampleConfig("/transformAsync"), createSampleResponse() ); @@ -227,10 +219,11 @@ describe("zodValidationPlugin", () => { it("should throw on unsuccessful parse", async () => { const badResponse = createSampleResponse(); + // @ts-expect-error badResponse.data.first = 123; await expect( - plugin.response!(api, createSampleConfig("/parse"), badResponse) + plugin.response!(api[0], createSampleConfig("/parse"), badResponse) ).rejects .toThrowError(`Zodios: Invalid response from endpoint 'post /parse' status: 200 OK @@ -254,15 +247,19 @@ received: }); }); - const notExistingConfig: ReadonlyDeep = { + const notExistingConfig: ReadonlyDeep< + AnyZodiosRequestOptions + > = { method: "get", url: "/notExisting", }; - const createSampleConfig = (url: string): AnyZodiosRequestOptions => ({ + const createSampleConfig = ( + url: string + ): AnyZodiosRequestOptions => ({ method: "post", url, - data: "123", + body: "123", queries: { sampleQueryParam: "456", }, @@ -271,10 +268,12 @@ received: }, }); - const createEmptySampleConfig = (url: string): AnyZodiosRequestOptions => ({ + const createEmptySampleConfig = ( + url: string + ): AnyZodiosRequestOptions => ({ method: "post", url, - data: "", + body: "", queries: { sampleQueryParam: "", }, @@ -285,24 +284,23 @@ received: const createUndefinedSampleConfig = ( url: string - ): AnyZodiosRequestOptions => ({ + ): AnyZodiosRequestOptions => ({ method: "get", url, }); - const createSampleResponse = () => - ({ - data: { - first: "123", - second: 111, - }, - status: 200, - headers: { - "content-type": "application/json", - }, - config: {}, - statusText: "OK", - } as unknown as AxiosResponse); + const createSampleResponse = () => ({ + data: { + first: "123", + second: 111, + }, + status: 200, + headers: { + "content-type": "application/json", + }, + config: {}, + statusText: "OK", + }); const api = apiBuilder({ path: "/parse", diff --git a/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/validation.plugin.ts similarity index 63% rename from src/plugins/zod-validation.plugin.ts rename to packages/core/src/plugins/validation.plugin.ts index af8c035a..a85974bb 100644 --- a/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/validation.plugin.ts @@ -1,9 +1,16 @@ import { ZodiosError } from "../zodios-error"; +import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; -import { findEndpoint } from "../utils"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; -type Options = Required< - Pick +type Options< + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = Required< + Pick< + ZodiosOptions, + "validate" | "transform" | "sendDefaults" | "typeProvider" + > >; function shouldResponse(option: string | boolean) { @@ -15,25 +22,23 @@ function shouldRequest(option: string | boolean) { } /** - * Zod validation plugin used internally by Zodios. + * alidation plugin used internally by Zodios. * By default zodios always validates the response. - * @returns zod-validation plugin + * @returns schema-validation plugin */ -export function zodValidationPlugin({ +export function schemaValidationPlugin< + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +>({ validate, transform, sendDefaults, -}: Options): ZodiosPlugin { + typeProvider, +}: Options): ZodiosPlugin { return { - name: "zod-validation", + name: "schema-validation", request: shouldRequest(validate) - ? async (api, config) => { - const endpoint = findEndpoint(api, config.method, config.url); - if (!endpoint) { - throw new Error( - `No endpoint found for ${config.method} ${config.url}` - ); - } + ? async (endpoint, config) => { const { parameters } = endpoint; if (!parameters) { return config; @@ -49,16 +54,17 @@ export function zodValidationPlugin({ params: { ...config.params, }, + body: config.body, }; const paramsOf = { Query: (name: string) => conf.queries?.[name], - Body: (_: string) => conf.data, + Body: (_: string) => conf.body, Header: (name: string) => conf.headers?.[name], Path: (name: string) => conf.params?.[name], }; const setParamsOf = { Query: (name: string, value: any) => (conf.queries![name] = value), - Body: (_: string, value: any) => (conf.data = value), + Body: (_: string, value: any) => (conf.body = value), Header: (name: string, value: any) => (conf.headers![name] = value), Path: (name: string, value: any) => (conf.params![name] = value), }; @@ -67,7 +73,7 @@ export function zodValidationPlugin({ const { name, schema, type } = parameter; const value = paramsOf[type](name); if (sendDefaults || value !== undefined) { - const parsed = await schema.safeParseAsync(value); + const parsed = await typeProvider.validateAsync(schema, value); if (!parsed.success) { throw new ZodiosError( `Zodios: Invalid ${type} parameter '${name}'`, @@ -85,18 +91,18 @@ export function zodValidationPlugin({ } : undefined, response: shouldResponse(validate) - ? async (api, config, response) => { - const endpoint = findEndpoint(api, config.method, config.url); - /* istanbul ignore next */ - if (!endpoint) { - throw new Error( - `No endpoint found for ${config.method} ${config.url}` - ); - } + ? async (endpoint, config, response) => { if ( - response.headers?.["content-type"]?.includes("application/json") + typeof response.headers?.get === "function" + ? (response.headers.get("content-type") as string)?.includes?.( + "application/json" + ) + : response.headers?.["content-type"]?.includes?.( + "application/json" + ) ) { - const parsed = await endpoint.response.safeParseAsync( + const parsed = await typeProvider.validateAsync( + endpoint.response, response.data ); if (!parsed.success) { @@ -105,11 +111,9 @@ export function zodValidationPlugin({ endpoint.path }'\nstatus: ${response.status} ${ response.statusText - }\ncause:\n${parsed.error.message}\nreceived:\n${JSON.stringify( - response.data, - null, - 2 - )}`, + }\ncause:\n${ + parsed.error.message ?? JSON.stringify(parsed.error) + }\nreceived:\n${JSON.stringify(response.data, null, 2)}`, config, response.data, parsed.error diff --git a/packages/core/src/plugins/zodios-plugins.test.ts b/packages/core/src/plugins/zodios-plugins.test.ts new file mode 100644 index 00000000..6a3f6b5d --- /dev/null +++ b/packages/core/src/plugins/zodios-plugins.test.ts @@ -0,0 +1,89 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; +import { tsSchema } from "../type-providers"; +import { ZodiosEndpointDefinition, ZodiosPlugin } from "../zodios.types"; +import { ZodiosPlugins } from "./zodios-plugins"; + +const testEndpoint: ZodiosEndpointDefinition = { + method: "get", + path: "/test", + alias: "getTest", + response: tsSchema<{ test: string }>(), +}; + +describe("ZodiosPlugins", () => { + it("should be defined", () => { + expect(ZodiosPlugins).toBeDefined(); + }); + + it("should register one plugin", () => { + const plugins = new ZodiosPlugins(); + const plugin: ZodiosPlugin = { + request: async (endpoint, config) => config, + response: async (endpoint, config, response) => response, + }; + const id = plugins.use({}, plugin); + expect(id).toBe(0); + }); + + it("should unregister one plugin", () => { + const plugins = new ZodiosPlugins(); + const plugin: ZodiosPlugin = { + request: async (api, config) => config, + response: async (api, config, response) => response, + }; + const id = plugins.use({}, plugin); + plugins.eject(id); + // @ts-ignore + expect(plugins.plugins.filter((filter) => filter.plugin).length).toBe(0); + }); + + it("should execute response plugins consistently", async () => { + const plugins = new ZodiosPlugins(); + const plugin1: ZodiosPlugin = { + request: async (api, config) => config, + response: async (api, config, response) => { + response.data += "1"; + return response; + }, + }; + plugins.use({}, plugin1); + const plugin2: ZodiosPlugin = { + request: async (api, config) => config, + response: async (api, config, response) => { + response.data += "2"; + return response; + }, + }; + plugins.use({}, plugin2); + const response1 = await plugins.interceptResponse( + testEndpoint, + // @ts-ignore + {}, + Promise.resolve({ data: "test1:" }) + ); + expect(response1.data).toBe("test1:21"); + const response2 = await plugins.interceptResponse( + testEndpoint, + // @ts-ignore + {}, + Promise.resolve({ data: "test2:" }) + ); + expect(response2.data).toBe("test2:21"); + }); + + it('should catch error if plugin "error" is defined', async () => { + const plugins = new ZodiosPlugins(); + const plugin: ZodiosPlugin = { + request: async (api, config) => config, + error: async (api, config, error) => ({ test: true }), + }; + plugins.use({}, plugin); + const response = await plugins.interceptResponse( + testEndpoint, + // @ts-ignore + { method: "any", url: "any" }, + Promise.reject(new Error("test")) + ); + expect(response).toEqual({ test: true }); + }); +}); diff --git a/packages/core/src/plugins/zodios-plugins.ts b/packages/core/src/plugins/zodios-plugins.ts new file mode 100644 index 00000000..77877d82 --- /dev/null +++ b/packages/core/src/plugins/zodios-plugins.ts @@ -0,0 +1,149 @@ +import type { + AnyZodiosFetcherProvider, + TypeOfFetcherResponse, +} from "../fetcher-providers"; +import type { ReadonlyDeep } from "../utils.types"; +import type { + AnyZodiosRequestOptions, + ZodiosEndpointDefinition, + ZodiosPlugin, +} from "../zodios.types"; +import { + PluginId, + ZodiosPluginRegistration, + RequiredZodiosPluginRegistration, + ZodiosPluginFilters, + PluginPriority, + PLUGIN_PRIORITIES_REQUEST, + PLUGIN_PRIORITIES_RESPONSE, + PluginPriorities, +} from "./zodios-plugins.types"; + +const matchPluginFilter = ( + endpoint: ZodiosEndpointDefinition, + filters: ZodiosPluginFilters +) => { + return (Object.keys(filters) as (keyof ZodiosPluginFilters)[]).every( + (key) => { + const filter = filters[key]; + const endpointValue = endpoint[key]; + if (typeof filter === "string" && endpointValue) { + return filter === endpointValue; + } + if (filter instanceof RegExp && endpointValue) { + return filter.test(endpointValue); + } + if (typeof filter === "function") { + return filter(endpointValue ?? ""); + } + return filter === undefined; + } + ); +}; + +const isPluginFor = + ( + endpoint: ZodiosEndpointDefinition, + priority: PluginPriority, + type: "request" | "response" + ) => + ( + plugin: ZodiosPluginRegistration + ): plugin is RequiredZodiosPluginRegistration => { + return ( + plugin.priority === priority && + Boolean(plugin.plugin) && + Boolean( + type === "request" + ? plugin.plugin!.request + : plugin.plugin!.response || plugin.plugin!.error + ) && + matchPluginFilter(endpoint, plugin.filter) + ); + }; +export class ZodiosPlugins { + private plugins: Array> = []; + + constructor() {} + + /** + * register a plugin + * @param filter - how to match the plugin + * @param plugin - plugin to be registered + * @param priority - low, normal, high, default: normal + * @returns - plugin id to be used for ejecting + */ + use( + filter: ZodiosPluginFilters, + plugin: ZodiosPlugin, + priority: PluginPriority = PluginPriorities.normal + ): PluginId { + this.plugins.push({ + filter, + plugin, + priority, + }); + return this.plugins.length - 1; + } + eject(id: PluginId) { + this.plugins[id].plugin = undefined; + } + + /** + * intercept the request before it is sent to the server + * apply plugins in order of registration (internal plugins first) + * @param endpoint - endpoint definition + * @param config - request config + * @returns - modified request config + */ + async interceptRequest( + endpoint: ZodiosEndpointDefinition, + config: ReadonlyDeep> + ) { + let pluginConfig = config; + for (const priority of PLUGIN_PRIORITIES_REQUEST) { + for (const plugin of this.plugins.filter( + isPluginFor(endpoint, priority, "request") + )) { + pluginConfig = await plugin.plugin.request(endpoint, pluginConfig); + } + } + return pluginConfig; + } + + /** + * intercept the response before it is returned to the user + * apply plugins in reverse order of registration (user plugins first) + * @param endpoint - endpoint definition + * @param config - request config + * @param response - response promise from the server + * @returns - modified response promise + */ + async interceptResponse( + endpoint: ZodiosEndpointDefinition, + config: ReadonlyDeep>, + response: Promise> + ) { + let pluginResponse = response; + const plugins = [...this.plugins].reverse(); + + for (const priority of PLUGIN_PRIORITIES_RESPONSE) { + for (const plugin of plugins.filter( + isPluginFor(endpoint, priority, "response") + )) { + pluginResponse = pluginResponse.then( + Boolean(plugin.plugin.response) + ? (res) => plugin.plugin.response(endpoint, config, res) + : undefined, + Boolean(plugin.plugin.error) + ? (err) => { + console.log("plugin error", err); + return plugin.plugin.error(endpoint, config, err); + } + : undefined + ); + } + } + return pluginResponse; + } +} diff --git a/packages/core/src/plugins/zodios-plugins.types.ts b/packages/core/src/plugins/zodios-plugins.types.ts new file mode 100644 index 00000000..2b897e7c --- /dev/null +++ b/packages/core/src/plugins/zodios-plugins.types.ts @@ -0,0 +1,46 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; +import { ZodiosPlugin } from "../zodios.types"; + +export type PluginId = number; + +export const PluginPriorities = { + low: "low", + normal: "normal", + high: "high", +} as const; + +export const PLUGIN_PRIORITIES_REQUEST = [ + PluginPriorities.high, + PluginPriorities.normal, + PluginPriorities.low, +] as const; + +export const PLUGIN_PRIORITIES_RESPONSE = [ + PluginPriorities.low, + PluginPriorities.normal, + PluginPriorities.high, +] as const; + +export type PluginPriority = keyof typeof PluginPriorities; + +export type ZodiosPluginFilters = { + method?: string | RegExp | ((method: string) => boolean); + path?: string | RegExp | ((path: string) => boolean); + alias?: string | RegExp | ((alias: string) => boolean); +}; + +export type ZodiosPluginRegistration< + FetcherProvider extends AnyZodiosFetcherProvider +> = { + priority: PluginPriority; + filter: ZodiosPluginFilters; + plugin?: ZodiosPlugin; +}; + +export type RequiredZodiosPluginRegistration< + FetcherProvider extends AnyZodiosFetcherProvider +> = { + priority: PluginPriority; + filter: ZodiosPluginFilters; + plugin: Required>; +}; diff --git a/packages/core/src/type-providers/index.ts b/packages/core/src/type-providers/index.ts new file mode 100644 index 00000000..d10fe1c0 --- /dev/null +++ b/packages/core/src/type-providers/index.ts @@ -0,0 +1,4 @@ +export * from "./type-provider.types"; +export * from "./type-provider.zod"; +export * from "./type-provider.io-ts"; +export * from "./type-provider.typescript"; diff --git a/packages/core/src/type-providers/type-provider.io-ts.ts b/packages/core/src/type-providers/type-provider.io-ts.ts new file mode 100644 index 00000000..fd75c90d --- /dev/null +++ b/packages/core/src/type-providers/type-provider.io-ts.ts @@ -0,0 +1,25 @@ +import { + AnyZodiosTypeProvider, + ZodiosRuntimeTypeProvider, +} from "./type-provider.types"; + +export interface IoTsTypeProvider + extends AnyZodiosTypeProvider<{ _A: unknown; _O: unknown }> { + input: this["schema"]["_O"]; + output: this["schema"]["_A"]; +} + +export const ioTsTypeProvider: ZodiosRuntimeTypeProvider = { + validate: (schema, input) => { + const result = schema.decode(input); + return result._tag === "Right" + ? { success: true, data: result.right } + : { success: false, error: result.left }; + }, + validateAsync: async (schema, input) => { + const result = schema.decode(input); + return result._tag === "Right" + ? { success: true, data: result.right } + : { success: false, error: result.left }; + }, +}; diff --git a/packages/core/src/type-providers/type-provider.test.ts b/packages/core/src/type-providers/type-provider.test.ts new file mode 100644 index 00000000..23e9819e --- /dev/null +++ b/packages/core/src/type-providers/type-provider.test.ts @@ -0,0 +1,84 @@ +import { + ioTsTypeProvider, + zodTypeProvider, + tsTypeProvider, + tsSchema, + tsFnSchema, +} from "./index"; +import * as t from "io-ts"; +import z from "zod"; +import assert from "assert"; + +describe("type-provider", () => { + describe("io-ts", () => { + it("should validate", async () => { + const schema = t.type({ + name: t.string, + }); + const result = ioTsTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + const result2 = await ioTsTypeProvider.validateAsync(schema, { + name: "test", + }); + assert(result2.success); + expect(result2.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", async () => { + const schema = t.type({ + name: t.string, + }); + const result = ioTsTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + expect(result.error).toBeDefined(); + const result2 = await ioTsTypeProvider.validateAsync(schema, { + name: 2, + }); + assert(!result2.success); + expect(result2.error).toBeDefined(); + }); + describe("zod", () => { + it("should validate", () => { + const schema = z.object({ + name: z.string(), + }); + const result = zodTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", () => { + const schema = z.object({ + name: z.string(), + }); + const result = zodTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + expect(result.error).toBeDefined(); + }); + describe("ts", () => { + it("should validate", async () => { + const schema = tsSchema<{ name: string }>(); + const result = tsTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + const result2 = await tsTypeProvider.validateAsync(schema, { + name: "test", + }); + assert(result2.success); + expect(result2.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", () => { + const schema = tsFnSchema((data) => { + if (!data || typeof data !== "object") throw new Error("not an object"); + if (!("name" in data)) throw new Error("missing name"); + // @ts-ignore + const { name } = data; + if (typeof name !== "string") throw new Error("name is not a string"); + return data; + }); + const result = tsTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + }); +}); diff --git a/packages/core/src/type-providers/type-provider.types.ts b/packages/core/src/type-providers/type-provider.types.ts new file mode 100644 index 00000000..8a7b9e14 --- /dev/null +++ b/packages/core/src/type-providers/type-provider.types.ts @@ -0,0 +1,27 @@ +export interface AnyZodiosTypeProvider { + schema: Schema; + input: unknown; + output: unknown; +} + +export type InferInputTypeFromSchema< + TypeProvider extends AnyZodiosTypeProvider, + Schema +> = (TypeProvider & { schema: Schema })["input"]; + +export type InferOutputTypeFromSchema< + TypeProvider extends AnyZodiosTypeProvider, + Schema +> = (TypeProvider & { schema: Schema })["output"]; + +export type ZodiosValidateResult = + | { success: true; data: any } + | { success: false; error: any }; + +export interface ZodiosRuntimeTypeProvider< + TypeProvider extends AnyZodiosTypeProvider +> { + readonly _provider?: TypeProvider; + validate: (schema: any, input: unknown) => ZodiosValidateResult; + validateAsync: (schema: any, input: unknown) => Promise; +} diff --git a/packages/core/src/type-providers/type-provider.typescript.ts b/packages/core/src/type-providers/type-provider.typescript.ts new file mode 100644 index 00000000..5116ee36 --- /dev/null +++ b/packages/core/src/type-providers/type-provider.typescript.ts @@ -0,0 +1,62 @@ +import { + AnyZodiosTypeProvider, + ZodiosRuntimeTypeProvider, + ZodiosValidateResult, +} from "./type-provider.types"; + +const genericTsSchema = { + parse: (data: unknown): ZodiosValidateResult => ({ + success: true, + data, + }), +}; + +type TsSchema = { + readonly _schema: Schema; + parse: (input: unknown) => ZodiosValidateResult; +}; + +/** + * A basic typescript schema provider that does not do any validation but provides type inference + * @returns - a schema that can be used with the `tsTypeProvider` + */ +export const tsSchema = (): TsSchema => genericTsSchema as any; +/** + * An advanced typescript schema provider where the schema is inferred from the + * output type of the throwing validation function + * @param throwingValidator - a function that throws if the input is invalid and returns the output type if the input is valid + * @returns - a schema that can be used with the `tsTypeProvider` + */ +export const tsFnSchema = ( + throwingValidator: (data: unknown) => Schema +): TsSchema => ({ + _schema: undefined as Schema, + parse: (data: unknown): ZodiosValidateResult => { + try { + return { + success: true, + data: throwingValidator(data), + }; + } catch (error) { + return { + success: false, + error, + }; + } + }, +}); + +export interface TsTypeProvider + extends AnyZodiosTypeProvider<{ _schema: unknown }> { + input: this["schema"]["_schema"]; + output: this["schema"]["_schema"]; +} + +/** + * A native typescript type provider + * to use with the `tsSchema` and `tsFnSchema` functions + */ +export const tsTypeProvider: ZodiosRuntimeTypeProvider = { + validate: (schema, input) => schema.parse(input), + validateAsync: (schema, input) => schema.parse(input), +}; diff --git a/packages/core/src/type-providers/type-provider.zod.ts b/packages/core/src/type-providers/type-provider.zod.ts new file mode 100644 index 00000000..447a3d81 --- /dev/null +++ b/packages/core/src/type-providers/type-provider.zod.ts @@ -0,0 +1,15 @@ +import { + AnyZodiosTypeProvider, + ZodiosRuntimeTypeProvider, +} from "./type-provider.types"; + +export interface ZodTypeProvider + extends AnyZodiosTypeProvider<{ _input: unknown; _output: unknown }> { + input: this["schema"]["_input"]; + output: this["schema"]["_output"]; +} + +export const zodTypeProvider: ZodiosRuntimeTypeProvider = { + validate: (schema, input) => schema.safeParse(input), + validateAsync: (schema, input) => schema.safeParseAsync(input), +}; diff --git a/src/utils.test.ts b/packages/core/src/utils.test.ts similarity index 100% rename from src/utils.test.ts rename to packages/core/src/utils.test.ts diff --git a/src/utils.ts b/packages/core/src/utils.ts similarity index 69% rename from src/utils.ts rename to packages/core/src/utils.ts index 310fb1e3..2ab75e59 100644 --- a/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,10 +1,4 @@ -import { AxiosError } from "axios"; -import { ReadonlyDeep } from "./utils.types"; -import { - AnyZodiosRequestOptions, - ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, -} from "./zodios.types"; +import type { ZodiosEndpointDefinition } from "./zodios.types"; /** * omit properties from an object @@ -42,32 +36,8 @@ export function pick( return ret; } -/** - * set first letter of a string to uppercase - * @param str - the string to capitalize - * @returns - the string with the first letter uppercased - */ -export function capitalize(str: T): Capitalize { - return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize; -} - -const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; - -export function replacePathParams( - config: ReadonlyDeep -) { - let result: string = config.url; - const params = config.params; - if (params) { - result = result.replace(paramsRegExp, (match, key) => - key in params ? `${params[key]}` : match - ); - } - return result; -} - export function findEndpoint( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], method: string, path: string ) { @@ -75,15 +45,23 @@ export function findEndpoint( } export function findEndpointByAlias( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], alias: string ) { return api.find((e) => e.alias === alias); } +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function pathMatchesUrl(path: string, url: string) { + return new RegExp(`^${path.replace(paramsRegExp, () => "([^/]*)")}$`).test( + url + ); +} + export function findEndpointErrors( endpoint: ZodiosEndpointDefinition, - err: AxiosError + err: any ) { const matchingErrors = endpoint.errors?.filter( (error) => error.status === err.response!.status @@ -93,10 +71,10 @@ export function findEndpointErrors( } export function findEndpointErrorsByPath( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], method: string, path: string, - err: AxiosError + err: any ) { const endpoint = findEndpoint(api, method, path); return endpoint && @@ -109,11 +87,13 @@ export function findEndpointErrorsByPath( } export function findEndpointErrorsByAlias( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], alias: string, - err: AxiosError + err: any ) { const endpoint = findEndpointByAlias(api, alias); + console.log("For Alias: ", alias); + console.log("Found Endpoint: ", endpoint); return endpoint && err.config && @@ -123,9 +103,3 @@ export function findEndpointErrorsByAlias( ? findEndpointErrors(endpoint, err) : undefined; } - -export function pathMatchesUrl(path: string, url: string) { - return new RegExp(`^${path.replace(paramsRegExp, () => "([^/]*)")}$`).test( - url - ); -} diff --git a/src/utils.types.test.ts b/packages/core/src/utils.types.test.ts similarity index 100% rename from src/utils.types.test.ts rename to packages/core/src/utils.types.test.ts diff --git a/src/utils.types.ts b/packages/core/src/utils.types.ts similarity index 75% rename from src/utils.types.ts rename to packages/core/src/utils.types.ts index cab8e5ab..313bba4a 100644 --- a/src/utils.types.ts +++ b/packages/core/src/utils.types.ts @@ -1,5 +1,3 @@ -import { z, ZodType } from "zod"; - /** * filter an array type by a predicate value * @param T - array type @@ -7,15 +5,38 @@ import { z, ZodType } from "zod"; * @details - this is using tail recursion type optimization from typescript 4.5 */ export type FilterArrayByValue< - T extends unknown[] | undefined, + T extends readonly unknown[] | unknown[] | undefined, C, Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends C + ? FilterArrayByValue + : FilterArrayByValue + : T extends [infer Head, ...infer Tail] ? Head extends C ? FilterArrayByValue : FilterArrayByValue : Acc; +/** + * find the first value in an array type that matches a predicate + * @param T - array type + * @param C - predicate object to match + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type ArrayFindByValue< + T extends readonly unknown[] | unknown[] | undefined, + C +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends C + ? Head + : ArrayFindByValue + : T extends [infer Head, ...infer Tail] + ? Head extends C + ? Head + : ArrayFindByValue + : never; + /** * filter an array type by key * @param T - array type @@ -23,10 +44,14 @@ export type FilterArrayByValue< * @details - this is using tail recursion type optimization from typescript 4.5 */ export type FilterArrayByKey< - T extends unknown[], + T extends readonly unknown[] | unknown[], K extends string, Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends { [Key in K]: unknown } + ? FilterArrayByKey + : FilterArrayByKey + : T extends [infer Head, ...infer Tail] ? Head extends { [Key in K]: unknown } ? FilterArrayByKey : FilterArrayByKey @@ -38,34 +63,18 @@ export type FilterArrayByKey< * @details - this is using tail recursion type optimization from typescript 4.5 */ export type DefinedArray< - T extends unknown[], + T extends readonly unknown[] | unknown[], Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends undefined + ? DefinedArray + : DefinedArray + : T extends [infer Head, ...infer Tail] ? Head extends undefined ? DefinedArray : DefinedArray : Acc; -type Try = A extends B ? A : C; - -type NarrowRaw = - | (T extends Function ? T : never) - | (T extends string | number | bigint | boolean ? T : never) - | (T extends [] ? [] : never) - | { - [K in keyof T]: K extends "description" ? T[K] : NarrowNotZod; - }; - -type NarrowNotZod = Try>; - -/** - * Utility to infer the embedded primitive type of any type - * Same as `as const` but without setting the object as readonly and without needing the user to use it - * @param T - type to infer the embedded type of - * @see - thank you tannerlinsley for this idea - */ -export type Narrow = Try>; - /** * merge all union types into a single type * @param T - union type @@ -169,22 +178,13 @@ export type UndefinedIfEmpty = IfEquals; export type UndefinedIfNever = IfEquals; -type RequiredChildProps = { - [K in keyof T]: IfEquals, never, K>; -}[keyof T]; - -export type OptionalChildProps = { - [K in keyof T]: IfEquals, K, never>; -}[keyof T]; - /** * set properties to optional if their child properties are optional * @param T - object type */ -export type SetPropsOptionalIfChildrenAreOptional = Merge< - Pick, OptionalChildProps>, - Pick> ->; +export type TransitiveOptional = UndefinedToOptional<{ + [k in keyof T]: RequiredKeys extends never ? T[k] | undefined : T[k]; +}>; /** * transform an array type into a readonly array type @@ -214,39 +214,6 @@ export type ReadonlyDeep = T extends (infer R)[] export type MaybeReadonly = T | ReadonlyDeep; -/** - * Map a type an api description parameter to a zod infer type - * @param T - array of api description parameters - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type MapSchemaParameters< - T, - Frontend extends boolean = true, - Acc = {} -> = T extends [infer Head, ...infer Tail] - ? Head extends { - name: infer Name; - schema: infer Schema; - } - ? Name extends string - ? MapSchemaParameters< - Tail, - Frontend, - Merge< - { - [Key in Name]: Schema extends z.ZodType - ? Frontend extends true - ? z.input - : z.output - : never; - }, - Acc - > - > - : Acc - : Acc - : Acc; - /** * get all parameters from an API path * @param Path - API path diff --git a/src/zodios-error.ts b/packages/core/src/zodios-error.ts similarity index 58% rename from src/zodios-error.ts rename to packages/core/src/zodios-error.ts index 3741b535..1e86deed 100644 --- a/src/zodios-error.ts +++ b/packages/core/src/zodios-error.ts @@ -1,5 +1,6 @@ -import { ReadonlyDeep } from "./utils.types"; -import { AnyZodiosRequestOptions } from "./zodios.types"; +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; +import type { ReadonlyDeep, DeepReadonlyObject } from "./utils.types"; +import type { AnyZodiosRequestOptions } from "./zodios.types"; /** * Custom Zodios Error with additional information @@ -11,7 +12,9 @@ import { AnyZodiosRequestOptions } from "./zodios.types"; export class ZodiosError extends Error { constructor( message: string, - public readonly config?: ReadonlyDeep, + public readonly config?: ReadonlyDeep< + AnyZodiosRequestOptions + >, public readonly data?: unknown, public readonly cause?: Error ) { diff --git a/packages/core/src/zodios-request.test.ts b/packages/core/src/zodios-request.test.ts new file mode 100644 index 00000000..50894823 --- /dev/null +++ b/packages/core/src/zodios-request.test.ts @@ -0,0 +1,206 @@ +import { z } from "zod"; +import { makeApi, ZodiosCore } from "./index"; +import { Assert } from "./utils.types"; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "post", + path: "/users/search", + alias: "searchUsers", + description: "Search users", + immutable: true, + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + page: z.number().positive().optional(), + limit: z.number().positive().optional(), + }), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/address/:address", + alias: "getUserAddress", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "put", + path: "/users", + alias: "updateUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "patch", + path: "/users", + alias: "patchUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + response: z.object({ + id: z.number(), + }), + }, + { + method: "get", + path: "/users/:id/error", + alias: "getUserError", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/cancel", + alias: "getUserCancel", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); +const core = new ZodiosCore(api); + +describe("ZodiosCore request", () => { + it("should return only one response type for get request", async () => { + const req = () => + core.request({ + method: "get", + url: "/users", + }); + type Req = typeof req; + const testResult: Assert< + ReturnType, + Promise<{ + nextPage?: number | undefined; + page: number; + count: number; + users: { + name: string; + id: number; + }[]; + }> + > = true; + }); + + it("should return only one response type for post request", async () => { + const core = new ZodiosCore(api); + + const req = () => + core.request({ + method: "post", + url: "/users", + body: { + name: "John", + }, + }); + type Req = typeof req; + const testResult: Assert< + ReturnType, + Promise<{ name: string; id: number }> + > = true; + }); +}); diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts new file mode 100644 index 00000000..46d72fa8 --- /dev/null +++ b/packages/core/src/zodios.test.ts @@ -0,0 +1,1486 @@ +import { z, ZodError } from "zod"; + +//Mock form data +globalThis.FormData = class FormData { + data = new Map(); + append(name: string, value: string | Blob, fileName?: string): void { + this.data.set(name, `${value}`); + } + delete(name: string): void { + this.data.delete(name); + } + get(name: string): string | File | null { + return this.data.get(name) || null; + } + getAll(name: string): (string | File)[] { + return this.data.has(name) ? [this.data.get(name)!] : []; + } + has(name: string): boolean { + return this.data.has(name); + } + set(name: string, value: string | Blob, fileName?: string): void { + if (typeof value === "string") { + this.data.set(name, value); + } + } + forEach( + callbackfn: (value: string | File, key: string, parent: FormData) => void, + thisArg?: any + ): void { + this.data.forEach((value, key) => callbackfn(value, key, this)); + } +}; + +import { + ZodiosCore, + ZodiosError, + apiBuilder, + makeApi, + makeParameters, + ApiOf, + ZodTypeProvider, +} from "./index"; + +import type { Assert } from "./utils.types"; +import { + FindZodiosEndpointDefinitionByPath, + ZodiosMatchingErrorsByPath, +} from "./zodios.types"; +import { + zodiosMocks, + MockProvider, + mockFetchFactory, +} from "./fetcher-providers/mock-provider"; + +describe("Zodios", () => { + beforeAll(async () => { + zodiosMocks.install(); + zodiosMocks.mockRequest("get", "/token", async (conf) => ({ + data: { + token: conf.headers!.authorization, + }, + })); + zodiosMocks.mockRequest("post", "/token", async (conf) => ({ + data: { + token: conf.headers!.authorization, + }, + })); + zodiosMocks.mockRequest("get", "/error401", async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + })); + zodiosMocks.mockRequest("get", "/error/:id/error401", async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + })); + zodiosMocks.mockRequest( + "get", + "/error/:id/error401/:message", + async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + }) + ); + zodiosMocks.mockRequest("get", "/error502", async (conf) => ({ + status: 502, + statusText: "Bad Gateway", + data: { + error: { + message: "bad gateway", + }, + }, + })); + zodiosMocks.mockRequest("get", "/queries", async (conf) => ({ + data: { + queries: conf.queries!.id, + }, + })); + zodiosMocks.mockRequest("get", "/:id", async (conf) => ({ + data: { + id: conf.params!.id, + name: "test", + }, + headers: { + "content-type": "application/json", + }, + })); + zodiosMocks.mockRequest("get", "/path/:uuid", async (config) => ({ + data: { + uuid: config.params!.uuid, + }, + })); + zodiosMocks.mockRequest("get", "/:id/address/:address", async (config) => ({ + data: { + id: config.params!.id, + address: config.params!.address, + }, + })); + zodiosMocks.mockRequest("post", "/", async (config) => ({ + data: { + id: 3, + // @ts-ignore + name: config.body.name, // @ts-ignore + }, + })); + zodiosMocks.mockRequest("put", "/", async (config) => ({ + data: { + // @ts-ignore + id: config.body.id, + // @ts-ignore + name: config.body.name, + }, + })); + zodiosMocks.mockRequest("patch", "/", async (config) => ({ + data: { + // @ts-ignore + id: config.body.id, + // @ts-ignore + name: config.body.name, + }, + })); + zodiosMocks.mockRequest("delete", "/:id", async (config) => ({ + data: { + id: config.params!.id, + }, + })); + zodiosMocks.mockRequest("post", "/form-data", async (config) => { + const data = {}; + (config.body as FormData).forEach((value, key) => { + // @ts-ignore + data[key] = value; + }); + return { + data, + }; + }); + zodiosMocks.mockRequest("post", "/form-url", async (config) => { + const data = {}; + const url = new URLSearchParams(config.body as string); + for (const [key, value] of url) { + // @ts-ignore + data[key] = value; + } + return { + data, + }; + }); + zodiosMocks.mockRequest("post", "/text", async (config) => ({ + headers: { + "content-type": "text/plain", + }, + data: config.body, + })); + }); + + afterAll(() => { + zodiosMocks.uninstall(); + }); + + it("should be defined", () => { + expect(ZodiosCore).toBeDefined(); + }); + + it("should throw if baseUrl is not provided", () => { + // @ts-ignore + expect(() => new ZodiosCore(undefined, [])).toThrowError( + "Zodios: missing base url" + ); + }); + + it("should throw if api is not provided", () => { + // @ts-ignore + expect(() => new ZodiosCore()).toThrowError( + "Zodios: missing api description" + ); + }); + + it("should throw if api is not an array", () => { + // @ts-ignore + expect(() => new ZodiosCore({})).toThrowError( + "Zodios: api must be an array" + ); + }); + + it("should create a new instance of Zodios", () => { + const zodios = new ZodiosCore(`http://localhost`, []); + expect(zodios).toBeDefined(); + }); + it("should create a new instance when providing an api", () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should should throw with duplicate api endpoints", () => { + expect( + () => + new ZodiosCore(`http://localhost`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /:id'"); + }); + + it("should create a new instance whithout base URL", () => { + const zodios = new ZodiosCore([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should register have validation plugin automatically installed", () => { + const zodios = new ZodiosCore(`http://localhost`, []); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(1); + }); + + it("should register a plugin", () => { + const zodios = new ZodiosCore(`http://localhost`, []); + zodios.use({ + request: async (_, config) => config, + }); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); + }); + + it("should unregister a plugin", () => { + const zodios = new ZodiosCore(`http://localhost`, []); + const id = zodios.use({ + request: async (_, config) => config, + }); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); + zodios.eject(id); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(1); + }); + + it("should throw if invalide parameters when registering a plugin", () => { + const zodios = new ZodiosCore(`http://localhost`, []); + // @ts-expect-error + expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); + }); + + it("should register a plugin by endpoint", () => { + const api = makeApi([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("get", "/:id", { + request: async (_, config) => config, + }); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); + }); + + it("should register a plugin by alias", () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + path: "/:id", + alias: "test", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("test", { + request: async (_, config) => config, + }); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); + }); + + it("should make an http request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.request({ + // ^? + method: "get", + url: "/:id", + params: { id: 7 }, + }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http get with standard query arrays", async () => { + const api = makeApi([ + { + method: "get", + path: "/queries", + parameters: makeParameters([ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ]), + response: z.object({ + queries: z.array(z.string()), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/queries", + parameters: [ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ], + response: z.object({ + queries: z.array(z.string()), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); + expect(response).toEqual({ queries: [1, 2] }); + }); + + it("should make an http get with one path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.get("/:id", { params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http alias request with one path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.getById({ params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should work with api builder", async () => { + const api = apiBuilder({ + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }).build(); + const zodios = new ZodiosCore(`http://localhost`, api, { + fetcherFactory: mockFetchFactory, + }); + const response = await zodios.getById({ params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make a get request with bad params and get back a zod error", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + try { + await zodios.get("/:id", { params: { id: "7" as unknown as number } }); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + } + }); + + it("should make an http get with multiples path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id/address/:address", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.get("/:id/address/:address", { + params: { id: 7, address: "address" }, + }); + const testResonseType: Assert< + typeof response, + { id: number; address: string } + > = true; + + expect(response).toEqual({ id: 7, address: "address" }); + }); + + it("should make an http post with body param", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.post("/", { body: { name: "post" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http post with transformed body param", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + firstname: z.string(), + lastname: z.string(), + }) + .transform((data) => ({ + name: `${data.firstname} ${data.lastname}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const config = { + body: { firstname: "post", lastname: "test" }, + } as const; + const response = await zodios.post("/", config); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + + expect(config).toEqual({ + body: { firstname: "post", lastname: "test" }, + }); + expect(response).toEqual({ id: 3, name: "post test" }); + }); + + it("should throw a zodios error if params are not correct", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + email: z.string().email(), + }) + .transform((data) => ({ + name: `${data.email.split("@")[0]}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let response; + let error: ZodiosError | undefined; + try { + response = await zodios.post("/", { + body: { + email: "post", + }, + }); + } catch (err) { + error = err as ZodiosError; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect(error!.cause).toBeInstanceOf(ZodError); + expect(error!.message).toBe("Zodios: Invalid Body parameter 'name'"); + }); + + it("should make an http mutation alias request with body param", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + alias: "create", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.create({ body: { name: "post" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http put", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "put", + path: "/", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http put alias", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "put", + path: "/", + alias: "update", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.update({ body: { id: 5, name: "put" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http patch", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "patch", + path: "/", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http patch alias", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "patch", + path: "/", + alias: "update", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http delete", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "delete", + path: "/:id", + response: z.object({ + id: z.number(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.delete("/:id", { + params: { id: 6 }, + }); + const testResonseType: Assert = true; + expect(response).toEqual({ id: 6 }); + }); + + it("should make an http delete alias", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "delete", + path: "/:id", + alias: "remove", + response: z.object({ + id: z.number(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.remove({ + params: { id: 6 }, + }); + const testResonseType: Assert = true; + expect(response).toEqual({ id: 6 }); + }); + + it("should validate uuid in path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1d-3967-4518-bc89-75a901aee128" }, + }); + const testResonseType: Assert = true; + expect(response).toEqual({ + uuid: "e9e09a1d-3967-4518-bc89-75a901aee128", + }); + }); + + it("should not validate bad path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let error; + try { + await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1-3967-4518-bc89-75a901aee128" }, + }); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toBe( + "Zodios: Invalid Path parameter 'uuid'" + ); + }); + + it("should not validate bad formatted responses", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let error: Error | undefined = undefined; + try { + await zodios.get("/:id", { params: { id: 1 } }); + } catch (e) { + error = e as Error; + } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toMatchSnapshot(); + expect((error as ZodiosError).data).toEqual({ + id: 1, + name: "test", + }); + expect((error as ZodiosError).config).toEqual({ + method: "get", + url: "/:id", + params: { id: 1 }, + }); + }); + + it("should match Expected error", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), + }), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), + }), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), + }), + }, + ], + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + type Test = ZodiosMatchingErrorsByPath< + ApiOf, + "get", + "/error502", + MockProvider, + ZodTypeProvider + >; + type Test2 = FindZodiosEndpointDefinitionByPath< + ApiOf, + "get", + "/error502" + >["errors"]; + + expect(error).toBeInstanceOf(Error); + // @ts-ignore + expect(error.response?.status).toBe(502); + if (zodios.isErrorFromPath("get", "/error502", error)) { + expect(error.response.status).toBe(502); + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + if (zodios.isErrorFromAlias("getError502", error)) { + expect(error.response.status).toBe(502); + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + }); + + it("should match error with params", async () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + alias: "getError401", + path: "/error/:id/error401", + response: z.void(), + errors: [ + { + status: 401, + schema: z.object({}), + }, + ], + }, + { + method: "get", + alias: "getError404", + path: "/error/:id/error404", + response: z.void(), + errors: [ + { + status: 404, + schema: z.object({}), + }, + ], + }, + ]); + + const params = { + id: "test", + }; + + let error; + try { + await zodios.getError401({ params }); + } catch (e) { + error = e; + console.log("Match Error params", e); + } + + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); + + expect(zodios.isErrorFromPath("get", "/error/:id/error401", error)).toBe( + true + ); + expect(zodios.isErrorFromPath("get", "/error/:id/error404", error)).toBe( + false + ); + }); + + it("should match error with empty params", async () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + alias: "getError401", + path: "/error/:id/error401", + response: z.void(), + errors: [ + { + status: 401, + schema: z.object({}), + }, + ], + }, + { + method: "get", + alias: "getError404", + path: "/error/:id/error404", + response: z.void(), + errors: [ + { + status: 404, + schema: z.object({}), + }, + ], + }, + ]); + + const params = { + id: "", + }; + + let error; + try { + await zodios.getError401({ params }); + } catch (e) { + error = e; + } + + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); + + expect(zodios.isErrorFromPath("get", "/error/:id/error401", error)).toBe( + true + ); + expect(zodios.isErrorFromPath("get", "/error/:id/error404", error)).toBe( + false + ); + }); + + it("should match error with optional params at the end", async () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + alias: "getError401", + path: "/error/:id/error401/:message", + response: z.void(), + errors: [ + { + status: 401, + schema: z.object({}), + }, + ], + }, + { + method: "get", + alias: "getError404", + path: "/error/:id/error404/:message", + response: z.void(), + errors: [ + { + status: 404, + schema: z.object({}), + }, + ], + }, + ]); + + const params = { + id: "test", + message: "", + }; + + let error; + try { + await zodios.getError401({ params }); + } catch (e) { + error = e; + } + + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); + + expect( + zodios.isErrorFromPath("get", "/error/:id/error401/:message", error) + ).toBe(true); + expect( + zodios.isErrorFromPath("get", "/error/:id/error404/:message", error) + ).toBe(false); + }); + + it("should match Unexpected error", async () => { + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + + expect(error).toBeInstanceOf(Error); + // @ts-ignore + expect(error.response?.status).toBe(502); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); + }); + + it("should return response when disabling validation", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { validate: false, fetcherFactory: mockFetchFactory } + ); + const response = await zodios.get("/:id", { params: { id: 1 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string; more: string } + > = true; + expect(response).toEqual({ + id: 1, + name: "test", + }); + }); + + it("should trigger an error with error response", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/error502", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + try { + await zodios.get("/error502"); + } catch (e) { + // @ts-ignore + expect(e.response?.data).toEqual({ + error: { + message: "bad gateway", + }, + }); + } + }); + + it("should send a form data request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); + const testResonseType: Assert< + typeof response, + { id: string; name: string } + > = true; + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form data request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-data", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: multipart/form-data body must be an object" + ); + }); + + it("should send a form url request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); + const testResonseType: Assert< + typeof response, + { id: string; name: string } + > = true; + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form url request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-url", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: application/x-www-form-urlencoded body must be an object" + ); + }); + + it("should send a text request", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/text", + requestFormat: "text", + parameters: [ + { + name: "body", + type: "Body", + schema: z.string(), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.post("/text", { body: "test" }); + const testResonseType: Assert = true; + expect(response).toEqual("test"); + }); +}); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts new file mode 100644 index 00000000..eca0ff60 --- /dev/null +++ b/packages/core/src/zodios.ts @@ -0,0 +1,498 @@ +import type { + AnyZodiosRequestOptions, + ZodiosRequestOptions, + Method, + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosOptions, + ZodiosEndpointDefinition, + ZodiosAliases, + ZodiosPlugin, + Aliases, + ZodiosEndpointError, + ZodiosMatchingErrorsByPath, + ZodiosMatchingErrorsByAlias, + ZodiosVerbs, +} from "./zodios.types"; +import { HTTP_METHODS } from "./zodios.types"; +import { + ZodiosPlugins, + schemaValidationPlugin, + formDataPlugin, + formURLPlugin, + headerPlugin, +} from "./plugins"; +import type { PickRequired, ReadonlyDeep } from "./utils.types"; +import { checkApi } from "./api"; +import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; +import { zodTypeProvider } from "./type-providers"; +import { + AnyZodiosFetcherProvider, + TypeOfFetcherOptions, + ZodiosFetcher, +} from "./fetcher-providers"; +import { + findEndpoint, + findEndpointErrorsByAlias, + findEndpointErrorsByPath, +} from "./utils"; +import { hooks } from "./hooks"; +import { + PluginPriority, + ZodiosPluginFilters, + PluginId, + PluginPriorities, +} from "./plugins/zodios-plugins.types"; + +export interface ZodiosBase< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> { + readonly api: Api; + readonly _typeProvider: TypeProvider; + readonly _fetcherProvider: FetcherProvider; +} + +/** + * zodios api client + */ +export class ZodiosCoreImpl< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> implements ZodiosBase +{ + public readonly options: PickRequired< + ZodiosOptions, + "validate" | "transform" | "sendDefaults" | "typeProvider" + >; + public readonly api: Api; + public readonly fetcher: ZodiosFetcher | undefined; + public readonly _typeProvider: TypeProvider; + public readonly _fetcherProvider: FetcherProvider; + private plugins = new ZodiosPlugins(); + + /** + * constructor + * @param baseURL - the base url to use - if omited will use the browser domain + * @param api - the description of all the api endpoints + * @param options - the options to setup the client API + * @example + * const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + * { + * method: "get", + * path: "/users", + * description: "Get all users", + * parameters: [ + * { + * name: "q", + * type: "Query", + * schema: z.string(), + * }, + * { + * name: "page", + * type: "Query", + * schema: z.string().optional(), + * }, + * ], + * response: z.array(z.object({ id: z.number(), name: z.string() })), + * } + * ]); + */ + constructor( + api: Api, + options?: ZodiosOptions & + TypeOfFetcherOptions + ); + constructor( + baseUrl: string, + api: Api, + options?: ZodiosOptions & + TypeOfFetcherOptions + ); + constructor( + arg1?: Api | string, + arg2?: + | Api + | (ZodiosOptions & + TypeOfFetcherOptions), + arg3?: ZodiosOptions & + TypeOfFetcherOptions + ) { + let options: ZodiosOptions & + TypeOfFetcherOptions; + if (!arg1) { + if (Array.isArray(arg2)) { + throw new Error("Zodios: missing base url"); + } + throw new Error("Zodios: missing api description"); + } + let baseURL: string | undefined; + if (typeof arg1 === "string" && Array.isArray(arg2)) { + baseURL = arg1; + this.api = arg2 as any; + options = arg3 || {}; + } else if (Array.isArray(arg1) && !Array.isArray(arg2)) { + this.api = arg1 as any; + options = arg2 || {}; + } else { + throw new Error("Zodios: api must be an array"); + } + + checkApi(this.api); + + this.options = { + validate: true, + transform: true, + sendDefaults: false, + typeProvider: zodTypeProvider as any, + ...options, + }; + this._typeProvider = undefined as any; + this._fetcherProvider = undefined as any; + + this.fetcher = this.options.fetcherFactory?.({ + baseURL, + ...this.options, + } as any); + + this.injectAliasEndpoints(); + this.injectHttpVerbEndpoints(); + this.initPlugins(); + if ([true, "all", "request", "response"].includes(this.options.validate)) { + this.use(schemaValidationPlugin(this.options), PluginPriorities.high); + } + } + + public get typeProvider() { + return this.options.typeProvider; + } + + private initPlugins() { + this.api.forEach((endpoint) => { + switch (endpoint.requestFormat) { + case "binary": + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + headerPlugin( + "Content-Type", + "application/octet-stream" + ) + ); + break; + case "form-data": + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + formDataPlugin() + ); + break; + case "form-url": + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + formURLPlugin() + ); + break; + case "text": + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + headerPlugin("Content-Type", "text/plain") + ); + break; + } + }); + } + + /** + * register a plugin to intercept the requests or responses + * @param plugin - the plugin to use + * @returns an id to allow you to unregister the plugin + */ + use( + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; + use>( + alias: Alias, + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; + use>( + method: M, + path: Path, + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; + use( + filter: ZodiosPluginFilters, + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; + use( + arg0: ZodiosPlugin | ZodiosPluginFilters | string, + arg1?: ZodiosPlugin | string, + arg2?: ZodiosPlugin | PluginPriority, + arg3?: PluginPriority + ) { + if (typeof arg0 === "object") { + if ("method" in arg0 || "path" in arg0 || "alias" in arg0) { + return this.plugins.use( + arg0, + arg1 as ZodiosPlugin, + arg2 as PluginPriority + ); + } + return this.plugins.use( + {}, + arg0 as ZodiosPlugin, + arg1 as PluginPriority + ); + } + if (typeof arg0 === "string" && typeof arg1 === "object") { + return this.plugins.use( + { alias: arg0 }, + arg1 as ZodiosPlugin, + arg2 as PluginPriority + ); + } + if ( + typeof arg0 === "string" && + typeof arg1 === "string" && + typeof arg2 === "object" + ) { + return this.plugins.use( + { method: arg0, path: arg1 }, + arg2 as ZodiosPlugin, + arg3 as PluginPriority + ); + } + + throw new Error("Zodios: invalid plugin registration"); + } + + /** + * unregister a plugin + * if the plugin name is provided instead of the registration plugin id, + * it will unregister the plugin with that name only for non endpoint plugins + * @param plugin - id of the plugin to remove + */ + eject(plugin: PluginId): void { + this.plugins.eject(plugin); + } + + private injectAliasEndpoints() { + this.api.forEach((endpoint) => { + if (endpoint.alias) { + (this as any)[endpoint.alias] = (config: any) => + this.request({ + ...config, + method: endpoint.method, + url: endpoint.path, + }); + } + }); + } + + private injectHttpVerbEndpoints() { + HTTP_METHODS.forEach((method) => { + (this as any)[method] = (path: string, config: any) => + this.request({ + ...config, + method, + url: path, + }); + }); + } + + /** + * make a request to the api + * @param config - the config to setup zodios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async request( + config: Path extends ZodiosPathsByMethod + ? ReadonlyDeep< + ZodiosRequestOptions< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > + > + : ReadonlyDeep< + ZodiosRequestOptions< + Api, + M, + ZodiosPathsByMethod, + FetcherProvider, + true, + TypeProvider + > + > + ): Promise< + ZodiosResponseByPath< + Api, + M, + Path extends ZodiosPathsByMethod ? Path : never, + true, + TypeProvider + > + > { + let conf = config as unknown as ReadonlyDeep< + AnyZodiosRequestOptions + >; + const endpoint = findEndpoint(this.api, conf.method, conf.url); + if (!endpoint) { + throw new Error( + `Zodios: no endpoint found for ${conf.method} ${conf.url}` + ); + } + conf = await this.plugins.interceptRequest(endpoint, conf); + let response: Promise; + if (hooks.fetcher) { + response = hooks.fetcher.fetch(conf); + } else if (this.fetcher) { + response = this.fetcher.fetch(conf); + } else { + throw new Error("Zodios: no fetcher provider found"); + } + response = this.plugins.interceptResponse(endpoint, conf, response); + return (await response).data; + } + + private isDefinedError( + error: unknown, + findEndpointErrors: (error: unknown) => ZodiosEndpointError[] | undefined + ): boolean { + if (error && typeof error === "object" && "response" in error) { + const response = error.response; + if (response && typeof response === "object" && "data" in response) { + const endpointErrors = findEndpointErrors(error); + if (endpointErrors) { + return endpointErrors.some( + (desc) => + this.options.typeProvider.validate(desc.schema, response.data) + .success + ); + } + } + } + return false; + } + + /** + * check if the error is matching the endpoint errors definitions + * @param api - the api definition + * @param method - http method of the endpoint + * @param path - path of the endpoint + * @param error - the error to check + * @returns - if true, the error type is narrowed to the matching endpoint errors + */ + isErrorFromPath>( + method: M, + path: Path, + error: unknown + ): error is ZodiosMatchingErrorsByPath< + Api, + M, + Path, + FetcherProvider, + TypeProvider + > { + return this.isDefinedError(error, (err) => + findEndpointErrorsByPath(this.api, method, path, err) + ); + } + + /** + * check if the error is matching the endpoint errors definitions + * @param api - the api definition + * @param alias - alias of the endpoint + * @param error - the error to check + * @returns - if true, the error type is narrowed to the matching endpoint errors + */ + isErrorFromAlias>( + alias: Alias, + error: unknown + ): error is ZodiosMatchingErrorsByAlias< + Api, + Alias, + FetcherProvider, + TypeProvider + > { + return this.isDefinedError(error, (err) => + findEndpointErrorsByAlias(this.api, alias, err) + ); + } +} + +export type ZodiosInstance< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = ZodiosCoreImpl & + ZodiosAliases & + ZodiosVerbs; + +export interface ZodiosCore { + new < + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + api: Api, + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; + new < + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + baseUrl: string, + api: Api, + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; +} + +export const ZodiosCore = ZodiosCoreImpl as ZodiosCore; + +/** + * Get the Api description type from zodios + * @param Z - zodios type + */ +export type ApiOf> = Z["api"]; +/** + * Get the type provider type from zodios + * @param Z - zodios type + */ +export type TypeProviderOf> = + Z["_typeProvider"]; + +export type FetcherProviderOf> = + Z["_fetcherProvider"]; diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts new file mode 100644 index 00000000..3e758183 --- /dev/null +++ b/packages/core/src/zodios.types.ts @@ -0,0 +1,928 @@ +import type { + FilterArrayByValue, + PickDefined, + NeverIfEmpty, + UndefinedToOptional, + PathParamNames, + TransitiveOptional, + ReadonlyDeep, + Merge, + FilterArrayByKey, + IfEquals, + RequiredKeys, + ArrayFindByValue, +} from "./utils.types"; +import type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosRuntimeTypeProvider, + ZodTypeProvider, +} from "./type-providers"; +import { + AnyZodiosFetcherProvider, + TypeOfFetcherConfig, + TypeOfFetcherError, + TypeOfFetcherResponse, + ZodiosFetcherFactory, +} from "./fetcher-providers"; + +export const HTTP_QUERY_METHODS = ["get", "head"] as const; +export const HTTP_MUTATION_METHODS = [ + "post", + "put", + "patch", + "delete", +] as const; +export const HTTP_METHODS = [ + ...HTTP_QUERY_METHODS, + ...HTTP_MUTATION_METHODS, +] as const; + +export type QueryMethod = (typeof HTTP_QUERY_METHODS)[number]; +export type MutationMethod = (typeof HTTP_MUTATION_METHODS)[number]; +export type Method = (typeof HTTP_METHODS)[number]; + +export type RequestFormat = + | "json" // default + | "form-data" // for file uploads + | "form-url" // for hiding query params in the body + | "binary" // for binary data / file uploads + | "text"; // for text data + +type EndpointDefinitionsByMethod< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method +> = FilterArrayByValue; + +export type FindZodiosEndpointDefinitionByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = ArrayFindByValue; + +export type FindZodiosEndpointDefinitionByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string +> = ArrayFindByValue; + +export type ZodiosPathsByMethod< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method +> = EndpointDefinitionsByMethod[number]["path"]; + +export type Aliases< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[] +> = FilterArrayByKey[number]["alias"]; + +export type ZodiosResponseForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema + : InferInputTypeFromSchema; + +export type ZodiosResponseByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByPath["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByPath["response"] + >; + +export type ZodiosResponseByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByAlias["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByAlias["response"] + >; + +export type ZodiosDefaultErrorForEndpoint< + Endpoint extends ZodiosEndpointDefinition +> = FilterArrayByValue< + Endpoint["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type ZodiosDefaultErrorByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type ZodiosDefaultErrorByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string +> = FilterArrayByValue< + FindZodiosEndpointDefinitionByAlias["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type IfNever = IfEquals; + +export type ZodiosErrorForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Status extends number, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + Endpoint["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorForEndpoint + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + Endpoint["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorForEndpoint + > + >; + +export type ZodiosErrorByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Status extends number | "default", + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByPath + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByPath + > + >; + +export type ZodiosErrorsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByPath< + Api, + M, + Path + >["errors"][number]["schema"] + > + : InferInputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByPath< + Api, + M, + Path + >["errors"][number]["schema"] + >; + +export type ZodiosErrorsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByAlias["errors"] + > + : InferInputTypeFromSchema< + TypeProvider, + FindZodiosEndpointDefinitionByAlias["errors"] + >; + +export type InferFetcherErrors< + T extends readonly unknown[] | unknown[], + TypeProvider extends AnyZodiosTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider, + Acc extends unknown[] = [] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends { + status: infer Status; + schema: infer Schema; + } + ? InferFetcherErrors< + Tail, + TypeProvider, + FetcherProvider, + [ + ...Acc, + TypeOfFetcherError< + FetcherProvider, + InferOutputTypeFromSchema, + Status + > + ] + > + : Acc + : T extends [infer Head, ...infer Tail] + ? Head extends { + status: infer Status; + schema: infer Schema; + } + ? InferFetcherErrors< + Tail, + TypeProvider, + FetcherProvider, + [ + ...Acc, + TypeOfFetcherError< + FetcherProvider, + InferOutputTypeFromSchema, + Status + > + ] + > + : Acc + : Acc; + +export type ZodiosMatchingErrorsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = InferFetcherErrors< + FindZodiosEndpointDefinitionByPath["errors"], + TypeProvider, + FetcherProvider +>[number]; + +export type ZodiosMatchingErrorsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = InferFetcherErrors< + FindZodiosEndpointDefinitionByAlias["errors"], + TypeProvider, + FetcherProvider +>[number]; + +export type ZodiosErrorByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Status extends number | "default", + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + FindZodiosEndpointDefinitionByAlias["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByAlias + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + FindZodiosEndpointDefinitionByAlias["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByAlias + > + >; + +type BodySchemaForEndpoint = + ArrayFindByValue["schema"]; + +type BodySchema< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = ArrayFindByValue< + FindZodiosEndpointDefinitionByPath["parameters"], + { type: "Body" } +>["schema"]; + +export type ZodiosBodyForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +export type ZodiosBodyByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +export type BodySchemaByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string +> = ArrayFindByValue< + FindZodiosEndpointDefinitionByAlias["parameters"], + { type: "Body" } +>["schema"]; + +export type ZodiosBodyByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +/** + * Map a type an api description parameter to a zod infer type + * @param T - array of api description parameters + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type MapSchemaParameters< + T, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + Acc = {} +> = T extends [infer Head, ...infer Tail] + ? Head extends { + name: infer Name; + schema: infer Schema; + } + ? Name extends string + ? MapSchemaParameters< + Tail, + Frontend, + TypeProvider, + Merge< + { + [Key in Name]: Frontend extends true + ? InferInputTypeFromSchema + : InferOutputTypeFromSchema; + }, + Acc + > + > + : Acc + : Acc + : Acc; + +export type ZodiosQueryParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosQueryParamsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["parameters"], + { type: "Query" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosQueryParamsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + FindZodiosEndpointDefinitionByAlias["parameters"], + { type: "Query" } + >, + Frontend, + TypeProvider + > + > +>; + +/** + * @deprecated - use ZodiosQueryParamsByPath instead + */ +export type ZodiosPathParams = NeverIfEmpty< + Record, string | number> +>; + +export type ZodiosPathParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + PathParameters = MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + >, + Path = Endpoint["path"], + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; + +/** + * Get path params for a given endpoint by path + */ +export type ZodiosPathParamsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + PathParameters = MapSchemaParameters< + FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["parameters"], + { type: "Path" } + >, + Frontend, + TypeProvider + >, + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; + +/** + * Get path params for a given endpoint by alias + */ +export type ZodiosPathParamByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + Endpoint extends ZodiosEndpointDefinition = FindZodiosEndpointDefinitionByAlias< + Api, + Alias + >, + Path = Endpoint["path"], + PathParameters = MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + >, + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; + +export type ZodiosHeaderParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosHeaderParamsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + FindZodiosEndpointDefinitionByPath["parameters"], + { type: "Header" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosHeaderParamsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + FindZodiosEndpointDefinitionByAlias["parameters"], + { type: "Header" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosRequestOptionsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + FetcherProvider extends AnyZodiosFetcherProvider, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Merge< + TypeOfFetcherConfig, + TransitiveOptional< + PickDefined<{ + params: ZodiosPathParamByAlias; + queries: ZodiosQueryParamsByAlias; + headers: ZodiosHeaderParamsByAlias; + body: ZodiosBodyByAlias; + }> + > +>; + +export type ZodiosAliasRequest = + RequiredKeys extends never + ? (configOptions?: ReadonlyDeep) => Promise + : (configOptions: ReadonlyDeep) => Promise; + +export type ZodiosAliases< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [Alias in Aliases]: ZodiosAliasRequest< + ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + ZodiosResponseByAlias + >; +}; + +type OptionalRequestOptionsByPathParameters< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider, + Config = ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > +> = RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep]; + +export type ZodiosVerbs< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [M in Method]: >( + path: Path, + ...params: OptionalRequestOptionsByPathParameters< + Api, + M, + Path, + FetcherProvider, + TypeProvider + > + ) => Promise>; +}; + +export type AnyZodiosMethodOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + TypeOfFetcherConfig, + { + params?: Record; + queries?: Record; + headers?: Record; + body?: unknown; + } +>; + +export type AnyZodiosRequestOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + { method: Method; url: string }, + AnyZodiosMethodOptions +>; + +/** + * Get the request options for a given endpoint + */ +export type ZodiosRequestOptionsByPath< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Merge< + TypeOfFetcherConfig, + TransitiveOptional< + PickDefined<{ + params: ZodiosPathParamsByPath; + queries: ZodiosQueryParamsByPath; + headers: ZodiosHeaderParamsByPath; + body: ZodiosBodyByPath; + }> + > +>; + +export type ZodiosRequestOptions< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Merge< + { + method: M; + url: Path; + }, + ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + Frontend, + TypeProvider + > +>; + +/** + * Zodios options + */ +export interface ZodiosOptions< + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + /** + * Should zodios validate parameters and response? Default: true + */ + validate?: boolean | "request" | "response" | "all" | "none"; + /** + * Should zodios transform the request and response ? Default: true + */ + transform?: boolean | "request" | "response"; + /** + * Should zod schema default values be used on parameters? Default: false + * you usually want your backend to handle default values + */ + sendDefaults?: boolean; + + /** + * Should zodios throw on error? Default: true + * if false, zodios will return the error in the response else it will throw + */ + throwOnError?: boolean; + + fetcherFactory?: ZodiosFetcherFactory; + + /** + * set a custom type provider. Default: ZodTypeProvider + */ + typeProvider?: ZodiosRuntimeTypeProvider; +} + +export interface ZodiosEndpointParameter { + /** + * name of the parameter + */ + name: string; + /** + * optional description of the parameter + */ + description?: string; + /** + * type of the parameter: Query, Body, Header, Path + */ + type: "Query" | "Body" | "Header" | "Path"; + /** + * zod schema of the parameter + * you can use zod `transform` to transform the value of the parameter before sending it to the server + */ + schema: BaseSchemaType; +} + +export interface ZodiosEndpointError { + /** + * status code of the error + * use 'default' to declare a default error + */ + status: number | "default"; + /** + * description of the error - used to generate the openapi error description + */ + description?: string; + /** + * schema of the error + */ + schema: BaseSchemaType; +} + +/** + * Zodios enpoint definition that should be used to create a new instance of Zodios + */ +export interface ZodiosEndpointDefinition { + /** + * http method : get, post, put, patch, delete + */ + method: Method; + /** + * path of the endpoint + * @example + * ```text + * /posts/:postId/comments/:commentId + * ``` + */ + path: string; + /** + * optional alias to call the endpoint easily + * @example + * ```text + * getPostComments + * ``` + */ + alias?: string; + /** + * optional description of the endpoint + */ + description?: string; + /** + * optional request format of the endpoint: json, form-data, form-url, binary, text + */ + requestFormat?: RequestFormat; + /** + * optionally mark the endpoint as immutable to allow zodios to cache the response with react-query + * use it to mark a 'post' endpoint as immutable + */ + immutable?: boolean; + /** + * optional parameters of the endpoint + */ + parameters?: + | readonly ZodiosEndpointParameter[] + | ZodiosEndpointParameter[]; + /** + * response of the endpoint + * you can use zod `transform` to transform the value of the response before returning it + */ + response: BaseSchemaType; + /** + * optional response status of the endpoint for sucess, default is 200 + * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code + */ + status?: number; + /** + * optional response description of the endpoint + */ + responseDescription?: string; + /** + * optional errors of the endpoint - only usefull when using @zodios/express + */ + errors?: + | readonly ZodiosEndpointError[] + | ZodiosEndpointError[]; +} + +/** + * Zodios plugin that can be used to intercept zodios requests and responses + */ +export interface ZodiosPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +> { + /** + * Optional name of the plugin + * naming a plugin allows to remove it or replace it later + */ + name?: string; + /** + * request interceptor to modify or inspect the request before it is sent + * @param api - the api description + * @param request - the request config + * @returns possibly a new request config + */ + request?: ( + endpoint: ZodiosEndpointDefinition, + config: ReadonlyDeep> + ) => Promise>>; + /** + * response interceptor to modify or inspect the response before it is returned + * @param api - the api description + * @param config - the request config + * @param response - the response + * @returns possibly a new response + */ + response?: ( + endpoint: ZodiosEndpointDefinition, + config: ReadonlyDeep>, + response: TypeOfFetcherResponse + ) => Promise>; + /** + * error interceptor for response errors + * there is no error interceptor for request errors + * @param api - the api description + * @param config - the config for the request + * @param error - the error that occured + * @returns possibly a new response or a new error + */ + error?: ( + endpoint: ZodiosEndpointDefinition, + config: ReadonlyDeep>, + error: Error + ) => Promise>; +} diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/core/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/tsup.config.js b/packages/core/tsup.config.js similarity index 100% rename from tsup.config.js rename to packages/core/tsup.config.js diff --git a/packages/express/CHANGELOG.md b/packages/express/CHANGELOG.md new file mode 100644 index 00000000..25466a3a --- /dev/null +++ b/packages/express/CHANGELOG.md @@ -0,0 +1,23 @@ +# @zodios/express + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 diff --git a/packages/express/LICENSE b/packages/express/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/express/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/express/README.md b/packages/express/README.md new file mode 100644 index 00000000..4e25ef63 --- /dev/null +++ b/packages/express/README.md @@ -0,0 +1,214 @@ +

Zodios Express

+

+ + Zodios logo + +

+

+ Zodios express is a typescript end to end typesafe adapter for express using zod +
+

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an express adapter for zodios that helps you type your express routes. + +- really simple centralized API declaration +- router endpoints autocompletion +- typescript autocompletion for query, path, header and body input parameters (`req` is fully typed) +- typescript autocompletion for response body (`res.json()`) +- input validation thanks to zod +- openapi specification generation out of the box (using swagger) +- end to end typesafe APIs (a la tRPC when using both @zodios/express and @zodios/core) + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) +- [How to use it ?](#how-to-use-it-) + - [`zodiosApp` : Declare your API for fullstack end to end type safety](#zodiosapp--declare-your-api-for-fullstack-end-to-end-type-safety) + - [`zodiosRouter` : Split your application with multiple routers](#zodiosrouter--split-your-application-with-multiple-routers) + - [Error Handling](#error-handling) +- [Roadmap](#roadmap) + +# Install + +```bash +> npm install @zodios/express +``` + +or + +```bash +> yarn add @zodios/express +``` + +# How to use it ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## `zodiosApp` : Declare your API for fullstack end to end type safety + +Here is an example of API declaration with Zodios. + +in a common directory (ex: `src/common/api.ts`) : + +```typescript +import { makeApi } from "@zodios/core"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); +``` + +in your frontend (ex: `src/client/api.ts`) : + +```typescript +import { Zodios } from "@zodios/core"; +import { userApi } from "../../common/api"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + userApi +); + +// typed alias auto-complete params +// ▼ ▼ ▼ +const user = await apiClient.getUser({ params: { id: 1 } }); +``` + +in your backend (ex: `src/server/router.ts`) : +```typescript +import { zodiosApp } from "@zodios/express"; +import { userApi } from "../../common/api"; + +// just an express adapter that is aware of your api, app is just an express app with type annotations and validation middlewares +const app = zodiosApp(userApi); + +// auto-complete path fully typed and validated input params (body, query, path, header) +// ▼ ▼ ▼ +app.get("/users/:id", (req, res) => { + // res.json is typed thanks to zod + res.json({ + // auto-complete req.params.id + // ▼ + id: req.params.id, + name: "John Doe", + }); +}) + +app.listen(3000); +``` + +## `zodiosRouter` : Split your application with multiple routers + +When organizing your express application, you usually want to split your API declarations into separate Routers. +You can use the `zodiosRouter` to do that with a `zodiosApp` without APIs attached. + +```typescript +import { zodiosApp, zodiosRouter } from "@zodios/express"; + +const app = zodiosApp(); // just an axpess app with type annotations +const userRouter = zodiosRouter(userApi); // just an express router with type annotations and validation middlewares +const adminRouter = zodiosRouter(adminApi); // just an express router with type annotations and validation middlewares + +const app.use(userRouter,adminRouter); + +app.listen(3000); +``` +## Error Handling + +Zodios express can infer the status code to match your API error response and also have your errors correctly typed. + +```typescript +import { makeApi } from "@zodios/core"; +import { zodiosApp } from "@zodios/express"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + errors: [ + { + status: 404, + response: z.object({ + code: z.string(), + message: z.string(), + id: z.number(), + }), + }, { + status: 'default', // default status code will be used if error is not 404 + response: z.object({ + code: z.string(), + message: z.string(), + }), + }, + ], + }, +]); + +const app = zodiosApp(userApi); +app.get("/users/:id", (req, res) => { + try { + const id = +req.params.id; + const user = service.findUser(id); + if(!user) { + // match error 404 schema with auto-completion + res.status(404).json({ + code: "USER_NOT_FOUND", + message: "User not found", + id, // compile time error if you forget to add id + }); + } else { + // match response schema with auto-completion + res.json(user); + } + } catch(err) { + // match default error schema with auto-completion + res.status(500).json({ + code: "INTERNAL_ERROR", + message: "Internal error", + }); + } +}) + +app.listen(3000); +``` + +# Roadmap + +- [] add support for swagger/openapi generation +- [] add utilities to combine api declarations to match the express router api +- [] add autocompletion for express `app.name()` diff --git a/packages/express/jest.config.ts b/packages/express/jest.config.ts new file mode 100644 index 00000000..d32c0704 --- /dev/null +++ b/packages/express/jest.config.ts @@ -0,0 +1,23 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/express/package.json b/packages/express/package.json new file mode 100644 index 00000000..6a2139e4 --- /dev/null +++ b/packages/express/package.json @@ -0,0 +1,63 @@ +{ + "name": "@zodios/express", + "description": "Typescript express server", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "express", + "zod", + "rpc", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.19", + "express": "4.x", + "zod": "^3.x" + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "@types/supertest": "2.0.12", + "@zodios/core": "workspace:*", + "express": "4.18.2", + "jest": "29.5.0", + "rimraf": "4.4.1", + "supertest": "6.3.3", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts new file mode 100644 index 00000000..290fecf1 --- /dev/null +++ b/packages/express/src/index.ts @@ -0,0 +1,22 @@ +export { + zodiosApp, + zodiosRouter, + zodiosNextApp, + zodiosContext, +} from "./zodios"; +export type { ZodiosContext } from "./zodios"; + +export type { + ZodiosApp, + ZodiosAppOptions, + ZodiosMethodMiddleware, + ZodiosMiddleware, + ZodiosPathMiddleware, + ZodiosRouter, + ZodiosRouterMethodMiddlewares, + ZodiosRouterOptions, + ZodiosValidationOptions, + ZodiosRouterMiddlewares, + ZodiosSucessCodes, + WithZodiosContext, +} from "./zodios.types"; diff --git a/packages/express/src/type-providers/index.ts b/packages/express/src/type-providers/index.ts new file mode 100644 index 00000000..90c4a6bb --- /dev/null +++ b/packages/express/src/type-providers/index.ts @@ -0,0 +1 @@ +export type { ZodiosExpressTypeProviderFactory } from "./type-provider.types"; diff --git a/packages/express/src/type-providers/type-provider.types.ts b/packages/express/src/type-providers/type-provider.types.ts new file mode 100644 index 00000000..5aef1128 --- /dev/null +++ b/packages/express/src/type-providers/type-provider.types.ts @@ -0,0 +1,10 @@ +import { AnyZodiosTypeProvider, ZodiosValidateResult } from "@zodios/core"; + +export interface ZodiosExpressTypeProviderFactory< + TypeProvider extends AnyZodiosTypeProvider +> { + readonly _provider?: TypeProvider; + validate: (schema: any, input: unknown) => ZodiosValidateResult; + validateAsync: (schema: any, input: unknown) => Promise; + isSchemaString: (schema: any) => boolean; +} diff --git a/packages/express/src/type-providers/zod.type-provider.ts b/packages/express/src/type-providers/zod.type-provider.ts new file mode 100644 index 00000000..337c4fc2 --- /dev/null +++ b/packages/express/src/type-providers/zod.type-provider.ts @@ -0,0 +1,31 @@ +import type { ZodTypeProvider } from "@zodios/core"; +import { ZodiosExpressTypeProviderFactory } from "./type-provider.types"; +import { z } from "zod"; + +// istanbul ignore next +export function isZodType( + t: z.ZodTypeAny, + type: z.ZodFirstPartyTypeKind +): boolean { + if (t._def?.typeName === type) { + return true; + } + if ( + t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && + (t as z.ZodEffects)._def.effect.type === "refinement" + ) { + return isZodType((t as z.ZodEffects).innerType(), type); + } + if (t._def?.innerType) { + return isZodType(t._def?.innerType, type); + } + return false; +} + +export const zodTypeFactory: ZodiosExpressTypeProviderFactory = + { + validate: (schema, input) => schema.safeParse(input), + validateAsync: (schema, input) => schema.safeParseAsync(input), + isSchemaString: (schema) => + isZodType(schema, z.ZodFirstPartyTypeKind.ZodString), + }; diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts new file mode 100644 index 00000000..5dccd914 --- /dev/null +++ b/packages/express/src/zodios-validator.ts @@ -0,0 +1,138 @@ +import express from "express"; +import { AnyZodiosTypeProvider, ZodiosEndpointDefinition } from "@zodios/core"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; + +const METHODS = ["get", "post", "put", "patch", "delete"] as const; + +function safeJsonParse(str: string) { + try { + return JSON.parse(str); + } catch { + return str; + } +} + +async function validateParam( + schema: unknown, + parameter: unknown, + typeFactory: ZodiosExpressTypeProviderFactory +) { + if ( + !typeFactory.isSchemaString(schema) && + parameter && + typeof parameter === "string" + ) { + return typeFactory.validateAsync(schema, safeJsonParse(parameter)); + } + return typeFactory.validateAsync(schema, parameter); +} + +function validateEndpointMiddleware( + endpoint: ZodiosEndpointDefinition, + transform: boolean, + typeFactory: ZodiosExpressTypeProviderFactory +) { + return async ( + req: express.Request, + res: express.Response, + next: express.NextFunction + ) => { + for (let parameter of endpoint.parameters!) { + let schema = parameter.schema; + + switch (parameter.type) { + case "Body": + { + // @ts-ignore + const result = await typeFactory.validateAsync(schema, req.body); + if (!result.success) { + return res.status(400).json({ + context: "body", + error: result.error.issues, + }); + } + if (transform) req.body = result.data; + } + break; + case "Path": + { + const result = await validateParam( + schema, + req.params[parameter.name], + typeFactory + ); + if (!result.success) { + return res.status(400).json({ + context: `path.${parameter.name}`, + error: result.error.issues, + }); + } + if (transform) req.params[parameter.name] = result.data as any; + } + break; + case "Query": + { + const result = await validateParam( + schema, + req.query[parameter.name], + typeFactory + ); + if (!result.success) { + return res.status(400).json({ + context: `query.${parameter.name}`, + error: result.error.issues, + }); + } + if (transform) req.query[parameter.name] = result.data as any; + } + break; + case "Header": + { + // @ts-ignore + const result = await parameter.schema.safeParseAsync( + req.get(parameter.name) + ); + if (!result.success) { + return res.status(400).json({ + context: `header.${parameter.name}`, + error: result.error.issues, + }); + } + if (transform) req.headers[parameter.name] = result.data as any; + } + break; + } + } + next(); + }; +} + +/** + * monkey patch express.Router to add inject the validation middlewares after the route is matched + * @param api - the api definition + * @param router - express router to patch + * @param transform - whether to transform the data or not + */ +export function injectParametersValidators( + api: readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + router: express.Router, + transform: boolean, + typeFactory: ZodiosExpressTypeProviderFactory +) { + for (let method of METHODS) { + const savedMethod = router[method].bind(router); + // @ts-ignore + router[method] = (path: string, ...handlers: any[]) => { + const endpoint = api.find( + (endpoint) => endpoint.method === method && endpoint.path === path + ); + if (endpoint && endpoint.parameters) { + handlers = [ + validateEndpointMiddleware(endpoint, transform, typeFactory), + ...handlers, + ]; + } + return savedMethod(path, ...handlers); + }; + } +} diff --git a/packages/express/src/zodios.spec.ts b/packages/express/src/zodios.spec.ts new file mode 100644 index 00000000..eca19730 --- /dev/null +++ b/packages/express/src/zodios.spec.ts @@ -0,0 +1,383 @@ +import request from "supertest"; +import z from "zod"; +import { apiBuilder, makeErrors } from "@zodios/core"; +import { zodiosContext } from "./zodios"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), +}); + +const errors = makeErrors([ + { + status: "default", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, +]); + +const userApi = apiBuilder({ + method: "get", + path: "/users", + parameters: [ + { + name: "limit", + type: "Query", + schema: z.number().min(1).max(Infinity).default(Infinity), + }, + { + name: "offset", + type: "Query", + schema: z.number().min(0).max(Infinity).default(0), + }, + { + name: "active", + type: "Query", + schema: z.boolean().default(true), + }, + ], + response: z.array(user), + errors, +}) + .addEndpoint({ + method: "get", + path: "/users/:id", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + ], + response: user, + errors, + }) + .addEndpoint({ + method: "post", + path: "/users", + parameters: [ + { + name: "user", + type: "Body", + schema: user.omit({ id: true }), + }, + ], + response: user, + }) + .addEndpoint({ + method: "put", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: user, + }, + { + name: "Authorization", + type: "Header", + schema: z.string().regex(/^Bearer\s+[a-zA-Z0-9]+$/), + }, + ], + response: user, + }) + .addEndpoint({ + method: "delete", + path: "/users/:id", + response: user, + }) + .build(); + +describe("router", () => { + it("should get one user", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + if (req.params.id >= 10) { + return res.status(404).json({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + } + res.json({ + id: req.params.id, + name: "john doe", + email: "test@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/3").expect(200); + expect(result.body).toEqual({ + id: 3, + name: "john doe", + email: "test@domain.com", + }); + }); + + it("should infer boolean in query params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users", (req, res, next) => { + if (req.query.active) { + return res.status(200).json([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + } + res.json([ + { + id: 1, + name: "john doe", + email: "test@domain.com", + }, + ]); + }); + const req = request(app); + const result1 = await req.get("/users?active=false"); + expect(result1.statusCode).toBe(200); + expect(result1.body).toEqual([ + { + id: 1, + name: "john doe", + email: "test@domain.com", + }, + ]); + const result2 = await req.get("/users?active=true"); + expect(result2.statusCode).toBe(200); + expect(result2.body).toEqual([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + const result3 = await req.get("/users"); + expect(result3.statusCode).toBe(200); + expect(result3.body).toEqual([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + }); + + it("should not find user if id>10", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + if (req.params.id >= 10) { + return res.status(404).json({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + } + res.json({ + id: req.params.id, + name: "john doe", + email: "test@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/10").expect(404); + expect(result.body).toEqual({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + }); + + it("should get many users with context", async () => { + const ctx = zodiosContext( + z.object({ + user: z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + }), + }) + ); + const app = ctx.app(); + const router = ctx.router(userApi); + router.use((req, res, next) => { + req.user = { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }; + next(); + }); + app.use(router); + router.get("/users", (req, res, next) => { + res.json([ + req.user, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + const req = request(app); + const result = await req.get("/users").expect(200); + expect(result.body).toEqual([ + { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + + it("should return 400 error on bad path params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + res.json({ + id: req.params.id, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/hello").expect(400); + expect(result.body).toEqual({ + context: "path.id", + error: [ + { + code: "invalid_type", + expected: "number", + message: "Expected number, received string", + path: [], + received: "string", + }, + ], + }); + }); + + it("should return 400 error on bad query params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users", (req, res, next) => { + res.json([ + { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + const req = request(app); + const result = await req.get("/users?limit=0").expect(400); + expect(result.body.context).toEqual("query.limit"); + expect(result.body.error).toEqual([ + expect.objectContaining({ + code: "too_small", + inclusive: true, + message: "Number must be greater than or equal to 1", + minimum: 1, + path: [], + type: "number", + }), + ]); + }); + it("should create a user", async () => { + const app = zodiosContext().app(userApi); + app.post("/users", (req, res, next) => { + res.json({ + id: 1, + ...req.body, + }); + }); + const req = request(app); + const result = await req.post("/users").send({ + name: "john doe", + email: "john.doe@domain.com", + }); + expect(result.status).toBe(200); + expect(result.body).toEqual({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + + it("should return 400 error when sending an invalid user", async () => { + const app = zodiosContext().app(userApi); + app.post("/users", (req, res, next) => { + res.json({ + id: 1, + ...req.body, + }); + }); + const req = request(app); + const result = await req.post("/users").send({ + name: "john doe", + email: "john.doe", + }); + expect(result.status).toBe(400); + expect(result.body).toEqual({ + context: "body", + error: [ + { + validation: "email", + code: "invalid_string", + message: "Invalid email", + path: ["email"], + }, + ], + }); + }); + it("should succeed to put a user if authenticated", async () => { + const app = zodiosContext().app(userApi); + app.put("/users/:id", (req, res) => { + res.json(req.body); + }); + const req = request(app); + const result = await req + .put("/users/1") + .send({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }) + .set("Authorization", "Bearer 12345"); + expect(result.status).toBe(200); + expect(result.body).toEqual({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + it("should fail to put a user if not authenticated", async () => { + const app = zodiosContext().app(userApi); + app.put("/users/:id", (req, res) => { + res.json(req.body); + }); + const req = request(app); + const result = await req.put("/users/1").send({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + expect(result.status).toBe(400); + }); +}); diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts new file mode 100644 index 00000000..0cf269c8 --- /dev/null +++ b/packages/express/src/zodios.ts @@ -0,0 +1,196 @@ +import express, { RouterOptions } from "express"; +import { + AnyZodiosTypeProvider, + ZodTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosEndpointDefinition, +} from "@zodios/core"; +import { + ZodiosApp, + ZodiosRouter, + ZodiosAppOptions, + ZodiosRouterOptions, + ZodiosMiddleware, +} from "./zodios.types"; +import { injectParametersValidators } from "./zodios-validator"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; +import { zodTypeFactory } from "./type-providers/zod.type-provider"; + +/** + * create a zodios app based on the given api and express + * @param api - api definition + * @param options - options to configure the app + * @returns + */ +export function zodiosApp< + ContextSchema, + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( + api?: Api, + options: ZodiosAppOptions = {} +): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider +> { + const { + express: app = express(), + enableJsonBodyParser = true, + validate = true, + transform = true, + typeFactory = zodTypeFactory, + } = options; + if (enableJsonBodyParser) { + app.use(express.json()); + } + if (api && validate) { + injectParametersValidators(api, app, transform, typeFactory); + } + return app as any; +} + +/** + * create a zodios router based on the given api and express router + * @param api - api definition + * @param options - options to configure the router + * @returns + */ +export function zodiosRouter< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( + api: Api, + options: RouterOptions & ZodiosRouterOptions = {} +): ZodiosRouter< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider +> { + const { + validate = true, + transform = true, + typeFactory = zodTypeFactory, + ...routerOptions + } = options; + const router = options?.router ?? express.Router(routerOptions); + if (validate) { + injectParametersValidators(api, router, transform, typeFactory); + } + return router as any; +} + +/** + * create a zodios app for nextjs + * @param options - options to configure the app + * @returns - a zodios app + */ +export function zodiosNextApp< + ContextSchema, + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( + api?: Api, + options: ZodiosAppOptions = {} +): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider +> { + return zodiosApp(api, { + ...options, + enableJsonBodyParser: false, + }); +} + +export class ZodiosContext< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + typeFactory: ZodiosExpressTypeProviderFactory; + constructor( + public context?: ContextSchema, + options?: { + typeFactory: ZodiosExpressTypeProviderFactory; + } + ) { + this.typeFactory = options?.typeFactory ?? (zodTypeFactory as any); + } + + app< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any + >( + api?: Api, + options?: ZodiosAppOptions + ): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider + > { + return zodiosApp(api, { ...options, typeFactory: this.typeFactory }); + } + + nextApp< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any + >( + api?: Api, + options?: ZodiosAppOptions + ): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider + > { + return zodiosNextApp(api, { ...options, typeFactory: this.typeFactory }); + } + + router< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] + >( + api: Api, + options?: RouterOptions & ZodiosRouterOptions + ): ZodiosRouter< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema, + TypeProvider + > { + return zodiosRouter(api, { ...options, typeFactory: this.typeFactory }); + } +} + +export function zodiosContext< + ContextSchema = unknown, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( + context?: ContextSchema, + options?: { + typeFactory: ZodiosExpressTypeProviderFactory; + } +): ZodiosContext { + return new ZodiosContext(context, options); +} diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts new file mode 100644 index 00000000..bf4f9b24 --- /dev/null +++ b/packages/express/src/zodios.types.ts @@ -0,0 +1,214 @@ +import express from "express"; +import type { Request, Response, NextFunction } from "express"; +import http from "node:http"; +import { + ZodiosEndpointDefinition, + ZodiosErrorByPath, + ZodiosResponseByPath, + ZodiosQueryParamsByPath, + ZodiosBodyByPath, + ZodiosPathsByMethod, + ZodiosPathParamsByPath, + Method, + AnyZodiosTypeProvider, + ZodTypeProvider, +} from "@zodios/core"; +import { IfEquals } from "@zodios/core/lib/utils.types"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; + +export type ZodiosSucessCodes = + | 200 + | 201 + | 202 + | 203 + | 204 + | 205 + | 206 + | 207 + | 208 + | 226; + +export type WithZodiosContext = T & Context; + +type Test = WithZodiosContext; + +export interface ZodiosPathMiddleware< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + M extends Method, + Path extends ZodiosPathsByMethod, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + ReqPath = ZodiosPathParamsByPath, + ReqBody = ZodiosBodyByPath, + ReqQuery = ZodiosQueryParamsByPath, + Res = ZodiosResponseByPath +> { + ( + req: WithZodiosContext, Context>, + res: Omit, "status"> & { + // rebind context to allow for type inference + status< + StatusCode extends number, + API extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = Api, + METHOD extends Method = M, + PATH extends ZodiosPathsByMethod = Path + >( + status: StatusCode + ): StatusCode extends ZodiosSucessCodes + ? Response + : Response< + ZodiosErrorByPath< + API, + METHOD, + PATH, + StatusCode, + false, + TypeProvider + > + >; + }, + next: NextFunction + ): void; +} + +export type ZodiosMiddleware = ( + req: WithZodiosContext, + res: Response, + next: NextFunction +) => void; + +export type ZodiosErrorMiddleware = ( + error: unknown, + req: WithZodiosContext, + res: Response, + next: NextFunction +) => void; + +export type ZodiosMethodMiddleware< + Router, + Context, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + TypeProvider extends AnyZodiosTypeProvider +> = >( + path: Path, + ...handlers: Array> +) => Router; + +export interface ZodiosRouterMiddlewares { + use(handlers: Array>): this; + use(...handlers: Array>): this; + use(...handler: Array>): this; + use(path: string, ...handlers: Array>): this; + use(path: string, handlers: Array>): this; +} + +export interface ZodiosRouterMethodMiddlewares< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosRouterMiddlewares { + get: ZodiosMethodMiddleware; + post: ZodiosMethodMiddleware; + put: ZodiosMethodMiddleware; + patch: ZodiosMethodMiddleware; + delete: ZodiosMethodMiddleware; + head: ZodiosMethodMiddleware; +} + +export interface ZodiosValidationOptions { + /** + * validate request parameters - default is true + */ + validate?: boolean; + /** + * transform request parameters - default is true + */ + transform?: boolean; +} + +export interface ZodiosAppOptions< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosValidationOptions { + /** + * express app intance - default is express() + */ + express?: ReturnType; + /** + * enable express json body parser - default is true + */ + enableJsonBodyParser?: boolean; + context?: ContextSchema; + typeFactory?: ZodiosExpressTypeProviderFactory; +} + +export interface ZodiosRouterOptions< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosValidationOptions { + /** + * express router instance - default is express.Router + */ + router?: ReturnType; + context?: ContextSchema; + typeFactory?: ZodiosExpressTypeProviderFactory; +} + +export interface ZodiosUnknownApp + extends Omit, "use">, + ZodiosRouterMiddlewares { + ( + req: Request | http.IncomingMessage, + res: Response | http.ServerResponse + ): any; +} + +export interface ZodiosApiApp< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends Omit, Method | "use">, + ZodiosRouterMethodMiddlewares { + ( + req: Request | http.IncomingMessage, + res: Response | http.ServerResponse + ): any; +} + +export type ZodiosApp< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> = IfEquals< + Api, + any, + ZodiosUnknownApp, + ZodiosApiApp +>; + +interface ZodiosUnknownRouter + extends Omit, "use">, + ZodiosRouterMiddlewares, + ZodiosMiddleware {} + +interface ZodiosApiRouter< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends Omit, Method | "use">, + ZodiosRouterMethodMiddlewares, + ZodiosMiddleware {} + +export type ZodiosRouter< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> = IfEquals< + Api, + any, + ZodiosUnknownRouter, + ZodiosApiRouter +>; diff --git a/packages/express/tsconfig.build.json b/packages/express/tsconfig.build.json new file mode 100644 index 00000000..2bfb6f53 --- /dev/null +++ b/packages/express/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES2020", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json new file mode 100644 index 00000000..de72eda7 --- /dev/null +++ b/packages/express/tsconfig.json @@ -0,0 +1,15 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2020", + "module": "CommonJS", + "moduleResolution": "Node", + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true + }, + "exclude": ["node_modules", "lib", "../../examples"] +} diff --git a/packages/express/tsup.config.js b/packages/express/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/express/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/fetch-batch/LICENSE b/packages/fetch-batch/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/fetch-batch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md new file mode 100644 index 00000000..0d40edd7 --- /dev/null +++ b/packages/fetch-batch/README.md @@ -0,0 +1,184 @@ +# Batch support for fetch + +Batching is a technique that allows to send multiple requests in a single HTTP request. +This is useful to reduce the number of roundtrips between the client and the server and to reduce the number of requests on the server. +Because HTTPS requests are expensive, batching can greatly improve the performance of your application. +It also allows to bypass browser limitations on the number of concurrent requests. + +However, if your service is already using HTTP/2, you should not use this library as HTTP/2 already supports multiplexing in a better way. +Indeed it also does supports interleaving the data of multiple requests allowing a slower request to be received before a faster one if it has fewer data to send. + +These features are not supported by this library, that does batching in a FIFO way. This should be OK for most REST APIs. + +So it's advised to not updload or download large files using this library, since one large file could block the response of a REST api that took longer to start sending data. + +## Main interface + +This allows to batch automatically all requests made within the same tick (aka the same event loop cycle) + +```ts + const client = new BatchRequest({ + input: `/batch`, + init: { method: "POST" } + }, + { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchResponse(response)) + }); + + const [user1, user2] = await Promise.all([ + client + .fetch(`/users/1`) + .then((res) => res.json()), + client + .fetch(`/users/2`) + .then((res) => res.json()), + ]); + + expect(user1).toEqual({ id: 1, name: "John Doe" }); + expect(user2).toEqual({ id: 2, name: "Jane Doe" }); +``` + +## Always Batch + +By default if only one request is pending, the request is sent immediately to the final endpoint without using the batch endpoint. +If you want to always use the batch endpoint, you can use the `alwaysBatch` option. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchResponse(response)), + alwaysBatch: true + }); +``` + +## Custom fetch + +If the platform you are running does not support fetch, but a library has a 100% compatible one, you should use it as a polyfill. +Batch request assumes there is a fetch implementation that is 100% compatible with the standard one. + +You can't just provite a custom fetch because behind the scene batch request uses the following objects : +- Request +- Response +- AbortSignal +- AbortController +- ReadStream + +All of which are part of the standard fetch API. + +👉 Custom fetch should only be used for intrumented fetch, A.K.A a fetch overload that adds caching, telemetry, logs, etc. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchResponse(response)), + fetch: myFetch + }); +``` + +## Streaming + +Batch request supports streaming, for the request body nothing to do, it's supported out the box. and for the response body you can replace the BatchResponse contructor +by BatchStreamResponse. +Streaming is useful to reduce the memory footprint of your application, especially if you are downloading large contents. +Also it allows to handle the one response from a batched request as soon as it's available, instead of waiting for the whole batch to be completed. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)) + }); +``` + +## React Native + +React Native does not support ReadableStream, so you need to use a polyfill or use dedicated react native implementation for BatchData and BatchResponse. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new ReactNativeBatchData(), + makeBatchResponse: (response) => new ReactNativeBatchResponse(response)) + }); +``` + +## canceling individual requests + +You can cancel requests individually using standard AborController. +If all requests are canceled, the batched request is canceled as well to return as soon as possible. + +```ts + const client = new BatchRequest({ + input: `/batch`, + init: { + method: "POST", + } + }, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)) + }); + + const controller = new AbortController(); + + const user1 = client + .fetch(`/users/1`, { signal: controller.signal }).then((res) => res.json()); + + const user2 = client + .fetch(`/users/2`).then((res) => res.json()); + + // be sure requests are sent + await sleep(100); + // abort request 1 afterwards + controller.abort(); + + await expect(user1).rejects.toThrow("Aborted"); + await expect(user2).resolves.toEqual({ id: 2, name: "Jane Doe" }); +``` + +## Behind the scenes + +Fetch batch uses multipart/mixed to send multiple requests in a single HTTP request. +Each individual request is sent as a part of the multipart/mixed request with application/http content type. +Each part is separated by a boundary. And each part starts with a Content-ID header that is used to match the response to the request. + +```ts + // individual requests must target the same host + const getUser1 = new Request(`http://localhost:${port}/get`, { + method: "GET", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + }), + }); + + // individual requests must target the same host + const renameUser2 = new Request(`http://localhost:${port}/patch`, { + method: "PATCH", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }), + body: JSON.stringify({ + name: "John Doe", + }), + }); + + const body = new BatchData(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + // use the batch endpoint to send the requests + const batched = await fetch(`http://localhost:${port}/batch`, { + method: "POST", + headers: body.getHeaders({ + 'x-custom-header': 'custom value' + }), + body: body.body(), + }).then((response) => new BatchResponse(response)); + + // you can iterate over the responses + for await (const [contentId,response] of batched) { + if(contentId === body.getRequestId(getUser1)) + console.log('getUser1 response',await response.json()) + else if(contentId === body.getRequestId(renameUser2)) + console.log('renameUser2 response',await response.json()) + } +``` diff --git a/packages/fetch-batch/jest.config.ts b/packages/fetch-batch/jest.config.ts new file mode 100644 index 00000000..587bf381 --- /dev/null +++ b/packages/fetch-batch/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 70, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/fetch-batch/package.json b/packages/fetch-batch/package.json new file mode 100644 index 00000000..f9d7fcc3 --- /dev/null +++ b/packages/fetch-batch/package.json @@ -0,0 +1,52 @@ +{ + "name": "@zodios/fetch-batch", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "zodios", + "mock", + "testing" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "express": "4.18.2", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4" + } +} \ No newline at end of file diff --git a/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap b/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap new file mode 100644 index 00000000..48e52a6b --- /dev/null +++ b/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BatchData makeBatchData should be able to batch requests 1`] = ` +"--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +GET /get HTTP/1.1 +accept: application/json; charset=utf-8 + + +--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +PATCH /patch HTTP/1.1 +accept: application/json; charset=utf-8 +content-type: application/json; charset=utf-8 + +{"name":"John Doe"} +--batch__1675206000000__batch-- +" +`; + +exports[`BatchData makeReactNativeBatchData should be able to batch requests 1`] = ` +"--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +GET /get HTTP/1.1 +accept: application/json; charset=utf-8 + + +--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +PATCH /patch HTTP/1.1 +accept: application/json; charset=utf-8 +content-type: application/json; charset=utf-8 + +{"name":"John Doe"} +--batch__1675206000000__batch-- +" +`; diff --git a/packages/fetch-batch/src/batch-data-react-native.ts b/packages/fetch-batch/src/batch-data-react-native.ts new file mode 100644 index 00000000..016c4ba2 --- /dev/null +++ b/packages/fetch-batch/src/batch-data-react-native.ts @@ -0,0 +1,111 @@ +import { IBatchData, BatchDataForeachCallback } from "./batch-data.types"; + +export class ReactNativeBatchData implements IBatchData { + #requests = new Map(); + #requestIdSuffix = `${Date.now()}@zodios.org`; + #boundary = `batch__${Date.now()}__batch`; + + constructor() {} + + get boundary() { + return this.#boundary; + } + + addRequest(request: Request) { + const requestId = `request-${this.#requests.size + 1}-${ + this.#requestIdSuffix + }`; + this.#requests.set(requestId, request); + return requestId; + } + + getHeaders(init?: HeadersInit) { + const headers = new Headers(init); + headers.set("Content-Type", `multipart/mixed; boundary=${this.#boundary}`); + return headers; + } + + [Symbol.iterator]() { + return this.#requests.entries(); + } + + requests() { + return this.#requests.values(); + } + + requestIds() { + return this.#requests.keys(); + } + + entries() { + return this.#requests.entries(); + } + + getRequest(requestOrResponseId: string) { + for (const id of this.requestIds()) { + if (requestOrResponseId.includes(id)) { + return this.#requests.get(id); + } + } + } + + forEach(callback: BatchDataForeachCallback) { + this.#requests.forEach((request, requestId) => + callback(request, requestId, this) + ); + } + + getRequestId(request: Request) { + for (const [requestId, req] of this.#requests.entries()) { + if (req === request) { + return requestId; + } + } + } + + async body() { + return this.#format(); + } + + #formatHeaders(headers: Headers) { + let result = ""; + for (const [name, value] of headers) { + result += `${name}: ${value}\r\n`; + } + result += "\r\n"; + return result; + } + + #formatPart(requestId: string) { + const headers = new Headers(); + headers.set("Content-ID", `<${requestId}>`); + headers.set("Content-Type", "application/http; msgtype=request"); + return this.#formatHeaders(headers); + } + + async #formatRequest(request: Request) { + const url = new URL(request.url); + let result = `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n`; + result += this.#formatHeaders(request.headers); + result += await request.text(); + return result; + } + + async #format() { + let result = ""; + const boundary = `--${this.#boundary}\r\n`; + const boundaryClose = `--${this.#boundary}--\r\n`; + for (const [requestId, request] of this.#requests) { + result += boundary; + result += this.#formatPart(requestId); + result += await this.#formatRequest(request); + result += "\r\n"; + } + result += boundaryClose; + return result; + } +} + +export function makeReactNativeBatchData() { + return new ReactNativeBatchData(); +} diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts new file mode 100644 index 00000000..05da3dc4 --- /dev/null +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -0,0 +1,137 @@ +import express from "express"; +import type { AddressInfo } from "net"; +import { makeBatchData } from "./batch-data"; +import { makeReactNativeBatchData } from "./batch-data-react-native"; + +function getUser1Req(port: number) { + return new Request(`http://localhost:${port}/get`, { + method: "GET", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + }), + }); +} + +function renameUser2Req(port: number) { + return new Request(`http://localhost:${port}/patch`, { + method: "PATCH", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }), + body: JSON.stringify({ + name: "John Doe", + }), + }); +} + +describe.each([{ make: makeBatchData }, { make: makeReactNativeBatchData }])( + "BatchData $make.name", + ({ make }) => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + res.json({ + url: req.url, + method: req.method, + headers: req.headers, + data: req.body.toString(), + }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + + jest.useFakeTimers(); + jest.setSystemTime(new Date(2023, 1, 1)); + }); + + afterAll((done) => { + jest.useRealTimers(); + server.close(done); + }); + + it("should be able to batch requests", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); + + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + const batched = await fetch(`http://localhost:${port}/batch`, { + method: "POST", + headers: body.getHeaders(), + body: await body.body(), + }).then((response) => response.json()); + + expect(batched.url).toBe("/batch"); + expect(batched.method).toBe("POST"); + expect(batched.headers["content-type"]).toContain("multipart/mixed"); + expect(batched.data).toMatchSnapshot(); + }); + + it("should be able to iterate over requests", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); + + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + const requests: Request[] = []; + for (const [, request] of body) { + requests.push(request); + } + expect(requests).toEqual([getUser1, renameUser2]); + + const requests2: Request[] = []; + for (const [, request] of body.entries()) { + requests2.push(request); + } + expect(requests2).toEqual([getUser1, renameUser2]); + + expect(Array.from(body.requests())).toEqual([getUser1, renameUser2]); + + expect(Array.from(body.requestIds())).toEqual([ + "request-1-1675206000000@zodios.org", + "request-2-1675206000000@zodios.org", + ]); + + body.forEach((request, contentId) => { + expect(request).toBe(body.getRequest(contentId)); + }); + + expect(body.getRequestId(getUser1)).toBe( + "request-1-1675206000000@zodios.org" + ); + expect(body.getRequestId(renameUser2)).toBe( + "request-2-1675206000000@zodios.org" + ); + + expect(body.boundary).toBe("batch__1675206000000__batch"); + }); + + it("should be able to get request by content id", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); + + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + expect( + body.getRequest("response-request-1-1675206000000@zodios.org") + ).toBe(getUser1); + expect( + body.getRequest("response-request-2-1675206000000@zodios.org") + ).toBe(renameUser2); + }); + } +); diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts new file mode 100644 index 00000000..efb93b1f --- /dev/null +++ b/packages/fetch-batch/src/batch-data.ts @@ -0,0 +1,132 @@ +import { IBatchData, BatchDataForeachCallback } from "./batch-data.types"; + +export class BatchData implements IBatchData { + #requests = new Map(); + #requestIdSuffix = `${Date.now()}@zodios.org`; + #boundary = `batch__${Date.now()}__batch`; + #encoder = new TextEncoder(); + + constructor() {} + + get boundary() { + return this.#boundary; + } + + addRequest(request: Request) { + const requestId = `request-${this.#requests.size + 1}-${ + this.#requestIdSuffix + }`; + this.#requests.set(requestId, request); + return requestId; + } + + getHeaders(init?: HeadersInit) { + const headers = new Headers(init); + headers.set("Content-Type", `multipart/mixed; boundary=${this.#boundary}`); + return headers; + } + + [Symbol.iterator]() { + return this.#requests.entries(); + } + + requests() { + return this.#requests.values(); + } + + requestIds() { + return this.#requests.keys(); + } + + entries() { + return this.#requests.entries(); + } + + getRequest(requestOrResponseId: string) { + for (const id of this.requestIds()) { + if (requestOrResponseId.includes(id)) { + return this.#requests.get(id); + } + } + } + + forEach(callback: BatchDataForeachCallback) { + this.#requests.forEach((request, requestId) => + callback(request, requestId, this) + ); + } + + getRequestId(request: Request) { + for (const [requestId, req] of this.#requests.entries()) { + if (req === request) { + return requestId; + } + } + } + + body() { + const iterator = this.#encodedIterator(); + return new ReadableStream({ + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value); + } + }, + }); + } + + #formatHeaders(headers: Headers) { + let result = ""; + for (const [name, value] of headers) { + result += `${name}: ${value}\r\n`; + } + result += "\r\n"; + return result; + } + + *#encodePart(requestId: string) { + const headers = new Headers(); + headers.set("Content-ID", `<${requestId}>`); + headers.set("Content-Type", "application/http; msgtype=request"); + yield this.#encoder.encode(this.#formatHeaders(headers)); + } + + async *#encodeRequest(request: Request) { + const url = new URL(request.url); + yield this.#encoder.encode( + `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n` + ); + yield this.#encoder.encode(this.#formatHeaders(request.headers)); + if (request.body) { + const reader = request.body.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + reader.releaseLock(); + break; + } + yield value; + } + } + } + + async *#encodedIterator() { + const boundary = this.#encoder.encode(`--${this.#boundary}\r\n`); + const boundaryClose = this.#encoder.encode(`--${this.#boundary}--\r\n`); + + for (const [requestId, request] of this.#requests) { + yield boundary; + yield* this.#encodePart(requestId); + yield* this.#encodeRequest(request); + yield this.#encoder.encode("\r\n"); + } + yield boundaryClose; + } +} + +export function makeBatchData() { + return new BatchData(); +} diff --git a/packages/fetch-batch/src/batch-data.types.ts b/packages/fetch-batch/src/batch-data.types.ts new file mode 100644 index 00000000..41299eda --- /dev/null +++ b/packages/fetch-batch/src/batch-data.types.ts @@ -0,0 +1,19 @@ +export type BatchDataForeachCallback = ( + request: Request, + requestId: string, + batchdata: IBatchData +) => void; + +export interface IBatchData { + get boundary(): string; + addRequest(request: Request): string; + getHeaders(init?: HeadersInit): Headers; + requests(): IterableIterator; + requestIds(): IterableIterator; + entries(): IterableIterator<[string, Request]>; + getRequest(requestOrResponseId: string): Request | undefined; + forEach(callback: BatchDataForeachCallback): void; + getRequestId(request: Request): string | undefined; + body(): ReadableStream | Promise | undefined; + [Symbol.iterator](): IterableIterator<[string, Request]>; +} diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts new file mode 100644 index 00000000..067f2a50 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -0,0 +1,502 @@ +import express from "express"; +import type { AddressInfo } from "net"; +import { BatchRequest } from "./batch-request"; +import { makeBatchResponse } from "./batch-response"; +import { makeBatchStreamResponse } from "./batch-response-stream"; +import { makeReactNativeBatchResponse } from "./batch-response-react-native"; +import { makeBatchData } from "./batch-data"; +import { makeReactNativeBatchData } from "./batch-data-react-native"; + +const responseDatas = [ + `Preamble +can be anything and should be ignored +--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +`, + `HTTP/1.1 200 OK +Content-Type: application/json +ETag: "etag/pony" + +`, + `{ + "id": 1,`, + ` + "name": "john doe" +} +`, + `--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +`, + `HTTP/1.1 200 OK +Content-Type: application/json;`, + ` + charset=UTF-8 +ETag: "etag/sheep" + +`, + `{ + "id": 2,`, + ` + "name": "jane doe" +} +`, + `--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +`, + `HTTP/1.1 304 Not Modified + + +`, + `--batch__1675206000000__batch-- +Epilogue can be anything +and should be ignored`, +]; + +const responseData = responseDatas.join("").replace(/\n/g, "\r\n"); + +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +describe.each([ + { + makeBatchedResponse: makeBatchResponse, + makeBatchedData: makeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeBatchResponse, + makeBatchedData: makeBatchData, + batch: "/batch-stream", + }, + { + makeBatchedResponse: makeBatchStreamResponse, + makeBatchedData: makeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeBatchStreamResponse, + makeBatchedData: makeBatchData, + batch: "/batch-stream", + }, + { + makeBatchedResponse: makeReactNativeBatchResponse, + makeBatchedData: makeReactNativeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeReactNativeBatchResponse, + makeBatchedData: makeReactNativeBatchData, + batch: "/batch-stream", + }, +])( + `BatchRequest $makeBatchedData.name $makeBatchedData.name with endpoint '$batch'`, + ({ makeBatchedResponse, makeBatchedData, batch }) => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.json()); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let response = responseData; + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + response = response.replace(`PLACEHOLDER${i + 1}`, id); + }); + res.status(200).send(response); + }); + + app.post("/batch-stream", async (req, res) => { + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let responses = responseDatas.map((response) => + response.replace(/\n/g, "\r\n") + ); + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + responses = responses.map((response) => + response.replace(`PLACEHOLDER${i + 1}`, id) + ); + }); + res.writeHead(200); + for await (const response of responses) { + res.write(response); + await sleep(100); + } + res.end(); + }); + + // simulate a proxy timeout that don't handle multipart/mixed + app.post("/batch-pending", async (req, res) => { + await sleep(1000); + res.status(504).json({ + error: "timeout", + }); + }); + + // simulate an internal server error that don't send back multipart/mixed + app.post("/batch-error", (req, res) => { + res.status(500).json({ + error: "internal server error", + }); + }); + + app.get("/users/:id", (req, res) => { + res.status(200).json({ + id: req.params.id, + name: "john doe", + }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll((done) => { + server.close(done); + }); + + it("should be able to fetch one request", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + const user7 = await client + .fetch(`http://localhost:${port}/users/7`) + .then((res) => res.json()); + + expect(user7).toEqual({ + id: "7", + name: "john doe", + }); + }); + + it("should be able to fetch multiple requests", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + + expect(user1).toEqual({ + id: 1, + name: "john doe", + }); + expect(user2).toEqual({ + id: 2, + name: "jane doe", + }); + expect(nothing.status).toBe(304); + }); + + it("should error if batch endpoint errors", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-error`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + expect(user1).toEqual({ + error: "internal server error", + }); + expect(user2).toEqual({ + error: "internal server error", + }); + expect(nothing.status).toBe(500); + }); + + it("should cancel one request if asked to before batching", async () => { + const controller = new AbortController(); + controller.abort(); + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); + }); + + it("should cancel one request if asked to after batching", async () => { + const controller = new AbortController(); + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-stream`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => { + controller.abort(); + return res.json(); + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + if (nothing.status === "rejected") { + expect(nothing.reason).toEqual(""); + } + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); + }); + + it("should not cancel requests if asked to before batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + client.cancel(); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("fulfilled"); + expect(nothing.status).toBe("fulfilled"); + }); + + it("should cancel all requests if asked to after batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + client.cancel(); + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("rejected"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("rejected"); + + const [user1Promise2, user2Promise2, nothingPromise2] = [ + client.fetch(`http://localhost:${port}/users/1`), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user12, user22, nothing2] = await Promise.allSettled([ + user1Promise2, + user2Promise2, + nothingPromise2, + ]); + + expect(user12.status).toBe("fulfilled"); + expect(user22.status).toBe("fulfilled"); + expect(nothing2.status).toBe("fulfilled"); + }); + + it("should cancel all individual requests if asked to after batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-pending`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const controller = new AbortController(); + + const user1Promise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); + const user2Promise = client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => res.json()); + const nothingPromise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); + await sleep(100); + controller.abort(); + + await expect(user1Promise).rejects.toThrow("Aborted"); + await expect(user2Promise).rejects.toThrow("Aborted"); + await expect(nothingPromise).rejects.toThrow("Aborted"); + + const [user12, user22, nothing2] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + ]); + + expect(user12).toEqual({ + error: "timeout", + }); + expect(user22).toEqual({ + error: "timeout", + }); + expect(nothing2).toEqual({ + error: "timeout", + }); + }); + } +); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts new file mode 100644 index 00000000..612bfe25 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.ts @@ -0,0 +1,171 @@ +import type { IBatchData } from "./batch-data.types"; +import { + cancelAbortedRequests, + cancelRequestInQueue, + isMultipartMixed, +} from "./batch-request.utils"; + +import type { + BatchCallbacks, + BatchRequestEndpoint, + BatchRequestOptions, +} from "./batch-request.types"; + +/** + * A batch request handler + * + * It will batch all requests made within the same tick (aka within the same event loop) + * using a multipart/mixed request with application/http envelopes. + * Your server should be able to handle this request and return a multipart/mixed response + */ +export class BatchRequest { + #queue = new Map(); + #timer?: ReturnType; + #input: RequestInfo | URL; + #init?: RequestInit; + #fetch: typeof fetch; + #controller?: AbortController; + #alwaysBatch: boolean; + #makeBatchData: () => IBatchData; + #makeBatchResponse: (response: Response) => AsyncIterable<[string, Response]>; + + /** + * create a new batch request handler + * @param batchEndpoint - the endpoint to send the batch request to with it's fetch init options + * @param options - options to allow to use a custom fetch function or to allways batch requests even if there is only one request pending. + * + * @details allwaysBatch set to false by default, meaning it will not batch requests if there is only one request pending. + */ + constructor( + batchEndpoint: BatchRequestEndpoint, + options: BatchRequestOptions + ) { + this.#input = batchEndpoint.input; + this.#init = batchEndpoint.init; + this.#fetch = options.fetch ?? fetch; + this.#alwaysBatch = options.alwaysBatch ?? false; + this.#makeBatchData = options.makeBatchData; + this.#makeBatchResponse = options.makeBatchResponse; + } + + /** + * cancel all pending requests + * if no request is pending, it does nothing + */ + cancel() { + if (this.#controller) { + this.#controller.abort(); + } + } + + /** + * fetch a request and return a promise that resolves with the response + * + * it will batch all requests made within the same tick (aka within the same event loop) + * + * @param input - a url or string or a request object, same as original fetch + * @param init - request init object, same as original fetch + * @returns the response + */ + async fetch(input: RequestInfo | URL, init?: RequestInit): Promise { + return new Promise((resolve, reject) => { + const request = new Request(input, init); + this.#queue.set(request, { resolve, reject }); + if (!this.#timer) { + this.#controller = new AbortController(); + this.#timer = setTimeout(() => this.#dispatch(), 0); + } + }); + } + + /** + * clear the batch queue + */ + #clear() { + clearTimeout(this.#timer); + this.#timer = undefined; + this.#controller = undefined; + this.#queue.clear(); + } + + /** + * process all the batched requests within the same tick + */ + async #dispatch() { + const queue = new Map(this.#queue); + const controller = this.#controller; + this.#clear(); + cancelAbortedRequests(queue); + + if (queue.size === 0) { + return; + } + if (queue.size === 1 && !this.#alwaysBatch) { + const [request, callbacks] = queue.entries().next().value; + try { + const response = await this.#fetch(request); + callbacks.resolve(response); + } catch (error) { + callbacks.reject(error); + } + return; + } + + const batchData = this.#makeBatchData(); + for (const request of queue.keys()) { + batchData.addRequest(request); + request.signal?.addEventListener("abort", () => + cancelRequestInQueue(queue, request, controller) + ); + } + let body: ReadableStream | string | undefined; + const batchBody = batchData.body(); + if (batchBody instanceof ReadableStream) { + body = batchBody; + } else if (batchBody instanceof Promise) { + body = await batchBody; + } + + try { + const response = await this.#fetch(this.#input, { + ...this.#init, + headers: batchData.getHeaders(this.#init?.headers), + body, + signal: controller?.signal, + }); + if (isMultipartMixed(response.headers)) { + const batchResponse = this.#makeBatchResponse(response); + for await (const [contentId, response] of batchResponse) { + const request = batchData.getRequest(contentId); + if (request) { + request.signal?.addEventListener("abort", () => + response.body?.cancel() + ); + const callbacks = queue.get(request); + queue.delete(request); + if (callbacks) { + callbacks.resolve(response); + } + } + } + if (queue.size > 0) { + for (const callbacks of queue.values()) { + callbacks.reject(new Error("response count mismatch")); + } + } + } else { + // response is not not multipart/mixed, so it's probably an error by an intermediary proxy + // let's just resolve all requests with the same response + // this is not ideal, but it's better than rejecting all requests + // it allows the user to handle the error in a more granular way + for (const callbacks of queue.values()) { + callbacks.resolve(response.clone()); + } + } + } catch (error) { + for (const callbacks of queue.values()) { + callbacks.reject(error); + } + } + } +} diff --git a/packages/fetch-batch/src/batch-request.types.ts b/packages/fetch-batch/src/batch-request.types.ts new file mode 100644 index 00000000..dc1dc8e2 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.types.ts @@ -0,0 +1,18 @@ +import { IBatchData } from "./batch-data.types"; + +export type BatchCallbacks = { + resolve: (value: Response) => void; + reject: (reason?: unknown) => void; +}; + +export type BatchRequestOptions = { + fetch?: typeof fetch; + alwaysBatch?: boolean; + makeBatchData: () => IBatchData; + makeBatchResponse: (response: Response) => AsyncIterable<[string, Response]>; +}; + +export type BatchRequestEndpoint = { + input: RequestInfo | URL; + init?: RequestInit; +}; diff --git a/packages/fetch-batch/src/batch-request.utils.ts b/packages/fetch-batch/src/batch-request.utils.ts new file mode 100644 index 00000000..6baf10b3 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.utils.ts @@ -0,0 +1,30 @@ +import { BatchCallbacks } from "./batch-request.types"; + +export function cancelAbortedRequests(queue: Map) { + for (const [request, callbacks] of queue.entries()) { + if (request.signal.aborted) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + } + } +} + +export function cancelRequestInQueue( + queue: Map, + request: Request, + controller?: AbortController +) { + const callbacks = queue.get(request); + if (callbacks) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + if (queue.size === 0) { + // abort the batch request if all requests are aborted + controller?.abort(); + } + } +} + +export function isMultipartMixed(headers: Headers) { + return headers.get("Content-Type")?.startsWith("multipart/mixed"); +} diff --git a/packages/fetch-batch/src/batch-response-react-native.ts b/packages/fetch-batch/src/batch-response-react-native.ts new file mode 100644 index 00000000..e2d0ca7e --- /dev/null +++ b/packages/fetch-batch/src/batch-response-react-native.ts @@ -0,0 +1,175 @@ +import { + parseBoundary, + parseContentId, + parseHeadersString, + parseStatusLineString, +} from "./batch-response.utils"; + +/** + * A BatchResponse implementation for react native not using streams + * it's less efficient than the stream implementation but it's the only way to make it work on react native + * since it only supports .text() and .json() methods on the response + */ +export class ReactNativeBatchResponse + implements AsyncIterable<[string, Response]> +{ + #response: Response; + + constructor(response: Response) { + this.#response = response; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * parse the multipart/mixed response and store each response in a map + * where the key is the content id of the request + * + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := "--" boundary "--" CRLF + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + const boundary = parseBoundary(this.#response.headers); + const data = await this.#response.text(); + + const boundaryPattern = `--${boundary}\r\n`; + const endBoundaryPattern = `--${boundary}--\r\n`; + const boundaryIndexes = this.#findAllIndexes(data, boundaryPattern); + const endBoundaryIndex = data.indexOf(endBoundaryPattern); + if (endBoundaryIndex === -1) { + throw new Error( + "BatchResponse: Invalid response, no ending boundary found" + ); + } + const indexes = boundaryIndexes.map((index, i) => ({ + start: index + boundaryPattern.length, + end: (boundaryIndexes[i + 1] || endBoundaryIndex) - 2, + })); + for (const { start, end } of indexes) { + const parsedResponse = this.#parseEmbeddedResponse( + data.substring(start, end) + ); + if (parsedResponse) { + yield [parsedResponse.contentId, parsedResponse.response] as [ + string, + Response + ]; + } + } + } + + #findAllIndexes(data: string, pattern: string) { + const indexes = []; + let index = data.indexOf(pattern); + while (index !== -1) { + indexes.push(index); + index = data.indexOf(pattern, index + pattern.length); + } + return indexes; + } + + /** + * parse a multipart/mixed response part only allowing application/http content type + * @param data - The data of the multipart/mixed response + * @returns - The content id and the response + * @example + * ```yaml + * Content-Type: application/http + * Content-ID: + * + * HTTP/1.1 200 OK + * Content-Type: application/json + * Content-Length: response_part_2_content_length + * ETag: "etag/sheep" + * + * { + * "kind": "farm#animal", + * "etag": "etag/sheep", + * "selfLink": "/farm/v1/animals/sheep", + * "animalName": "sheep", + * "animalAge": 5, + * "peltColor": "green" + * } + * ``` + */ + #parseEmbeddedResponse(data: string) { + const dividerPattern = "\r\n\r\n"; + const newLinePattern = "\r\n"; + const partHeadersEndIndex = data.indexOf(dividerPattern); + if (partHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid part, no headers found"); + } + const partHeadersString = data.substring(0, partHeadersEndIndex); + const partHeaders = parseHeadersString(partHeadersString); + const contentType = partHeaders.get("content-type"); + if (!contentType?.startsWith("application/http")) { + return undefined; + } + + const partBodyString = data.substring( + partHeadersEndIndex + dividerPattern.length + ); + const responseHeadersEndIndex = partBodyString.indexOf(dividerPattern); + if (responseHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid response"); + } + const responseStatusLineEndIndex = partBodyString.indexOf(newLinePattern); + if (responseStatusLineEndIndex === -1) { + throw new Error("BatchResponse: Invalid response status line"); + } + const responseStatusLineString = partBodyString.substring( + 0, + responseStatusLineEndIndex + ); + const responseHeadersString = partBodyString.substring( + responseStatusLineEndIndex + newLinePattern.length, + responseHeadersEndIndex + ); + const responseBodyString = partBodyString.substring( + responseHeadersEndIndex + dividerPattern.length + ); + const responseStatusLine = parseStatusLineString(responseStatusLineString); + const responseHeaders = parseHeadersString(responseHeadersString); + + const contentId = parseContentId(partHeaders); + const response = new Response( + responseBodyString.length > 0 ? responseBodyString : undefined, + { + status: responseStatusLine.status, + statusText: responseStatusLine.statusText, + headers: responseHeaders, + } + ); + + return { + contentId, + response, + }; + } +} + +export function makeReactNativeBatchResponse(response: Response) { + return new ReactNativeBatchResponse(response); +} diff --git a/packages/fetch-batch/src/batch-response-stream.test.ts b/packages/fetch-batch/src/batch-response-stream.test.ts new file mode 100644 index 00000000..d26ec8e8 --- /dev/null +++ b/packages/fetch-batch/src/batch-response-stream.test.ts @@ -0,0 +1,324 @@ +import { + BatchStreamResponse, + HttpBatchTansformer, +} from "./batch-response-stream"; + +const mockedResponseData = `Preamble +can be anything and should be ignored +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +ETag: "etag/pony" + +{ + "kind": "farm#animal", + "etag": "etag/pony", + "selfLink": "/farm/v1/animals/pony", + "animalName": "pony", + "animalAge": 34, + "peltColor": "white" +} +--batch_foobarbaz +Content-Type: application/http; msgtype=response; msgtype is optional and even this comment should be ignored +Content-ID: + +HTTP/1.1 304 Not Modified +ETag: "etag/pony" + + +--batch_foobarbaz +Content-ID: response-item2:12930812@barnyard.example.com +Content-Type: application/http + +HTTP/1.1 200 OK +Content-Type: application/json; + charset=UTF-8 +ETag: "etag/sheep" + +{ + "kind": "farm#animal", + "etag": "etag/sheep", + "selfLink": "/farm/v1/animals/sheep", + "animalName": "sheep", + "animalAge": 5, + "peltColor": "green" +} + +--batch_foobarbaz-- +Epilogue can be anything +and should be ignored`.replace(/\n/g, "\r\n"); + +describe("BatchResponseStream", () => { + describe("HttpBatchTansformer", () => { + it("should parse a multipart/mixed response in one buffer", async () => { + const stream = new ReadableStream({ + async pull(controller) { + controller.enqueue(new TextEncoder().encode(mockedResponseData)); + controller.close(); + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await stream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + + it("should parse a multipart/mixed response cut line by line", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + } else { + controller.close(); + } + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await chunckedStream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + it("should parse a multipart/mixed response even if cut in the middle of crlf", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + } else { + controller.close(); + } + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await chunckedStream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + + it("should throw if preamble size is too big", async () => { + const stream = new ReadableStream({ + async pull(controller) { + controller.enqueue(new TextEncoder().encode("Preamble".repeat(100))); + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await expect( + stream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ) + ).rejects.toThrowError("Preamble too large"); + }); + }); + + describe("BatchStreamResponse", () => { + it("should parse a multipart/mixed response", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + // simulate a slow stream + await new Promise((resolve) => setTimeout(resolve, 100)); + } else { + controller.close(); + } + }, + }); + + const mockedResponse = new Response(chunckedStream, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchStreamResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + console.time("json item 1"); + // await expect(response.json()).resolves.toEqual({ + // kind: "farm#animal", + // etag: "etag/pony", + // selfLink: "/farm/v1/animals/pony", + // animalName: "pony", + // animalAge: 34, + // peltColor: "white", + // }); + await response.body?.cancel(); + console.timeEnd("json item 1"); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + console.time("json item 2"); + await expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + console.timeEnd("json item 2"); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + console.time("text item 3"); + await expect(response.text()).resolves.toBe(""); + console.timeEnd("text item 3"); + } + break; + } + } + expect(count).toBe(3); + }); + + it("should parse a multipart/mixed response when cancelled", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + // simulate a slow stream + await new Promise((resolve) => setTimeout(resolve, 100)); + } else { + controller.close(); + } + }, + }); + + const mockedResponse = new Response(chunckedStream, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchStreamResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + await response.body?.cancel(); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + await expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + await expect(response.text()).resolves.toBe(""); + } + break; + } + } + expect(count).toBe(3); + }); + }); +}); diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts new file mode 100644 index 00000000..54344794 --- /dev/null +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -0,0 +1,518 @@ +import { concat, SearchArray } from "./utils"; +import { + ensureBody, + parseBoundary, + parseContentId, + parseHeaders, + parseStatusLine, +} from "./batch-response.utils"; + +type ChunkType = "multipart-header" | "statusline" | "header" | "body"; + +type HttpMultipartChunk = { + type: ChunkType; + data: Uint8Array; + done?: boolean; +}; + +const STATUS_PREAMBLE = "preamble"; +const STATUS_MULTIPART_HEADER = "multipart-header"; +const STATUS_STATUSLINE = "statusline"; +const STATUS_HEADER = "header"; +const STATUS_BODY = "body"; +const STATUS_EPILOGUE = "epilogue"; + +export interface HttpBatchTansformerOptions { + /** + * max discard size for preamble and epilogue + * protect against preamble attacks, default to 16kb + */ + maxDiscardSize?: number; + /** + * max status line size + * protect against status line overflow attacks, default to 1kb + */ + maxStatusLineSize?: number; + /** + * max header size + * protect against header overflow attacks, default to 16kb + */ + maxHeaderSize?: number; + /** + * max body size + * protect against body overflow attacks, default to 1mb + */ + maxChunkBodySize?: number; +} + +/** + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := "--" boundary "--" CRLF + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + */ +export class HttpBatchTansformer + implements Transformer +{ + #state: ChunkType | "preamble" | "epilogue" = STATUS_PREAMBLE; + #boundary: string; + #buffer?: Uint8Array; + #encoder = new TextEncoder(); + #searchStartBoundary: SearchArray; + #searchBoundary: SearchArray; + #searchEndBoundary: SearchArray; + #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); + #searchDivider = new SearchArray(this.#encoder.encode("\r\n\r\n")); + #maxDiscardSize: number; + #maxStatusLineSize: number; + #maxHeaderSize: number; + #maxChunkBodySize: number; + #epilogueSize = 0; + + /** + * create a transformer for multipart/mixed content type that handle application/http envelop + * @param boundary - boundary string to separate each part + * @param options - options for the transformer to protect against overflow attacks + */ + constructor(boundary: string, options?: HttpBatchTansformerOptions) { + this.#boundary = boundary; + this.#searchStartBoundary = new SearchArray( + this.#encoder.encode(`--${this.#boundary}\r\n`) + ); + this.#searchBoundary = new SearchArray( + this.#encoder.encode(`\r\n--${this.#boundary}\r\n`) + ); + this.#searchEndBoundary = new SearchArray( + this.#encoder.encode(`\r\n--${this.#boundary}--\r\n`) + ); + this.#maxDiscardSize = options?.maxDiscardSize ?? 16 * 1024; + this.#maxStatusLineSize = options?.maxStatusLineSize ?? 1 * 1024; + this.#maxHeaderSize = options?.maxHeaderSize ?? 16 * 1024; + this.#maxChunkBodySize = options?.maxChunkBodySize ?? 1 * 1024 * 1024; + } + + /** + * transform readable stream of Uint8Array to an stream of HttpMultipartChunk + * @param chunk - chunk of data to parse + * @param controller - transform stream controller + * @returns void + */ + transform( + chunk: Uint8Array, + controller: TransformStreamDefaultController + ) { + if (this.#buffer) { + this.#buffer = concat([this.#buffer, chunk]); + } else { + this.#buffer = chunk; + } + + while (this.#buffer?.length > 0) { + switch (this.#state) { + case STATUS_PREAMBLE: + if (!this.#parsePreamble()) return; + break; + case STATUS_MULTIPART_HEADER: + if (!this.#parseMultipart(controller)) return; + break; + case STATUS_STATUSLINE: + if (!this.#parseStatusLine(controller)) return; + break; + case STATUS_HEADER: + if (!this.#parseHeader(controller)) return; + break; + case STATUS_BODY: + if (!this.#parseBody(controller)) return; + break; + case STATUS_EPILOGUE: + if (!this.#parseEpilogue()) return; + break; + } + } + } + + /** + * we just discard the preamble + * @param controller - transform stream controller + * @returns true if preamble is parsed and advance to next state + */ + #parsePreamble() { + const index = this.#searchStartBoundary.search(this.#buffer!); + if (index !== -1) { + this.#state = STATUS_MULTIPART_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchStartBoundary.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxDiscardSize) { + throw new Error("Preamble too large"); + } + return false; + } + + /** + * parse the multipart/mixed header + * @param controller - transform stream controller + * @returns true if header is parsed and advance to next state + */ + #parseMultipart( + controller: TransformStreamDefaultController + ) { + const index = this.#searchDivider.search(this.#buffer!); + if (index !== -1) { + const header = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_MULTIPART_HEADER, data: header }); + this.#state = STATUS_STATUSLINE; + this.#buffer = this.#buffer!.subarray( + index + this.#searchDivider.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxHeaderSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + return false; + } + + /** + * parse http status line - keep in mind that status line is terminated by newline + * @param controller - transform stream controller + * @returns true if status line is parsed and advance to next state + */ + #parseStatusLine( + controller: TransformStreamDefaultController + ) { + const index = this.#searchNewline.search(this.#buffer!); + if (index !== -1) { + const statusLine = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_STATUSLINE, data: statusLine }); + this.#state = STATUS_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchNewline.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxStatusLineSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + return false; + } + + /** + * parse http header block - keep in mind that header block is terminated by an empty line + * @param controller - transform stream controller + * @returns true if header is completly parsed and advance to next state + */ + #parseHeader( + controller: TransformStreamDefaultController + ) { + const index = this.#searchDivider.search(this.#buffer!); + if (index !== -1) { + const header = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_HEADER, data: header }); + this.#state = STATUS_BODY; + this.#buffer = this.#buffer!.subarray( + index + this.#searchDivider.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxHeaderSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + + return false; + } + + /** + * parse http body + * + * It will try to not accumulate the whole body in memory + * but it will return a body chunk if it can guarantee that + * the last bytes of body chunk does not contain a CR + * the last bytes being the size of the end boundary + * this allows to stream the body chunks to as a ReadableStream + * + * @param controller - transform stream controller + * @returns true if body end is found and advance to next state + */ + #parseBody(controller: TransformStreamDefaultController) { + const index = this.#searchBoundary.search(this.#buffer!); + if (index !== -1) { + const body = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_BODY, data: body, done: true }); + this.#state = STATUS_MULTIPART_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchBoundary.pattern.length + ); + return true; + } else { + const index = this.#searchEndBoundary.search(this.#buffer!); + if (index !== -1) { + const body = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_BODY, data: body, done: true }); + this.#state = STATUS_EPILOGUE; + this.#buffer = this.#buffer!.subarray( + index + this.#searchEndBoundary.pattern.length + ); + return true; + } + // 13 is CR in CRLF that may be the start of a boundary + else if ( + this.#buffer!.indexOf(13, -this.#searchEndBoundary.pattern.length) === + -1 + ) { + controller.enqueue({ + type: STATUS_BODY, + data: this.#buffer!, + done: false, + }); + this.#buffer = undefined; + return false; + } + } + + if (this.#buffer!.length > this.#maxChunkBodySize) { + throw new Error( + `Chunk body size exceeded maxChunkBodySize : ${ + this.#maxChunkBodySize + } bytes` + ); + } + return false; + } + + /** + * we just discard the epilogue + * @param controller - the controller of the transform stream + * @returns true + */ + #parseEpilogue() { + this.#epilogueSize += this.#buffer!.length; + if (this.#epilogueSize > this.#maxDiscardSize) { + throw new Error(`Epilogue too large`); + } + this.#buffer = undefined; + return true; + } +} + +class HttpBodyStreamSource implements UnderlyingDefaultSource { + #reader: ReadableStreamDefaultReader; + #completed = false; + #reading = false; + #cancelled = false; + #completedPromise: Promise; + #completedPromiseResolve!: () => void; + + /** + * Create a new HttpBodyStreamSource + * + * The HttpBodyStreamSource is a ReadableStreamSource that will + * read the body of a multipart stream that will complete when + * a boundary is found + * + * @param reader - the reader of the multipart stream + */ + constructor(reader: ReadableStreamDefaultReader) { + this.#reader = reader; + this.#completedPromise = new Promise((resolve) => { + this.#completedPromiseResolve = resolve; + }); + } + + /** + * a promise fired when the body is completely read + * @returns a promise that will resolve when the body is completly read from the stream + */ + completed() { + return this.#completedPromise; + } + + /** + * resolve the completed promise and set the completed flags + */ + #setCompleted() { + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + } + + /** + * consume the body until a boundary is found + * this is used when the stream is cancelled + * to discard the rest of the body + */ + async #consumeBody() { + while (true) { + const { value, done } = await this.#reader.read(); + if (done || value.done) break; + } + } + + /** + * pull one chunk from the body at a time + * @param controller - the controller of the readable stream + * @returns void + */ + async pull(controller: ReadableStreamDefaultController) { + if (this.#completed) return controller.close(); + + this.#reading = true; + + if (this.#cancelled) { + this.#setCompleted(); + return controller.close(); + } + + const { value: body, done: bodyDone } = await this.#reader.read(); + if (this.#cancelled) { + if (body && !body?.done) { + await this.#consumeBody(); + } + this.#setCompleted(); + return controller.close(); + } + if (body?.type !== STATUS_BODY) { + this.#setCompleted(); + controller.close(); + throw new Error(`Unexpected body type ${body?.type}`); + } + if (bodyDone || body.done) { + if (body.data) controller.enqueue(body.data); + this.#setCompleted(); + return controller.close(); + } + controller.enqueue(body.data); + this.#reading = false; + } + async cancel() { + this.#cancelled = true; + if (!this.#completed && !this.#reading) { + this.#reading = true; + await this.#consumeBody(); + this.#setCompleted(); + } + } +} + +export class BatchStreamResponse implements AsyncIterable<[string, Response]> { + #response: Response; + #options?: HttpBatchTansformerOptions; + + constructor(response: Response, options?: HttpBatchTansformerOptions) { + this.#response = response; + this.#options = options; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + const boundary = parseBoundary(this.#response.headers); + ensureBody(this.#response.body); + const stream = this.#response.body.pipeThrough( + new TransformStream(new HttpBatchTansformer(boundary, this.#options)) + ); + const reader = stream.getReader(); + let currentBodyStreamSource: HttpBodyStreamSource | undefined; + + while (true) { + // we wait until previous body is consumed or cancelled + await currentBodyStreamSource?.completed(); + const multipart = await this.#parseMultipartHeader(reader); + if (multipart.done) break; + const embedded = await this.#parseEmbeddedResponse(reader); + currentBodyStreamSource = embedded.bodyStreamSource; + yield [multipart.contentId, embedded.response] as [string, Response]; + } + } + + async #parseMultipartHeader( + reader: ReadableStreamDefaultReader + ) { + const { value, done } = await reader.read(); + + if (done) return { done }; + if (value.type !== STATUS_MULTIPART_HEADER) { + throw new Error("BatchResponse: Invalid multipart header"); + } + const partHeaders = parseHeaders(value.data); + const contentId = parseContentId(partHeaders); + const contentType = partHeaders.get("content-type"); + if (!contentType || !contentType.startsWith("application/http")) { + throw new Error( + "BatchResponse: Invalid content type, expected application/http" + ); + } + return { done, contentId }; + } + + async #parseEmbeddedResponse( + reader: ReadableStreamDefaultReader + ) { + const { value: statusLine, done: statusLineDone } = await reader.read(); + if (statusLineDone || statusLine.type !== STATUS_STATUSLINE) { + throw new Error("BatchResponse: Invalid status line"); + } + const { status, statusText } = parseStatusLine(statusLine.data); + const { value: headers, done: headersDone } = await reader.read(); + if (headersDone || headers.type !== STATUS_HEADER) { + throw new Error("BatchResponse: Invalid headers"); + } + const responseHeaders = parseHeaders(headers.data); + if (status === 204 || status === 304) { + const { value: body, done: bodyDone } = await reader.read(); + if (body && (body.type !== STATUS_BODY || !body.done)) { + throw new Error("BatchResponse: Body not empty"); + } + return { + response: new Response(undefined, { + status, + statusText, + headers: responseHeaders, + }), + }; + } + const bodyStreamSource = new HttpBodyStreamSource(reader); + const bodyStream = new ReadableStream(bodyStreamSource); + const response = new Response(bodyStream, { + status, + statusText, + headers: responseHeaders, + }); + return { bodyStreamSource, response }; + } +} +export function makeBatchStreamResponse( + response: Response, + options?: HttpBatchTansformerOptions +): BatchStreamResponse { + return new BatchStreamResponse(response, options); +} diff --git a/packages/fetch-batch/src/batch-response.test.ts b/packages/fetch-batch/src/batch-response.test.ts new file mode 100644 index 00000000..e4d80019 --- /dev/null +++ b/packages/fetch-batch/src/batch-response.test.ts @@ -0,0 +1,116 @@ +import { BatchResponse } from "./batch-response"; + +const mockedResponseData = `Preamble +can be anything and should be ignored +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +ETag: "etag/pony" + +{ + "kind": "farm#animal", + "etag": "etag/pony", + "selfLink": "/farm/v1/animals/pony", + "animalName": "pony", + "animalAge": 34, + "peltColor": "white" +} + +--batch_foobarbaz +Content-Type: application/http; msgtype=response; msgtype is optional and even this comment should be ignored +Content-ID: response-item2:12930812@barnyard.example.com + +HTTP/1.1 200 OK +Content-Type: application/json; + charset=UTF-8 +ETag: "etag/sheep" + +{ + "kind": "farm#animal", + "etag": "etag/sheep", + "selfLink": "/farm/v1/animals/sheep", + "animalName": "sheep", + "animalAge": 5, + "peltColor": "green" +} +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 304 Not Modified + + +--batch_foobarbaz-- +Epilogue can be anything +and should be ignored`.replace(/\n/g, "\r\n"); + +describe("BatchResponse", () => { + it("should parse a multipart/mixed response", async () => { + const mockedResponse = new Response(mockedResponseData, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/pony", + selfLink: "/farm/v1/animals/pony", + animalName: "pony", + animalAge: 34, + peltColor: "white", + }); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + expect(response.text()).resolves.toBe(""); + } + break; + } + } + expect(count).toBe(3); + }); +}); diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts new file mode 100644 index 00000000..21065782 --- /dev/null +++ b/packages/fetch-batch/src/batch-response.ts @@ -0,0 +1,228 @@ +/** + * BatchResponse is a class that allows to deal with batch responses using multipart/mixed content type. + * @example + * ```ts + * const body = new BatchData(); + * const getUser1 = new Request(`http://localhost:${port}/get`, { + * method: "GET", + * headers: { + * Accept: "application/json; charset=utf-8", + * }, + * }); + * + * const renameUser2 = new Request(`http://localhost:${port}/patch`, { + * method: "PATCH", + * headers: { + * Accept: "application/json; charset=utf-8", + * "Content-Type": "application/json; charset=utf-8", + * }, + * body: JSON.stringify({ + * name: "John Doe", + * }), + * }); + * + * const response = await fetch("http://localhost:3000/batch", { + * method: "POST", + * headers: body.getHeaders(), + * body: body.stream(), + * }); + * // you can now get the response for each request + * const batchResponse = new BatchResponse(response, body); + * const getUser1Response = await batchResponse.getResponse(body.getContentId(getUser1)); + * const renameUser2Response = await batchResponse.getResponse(body.getContentId(renameUser2)); + * // or you can get all responses by iterating over the batch response + * for await (const response of batchResponse) { + * console.log(response); + * } + * ``` + */ + +import { concat, SearchArray } from "./utils"; +import { + ensureBody, + parseBoundary, + parseContentId, + parseHeaders, + parseStatusLine, +} from "./batch-response.utils"; + +export class BatchResponse implements AsyncIterable<[string, Response]> { + #response: Response; + #encoder = new TextEncoder(); + #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); + #searchDivider = new SearchArray(this.#encoder.encode("\r\n\r\n")); + + constructor(response: Response) { + this.#response = response; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * parse the multipart/mixed response and store each response in a map + * where the key is the content id of the request + * + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := "--" boundary "--" CRLF + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + const boundary = parseBoundary(this.#response.headers); + const buffers = await this.#readChuncks(); + const data = concat(buffers); + const searchBoundary = new SearchArray( + this.#encoder.encode(`--${boundary}\r\n`) + ); + const searchEndBoundary = new SearchArray( + this.#encoder.encode(`--${boundary}--\r\n`) + ); + const boundaryIndexes = searchBoundary.searchAll(data); + const endBoundaryIndex = searchEndBoundary.search(data); + if (endBoundaryIndex === -1) { + throw new Error( + "BatchResponse: Invalid response, no ending boundary found" + ); + } + const indexes = boundaryIndexes.map((index, i) => ({ + start: index + searchBoundary.pattern.length, + end: + (boundaryIndexes[i + 1] || endBoundaryIndex) - + this.#searchNewline.pattern.length, + })); + for (const { start, end } of indexes) { + const parsedResponse = this.#parseEmbeddedResponse( + data.subarray(start, end) + ); + if (parsedResponse) { + yield [parsedResponse.contentId, parsedResponse.response] as [ + string, + Response + ]; + } + } + } + + /** + * read all chuncks of the multipart/mixed response body + * @returns - the combined data of the multipart/mixed response body in a single Uint8Array + */ + async #readChuncks() { + ensureBody(this.#response.body); + const buffers: Uint8Array[] = []; + const reader = this.#response.body.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + reader.releaseLock(); + break; + } + if (value) { + buffers.push(value); + } + } + return buffers; + } + + /** + * parse a multipart/mixed response part only allowing application/http content type + * @param data - The data of the multipart/mixed response + * @returns - The content id and the response + * @example + * ```yaml + * Content-Type: application/http + * Content-ID: + * + * HTTP/1.1 200 OK + * Content-Type: application/json + * Content-Length: response_part_2_content_length + * ETag: "etag/sheep" + * + * { + * "kind": "farm#animal", + * "etag": "etag/sheep", + * "selfLink": "/farm/v1/animals/sheep", + * "animalName": "sheep", + * "animalAge": 5, + * "peltColor": "green" + * } + * ``` + */ + #parseEmbeddedResponse(data: Uint8Array) { + const partHeadersEndIndex = this.#searchDivider.search(data); + if (partHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid part, no headers found"); + } + const partHeadersBytes = data.subarray(0, partHeadersEndIndex); + const partHeaders = parseHeaders(partHeadersBytes); + const contentType = partHeaders.get("content-type"); + if (!contentType?.startsWith("application/http")) { + return undefined; + } + + const partBodyBytes = data.subarray( + partHeadersEndIndex + this.#searchDivider.pattern.length + ); + const responseHeadersEndIndex = this.#searchDivider.search(partBodyBytes); + if (responseHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid response"); + } + const responseStatusLineEndIndex = + this.#searchNewline.search(partBodyBytes); + if (responseStatusLineEndIndex === -1) { + throw new Error("BatchResponse: Invalid response status line"); + } + const responseStatusLineBytes = partBodyBytes.subarray( + 0, + responseStatusLineEndIndex + ); + const responseHeadersBytes = partBodyBytes.subarray( + responseStatusLineEndIndex + this.#searchNewline.pattern.length, + responseHeadersEndIndex + ); + const responseBodyBytes = partBodyBytes.subarray( + responseHeadersEndIndex + this.#searchDivider.pattern.length + ); + const responseStatusLine = parseStatusLine(responseStatusLineBytes); + const responseHeaders = parseHeaders(responseHeadersBytes); + + const contentId = parseContentId(partHeaders); + const response = new Response( + responseBodyBytes.length > 0 ? responseBodyBytes : undefined, + { + status: responseStatusLine.status, + statusText: responseStatusLine.statusText, + headers: responseHeaders, + } + ); + + return { + contentId, + response, + }; + } +} + +export function makeBatchResponse(response: Response) { + return new BatchResponse(response); +} diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts new file mode 100644 index 00000000..89c2db10 --- /dev/null +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -0,0 +1,111 @@ +const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; +const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; +const contentIdRegExp = /^]+)>?$/; +const boundaryRegExp = /boundary="?([^";]+)"?;?/; + +/** + * parse the headers from a multipart/mixed response and extract the boundary + * @param response - The response to parse the boundary from + * @returns the boundary + * @throws if the response is not multipart/mixed or if the boundary is not found or if there is no response body + */ +export function parseBoundary(headers: Headers) { + const contentType = headers.get("content-type"); + if (!contentType?.startsWith("multipart/mixed")) { + throw new Error( + "BatchResponse: Invalid content type, expected multipart/mixed" + ); + } + const boundary = contentType.match(boundaryRegExp)?.[1]; + if (!boundary) { + throw new Error("BatchResponse: Invalid boundary"); + } + return boundary; +} + +export function ensureBody( + body: ReadableStream | null +): asserts body is ReadableStream { + if (!body) { + throw new Error("BatchResponse: Empty response body"); + } +} + +/** + * parse content id from headers + * @param headers - The headers to parse the content id from + * @returns the content id + */ +export function parseContentId(headers: Headers) { + const contentIdRaw = headers.get("content-id"); + if (!contentIdRaw) { + throw new Error("BatchResponse: Content-ID not found"); + } + const match = contentIdRaw.match(contentIdRegExp); + if (!match) { + throw new Error( + "BatchResponse: Invalid Content-ID format, should be '<'contentId'>'" + ); + } + return match[1]; +} + +/** + * parse HTTP response status line + * @param statusLineBytes - The status line bytes to parse + * @returns the status and status text + */ +export function parseStatusLine(statusLineBytes: Uint8Array) { + return parseStatusLineString(new TextDecoder().decode(statusLineBytes)); +} + +export function parseStatusLineString(statusLine: string) { + const match = statusLine.match(statusLineRegExp); + if (!match) { + throw new Error("BatchResponse: Invalid response status line"); + } + const [, status, statusText] = match; + return { + status: Number(status), + statusText, + }; +} + +/** + * parse headers from a Uint8Array + * + * it supports header folding continuations (https://tools.ietf.org/html/rfc7230#section-3.2.4) + * even though it's not recommended by the spec and deprecated + * in case headers are malformed, it will gently ignore them + * + * @param headersBytes - The headers bytes to parse + * @returns + */ +export function parseHeaders(headersBytes: Uint8Array) { + return parseHeadersString(new TextDecoder().decode(headersBytes)); +} + +export function parseHeadersString(headersStr: string) { + const decodedHeaders = headersStr.split("\r\n"); + const headers = new Headers(); + let lastKey: string | undefined; + for (const header of decodedHeaders) { + if (header.startsWith(" ") || header.startsWith("\t")) { + // this is a header folding continuation + if (lastKey) { + const value = header.trim(); + const currentValue = headers.get(lastKey); + if (currentValue) { + headers.set(lastKey, `${currentValue} ${value}`); + } + } + } else { + const match = header.match(headerRegExp); + if (match) { + const [, name, value] = match; + headers.set(name, value); + } + } + } + return headers; +} diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts new file mode 100644 index 00000000..f73a4172 --- /dev/null +++ b/packages/fetch-batch/src/index.ts @@ -0,0 +1,20 @@ +export { BatchData, makeBatchData } from "./batch-data"; +export { + ReactNativeBatchData, + makeReactNativeBatchData, +} from "./batch-data-react-native"; +export { BatchDataForeachCallback, IBatchData } from "./batch-data.types"; +export { BatchResponse, makeBatchResponse } from "./batch-response"; +export { + BatchStreamResponse, + makeBatchStreamResponse, +} from "./batch-response-stream"; +export { + ReactNativeBatchResponse, + makeReactNativeBatchResponse, +} from "./batch-response-react-native"; +export { BatchRequest } from "./batch-request"; +export type { + BatchRequestEndpoint, + BatchRequestOptions, +} from "./batch-request.types"; diff --git a/packages/fetch-batch/src/utils.test.ts b/packages/fetch-batch/src/utils.test.ts new file mode 100644 index 00000000..012ae57a --- /dev/null +++ b/packages/fetch-batch/src/utils.test.ts @@ -0,0 +1,206 @@ +import { SearchArray, concat } from "./utils"; + +describe("utils", () => { + describe("concat", () => { + it("should concat two arrays", () => { + let a = new Uint8Array([1, 2, 3]); + let b = new Uint8Array([4, 5, 6]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6])); + }); + + it("should concat three arrays", () => { + let a = new Uint8Array([1, 2, 3]); + let b = new Uint8Array([4, 5, 6]); + let c = new Uint8Array([7, 8, 9]); + let result = concat([a, b, c]); + expect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9])); + }); + + it("should concat empty arrays", () => { + let a = new Uint8Array([]); + let b = new Uint8Array([]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([])); + }); + + it("should concat empty array with non-empty array", () => { + let a = new Uint8Array([]); + let b = new Uint8Array([1, 2, 3]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([1, 2, 3])); + }); + }); + + describe("Knuth-Morris-Pratt algorithm", () => { + describe("search", () => { + it("should match simple pattern", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([2, 3, 4]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(1); + }); + + it("should match pattern at the end", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([6, 7]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(5); + }); + + it("should match pattern at the beginning", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([1, 2]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(0); + }); + + it("should match first when pattern appears more than once", () => { + let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); + let pattern = new Uint8Array([1, 2]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(3); + }); + + it("should match first when pattern is self repeating", () => { + let text = new Uint8Array([ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, + ]); + let pattern = new Uint8Array([1, 1, 1]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(10); + }); + + it("should match long pattern and text almost matches multiple times", () => { + let text = new Uint8Array([ + 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, + 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, + ]); + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toEqual(13); + }); + + it("should not match when pattern not in source", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([8, 9]); + const search = new SearchArray(pattern); + let result = search.search(text); + expect(result).toBe(-1); + }); + }); + + describe("searchAll", () => { + it("should match simple pattern", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([2, 3, 4]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([1]); + }); + + it("should match pattern at the end", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([6, 7]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([5]); + }); + + it("should match pattern at the beginning", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([1, 2]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([0]); + }); + + it("should match multiple occurrences", () => { + let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); + let pattern = new Uint8Array([1, 2]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([3, 7]); + }); + + it("should match overlapping occurrences", () => { + let text = new Uint8Array([1, 2, 1, 2, 1, 2]); + let pattern = new Uint8Array([1, 2, 1, 2]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([0, 2]); + }); + + it("should match overlapping occurrences at the end", () => { + let text = new Uint8Array([1, 2, 1, 2, 1, 2]); + let pattern = new Uint8Array([1, 2, 1]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([0, 2]); + }); + + it("should match long pattern and text almost matches multiple times", () => { + let text = new Uint8Array([ + 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, + 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, + ]); + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([13, 26]); + }); + + it("should match first when pattern is self repeating", () => { + let text = new Uint8Array([ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, + ]); + let pattern = new Uint8Array([1, 1, 1]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([10, 16, 17, 18, 19, 20, 21]); + }); + + it("should not match when pattern not in source", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([8, 9]); + const search = new SearchArray(pattern); + let result = search.searchAll(text); + expect(result).toEqual([]); + }); + }); + + describe("getLSP", () => { + it("should return one item 0 array for empty pattern", () => { + let pattern = new Uint8Array([]); + let result = new SearchArray(pattern).lps; + expect(result).toEqual([0]); + }); + + it("should return zero filled array for pattern without repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let result = new SearchArray(pattern).lps; + expect(result).toEqual([0, 0, 0, 0, 0, 0, 0]); + }); + + it("should return non zero filled array for pattern with repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 1, 2, 1, 2]); + let result = new SearchArray(pattern).lps; + expect(result).toEqual([0, 0, 1, 2, 3, 4]); + }); + + it("should return non zero filled array for pattern with repeated sequences within repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 1, 2, 1, 2, 3, 2]); + let result = new SearchArray(pattern).lps; + expect(result).toEqual([0, 0, 1, 2, 3, 4, 0, 0]); + }); + }); + }); +}); diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts new file mode 100644 index 00000000..5a67c143 --- /dev/null +++ b/packages/fetch-batch/src/utils.ts @@ -0,0 +1,158 @@ +export function concat(arrays: Uint8Array[]) { + let length = 0; + for (const arr of arrays) { + length += arr.length; + } + const result = new Uint8Array(length); + let offset = 0; + for (const arr of arrays) { + result.set(arr, offset); + offset += arr.length; + } + return result; +} + +type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + +export class SearchArray { + #pattern: TArray; + #lps: number[]; + + constructor(pattern: TArray) { + this.#pattern = pattern; + this.#lps = this.#getLPS(pattern); + } + + get pattern() { + return this.#pattern; + } + + get lps() { + return this.#lps; + } + + /** + * Knuth-Morris-Pratt algorithm to compute the failure array + * + * complexity: O(m) where m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, + * the pattern itself embodies sufficient information to determine + * where the next match could begin, thus bypassing re-examination + * of previously matched characters. + * + * The failure array is an array of integers where the value at index i denotes the length + * of the longest proper prefix of the substring pattern[0..i] which is also a suffix of this substring. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param pattern - the pattern to search for + * @returns + */ + #getLPS(pattern: TArray): number[] { + const result = [0]; + let matchingLength = 0; + let i = 1; + const patternLength = pattern.length; + while (i < patternLength) { + if (pattern[i] === pattern[matchingLength]) { + matchingLength++; + result[i] = matchingLength; + i++; + } else if (matchingLength !== 0) { + matchingLength = result[matchingLength - 1]; + } else { + result[i] = 0; + i++; + } + } + return result; + } + + /** + * Knuth-Morris-Pratt algorithm that finds the first occurrence of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the index where the pattern occurs in the source array or -1 if it does not occur + */ + search(source: TArray): number { + let i = 0; + let matchingLength = 0; + const srcLength = source.length; + while (i < srcLength) { + if (this.#pattern[matchingLength] === source[i]) { + matchingLength++; + i++; + } + if (matchingLength === this.#pattern.length) { + return i - matchingLength; + } else if (i < srcLength && this.#pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = this.#lps[matchingLength - 1]; + } else { + i++; + } + } + } + return -1; + } + + /** + * Knuth-Morris-Pratt algorithm that finds all occurrences of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the array of indices where the pattern occurs in the source array + */ + searchAll(source: TArray): number[] { + const result: number[] = []; + let i = 0; + let matchingLength = 0; + const srcLength = source.length; + while (i < srcLength) { + if (this.#pattern[matchingLength] === source[i]) { + matchingLength++; + i++; + } + if (matchingLength === this.#pattern.length) { + result.push(i - matchingLength); + matchingLength = this.#lps[matchingLength - 1]; + } else if (i < srcLength && this.#pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = this.#lps[matchingLength - 1]; + } else { + i++; + } + } + } + return result; + } +} diff --git a/packages/fetch-batch/tsconfig.build.json b/packages/fetch-batch/tsconfig.build.json new file mode 100644 index 00000000..2bfb6f53 --- /dev/null +++ b/packages/fetch-batch/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES2020", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/fetch-batch/tsconfig.json b/packages/fetch-batch/tsconfig.json new file mode 100644 index 00000000..fab9c4ab --- /dev/null +++ b/packages/fetch-batch/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "CommonJS", + "moduleResolution": "Node", + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": [ + "jest", + "node" + ] + }, + "exclude": [ + "node_modules", + "lib" + ] +} \ No newline at end of file diff --git a/packages/fetch-batch/tsup.config.js b/packages/fetch-batch/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/fetch-batch/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/fetch/.gitignore b/packages/fetch/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/fetch/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/fetch/.npmignore b/packages/fetch/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/fetch/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md new file mode 100644 index 00000000..eb55e9c1 --- /dev/null +++ b/packages/fetch/CHANGELOG.md @@ -0,0 +1,227 @@ +# @zodios/core + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +### Patch Changes + +- Updated dependencies [e67fa49] +- Updated dependencies [731e399] + - @zodios/core@11.0.0-beta.8 + +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +### Patch Changes + +- Updated dependencies [7dcbb0c] + - @zodios/core@11.0.0-beta.7 + +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +### Patch Changes + +- Updated dependencies [da4ddab] +- Updated dependencies [535c76b] + - @zodios/core@11.0.0-beta.6 + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +### Patch Changes + +- Updated dependencies [1b67309] +- Updated dependencies [c7c03bc] + - @zodios/core@11.0.0-beta.5 + +## 11.0.0-beta.4 + +### Major Changes + +- 679a267: update axios + +### Patch Changes + +- Updated dependencies [14ce00b] +- Updated dependencies [c9cae0a] +- Updated dependencies [3ac25a1] +- Updated dependencies [6c10dc2] +- Updated dependencies [679a267] +- Updated dependencies [90108a5] + - @zodios/core@11.0.0-beta.4 + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/fetch/LICENSE b/packages/fetch/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/fetch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/fetch/README.md b/packages/fetch/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/fetch/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/fetch/SECURITY.md b/packages/fetch/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/fetch/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/fetch/examples/define-types.ts b/packages/fetch/examples/define-types.ts new file mode 100644 index 00000000..54bd9a75 --- /dev/null +++ b/packages/fetch/examples/define-types.ts @@ -0,0 +1,61 @@ +import { Zodios, makeApi } from "../src/index"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: z.string(), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: z.number().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +// and then use them in your API +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + fetchConfig: { credentials: "include" }, + }); + + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + console.log(user); +} + +bootstrap(); diff --git a/packages/fetch/examples/dev.to/api-key-plugin.ts b/packages/fetch/examples/dev.to/api-key-plugin.ts new file mode 100644 index 00000000..ba768056 --- /dev/null +++ b/packages/fetch/examples/dev.to/api-key-plugin.ts @@ -0,0 +1,19 @@ +import { ZodiosPlugin } from "../../src/index"; + +export interface ApiKeyPluginConfig { + getApiKey: () => Promise; +} + +export function pluginApiKey(provider: ApiKeyPluginConfig): ZodiosPlugin { + return { + request: async (_, config) => { + return { + ...config, + headers: { + ...config.headers, + "api-key": await provider.getApiKey(), + }, + }; + }, + }; +} diff --git a/packages/fetch/examples/dev.to/articles.ts b/packages/fetch/examples/dev.to/articles.ts new file mode 100644 index 00000000..96714c78 --- /dev/null +++ b/packages/fetch/examples/dev.to/articles.ts @@ -0,0 +1,167 @@ +import { apiBuilder, makeApi } from "../../src/index"; +import { z } from "zod"; +import { devUser } from "./users"; +import { paramPages } from "./params"; + +const devArticle = z.object({ + id: z.number(), + type_of: z.string(), + title: z.string(), + description: z.string(), + cover_image: z.string().or(z.null()), + readable_publish_date: z.string().optional(), + social_image: z.string().optional(), + tag_list: z.array(z.string()).or(z.string()), + tags: z.array(z.string()).or(z.string()).optional(), + slug: z.string(), + path: z.string(), + url: z.string(), + canonical_url: z.string(), + comments_count: z.number(), + positive_reactions_count: z.number(), + public_reactions_count: z.number(), + collection_id: z.number().or(z.null()).optional(), + created_at: z.string().optional(), + edited_at: z.string().optional(), + crossposted_at: z.string().or(z.null()).optional(), + published_at: z.string().or(z.null()).optional(), + last_comment_at: z.string().optional(), + published_timestamp: z.string(), + reading_time_minutes: z.number(), + user: devUser.partial(), + read_time_minutes: z.number().optional(), + organization: z + .object({ + name: z.string(), + username: z.string(), + slug: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), + }) + .optional(), + flare_tag: z + .object({ + name: z.string(), + bg_color_hex: z.string(), + text_color_hex: z.string(), + }) + .optional(), +}); + +const devArticles = z.array(devArticle); + +export type Article = z.infer; +export type Articles = z.infer; + +export const articlesApi = apiBuilder({ + method: "get", + path: "/articles", + alias: "getAllArticles", + description: "Get all articles", + parameters: [ + ...paramPages, + { + name: "tag", + description: "Filter by tag", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags", + description: "Filter by tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags_exclude", + description: "Exclude tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "username", + description: "Filter by username", + type: "Query", + schema: z.string().optional(), + }, + { + name: "state", + description: "Filter by state", + type: "Query", + schema: z.string().optional(), + }, + { + name: "top", + type: "Query", + schema: z.number().optional(), + }, + { + name: "collection_id", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devArticles, +}) + .addEndpoint({ + method: "get", + path: "/articles/latest", + alias: "getLatestArticle", + description: "Get latest articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/:id", + alias: "getArticle", + description: "Get an article by id", + response: devArticle, + }) + .addEndpoint({ + method: "put", + path: "/articles/:id", + alias: "updateArticle", + description: "Update an article", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/:username/:slug", + alias: "getArticleByUsernameAndSlug", + description: "Get an article by username and slug", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/me", + alias: "getMyArticles", + description: "Get current user's articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/published", + alias: "getMyPublishedArticles", + description: "Get current user's published articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/unpublished", + alias: "getMyUnpublishedArticles", + description: "Get current user's unpublished articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/all", + alias: "getAllMyArticles", + description: "Get current user's all articles", + parameters: paramPages, + response: devArticles, + }) + .build(); diff --git a/packages/fetch/examples/dev.to/comments.ts b/packages/fetch/examples/dev.to/comments.ts new file mode 100644 index 00000000..7f749319 --- /dev/null +++ b/packages/fetch/examples/dev.to/comments.ts @@ -0,0 +1,61 @@ +import { makeApi, makeEndpoint } from "../../src/index"; +import { z } from "zod"; +import { devUser, User } from "./users"; + +/** + * zod does not handle recusive well, so we need to manually define the schema + */ +export type Comment = { + type_of: string; + id_code: string; + created_at: string; + body_html: string; + user: User; + children: Comment[]; +}; + +export const devComment: z.ZodSchema = z.lazy(() => + z.object({ + type_of: z.string(), + id_code: z.string(), + created_at: z.string(), + body_html: z.string(), + user: devUser, + children: z.array(devComment), + }) +); +export const devComments = z.array(devComment); + +export type Comments = z.infer; + +const getAllComments = makeEndpoint({ + method: "get", + path: "/comments", + alias: "getAllComments", + description: "Get all comments", + parameters: [ + { + name: "a_id", + description: "Article ID", + type: "Query", + schema: z.number().optional(), + }, + { + name: "p_id", + description: "Podcast comment ID", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devComments, +}); + +const getComment = makeEndpoint({ + method: "get", + path: "/comments/:id", + alias: "getComment", + description: "Get a comment", + response: devComment, +}); + +export const commentsApi = makeApi([getAllComments, getComment]); diff --git a/packages/fetch/examples/dev.to/example.ts b/packages/fetch/examples/dev.to/example.ts new file mode 100644 index 00000000..0ffcd255 --- /dev/null +++ b/packages/fetch/examples/dev.to/example.ts @@ -0,0 +1,26 @@ +import { Zodios } from "../../src/index"; +import { articlesApi } from "./articles"; +import { commentsApi } from "./comments"; +import { followsApi } from "./follows"; +import { followersApi } from "./followers"; +import { userApi } from "./users"; +import { pluginApiKey } from "./api-key-plugin"; + +export const devTo = new Zodios("https://dev.to/api", [ + ...articlesApi, + ...commentsApi, + ...followsApi, + ...followersApi, + ...userApi, +]); + +devTo.use( + pluginApiKey({ + getApiKey: async () => "", + }) +); + +devTo + .get("/articles/:id", { params: { id: 2 } }) + .then((user) => console.log(user)); +// ^? diff --git a/packages/fetch/examples/dev.to/followers.ts b/packages/fetch/examples/dev.to/followers.ts new file mode 100644 index 00000000..db9e7d5b --- /dev/null +++ b/packages/fetch/examples/dev.to/followers.ts @@ -0,0 +1,33 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; +import { paramPages } from "./params"; + +const devFollower = z.object({ + type_of: z.string(), + created_at: z.string(), + id: z.number(), + name: z.string(), + path: z.string(), + username: z.string(), + profile_image: z.string(), +}); + +const devFollowers = z.array(devFollower); + +export const followersApi = makeApi([ + { + method: "get", + path: "/followers/users", + alias: "getAllFollowers", + parameters: [ + ...paramPages, + { + name: "sort", + description: "Sort by. defaults to created_at", + type: "Query", + schema: z.string().optional(), + }, + ], + response: devFollowers, + }, +]); diff --git a/packages/fetch/examples/dev.to/follows.ts b/packages/fetch/examples/dev.to/follows.ts new file mode 100644 index 00000000..3aa7cae6 --- /dev/null +++ b/packages/fetch/examples/dev.to/follows.ts @@ -0,0 +1,23 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devFollow = z.object({ + id: z.number(), + name: z.string(), + points: z.number(), +}); + +export const devFollows = z.array(devFollow); + +export type Follow = z.infer; +export type Follows = z.infer; + +export const followsApi = makeApi([ + { + method: "get", + path: "/follows/tags", + alias: "getAllFollowedTags", + description: "Get all followed tags", + response: devFollows, + }, +]); diff --git a/packages/fetch/examples/dev.to/params.ts b/packages/fetch/examples/dev.to/params.ts new file mode 100644 index 00000000..c07e5a80 --- /dev/null +++ b/packages/fetch/examples/dev.to/params.ts @@ -0,0 +1,16 @@ +import { z } from "zod"; +import { makeParameters } from "../../src/api"; + +export const paramPages = makeParameters([ + { + name: "page", + type: "Query", + description: "Page number", + schema: z.number().optional(), + }, + { + name: "per_page", + type: "Query", + schema: z.number().optional(), + }, +]); diff --git a/packages/fetch/examples/dev.to/users.ts b/packages/fetch/examples/dev.to/users.ts new file mode 100644 index 00000000..1c74bc1b --- /dev/null +++ b/packages/fetch/examples/dev.to/users.ts @@ -0,0 +1,64 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devUser = z.object({ + id: z.number(), + type_of: z.string(), + name: z.string(), + username: z.string(), + summary: z.string().or(z.null()), + twitter_username: z.string().or(z.null()), + github_username: z.string().or(z.null()), + website_url: z.string().or(z.null()), + location: z.string().or(z.null()), + joined_at: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type User = z.infer; + +export const devProfileImage = z.object({ + type_of: z.string(), + image_of: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type ProfileImage = z.infer; + +export const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: devUser, + errors: [ + { + status: "default", + description: "Default error", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "get", + path: "/users/me", + alias: "getMe", + description: "Get current user", + response: devUser, + }, + { + method: "get", + path: "/profile_image/:username", + alias: "getProfileImage", + description: "Get a user's profile image", + response: devProfileImage, + }, +]); diff --git a/packages/fetch/examples/io-ts-types.ts b/packages/fetch/examples/io-ts-types.ts new file mode 100644 index 00000000..3a914737 --- /dev/null +++ b/packages/fetch/examples/io-ts-types.ts @@ -0,0 +1,102 @@ +import { + Zodios, + makeApi, + ApiOf, + TypeProviderOf, + FetcherProviderOf, + ioTsTypeProvider, +} from "../src/index"; +import * as t from "io-ts"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, + { + method: "post", + path: "/users", + description: "Create a user", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: t.type({ name: t.string }), + }, + { + name: "Content-Type", + type: "Header", + schema: t.string, + }, + ], + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); + const user2 = await apiClient.createUser({ + // ^? + body: { name: "Nicholas" }, + headers: { "Content-Type": "application/json" }, + }); +} + +bootstrap(); diff --git a/packages/fetch/examples/jsonplaceholder.ts b/packages/fetch/examples/jsonplaceholder.ts new file mode 100644 index 00000000..93baae2b --- /dev/null +++ b/packages/fetch/examples/jsonplaceholder.ts @@ -0,0 +1,95 @@ +import { + ApiOf, + ZodiosResponseByAlias, + ZodiosHeaderParamsByAlias, + Zodios, +} from "../src/index"; +import { z } from "zod"; + +async function bootstrap() { + const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: z.array(z.object({ id: z.number(), name: z.string() })), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string() }), + }, + { + name: "Content-Type", + type: "Header", + schema: z.string(), + }, + ], + response: z.object({ id: z.number(), name: z.string() }), + }, + ]); + + type UserResponseAlias = ZodiosResponseByAlias< + ApiOf, + "getUsers" + >; + + type Test = ZodiosHeaderParamsByAlias, "createUser">; + + const users: UserResponseAlias = await apiClient.getUsers({ + queries: { q: "Nicholas" }, + }); + console.log(users); + const user = await apiClient.getUser({ params: { id: 7 } }); + console.log(user); + const createdUser = await apiClient.createUser({ + body: { name: "john doe" }, + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + }); + console.log(createdUser); + const deletedUser = await apiClient.deleteUser({ + params: { id: 7 }, + }); + console.log(deletedUser); +} + +bootstrap(); diff --git a/packages/fetch/examples/types-from-definition.ts b/packages/fetch/examples/types-from-definition.ts new file mode 100644 index 00000000..bc25cf30 --- /dev/null +++ b/packages/fetch/examples/types-from-definition.ts @@ -0,0 +1,128 @@ +import { + ZodiosResponseByPath, + ZodiosBodyByPath, + ZodiosPathParamsByPath, + ZodiosQueryParamsByPath, + makeApi, + ZodiosPathParamByAlias, + makeErrors, +} from "../src/index"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + phone: z.string(), +}); + +const errors = makeErrors([ + { + status: 404, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 401, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 500, + schema: z.object({ + message: z.string(), + cause: z.record(z.string()), + }), + }, +]); + +const api = makeApi([ + { + path: "/users", + method: "get", + response: z.array(user), + }, + { + path: "/users/:id", + method: "get", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors, + }, + { + path: "/users", + method: "post", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "put", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "patch", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "delete", + response: z.object({}), + }, +]); + +type User = z.infer; +type Api = typeof api; + +type Users = ZodiosResponseByPath; +// ^? +type UserById = ZodiosResponseByPath; +// ^? +type GetUserParams = ZodiosPathParamsByPath; +// ^? +type GetUserParamsByAlias = ZodiosPathParamByAlias; +// ^? +type GetUsersParams = ZodiosPathParamsByPath; +// ^? +type GetUserQueries = ZodiosQueryParamsByPath; +// ^? +type CreateUserBody = ZodiosBodyByPath; +// ^? +type CreateUserResponse = ZodiosResponseByPath; +// ^? +type UpdateUserBody = ZodiosBodyByPath; +// ^? +type PatchUserBody = ZodiosBodyByPath; +// ^? +type DeleteUserResponse = ZodiosResponseByPath; +// ^? diff --git a/packages/fetch/examples/typescript-types.ts b/packages/fetch/examples/typescript-types.ts new file mode 100644 index 00000000..fdf8e533 --- /dev/null +++ b/packages/fetch/examples/typescript-types.ts @@ -0,0 +1,77 @@ +import { + Zodios, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, + FetcherProviderOf, +} from "../src"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/fetch/jest.config.ts b/packages/fetch/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/fetch/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/fetch/package.json b/packages/fetch/package.json new file mode 100644 index 00000000..2ef0f629 --- /dev/null +++ b/packages/fetch/package.json @@ -0,0 +1,79 @@ +{ + "name": "@zodios/fetch", + "description": "Typescript API client with fetch", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "fetch", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.19", + "fp-ts": "2.x", + "io-ts": "2.x", + "zod": "^3.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/multer": "1.4.7", + "@types/node": "18.15.11", + "@zodios/core": "workspace:*", + "cross-fetch": "3.1.5", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", + "jest": "29.5.0", + "multer": "1.4.5-lts.1", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/fetch/src/fetch-provider/fetch.ts b/packages/fetch/src/fetch-provider/fetch.ts new file mode 100644 index 00000000..0b8cac64 --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.ts @@ -0,0 +1,160 @@ +import { AnyZodiosRequestOptions } from "@zodios/core"; +import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; +import { + buildURL, + combineSignals, + isBlob, + isFile, + isFormData, +} from "./fetch.utils"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +export class FetchError extends Error { + /** + * constructore with same signature as AxiosError + */ + constructor( + message?: string, + public code?: string, + public config?: FetchProviderConfig, + public request?: Request, + public response?: FetchProviderResponse + ) { + super(message); + } +} + +/** + * fetch provider + * @param config - fetch config + * @returns + */ +export const advancedFetch = async ( + config: AnyZodiosRequestOptions +) => { + const request = createFetchRequest(config); + const response = (await fetchRequest( + request, + config as FetchProviderConfig + )) as FetchProviderResponse; + response.data = await getResponseData( + response, + config as FetchProviderConfig + ); + if ( + (config.validateStatus && !config.validateStatus(response.status)) || + !response.ok + ) { + throw new FetchError( + response.statusText, + `${response.status}`, + config as FetchProviderConfig, + request, + response + ); + } + return response; +}; + +// istanbul ignore next +function getAbortTimeout(ms: number): AbortSignal { + const controller = new AbortController(); + const id = setTimeout(() => controller.abort(), ms); + controller.signal.addEventListener("abort", () => { + clearTimeout(id); + }); + return controller.signal; +} + +function createFetchRequest(config: AnyZodiosRequestOptions) { + const headers = new Headers(config.headers); + if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { + // istanbul ignore next + if (headers.has("Content-Type")) { + headers.delete("Content-Type"); + } + } else if (typeof config.body === "object") { + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + config.body = JSON.stringify(config.body); + } + + // istanbul ignore next + if (config.auth) { + const username = config.auth.username || ""; + const password = config.auth.password + ? decodeURI(encodeURIComponent(config.auth.password)) + : ""; + headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); + } + + // istanbul ignore next + if (config.timeout) { + if (!globalThis.AbortController) { + console.warn("Timeout is not supported in this environment"); + } else if (globalThis.AbortSignal && "timeout" in globalThis.AbortSignal) { + config.signal = combineSignals( + config.signal, + AbortSignal.timeout(config.timeout) + ); + } else { + config.signal = combineSignals( + config.signal, + getAbortTimeout(config.timeout) + ); + } + } + + const url = buildURL(config); + return new Request(url, { + ...(config as FetchProviderConfig), + method: config.method.toUpperCase(), + headers, + }); +} + +// istanbul ignore next +function isErrorLike(error: unknown): error is Error { + return ( + error instanceof Error || + (!!error && typeof error === "object" && "message" in error) + ); +} + +async function fetchRequest(request: Request, config: FetchProviderConfig) { + try { + return await fetch(request); + } catch (error) { + // istanbul ignore next + if (isErrorLike(error)) { + throw new FetchError(error.message, "ERR_NETWORK", config, request); + } else { + throw new FetchError("Network Error", "ERR_NETWORK", config, request); + } + } +} + +// istanbul ignore next +async function getResponseData( + response: Response, + config: FetchProviderConfig +) { + switch (config.responseType) { + case "arraybuffer": + return response.arrayBuffer(); + case "blob": + return response.blob(); + case "stream": + return response.body; + case "text": + return response.text(); + case "json": + return response.json(); + default: { + if (response.headers.get("content-type")?.includes("application/json")) { + return response.json(); + } + return response.text(); + } + } +} diff --git a/packages/fetch/src/fetch-provider/fetch.types.ts b/packages/fetch/src/fetch-provider/fetch.types.ts new file mode 100644 index 00000000..447b23fa --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.types.ts @@ -0,0 +1,13 @@ +/// + +export interface FetchProviderConfig extends RequestInit { + baseURL?: string; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; +} + +export interface FetchProviderResponse extends Response { + data: Data; +} diff --git a/packages/fetch/src/fetch-provider/fetch.utils.ts b/packages/fetch/src/fetch-provider/fetch.utils.ts new file mode 100644 index 00000000..fa705e1a --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.utils.ts @@ -0,0 +1,109 @@ +import { AnyZodiosRequestOptions } from "@zodios/core"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +/** + * more resilient alternative to instanceof when the object is not native and compiled to es5 + * @param kind - string representation of the object kind + * @returns - a function that checks if the object is of the given kind + */ +// istanbul ignore next +export const isKindOf = + (kind: string) => + (data: any): boolean => { + const pattern = `[object ${kind}]`; + return ( + data && + (toString.call(data) === pattern || + (typeof data.toString === "function" && data.toString() === pattern)) + ); + }; + +// istanbul ignore next +export const isFormData = isKindOf("FormData"); +// istanbul ignore next +export const isBlob = isKindOf("Blob"); +// istanbul ignore next +export const isFile = isKindOf("File"); +// istanbul ignore next +export const isSearchParams = isKindOf("URLSearchParams"); + +function queriesToSearchString( + queries?: Record +): string | undefined { + if (queries) { + const searchParams = new URLSearchParams(); + Object.entries(queries).forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach((v) => + searchParams.append(`${key}[]`, JSON.stringify(v)) + ); + } else if (typeof value === "string") { + searchParams.append(key, value); + } else { + // istanbul ignore next + searchParams.append(key, JSON.stringify(value)); + } + }); + return searchParams.toString(); + } + return ""; +} + +// istanbul ignore next +function getFullURL(config: AnyZodiosRequestOptions) { + if (config.url?.startsWith("http") || !config.baseURL) { + return config.url; + } + const baseURL = config.baseURL.replace(/\/$/, ""); + if (!config.url) { + return baseURL; + } + const path = config.url.replace(/^\//, ""); + return `${baseURL}/${path}`; +} + +export function buildURL(config: AnyZodiosRequestOptions) { + let fullURL = getFullURL(config) || "/"; + const serializedParams = queriesToSearchString(config.queries); + if (serializedParams) { + fullURL += fullURL.indexOf("?") === -1 ? "?" : "&"; + } + return `${fullURL}${serializedParams}`; +} + +function isDefinedSignal( + signal: AbortSignal | undefined | null +): signal is AbortSignal { + return Boolean(signal); +} + +/** + * combine multiple abort signals into one + * @param signals - the signals to listen to + * @returns - the combined signal + */ +export function combineSignals( + ...signals: (AbortSignal | undefined | null)[] +): AbortSignal | undefined { + const definedSignals: AbortSignal[] = signals.filter(isDefinedSignal); + if (definedSignals.length < 2) { + return definedSignals[0]; + } + const controller = new AbortController(); + + function onAbort() { + controller.abort(); + definedSignals.forEach((signal) => { + signal.removeEventListener("abort", onAbort); + }); + } + + definedSignals.forEach((signal) => { + if (signal.aborted) { + onAbort(); + } else { + signal.addEventListener("abort", onAbort); + } + }); + return controller.signal; +} diff --git a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts new file mode 100644 index 00000000..cab92a25 --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts @@ -0,0 +1,55 @@ +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosFetcher, + ZodiosFetcherFactory, +} from "@zodios/core"; +import { Merge } from "@zodios/core/lib/utils.types"; +import { replacePathParams } from "../utils"; +import { FetchProviderConfig, FetchProviderResponse } from "./fetch.types"; +import { advancedFetch, FetchError } from "./fetch"; + +type FetchErrorStatus = Merge< + Omit, "status" | "response">, + { + response: Merge< + FetchError["response"], + { + status: Status extends "default" ? 0 & { error: "default" } : Status; + } + >; + } +>; + +type FetchProviderOptions = { + fetchConfig?: FetchProviderConfig; +}; + +export interface FetchProvider extends AnyZodiosFetcherProvider { + options: FetchProviderOptions; + config: Omit; + response: FetchProviderResponse; + error: FetchErrorStatus; +} + +class Fetcher implements ZodiosFetcher { + constructor( + public baseURL: string | undefined, + public config: FetchProviderConfig | undefined + ) {} + async fetch(config: AnyZodiosRequestOptions) { + const requestConfig = { + baseURL: this.baseURL, + ...this.config, + ...config, + url: replacePathParams(config), + }; + return advancedFetch( + requestConfig as AnyZodiosRequestOptions + ); + } +} + +export const fetchFactory: ZodiosFetcherFactory = (options) => { + return new Fetcher(options?.baseURL, options?.fetchConfig); +}; diff --git a/packages/fetch/src/fetch-provider/index.ts b/packages/fetch/src/fetch-provider/index.ts new file mode 100644 index 00000000..67bc2279 --- /dev/null +++ b/packages/fetch/src/fetch-provider/index.ts @@ -0,0 +1 @@ +export * from "./fetcher-provider.fetch"; diff --git a/packages/fetch/src/index.ts b/packages/fetch/src/index.ts new file mode 100644 index 00000000..373561c9 --- /dev/null +++ b/packages/fetch/src/index.ts @@ -0,0 +1,3 @@ +export { Zodios } from "./zodios"; +export type { FetchProvider } from "./fetch-provider"; +export * from "@zodios/core"; diff --git a/packages/fetch/src/utils.ts b/packages/fetch/src/utils.ts new file mode 100644 index 00000000..d1932bda --- /dev/null +++ b/packages/fetch/src/utils.ts @@ -0,0 +1,16 @@ +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; + +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function replacePathParams( + config: ReadonlyDeep<{ url: string; params?: Record }> +) { + let result: string = config.url; + const params = config.params; + if (params) { + result = result.replace(paramsRegExp, (match, key) => + key in params ? `${params[key]}` : match + ); + } + return result; +} diff --git a/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts similarity index 67% rename from src/zodios.test.ts rename to packages/fetch/src/zodios.test.ts index 44fcdb47..1911d33d 100644 --- a/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -1,15 +1,20 @@ -import { AxiosError } from "axios"; +/// import express from "express"; import { AddressInfo } from "net"; import { z, ZodError } from "zod"; -globalThis.FormData = require("form-data"); +if (globalThis.FormData === undefined) { + globalThis.FormData = require("form-data"); +} +import "cross-fetch/polyfill"; import { Zodios } from "./zodios"; -import { ZodiosError } from "./zodios-error"; +import { + ZodiosError, + AnyZodiosFetcherProvider, + ZodiosPlugin, + apiBuilder, +} from "@zodios/core"; import multer from "multer"; -import { ZodiosPlugin } from "./zodios.types"; -import { apiBuilder } from "./api"; -import { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; -import { Assert } from "./utils.types"; +import { Assert } from "@zodios/core/lib/utils.types"; const multipart = multer({ storage: multer.memoryStorage() }); @@ -30,18 +35,12 @@ describe("Zodios", () => { app.get("/error401", (req, res) => { res.status(401).json({}); }); - app.get("/error//error401", (req, res) => { - res.status(401).json({}); - }); - app.get("/error/:id/error401", (req, res) => { - res.status(401).json({}); - }); app.get("/error502", (req, res) => { res.status(502).json({ error: { message: "bad gateway" } }); }); app.get("/queries", (req, res) => { res.status(200).json({ - queries: req.query.id, + queries: req.query, }); }); app.get("/:id", (req, res) => { @@ -67,7 +66,7 @@ describe("Zodios", () => { app.delete("/:id", (req, res) => { res.status(200).json({ id: Number(req.params.id) }); }); - app.post("/form-data", multipart.none() as any, (req, res) => { + app.post("/form-data", multipart.none(), (req, res) => { res.status(200).json(req.body); }); app.post( @@ -80,12 +79,16 @@ describe("Zodios", () => { app.post("/text", express.text(), (req, res) => { res.status(200).send(req.body); }); + app.get("/cancel", async (req, res) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + res.status(200).json({ shouldNotBeReturned: true }); + }); server = app.listen(0); port = (server.address() as AddressInfo).port; }); - afterAll(() => { - server.close(); + afterAll((done) => { + server.close(done); }); it("should be defined", () => { @@ -109,10 +112,6 @@ describe("Zodios", () => { expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); }); - it("should return the underlying axios instance", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - expect(zodios.axios).toBeDefined(); - }); it("should create a new instance of Zodios", () => { const zodios = new Zodios(`http://localhost:${port}`, []); expect(zodios).toBeDefined(); @@ -155,11 +154,6 @@ describe("Zodios", () => { ).toThrowError("Zodios: Duplicate path 'get /:id'"); }); - it("should get base url", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - expect(zodios.baseURL).toBe(`http://localhost:${port}`); - }); - it("should create a new instance whithout base URL", () => { const zodios = new Zodios([ { @@ -174,144 +168,6 @@ describe("Zodios", () => { expect(zodios).toBeDefined(); }); - it("should register have validation plugin automatically installed", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should register a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const id = zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - zodios.eject(id); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should replace a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.use(plugin); - zodios.use(plugin); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.eject("test"); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should throw if invalid parameters when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); - }); - - it("should throw if invalid alias when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("tests", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError("Zodios: no alias 'tests' found to register plugin"); - }); - - it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("get", "/test/:id", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError( - "Zodios: no endpoint 'get /test/:id' found to register plugin" - ); - }); - - it("should register a plugin by endpoint", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("get", "/:id", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - - it("should register a plugin by alias", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("test", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - it("should make an http request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { @@ -334,15 +190,10 @@ describe("Zodios", () => { }, ]); const response = await zodios.request({ - // ^? method: "get", url: "/:id", params: { id: 7 }, }); - const testResonseType: Assert< - typeof response, - { id: number; name: string } - > = true; expect(response).toEqual({ id: 7, name: "test" }); }); @@ -353,18 +204,28 @@ describe("Zodios", () => { path: "/queries", parameters: [ { - name: "id", + name: "ids", type: "Query", schema: z.array(z.number()), }, + { + name: "q", + type: "Query", + schema: z.string(), + }, ], response: z.object({ - queries: z.array(z.string()), + queries: z.object({ + ids: z.array(z.string()), + q: z.string(), + }), }), }, ]); - const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); - expect(response).toEqual({ queries: ["1", "2"] }); + const response = await zodios.get("/queries", { + queries: { ids: [1, 2], q: "hello" }, + }); + expect(response).toEqual({ queries: { ids: ["1", "2"], q: "hello" } }); }); it("should make an http get with one path params", async () => { @@ -469,7 +330,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.post("/", { name: "post" }); + const response = await zodios.post("/", { body: { name: "post" } }); expect(response).toEqual({ id: 3, name: "post" }); }); @@ -501,13 +362,13 @@ describe("Zodios", () => { const config = { method: "post", url: "/", - data: { firstname: "post", lastname: "test" }, + body: { firstname: "post", lastname: "test" }, } as const; const response = await zodios.request(config); expect(config).toEqual({ method: "post", url: "/", - data: { firstname: "post", lastname: "test" }, + body: { firstname: "post", lastname: "test" }, }); expect(response).toEqual({ id: 3, name: "post test" }); }); @@ -540,7 +401,9 @@ describe("Zodios", () => { let error: ZodiosError | undefined; try { response = await zodios.post("/", { - email: "post", + body: { + email: "post", + }, }); } catch (err) { error = err as ZodiosError; @@ -572,7 +435,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.create({ name: "post" }); + const response = await zodios.create({ body: { name: "post" } }); expect(response).toEqual({ id: 3, name: "post" }); }); @@ -597,7 +460,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.put("/", { id: 5, name: "put" }); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); expect(response).toEqual({ id: 5, name: "put" }); }); @@ -623,7 +486,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.update({ id: 5, name: "put" }); + const response = await zodios.update({ body: { id: 5, name: "put" } }); expect(response).toEqual({ id: 5, name: "put" }); }); @@ -648,7 +511,9 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.patch("/", { id: 4, name: "patch" }); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); expect(response).toEqual({ id: 4, name: "patch" }); }); @@ -674,7 +539,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.update({ id: 4, name: "patch" }); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); expect(response).toEqual({ id: 4, name: "patch" }); }); @@ -688,7 +553,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.delete("/:id", undefined, { + const response = await zodios.delete("/:id", { params: { id: 6 }, }); expect(response).toEqual({ id: 6 }); @@ -705,7 +570,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.remove(undefined, { + const response = await zodios.remove({ params: { id: 6 }, }); expect(response).toEqual({ id: 6 }); @@ -817,6 +682,108 @@ received: } }); + it("should cancel request on timeout", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + try { + result = await zodios.get("/cancel", { timeout: 1 }); + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toContain("aborted"); + }); + + it("should cancel request on abort", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { signal: controller.signal }); + controller.abort(); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toContain("aborted"); + }); + + it("should cancel request on abort with timeout", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { + signal: controller.signal, + timeout: 1000, + }); + controller.abort(); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toContain("aborted"); + }); + + it("should cancel request on timeout with abort", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { + signal: controller.signal, + timeout: 1, + }); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toContain("aborted"); + }); + it("should match Expected error", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { @@ -830,7 +797,6 @@ received: schema: z.object({ error: z.object({ message: z.string(), - _502: z.literal(true), }), }), }, @@ -854,31 +820,6 @@ received: }, ], }, - { - method: "get", - alias: "getErrorById", - path: "/error502/:id", - response: z.void(), - errors: [ - { - status: 502, - schema: z.object({ - error: z.object({ - message: z.string(), - }), - }), - }, - { - status: 401, - schema: z.object({ - error: z.object({ - message: z.string(), - _401: z.literal(true), - }), - }), - }, - ], - }, ]); let error; try { @@ -886,30 +827,24 @@ received: } catch (e) { error = e; } - expect(error).toBeInstanceOf(AxiosError); - expect((error as AxiosError).response?.status).toBe(502); - if (isErrorFromPath(zodios.api, "get", "/error502", error)) { + expect(error).toBeInstanceOf(Error); + expect((error as any).response?.status).toBe(502); + if (zodios.isErrorFromPath("get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; - const test: Assert< - typeof data, - { error: { message: string; _502: true } } - > = true; + const test: Assert = true; } expect(error.response?.data).toEqual({ error: { message: "bad gateway" }, }); } - if (isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias("getError502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; // ^? - const test: Assert< - typeof data, - { error: { message: string; _502: true } } - > = true; + const test: Assert = true; } else if (error.response.status === 401) { const data = error.response.data; // ^? @@ -933,157 +868,6 @@ received: } }); - it("should match error with params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - alias: "getError401", - path: "/error/:id/error401", - response: z.void(), - errors: [ - { - status: 401, - schema: z.object({}), - }, - ], - }, - { - method: "get", - alias: "getError404", - path: "/error/:id/error404", - response: z.void(), - errors: [ - { - status: 404, - schema: z.object({}), - }, - ], - }, - ]); - - const params = { - id: "test", - }; - - let error; - try { - await zodios.getError401({ params }); - } catch (e) { - error = e; - } - - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); - - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) - ).toBe(true); - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) - ).toBe(false); - }); - - it("should match error with empty params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - alias: "getError401", - path: "/error/:id/error401", - response: z.void(), - errors: [ - { - status: 401, - schema: z.object({}), - }, - ], - }, - { - method: "get", - alias: "getError404", - path: "/error/:id/error404", - response: z.void(), - errors: [ - { - status: 404, - schema: z.object({}), - }, - ], - }, - ]); - - const params = { - id: "", - }; - - let error; - try { - await zodios.getError401({ params }); - } catch (e) { - error = e; - } - - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); - - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) - ).toBe(true); - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) - ).toBe(false); - }); - - it("should match error with optional params at the end", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - alias: "getError401", - path: "/error/:id/error401/:message", - response: z.void(), - errors: [ - { - status: 401, - schema: z.object({}), - }, - ], - }, - { - method: "get", - alias: "getError404", - path: "/error/:id/error404/:message", - response: z.void(), - errors: [ - { - status: 404, - schema: z.object({}), - }, - ], - }, - ]); - - const params = { - id: "test", - message: "", - }; - - let error; - try { - await zodios.getError401({ params }); - } catch (e) { - error = e; - } - - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); - - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401/:message", error) - ).toBe(true); - expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404/:message", error) - ).toBe(false); - }); - it("should match Unexpected error", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { @@ -1100,10 +884,10 @@ received: error = e; } - expect(error).toBeInstanceOf(AxiosError); - expect((error as AxiosError).response?.status).toBe(502); - expect(isErrorFromPath(zodios.api, "get", "/error502", error)).toBe(false); - expect(isErrorFromAlias(zodios.api, "getError502", error)).toBe(false); + expect(error).toBeInstanceOf(Error); + expect((error as any).response?.status).toBe(502); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); }); it("should return response when disabling validation", async () => { @@ -1129,7 +913,7 @@ received: }); }); - it("should trigger an axios error with error response", async () => { + it("should trigger an error with error response", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { method: "get", @@ -1143,7 +927,7 @@ received: try { await zodios.get("/error502"); } catch (e) { - expect((e as AxiosError).response?.data).toEqual({ + expect((e as any).response?.data).toEqual({ error: { message: "bad gateway", }, @@ -1173,36 +957,12 @@ received: }), }, ]); - const response = await zodios.post("/form-data", { id: 4, name: "post" }); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); expect(response).toEqual({ id: "4", name: "post" }); }); - it("should send a form data request a second time under 100 ms", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); - const response = await zodios.post("/form-data", { id: 4, name: "post" }); - expect(response).toEqual({ id: "4", name: "post" }); - }, 100); - it("should not send an array as form data request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { @@ -1222,7 +982,7 @@ received: let error: Error | undefined; let response: string | undefined; try { - response = await zodios.post("/form-data", ["test", "test2"]); + response = await zodios.post("/form-data", { body: ["test", "test2"] }); } catch (err) { error = err as Error; } @@ -1255,7 +1015,9 @@ received: }), }, ]); - const response = await zodios.post("/form-url", { id: 4, name: "post" }); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); expect(response).toEqual({ id: "4", name: "post" }); }); @@ -1278,7 +1040,7 @@ received: let error: Error | undefined; let response: string | undefined; try { - response = await zodios.post("/form-url", ["test", "test2"]); + response = await zodios.post("/form-url", { body: ["test", "test2"] }); } catch (err) { error = err as Error; } @@ -1305,7 +1067,7 @@ received: response: z.string(), }, ]); - const response = await zodios.post("/text", "test"); + const response = await zodios.post("/text", { body: "test" }); expect(response).toEqual("test"); }); }); diff --git a/packages/fetch/src/zodios.ts b/packages/fetch/src/zodios.ts new file mode 100644 index 00000000..167bb841 --- /dev/null +++ b/packages/fetch/src/zodios.ts @@ -0,0 +1,61 @@ +import type { + ZodiosEndpointDefinition, + ZodiosOptions, + AnyZodiosTypeProvider, + TypeOfFetcherOptions, + ZodiosInstance, + ZodTypeProvider, +} from "@zodios/core"; +import { ZodiosCore } from "@zodios/core"; +import { fetchFactory, FetchProvider } from "./fetch-provider"; + +function isZodiosOptions( + lastArg: unknown +): lastArg is ZodiosOptions { + return !Array.isArray(lastArg) && typeof lastArg === "object"; +} + +const ZodiosFetch = new Proxy(ZodiosCore, { + construct: (target, args) => { + if (args.length !== 0) { + let lastArg = args[args.length - 1]; + if (isZodiosOptions(lastArg)) { + lastArg.fetcherFactory = fetchFactory; + } else { + args.push({ fetcherFactory: fetchFactory }); + } + } + // @ts-ignore + return new target(...args); + }, +}); + +export interface Zodios { + new < + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + api: Api, + options?: Omit< + ZodiosOptions, + "fetcherFactory" + > & + TypeOfFetcherOptions + ): ZodiosInstance; + new < + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + baseUrl: string, + api: Api, + options?: Omit< + ZodiosOptions, + "fetcherFactory" + > & + TypeOfFetcherOptions + ): ZodiosInstance; +} + +const Zodios = ZodiosFetch as Zodios; + +export { Zodios }; diff --git a/packages/fetch/tsconfig.build.json b/packages/fetch/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/fetch/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/fetch/tsconfig.json b/packages/fetch/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/fetch/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/fetch/tsup.config.js b/packages/fetch/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/fetch/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/openapi/CHANGELOG.md b/packages/openapi/CHANGELOG.md new file mode 100644 index 00000000..681c287a --- /dev/null +++ b/packages/openapi/CHANGELOG.md @@ -0,0 +1,12 @@ +# @zodios/openapi + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 diff --git a/packages/openapi/LICENSE b/packages/openapi/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/openapi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/openapi/README.md b/packages/openapi/README.md new file mode 100644 index 00000000..2e129bc9 --- /dev/null +++ b/packages/openapi/README.md @@ -0,0 +1,193 @@ +

Zodios Openapi

+

+ + Zodios logo + +

+

+ Zodios Openapi is an openapi generator for zodios api description format. +
+

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +# What is it ? + +It's an openapi generator for zodios api description format. + +- really simple centralized API declaration +- generate openapi v3 json schema + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) +- [How to use it ?](#how-to-use-it-) + - [Declare your API for fullstack end to end type safety](#declare-your-api-for-fullstack-end-to-end-type-safety) + - [Expose your OpenAPI documentation](#expose-your-openapi-documentation) + +# Install + +```bash +> npm install @zodios/openapi +``` + +or + +```bash +> yarn add @zodios/openapi +``` + +# How to use it ? + +Openapi is a specification for describing REST APIs. It's a standard that is widely used in the industry. It's a great way to document your API and zodios-openapi is a tool to generate openapi v3 json schema from zodios api description format. + +## Declare your API for fullstack end to end type safety + +Here is an example of API declaration with Zodios. Splitted between public and admin API. + +in a common directory (ex: `src/api.ts`) : + +```typescript +import { makeApi } from "@zodios/core"; +import { z } from "zod"; + +export const userApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive(), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + ], + response: z.array(userSchema), + errors, + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: userSchema, + errors, + }, + { + method: "get", + path: "/users/:id/comments", + alias: "getComments", + description: "Get all user comments", + response: z.array(commentSchema), + errors, + }, + { + method: "get", + path: "/users/:id/comments/:commentId", + alias: "getComment", + description: "Get a user comment by id", + response: commentSchema, + errors, + }, +]); + +export const adminApi = makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: userSchema, + }, + ], + response: userSchema, + errors, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + errors, + }, +]); +``` + +## Expose your OpenAPI documentation + + +in your backend (ex: `src/server.ts`) : +```typescript +import { serve, setup } from "swagger-ui-express"; +import { makeApi } from "@zodios/core"; +import { zodiosApp, zodiosRouter } from "@zodios/express"; +import { bearerAuthScheme, openApiBuilder } from "@zodios/openapi"; +import { userApi, adminApi } from "./api"; + +const app = zodiosApp(); +const userRouter = zodiosRouter([...userApi, ...adminApi]); + + +app.use("/api/v1", userRouter); + +const document = openApiBuilder({ + title: "User API", + version: "1.0.0", + description: "A simple user API", +}) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("admin", bearerAuthScheme()) + .addPublicApi(api) + .addProtectedApi("admin", adminApi) + .build(); + +app.use(`/docs/swagger.json`, (_, res) => res.json(document)); +app.use("/docs", serve); +app.use("/docs", setup(undefined, { swaggerUrl: "/docs/swagger.json" })); + +app.listen(3000); +``` diff --git a/packages/openapi/examples/server.ts b/packages/openapi/examples/server.ts new file mode 100644 index 00000000..aa7337be --- /dev/null +++ b/packages/openapi/examples/server.ts @@ -0,0 +1,212 @@ +import { makeApi, makeErrors } from "@zodios/core"; +import { zodiosApp, zodiosRouter } from "@zodios/express"; +import { serve, setup } from "swagger-ui-express"; +import { z } from "zod"; +import { bearerAuthScheme, openApiBuilder } from "../src"; + +const userSchema = z.object({ + id: z.string(), + name: z.string(), + email: z.string().email(), +}); + +const commentSchema = z.object({ + id: z.string(), + content: z.string(), + createdAt: z.string(), + modifiedAt: z.string(), +}); + +type User = z.infer; + +const errors = makeErrors([ + { + status: 404, + description: "No users found", + schema: z.object({ + message: z.enum(["No users found", "User not found"]), + }), + }, + { + status: "default", + description: "Default error", + schema: z.object({ + message: z.string(), + }), + }, +]); + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive().default(10), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + { + name: "filter", + type: "Query", + description: "Filter users by name", + schema: z + .array(z.string()) + .refine((array) => array.length === new Set(array).size, { + message: "Duplicate values are not allowed", + }), + }, + ], + response: z.array(userSchema), + errors, + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: userSchema, + errors, + }, + { + method: "get", + path: "/users/:id/comments", + alias: "getComments", + description: "Get all user comments", + response: z.array(commentSchema), + errors, + }, + { + method: "get", + path: "/users/:id/comments/:commentId", + alias: "getComment", + description: "Get a user comment by id", + response: commentSchema, + errors, + }, +]); + +const adminApi = makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: userSchema, + }, + ], + response: userSchema, + errors, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + errors, + }, +]); + +const app = zodiosApp(); +const userRouter = zodiosRouter([...api, ...adminApi]); + +const users: User[] = [ + { + id: "1", + name: "John Doe", + email: "john.doe@test.com", + }, + { + id: "2", + name: "John Doe", + email: "john.doe@test.com", + }, +]; + +userRouter.get("/users", (req, res) => { + res.json(users); +}); + +userRouter.get("/users/:id", (req, res) => { + const user = users.find((user) => user.id === req.params.id); + if (!user) { + res.status(404).json({ message: "User not found" }); + } + return res.json(user); +}); + +userRouter.post("/users", (req, res) => { + const user = { ...req.body, id: String(users.length + 1) }; + users.push(user); + return res.json(user); +}); + +userRouter.put("/users/:id", (req, res) => { + const userIdx = users.findIndex((user) => user.id === req.params.id); + if (userIdx < 0) { + res.status(404).json({ message: "User not found" }); + } + const updatedUser = { ...users[userIdx], ...req.body }; + users[userIdx] = updatedUser; + return res.json(updatedUser); +}); + +userRouter.delete("/users/:id", (req, res) => { + const userIdx = users.findIndex((user) => user.id === req.params.id); + if (userIdx < 0) { + res.status(404).json({ message: "User not found" }); + } + users.splice(userIdx, 1); + return res.status(204).send(); +}); + +app.use("/api/v1", userRouter); + +const document = openApiBuilder({ + title: "User API", + version: "1.0.0", + description: "A simple user API", +}) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("admin", bearerAuthScheme()) + .addPublicApi(api) + .addProtectedApi("admin", adminApi) + .build(); + +app.use(`/docs/swagger.json`, (_, res) => res.json(document)); +app.use("/docs", serve); +app.use("/docs", setup(undefined, { swaggerUrl: "/docs/swagger.json" })); + +app.listen(3000); diff --git a/packages/openapi/jest.config.ts b/packages/openapi/jest.config.ts new file mode 100644 index 00000000..d32c0704 --- /dev/null +++ b/packages/openapi/jest.config.ts @@ -0,0 +1,23 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/openapi/package.json b/packages/openapi/package.json new file mode 100644 index 00000000..691ecd26 --- /dev/null +++ b/packages/openapi/package.json @@ -0,0 +1,68 @@ +{ + "name": "@zodios/openapi", + "description": "Openapi for zodios", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios-openapi", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios-openapi.git" + }, + "license": "MIT", + "keywords": [ + "zod", + "zodios", + "rest", + "openapi" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.19", + "zod": "^3.x" + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/multer": "1.4.7", + "@types/node": "18.15.11", + "@types/swagger-ui-express": "4.1.3", + "@zodios/core": "workspace:*", + "@zodios/express": "workspace:*", + "axios": "1.3.5", + "express": "4.18.2", + "jest": "29.5.0", + "rimraf": "4.4.1", + "swagger-ui-express": "4.6.2", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + }, + "dependencies": { + "openapi-types": "12.1.0", + "zod-to-json-schema": "3.20.4" + } +} diff --git a/packages/openapi/src/__snapshots__/openapi.test.ts.snap b/packages/openapi/src/__snapshots__/openapi.test.ts.snap new file mode 100644 index 00000000..ca04f6a3 --- /dev/null +++ b/packages/openapi/src/__snapshots__/openapi.test.ts.snap @@ -0,0 +1,773 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`toOpenApi should convert to openapi with builder 1`] = ` +{ + "info": { + "title": "My API", + "version": "1.0.0", + }, + "openapi": "3.0.0", + "paths": { + "/users": { + "post": { + "description": "Create a user", + "operationId": "createUser", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to create", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Create a user", + "tags": [ + "users", + ], + }, + }, + "/users/{id}": { + "delete": { + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "204": { + "content": { + "application/json": { + "schema": {}, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Delete a user", + "tags": [ + "users", + ], + }, + "get": { + "description": "Get a user by id", + "operationId": "getUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Get a user by id", + "tags": [ + "users", + ], + }, + "put": { + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to update", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Update a user", + "tags": [ + "users", + ], + }, + }, + "/users?filter={filter}#fragment": { + "get": { + "description": "Get all users", + "operationId": "getUsers", + "parameters": [ + { + "in": "path", + "name": "filter", + "required": true, + "schema": { + "type": "string", + }, + }, + { + "description": "Limit the number of users", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 10, + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Offset the number of users", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Filter users by name", + "in": "query", + "name": "filter[]", + "required": true, + "schema": { + "items": { + "type": "string", + }, + "type": "array", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + "type": "array", + }, + }, + }, + "description": "Success", + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "enum": [ + "No users found", + ], + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "No users found", + }, + "default": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "Default error", + }, + }, + "security": undefined, + "summary": "Get all users", + "tags": [ + "users", + ], + }, + }, + }, + "servers": undefined, +} +`; + +exports[`toOpenApi should convert to openapi with builder with security 1`] = ` +{ + "components": { + "securitySchemes": { + "auth": { + "bearerFormat": "JWT", + "description": undefined, + "scheme": "bearer", + "type": "http", + }, + }, + }, + "info": { + "title": "My API", + "version": "1.0.0", + }, + "openapi": "3.0.0", + "paths": { + "/users": { + "post": { + "description": "Create a user", + "operationId": "createUser", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to create", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Create a user", + "tags": [ + "users", + ], + }, + }, + "/users/{id}": { + "delete": { + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "204": { + "content": { + "application/json": { + "schema": {}, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Delete a user", + "tags": [ + "users", + ], + }, + "get": { + "description": "Get a user by id", + "operationId": "getUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Get a user by id", + "tags": [ + "users", + ], + }, + "put": { + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to update", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Update a user", + "tags": [ + "users", + ], + }, + }, + "/users?filter={filter}#fragment": { + "get": { + "description": "Get all users", + "operationId": "getUsers", + "parameters": [ + { + "in": "path", + "name": "filter", + "required": true, + "schema": { + "type": "string", + }, + }, + { + "description": "Limit the number of users", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 10, + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Offset the number of users", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Filter users by name", + "in": "query", + "name": "filter[]", + "required": true, + "schema": { + "items": { + "type": "string", + }, + "type": "array", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + "type": "array", + }, + }, + }, + "description": "Success", + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "enum": [ + "No users found", + ], + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "No users found", + }, + "default": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "Default error", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Get all users", + "tags": [ + "users", + ], + }, + }, + }, + "servers": [ + { + "url": "/api/v1", + }, + ], +} +`; diff --git a/packages/openapi/src/index.ts b/packages/openapi/src/index.ts new file mode 100644 index 00000000..cbcf6047 --- /dev/null +++ b/packages/openapi/src/index.ts @@ -0,0 +1 @@ +export * from "./openapi"; diff --git a/packages/openapi/src/openapi.test.ts b/packages/openapi/src/openapi.test.ts new file mode 100644 index 00000000..8745c37c --- /dev/null +++ b/packages/openapi/src/openapi.test.ts @@ -0,0 +1,172 @@ +import { makeApi } from "@zodios/core"; +import { z } from "zod"; +import { + basicAuthScheme, + bearerAuthScheme, + oauth2Scheme, + openApiBuilder, +} from "./openapi"; + +const user = z.object({ + id: z.string(), + name: z.string(), + email: z.string().email(), +}); + +const api = makeApi([ + { + method: "get", + path: "/users?filter=:filter#fragment", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive().default(10), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + { + name: "filter", + type: "Query", + description: "Filter users by name", + schema: z + .array(z.string()) + .refine((a) => new Set(a).size === a.length, "No duplicates allowed"), + }, + ], + response: z.array(user), + errors: [ + { + status: 404, + description: "No users found", + schema: z.object({ + message: z.literal("No users found"), + }), + }, + { + status: "default", + description: "Default error", + schema: z.object({ + message: z.string(), + }), + }, + ], + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: user, + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: user.omit({ id: true }), + }, + ], + response: user, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: user, + }, + ], + response: user, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + }, +]); + +describe("toOpenApi", () => { + it("should generate bearer scheme", () => { + const scheme = bearerAuthScheme(); + expect(scheme).toEqual({ + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + }); + }); + + it("should generate basic scheme", () => { + const scheme = basicAuthScheme(); + expect(scheme).toEqual({ + type: "http", + scheme: "basic", + }); + }); + + it("should generate oauth2 scheme", () => { + const scheme = oauth2Scheme({ + implicit: { + authorizationUrl: "https://example.com/oauth2/authorize", + scopes: { + read: "Read access", + write: "Write access", + }, + }, + }); + expect(scheme).toEqual({ + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/oauth2/authorize", + scopes: { + read: "Read access", + write: "Write access", + }, + }, + }, + }); + }); + + it("should convert to openapi with builder", () => { + const openApi = openApiBuilder({ + title: "My API", + version: "1.0.0", + }) + .addPublicApi(api) + .build(); + expect(openApi).toMatchSnapshot(); + }); + + it("should convert to openapi with builder with security", () => { + const openApi = openApiBuilder({ + title: "My API", + version: "1.0.0", + }) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("auth", bearerAuthScheme()) + .addProtectedApi("auth", api) + .build(); + expect(openApi).toMatchSnapshot(); + }); +}); diff --git a/packages/openapi/src/openapi.ts b/packages/openapi/src/openapi.ts new file mode 100644 index 00000000..fe4b32c8 --- /dev/null +++ b/packages/openapi/src/openapi.ts @@ -0,0 +1,330 @@ +import { zodToJsonSchema } from "zod-to-json-schema"; +import type { OpenAPIV3 } from "openapi-types"; +import type { ZodiosEndpointDefinition } from "@zodios/core"; +import { ZodTypeAny, z } from "zod"; +import { isZodType } from "./utils"; + +const pathRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; +const expludedParamTypes = ["Body", "Path"]; + +function pathWithoutParams(path: string) { + return path.indexOf("?") > -1 + ? path.split("?")[0] + : path.indexOf("#") > -1 + ? path.split("#")[0] + : path; +} + +function tagsFromPath(path: string): string[] | undefined { + const resources = pathWithoutParams(path) + .replace(pathRegExp, "") + .split("/") + .filter((part) => part !== ""); + return resources ? [resources[resources.length - 1]] : undefined; +} + +export function bearerAuthScheme( + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + description, + }; +} + +export function basicAuthScheme( + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "http", + scheme: "basic", + description, + }; +} + +export function apiKeyAuthScheme( + options: Omit, + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "apiKey", + description, + ...options, + }; +} + +export function oauth2Scheme( + flows: OpenAPIV3.OAuth2SecurityScheme["flows"], + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "oauth2", + description, + flows, + }; +} + +function findPathParam( + endpoint: ZodiosEndpointDefinition, + paramName: string +) { + return endpoint.parameters?.find( + (param) => param.type === "Path" && param.name === paramName + ); +} + +function makeJsonSchema(schema: z.ZodTypeAny) { + return zodToJsonSchema(schema, { + target: "openApi3", + $refStrategy: "none", + }) as OpenAPIV3.SchemaObject; +} + +/** + * Create an openapi V3 document from a list of api definitions + * Use this function if you want to define multiple apis protected by different security schemes + * @param options - the parameters to create the document + * @returns - the openapi V3 document + */ +function makeOpenApi(options: { + apis: Array< + | { + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + | { + scheme: string; + securityRequirement?: string[]; + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + >; + info?: OpenAPIV3.InfoObject; + servers?: OpenAPIV3.ServerObject[]; + securitySchemes?: Record; + tagsFromPathFn?: (path: string) => string[]; +}) { + const { tagsFromPathFn = tagsFromPath } = options; + const openApi: OpenAPIV3.Document = { + openapi: "3.0.0", + info: options.info ?? { + title: "Zodios : add an info object to 'toOpenApi' options", + version: "1.0.0", + }, + servers: options.servers, + paths: {}, + }; + if (options.securitySchemes) { + openApi.components = { + securitySchemes: options.securitySchemes, + }; + } + for (let api of options.apis) { + for (let endpoint of api.definitions) { + const responses: OpenAPIV3.ResponsesObject = { + [`${endpoint.status ?? 200}`]: { + description: endpoint.responseDescription ?? "Success", + content: { + "application/json": { + schema: makeJsonSchema(endpoint.response), + }, + }, + }, + }; + for (let error of endpoint.errors ?? []) { + responses[`${error.status}`] = { + description: error.description ?? "Error", + content: { + "application/json": { + schema: makeJsonSchema(error.schema), + }, + }, + }; + } + const parameters: OpenAPIV3.ParameterObject[] = []; + // extract path parameters from endpoint path + const pathParams = endpoint.path.match(pathRegExp); + if (pathParams) { + for (let pathParam of pathParams) { + const paramName = pathParam.slice(1); + const param = findPathParam(endpoint, paramName); + if (param) { + parameters.push({ + name: paramName, + description: param.description, + in: "path", + schema: makeJsonSchema(param.schema), + required: true, + }); + } else { + parameters.push({ + name: paramName, + in: "path", + schema: { + type: "string", + }, + required: true, + }); + } + } + } + // extract all other parameters from endpoint + for (let param of endpoint.parameters ?? []) { + if (!expludedParamTypes.includes(param.type)) { + const required = !param.schema.isOptional(); + const schema = + required || + !isZodType(param.schema, z.ZodFirstPartyTypeKind.ZodOptional) + ? param.schema + : (param.schema as z.ZodOptional).unwrap(); + parameters.push({ + name: + param.type === "Query" && + isZodType(param.schema, z.ZodFirstPartyTypeKind.ZodArray) + ? `${param.name}[]` + : param.name, + in: param.type.toLowerCase(), + schema: makeJsonSchema(schema), + description: param.description, + required, + } as OpenAPIV3.ParameterObject); + } + } + const path = endpoint.path.replace(pathRegExp, "{$1}"); + const body = endpoint.parameters?.find((param) => param.type === "Body"); + + const operation: OpenAPIV3.OperationObject = { + operationId: endpoint.alias, + summary: endpoint.description, + description: endpoint.description, + tags: tagsFromPathFn(endpoint.path), + security: + "scheme" in api && api.scheme + ? [{ [api.scheme]: api.securityRequirement ?? ([] as string[]) }] + : undefined, + requestBody: body + ? { + description: body.description, + content: { + "application/json": { + schema: makeJsonSchema(body.schema), + }, + }, + } + : undefined, + parameters, + responses, + }; + openApi.paths[path] = { + ...openApi.paths[path], + [endpoint.method]: operation, + }; + } + } + return openApi; +} + +export class OpenApiBuilder { + apis: Array< + | { + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + | { + scheme: string; + securityRequirement?: string[]; + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + > = []; + options: { + info: OpenAPIV3.InfoObject; + servers?: OpenAPIV3.ServerObject[]; + securitySchemes?: Record; + tagsFromPathFn?: (path: string) => string[]; + }; + constructor(info: OpenAPIV3.InfoObject) { + this.options = { info }; + } + + /** + * add a security scheme to proctect the apis + * @param name - the name of the security scheme + * @param securityScheme - the security scheme object + */ + addSecurityScheme( + name: string, + securityScheme: OpenAPIV3.SecuritySchemeObject + ) { + this.options.securitySchemes ??= {}; + this.options.securitySchemes[name] = securityScheme; + return this; + } + /** + * add an api with public endpoints + * @param definitions - the endpoint definitions + * @returns + */ + addPublicApi( + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] + ) { + this.apis.push({ definitions }); + return this; + } + /** + * add an api protected by a security scheme + * @param scheme - the name of the security scheme to use + * @param definitions - the endpoints API + * @param securityRequirement - optional security requirement to use for this API (oauth2 scopes for example) + */ + addProtectedApi( + scheme: string, + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + securityRequirement?: string[] + ) { + this.apis.push({ scheme, definitions, securityRequirement }); + return this; + } + /** + * add a server to the openapi document + * @param server - the server to add + */ + addServer(server: OpenAPIV3.ServerObject) { + this.options.servers ??= []; + this.options.servers.push(server); + return this; + } + /** + * ovveride the default tagsFromPathFn + * @param tagsFromPathFn - a function that takes a path and returns the tags to use for this path + */ + setCustomTagsFn(tagsFromPathFn: (path: string) => string[]) { + this.options.tagsFromPathFn = tagsFromPathFn; + return this; + } + build() { + return makeOpenApi({ + apis: this.apis, + ...this.options, + }); + } +} + +/** + * Builder to easily create an openapi V3 document from zodios api definitions + * @param info - the info object to add to the document + * @returns - the openapi V3 builder + */ +export function openApiBuilder(info: OpenAPIV3.InfoObject) { + return new OpenApiBuilder(info); +} diff --git a/packages/openapi/src/utils.ts b/packages/openapi/src/utils.ts new file mode 100644 index 00000000..3aa3f6ef --- /dev/null +++ b/packages/openapi/src/utils.ts @@ -0,0 +1,20 @@ +import { z } from "zod"; + +export function isZodType( + t: z.ZodTypeAny, + type: z.ZodFirstPartyTypeKind +): boolean { + if (t._def?.typeName === type) { + return true; + } + if ( + t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && + (t as z.ZodEffects)._def.effect.type === "refinement" + ) { + return isZodType((t as z.ZodEffects).innerType(), type); + } + if (t._def?.innerType) { + return isZodType(t._def.innerType, type); + } + return false; +} diff --git a/packages/openapi/tsconfig.build.json b/packages/openapi/tsconfig.build.json new file mode 100644 index 00000000..e8b555b9 --- /dev/null +++ b/packages/openapi/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/tsconfig.json b/packages/openapi/tsconfig.json similarity index 92% rename from tsconfig.json rename to packages/openapi/tsconfig.json index 928afa0b..125f9093 100644 --- a/tsconfig.json +++ b/packages/openapi/tsconfig.json @@ -11,7 +11,6 @@ "esModuleInterop": true, "sourceMap": true, "declaration": true, - "noErrorTruncation": true, "jsx": "react-jsx" }, "exclude": ["node_modules", "lib"] diff --git a/packages/openapi/tsup.config.js b/packages/openapi/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/openapi/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/react/.gitignore b/packages/react/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/react/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/react/.npmignore b/packages/react/.npmignore new file mode 100644 index 00000000..9b818209 --- /dev/null +++ b/packages/react/.npmignore @@ -0,0 +1,39 @@ +# compiled output +!/lib +/node_modules +/src +/examples + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md new file mode 100644 index 00000000..49c439df --- /dev/null +++ b/packages/react/CHANGELOG.md @@ -0,0 +1,104 @@ +# @zodios/react + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/axios@11.0.0-beta.19 + - @zodios/fetch@11.0.0-beta.19 + - @zodios/core@11.0.0-beta.19 + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/axios@11.0.0-beta.18 + - @zodios/fetch@11.0.0-beta.18 + - @zodios/core@11.0.0-beta.18 + +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/axios@11.0.0-beta.17 + - @zodios/core@11.0.0-beta.17 + - @zodios/fetch@11.0.0-beta.17 + +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/axios@11.0.0-beta.16 + - @zodios/core@11.0.0-beta.16 + - @zodios/fetch@11.0.0-beta.16 + +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/axios@11.0.0-beta.15 + - @zodios/core@11.0.0-beta.15 + - @zodios/fetch@11.0.0-beta.15 + +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 diff --git a/packages/react/LICENSE b/packages/react/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/react/README.md b/packages/react/README.md new file mode 100644 index 00000000..ba6b50b4 --- /dev/null +++ b/packages/react/README.md @@ -0,0 +1,153 @@ +

Zodios React

+

+ + Zodios logo + +

+ +

+ React hooks for zodios backed by react-query +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +# Install + +```bash +> npm install @zodios/react +``` + +or + +```bash +> yarn add @zodios/react +``` + +# Usage + +Zodios comes with a Query and Mutation hook helper. +It's a thin wrapper around React-Query but with zodios auto completion. + +Zodios query hook also returns an invalidation helper to allow you to reset react query cache easily + +```typescript +import React from "react"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { Zodios, asApi } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const createUserSchema = z + .object({ + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +const api = asApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, + { + method: "post", + path: "/users", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: createUserSchema, + }, + ], + response: userSchema, + }, +]); +const baseUrl = "https://jsonplaceholder.typicode.com"; + +const zodios = new Zodios(baseUrl, api); +const zodiosHooks = new ZodiosHooks("jsonplaceholder", zodios); + +const Users = () => { + const { + data: users, + isLoading, + error, + invalidate: invalidateUsers, // zodios also provides invalidation helpers + } = zodiosHooks.useQuery("/users"); + const { mutate } = zodiosHooks.useMutation("post", "/users", undefined, { + onSuccess: () => invalidateUsers(), + }); + + return ( + <> +

Users

+ + {isLoading &&
Loading...
} + {error &&
Error: {(error as Error).message}
} + {users && ( +
    + {users.map((user) => ( +
  • {user.name}
  • + ))} +
+ )} + + ); +}; + +// on another file +const queryClient = new QueryClient(); + +export const App = () => { + return ( + + + + ); +}; +``` diff --git a/packages/react/examples/react.tsx b/packages/react/examples/react.tsx new file mode 100644 index 00000000..6c64d7d6 --- /dev/null +++ b/packages/react/examples/react.tsx @@ -0,0 +1,131 @@ +import React, { useRef } from "react"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { makeApi, Zodios } from "@zodios/fetch"; +import { ZodiosHooks } from "../src"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const createUserSchema = z + .object({ + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + alias: "getUser", + response: userSchema, + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: createUserSchema, + }, + ], + response: userSchema, + }, +]); +const baseUrl = "https://jsonplaceholder.typicode.com"; + +const zodios = new Zodios(baseUrl, api); +const zodiosHooks = new ZodiosHooks("jsonplaceholder", zodios); + +const Users = () => { + const page = useRef(0); + const { + data: users, + isLoading, + error, + fetchNextPage, + invalidate: invalidateUsers, // zodios also provides invalidation helpers + } = zodiosHooks.useInfiniteQuery( + "/users", + { queries: { limit: 10 } }, + { + getPageParamList: () => { + return ["page"]; + }, + getNextPageParam: () => { + return { + queries: { + page: page.current + 1, + }, + }; + }, + } + ); + const { mutate } = zodiosHooks.useCreateUser(undefined, { + onSuccess: () => invalidateUsers(), + }); + + return ( + <> +

Users

+ + {isLoading &&
Loading...
} + {error &&
Error: {(error as Error).message}
} + {users && ( + <> +
    + {users.pages.flatMap((page) => + page.map((user) =>
  • {user.name}
  • ) + )} +
+ + + )} + + ); +}; + +// on another file +const queryClient = new QueryClient(); + +export const App = () => { + return ( + + + + ); +}; diff --git a/packages/react/jest.config.ts b/packages/react/jest.config.ts new file mode 100644 index 00000000..6c31134b --- /dev/null +++ b/packages/react/jest.config.ts @@ -0,0 +1,25 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "tsx", "jsx", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + "node_modules/axios/.+\\.(j|t)sx?$": "ts-jest", + }, + transformIgnorePatterns: ["node_modules/(?!axios/.*)"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 75, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "jsdom", +}; +export default config; diff --git a/packages/react/package.json b/packages/react/package.json new file mode 100644 index 00000000..fb8de341 --- /dev/null +++ b/packages/react/package.json @@ -0,0 +1,90 @@ +{ + "name": "@zodios/react", + "description": "React hooks for zodios", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "axios", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@tanstack/react-query": "4.x", + "@zodios/axios": "11.0.0-beta.19", + "@zodios/core": "11.0.0-beta.19", + "@zodios/fetch": "11.0.0-beta.19", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@zodios/axios": { + "optional": true + }, + "@zodios/fetch": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@tanstack/react-query": "4.28.0", + "@testing-library/dom": "9.2.0", + "@testing-library/jest-dom": "5.16.5", + "@testing-library/react": "14.0.0", + "@testing-library/react-hooks": "8.0.1", + "@testing-library/user-event": "14.4.3", + "@types/cors": "2.8.13", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "@types/react": "18.0.33", + "@zodios/axios": "workspace:*", + "@zodios/core": "workspace:*", + "@zodios/fetch": "workspace:*", + "cors": "2.8.5", + "cross-fetch": "3.1.5", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", + "jest": "29.5.0", + "jest-environment-jsdom": "29.5.0", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-test-renderer": "18.2.0", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/react/src/hooks.spec.tsx b/packages/react/src/hooks.spec.tsx new file mode 100644 index 00000000..9116c684 --- /dev/null +++ b/packages/react/src/hooks.spec.tsx @@ -0,0 +1,859 @@ +import "cross-fetch/polyfill"; +import React from "react"; +import { renderHook } from "@testing-library/react-hooks"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { Zodios, makeApi, ZodiosError } from "@zodios/fetch"; +import express from "express"; +import { AddressInfo } from "net"; +import cors from "cors"; +import z from "zod"; +import { ZodiosHooks } from "./hooks"; +import { Assert } from "@zodios/core/lib/utils.types"; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "post", + path: "/users/search", + alias: "searchUsers", + description: "Search users", + immutable: true, + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + page: z.number().positive().optional(), + limit: z.number().positive().optional(), + }), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/address/:address", + alias: "getUserAddress", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "put", + path: "/users", + alias: "updateUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "patch", + path: "/users", + alias: "patchUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + response: z.object({ + id: z.number(), + }), + }, + { + method: "get", + path: "/users/:id/error", + alias: "getUserError", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/cancel", + alias: "getUserCancel", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, +}); +const wrapper = ({ children }: { children: React.ReactNode }) => ( + {children} +); + +describe("zodios hooks", () => { + describe("keys", () => { + const apiClient = new Zodios(api); + const apiHooks = new ZodiosHooks("test", apiClient); + beforeAll(() => {}); + it("should get back endpoint key", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id", { + params: { id: 1 }, + }); + expect(key).toEqual(["test", "/users/:id", { params: { id: 1 } }]); + }); + + it("should be serialisable", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id", { + params: { id: 1 }, + }); + expect( + JSON.stringify(key, (k, v) => (v === undefined ? null : v)) + ).toEqual('["test","/users/:id",{"params":{"id":1}}]'); + }); + + it("should throw on invalid endpoint", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByPath("get", "/users/:id/bad", { + params: { id: 1 }, + }) + ).toThrow("No endpoint found for path 'get /users/:id/bad'"); + }); + + it("should get back endpoint invalidation key", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id"); + expect(key).toEqual(["test", "/users/:id"]); + }); + + it("should throw on invalid invalidation endpoint", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByPath("get", "/users/:id/bad") + ).toThrow("No endpoint found for path 'get /users/:id/bad'"); + }); + + it("should get back alias key", () => { + const key = apiHooks.getKeyByAlias("getUser", { + params: { id: 1 }, + }); + expect(key).toEqual(["test", "/users/:id", { params: { id: 1 } }]); + }); + + it("should throw on invalid alias", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByAlias("getTest", { + params: { id: 1 }, + }) + ).toThrow("No endpoint found for alias 'getTest'"); + }); + + it("should get back alias invalidation key", () => { + const key = apiHooks.getKeyByAlias("getUser"); + expect(key).toEqual(["test", "/users/:id"]); + }); + + it("should throw on invalid invalidation alias", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByAlias("getTest") + ).toThrow("No endpoint found for alias 'getTest'"); + }); + }); + describe("hooks", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(async () => { + app = express(); + app.use(express.json()); + app.use(cors()); + const userDB = Array.from({ length: 23 }, (_, i) => ({ + id: i + 1, + name: `User ${i + 1}`, + })); + app.get("/users", (req, res) => { + const page = req.query.page ? +req.query.page : 1; + const limit = req.query.limit ? +req.query.limit : 10; + const start = (page - 1) * limit; + const end = start + limit; + const nextPage = end < userDB.length ? page + 1 : undefined; + const users = userDB.slice(start, end); + + res.json({ + page, + count: users.length, + nextPage, + users, + }); + }); + app.post("/users/search", (req, res) => { + const { name } = req.body; + const users = userDB.filter((user) => user.name.includes(name)); + const page = req.body.page ?? 1; + const limit = req.body.limit ?? 10; + const start = (page - 1) * limit; + const end = start + limit; + const nextPage = end < users.length ? page + 1 : undefined; + const result = users.slice(start, end); + res.json({ + page, + count: result.length, + nextPage, + users: result, + }); + }); + app.get("/error502", (req, res) => { + res.status(502).json({ error: { message: "bad gateway" } }); + }); + app.get("/users/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + app.get("/users/:id/address/:address", (req, res) => { + res + .status(200) + .json({ id: Number(req.params.id), address: req.params.address }); + }); + app.post("/users", (req, res) => { + res.status(200).json({ id: 3, name: req.body.name }); + }); + app.put("/users", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.patch("/users", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.delete("/users/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id) }); + }); + app.get("/users/:id/error", (req, res) => { + res.status(200).json({ id: Number(req.params.id), names: "test" }); + }); + app.get("/users/:id/cancel", async (req, res) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should get id", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + + const { result, waitFor } = renderHook( + () => apiHooks.useGet("/users/:id", { params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + name: "test", + }); + expect(result.current.invalidate).toBeDefined(); + }); + + it("should have validation error", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useGet("/users/:id/error", { params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isError); + expect(result.current.error).toBeInstanceOf(ZodiosError); + }); + + it("should get id with alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useGetUser({ params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + name: "test", + }); + expect(result.current.invalidate).toBeDefined(); + }); + + it("should get id and address", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => + apiHooks.useGet("/users/:id/address/:address", { + params: { id: 1, address: "test" }, + }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + address: "test", + }); + }); + + it("should create user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userCreated, setUserCreated] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.useMutation( + "post", + "/users", + undefined, + { + onSuccess: (data) => { + // ^? + setUserCreated(data); + }, + } + ); + const testMutation: Assert< + typeof apiMutations.data, + { id: number; name: string } | undefined + > = true; + return { apiMutations, userCreated }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userCreated).toEqual({ id: 3, name: "test" }); + }); + + it("should search immutable users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => + apiHooks.useImmutableQuery("/users/search", { + body: { + name: "User 21", + }, + }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + page: 1, + count: 1, + users: [ + { + id: 21, + name: "User 21", + }, + ], + }); + expect(result.current.invalidate).toBeDefined(); + expect(result.current.key).toBeDefined(); + }); + + it("should search immutable users by alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useSearchUsers({ body: { name: "User 22" } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + page: 1, + count: 1, + users: [ + { + id: 22, + name: "User 22", + }, + ], + }); + expect(result.current.invalidate).toBeDefined(); + expect(result.current.key).toBeDefined(); + }); + + it("should update user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userUpdated, setUserUpdated] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.usePut("/users", undefined, { + onSuccess: (data) => { + setUserUpdated(data); + }, + }); + return { apiMutations, userUpdated }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ id: 1, name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userUpdated).toEqual({ id: 1, name: "test" }); + }); + + it("should patch user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userPatched, setUserPatched] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.usePatch("/users", undefined, { + onSuccess: (data) => { + setUserPatched(data); + }, + }); + return { apiMutations, userPatched }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ id: 2, name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userPatched).toEqual({ id: 2, name: "test" }); + }); + + it("should delete user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userDeleted, setUserDeleted] = React.useState<{ + id: number; + }>(); + const apiMutations = apiHooks.useDelete( + "/users/:id", + { params: { id: 3 } }, + { + onSuccess: (data) => { + setUserDeleted(data); + }, + } + ); + return { apiMutations, userDeleted }; + }, + { wrapper } + ); + result.current.apiMutations.mutate(undefined); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userDeleted).toEqual({ id: 3 }); + }); + + it("should delete user with alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userDeleted, setUserDeleted] = React.useState<{ + id: number; + }>(); + const apiMutations = apiHooks.useDeleteUser( + { params: { id: 3 } }, + { + onSuccess: (data) => { + setUserDeleted(data); + }, + } + ); + return { apiMutations, userDeleted }; + }, + { wrapper } + ); + result.current.apiMutations.mutate(undefined); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userDeleted).toEqual({ id: 3 }); + }); + + it("should cancel request with signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + timeout: 1000, + }); + return { apiCancel, controller }; + }, + { wrapper } + ); + result.current.controller.abort(); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request early with signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + controller.abort(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request with timeout and signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + timeout: 1, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request with timeout", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + timeout: 1, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should infinite load users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const apiInfinite = apiHooks.useInfiniteQuery( + "/users", + { + queries: { limit: 10 }, + }, + { + getPageParamList: () => ["page"], + getNextPageParam: (lastPage, pages) => { + return lastPage.nextPage + ? { + queries: { + page: lastPage.nextPage, + }, + } + : undefined; + }, + } + ); + return { apiInfinite }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiInfinite.isSuccess); + expect(result.current.apiInfinite.data?.pages).toEqual([ + { + users: [ + { + id: 1, + name: "User 1", + }, + { + id: 2, + name: "User 2", + }, + { + id: 3, + name: "User 3", + }, + { + id: 4, + name: "User 4", + }, + { + id: 5, + name: "User 5", + }, + { + id: 6, + name: "User 6", + }, + { + id: 7, + name: "User 7", + }, + { + id: 8, + name: "User 8", + }, + { + id: 9, + name: "User 9", + }, + { + id: 10, + name: "User 10", + }, + ], + page: 1, + count: 10, + nextPage: 2, + }, + ]); + + let i = 1; + do { + result.current.apiInfinite.fetchNextPage(); + await waitFor(() => result.current.apiInfinite.isFetching); + await waitFor(() => !result.current.apiInfinite.isFetching); + expect(result.current.apiInfinite.data?.pages.length).toEqual(++i); + } while (result.current.apiInfinite.hasNextPage); + expect(i).toEqual(3); + }); + + it("should infinite search users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const apiInfinite = apiHooks.useImmutableInfiniteQuery( + "/users/search", + { + body: { + name: "User", + limit: 10, + }, + }, + { + getPageParamList: () => ["page"], + getNextPageParam: (lastPage, pages) => { + return lastPage.nextPage + ? { + body: { + page: lastPage.nextPage, + }, + } + : undefined; + }, + } + ); + return { apiInfinite }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiInfinite.isSuccess); + expect(result.current.apiInfinite.data?.pages).toEqual([ + { + users: [ + { + id: 1, + name: "User 1", + }, + { + id: 2, + name: "User 2", + }, + { + id: 3, + name: "User 3", + }, + { + id: 4, + name: "User 4", + }, + { + id: 5, + name: "User 5", + }, + { + id: 6, + name: "User 6", + }, + { + id: 7, + name: "User 7", + }, + { + id: 8, + name: "User 8", + }, + { + id: 9, + name: "User 9", + }, + { + id: 10, + name: "User 10", + }, + ], + page: 1, + count: 10, + + nextPage: 2, + }, + ]); + + let i = 1; + do { + result.current.apiInfinite.fetchNextPage(); + await waitFor(() => result.current.apiInfinite.isFetching); + await waitFor(() => !result.current.apiInfinite.isFetching); + expect(result.current.apiInfinite.data?.pages.length).toEqual(++i); + if (i < 3) { + expect(result.current.apiInfinite.data?.pages[i - 1]).toEqual({ + users: Array.from({ length: 10 }, (_, ii) => ({ + id: (i - 1) * 10 + ii + 1, + name: `User ${(i - 1) * 10 + ii + 1}`, + })), + page: i, + count: 10, + + nextPage: i + 1, + }); + } + } while (result.current.apiInfinite.hasNextPage); + expect(i).toEqual(3); + }); + }); +}); diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts new file mode 100644 index 00000000..b1011996 --- /dev/null +++ b/packages/react/src/hooks.ts @@ -0,0 +1,948 @@ +import { + useQuery, + UseQueryOptions, + UseQueryResult, + useMutation, + UseMutationOptions, + UseMutationResult, + useInfiniteQuery, + UseInfiniteQueryOptions, + useQueryClient, + QueryFunctionContext, + QueryKey, + UseInfiniteQueryResult, +} from "@tanstack/react-query"; +import { + ZodiosError, + HTTP_MUTATION_METHODS, + FindZodiosEndpointDefinitionByAlias, +} from "@zodios/core"; +import type { + AnyZodiosFetcherProvider, + AnyZodiosMethodOptions, + AnyZodiosTypeProvider, + Method, + ZodiosInstance, + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosResponseByAlias, + ZodiosEndpointDefinition, + ZodiosRequestOptionsByPath, + ZodiosBodyByPath, + ZodiosBodyByAlias, + ZodiosQueryParamsByPath, + ZodiosRequestOptionsByAlias, + ZodTypeProvider, +} from "@zodios/core"; +import type { + IfEquals, + PathParamNames, + ReadonlyDeep, + RequiredKeys, +} from "@zodios/core/lib/utils.types"; +import type { Aliases, MutationMethod } from "@zodios/core/lib/zodios.types"; +import { capitalize, pick, omit, hasObjectBody, combineSignals } from "./utils"; + +type UndefinedIfNever = IfEquals; +type Errors = Error | ZodiosError; + +type MutationOptions< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + TypeProvider extends AnyZodiosTypeProvider +> = Omit< + UseMutationOptions< + Awaited>, + Errors, + UndefinedIfNever> + >, + "mutationFn" | "mutationKey" +>; + +type MutationOptionsByAlias< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Alias extends string, + TypeProvider extends AnyZodiosTypeProvider +> = Omit< + UseMutationOptions< + Awaited>, + Errors, + UndefinedIfNever> + >, + "mutationFn" +>; + +export type QueryOptions = Omit< + UseQueryOptions, + "queryKey" | "queryFn" +>; + +type ImmutableQueryOptions = Omit< + UseQueryOptions, + "queryKey" | "queryFn" +>; + +type InfiniteQueryOptions = Omit< + UseInfiniteQueryOptions, + "queryKey" | "queryFn" +>; + +export type ImmutableInfiniteQueryOptions = Omit< + UseInfiniteQueryOptions, + "queryKey" | "queryFn" +>; + +export class ZodiosHooksImpl< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + constructor( + private readonly apiName: string, + private readonly zodios: ZodiosInstance, + private readonly options: { shouldAbortOnUnmount?: boolean } = {} + ) { + this.injectAliasEndpoints(); + this.injectMutationEndpoints(); + } + + private injectAliasEndpoints() { + this.zodios.api.forEach((endpoint) => { + if (endpoint.alias) { + if (["post", "put", "patch", "delete"].includes(endpoint.method)) { + if (endpoint.method === "post" && endpoint.immutable) { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + mutationOptions: any + ) => + this.useImmutableQuery( + endpoint.path as any, + config, + mutationOptions + ); + } else { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + mutationOptions: any + ) => + this.useMutation( + // @ts-expect-error + endpoint.method, + endpoint.path as any, + config, + mutationOptions + ); + } + } else { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + queryOptions: any + ) => this.useQuery(endpoint.path as any, config, queryOptions); + } + } + }); + } + + private injectMutationEndpoints() { + HTTP_MUTATION_METHODS.forEach((method) => { + (this as any)[`use${capitalize(method)}`] = ( + path: any, + config: any, + mutationOptions: any + // @ts-expect-error + ) => this.useMutation(method, path, config, mutationOptions); + }); + } + + private getEndpointByPath(method: string, path: string) { + return this.zodios.api.find( + (endpoint) => endpoint.method === method && endpoint.path === path + ); + } + + private getEndpointByAlias(alias: string) { + return this.zodios.api.find((endpoint) => endpoint.alias === alias); + } + + /** + * compute the key for the provided endpoint + * @param method - HTTP method of the endpoint + * @param path - path for the endpoint + * @param config - parameters of the api to the endpoint - when providing no parameters, will return the common key for the endpoint + * @returns - Key + */ + getKeyByPath>( + method: M, + path: Path extends ZodiosPathsByMethod ? Path : never, + config?: ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > + ) { + const endpoint = this.getEndpointByPath(method, path); + if (!endpoint) + throw new Error(`No endpoint found for path '${method} ${path}'`); + if (config) { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + if (Object.keys(params).length > 0) + return [this.apiName, endpoint.path, params] as QueryKey; + } + return [this.apiName, endpoint.path] as QueryKey; + } + + /** + * compute the key for the provided endpoint alias + * @param alias - alias of the endpoint + * @param config - parameters of the api to the endpoint + * @returns - QueryKey + */ + getKeyByAlias>( + alias: Alias extends string ? Alias : never, + config?: Alias extends string + ? ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + > + : never + ) { + const endpoint = this.getEndpointByAlias(alias); + if (!endpoint) throw new Error(`No endpoint found for alias '${alias}'`); + if (config) { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + if (Object.keys(params).length > 0) + return [this.apiName, endpoint.path, params] as QueryKey; + } + return [this.apiName, endpoint.path] as QueryKey; + } + + useQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const key = this.getKeyByPath("get", path, config as any); + const query = (queryParams: QueryFunctionContext) => + this.zodios.get(path, { + ...(config as any), + signal: this.options.shouldAbortOnUnmount + ? combineSignals(queryParams.signal, (config as any)?.signal) + : (config as any)?.signal, + }); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + // @ts-expect-error + ...useQuery(key, query, queryOptions), + }; + } + + useImmutableQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const key = this.getKeyByPath("post", path, config as any); + const query = (queryParams: QueryFunctionContext) => + this.zodios.post(path, { + ...(config as any), + signal: this.options.shouldAbortOnUnmount + ? combineSignals(queryParams.signal, (config as any)?.signal) + : (config as any)?.signal, + }); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useQuery(key, query as any, queryOptions), + }; + } + + useInfiniteQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData, + TQueryParams = ZodiosQueryParamsByPath< + Api, + "get", + Path, + true, + TypeProvider + > extends never + ? never + : keyof ZodiosQueryParamsByPath + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: InfiniteQueryOptions & { + getPageParamList: () => (TQueryParams | PathParamNames)[]; + } + ] + : [ + config: ReadonlyDeep, + queryOptions?: InfiniteQueryOptions & { + getPageParamList: () => (TQueryParams | PathParamNames)[]; + } + ] + ): UseInfiniteQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + // istanbul ignore next + if (params.params && queryOptions) { + params.params = omit( + params.params, + queryOptions.getPageParamList() as string[] + ); + } + if (params.queries && queryOptions) { + params.queries = omit( + params.queries, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if ( + params.body && + typeof params.body === "object" && + !Array.isArray(params.body) && + queryOptions + ) { + params.body = omit( + params.body as Record, + queryOptions.getPageParamList() as string[] + ); + } + const key = [this.apiName, path, params]; + const query = (queryParams: QueryFunctionContext) => + this.zodios.get(path, { + ...config, + queries: { + ...(config as any)?.queries, + ...queryParams.pageParam?.queries, + }, + params: { + ...(config as any)?.params, + ...queryParams.pageParam?.params, + }, + body: + // istanbul ignore next + hasObjectBody(config) + ? { + ...(config as any)?.body, + ...queryParams.pageParam?.body, + } + : (config as any)?.body, + signal: this.options.shouldAbortOnUnmount + ? combineSignals(queryParams.signal, (config as any)?.signal) + : (config as any)?.signal, + } as unknown as ReadonlyDeep); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useInfiniteQuery( + key, + query as any, + queryOptions as Omit + ), + }; + } + + useImmutableInfiniteQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData, + TQueryParams = ZodiosQueryParamsByPath< + Api, + "post", + Path, + true, + TypeProvider + > extends never + ? never + : keyof ZodiosQueryParamsByPath + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableInfiniteQueryOptions & { + getPageParamList: () => ( + | keyof ZodiosBodyByPath + | PathParamNames + | TQueryParams + )[]; + } + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableInfiniteQueryOptions & { + getPageParamList: () => ( + | keyof ZodiosBodyByPath + | PathParamNames + | TQueryParams + )[]; + } + ] + ): UseInfiniteQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + // istanbul ignore next + if (params.params && queryOptions) { + params.params = omit( + params.params, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if (params.queries && queryOptions) { + params.queries = omit( + params.queries, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if ( + params.body && + typeof params.body === "object" && + !Array.isArray(params.body) && + queryOptions + ) { + params.body = omit( + params.body as Record, + queryOptions.getPageParamList() as string[] + ); + } + const key = [this.apiName, path, params]; + const query = (queryParams: QueryFunctionContext) => + this.zodios.post(path, { + ...config, + queries: { + ...(config as any)?.queries, + ...queryParams.pageParam?.queries, + }, + params: { + ...(config as any)?.params, + ...queryParams.pageParam?.params, + }, + body: + // istanbul ignore next + hasObjectBody(config) + ? { + ...(config as any)?.body, + ...queryParams.pageParam?.body, + } + : (config as any)?.body, + signal: this.options.shouldAbortOnUnmount + ? combineSignals(queryParams.signal, (config as any)?.signal) + : (config as any)?.signal, + } as unknown as ReadonlyDeep); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useInfiniteQuery( + key, + // @ts-expect-error + query, + queryOptions as Omit + ), + }; + } + + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "get", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "post", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "put", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "put", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "patch", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "delete", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + M extends Method, + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: M, + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + const mutation = (body: MutationVariables) => { + return this.zodios.request({ + ...config, + method, + url: path, + body, + } as any); + }; + // @ts-expect-error + return useMutation(mutation, mutationOptions); + } + + useGet< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + return this.useQuery(path, ...(rest as any[])); + } +} + +export type ZodiosMutationAliasHook = + RequiredKeys extends never + ? ( + configOptions?: ReadonlyDeep, + mutationOptions?: MutationOptions + ) => UseMutationResult, unknown> + : ( + configOptions: ReadonlyDeep, + mutationOptions?: MutationOptions + ) => UseMutationResult, unknown>; + +export type ZodiosHooksAliases< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [Alias in Aliases as `use${Capitalize}`]: FindZodiosEndpointDefinitionByAlias< + Api, + Alias + >["method"] extends infer AliasMethod + ? AliasMethod extends MutationMethod + ? { + immutable: FindZodiosEndpointDefinitionByAlias< + Api, + Alias + >["immutable"]; + method: AliasMethod; + } extends { immutable: true; method: "post" } + ? // immutable query + < + TConfig extends ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByAlias< + Api, + Alias, + true, + TypeProvider + >, + TData = ZodiosResponseByAlias + >( + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + ) => UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } + : // useMutation + ZodiosMutationAliasHook< + ZodiosBodyByAlias, + Omit< + ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationOptionsByAlias, + ZodiosResponseByAlias + > + : // useQuery + < + Config extends ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByAlias, + TData = ZodiosResponseByAlias + >( + ...rest: RequiredKeys extends never + ? [ + configOptions?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + configOptions: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ) => UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } + : never; +}; + +export type ZodiosHooksMutations< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [M in MutationMethod as `use${Capitalize}`]: < + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ) => UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; +}; + +export type ZodiosHooksInstance< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = ZodiosHooksImpl & + ZodiosHooksAliases & + ZodiosHooksMutations; + +export type ZodiosHooks = { + new < + Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider + >( + name: string, + zodios: ZodiosInstance, + options?: { shouldAbortOnUnmount?: boolean } + ): ZodiosHooksInstance; +}; + +export const ZodiosHooks = ZodiosHooksImpl as ZodiosHooks; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts new file mode 100644 index 00000000..9b8b40fb --- /dev/null +++ b/packages/react/src/index.ts @@ -0,0 +1 @@ +export { ZodiosHooks, ZodiosHooksInstance } from "./hooks"; diff --git a/packages/react/src/utils.test.ts b/packages/react/src/utils.test.ts new file mode 100644 index 00000000..acd308bd --- /dev/null +++ b/packages/react/src/utils.test.ts @@ -0,0 +1,86 @@ +import { capitalize, omit, pick } from "./utils"; + +describe("omit", () => { + it("should be defined", () => { + expect(omit).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(omit(obj, ["a"])).toEqual({}); + }); + + it("should remove the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a"])).toEqual({ + b: 2, + c: 3, + }); + }); + + it("should accept to remove all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a", "b", "c"])).toEqual({}); + }); +}); + +describe("pick", () => { + it("should be defined", () => { + expect(pick).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(pick(obj, ["a"])).toEqual({}); + }); + + it("should pick the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a"])).toEqual({ + a: 1, + }); + }); + + it("should accept to pick all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a", "b", "c"])).toEqual(obj); + }); + + it("should allow undefined picks", () => { + expect(pick(undefined, ["a", "b"])).toEqual({}); + }); +}); + +describe("capitalize", () => { + it("should be defined", () => { + expect(capitalize).toBeDefined(); + }); + + it("should capitalize the first letter of the string", () => { + expect(capitalize("anyway")).toEqual("Anyway"); + }); + + it("should capitalize the first letter of an utf8 string", () => { + expect(capitalize("émmanuelle")).toEqual("Émmanuelle"); + }); +}); diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts new file mode 100644 index 00000000..d3c077e8 --- /dev/null +++ b/packages/react/src/utils.ts @@ -0,0 +1,93 @@ +import { AnyZodiosRequestOptions } from "@zodios/core"; + +/** + * omit properties from an object + * @param obj - the object to omit properties from + * @param keys - the keys to omit + * @returns the object with the omitted properties + */ +export function omit( + obj: T | undefined, + keys: K[] +): Omit { + const ret = { ...obj } as T; + for (const key of keys) { + delete ret[key]; + } + return ret; +} + +/** + * pick properties from an object + * @param obj - the object to pick properties from + * @param keys - the keys to pick + * @returns the object with the picked properties + */ +export function pick, K extends keyof T>( + obj: T | undefined, + keys: K[] +): Pick { + const ret = {} as Pick; + if (obj) { + for (const key of keys) { + if (key in obj && obj[key] !== undefined) { + ret[key] = obj[key]; + } + } + } + return ret; +} + +/** + * set first letter of a string to uppercase + * @param str - the string to capitalize + * @returns - the string with the first letter uppercased + */ +export function capitalize(str: string) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +export function hasObjectBody(config?: any) { + return ( + config?.body && + typeof config.body === "object" && + !Array.isArray(config.body) + ); +} + +function isDefinedSignal( + signal: AbortSignal | undefined | null +): signal is AbortSignal { + return Boolean(signal); +} + +/** + * combine multiple abort signals into one + * @param signals - the signals to listen to + * @returns - the combined signal + */ +export function combineSignals( + ...signals: (AbortSignal | undefined | null)[] +): AbortSignal | undefined { + const definedSignals: AbortSignal[] = signals.filter(isDefinedSignal); + if (definedSignals.length < 2) { + return definedSignals[0]; + } + const controller = new AbortController(); + + function onAbort() { + controller.abort(); + definedSignals.forEach((signal) => { + signal.removeEventListener("abort", onAbort); + }); + } + + definedSignals.forEach((signal) => { + if (signal.aborted) { + onAbort(); + } else { + signal.addEventListener("abort", onAbort); + } + }); + return controller.signal; +} diff --git a/packages/react/tsconfig.build.json b/packages/react/tsconfig.build.json new file mode 100644 index 00000000..496e5472 --- /dev/null +++ b/packages/react/tsconfig.build.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "coverage", + "examples", + "**/*.config.js", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.d.ts" + ] +} diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json new file mode 100644 index 00000000..240c1c11 --- /dev/null +++ b/packages/react/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "allowJs": true, + "jsx": "react-jsx" + }, + "exclude": ["node_modules", "lib", "coverage"] +} diff --git a/packages/react/tsup.config.js b/packages/react/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/react/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/testing/.gitignore b/packages/testing/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/testing/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/testing/.npmignore b/packages/testing/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/testing/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md new file mode 100644 index 00000000..fa4f14fc --- /dev/null +++ b/packages/testing/CHANGELOG.md @@ -0,0 +1,201 @@ +# @zodios/core + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + +## 11.0.0-beta.9 + +### Major Changes + +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +## 11.0.0-beta.4 + +### Major Changes + +- 6c10dc2: rename exports +- 679a267: update axios + +### Patch Changes + +- 14ce00b: add fetch implementation +- c9cae0a: autocommit on changesets +- 3ac25a1: add fetcher provider and axios impl +- 90108a5: body is now part of the config + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/testing/LICENSE b/packages/testing/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/testing/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/testing/README.md b/packages/testing/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/testing/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/testing/SECURITY.md b/packages/testing/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/testing/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/testing/jest.config.ts b/packages/testing/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/testing/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/testing/package.json b/packages/testing/package.json new file mode 100644 index 00000000..2740d6be --- /dev/null +++ b/packages/testing/package.json @@ -0,0 +1,60 @@ +{ + "name": "@zodios/testing", + "description": "Zodios mock library", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "zodios", + "mock", + "testing" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.19" + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "@zodios/core": "workspace:*", + "@zodios/fetch": "workspace:*", + "form-data": "^4.0.0", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + } +} diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts new file mode 100644 index 00000000..94a4a9ce --- /dev/null +++ b/packages/testing/src/index.ts @@ -0,0 +1,2 @@ +export { ZodiosMocks } from "./zodios"; +export type { MockProvider, MockResponse } from "./mock-provider"; diff --git a/packages/testing/src/mock-provider/index.ts b/packages/testing/src/mock-provider/index.ts new file mode 100644 index 00000000..6fa0ecf1 --- /dev/null +++ b/packages/testing/src/mock-provider/index.ts @@ -0,0 +1 @@ +export * from "./mock-provider"; diff --git a/packages/testing/src/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts new file mode 100644 index 00000000..a890568a --- /dev/null +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -0,0 +1,113 @@ +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosFetcher, + ZodiosFetcherFactory, +} from "@zodios/core"; +import { setFetcherHook, clearFetcherHook } from "@zodios/core"; + +export interface MockProvider extends AnyZodiosFetcherProvider { + options: {}; + config: { + baseURL?: string; + body?: unknown; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; + }; + response: unknown; + error: unknown; +} + +class Fetcher implements ZodiosFetcher { + constructor(public baseURL: string | undefined) {} + async fetch(config: AnyZodiosRequestOptions) { + for (const [{ method, url }, callback] of registeredMocks) { + if (method === config.method && url === config.url) { + const result = { + headers: {}, + status: 200, + statusText: "OK", + ...(await callback(config)), + }; + if ( + (config.validateStatus && !config.validateStatus(result.status)) || + result.status > 299 + ) { + const err = new Error( + `Request failed with status code ${result.status}` + ) as Error & { code: string; config: any; response: any }; + err.code = `ERR_STATUS_${result.status}`; + err.config = config; + err.response = result; + throw err; + } + return result; + } + } + throw new Error(`No mocks found for ${config.url}`); + } +} + +export const mockFactory: ZodiosFetcherFactory = (options) => + new Fetcher(options?.baseURL); + +export type MockResponse = { + readonly headers?: Record; + readonly status?: number; + readonly statusText?: string; + readonly data: Data; +}; + +export type MaybePromise = T | Promise; + +interface ZodiosMockBase { + install(): void; + uninstall(): void; + reset(): void; + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => MaybePromise + ): void; + mockResponse(method: string, path: string, response: MockResponse): void; +} + +const registeredMocks = new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => MaybePromise +>(); + +export const zodiosMocks: ZodiosMockBase = { + install() { + setFetcherHook(mockFactory()); + }, + uninstall() { + registeredMocks.clear(); + clearFetcherHook(); + }, + reset() { + registeredMocks.clear(); + }, + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => MaybePromise + ) { + registeredMocks.set({ method, url: path }, callback); + }, + mockResponse(method: string, path: string, response: MockResponse) { + registeredMocks.set( + { + method, + url: path, + }, + () => response + ); + }, +}; diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts new file mode 100644 index 00000000..9feea1c4 --- /dev/null +++ b/packages/testing/src/zodios.test.ts @@ -0,0 +1,389 @@ +/// +import { z } from "zod"; +import { makeApi, makeErrors, Zodios } from "@zodios/fetch"; +import { ZodiosMocks } from "./index"; + +const userSchema = z.object({ + id: z.number(), + name: z.string(), + email: z.string(), +}); + +const errorSchemas = makeErrors([ + { + status: "default", + schema: z.object({ + message: z.string(), + }), + }, +]); + +const api = makeApi([ + { + method: "get", + path: "/users", + response: z.array(userSchema), + errors: errorSchemas, + }, + { + method: "get", + path: "/users/:id", + response: userSchema, + errors: errorSchemas, + }, + { + method: "post", + path: "/users", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "put", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema, + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "patch", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema, + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "delete", + path: "/users/:id", + response: userSchema, + errors: errorSchemas, + }, +]); + +const zodios = new Zodios(api); +const mocks = new ZodiosMocks(zodios); + +describe("Zodios", () => { + describe("dynamic mocks", () => { + beforeAll(() => { + ZodiosMocks.install(); + mocks.get("/users", (config) => { + return { + data: [ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ], + }; + }); + mocks.get("/users/:id", (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.post("/users", (config) => { + return { + data: { + id: 1, + ...config.body, + }, + }; + }); + mocks.put("/users/:id", (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.patch("/users/:id", (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.delete("/users/:id", (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + }); + + afterAll(() => { + ZodiosMocks.uninstall(); + }); + + it("should be defined", () => { + expect(ZodiosMocks).toBeDefined(); + }); + + it("should be able to mock a request", async () => { + const response = await zodios.get("/users"); + expect(response).toEqual([ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ]); + }); + it("should be able to mock a request with params", async () => { + const response = await zodios.get("/users/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + it("should be able to mock errors of a request with params", async () => { + let error; + try { + const response = await zodios.get("/users/:id", { params: { id: 2 } }); + } catch (e) { + error = e; + } + expect(error).toBeDefined(); + expect((error as any).response.status).toEqual(404); + }); + it("should be able to mock a post request", async () => { + const response = await zodios.post("/users", { + body: { name: "John Doe", email: "john.doe@test-post.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }); + }); + it("should be able to mock a put request", async () => { + const response = await zodios.put("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }); + }); + it("should be able to mock a patch request", async () => { + const response = await zodios.patch("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }); + }); + it("should be able to mock a delete request", async () => { + const response = await zodios.delete("/users/:id", { + params: { id: 1 }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + }); + + describe("static mocks", () => { + beforeAll(() => { + ZodiosMocks.install(); + }); + afterAll(() => { + ZodiosMocks.uninstall(); + }); + beforeEach(() => { + ZodiosMocks.reset(); + }); + + it("should be able to mock a request", async () => { + mocks.getResponse("/users", { + data: [ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ], + }); + const response = await zodios.get("/users"); + expect(response).toEqual([ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ]); + }); + it("should be able to mock a request with params", async () => { + mocks.getResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }); + + const response = await zodios.get("/users/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + it("should be able to mock errors of a request with params", async () => { + mocks.getResponse("/users/:id", { + status: 404, + data: { + message: "User not found", + }, + }); + let error; + try { + const response = await zodios.get("/users/:id", { params: { id: 2 } }); + } catch (e) { + error = e; + } + expect(error).toBeDefined(); + expect((error as any).response.status).toEqual(404); + }); + it("should be able to mock a post request", async () => { + mocks.postResponse("/users", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }, + }); + + const response = await zodios.post("/users", { + body: { name: "John Doe", email: "john.doe@test-post.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }); + }); + it("should be able to mock a put request", async () => { + mocks.putResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }, + }); + + const response = await zodios.put("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }); + }); + it("should be able to mock a patch request", async () => { + mocks.patchResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }, + }); + const response = await zodios.patch("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }); + }); + it("should be able to mock a delete request", async () => { + mocks.deleteResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }); + + const response = await zodios.delete("/users/:id", { + params: { id: 1 }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + }); +}); diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts new file mode 100644 index 00000000..3ef6be86 --- /dev/null +++ b/packages/testing/src/zodios.ts @@ -0,0 +1,207 @@ +import type { + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosEndpointDefinition, + ZodiosRequestOptionsByPath, + AnyZodiosTypeProvider, + ZodTypeProvider, + AnyZodiosFetcherProvider, + ZodiosBase, + ZodiosErrorsByPath, +} from "@zodios/core"; +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; +import { zodiosMocks, MockResponse, MaybePromise } from "./mock-provider"; +/** + * zodios mock service + */ +export class ZodiosMocks< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + constructor( + private readonly zodios: ZodiosBase + ) {} + + static install() { + zodiosMocks.install(); + } + + static uninstall() { + zodiosMocks.uninstall(); + } + + static reset() { + zodiosMocks.reset(); + } + + get< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => MaybePromise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("get", path, callback as any); + } + + getResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("get", path, response); + } + + post< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => MaybePromise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("post", path, callback as any); + } + + postResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("post", path, response); + } + + put< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "put", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => MaybePromise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("put", path, callback as any); + } + + putResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("put", path, response); + } + + patch< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => MaybePromise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("patch", path, callback as any); + } + + patchResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("patch", path, response); + } + + delete< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => MaybePromise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("delete", path, callback as any); + } + + deleteResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("delete", path, response); + } +} diff --git a/packages/testing/tsconfig.build.json b/packages/testing/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/testing/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/testing/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/testing/tsup.config.js b/packages/testing/tsup.config.js new file mode 100644 index 00000000..6fc64294 --- /dev/null +++ b/packages/testing/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts", "src/utils.types.ts", "src/zodios.types.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..d35fe410 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,6224 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +overrides: + esbuild: 0.17.14 + +importers: + + .: + devDependencies: + '@changesets/cli': + specifier: 2.26.1 + version: 2.26.1 + turbo: + specifier: 1.8.8 + version: 1.8.8 + typescript: + specifier: 5.0.4 + version: 5.0.4 + + packages/axios: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + axios: + specifier: 1.3.5 + version: 1.3.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/core: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + form-data: + specifier: ^4.0.0 + version: 4.0.0 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/express: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/supertest': + specifier: 2.0.12 + version: 2.0.12 + '@zodios/core': + specifier: workspace:* + version: link:../core + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + supertest: + specifier: 6.3.3 + version: 6.3.3 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/fetch: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + cross-fetch: + specifier: 3.1.5 + version: 3.1.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/fetch-batch: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + + packages/openapi: + dependencies: + openapi-types: + specifier: 12.1.0 + version: 12.1.0 + zod-to-json-schema: + specifier: 3.20.4 + version: 3.20.4(zod@3.21.4) + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/swagger-ui-express': + specifier: 4.1.3 + version: 4.1.3 + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/express': + specifier: workspace:* + version: link:../express + axios: + specifier: 1.3.5 + version: 1.3.5 + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + swagger-ui-express: + specifier: 4.6.2 + version: 4.6.2(express@4.18.2) + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/react: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@tanstack/react-query': + specifier: 4.28.0 + version: 4.28.0(react-dom@18.2.0)(react@18.2.0) + '@testing-library/dom': + specifier: 9.2.0 + version: 9.2.0 + '@testing-library/jest-dom': + specifier: 5.16.5 + version: 5.16.5 + '@testing-library/react': + specifier: 14.0.0 + version: 14.0.0(react-dom@18.2.0)(react@18.2.0) + '@testing-library/react-hooks': + specifier: 8.0.1 + version: 8.0.1(@types/react@18.0.33)(react-dom@18.2.0)(react-test-renderer@18.2.0)(react@18.2.0) + '@testing-library/user-event': + specifier: 14.4.3 + version: 14.4.3(@testing-library/dom@9.2.0) + '@types/cors': + specifier: 2.8.13 + version: 2.8.13 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/react': + specifier: 18.0.33 + version: 18.0.33 + '@zodios/axios': + specifier: workspace:* + version: link:../axios + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/fetch': + specifier: workspace:* + version: link:../fetch + cors: + specifier: 2.8.5 + version: 2.8.5 + cross-fetch: + specifier: 3.1.5 + version: 3.1.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + jest-environment-jsdom: + specifier: 29.5.0 + version: 29.5.0 + react: + specifier: 18.2.0 + version: 18.2.0 + react-dom: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) + react-test-renderer: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/testing: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/fetch': + specifier: workspace:* + version: link:../fetch + form-data: + specifier: ^4.0.0 + version: 4.0.0 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + +packages: + + /@adobe/css-tools@4.2.0: + resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} + dev: true + + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + + /@babel/code-frame@7.21.4: + resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + dev: true + + /@babel/compat-data@7.21.4: + resolution: {integrity: sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/core@7.21.4: + resolution: {integrity: sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.21.4) + '@babel/helper-module-transforms': 7.21.2 + '@babel/helpers': 7.21.0 + '@babel/parser': 7.21.4 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.21.4: + resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + jsesc: 2.5.2 + dev: true + + /@babel/helper-compilation-targets@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.21.4 + '@babel/core': 7.21.4 + '@babel/helper-validator-option': 7.21.0 + browserslist: 4.21.5 + lru-cache: 5.1.1 + semver: 6.3.0 + dev: true + + /@babel/helper-environment-visitor@7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-function-name@7.21.0: + resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-hoist-variables@7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-module-imports@7.21.4: + resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-module-transforms@7.21.2: + resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.21.4 + '@babel/helper-simple-access': 7.20.2 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-plugin-utils@7.20.2: + resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-simple-access@7.20.2: + resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-split-export-declaration@7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-string-parser@7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-identifier@7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.21.0: + resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helpers@7.21.0: + resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/highlight@7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.21.4: + resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.21.4): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.21.4): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.21.4): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/runtime@7.21.0: + resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.11 + dev: true + + /@babel/template@7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + dev: true + + /@babel/traverse@7.21.4: + resolution: {integrity: sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types@7.21.4: + resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: true + + /@bcoe/v8-coverage@0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + + /@changesets/apply-release-plan@6.1.3: + resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/config': 2.3.0 + '@changesets/get-version-range-type': 0.3.2 + '@changesets/git': 2.0.0 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.7 + resolve-from: 5.0.0 + semver: 5.7.1 + dev: true + + /@changesets/assemble-release-plan@5.2.3: + resolution: {integrity: sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.5 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + semver: 5.7.1 + dev: true + + /@changesets/changelog-git@0.1.14: + resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} + dependencies: + '@changesets/types': 5.2.1 + dev: true + + /@changesets/cli@2.26.1: + resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} + hasBin: true + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/apply-release-plan': 6.1.3 + '@changesets/assemble-release-plan': 5.2.3 + '@changesets/changelog-git': 0.1.14 + '@changesets/config': 2.3.0 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.5 + '@changesets/get-release-plan': 3.0.16 + '@changesets/git': 2.0.0 + '@changesets/logger': 0.0.5 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 + '@changesets/write': 0.2.3 + '@manypkg/get-packages': 1.1.3 + '@types/is-ci': 3.0.0 + '@types/semver': 6.2.3 + ansi-colors: 4.1.3 + chalk: 2.4.2 + enquirer: 2.3.6 + external-editor: 3.1.0 + fs-extra: 7.0.1 + human-id: 1.0.2 + is-ci: 3.0.1 + meow: 6.1.1 + outdent: 0.5.0 + p-limit: 2.3.0 + preferred-pm: 3.0.3 + resolve-from: 5.0.0 + semver: 5.7.1 + spawndamnit: 2.0.0 + term-size: 2.2.1 + tty-table: 4.2.1 + dev: true + + /@changesets/config@2.3.0: + resolution: {integrity: sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==} + dependencies: + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.5 + '@changesets/logger': 0.0.5 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.5 + dev: true + + /@changesets/errors@0.1.4: + resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} + dependencies: + extendable-error: 0.1.7 + dev: true + + /@changesets/get-dependents-graph@1.3.5: + resolution: {integrity: sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==} + dependencies: + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + chalk: 2.4.2 + fs-extra: 7.0.1 + semver: 5.7.1 + dev: true + + /@changesets/get-release-plan@3.0.16: + resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/assemble-release-plan': 5.2.3 + '@changesets/config': 2.3.0 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + dev: true + + /@changesets/get-version-range-type@0.3.2: + resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} + dev: true + + /@changesets/git@2.0.0: + resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + micromatch: 4.0.5 + spawndamnit: 2.0.0 + dev: true + + /@changesets/logger@0.0.5: + resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} + dependencies: + chalk: 2.4.2 + dev: true + + /@changesets/parse@0.3.16: + resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} + dependencies: + '@changesets/types': 5.2.1 + js-yaml: 3.14.1 + dev: true + + /@changesets/pre@1.0.14: + resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + dev: true + + /@changesets/read@0.5.9: + resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/git': 2.0.0 + '@changesets/logger': 0.0.5 + '@changesets/parse': 0.3.16 + '@changesets/types': 5.2.1 + chalk: 2.4.2 + fs-extra: 7.0.1 + p-filter: 2.1.0 + dev: true + + /@changesets/types@4.1.0: + resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} + dev: true + + /@changesets/types@5.2.1: + resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} + dev: true + + /@changesets/write@0.2.3: + resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/types': 5.2.1 + fs-extra: 7.0.1 + human-id: 1.0.2 + prettier: 2.8.7 + dev: true + + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@esbuild/android-arm64@0.17.14: + resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.17.14: + resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.17.14: + resolution: {integrity: sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.17.14: + resolution: {integrity: sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.17.14: + resolution: {integrity: sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.17.14: + resolution: {integrity: sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.17.14: + resolution: {integrity: sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.17.14: + resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.17.14: + resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.17.14: + resolution: {integrity: sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.17.14: + resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.17.14: + resolution: {integrity: sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.17.14: + resolution: {integrity: sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.17.14: + resolution: {integrity: sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.17.14: + resolution: {integrity: sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.17.14: + resolution: {integrity: sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.17.14: + resolution: {integrity: sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.17.14: + resolution: {integrity: sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.17.14: + resolution: {integrity: sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.17.14: + resolution: {integrity: sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.17.14: + resolution: {integrity: sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.17.14: + resolution: {integrity: sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@istanbuljs/load-nyc-config@1.1.0: + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.1 + resolve-from: 5.0.0 + dev: true + + /@istanbuljs/schema@0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jest/console@29.5.0: + resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + chalk: 4.1.2 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + slash: 3.0.0 + dev: true + + /@jest/core@29.5.0(ts-node@10.9.1): + resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 29.5.0 + '@jest/reporters': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.8.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.5.0 + jest-config: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-resolve-dependencies: 29.5.0 + jest-runner: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + jest-watcher: 29.5.0 + micromatch: 4.0.5 + pretty-format: 29.5.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + + /@jest/environment@29.5.0: + resolution: {integrity: sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + jest-mock: 29.5.0 + dev: true + + /@jest/expect-utils@29.5.0: + resolution: {integrity: sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.4.3 + dev: true + + /@jest/expect@29.5.0: + resolution: {integrity: sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.5.0 + jest-snapshot: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/fake-timers@29.5.0: + resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@sinonjs/fake-timers': 10.0.2 + '@types/node': 18.15.11 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-util: 29.5.0 + dev: true + + /@jest/globals@29.5.0: + resolution: {integrity: sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/types': 29.5.0 + jest-mock: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/reporters@29.5.0: + resolution: {integrity: sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@jridgewell/trace-mapping': 0.3.18 + '@types/node': 18.15.11 + chalk: 4.1.2 + collect-v8-coverage: 1.0.1 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-instrument: 5.2.1 + istanbul-lib-report: 3.0.0 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.5 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + jest-worker: 29.5.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/schemas@29.4.3: + resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.25.24 + dev: true + + /@jest/source-map@29.4.3: + resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + callsites: 3.1.0 + graceful-fs: 4.2.11 + dev: true + + /@jest/test-result@29.5.0: + resolution: {integrity: sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.5.0 + '@jest/types': 29.5.0 + '@types/istanbul-lib-coverage': 2.0.4 + collect-v8-coverage: 1.0.1 + dev: true + + /@jest/test-sequencer@29.5.0: + resolution: {integrity: sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.5.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + slash: 3.0.0 + dev: true + + /@jest/transform@29.5.0: + resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.21.4 + '@jest/types': 29.5.0 + '@jridgewell/trace-mapping': 0.3.18 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 + micromatch: 4.0.5 + pirates: 4.0.5 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/types@29.5.0: + resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.3 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 18.15.11 + '@types/yargs': 17.0.24 + chalk: 4.1.2 + dev: true + + /@jridgewell/gen-mapping@0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + + /@jridgewell/resolve-uri@3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/set-array@1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.18: + resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /@manypkg/find-root@1.1.0: + resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} + dependencies: + '@babel/runtime': 7.21.0 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 + dev: true + + /@manypkg/get-packages@1.1.3: + resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + dependencies: + '@babel/runtime': 7.21.0 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 + dev: true + + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.15.0 + dev: true + + /@sinclair/typebox@0.25.24: + resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} + dev: true + + /@sinonjs/commons@2.0.0: + resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers@10.0.2: + resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} + dependencies: + '@sinonjs/commons': 2.0.0 + dev: true + + /@tanstack/query-core@4.27.0: + resolution: {integrity: sha512-sm+QncWaPmM73IPwFlmWSKPqjdTXZeFf/7aEmWh00z7yl2FjqophPt0dE1EHW9P1giMC5rMviv7OUbSDmWzXXA==} + dev: true + + /@tanstack/react-query@4.28.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-8cGBV5300RHlvYdS4ea+G1JcZIt5CIuprXYFnsWggkmGoC0b5JaqG0fIX3qwDL9PTNkKvG76NGThIWbpXivMrQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.27.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + use-sync-external-store: 1.2.0(react@18.2.0) + dev: true + + /@testing-library/dom@9.2.0: + resolution: {integrity: sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==} + engines: {node: '>=14'} + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/runtime': 7.21.0 + '@types/aria-query': 5.0.1 + aria-query: 5.1.3 + chalk: 4.1.2 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 + pretty-format: 27.5.1 + dev: true + + /@testing-library/jest-dom@5.16.5: + resolution: {integrity: sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA==} + engines: {node: '>=8', npm: '>=6', yarn: '>=1'} + dependencies: + '@adobe/css-tools': 4.2.0 + '@babel/runtime': 7.21.0 + '@types/testing-library__jest-dom': 5.14.5 + aria-query: 5.1.3 + chalk: 3.0.0 + css.escape: 1.5.1 + dom-accessibility-api: 0.5.16 + lodash: 4.17.21 + redent: 3.0.0 + dev: true + + /@testing-library/react-hooks@8.0.1(@types/react@18.0.33)(react-dom@18.2.0)(react-test-renderer@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} + engines: {node: '>=12'} + peerDependencies: + '@types/react': ^16.9.0 || ^17.0.0 + react: ^16.9.0 || ^17.0.0 + react-dom: ^16.9.0 || ^17.0.0 + react-test-renderer: ^16.9.0 || ^17.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + react-dom: + optional: true + react-test-renderer: + optional: true + dependencies: + '@babel/runtime': 7.21.0 + '@types/react': 18.0.33 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-error-boundary: 3.1.4(react@18.2.0) + react-test-renderer: 18.2.0(react@18.2.0) + dev: true + + /@testing-library/react@14.0.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg==} + engines: {node: '>=14'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@babel/runtime': 7.21.0 + '@testing-library/dom': 9.2.0 + '@types/react-dom': 18.0.11 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: true + + /@testing-library/user-event@14.4.3(@testing-library/dom@9.2.0): + resolution: {integrity: sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q==} + engines: {node: '>=12', npm: '>=6'} + peerDependencies: + '@testing-library/dom': '>=7.21.4' + dependencies: + '@testing-library/dom': 9.2.0 + dev: true + + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: true + + /@tsconfig/node10@1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16@1.0.3: + resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} + dev: true + + /@types/aria-query@5.0.1: + resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} + dev: true + + /@types/babel__core@7.20.0: + resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} + dependencies: + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + '@types/babel__generator': 7.6.4 + '@types/babel__template': 7.4.1 + '@types/babel__traverse': 7.18.3 + dev: true + + /@types/babel__generator@7.6.4: + resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@types/babel__template@7.4.1: + resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} + dependencies: + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + dev: true + + /@types/babel__traverse@7.18.3: + resolution: {integrity: sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@types/body-parser@1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 18.15.11 + dev: true + + /@types/connect@3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 18.15.11 + dev: true + + /@types/cookiejar@2.1.2: + resolution: {integrity: sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==} + dev: true + + /@types/cors@2.8.13: + resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} + dependencies: + '@types/node': 18.15.11 + dev: true + + /@types/express-serve-static-core@4.17.33: + resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} + dependencies: + '@types/node': 18.15.11 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: true + + /@types/express@4.17.17: + resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.33 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.1 + dev: true + + /@types/graceful-fs@4.1.6: + resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} + dependencies: + '@types/node': 18.15.11 + dev: true + + /@types/is-ci@3.0.0: + resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} + dependencies: + ci-info: 3.8.0 + dev: true + + /@types/istanbul-lib-coverage@2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + + /@types/istanbul-lib-report@3.0.0: + resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.4 + dev: true + + /@types/istanbul-reports@3.0.1: + resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} + dependencies: + '@types/istanbul-lib-report': 3.0.0 + dev: true + + /@types/jest@29.5.0: + resolution: {integrity: sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==} + dependencies: + expect: 29.5.0 + pretty-format: 29.5.0 + dev: true + + /@types/jsdom@20.0.1: + resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} + dependencies: + '@types/node': 18.15.11 + '@types/tough-cookie': 4.0.2 + parse5: 7.1.2 + dev: true + + /@types/mime@3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: true + + /@types/minimist@1.2.2: + resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + dev: true + + /@types/multer@1.4.7: + resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} + dependencies: + '@types/express': 4.17.17 + dev: true + + /@types/node@12.20.55: + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + dev: true + + /@types/node@18.15.11: + resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} + dev: true + + /@types/normalize-package-data@2.4.1: + resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + dev: true + + /@types/prettier@2.7.2: + resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==} + dev: true + + /@types/prop-types@15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true + + /@types/qs@6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: true + + /@types/range-parser@1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: true + + /@types/react-dom@18.0.11: + resolution: {integrity: sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==} + dependencies: + '@types/react': 18.0.33 + dev: true + + /@types/react@18.0.33: + resolution: {integrity: sha512-sHxzVxeanvQyQ1lr8NSHaj0kDzcNiGpILEVt69g9S31/7PfMvNCKLKcsHw4lYKjs3cGNJjXSP4mYzX43QlnjNA==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.3 + csstype: 3.1.2 + dev: true + + /@types/scheduler@0.16.3: + resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} + dev: true + + /@types/semver@6.2.3: + resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} + dev: true + + /@types/serve-static@1.15.1: + resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 18.15.11 + dev: true + + /@types/stack-utils@2.0.1: + resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} + dev: true + + /@types/superagent@4.1.16: + resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} + dependencies: + '@types/cookiejar': 2.1.2 + '@types/node': 18.15.11 + dev: true + + /@types/supertest@2.0.12: + resolution: {integrity: sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==} + dependencies: + '@types/superagent': 4.1.16 + dev: true + + /@types/swagger-ui-express@4.1.3: + resolution: {integrity: sha512-jqCjGU/tGEaqIplPy3WyQg+Nrp6y80DCFnDEAvVKWkJyv0VivSSDCChkppHRHAablvInZe6pijDFMnavtN0vqA==} + dependencies: + '@types/express': 4.17.17 + '@types/serve-static': 1.15.1 + dev: true + + /@types/testing-library__jest-dom@5.14.5: + resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} + dependencies: + '@types/jest': 29.5.0 + dev: true + + /@types/tough-cookie@4.0.2: + resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} + dev: true + + /@types/yargs-parser@21.0.0: + resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} + dev: true + + /@types/yargs@17.0.24: + resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} + dependencies: + '@types/yargs-parser': 21.0.0 + dev: true + + /abab@2.0.6: + resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} + dev: true + + /accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-globals@7.0.1: + resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} + dependencies: + acorn: 8.8.2 + acorn-walk: 8.2.0 + dev: true + + /acorn-walk@8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn@8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + dev: true + + /ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + + /any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + dev: true + + /anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /append-field@1.0.0: + resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} + dev: true + + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + dev: true + + /aria-query@5.1.3: + resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} + dependencies: + deep-equal: 2.2.0 + dev: true + + /array-buffer-byte-length@1.0.0: + resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} + dependencies: + call-bind: 1.0.2 + is-array-buffer: 3.0.2 + dev: true + + /array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: true + + /array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + + /array.prototype.flat@1.3.1: + resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + es-shim-unscopables: 1.0.0 + dev: true + + /arrify@1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + dev: true + + /asap@2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + dev: true + + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true + + /available-typed-arrays@1.0.5: + resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + engines: {node: '>= 0.4'} + dev: true + + /axios@1.3.5: + resolution: {integrity: sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + + /babel-jest@29.5.0(@babel/core@7.21.4): + resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.21.4 + '@jest/transform': 29.5.0 + '@types/babel__core': 7.20.0 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.5.0(@babel/core@7.21.4) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + dependencies: + '@babel/helper-plugin-utils': 7.20.2 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-jest-hoist@29.5.0: + resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.21.4 + '@types/babel__core': 7.20.0 + '@types/babel__traverse': 7.18.3 + dev: true + + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.21.4): + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.4 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.21.4) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.21.4) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.21.4) + dev: true + + /babel-preset-jest@29.5.0(@babel/core@7.21.4): + resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.4 + babel-plugin-jest-hoist: 29.5.0 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /better-path-resolve@1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} + engines: {node: '>=4'} + dependencies: + is-windows: 1.0.2 + dev: true + + /binary-extensions@2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /body-parser@1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /breakword@1.0.5: + resolution: {integrity: sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg==} + dependencies: + wcwidth: 1.0.1 + dev: true + + /browserslist@4.21.5: + resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001476 + electron-to-chromium: 1.4.356 + node-releases: 2.0.10 + update-browserslist-db: 1.0.10(browserslist@4.21.5) + dev: true + + /bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + dependencies: + fast-json-stable-stringify: 2.1.0 + dev: true + + /bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + dependencies: + node-int64: 0.4.0 + dev: true + + /buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /bundle-require@4.0.1(esbuild@0.17.14): + resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + dependencies: + esbuild: 0.17.14 + load-tsconfig: 0.2.5 + dev: true + + /busboy@1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + dependencies: + streamsearch: 1.1.0 + dev: true + + /bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + + /call-bind@1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.2.0 + dev: true + + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camelcase-keys@6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + dev: true + + /camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + dev: true + + /caniuse-lite@1.0.30001476: + resolution: {integrity: sha512-JmpktFppVSvyUN4gsLS0bShY2L9ZUslHLE72vgemBkS43JD2fOvKTKs+GtRwuxrtRGnwJFW0ye7kWRRlLJS9vQ==} + dev: true + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk@3.0.0: + resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + dev: true + + /chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: true + + /chokidar@3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /ci-info@3.8.0: + resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} + engines: {node: '>=8'} + dev: true + + /cjs-module-lexer@1.2.2: + resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} + dev: true + + /cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + dev: true + + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + dev: true + + /co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + dev: true + + /collect-v8-coverage@1.0.1: + resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} + dev: true + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: true + + /commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + dev: true + + /component-emitter@1.3.0: + resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /concat-stream@1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.8 + typedarray: 0.0.6 + dev: true + + /content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: true + + /convert-source-map@1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + dev: true + + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + + /cookie-signature@1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: true + + /cookie@0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + + /cookiejar@2.1.4: + resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} + dev: true + + /core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /cross-fetch@3.1.5: + resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + + /cross-spawn@5.1.0: + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} + dependencies: + lru-cache: 4.1.5 + shebang-command: 1.2.0 + which: 1.3.1 + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /css.escape@1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + dev: true + + /cssom@0.3.8: + resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} + dev: true + + /cssom@0.5.0: + resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==} + dev: true + + /cssstyle@2.3.0: + resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==} + engines: {node: '>=8'} + dependencies: + cssom: 0.3.8 + dev: true + + /csstype@3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + dev: true + + /csv-generate@3.4.3: + resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + dev: true + + /csv-parse@4.16.3: + resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + dev: true + + /csv-stringify@5.6.5: + resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + dev: true + + /csv@5.5.3: + resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} + engines: {node: '>= 0.1.90'} + dependencies: + csv-generate: 3.4.3 + csv-parse: 4.16.3 + csv-stringify: 5.6.5 + stream-transform: 2.1.3 + dev: true + + /data-urls@3.0.2: + resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} + engines: {node: '>=12'} + dependencies: + abab: 2.0.6 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + dev: true + + /debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + dev: true + + /decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: true + + /decimal.js@10.4.3: + resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + dev: true + + /dedent@0.7.0: + resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + dev: true + + /deep-equal@2.2.0: + resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} + dependencies: + call-bind: 1.0.2 + es-get-iterator: 1.1.3 + get-intrinsic: 1.2.0 + is-arguments: 1.1.1 + is-array-buffer: 3.0.2 + is-date-object: 1.0.5 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + isarray: 2.0.5 + object-is: 1.1.5 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + side-channel: 1.0.4 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.1 + which-typed-array: 1.1.9 + dev: true + + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + + /deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + dev: true + + /defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + dependencies: + clone: 1.0.4 + dev: true + + /define-properties@1.2.0: + resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: true + + /depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} + dev: true + + /detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + dev: true + + /dezalgo@1.0.4: + resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} + dependencies: + asap: 2.0.6 + wrappy: 1.0.2 + dev: true + + /diff-sequences@29.4.3: + resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /dom-accessibility-api@0.5.16: + resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + dev: true + + /domexception@4.0.0: + resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} + engines: {node: '>=12'} + dependencies: + webidl-conversions: 7.0.0 + dev: true + + /ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /electron-to-chromium@1.4.356: + resolution: {integrity: sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==} + dev: true + + /emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + dev: true + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /enquirer@2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + dev: true + + /entities@4.4.0: + resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} + engines: {node: '>=0.12'} + dev: true + + /error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /es-abstract@1.21.2: + resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + es-set-tostringtag: 2.0.1 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.2.0 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-proto: 1.0.1 + has-symbols: 1.0.3 + internal-slot: 1.0.5 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.10 + is-weakref: 1.0.2 + object-inspect: 1.12.3 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.7 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.9 + dev: true + + /es-get-iterator@1.1.3: + resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + has-symbols: 1.0.3 + is-arguments: 1.1.1 + is-map: 2.0.2 + is-set: 2.0.2 + is-string: 1.0.7 + isarray: 2.0.5 + stop-iteration-iterator: 1.0.0 + dev: true + + /es-set-tostringtag@2.0.1: + resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.0 + has: 1.0.3 + has-tostringtag: 1.0.0 + dev: true + + /es-shim-unscopables@1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: true + + /es-to-primitive@1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /esbuild@0.17.14: + resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.17.14 + '@esbuild/android-arm64': 0.17.14 + '@esbuild/android-x64': 0.17.14 + '@esbuild/darwin-arm64': 0.17.14 + '@esbuild/darwin-x64': 0.17.14 + '@esbuild/freebsd-arm64': 0.17.14 + '@esbuild/freebsd-x64': 0.17.14 + '@esbuild/linux-arm': 0.17.14 + '@esbuild/linux-arm64': 0.17.14 + '@esbuild/linux-ia32': 0.17.14 + '@esbuild/linux-loong64': 0.17.14 + '@esbuild/linux-mips64el': 0.17.14 + '@esbuild/linux-ppc64': 0.17.14 + '@esbuild/linux-riscv64': 0.17.14 + '@esbuild/linux-s390x': 0.17.14 + '@esbuild/linux-x64': 0.17.14 + '@esbuild/netbsd-x64': 0.17.14 + '@esbuild/openbsd-x64': 0.17.14 + '@esbuild/sunos-x64': 0.17.14 + '@esbuild/win32-arm64': 0.17.14 + '@esbuild/win32-ia32': 0.17.14 + '@esbuild/win32-x64': 0.17.14 + dev: true + + /escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: true + + /escodegen@2.0.0: + resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionator: 0.8.3 + optionalDependencies: + source-map: 0.6.1 + dev: true + + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + + /etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + + /execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + + /exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + dev: true + + /expect@29.5.0: + resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + dev: true + + /express@4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /extendable-error@0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + dev: true + + /external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: true + + /fast-glob@3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + + /fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: true + + /fastq@1.15.0: + resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + dependencies: + reusify: 1.0.4 + dev: true + + /fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + dependencies: + bser: 2.1.1 + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler@1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /find-yarn-workspace-root2@1.2.16: + resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} + dependencies: + micromatch: 4.0.5 + pkg-dir: 4.2.0 + dev: true + + /follow-redirects@1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /formidable@2.1.2: + resolution: {integrity: sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==} + dependencies: + dezalgo: 1.0.4 + hexoid: 1.0.0 + once: 1.4.0 + qs: 6.11.1 + dev: true + + /forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + + /fp-ts@2.13.1: + resolution: {integrity: sha512-0eu5ULPS2c/jsa1lGFneEFFEdTbembJv8e4QKXeVJ3lm/5hyve06dlKZrpxmMwJt6rYen7sxmHHK2CLaXvWuWQ==} + dev: true + + /fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + + /fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /function.prototype.name@1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + functions-have-names: 1.2.3 + dev: true + + /functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + + /gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-intrinsic@1.2.0: + resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + + /get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + dev: true + + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /get-symbol-description@1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + dev: true + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob@7.1.6: + resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob@9.3.4: + resolution: {integrity: sha512-qaSc49hojMOv1EPM4EuyITjDSgSKI0rthoHnvE81tcOi1SCVndHko7auqxdQ14eiQG2NDBJBE86+2xIrbIvrbA==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + fs.realpath: 1.0.0 + minimatch: 8.0.3 + minipass: 4.2.5 + path-scurry: 1.6.3 + dev: true + + /globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + dev: true + + /globalthis@1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.0 + dev: true + + /globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true + + /grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + + /hard-rejection@2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + dev: true + + /has-bigints@1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + + /has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors@1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /has-proto@1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag@1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /hexoid@1.0.0: + resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==} + engines: {node: '>=8'} + dev: true + + /hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + + /html-encoding-sniffer@3.0.0: + resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} + engines: {node: '>=12'} + dependencies: + whatwg-encoding: 2.0.0 + dev: true + + /html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /human-id@1.0.2: + resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} + dev: true + + /human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /ignore@5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + engines: {node: '>= 4'} + dev: true + + /import-local@3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /internal-slot@1.0.5: + resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.0 + has: 1.0.3 + side-channel: 1.0.4 + dev: true + + /io-ts@2.2.20(fp-ts@2.13.1): + resolution: {integrity: sha512-Rq2BsYmtwS5vVttie4rqrOCIfHCS9TgpRLFpKQCM1wZBBRY9nWVGmEvm2FnDbSE2un1UE39DvFpTR5UL47YDcA==} + peerDependencies: + fp-ts: ^2.5.0 + dependencies: + fp-ts: 2.13.1 + dev: true + + /ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + + /is-arguments@1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-array-buffer@3.0.2: + resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + is-typed-array: 1.1.10 + dev: true + + /is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-bigint@1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-boolean-object@1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-ci@3.0.1: + resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} + hasBin: true + dependencies: + ci-info: 3.8.0 + dev: true + + /is-core-module@2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: true + + /is-date-object@1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + dev: true + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-map@2.0.2: + resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} + dev: true + + /is-negative-zero@2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object@1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + dev: true + + /is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + dev: true + + /is-regex@1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-set@2.0.2: + resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} + dev: true + + /is-shared-array-buffer@1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 + dev: true + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /is-string@1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-subdir@1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} + dependencies: + better-path-resolve: 1.0.0 + dev: true + + /is-symbol@1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array@1.1.10: + resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /is-weakmap@2.0.1: + resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} + dev: true + + /is-weakref@1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: true + + /is-weakset@2.0.2: + resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + dev: true + + /is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: true + + /isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /istanbul-lib-coverage@3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + dependencies: + '@babel/core': 7.21.4 + '@babel/parser': 7.21.4 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-lib-report@3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-reports@3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + + /jest-changed-files@29.5.0: + resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + execa: 5.1.1 + p-limit: 3.1.0 + dev: true + + /jest-circus@29.5.0: + resolution: {integrity: sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + chalk: 4.1.2 + co: 4.6.0 + dedent: 0.7.0 + is-generator-fn: 2.1.0 + jest-each: 29.5.0 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + p-limit: 3.1.0 + pretty-format: 29.5.0 + pure-rand: 6.0.1 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-cli@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): + resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.5.0(ts-node@10.9.1) + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + import-local: 3.1.0 + jest-config: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + jest-util: 29.5.0 + jest-validate: 29.5.0 + prompts: 2.4.2 + yargs: 17.7.1 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /jest-config@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): + resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.21.4 + '@jest/test-sequencer': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + babel-jest: 29.5.0(@babel/core@7.21.4) + chalk: 4.1.2 + ci-info: 3.8.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.5.0 + jest-environment-node: 29.5.0 + jest-get-type: 29.4.3 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-runner: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.5.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + transitivePeerDependencies: + - supports-color + dev: true + + /jest-diff@29.5.0: + resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.4.3 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-docblock@29.4.3: + resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + detect-newline: 3.1.0 + dev: true + + /jest-each@29.5.0: + resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + chalk: 4.1.2 + jest-get-type: 29.4.3 + jest-util: 29.5.0 + pretty-format: 29.5.0 + dev: true + + /jest-environment-jsdom@29.5.0: + resolution: {integrity: sha512-/KG8yEK4aN8ak56yFVdqFDzKNHgF4BAymCx2LbPNPsUshUlfAl0eX402Xm1pt+eoG9SLZEUVifqXtX8SK74KCw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/jsdom': 20.0.1 + '@types/node': 18.15.11 + jest-mock: 29.5.0 + jest-util: 29.5.0 + jsdom: 20.0.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /jest-environment-node@29.5.0: + resolution: {integrity: sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + jest-mock: 29.5.0 + jest-util: 29.5.0 + dev: true + + /jest-get-type@29.4.3: + resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-haste-map@29.5.0: + resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/graceful-fs': 4.1.6 + '@types/node': 18.15.11 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 + jest-worker: 29.5.0 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /jest-leak-detector@29.5.0: + resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-matcher-utils@29.5.0: + resolution: {integrity: sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-message-util@29.5.0: + resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.21.4 + '@jest/types': 29.5.0 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.5.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + + /jest-mock@29.5.0: + resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + jest-util: 29.5.0 + dev: true + + /jest-pnp-resolver@1.2.3(jest-resolve@29.5.0): + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + dependencies: + jest-resolve: 29.5.0 + dev: true + + /jest-regex-util@29.4.3: + resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-resolve-dependencies@29.5.0: + resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-regex-util: 29.4.3 + jest-snapshot: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-resolve@29.5.0: + resolution: {integrity: sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.5.0) + jest-util: 29.5.0 + jest-validate: 29.5.0 + resolve: 1.22.2 + resolve.exports: 2.0.2 + slash: 3.0.0 + dev: true + + /jest-runner@29.5.0: + resolution: {integrity: sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.5.0 + '@jest/environment': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.4.3 + jest-environment-node: 29.5.0 + jest-haste-map: 29.5.0 + jest-leak-detector: 29.5.0 + jest-message-util: 29.5.0 + jest-resolve: 29.5.0 + jest-runtime: 29.5.0 + jest-util: 29.5.0 + jest-watcher: 29.5.0 + jest-worker: 29.5.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-runtime@29.5.0: + resolution: {integrity: sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/globals': 29.5.0 + '@jest/source-map': 29.4.3 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + chalk: 4.1.2 + cjs-module-lexer: 1.2.2 + collect-v8-coverage: 1.0.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-snapshot@29.5.0: + resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.4) + '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.21.4) + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + '@jest/expect-utils': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/babel__traverse': 7.18.3 + '@types/prettier': 2.7.2 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) + chalk: 4.1.2 + expect: 29.5.0 + graceful-fs: 4.2.11 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + natural-compare: 1.4.0 + pretty-format: 29.5.0 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-util@29.5.0: + resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + chalk: 4.1.2 + ci-info: 3.8.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: true + + /jest-validate@29.5.0: + resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.4.3 + leven: 3.1.0 + pretty-format: 29.5.0 + dev: true + + /jest-watcher@29.5.0: + resolution: {integrity: sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.11 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.5.0 + string-length: 4.0.2 + dev: true + + /jest-worker@29.5.0: + resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 18.15.11 + jest-util: 29.5.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + + /jest@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): + resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.5.0(ts-node@10.9.1) + '@jest/types': 29.5.0 + import-local: 3.1.0 + jest-cli: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /jsdom@20.0.3: + resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.8.2 + acorn-globals: 7.0.1 + cssom: 0.5.0 + cssstyle: 2.3.0 + data-urls: 3.0.2 + decimal.js: 10.4.3 + domexception: 4.0.0 + escodegen: 2.0.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.3 + parse5: 7.1.2 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.2 + w3c-xmlserializer: 4.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + ws: 8.13.0 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /jsesc@2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + dev: true + + /jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + + /kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + dev: true + + /kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + dev: true + + /leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + dev: true + + /levn@0.3.0: + resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + dev: true + + /lilconfig@2.1.0: + resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} + engines: {node: '>=10'} + dev: true + + /lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true + + /load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /load-yaml-file@0.2.0: + resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.11 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 + dev: true + + /locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + dev: true + + /lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + dev: true + + /lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: true + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /loose-envify@1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + dev: true + + /lru-cache@4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + dev: true + + /lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /lru-cache@7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} + engines: {node: '>=12'} + dev: true + + /lz-string@1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + dev: true + + /make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + dependencies: + tmpl: 1.0.5 + dev: true + + /map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + dev: true + + /map-obj@4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + dev: true + + /media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: true + + /meow@6.1.1: + resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} + engines: {node: '>=8'} + dependencies: + '@types/minimist': 1.2.2 + camelcase-keys: 6.2.2 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 2.5.0 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.13.1 + yargs-parser: 18.1.3 + dev: true + + /merge-descriptors@1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: true + + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /mime@2.6.0: + resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} + engines: {node: '>=4.0.0'} + hasBin: true + dev: true + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + dev: true + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch@8.0.3: + resolution: {integrity: sha512-tEEvU9TkZgnFDCtpnrEYnPsjT7iUx42aXfs4bzmQ5sMA09/6hZY0jeZcGkXyDagiBOvkUjNo8Viom+Me6+2x7g==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimist-options@4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 + dev: true + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /minipass@4.2.5: + resolution: {integrity: sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==} + engines: {node: '>=8'} + dev: true + + /mixme@0.5.9: + resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} + engines: {node: '>= 8.0.0'} + dev: true + + /mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /multer@1.4.5-lts.1: + resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} + engines: {node: '>= 6.0.0'} + dependencies: + append-field: 1.0.0 + busboy: 1.6.0 + concat-stream: 1.6.2 + mkdirp: 0.5.6 + object-assign: 4.1.1 + type-is: 1.6.18 + xtend: 4.0.2 + dev: true + + /mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + dev: true + + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /node-fetch@2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + + /node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + dev: true + + /node-releases@2.0.10: + resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + dev: true + + /normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.2 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: true + + /normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + + /nwsapi@2.2.3: + resolution: {integrity: sha512-jscxIO4/VKScHlbmFBdV1Z6LXnLO+ZR4VMtypudUdfwtKxUN3TQcNFIHLwKtrUbDyHN4/GycY9+oRGZ2XMXYPw==} + dev: true + + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-inspect@1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + dev: true + + /object-is@1.1.5: + resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + dev: true + + /object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign@4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /openapi-types@12.1.0: + resolution: {integrity: sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==} + dev: false + + /optionator@0.8.3: + resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.3 + dev: true + + /os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: true + + /outdent@0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + dev: true + + /p-filter@2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} + dependencies: + p-map: 2.1.0 + dev: true + + /p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /p-map@2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} + dev: true + + /p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.21.4 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: true + + /parse5@7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.4.0 + dev: true + + /parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-scurry@1.6.3: + resolution: {integrity: sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + lru-cache: 7.18.3 + minipass: 4.2.5 + dev: true + + /path-to-regexp@0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: true + + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + dev: true + + /pirates@4.0.5: + resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} + engines: {node: '>= 6'} + dev: true + + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + + /postcss-load-config@3.1.4(ts-node@10.9.1): + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.1.0 + ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + yaml: 1.10.2 + dev: true + + /preferred-pm@3.0.3: + resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} + engines: {node: '>=10'} + dependencies: + find-up: 5.0.0 + find-yarn-workspace-root2: 1.2.16 + path-exists: 4.0.0 + which-pm: 2.0.0 + dev: true + + /prelude-ls@1.1.2: + resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} + engines: {node: '>= 0.8.0'} + dev: true + + /prettier@2.8.7: + resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /pretty-format@27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + dev: true + + /pretty-format@29.5.0: + resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + + /process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + dev: true + + /proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: true + + /pseudomap@1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: true + + /psl@1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: true + + /punycode@2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + engines: {node: '>=6'} + dev: true + + /pure-rand@6.0.1: + resolution: {integrity: sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==} + dev: true + + /qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /qs@6.11.1: + resolution: {integrity: sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: true + + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /quick-lru@4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + dev: true + + /range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body@2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /react-dom@18.2.0(react@18.2.0): + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: true + + /react-error-boundary@3.1.4(react@18.2.0): + resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==} + engines: {node: '>=10', npm: '>=6'} + peerDependencies: + react: '>=16.13.1' + dependencies: + '@babel/runtime': 7.21.0 + react: 18.2.0 + dev: true + + /react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: true + + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + + /react-shallow-renderer@16.15.0(react@18.2.0): + resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + dependencies: + object-assign: 4.1.1 + react: 18.2.0 + react-is: 18.2.0 + dev: true + + /react-test-renderer@18.2.0(react@18.2.0): + resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} + peerDependencies: + react: ^18.2.0 + dependencies: + react: 18.2.0 + react-is: 18.2.0 + react-shallow-renderer: 16.15.0(react@18.2.0) + scheduler: 0.23.0 + dev: true + + /react@18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: true + + /read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + dev: true + + /read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + dependencies: + '@types/normalize-package-data': 2.4.1 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + dev: true + + /read-yaml-file@1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.11 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 + dev: true + + /readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + dev: true + + /regenerator-runtime@0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + dev: true + + /regexp.prototype.flags@1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + functions-have-names: 1.2.3 + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true + + /requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + + /resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + + /resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + + /resolve.exports@2.0.2: + resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} + engines: {node: '>=10'} + dev: true + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /rimraf@4.4.1: + resolution: {integrity: sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==} + engines: {node: '>=14'} + hasBin: true + dependencies: + glob: 9.3.4 + dev: true + + /rollup@3.20.2: + resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safe-regex-test@1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + is-regex: 1.1.4 + dev: true + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + dependencies: + xmlchars: 2.2.0 + dev: true + + /scheduler@0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: true + + /semver@5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + hasBin: true + dev: true + + /semver@6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + + /semver@7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /send@0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-static@1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + + /set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true + + /setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /shebang-command@1.2.0: + resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} + engines: {node: '>=0.10.0'} + dependencies: + shebang-regex: 1.0.0 + dev: true + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@1.0.0: + resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} + engines: {node: '>=0.10.0'} + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /side-channel@1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + object-inspect: 1.12.3 + dev: true + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + dev: true + + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /smartwrap@2.0.2: + resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} + engines: {node: '>=6'} + hasBin: true + dependencies: + array.prototype.flat: 1.3.1 + breakword: 1.0.5 + grapheme-splitter: 1.0.4 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 15.4.1 + dev: true + + /source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + dependencies: + whatwg-url: 7.1.0 + dev: true + + /spawndamnit@2.0.0: + resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} + dependencies: + cross-spawn: 5.1.0 + signal-exit: 3.0.7 + dev: true + + /spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.13 + dev: true + + /spdx-exceptions@2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true + + /spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.13 + dev: true + + /spdx-license-ids@3.0.13: + resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} + dev: true + + /sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true + + /stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: true + + /statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /stop-iteration-iterator@1.0.0: + resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + engines: {node: '>= 0.4'} + dependencies: + internal-slot: 1.0.5 + dev: true + + /stream-transform@2.1.3: + resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} + dependencies: + mixme: 0.5.9 + dev: true + + /streamsearch@1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + dev: true + + /string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + dev: true + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string.prototype.trim@1.2.7: + resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + dev: true + + /string.prototype.trimend@1.0.6: + resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + dev: true + + /string.prototype.trimstart@1.0.6: + resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + dev: true + + /string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: true + + /strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + dev: true + + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + + /strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + dependencies: + min-indent: 1.0.1 + dev: true + + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /sucrase@3.32.0: + resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} + engines: {node: '>=8'} + hasBin: true + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + commander: 4.1.1 + glob: 7.1.6 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.5 + ts-interface-checker: 0.1.13 + dev: true + + /superagent@8.0.9: + resolution: {integrity: sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA==} + engines: {node: '>=6.4.0 <13 || >=14'} + dependencies: + component-emitter: 1.3.0 + cookiejar: 2.1.4 + debug: 4.3.4 + fast-safe-stringify: 2.1.1 + form-data: 4.0.0 + formidable: 2.1.2 + methods: 1.1.2 + mime: 2.6.0 + qs: 6.11.1 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + dev: true + + /supertest@6.3.3: + resolution: {integrity: sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA==} + engines: {node: '>=6.4.0'} + dependencies: + methods: 1.1.2 + superagent: 8.0.9 + transitivePeerDependencies: + - supports-color + dev: true + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /swagger-ui-dist@4.18.2: + resolution: {integrity: sha512-oVBoBl9Dg+VJw8uRWDxlyUyHoNEDC0c1ysT6+Boy6CTgr2rUcLcfPon4RvxgS2/taNW6O0+US+Z/dlAsWFjOAQ==} + dev: true + + /swagger-ui-express@4.6.2(express@4.18.2): + resolution: {integrity: sha512-MHIOaq9JrTTB3ygUJD+08PbjM5Tt/q7x80yz9VTFIatw8j5uIWKcr90S0h5NLMzFEDC6+eVprtoeA5MDZXCUKQ==} + engines: {node: '>= v0.10.32'} + peerDependencies: + express: '>=4.0.0' + dependencies: + express: 4.18.2 + swagger-ui-dist: 4.18.2 + dev: true + + /symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + dev: true + + /term-size@2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} + engines: {node: '>=8'} + dev: true + + /test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + + /thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + dependencies: + thenify: 3.3.1 + dev: true + + /thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + dependencies: + any-promise: 1.3.0 + dev: true + + /tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: true + + /tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + dev: true + + /to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /tough-cookie@4.1.2: + resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.3.0 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: true + + /tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + + /tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + dependencies: + punycode: 2.3.0 + dev: true + + /tr46@3.0.0: + resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} + engines: {node: '>=12'} + dependencies: + punycode: 2.3.0 + dev: true + + /tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + dev: true + + /trim-newlines@3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} + dev: true + + /ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + dev: true + + /ts-jest@29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4): + resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.21.4 + '@jest/types': 29.5.0 + bs-logger: 0.2.6 + esbuild: 0.17.14 + fast-json-stable-stringify: 2.1.0 + jest: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + jest-util: 29.5.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 5.0.4 + yargs-parser: 21.1.1 + dev: true + + /ts-node@10.9.1(@types/node@18.15.11)(typescript@5.0.4): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.15.11 + acorn: 8.8.2 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.0.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /tsup@6.7.0(ts-node@10.9.1)(typescript@5.0.4): + resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} + engines: {node: '>=14.18'} + hasBin: true + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.1.0' + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.0.1(esbuild@0.17.14) + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4 + esbuild: 0.17.14 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 3.1.4(ts-node@10.9.1) + resolve-from: 5.0.0 + rollup: 3.20.2 + source-map: 0.8.0-beta.0 + sucrase: 3.32.0 + tree-kill: 1.2.2 + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + + /tty-table@4.2.1: + resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} + engines: {node: '>=8.0.0'} + hasBin: true + dependencies: + chalk: 4.1.2 + csv: 5.5.3 + kleur: 4.1.5 + smartwrap: 2.0.2 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 17.7.1 + dev: true + + /turbo-darwin-64@1.8.8: + resolution: {integrity: sha512-18cSeIm7aeEvIxGyq7PVoFyEnPpWDM/0CpZvXKHpQ6qMTkfNt517qVqUTAwsIYqNS8xazcKAqkNbvU1V49n65Q==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64@1.8.8: + resolution: {integrity: sha512-ruGRI9nHxojIGLQv1TPgN7ud4HO4V8mFBwSgO6oDoZTNuk5ybWybItGR+yu6fni5vJoyMHXOYA2srnxvOc7hjQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64@1.8.8: + resolution: {integrity: sha512-N/GkHTHeIQogXB1/6ZWfxHx+ubYeb8Jlq3b/3jnU4zLucpZzTQ8XkXIAfJG/TL3Q7ON7xQ8yGOyGLhHL7MpFRg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64@1.8.8: + resolution: {integrity: sha512-hKqLbBHgUkYf2Ww8uBL9UYdBFQ5677a7QXdsFhONXoACbDUPvpK4BKlz3NN7G4NZ+g9dGju+OJJjQP0VXRHb5w==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64@1.8.8: + resolution: {integrity: sha512-2ndjDJyzkNslXxLt+PQuU21AHJWc8f6MnLypXy3KsN4EyX/uKKGZS0QJWz27PeHg0JS75PVvhfFV+L9t9i+Yyg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64@1.8.8: + resolution: {integrity: sha512-xCA3oxgmW9OMqpI34AAmKfOVsfDljhD5YBwgs0ZDsn5h3kCHhC4x9W5dDk1oyQ4F5EXSH3xVym5/xl1J6WRpUg==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo@1.8.8: + resolution: {integrity: sha512-qYJ5NjoTX+591/x09KgsDOPVDUJfU9GoS+6jszQQlLp1AHrf1wRFA3Yps8U+/HTG03q0M4qouOfOLtRQP4QypA==} + hasBin: true + requiresBuild: true + optionalDependencies: + turbo-darwin-64: 1.8.8 + turbo-darwin-arm64: 1.8.8 + turbo-linux-64: 1.8.8 + turbo-linux-arm64: 1.8.8 + turbo-windows-64: 1.8.8 + turbo-windows-arm64: 1.8.8 + dev: true + + /type-check@0.3.2: + resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + dev: true + + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type-fest@0.13.1: + resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} + engines: {node: '>=10'} + dev: true + + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + + /type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + dev: true + + /type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + dev: true + + /type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /typed-array-length@1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + is-typed-array: 1.1.10 + dev: true + + /typedarray@0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: true + + /typescript@5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} + engines: {node: '>=12.20'} + hasBin: true + dev: true + + /unbox-primitive@1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: true + + /universalify@0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: true + + /unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /update-browserslist-db@1.0.10(browserslist@4.21.5): + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.5 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + + /url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: true + + /use-sync-external-store@1.2.0(react@18.2.0): + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: true + + /util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /v8-to-istanbul@9.1.0: + resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + + /validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: true + + /vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /w3c-xmlserializer@4.0.0: + resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} + engines: {node: '>=14'} + dependencies: + xml-name-validator: 4.0.0 + dev: true + + /walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + dependencies: + makeerror: 1.0.12 + dev: true + + /wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 + dev: true + + /webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + + /webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + dev: true + + /webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + dev: true + + /whatwg-encoding@2.0.0: + resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} + engines: {node: '>=12'} + dependencies: + iconv-lite: 0.6.3 + dev: true + + /whatwg-mimetype@3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + dev: true + + /whatwg-url@11.0.0: + resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} + engines: {node: '>=12'} + dependencies: + tr46: 3.0.0 + webidl-conversions: 7.0.0 + dev: true + + /whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + + /whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + dev: true + + /which-boxed-primitive@1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-collection@1.0.1: + resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} + dependencies: + is-map: 2.0.2 + is-set: 2.0.2 + is-weakmap: 2.0.1 + is-weakset: 2.0.2 + dev: true + + /which-module@2.0.0: + resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} + dev: true + + /which-pm@2.0.0: + resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} + engines: {node: '>=8.15'} + dependencies: + load-yaml-file: 0.2.0 + path-exists: 4.0.0 + dev: true + + /which-typed-array@1.1.9: + resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + is-typed-array: 1.1.10 + dev: true + + /which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /word-wrap@1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + dev: true + + /wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + dev: true + + /ws@8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /xml-name-validator@4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + dev: true + + /xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + dev: true + + /xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + dev: true + + /y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true + + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yallist@2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: true + + /yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + dev: true + + /yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.0 + y18n: 4.0.3 + yargs-parser: 18.1.3 + dev: true + + /yargs@17.7.1: + resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true + + /zod-to-json-schema@3.20.4(zod@3.21.4): + resolution: {integrity: sha512-Un9+kInJ2Zt63n6Z7mLqBifzzPcOyX+b+Exuzf7L1+xqck9Q2EPByyTRduV3kmSPaXaRer1JCsucubpgL1fipg==} + peerDependencies: + zod: ^3.20.0 + dependencies: + zod: 3.21.4 + dev: false + + /zod@3.21.4: + resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..dee51e92 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "packages/*" diff --git a/src/api.test.ts b/src/api.test.ts deleted file mode 100644 index 5012203d..00000000 --- a/src/api.test.ts +++ /dev/null @@ -1,494 +0,0 @@ -import express from "express"; -import { AddressInfo } from "net"; -import z from "zod"; -import { - makeApi, - makeCrudApi, - mergeApis, - Zodios, - parametersBuilder, -} from "./index"; -import { Assert } from "./utils.types"; - -const userSchema = z.object({ - id: z.number(), - name: z.string(), -}); - -describe("makeApi", () => { - it("should throw on duplicate path", () => { - expect(() => - makeApi([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users", - alias: "getUsers2", - description: "Get all users", - response: z.array(userSchema), - }, - ]) - ).toThrowError("Zodios: Duplicate path 'get /users'"); - }); - - it("should throw on duplicate alias", () => { - expect(() => - makeApi([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users2", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - ]) - ).toThrowError("Zodios: Duplicate alias 'getUsers'"); - }); - - it("should throw on duplicate Body", () => { - expect(() => - makeApi([ - { - method: "post", - path: "/users", - alias: "createUser", - description: "Create a user", - parameters: [ - { - name: "first", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - { - name: "second", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - ]) - ).toThrowError("Zodios: Multiple body parameters in endpoint '/users'"); - }); - - it("should build with parameters (Path,Query,Body,Header)", () => { - // get users api with query filter for user name, and path parameter for user id and header parameter for user token - const optionalTrueSchema = z.boolean().default(true).optional(); - const partialUserSchema = userSchema.partial(); - const bearerSchema = z.string().transform((s) => `Bearer ${s}`); - const api = makeApi([ - { - method: "post", - path: "/users/:id", - alias: "createtUser", - description: "Create a user", - parameters: [ - { - name: "id", - type: "Path", - description: "The user id", - schema: z.number(), - }, - { - name: "homonyms", - type: "Query", - description: "Allow homonyms", - schema: optionalTrueSchema, - }, - { - name: "email", - type: "Query", - description: "create an email account for the user", - schema: optionalTrueSchema, - }, - { - name: "body", - type: "Body", - description: "The object to create", - schema: partialUserSchema, - }, - { - name: "Authorization", - type: "Header", - description: "The user token", - schema: bearerSchema, - }, - { - name: "x-custom-header", - type: "Header", - description: "A custom header", - schema: z.string(), - }, - ], - response: userSchema, - }, - ]); - // check narrowing works - const test: Assert< - typeof api, - [ - { - method: "post"; - path: "/users/:id"; - alias: "createtUser"; - description: "Create a user"; - parameters: [ - { - name: "id"; - type: "Path"; - description: string; - schema: z.ZodNumber; - }, - { - name: "homonyms"; - type: "Query"; - description: string; - schema: typeof optionalTrueSchema; - }, - { - name: "email"; - type: "Query"; - description: string; - schema: typeof optionalTrueSchema; - }, - { - name: "body"; - type: "Body"; - description: string; - schema: typeof partialUserSchema; - }, - { - name: "Authorization"; - type: "Header"; - description: string; - schema: typeof bearerSchema; - }, - { - name: "x-custom-header"; - type: "Header"; - description: string; - schema: z.ZodString; - } - ]; - response: typeof userSchema; - } - ] - > = true; - }); -}); - -describe("parametersBuilder", () => { - it("should build parameters (Path,Query,Body,Header)", () => { - // get users api with query filter for user name, and path parameter for user id and header parameter for user token - const optionalTrueSchema = z.boolean().default(true).optional(); - const partialUserSchema = userSchema.partial(); - const bearerSchema = z.string().transform((s) => `Bearer ${s}`); - - const parameters = parametersBuilder() - .addParameters("Path", { - id: z.number(), - }) - .addQueries({ - homonyms: optionalTrueSchema, - email: optionalTrueSchema, - }) - .addBody(partialUserSchema) - .addHeaders({ - Authorization: bearerSchema, - "x-custom-header": z.string(), - }) - .build(); - - const test: Assert< - typeof parameters[number], - | { - name: "id"; - type: "Path"; - description?: string; - schema: z.ZodNumber; - } - | { - name: "homonyms"; - type: "Query"; - description?: string; - schema: typeof optionalTrueSchema; - } - | { - name: "email"; - type: "Query"; - description?: string; - schema: typeof optionalTrueSchema; - } - | { - name: "body"; - type: "Body"; - description?: string; - schema: typeof partialUserSchema; - } - | { - name: "Authorization"; - type: "Header"; - description?: string; - schema: typeof bearerSchema; - } - | { - name: "x-custom-header"; - type: "Header"; - description?: string; - schema: z.ZodString; - } - > = true; - }); -}); - -describe("makeCrudApi", () => { - let app: express.Express; - let server: ReturnType; - let port: number; - - beforeAll(async () => { - app = express(); - app.use(express.json()); - app.get("/users", (req, res) => { - res.status(200).json([{ id: 1, name: "test" }]); - }); - app.get("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: "test" }); - }); - app.post("/users", (req, res) => { - res.status(200).json({ id: 1, name: "test" }); - }); - app.put("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: req.body.name }); - }); - app.patch("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: req.body.name }); - }); - app.delete("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: "test" }); - }); - server = app.listen(0); - port = (server.address() as AddressInfo).port; - }); - - afterAll(() => { - server.close(); - }); - - it("should create a CRUD api definition", () => { - const api = makeCrudApi("user", userSchema); - - const usersSchema = z.array(userSchema); - - type ExpectedGetEndpoint = { - method: "get"; - path: "/users"; - alias: "getUsers"; - description: "Get all users"; - response: typeof usersSchema; - }; - - // check narrowing works - const testGet: Assert = true; - - expect(JSON.stringify(api)).toEqual( - JSON.stringify([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users/:id", - alias: "getUser", - description: "Get a user", - response: userSchema, - }, - { - method: "post", - path: "/users", - alias: "createUser", - description: "Create a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - { - method: "put", - path: "/users/:id", - alias: "updateUser", - description: "Update a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to update", - schema: userSchema, - }, - ], - response: userSchema, - }, - { - method: "patch", - path: "/users/:id", - alias: "patchUser", - description: "Patch a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to patch", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - { - method: "delete", - path: "/users/:id", - alias: "deleteUser", - description: "Delete a user", - response: userSchema, - }, - ]) - ); - }); - - it("should get one user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.getUser({ params: { id: 1 } }); - expect(user).toEqual({ id: 1, name: "test" }); - }); - - it("should get all users", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const users = await client.getUsers(); - expect(users).toEqual([{ id: 1, name: "test" }]); - }); - - it("should create a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.createUser({ name: "test" }); - expect(user).toEqual({ id: 1, name: "test" }); - }); - - it("should update a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.updateUser( - { id: 2, name: "test2" }, - { params: { id: 2 } } - ); - expect(user).toEqual({ id: 2, name: "test2" }); - }); - - it("should patch a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.patchUser( - { name: "test2" }, - { params: { id: 2 } } - ); - expect(user).toEqual({ id: 2, name: "test2" }); - }); - - it("should delete a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.deleteUser(undefined, { params: { id: 2 } }); - expect(user).toEqual({ id: 2, name: "test" }); - }); -}); - -describe("mergeApis", () => { - it("should merge two apis", () => { - const usersSchema = z.array(userSchema); - const api1 = makeApi([ - { - method: "get", - path: "/", - alias: "getUsers", - description: "Get all users", - response: usersSchema, - }, - { - method: "get", - path: "/:id", - alias: "getUser", - description: "Get a user", - response: userSchema, - }, - ]); - - const api2 = makeApi([ - { - method: "get", - path: "/", - alias: "getAdmins", - description: "Get all admins", - response: usersSchema, - }, - ]); - const merged = mergeApis({ - "/users": api1, - "/admins": api2, - }); - expect(merged).toHaveLength(3); - expect(merged[0].path).toEqual("/users"); - expect(merged[1].path).toEqual("/users/:id"); - expect(merged[2].path).toEqual("/admins"); - const test1: Assert< - typeof merged, - [ - { - method: "get"; - path: "/users"; - alias: "getUsers"; - description: "Get all users"; - response: typeof usersSchema; - }, - { - method: "get"; - path: "/users/:id"; - alias: "getUser"; - description: "Get a user"; - response: typeof userSchema; - }, - { - method: "get"; - path: "/admins"; - alias: "getAdmins"; - description: "Get all admins"; - response: typeof usersSchema; - } - ] - > = true; - }); -}); diff --git a/src/plugins/zodios-plugins.test.ts b/src/plugins/zodios-plugins.test.ts deleted file mode 100644 index 7f4f7415..00000000 --- a/src/plugins/zodios-plugins.test.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { ZodiosPlugin } from "../zodios.types"; -import { ZodiosPlugins } from "./zodios-plugins"; - -describe("ZodiosPlugins", () => { - it("should be defined", () => { - expect(ZodiosPlugins).toBeDefined(); - }); - - it("should register one plugin", () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - const id = plugins.use(plugin); - expect(id.key).toBe("any-any"); - expect(id.value).toBe(0); - expect(plugins.count()).toBe(1); - }); - - it("should unregister one plugin", () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - const id = plugins.use(plugin); - plugins.eject(id); - expect(plugins.count()).toBe(0); - }); - - it("should replace named plugins", () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { - name: "test", - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - plugins.use(plugin); - plugins.use(plugin); - expect(plugins.count()).toBe(1); - }); - - it("should throw if plugin is not registered", () => { - const plugins = new ZodiosPlugins("any", "any"); - const id = { key: "test-any", value: 5 }; - expect(() => plugins.eject(id)).toThrowError( - `Plugin with key 'test-any' is not registered for endpoint 'any-any'` - ); - }); - - it("should throw if named plugin is not registered", () => { - const plugins = new ZodiosPlugins("any", "any"); - expect(() => plugins.eject("test")).toThrowError( - `Plugin with name 'test' not found` - ); - }); - - it("should execute response plugins consistently", async () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin1: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => { - response.data += "1"; - return response; - }, - }; - plugins.use(plugin1); - const plugin2: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => { - response.data += "2"; - return response; - }, - }; - plugins.use(plugin2); - const response1 = await plugins.interceptResponse( - [], - // @ts-ignore - {}, - Promise.resolve({ data: "test1:" }) - ); - expect(response1.data).toBe("test1:21"); - const response2 = await plugins.interceptResponse( - [], - // @ts-ignore - {}, - Promise.resolve({ data: "test2:" }) - ); - expect(response2.data).toBe("test2:21"); - }); - - it('should catch error if plugin "error" is defined', async () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { - request: async (api, config) => config, - // @ts-ignore - error: async (api, config, error) => ({ test: true }), - }; - plugins.use(plugin); - const response = await plugins.interceptResponse( - [], - // @ts-ignore - { method: "any", url: "any" }, - Promise.reject(new Error("test")) - ); - expect(response).toEqual({ test: true }); - }); - - it("should count plugins", () => { - const plugins = new ZodiosPlugins("any", "any"); - const namedPlugin: (n: number) => ZodiosPlugin = (n) => ({ - name: `test${n}`, - request: async (api, config) => config, - response: async (api, config, response) => response, - }); - const plugin: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - plugins.use(namedPlugin(1)); - plugins.use(plugin); - plugins.use(namedPlugin(2)); - expect(plugins.count()).toBe(3); - }); -}); diff --git a/src/plugins/zodios-plugins.ts b/src/plugins/zodios-plugins.ts deleted file mode 100644 index b4742849..00000000 --- a/src/plugins/zodios-plugins.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { AxiosResponse } from "axios"; -import { ReadonlyDeep } from "../utils.types"; -import { - AnyZodiosRequestOptions, - Method, - ZodiosEndpointDefinitions, - ZodiosPlugin, -} from "../zodios.types"; - -export type PluginId = { - key: string; - value: number; -}; - -/** - * A list of plugins that can be used by the Zodios client. - */ -export class ZodiosPlugins { - public readonly key: string; - private plugins: Array = []; - - /** - * Constructor - * @param method - http method of the endpoint where the plugins are registered - * @param path - path of the endpoint where the plugins are registered - */ - constructor(method: Method | "any", path: string) { - this.key = `${method}-${path}`; - } - - /** - * Get the index of a plugin by name - * @param name - name of the plugin - * @returns the index of the plugin if found, -1 otherwise - */ - indexOf(name: string) { - return this.plugins.findIndex((p) => p?.name === name); - } - - /** - * register a plugin - * if the plugin has a name it will be replaced if it already exists - * @param plugin - plugin to register - * @returns unique id of the plugin - */ - use(plugin: ZodiosPlugin): PluginId { - if (plugin.name) { - const id = this.indexOf(plugin.name); - if (id !== -1) { - this.plugins[id] = plugin; - return { key: this.key, value: id }; - } - } - this.plugins.push(plugin); - return { key: this.key, value: this.plugins.length - 1 }; - } - - /** - * unregister a plugin - * @param plugin - plugin to unregister - */ - eject(plugin: PluginId | string) { - if (typeof plugin === "string") { - const id = this.indexOf(plugin); - if (id === -1) { - throw new Error(`Plugin with name '${plugin}' not found`); - } - this.plugins[id] = undefined; - } else { - if (plugin.key !== this.key) { - throw new Error( - `Plugin with key '${plugin.key}' is not registered for endpoint '${this.key}'` - ); - } - this.plugins[plugin.value] = undefined; - } - } - - /** - * Intercept the request config by applying all plugins - * before using it to send a request to the server - * @param config - request config - * @returns the modified config - */ - async interceptRequest( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep - ) { - let pluginConfig = config; - for (const plugin of this.plugins) { - if (plugin?.request) { - pluginConfig = await plugin.request(api, pluginConfig); - } - } - return pluginConfig; - } - - /** - * Intercept the response from server by applying all plugins - * @param api - endpoint descriptions - * @param config - request config - * @param response - response from the server - * @returns the modified response - */ - async interceptResponse( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, - response: Promise - ) { - let pluginResponse = response; - for (let index = this.plugins.length - 1; index >= 0; index--) { - const plugin = this.plugins[index]; - if (plugin) { - pluginResponse = pluginResponse.then( - plugin?.response - ? (res) => plugin.response!(api, config, res) - : undefined, - plugin?.error ? (err) => plugin.error!(api, config, err) : undefined - ); - } - } - return pluginResponse; - } - - /** - * Get the number of plugins registered - * @returns the number of plugins registered - */ - count() { - return this.plugins.reduce( - (count, plugin) => (plugin ? count + 1 : count), - 0 - ); - } -} diff --git a/src/zodios-error.utils.ts b/src/zodios-error.utils.ts deleted file mode 100644 index a8f277af..00000000 --- a/src/zodios-error.utils.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { AxiosError } from "axios"; -import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; -import { - Aliases, - Method, - ZodiosEndpointDefinitions, - ZodiosEndpointError, - ZodiosMatchingErrorsByAlias, - ZodiosMatchingErrorsByPath, - ZodiosPathsByMethod, -} from "./zodios.types"; - -function isDefinedError( - error: unknown, - findEndpointErrors: (error: AxiosError) => ZodiosEndpointError[] | undefined -): boolean { - if ( - error instanceof AxiosError || - (error && typeof error === "object" && "isAxiosError" in error) - ) { - const err = error as AxiosError; - if (err.response) { - const endpointErrors = findEndpointErrors(err); - if (endpointErrors) { - return endpointErrors.some( - (desc) => desc.schema.safeParse(err.response!.data).success - ); - } - } - } - return false; -} - -/** - * check if the error is matching the endpoint errors definitions - * @param api - the api definition - * @param method - http method of the endpoint - * @param path - path of the endpoint - * @param error - the error to check - * @returns - if true, the error type is narrowed to the matching endpoint errors - */ -export function isErrorFromPath< - Api extends ZodiosEndpointDefinitions, - M extends Method, - Path extends string ->( - api: Api, - method: M, - path: Path extends ZodiosPathsByMethod - ? Path - : ZodiosPathsByMethod, - error: unknown -): error is ZodiosMatchingErrorsByPath< - Api, - M, - Path extends ZodiosPathsByMethod ? Path : never -> { - return isDefinedError(error, (err) => - findEndpointErrorsByPath(api, method, path, err) - ); -} - -/** - * check if the error is matching the endpoint errors definitions - * @param api - the api definition - * @param alias - alias of the endpoint - * @param error - the error to check - * @returns - if true, the error type is narrowed to the matching endpoint errors - */ -export function isErrorFromAlias< - Api extends ZodiosEndpointDefinitions, - Alias extends string ->( - api: Api, - alias: Alias extends Aliases ? Alias : Aliases, - error: unknown -): error is ZodiosMatchingErrorsByAlias { - return isDefinedError(error, (err) => - findEndpointErrorsByAlias(api, alias, err) - ); -} diff --git a/src/zodios.ts b/src/zodios.ts deleted file mode 100644 index 730afb29..00000000 --- a/src/zodios.ts +++ /dev/null @@ -1,444 +0,0 @@ -import axios from "axios"; -import type { AxiosInstance } from "axios"; -import { - AnyZodiosRequestOptions, - ZodiosRequestOptions, - ZodiosBodyByPath, - Method, - ZodiosPathsByMethod, - ZodiosResponseByPath, - ZodiosOptions, - ZodiosEndpointDefinitions, - ZodiosRequestOptionsByPath, - ZodiosAliases, - ZodiosPlugin, - Aliases, -} from "./zodios.types"; -import { omit, replacePathParams } from "./utils"; -import { - PluginId, - ZodiosPlugins, - zodValidationPlugin, - formDataPlugin, - formURLPlugin, - headerPlugin, -} from "./plugins"; -import { - Narrow, - PickRequired, - ReadonlyDeep, - RequiredKeys, - UndefinedIfNever, -} from "./utils.types"; -import { checkApi } from "./api"; - -/** - * zodios api client based on axios - */ -export class ZodiosClass { - private axiosInstance: AxiosInstance; - public readonly options: PickRequired< - ZodiosOptions, - "validate" | "transform" | "sendDefaults" - >; - public readonly api: Api; - private endpointPlugins: Map = new Map(); - - /** - * constructor - * @param baseURL - the base url to use - if omited will use the browser domain - * @param api - the description of all the api endpoints - * @param options - the options to setup the client API - * @example - * const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ - * { - * method: "get", - * path: "/users", - * description: "Get all users", - * parameters: [ - * { - * name: "q", - * type: "Query", - * schema: z.string(), - * }, - * { - * name: "page", - * type: "Query", - * schema: z.string().optional(), - * }, - * ], - * response: z.array(z.object({ id: z.number(), name: z.string() })), - * } - * ]); - */ - constructor(api: Narrow, options?: ZodiosOptions); - constructor(baseUrl: string, api: Narrow, options?: ZodiosOptions); - constructor( - arg1?: Api | string, - arg2?: Api | ZodiosOptions, - arg3?: ZodiosOptions - ) { - let options: ZodiosOptions; - if (!arg1) { - if (Array.isArray(arg2)) { - throw new Error("Zodios: missing base url"); - } - throw new Error("Zodios: missing api description"); - } - let baseURL: string | undefined; - if (typeof arg1 === "string" && Array.isArray(arg2)) { - baseURL = arg1; - this.api = arg2; - options = arg3 || {}; - } else if (Array.isArray(arg1) && !Array.isArray(arg2)) { - this.api = arg1; - options = arg2 || {}; - } else { - throw new Error("Zodios: api must be an array"); - } - - checkApi(this.api); - - this.options = { - validate: true, - transform: true, - sendDefaults: false, - ...options, - }; - - if (this.options.axiosInstance) { - this.axiosInstance = this.options.axiosInstance; - } else { - this.axiosInstance = axios.create({ - ...this.options.axiosConfig, - }); - } - if (baseURL) this.axiosInstance.defaults.baseURL = baseURL; - - this.injectAliasEndpoints(); - this.initPlugins(); - if ([true, "all", "request", "response"].includes(this.options.validate)) { - this.use(zodValidationPlugin(this.options)); - } - } - - private initPlugins() { - this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); - - this.api.forEach((endpoint) => { - const plugins = new ZodiosPlugins(endpoint.method, endpoint.path); - switch (endpoint.requestFormat) { - case "binary": - plugins.use(headerPlugin("Content-Type", "application/octet-stream")); - break; - case "form-data": - plugins.use(formDataPlugin()); - break; - case "form-url": - plugins.use(formURLPlugin()); - break; - case "text": - plugins.use(headerPlugin("Content-Type", "text/plain")); - break; - } - this.endpointPlugins.set(`${endpoint.method}-${endpoint.path}`, plugins); - }); - } - - private getAnyEndpointPlugins() { - return this.endpointPlugins.get("any-any"); - } - - private findAliasEndpointPlugins(alias: string) { - const endpoint = this.api.find((endpoint) => endpoint.alias === alias); - if (endpoint) { - return this.endpointPlugins.get(`${endpoint.method}-${endpoint.path}`); - } - return undefined; - } - - private findEnpointPlugins(method: Method, path: string) { - return this.endpointPlugins.get(`${method}-${path}`); - } - - /** - * get the base url of the api - */ - get baseURL() { - return this.axiosInstance.defaults.baseURL; - } - - /** - * get the underlying axios instance - */ - get axios() { - return this.axiosInstance; - } - - /** - * register a plugin to intercept the requests or responses - * @param plugin - the plugin to use - * @returns an id to allow you to unregister the plugin - */ - use(plugin: ZodiosPlugin): PluginId; - use>(alias: Alias, plugin: ZodiosPlugin): PluginId; - use>( - method: M, - path: Path, - plugin: ZodiosPlugin - ): PluginId; - use(...args: unknown[]) { - if (typeof args[0] === "object") { - const plugins = this.getAnyEndpointPlugins()!; - return plugins.use(args[0] as ZodiosPlugin); - } else if (typeof args[0] === "string" && typeof args[1] === "object") { - const plugins = this.findAliasEndpointPlugins(args[0]); - if (!plugins) - throw new Error( - `Zodios: no alias '${args[0]}' found to register plugin` - ); - return plugins.use(args[1] as ZodiosPlugin); - } else if ( - typeof args[0] === "string" && - typeof args[1] === "string" && - typeof args[2] === "object" - ) { - const plugins = this.findEnpointPlugins(args[0] as Method, args[1]); - if (!plugins) - throw new Error( - `Zodios: no endpoint '${args[0]} ${args[1]}' found to register plugin` - ); - return plugins.use(args[2] as ZodiosPlugin); - } - throw new Error("Zodios: invalid plugin registration"); - } - - /** - * unregister a plugin - * if the plugin name is provided instead of the registration plugin id, - * it will unregister the plugin with that name only for non endpoint plugins - * @param plugin - id of the plugin to remove - */ - eject(plugin: PluginId | string): void { - if (typeof plugin === "string") { - const plugins = this.getAnyEndpointPlugins()!; - plugins.eject(plugin); - return; - } - this.endpointPlugins.get(plugin.key)?.eject(plugin); - } - - private injectAliasEndpoints() { - this.api.forEach((endpoint) => { - if (endpoint.alias) { - if (["post", "put", "patch", "delete"].includes(endpoint.method)) { - (this as any)[endpoint.alias] = (data: any, config: any) => - this.request({ - ...config, - method: endpoint.method, - url: endpoint.path, - data, - }); - } else { - (this as any)[endpoint.alias] = (config: any) => - this.request({ - ...config, - method: endpoint.method, - url: endpoint.path, - }); - } - } - }); - } - - /** - * make a request to the api - * @param config - the config to setup zodios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async request( - config: Path extends ZodiosPathsByMethod - ? ReadonlyDeep> - : ReadonlyDeep>> - ): Promise< - ZodiosResponseByPath< - Api, - M, - Path extends ZodiosPathsByMethod ? Path : never - > - > { - let conf = config as unknown as ReadonlyDeep; - const anyPlugin = this.getAnyEndpointPlugins()!; - const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); - conf = await anyPlugin.interceptRequest(this.api, conf); - if (endpointPlugin) { - conf = await endpointPlugin.interceptRequest(this.api, conf); - } - let response = this.axiosInstance.request({ - ...omit(conf as AnyZodiosRequestOptions, ["params", "queries"]), - url: replacePathParams(conf), - params: conf.queries, - }); - if (endpointPlugin) { - response = endpointPlugin.interceptResponse(this.api, conf, response); - } - response = anyPlugin.interceptResponse(this.api, conf, response); - return (await response).data; - } - - /** - * make a get request to the api - * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async get< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "get", - url: path, - } as any); - } - - /** - * make a post request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async post< - Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, - TConfig extends ZodiosRequestOptionsByPath - >( - path: Path, - data: TBody, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "post", - url: path, - data, - } as any); - } - - /** - * make a put request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async put< - Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, - TConfig extends ZodiosRequestOptionsByPath - >( - path: Path, - data: TBody, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "put", - url: path, - data, - } as any); - } - - /** - * make a patch request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async patch< - Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, - TConfig extends ZodiosRequestOptionsByPath - >( - path: Path, - data: TBody, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "patch", - url: path, - data, - } as any); - } - - /** - * make a delete request to the api - * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async delete< - Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, - TConfig extends ZodiosRequestOptionsByPath - >( - path: Path, - data: TBody, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "delete", - url: path, - data, - } as any); - } -} - -export type ZodiosInstance = - ZodiosClass & ZodiosAliases; - -export type ZodiosConstructor = { - new ( - api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; - new ( - baseUrl: string, - api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; -}; - -export const Zodios = ZodiosClass as ZodiosConstructor; - -/** - * Get the Api description type from zodios - * @param Z - zodios type - */ -export type ApiOf = Z extends ZodiosInstance ? Api : never; diff --git a/src/zodios.types.ts b/src/zodios.types.ts deleted file mode 100644 index dc5bbeaa..00000000 --- a/src/zodios.types.ts +++ /dev/null @@ -1,733 +0,0 @@ -import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; -import type { - FilterArrayByValue, - MapSchemaParameters, - PickDefined, - NeverIfEmpty, - UndefinedToOptional, - PathParamNames, - SetPropsOptionalIfChildrenAreOptional, - ReadonlyDeep, - Merge, - FilterArrayByKey, - IfEquals, - RequiredKeys, - UndefinedIfNever, -} from "./utils.types"; -import z from "zod"; - -type AxiosRequestConfig = Parameters[0]; - -export type MutationMethod = "post" | "put" | "patch" | "delete"; - -export type Method = "get" | "head" | "options" | MutationMethod; - -export type RequestFormat = - | "json" // default - | "form-data" // for file uploads - | "form-url" // for hiding query params in the body - | "binary" // for binary data / file uploads - | "text"; // for text data - -type EndpointDefinitionsByMethod< - Api extends ZodiosEndpointDefinition[], - M extends Method -> = FilterArrayByValue; - -export type ZodiosEndpointDefinitionByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue; - -export type ZodiosEndpointDefinitionByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue; - -export type ZodiosPathsByMethod< - Api extends ZodiosEndpointDefinition[], - M extends Method -> = EndpointDefinitionsByMethod[number]["path"]; - -export type Aliases = FilterArrayByKey< - Api, - "alias" ->[number]["alias"]; - -export type ZodiosResponseForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true -> = Frontend extends true - ? z.output - : z.input; - -export type ZodiosResponseByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true -> = Frontend extends true - ? z.output[number]["response"]> - : z.input[number]["response"]>; - -export type ZodiosResponseByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true -> = Frontend extends true - ? z.output[number]["response"]> - : z.input[number]["response"]>; - -export type ZodiosDefaultErrorForEndpoint< - Endpoint extends ZodiosEndpointDefinition -> = FilterArrayByValue< - Endpoint["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type ZodiosDefaultErrorByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type ZodiosDefaultErrorByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type IfNever = IfEquals; - -export type ZodiosErrorForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Status extends number, - Frontend extends boolean = true -> = Frontend extends true - ? z.output< - IfNever< - FilterArrayByValue< - Endpoint["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorForEndpoint - > - > - : z.input< - IfNever< - FilterArrayByValue< - Endpoint["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorForEndpoint - > - >; - -export type ZodiosErrorByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Status extends number, - Frontend extends boolean = true -> = Frontend extends true - ? z.output< - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByPath - > - > - : z.input< - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByPath - > - >; - -export type ErrorsToAxios = T extends [ - infer Head, - ...infer Tail -] - ? Head extends { - status: infer Status; - schema: infer Schema; - } - ? Schema extends z.ZodTypeAny - ? ErrorsToAxios< - Tail, - [ - ...Acc, - Merge< - Omit, - { - response: Merge< - AxiosError>["response"], - { - status: Status extends "default" - ? 0 & { error: Status } - : Status; - } - >; - } - > - ] - > - : Acc - : Acc - : Acc; - -export type ZodiosMatchingErrorsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = ErrorsToAxios< - ZodiosEndpointDefinitionByPath[number]["errors"] ->[number]; - -export type ZodiosMatchingErrorsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = ErrorsToAxios< - ZodiosEndpointDefinitionByAlias[number]["errors"] ->[number]; - -export type ZodiosErrorByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Status extends number, - Frontend extends boolean = true -> = Frontend extends true - ? z.output< - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByAlias - > - > - : z.input< - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByAlias - > - >; - -export type BodySchemaForEndpoint = - FilterArrayByValue< - Endpoint["parameters"], - { type: "Body" } - >[number]["schema"]; - -export type BodySchema< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Body" } ->[number]["schema"]; - -export type ZodiosBodyForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true -> = Frontend extends true - ? z.input> - : z.output>; - -export type ZodiosBodyByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true -> = Frontend extends true - ? z.input> - : z.output>; - -export type BodySchemaByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Body" } ->[number]["schema"]; - -export type ZodiosBodyByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true -> = Frontend extends true - ? z.input> - : z.output>; - -export type ZodiosQueryParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue, - Frontend - > - > ->; - -export type ZodiosQueryParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Query" } - >, - Frontend - > - > ->; - -export type ZodiosQueryParamsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Query" } - >, - Frontend - > - > ->; - -/** - * @deprecated - use ZodiosQueryParamsByPath instead - */ -export type ZodiosPathParams = NeverIfEmpty< - Record, string | number> ->; - -export type ZodiosPathParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - PathParameters = MapSchemaParameters< - FilterArrayByValue, - Frontend - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { - [Key in K]: any; - } - ? PathParameters[K] - : string | number; -}>; - -/** - * Get path params for a given endpoint by path - */ -export type ZodiosPathParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - PathParameters = MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Path" } - >, - Frontend - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; - -/** - * Get path params for a given endpoint by alias - */ -export type ZodiosPathParamByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - EndpointDefinition extends ZodiosEndpointDefinition = ZodiosEndpointDefinitionByAlias< - Api, - Alias - >[number], - Path = EndpointDefinition["path"], - PathParameters = MapSchemaParameters< - FilterArrayByValue, - Frontend - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; - -export type ZodiosHeaderParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue, - Frontend - > - > ->; - -export type ZodiosHeaderParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Header" } - >, - Frontend - > - > ->; - -export type ZodiosHeaderParamsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Header" } - >, - Frontend - > - > ->; - -export type ZodiosRequestOptionsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = Merge< - SetPropsOptionalIfChildrenAreOptional< - PickDefined<{ - params: ZodiosPathParamByAlias; - queries: ZodiosQueryParamsByAlias; - headers: ZodiosHeaderParamsByAlias; - }> - >, - Omit ->; - -export type ZodiosMutationAliasRequest = - RequiredKeys extends never - ? ( - body: ReadonlyDeep>, - configOptions?: ReadonlyDeep - ) => Promise - : ( - body: ReadonlyDeep>, - configOptions: ReadonlyDeep - ) => Promise; - -export type ZodiosAliasRequest = - RequiredKeys extends never - ? (configOptions?: ReadonlyDeep) => Promise - : (configOptions: ReadonlyDeep) => Promise; - -export type ZodiosAliases = { - [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< - Api, - Alias - >[number]["method"] extends MutationMethod - ? ZodiosMutationAliasRequest< - ZodiosBodyByAlias, - ZodiosRequestOptionsByAlias, - ZodiosResponseByAlias - > - : ZodiosAliasRequest< - ZodiosRequestOptionsByAlias, - ZodiosResponseByAlias - >; -}; - -export type AnyZodiosMethodOptions = Merge< - { - params?: Record; - queries?: Record; - headers?: Record; - }, - Omit ->; - -export type AnyZodiosRequestOptions = Merge< - { method: Method; url: string }, - AnyZodiosMethodOptions ->; - -/** - * @deprecated - use ZodiosRequestOptionsByPath instead - */ -export type ZodiosMethodOptions< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = Merge< - SetPropsOptionalIfChildrenAreOptional< - PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; - }> - >, - Omit ->; - -/** - * Get the request options for a given endpoint - */ -export type ZodiosRequestOptionsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = Merge< - SetPropsOptionalIfChildrenAreOptional< - PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; - }> - >, - Omit ->; - -export type ZodiosRequestOptions< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = Merge< - { - method: M; - url: Path; - data?: ZodiosBodyByPath; - }, - ZodiosRequestOptionsByPath ->; - -/** - * Zodios options - */ -export type ZodiosOptions = { - /** - * Should zodios validate parameters and response? Default: true - */ - validate?: boolean | "request" | "response" | "all" | "none"; - /** - * Should zodios transform the request and response ? Default: true - */ - transform?: boolean | "request" | "response"; - /** - * Should zod schema default values be used on parameters? Default: false - * you usually want your backend to handle default values - */ - sendDefaults?: boolean; - /** - * Override the default axios instance. Default: zodios will create it's own axios instance - */ - axiosInstance?: AxiosInstance; - /** - * default config for axios requests - */ - axiosConfig?: AxiosRequestConfig; -}; - -export type ZodiosEndpointParameter = { - /** - * name of the parameter - */ - name: string; - /** - * optional description of the parameter - */ - description?: string; - /** - * type of the parameter: Query, Body, Header, Path - */ - type: "Query" | "Body" | "Header" | "Path"; - /** - * zod schema of the parameter - * you can use zod `transform` to transform the value of the parameter before sending it to the server - */ - schema: z.ZodType; -}; - -export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; - -export type ZodiosEndpointError = { - /** - * status code of the error - * use 'default' to declare a default error - */ - status: number | "default"; - /** - * description of the error - used to generate the openapi error description - */ - description?: string; - /** - * schema of the error - */ - schema: z.ZodType; -}; - -export type ZodiosEndpointErrors = ZodiosEndpointError[]; - -/** - * Zodios enpoint definition that should be used to create a new instance of Zodios - */ -export type ZodiosEndpointDefinition = { - /** - * http method : get, post, put, patch, delete - */ - method: Method; - /** - * path of the endpoint - * @example - * ```text - * /posts/:postId/comments/:commentId - * ``` - */ - path: string; - /** - * optional alias to call the endpoint easily - * @example - * ```text - * getPostComments - * ``` - */ - alias?: string; - /** - * optional description of the endpoint - */ - description?: string; - /** - * optional request format of the endpoint: json, form-data, form-url, binary, text - */ - requestFormat?: RequestFormat; - /** - * optionally mark the endpoint as immutable to allow zodios to cache the response with react-query - * use it to mark a 'post' endpoint as immutable - */ - immutable?: boolean; - /** - * optional parameters of the endpoint - */ - parameters?: Array; - /** - * response of the endpoint - * you can use zod `transform` to transform the value of the response before returning it - */ - response: z.ZodType; - /** - * optional response status of the endpoint for sucess, default is 200 - * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code - */ - status?: number; - /** - * optional response description of the endpoint - */ - responseDescription?: string; - /** - * optional errors of the endpoint - only usefull when using @zodios/express - */ - errors?: Array; -}; - -export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; - -/** - * Zodios plugin that can be used to intercept zodios requests and responses - */ -export type ZodiosPlugin = { - /** - * Optional name of the plugin - * naming a plugin allows to remove it or replace it later - */ - name?: string; - /** - * request interceptor to modify or inspect the request before it is sent - * @param api - the api description - * @param request - the request config - * @returns possibly a new request config - */ - request?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep - ) => Promise>; - /** - * response interceptor to modify or inspect the response before it is returned - * @param api - the api description - * @param config - the request config - * @param response - the response - * @returns possibly a new response - */ - response?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, - response: AxiosResponse - ) => Promise; - /** - * error interceptor for response errors - * there is no error interceptor for request errors - * @param api - the api description - * @param config - the config for the request - * @param error - the error that occured - * @returns possibly a new response or a new error - */ - error?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, - error: Error - ) => Promise; -}; diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000..cb0bebe8 --- /dev/null +++ b/turbo.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://turbo.build/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["lib/**"] + }, + "test": { + "outputs": [] + }, + "lint": {}, + "deploy": {} + } +} diff --git a/website/package.json b/website/package.json index 08cb092d..b3e14081 100644 --- a/website/package.json +++ b/website/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^2.3.1", "@tsconfig/docusaurus": "1.0.6", - "typescript": "4.8.2" + "typescript": "5.0.2" }, "browserslist": { "production": [ diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index db73e76a..00000000 --- a/yarn.lock +++ /dev/null @@ -1,3711 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ampproject/remapping@^2.0.0": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.1.tgz#7922fb0817bf3166d8d9e258c57477e3fd1c3610" - integrity sha512-Aolwjd7HSC2PyY0fDj/wA/EimQT4HfEnFYNp5s9CQlrdhyvWTtvZ5YzrUPu6R6/1jKiUlxu8bUhkdSnKHNAHMA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.0" - -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - -"@babel/compat-data@^7.16.4": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.0.tgz#86850b8597ea6962089770952075dcaabb8dba34" - integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng== - -"@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== - -"@babel/core@^7.11.6": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.10.tgz#74ef0fbf56b7dfc3f198fc2d927f4f03e12f4b05" - integrity sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-compilation-targets" "^7.17.10" - "@babel/helper-module-transforms" "^7.17.7" - "@babel/helpers" "^7.17.9" - "@babel/parser" "^7.17.10" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.10" - "@babel/types" "^7.17.10" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/core@^7.12.3": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.2.tgz#2c77fc430e95139d816d39b113b31bf40fb22337" - integrity sha512-R3VH5G42VSDolRHyUO4V2cfag8WHcZyxdq5Z/m8Xyb92lW/Erm/6kM+XtRFGf3Mulre3mveni2NHfEUws8wSvw== - dependencies: - "@ampproject/remapping" "^2.0.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.0" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.17.2" - "@babel/parser" "^7.17.0" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" - "@babel/types" "^7.17.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - -"@babel/generator@^7.17.0", "@babel/generator@^7.7.2": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.0.tgz#7bd890ba706cd86d3e2f727322346ffdbf98f65e" - integrity sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw== - dependencies: - "@babel/types" "^7.17.0" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.10.tgz#c281fa35b0c349bbe9d02916f4ae08fc85ed7189" - integrity sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg== - dependencies: - "@babel/types" "^7.17.10" - "@jridgewell/gen-mapping" "^0.1.0" - jsesc "^2.5.1" - -"@babel/helper-compilation-targets@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" - integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== - dependencies: - "@babel/compat-data" "^7.16.4" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.17.5" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" - integrity sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ== - dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" - integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== - dependencies: - "@babel/helper-get-function-arity" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - -"@babel/helper-get-function-arity@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" - integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-imports@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" - integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" - integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.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.16.7", "@babel/helper-plugin-utils@^7.8.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" - integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== - -"@babel/helper-plugin-utils@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== - -"@babel/helper-simple-access@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" - integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-simple-access@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" - integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== - dependencies: - "@babel/types" "^7.17.0" - -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - -"@babel/helper-validator-option@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" - integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== - -"@babel/helpers@^7.17.2": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" - integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" - "@babel/types" "^7.17.0" - -"@babel/helpers@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.9.tgz#b2af120821bfbe44f9907b1826e168e819375a1a" - integrity sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.9" - "@babel/types" "^7.17.0" - -"@babel/highlight@^7.16.7": - version "7.16.10" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" - integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.0": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c" - integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw== - -"@babel/parser@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.10.tgz#873b16db82a8909e0fbd7f115772f4b739f6ce78" - integrity sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.8.3": - 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": - 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== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - 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== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.8.3": - 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== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-top-level-await@^7.8.3": - 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== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" - integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/template@^7.16.7", "@babel/template@^7.3.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/traverse@^7.16.7", "@babel/traverse@^7.17.0", "@babel/traverse@^7.7.2": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.0.tgz#3143e5066796408ccc880a33ecd3184f3e75cd30" - integrity sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.0" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.0" - "@babel/types" "^7.17.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.17.10", "@babel/traverse@^7.17.3", "@babel/traverse@^7.17.9": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.10.tgz#1ee1a5ac39f4eac844e6cf855b35520e5eb6f8b5" - integrity sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.10" - "@babel/types" "^7.17.10" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" - integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" - -"@babel/types@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.10.tgz#d35d7b4467e439fcf06d195f8100e0fea7fc82c4" - integrity sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@esbuild/android-arm@0.15.12": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.12.tgz#e548b10a5e55b9e10537a049ebf0bc72c453b769" - integrity sha512-IC7TqIqiyE0MmvAhWkl/8AEzpOtbhRNDo7aph47We1NbE5w2bt/Q+giAhe0YYeVpYnIhGMcuZY92qDK6dQauvA== - -"@esbuild/linux-loong64@0.15.12": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.12.tgz#475b33a2631a3d8ca8aa95ee127f9a61d95bf9c1" - integrity sha512-tZEowDjvU7O7I04GYvWQOS4yyP9E/7YlsB0jjw1Ycukgr2ycEzKyIk5tms5WnLBymaewc6VmRKnn5IJWgK4eFw== - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" - integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - slash "^3.0.0" - -"@jest/core@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" - integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/reporters" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - ci-info "^3.2.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-changed-files "^29.5.0" - jest-config "^29.5.0" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-resolve-dependencies "^29.5.0" - jest-runner "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - jest-watcher "^29.5.0" - micromatch "^4.0.4" - pretty-format "^29.5.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" - integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== - dependencies: - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-mock "^29.5.0" - -"@jest/expect-utils@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.1.tgz#c1a84ee66caaef537f351dd82f7c63d559cf78d5" - integrity sha512-Tw5kUUOKmXGQDmQ9TSgTraFFS7HMC1HG/B7y0AN2G2UzjdAXz9BzK2rmNpCSDl7g7y0Gf/VLBm//blonvhtOTQ== - dependencies: - jest-get-type "^29.0.0" - -"@jest/expect-utils@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" - integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== - dependencies: - jest-get-type "^29.4.3" - -"@jest/expect@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" - integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== - dependencies: - expect "^29.5.0" - jest-snapshot "^29.5.0" - -"@jest/fake-timers@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" - integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== - dependencies: - "@jest/types" "^29.5.0" - "@sinonjs/fake-timers" "^10.0.2" - "@types/node" "*" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" - jest-util "^29.5.0" - -"@jest/globals@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" - integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/types" "^29.5.0" - jest-mock "^29.5.0" - -"@jest/reporters@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" - integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" - "@types/node" "*" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.1.3" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - jest-worker "^29.5.0" - slash "^3.0.0" - string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" - -"@jest/schemas@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" - integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== - dependencies: - "@sinclair/typebox" "^0.24.1" - -"@jest/schemas@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" - integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== - dependencies: - "@sinclair/typebox" "^0.25.16" - -"@jest/source-map@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" - integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== - dependencies: - "@jridgewell/trace-mapping" "^0.3.15" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/test-result@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" - integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" - integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== - dependencies: - "@jest/test-result" "^29.5.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - slash "^3.0.0" - -"@jest/transform@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" - integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== - dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^2.0.0" - fast-json-stable-stringify "^2.1.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-regex-util "^29.4.3" - jest-util "^29.5.0" - micromatch "^4.0.4" - pirates "^4.0.4" - slash "^3.0.0" - write-file-atomic "^4.0.2" - -"@jest/types@29.5.0", "@jest/types@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" - integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== - dependencies: - "@jest/schemas" "^29.4.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.1.tgz#1985650acf137bdb81710ff39a4689ec071dd86a" - integrity sha512-ft01rxzVsbh9qZPJ6EFgAIj3PT9FCRfBF9Xljo2/33VDOUjLZr0ZJ2oKANqh9S/K0/GERCsHDAQlBwj7RxA+9g== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1" - integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" - integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== - -"@jridgewell/set-array@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.0.tgz#1179863356ac8fbea64a5a4bcde93a4871012c01" - integrity sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.11" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" - integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== - -"@jridgewell/trace-mapping@0.3.9", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" - integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.12": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.15": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@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" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@sinclair/typebox@^0.24.1": - version "0.24.19" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" - integrity sha512-gHJu8cdYTD5p4UqmQHrxaWrtb/jkH5imLXzuBypWhKzNkW0qfmgz+w1xaJccWVuJta1YYUdlDiPHXRTR4Ku0MQ== - -"@sinclair/typebox@^0.25.16": - version "0.25.21" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" - integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== - -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" - integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== - dependencies: - "@sinonjs/commons" "^2.0.0" - -"@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== - -"@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== - -"@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== - -"@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== - -"@types/babel__core@^7.1.14": - version "7.1.18" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.18.tgz#1a29abcc411a9c05e2094c98f9a1b7da6cdf49f8" - integrity sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" - integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== - dependencies: - "@babel/types" "^7.3.0" - -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@^4.17.18": - version "4.17.28" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" - integrity sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express-serve-static-core@^4.17.33": - version "4.17.33" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz#de35d30a9d637dc1450ad18dd583d75d5733d543" - integrity sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express@*": - version "4.17.13" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" - integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/express@4.17.17": - version "4.17.17" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.17.tgz#01d5437f6ef9cfa8668e616e13c2f2ac9a491ae4" - integrity sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.33" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/graceful-fs@^4.1.3": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.0.tgz#337b90bbcfe42158f39c2fb5619ad044bbb518ac" - integrity sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - -"@types/mime@^1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== - -"@types/multer@1.4.7": - version "1.4.7" - resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.7.tgz#89cf03547c28c7bbcc726f029e2a76a7232cc79e" - integrity sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA== - dependencies: - "@types/express" "*" - -"@types/node@*": - version "17.0.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.17.tgz#a8ddf6e0c2341718d74ee3dc413a13a042c45a0c" - integrity sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw== - -"@types/node@18.15.11": - version "18.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== - -"@types/prettier@^2.1.5": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" - integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/serve-static@*": - version "1.13.10" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" - integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== - dependencies: - "@types/mime" "^1" - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== - -"@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== - -"@types/yargs@^17.0.8": - version "17.0.10" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" - integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== - dependencies: - "@types/yargs-parser" "*" - -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" - -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - -acorn@^8.4.1: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "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" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== - -anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -append-field@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56" - integrity sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw== - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -axios@1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.5.tgz#e07209b39a0d11848e3e341fa087acd71dadc542" - integrity sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -babel-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" - integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== - dependencies: - "@jest/transform" "^29.5.0" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.5.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - slash "^3.0.0" - -babel-plugin-istanbul@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a" - integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" - "@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== - 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-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@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-preset-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2" - integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== - dependencies: - babel-plugin-jest-hoist "^29.5.0" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - -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== - 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== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browserslist@^4.17.5: - version "4.19.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" - integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== - dependencies: - caniuse-lite "^1.0.30001286" - electron-to-chromium "^1.4.17" - escalade "^3.1.1" - node-releases "^2.0.1" - picocolors "^1.0.0" - -browserslist@^4.20.2: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== - dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" - escalade "^3.1.1" - node-releases "^2.0.3" - picocolors "^1.0.0" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -bundle-require@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-3.1.2.tgz#1374a7bdcb8b330a7ccc862ccbf7c137cc43ad27" - integrity sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA== - dependencies: - load-tsconfig "^0.2.0" - -busboy@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -cac@^6.7.12: - version "6.7.14" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" - integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== - -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001286: - version "1.0.30001312" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f" - integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ== - -caniuse-lite@^1.0.30001332: - version "1.0.30001335" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz#899254a0b70579e5a957c32dced79f0727c61f2a" - integrity sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w== - -chalk@^2.0.0: - 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" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -chokidar@^3.5.1: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -ci-info@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" - integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== - -cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== - -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" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - 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 sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -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== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.1.0, debug@^4.1.1: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -debug@^4.3.1: - 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" - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - -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= - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" - integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== - -diff-sequences@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" - integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.4.118: - version "1.4.131" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.131.tgz#ca42d22eac0fe545860fbc636a6f4a7190ba70a9" - integrity sha512-oi3YPmaP87hiHn0c4ePB67tXaF+ldGhxvZnT19tW9zX6/Ej+pLN0Afja5rQ6S+TND7I9EuwQTT8JYn1k7R7rrw== - -electron-to-chromium@^1.4.17: - version "1.4.68" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.68.tgz#d79447b6bd1bec9183f166bb33d4bef0d5e4e568" - integrity sha512-cId+QwWrV8R1UawO6b9BR1hnkJ4EJPCPAr4h315vliHUtVUJDk39Sg1PMNnaWKfj5x+93ssjeJ9LKL6r8LaMiA== - -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -esbuild-android-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.12.tgz#5e8151d5f0a748c71a7fbea8cee844ccf008e6fc" - integrity sha512-MJKXwvPY9g0rGps0+U65HlTsM1wUs9lbjt5CU19RESqycGFDRijMDQsh68MtbzkqWSRdEtiKS1mtPzKneaAI0Q== - -esbuild-android-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.12.tgz#5ee72a6baa444bc96ffcb472a3ba4aba2cc80666" - integrity sha512-Hc9SEcZbIMhhLcvhr1DH+lrrec9SFTiRzfJ7EGSBZiiw994gfkVV6vG0sLWqQQ6DD7V4+OggB+Hn0IRUdDUqvA== - -esbuild-darwin-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.12.tgz#70047007e093fa1b3ba7ef86f9b3fa63db51fe25" - integrity sha512-qkmqrTVYPFiePt5qFjP8w/S+GIUMbt6k8qmiPraECUWfPptaPJUGkCKrWEfYFRWB7bY23FV95rhvPyh/KARP8Q== - -esbuild-darwin-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.12.tgz#41c951f23d9a70539bcca552bae6e5196696ae04" - integrity sha512-z4zPX02tQ41kcXMyN3c/GfZpIjKoI/BzHrdKUwhC/Ki5BAhWv59A9M8H+iqaRbwpzYrYidTybBwiZAIWCLJAkw== - -esbuild-freebsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.12.tgz#a761b5afd12bbedb7d56c612e9cfa4d2711f33f0" - integrity sha512-XFL7gKMCKXLDiAiBjhLG0XECliXaRLTZh6hsyzqUqPUf/PY4C6EJDTKIeqqPKXaVJ8+fzNek88285krSz1QECw== - -esbuild-freebsd-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.12.tgz#6b0839d4d58deabc6cbd96276eb8cbf94f7f335e" - integrity sha512-jwEIu5UCUk6TjiG1X+KQnCGISI+ILnXzIzt9yDVrhjug2fkYzlLbl0K43q96Q3KB66v6N1UFF0r5Ks4Xo7i72g== - -esbuild-linux-32@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.12.tgz#bd50bfe22514d434d97d5150977496e2631345b4" - integrity sha512-uSQuSEyF1kVzGzuIr4XM+v7TPKxHjBnLcwv2yPyCz8riV8VUCnO/C4BF3w5dHiVpCd5Z1cebBtZJNlC4anWpwA== - -esbuild-linux-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.12.tgz#074bb2b194bf658245f8490f29c01ffcdfa8c931" - integrity sha512-QcgCKb7zfJxqT9o5z9ZUeGH1k8N6iX1Y7VNsEi5F9+HzN1OIx7ESxtQXDN9jbeUSPiRH1n9cw6gFT3H4qbdvcA== - -esbuild-linux-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.12.tgz#3bf789c4396dc032875a122988efd6f3733f28f5" - integrity sha512-HtNq5xm8fUpZKwWKS2/YGwSfTF+339L4aIA8yphNKYJckd5hVdhfdl6GM2P3HwLSCORS++++7++//ApEwXEuAQ== - -esbuild-linux-arm@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.12.tgz#b91b5a8d470053f6c2c9c8a5e67ec10a71fe4a67" - integrity sha512-Wf7T0aNylGcLu7hBnzMvsTfEXdEdJY/hY3u36Vla21aY66xR0MS5I1Hw8nVquXjTN0A6fk/vnr32tkC/C2lb0A== - -esbuild-linux-mips64le@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.12.tgz#2fb54099ada3c950a7536dfcba46172c61e580e2" - integrity sha512-Qol3+AvivngUZkTVFgLpb0H6DT+N5/zM3V1YgTkryPYFeUvuT5JFNDR3ZiS6LxhyF8EE+fiNtzwlPqMDqVcc6A== - -esbuild-linux-ppc64le@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.12.tgz#9e3b8c09825fb27886249dfb3142a750df29a1b7" - integrity sha512-4D8qUCo+CFKaR0cGXtGyVsOI7w7k93Qxb3KFXWr75An0DHamYzq8lt7TNZKoOq/Gh8c40/aKaxvcZnTgQ0TJNg== - -esbuild-linux-riscv64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.12.tgz#923d0f5b6e12ee0d1fe116b08e4ae4478fe40693" - integrity sha512-G9w6NcuuCI6TUUxe6ka0enjZHDnSVK8bO+1qDhMOCtl7Tr78CcZilJj8SGLN00zO5iIlwNRZKHjdMpfFgNn1VA== - -esbuild-linux-s390x@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.12.tgz#3b1620220482b96266a0c6d9d471d451a1eab86f" - integrity sha512-Lt6BDnuXbXeqSlVuuUM5z18GkJAZf3ERskGZbAWjrQoi9xbEIsj/hEzVnSAFLtkfLuy2DE4RwTcX02tZFunXww== - -esbuild-netbsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.12.tgz#276730f80da646859b1af5a740e7802d8cd73e42" - integrity sha512-jlUxCiHO1dsqoURZDQts+HK100o0hXfi4t54MNRMCAqKGAV33JCVvMplLAa2FwviSojT/5ZG5HUfG3gstwAG8w== - -esbuild-openbsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.12.tgz#bd0eea1dd2ca0722ed489d88c26714034429f8ae" - integrity sha512-1o1uAfRTMIWNOmpf8v7iudND0L6zRBYSH45sofCZywrcf7NcZA+c7aFsS1YryU+yN7aRppTqdUK1PgbZVaB1Dw== - -esbuild-sunos-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.12.tgz#5e56bf9eef3b2d92360d6d29dcde7722acbecc9e" - integrity sha512-nkl251DpoWoBO9Eq9aFdoIt2yYmp4I3kvQjba3jFKlMXuqQ9A4q+JaqdkCouG3DHgAGnzshzaGu6xofGcXyPXg== - -esbuild-windows-32@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.12.tgz#a4f1a301c1a2fa7701fcd4b91ef9d2620cf293d0" - integrity sha512-WlGeBZHgPC00O08luIp5B2SP4cNCp/PcS+3Pcg31kdcJPopHxLkdCXtadLU9J82LCfw4TVls21A6lilQ9mzHrw== - -esbuild-windows-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.12.tgz#bc2b467541744d653be4fe64eaa9b0dbbf8e07f6" - integrity sha512-VActO3WnWZSN//xjSfbiGOSyC+wkZtI8I4KlgrTo5oHJM6z3MZZBCuFaZHd8hzf/W9KPhF0lY8OqlmWC9HO5AA== - -esbuild-windows-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.12.tgz#9a7266404334a86be800957eaee9aef94c3df328" - integrity sha512-Of3MIacva1OK/m4zCNIvBfz8VVROBmQT+gRX6pFTLPngFYcj6TFH/12VveAqq1k9VB2l28EoVMNMUCcmsfwyuA== - -esbuild@^0.15.1: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.12.tgz#6c8e22d6d3b7430d165c33848298d3fc9a1f251c" - integrity sha512-PcT+/wyDqJQsRVhaE9uX/Oq4XLrFh0ce/bs2TJh4CSaw9xuvI+xFrH2nAYOADbhQjUgAhNWC5LKoUsakm4dxng== - optionalDependencies: - "@esbuild/android-arm" "0.15.12" - "@esbuild/linux-loong64" "0.15.12" - esbuild-android-64 "0.15.12" - esbuild-android-arm64 "0.15.12" - esbuild-darwin-64 "0.15.12" - esbuild-darwin-arm64 "0.15.12" - esbuild-freebsd-64 "0.15.12" - esbuild-freebsd-arm64 "0.15.12" - esbuild-linux-32 "0.15.12" - esbuild-linux-64 "0.15.12" - esbuild-linux-arm "0.15.12" - esbuild-linux-arm64 "0.15.12" - esbuild-linux-mips64le "0.15.12" - esbuild-linux-ppc64le "0.15.12" - esbuild-linux-riscv64 "0.15.12" - esbuild-linux-s390x "0.15.12" - esbuild-netbsd-64 "0.15.12" - esbuild-openbsd-64 "0.15.12" - esbuild-sunos-64 "0.15.12" - esbuild-windows-32 "0.15.12" - esbuild-windows-64 "0.15.12" - esbuild-windows-arm64 "0.15.12" - -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-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -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 sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expect@^29.0.0: - version "29.0.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.1.tgz#a2fa64a59cffe4b4007877e730bc82be3d1742bb" - integrity sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg== - dependencies: - "@jest/expect-utils" "^29.0.1" - jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.1" - jest-message-util "^29.0.1" - jest-util "^29.0.1" - -expect@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" - integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== - dependencies: - "@jest/expect-utils" "^29.5.0" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - -express@4.18.2: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - 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-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -form-data@4.0.0, form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "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.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -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-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.0.0.tgz#034ab2e93644ba702e769c3e0558143d3fbd1612" - integrity sha512-zmp9ZDC6NpDNLujV2W2n+3lH+BafIVZ4/ct+Yj3BMZTH/+bgm/eVjHzeFLwxJrrIGgjjS2eiQLlpurHsNlEAtQ== - dependencies: - fs.realpath "^1.0.0" - minimatch "^9.0.0" - minipass "^5.0.0" - path-scurry "^1.6.4" - -glob@^7.1.3, glob@^7.1.4: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.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== - -globby@^11.0.3: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -graceful-fs@^4.2.9: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -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.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - -import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== - -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" - integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.1.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" - integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== - dependencies: - execa "^5.0.0" - p-limit "^3.1.0" - -jest-circus@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.5.0.tgz#b5926989449e75bff0d59944bae083c9d7fb7317" - integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^0.7.0" - is-generator-fn "^2.0.0" - jest-each "^29.5.0" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - p-limit "^3.1.0" - pretty-format "^29.5.0" - pure-rand "^6.0.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-cli@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" - integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== - dependencies: - "@jest/core" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - import-local "^3.0.2" - jest-config "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - prompts "^2.0.1" - yargs "^17.3.1" - -jest-config@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" - integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== - dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.5.0" - "@jest/types" "^29.5.0" - babel-jest "^29.5.0" - chalk "^4.0.0" - ci-info "^3.2.0" - deepmerge "^4.2.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-circus "^29.5.0" - jest-environment-node "^29.5.0" - jest-get-type "^29.4.3" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-runner "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - micromatch "^4.0.4" - parse-json "^5.2.0" - pretty-format "^29.5.0" - slash "^3.0.0" - strip-json-comments "^3.1.1" - -jest-diff@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.1.tgz#d14e900a38ee4798d42feaaf0c61cb5b98e4c028" - integrity sha512-l8PYeq2VhcdxG9tl5cU78ClAlg/N7RtVSp0v3MlXURR0Y99i6eFnegmasOandyTmO6uEdo20+FByAjBFEO9nuw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.0.0" - jest-get-type "^29.0.0" - pretty-format "^29.0.1" - -jest-diff@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" - integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.4.3" - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-docblock@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" - integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== - dependencies: - detect-newline "^3.0.0" - -jest-each@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.5.0.tgz#fc6e7014f83eac68e22b7195598de8554c2e5c06" - integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== - dependencies: - "@jest/types" "^29.5.0" - chalk "^4.0.0" - jest-get-type "^29.4.3" - jest-util "^29.5.0" - pretty-format "^29.5.0" - -jest-environment-node@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" - integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-mock "^29.5.0" - jest-util "^29.5.0" - -jest-get-type@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" - integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== - -jest-get-type@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" - integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== - -jest-haste-map@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.5.0.tgz#69bd67dc9012d6e2723f20a945099e972b2e94de" - integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== - dependencies: - "@jest/types" "^29.5.0" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^29.4.3" - jest-util "^29.5.0" - jest-worker "^29.5.0" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz#cf4bdea9615c72bac4a3a7ba7e7930f9c0610c8c" - integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== - dependencies: - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-matcher-utils@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.1.tgz#eaa92dd5405c2df9d31d45ec4486361d219de3e9" - integrity sha512-/e6UbCDmprRQFnl7+uBKqn4G22c/OmwriE5KCMVqxhElKCQUDcFnq5XM9iJeKtzy4DUjxT27y9VHmKPD8BQPaw== - dependencies: - chalk "^4.0.0" - jest-diff "^29.0.1" - jest-get-type "^29.0.0" - pretty-format "^29.0.1" - -jest-matcher-utils@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" - integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== - dependencies: - chalk "^4.0.0" - jest-diff "^29.5.0" - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-message-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.1.tgz#85c4b5b90296c228da158e168eaa5b079f2ab879" - integrity sha512-wRMAQt3HrLpxSubdnzOo68QoTfQ+NLXFzU0Heb18ZUzO2S9GgaXNEdQ4rpd0fI9dq2NXkpCk1IUWSqzYKji64A== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.1" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.0.1" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-message-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" - integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.5.0" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.5.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" - integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-util "^29.5.0" - -jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== - -jest-regex-util@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" - integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== - -jest-resolve-dependencies@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz#f0ea29955996f49788bf70996052aa98e7befee4" - integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== - dependencies: - jest-regex-util "^29.4.3" - jest-snapshot "^29.5.0" - -jest-resolve@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" - integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== - dependencies: - chalk "^4.0.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-pnp-resolver "^1.2.2" - jest-util "^29.5.0" - jest-validate "^29.5.0" - resolve "^1.20.0" - resolve.exports "^2.0.0" - slash "^3.0.0" - -jest-runner@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" - integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/environment" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.13.1" - graceful-fs "^4.2.9" - jest-docblock "^29.4.3" - jest-environment-node "^29.5.0" - jest-haste-map "^29.5.0" - jest-leak-detector "^29.5.0" - jest-message-util "^29.5.0" - jest-resolve "^29.5.0" - jest-runtime "^29.5.0" - jest-util "^29.5.0" - jest-watcher "^29.5.0" - jest-worker "^29.5.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" - integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/globals" "^29.5.0" - "@jest/source-map" "^29.4.3" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-snapshot@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" - integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== - dependencies: - "@babel/core" "^7.11.6" - "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/babel__traverse" "^7.0.6" - "@types/prettier" "^2.1.5" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^29.5.0" - graceful-fs "^4.2.9" - jest-diff "^29.5.0" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - natural-compare "^1.4.0" - pretty-format "^29.5.0" - semver "^7.3.5" - -jest-util@^29.0.0: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a" - integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ== - dependencies: - "@jest/types" "^29.0.2" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.1.tgz#f854a4a8877c7817316c4afbc2a851ceb2e71598" - integrity sha512-GIWkgNfkeA9d84rORDHPGGTFBrRD13A38QVSKE0bVrGSnoR1KDn8Kqz+0yI5kezMgbT/7zrWaruWP1Kbghlb2A== - dependencies: - "@jest/types" "^29.0.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" - integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-validate@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" - integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== - dependencies: - "@jest/types" "^29.5.0" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^29.4.3" - leven "^3.1.0" - pretty-format "^29.5.0" - -jest-watcher@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" - integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== - dependencies: - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.5.0" - string-length "^4.0.1" - -jest-worker@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" - integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== - dependencies: - "@types/node" "*" - jest-util "^29.5.0" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" - integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== - dependencies: - "@jest/core" "^29.5.0" - "@jest/types" "^29.5.0" - import-local "^3.0.2" - jest-cli "^29.5.0" - -joycon@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" - integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - 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== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json5@^2.1.2, json5@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" - integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== - -json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -lilconfig@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" - integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -load-tsconfig@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.3.tgz#08af3e7744943caab0c75f8af7f1703639c3ef1f" - integrity sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru-cache@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.0.tgz#daece36a9fc332e93f8e75f3fcfd17900253567c" - integrity sha512-9AEKXzvOZc4BMacFnYiTOlDH/197LNnQIK9wZ6iMB5NXPzuv4bWR/Msv7iUMplkiMQ1qQL+KSv/JF1mZAB5Lrg== - -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-error@1.x, make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -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-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: - 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== - dependencies: - mime-db "1.51.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4: - version "3.1.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.1.tgz#879ad447200773912898b46cd516a7abbb5e50b0" - integrity sha512-reLxBcKUPNBnc/sVtAbxgRVFSegoGeLaSjmphNhcwcolhYLRgtJscn5mRl6YRZNQv40Y7P6JM2YhSIsbL9OB5A== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" - integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== - 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== - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - -mkdirp@^0.5.4: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -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.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== - -multer@1.4.5-lts.1: - version "1.4.5-lts.1" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.5-lts.1.tgz#803e24ad1984f58edffbc79f56e305aec5cfd1ac" - integrity sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ== - dependencies: - append-field "^1.0.0" - busboy "^1.0.0" - concat-stream "^1.5.2" - mkdirp "^0.5.4" - object-assign "^4.1.1" - type-is "^1.6.4" - xtend "^4.0.0" - -mz@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-releases@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" - integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== - -node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -object-assign@^4.0.1, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-inspect@^1.9.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== - -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parse-json@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-scurry@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.4.tgz#020a9449e5382a4acb684f9c7e1283bc5695de66" - integrity sha512-Qp/9IHkdNiXJ3/Kon++At2nVpnhRiPq/aSvQN+H3U1WZbvNRK0RIQK/o4HMqPoXjpuGJUEWpHSs6Mnjxqh3TQg== - dependencies: - lru-cache "^9.0.0" - minipass "^5.0.0" - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pirates@^4.0.1, pirates@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -postcss-load-config@^3.0.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" - integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== - dependencies: - lilconfig "^2.0.5" - yaml "^1.10.2" - -pretty-format@^29.0.0, pretty-format@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.1.tgz#2f8077114cdac92a59b464292972a106410c7ad0" - integrity sha512-iTHy3QZMzuL484mSTYbQIM1AHhEQsH8mXWS2/vd2yFBYnG3EBqGiMONo28PlPgrW7P/8s/1ISv+y7WH306l8cw== - dependencies: - "@jest/schemas" "^29.0.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -pretty-format@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" - integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== - dependencies: - "@jest/schemas" "^29.4.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -pure-rand@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.0.tgz#701996ceefa253507923a0e864c17ab421c04a7c" - integrity sha512-rLSBxJjP+4DQOgcJAx6RZHT2he2pkhQdSnofG5VWyVl6GRq/K02ISOuOLcsMOrtKDIJb8JN2zm3FFzWNbezdPw== - -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -react-is@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" - integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== - -readable-stream@^2.2.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve.exports@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" - integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== - -resolve@^1.20.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.0.tgz#5bda14e410d7e4dd522154891395802ce032c2cb" - integrity sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g== - dependencies: - glob "^10.0.0" - -rollup@^2.74.1: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== - optionalDependencies: - fsevents "~2.3.2" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@7.x: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.3.5: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.3, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@0.8.0-beta.0: - version "0.8.0-beta.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" - integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== - dependencies: - whatwg-url "^7.0.0" - -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -sucrase@^3.20.3: - version "3.28.0" - resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.28.0.tgz#7fd8b3118d2155fcdf291088ab77fa6eefd63c4c" - integrity sha512-TK9600YInjuiIhVM3729rH4ZKPOsGeyXUwY+Ugu9eilNbdTFyHr6XcAGYbRVZPDgWj6tgI7bx95aaJjHnbffag== - dependencies: - commander "^4.0.0" - glob "7.1.6" - lines-and-columns "^1.1.6" - mz "^2.7.0" - pirates "^4.0.1" - ts-interface-checker "^0.1.9" - -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" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== - dependencies: - thenify ">= 3.1.0 < 4" - -"thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - -tmpl@1.0.5: - version "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 sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -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" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - -ts-interface-checker@^0.1.9: - version "0.1.13" - resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" - integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== - -ts-jest@29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.0.tgz#4a9db4104a49b76d2b368ea775b6c9535c603891" - integrity sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA== - dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^29.0.0" - json5 "^2.2.3" - lodash.memoize "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "^21.0.1" - -ts-node@10.9.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tsup@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/tsup/-/tsup-6.3.0.tgz#aa270a788e54248d4a5541f722c8763bca778e3c" - integrity sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw== - dependencies: - bundle-require "^3.1.0" - cac "^6.7.12" - chokidar "^3.5.1" - debug "^4.3.1" - esbuild "^0.15.1" - execa "^5.0.0" - globby "^11.0.3" - joycon "^3.0.1" - postcss-load-config "^3.0.1" - resolve-from "^5.0.0" - rollup "^2.74.1" - source-map "0.8.0-beta.0" - sucrase "^3.20.3" - tree-kill "^1.2.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-is@^1.6.4, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -typescript@5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -v8-to-istanbul@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" - integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -walker@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@^21.0.0, yargs-parser@^21.0.1: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== - -yargs@^17.3.1: - version "17.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" - integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.0.0" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zod@3.21.4: - version "3.21.4" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" - integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==