├── .github ├── FUNDING.yml ├── stale.yml └── workflows │ ├── ci.yml │ └── publish.yml ├── .gitignore ├── .npmignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── SECURITY.md ├── docs └── logo.svg ├── examples ├── define-types.ts ├── dev.to │ ├── api-key-plugin.ts │ ├── articles.ts │ ├── comments.ts │ ├── example.ts │ ├── followers.ts │ ├── follows.ts │ ├── params.ts │ └── users.ts ├── jsonplaceholder.ts └── types-from-definition.ts ├── jest.config.ts ├── package.json ├── renovate.json ├── src ├── api.test.ts ├── api.ts ├── index.ts ├── plugins │ ├── form-data.plugin.ts │ ├── form-data.utils.ts │ ├── form-url.plugin.ts │ ├── header.plugin.ts │ ├── index.ts │ ├── zod-validation.plugin.test.ts │ ├── zod-validation.plugin.ts │ ├── zodios-plugins.test.ts │ └── zodios-plugins.ts ├── utils.test.ts ├── utils.ts ├── utils.types.test.ts ├── utils.types.ts ├── zodios-error.ts ├── zodios-error.utils.ts ├── zodios.test.ts ├── zodios.ts └── zodios.types.ts ├── tsconfig.build.json ├── tsconfig.json ├── tsup.config.js ├── website ├── .gitignore ├── README.md ├── babel.config.js ├── docs │ ├── api │ │ ├── _category_.json │ │ ├── api-definition.md │ │ ├── examples.md │ │ ├── helpers.md │ │ ├── openapi.md │ │ └── typescript.md │ ├── client │ │ ├── _category_.json │ │ ├── client.md │ │ ├── error.md │ │ ├── plugins.md │ │ ├── react.md │ │ └── solid.md │ ├── ecosystem.md │ ├── installation.md │ ├── intro.md │ ├── server │ │ ├── _category_.json │ │ ├── express-app.md │ │ ├── express-context.md │ │ ├── express-router.md │ │ └── next.md │ └── sponsors.md ├── docusaurus.config.js ├── package.json ├── sidebars.js ├── src │ ├── components │ │ └── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.module.css │ │ ├── index.tsx │ │ └── markdown-page.md ├── static │ ├── .nojekyll │ ├── CNAME │ ├── img │ │ ├── favicon.ico │ │ ├── logo.svg │ │ ├── openapi-to-zodios.png │ │ ├── openapi.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ ├── undraw_docusaurus_tree.svg │ │ └── zodios-social.png │ └── video │ │ └── zodios.mp4 ├── tsconfig.json └── yarn.lock └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [ecyrbe] 4 | custom: ["https://www.paypal.me/ecyrbe"] 5 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | daysUntilStale: 30 2 | # Number of days of inactivity before a stale issue is closed 3 | daysUntilClose: 7 4 | # Issues with these labels will never be considered stale 5 | exemptLabels: 6 | - pinned 7 | - security 8 | # Label to use when marking an issue as stale 9 | staleLabel: wontfix 10 | # Comment to post when marking an issue as stale. Set to `false` to disable 11 | markComment: > 12 | This issue has been automatically marked as stale because it has not had 13 | recent activity. It will be closed if no further activity occurs. Thank you 14 | for your contributions. 15 | # Comment to post when closing a stale issue. Set to `false` to disable 16 | closeComment: false 17 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: CI 5 | 6 | on: 7 | push: 8 | branches: [main] 9 | paths: 10 | - src/** 11 | - yarn.lock 12 | - package.json 13 | - tsconfig.json 14 | pull_request: 15 | branches: [main] 16 | paths: 17 | - src/** 18 | - yarn.lock 19 | - package.json 20 | - tsconfig.json 21 | 22 | jobs: 23 | build: 24 | name: Build 25 | runs-on: ubuntu-latest 26 | strategy: 27 | matrix: 28 | node-version: [14.x, 16.x, 18.x] 29 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 30 | 31 | steps: 32 | - uses: actions/checkout@v4 33 | - name: Use Node.js ${{ matrix.node-version }} 34 | uses: actions/setup-node@v4 35 | with: 36 | node-version: ${{ matrix.node-version }} 37 | cache: "yarn" 38 | - run: yarn install --ignore-engines 39 | - run: yarn build 40 | - run: yarn test 41 | analyze: 42 | name: Analyze 43 | runs-on: ubuntu-latest 44 | permissions: 45 | actions: read 46 | contents: read 47 | security-events: write 48 | strategy: 49 | fail-fast: false 50 | matrix: 51 | language: ["javascript"] 52 | steps: 53 | - name: Checkout repository 54 | uses: actions/checkout@v4 55 | - name: Initialize CodeQL 56 | uses: github/codeql-action/init@v2 57 | with: 58 | languages: ${{ matrix.language }} 59 | - name: Perform CodeQL Analysis 60 | uses: github/codeql-action/analyze@v2 61 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | # publish on npm when there is a new version tag 2 | 3 | name: publish 4 | on: 5 | push: 6 | tags: [v*] 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | node-version: [16.x] 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v4 18 | with: 19 | registry-url: "https://registry.npmjs.org" 20 | node-version: ${{ matrix.node-version }} 21 | cache: "yarn" 22 | - name: install dependencies 23 | run: yarn install 24 | - name: build 25 | run: yarn build 26 | - name: run test 27 | run: yarn test 28 | - name: publish to npm 29 | # only run when tag has no 'rc' in it 30 | if: ${{ !contains(github.ref, 'rc') }} 31 | run: yarn publish --access public 32 | env: 33 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 34 | - name: publish beta to npm 35 | # only run when tag has 'rc' in it 36 | if: ${{ contains(github.ref, 'rc') }} 37 | run: yarn publish --access public --tag beta 38 | env: 39 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 40 | - name: generate changelog 41 | uses: orhun/git-cliff-action@v2 42 | id: cliff 43 | with: 44 | args: --latest --strip footer 45 | env: 46 | OUTPUT: CHANGES.md 47 | - name: save changelog 48 | id: changelog 49 | shell: bash 50 | run: | 51 | changelog=$(cat ${{ steps.cliff.outputs.changelog }}) 52 | changelog="${changelog//'%'/'%25'}" 53 | changelog="${changelog//$'\n'/'%0A'}" 54 | changelog="${changelog//$'\r'/'%0D'}" 55 | echo "changelog=$changelog" >> $GITHUB_OUTPUT 56 | - name: create release 57 | id: release 58 | uses: actions/create-release@v1 59 | env: 60 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 61 | with: 62 | tag_name: ${{ github.ref }} 63 | release_name: Release ${{ github.ref }} 64 | body: ${{ steps.changelog.outputs.changelog }} 65 | draft: false 66 | prerelease: false 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | lib 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | # Developpement directory 108 | .devcontainer 109 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | !/lib 3 | /node_modules 4 | /src 5 | /examples 6 | /website 7 | 8 | # Logs 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | lerna-debug.log* 15 | 16 | # OS 17 | .DS_Store 18 | 19 | # Tests 20 | /coverage 21 | /.nyc_output 22 | 23 | # IDEs and editors 24 | /.idea 25 | .project 26 | .classpath 27 | .c9/ 28 | *.launch 29 | .settings/ 30 | *.sublime-workspace 31 | 32 | # IDE - VSCode 33 | .vscode/* 34 | !.vscode/settings.json 35 | !.vscode/tasks.json 36 | !.vscode/launch.json 37 | !.vscode/extensions.json 38 | 39 | # ENV 40 | .env 41 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 ecyrbe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
3 |
4 |
5 |
6 |
8 | Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express
9 |
10 | Documentation
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
{siteConfig.tagline}
17 | 20 |21 |