fork of hey-api/openapi-ts because I need some additional things

chore: add working local example with fetch client

Lubos f06e11e0 af193f27

+1637 -40
+1 -1
examples/openapi-ts-axios/package.json
··· 1 1 { 2 - "name": "@examples/openapi-ts-axios", 2 + "name": "@example/openapi-ts-axios", 3 3 "private": true, 4 4 "version": "0.0.0", 5 5 "type": "module",
+1 -1
examples/openapi-ts-axios/src/App.tsx
··· 37 37 alt="Hey API logo" 38 38 /> 39 39 </a> 40 - <h1 className="h1">@hey-api/openapi-ts example</h1> 40 + <h1 className="h1">@hey-api/openapi-ts 🤝 Axios</h1> 41 41 </div> 42 42 <div className="flex"> 43 43 <button className="button" onClick={onFetchPet}>
+24
examples/openapi-ts-fetch/.gitignore
··· 1 + # Logs 2 + logs 3 + *.log 4 + npm-debug.log* 5 + yarn-debug.log* 6 + yarn-error.log* 7 + pnpm-debug.log* 8 + lerna-debug.log* 9 + 10 + node_modules 11 + dist 12 + dist-ssr 13 + *.local 14 + 15 + # Editor directories and files 16 + .vscode/* 17 + !.vscode/extensions.json 18 + .idea 19 + .DS_Store 20 + *.suo 21 + *.ntvs* 22 + *.njsproj 23 + *.sln 24 + *.sw?
+13
examples/openapi-ts-fetch/index.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + <link rel="icon" type="image/svg+xml" href="/vite.svg" /> 6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 7 + <title>Hey API + Fetch API Demo</title> 8 + </head> 9 + <body> 10 + <div id="root"></div> 11 + <script type="module" src="/src/main.tsx"></script> 12 + </body> 13 + </html>
+10
examples/openapi-ts-fetch/openapi-ts.config.ts
··· 1 + import { defineConfig } from '@hey-api/openapi-ts'; 2 + 3 + export default defineConfig({ 4 + base: 'https://petstore3.swagger.io/api/v3', 5 + format: 'prettier', 6 + input: 7 + 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', 8 + lint: 'eslint', 9 + output: './src/client', 10 + });
+32
examples/openapi-ts-fetch/package.json
··· 1 + { 2 + "name": "@example/openapi-ts-fetch", 3 + "private": true, 4 + "version": "0.0.0", 5 + "type": "module", 6 + "scripts": { 7 + "build": "tsc && vite build", 8 + "dev": "vite", 9 + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 10 + "openapi-ts": "openapi-ts", 11 + "preview": "vite preview" 12 + }, 13 + "dependencies": { 14 + "@hey-api/client-fetch": "workspace:*", 15 + "react": "18.2.0", 16 + "react-dom": "18.2.0" 17 + }, 18 + "devDependencies": { 19 + "@hey-api/openapi-ts": "workspace:*", 20 + "@types/react": "18.2.79", 21 + "@types/react-dom": "18.2.25", 22 + "@typescript-eslint/eslint-plugin": "7.7.1", 23 + "@typescript-eslint/parser": "7.7.1", 24 + "@vitejs/plugin-react": "4.2.1", 25 + "eslint": "8.57.0", 26 + "eslint-plugin-react-hooks": "4.6.0", 27 + "eslint-plugin-react-refresh": "0.4.6", 28 + "prettier": "3.2.5", 29 + "typescript": "5.4.5", 30 + "vite": "5.2.10" 31 + } 32 + }
+102
examples/openapi-ts-fetch/src/App.css
··· 1 + :root { 2 + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 + line-height: 1.5; 4 + font-weight: 400; 5 + 6 + color-scheme: light dark; 7 + color: rgba(255, 255, 255, 0.87); 8 + background-color: #242424; 9 + 10 + font-synthesis: none; 11 + text-rendering: optimizeLegibility; 12 + -webkit-font-smoothing: antialiased; 13 + -moz-osx-font-smoothing: grayscale; 14 + } 15 + 16 + .flex { 17 + align-items: center; 18 + display: flex; 19 + padding: 1em 0; 20 + } 21 + 22 + .pet-name { 23 + padding: 0 1em; 24 + } 25 + 26 + .button { 27 + border: 1px solid #444; 28 + } 29 + 30 + #root { 31 + max-width: 1280px; 32 + margin: 0 auto; 33 + padding: 0.5rem 2rem; 34 + } 35 + 36 + body { 37 + margin: 0; 38 + display: flex; 39 + place-items: center; 40 + min-width: 320px; 41 + min-height: 100vh; 42 + } 43 + 44 + .h1 { 45 + font-size: 1.2em; 46 + line-height: 1.1; 47 + } 48 + 49 + .logo { 50 + height: 4em; 51 + will-change: filter; 52 + transition: filter 300ms; 53 + } 54 + .logo:hover { 55 + filter: drop-shadow(0 0 2em #646cffaa); 56 + } 57 + .logo.react:hover { 58 + filter: drop-shadow(0 0 2em #61dafbaa); 59 + } 60 + 61 + @keyframes logo-spin { 62 + from { 63 + transform: rotate(0deg); 64 + } 65 + to { 66 + transform: rotate(360deg); 67 + } 68 + } 69 + 70 + @media (prefers-reduced-motion: no-preference) { 71 + a:nth-of-type(2) .logo { 72 + animation: logo-spin infinite 20s linear; 73 + } 74 + } 75 + 76 + .card { 77 + padding: 2em; 78 + } 79 + 80 + .container { 81 + align-items: center; 82 + display: flex; 83 + grid-gap: 1em; 84 + text-align: center; 85 + } 86 + 87 + .openapi-ts { 88 + color: #444; 89 + } 90 + 91 + @media (prefers-color-scheme: light) { 92 + :root { 93 + color: #213547; 94 + background-color: #ffffff; 95 + } 96 + a:hover { 97 + color: #747bff; 98 + } 99 + button { 100 + background-color: #f9f9f9; 101 + } 102 + }
+56
examples/openapi-ts-fetch/src/App.tsx
··· 1 + import './App.css'; 2 + 3 + import { OpenAPI } from '@hey-api/client-fetch'; 4 + import { useState } from 'react'; 5 + 6 + import { $Pet } from './client/schemas.gen'; 7 + import { PetService } from './client/services.gen'; 8 + 9 + OpenAPI.BASE = 'https://petstore3.swagger.io/api/v3'; 10 + 11 + // OpenAPI.interceptors.response.use((response) => { 12 + // if (response.status === 200) { 13 + // console.log(`request to ${response.url} was successful`); 14 + // } 15 + // return response; 16 + // }); 17 + 18 + function App() { 19 + const [pet, setPet] = 20 + useState<Awaited<ReturnType<typeof PetService.getPetById>>>(); 21 + 22 + const onFetchPet = async () => { 23 + const pet = await PetService.getPetById({ 24 + // random id 1-10 25 + petId: Math.floor(Math.random() * (10 - 1 + 1) + 1), 26 + }); 27 + setPet(pet); 28 + }; 29 + 30 + return ( 31 + <> 32 + <div className="container"> 33 + <a href="https://heyapi.vercel.app/" target="_blank"> 34 + <img 35 + src="https://heyapi.vercel.app/logo.png" 36 + className="logo vanilla" 37 + alt="Hey API logo" 38 + /> 39 + </a> 40 + <h1 className="h1">@hey-api/openapi-ts 🤝 Fetch API</h1> 41 + </div> 42 + <div className="flex"> 43 + <button className="button" onClick={onFetchPet}> 44 + Fetch random pet 45 + </button> 46 + <span className="pet-name">Fetched pet's name: {pet?.name}</span> 47 + </div> 48 + <div className="openapi-ts"> 49 + <code>{"import { $Pet } from './client/schemas.gen'"}</code> 50 + <pre>{JSON.stringify($Pet, null, 2)}</pre> 51 + </div> 52 + </> 53 + ); 54 + } 55 + 56 + export default App;
+4
examples/openapi-ts-fetch/src/client/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './schemas.gen'; 3 + export * from './services.gen'; 4 + export * from './types.gen';
+244
examples/openapi-ts-fetch/src/client/schemas.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export const $Order = { 4 + properties: { 5 + complete: { 6 + type: 'boolean', 7 + }, 8 + id: { 9 + example: 10, 10 + format: 'int64', 11 + type: 'integer', 12 + }, 13 + petId: { 14 + example: 198772, 15 + format: 'int64', 16 + type: 'integer', 17 + }, 18 + quantity: { 19 + example: 7, 20 + format: 'int32', 21 + type: 'integer', 22 + }, 23 + shipDate: { 24 + format: 'date-time', 25 + type: 'string', 26 + }, 27 + status: { 28 + description: 'Order Status', 29 + enum: ['placed', 'approved', 'delivered'], 30 + example: 'approved', 31 + type: 'string', 32 + }, 33 + }, 34 + type: 'object', 35 + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', 36 + xml: { 37 + name: 'order', 38 + }, 39 + } as const; 40 + 41 + export const $Customer = { 42 + properties: { 43 + address: { 44 + items: { 45 + $ref: '#/components/schemas/Address', 46 + }, 47 + type: 'array', 48 + xml: { 49 + name: 'addresses', 50 + wrapped: true, 51 + }, 52 + }, 53 + id: { 54 + example: 100000, 55 + format: 'int64', 56 + type: 'integer', 57 + }, 58 + username: { 59 + example: 'fehguy', 60 + type: 'string', 61 + }, 62 + }, 63 + type: 'object', 64 + xml: { 65 + name: 'customer', 66 + }, 67 + } as const; 68 + 69 + export const $Address = { 70 + properties: { 71 + city: { 72 + example: 'Palo Alto', 73 + type: 'string', 74 + }, 75 + state: { 76 + example: 'CA', 77 + type: 'string', 78 + }, 79 + street: { 80 + example: '437 Lytton', 81 + type: 'string', 82 + }, 83 + zip: { 84 + example: 94301, 85 + type: 'string', 86 + }, 87 + }, 88 + type: 'object', 89 + xml: { 90 + name: 'address', 91 + }, 92 + } as const; 93 + 94 + export const $Category = { 95 + properties: { 96 + id: { 97 + example: 1, 98 + format: 'int64', 99 + type: 'integer', 100 + }, 101 + name: { 102 + example: 'Dogs', 103 + type: 'string', 104 + }, 105 + }, 106 + type: 'object', 107 + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', 108 + xml: { 109 + name: 'category', 110 + }, 111 + } as const; 112 + 113 + export const $User = { 114 + properties: { 115 + email: { 116 + example: 'john@email.com', 117 + type: 'string', 118 + }, 119 + firstName: { 120 + example: 'John', 121 + type: 'string', 122 + }, 123 + id: { 124 + example: 10, 125 + format: 'int64', 126 + type: 'integer', 127 + }, 128 + lastName: { 129 + example: 'James', 130 + type: 'string', 131 + }, 132 + password: { 133 + example: 12345, 134 + type: 'string', 135 + }, 136 + phone: { 137 + example: 12345, 138 + type: 'string', 139 + }, 140 + userStatus: { 141 + description: 'User Status', 142 + example: 1, 143 + format: 'int32', 144 + type: 'integer', 145 + }, 146 + username: { 147 + example: 'theUser', 148 + type: 'string', 149 + }, 150 + }, 151 + type: 'object', 152 + 'x-swagger-router-model': 'io.swagger.petstore.model.User', 153 + xml: { 154 + name: 'user', 155 + }, 156 + } as const; 157 + 158 + export const $Tag = { 159 + properties: { 160 + id: { 161 + format: 'int64', 162 + type: 'integer', 163 + }, 164 + name: { 165 + type: 'string', 166 + }, 167 + }, 168 + type: 'object', 169 + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', 170 + xml: { 171 + name: 'tag', 172 + }, 173 + } as const; 174 + 175 + export const $Pet = { 176 + properties: { 177 + category: { 178 + $ref: '#/components/schemas/Category', 179 + }, 180 + id: { 181 + example: 10, 182 + format: 'int64', 183 + type: 'integer', 184 + }, 185 + name: { 186 + example: 'doggie', 187 + type: 'string', 188 + }, 189 + photoUrls: { 190 + items: { 191 + type: 'string', 192 + xml: { 193 + name: 'photoUrl', 194 + }, 195 + }, 196 + type: 'array', 197 + xml: { 198 + wrapped: true, 199 + }, 200 + }, 201 + status: { 202 + description: 'pet status in the store', 203 + enum: ['available', 'pending', 'sold'], 204 + type: 'string', 205 + }, 206 + tags: { 207 + items: { 208 + $ref: '#/components/schemas/Tag', 209 + xml: { 210 + name: 'tag', 211 + }, 212 + }, 213 + type: 'array', 214 + xml: { 215 + wrapped: true, 216 + }, 217 + }, 218 + }, 219 + required: ['name', 'photoUrls'], 220 + type: 'object', 221 + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', 222 + xml: { 223 + name: 'pet', 224 + }, 225 + } as const; 226 + 227 + export const $ApiResponse = { 228 + properties: { 229 + code: { 230 + format: 'int32', 231 + type: 'integer', 232 + }, 233 + message: { 234 + type: 'string', 235 + }, 236 + type: { 237 + type: 'string', 238 + }, 239 + }, 240 + type: 'object', 241 + xml: { 242 + name: '##default', 243 + }, 244 + } as const;
+444
examples/openapi-ts-fetch/src/client/services.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { CancelablePromise } from '@hey-api/client-fetch'; 4 + import { OpenAPI } from '@hey-api/client-fetch'; 5 + import { request as __request } from '@hey-api/client-fetch'; 6 + 7 + import type { $OpenApiTs } from './types.gen'; 8 + 9 + export class PetService { 10 + /** 11 + * Add a new pet to the store 12 + * Add a new pet to the store 13 + * @param data The data for the request. 14 + * @param data.requestBody Create a new pet in the store 15 + * @returns Pet Successful operation 16 + * @throws ApiError 17 + */ 18 + public static addPet( 19 + data: $OpenApiTs['/pet']['post']['req'], 20 + ): CancelablePromise<$OpenApiTs['/pet']['post']['res'][200]> { 21 + return __request(OpenAPI, { 22 + body: data.requestBody, 23 + errors: { 24 + 405: 'Invalid input', 25 + }, 26 + mediaType: 'application/json', 27 + method: 'POST', 28 + url: '/pet', 29 + }); 30 + } 31 + 32 + /** 33 + * Update an existing pet 34 + * Update an existing pet by Id 35 + * @param data The data for the request. 36 + * @param data.requestBody Update an existent pet in the store 37 + * @returns Pet Successful operation 38 + * @throws ApiError 39 + */ 40 + public static updatePet( 41 + data: $OpenApiTs['/pet']['put']['req'], 42 + ): CancelablePromise<$OpenApiTs['/pet']['put']['res'][200]> { 43 + return __request(OpenAPI, { 44 + body: data.requestBody, 45 + errors: { 46 + 400: 'Invalid ID supplied', 47 + 404: 'Pet not found', 48 + 405: 'Validation exception', 49 + }, 50 + mediaType: 'application/json', 51 + method: 'PUT', 52 + url: '/pet', 53 + }); 54 + } 55 + 56 + /** 57 + * Finds Pets by status 58 + * Multiple status values can be provided with comma separated strings 59 + * @param data The data for the request. 60 + * @param data.status Status values that need to be considered for filter 61 + * @returns Pet successful operation 62 + * @throws ApiError 63 + */ 64 + public static findPetsByStatus( 65 + data: $OpenApiTs['/pet/findByStatus']['get']['req'] = {}, 66 + ): CancelablePromise<$OpenApiTs['/pet/findByStatus']['get']['res'][200]> { 67 + return __request(OpenAPI, { 68 + errors: { 69 + 400: 'Invalid status value', 70 + }, 71 + method: 'GET', 72 + query: { 73 + status: data.status, 74 + }, 75 + url: '/pet/findByStatus', 76 + }); 77 + } 78 + 79 + /** 80 + * Finds Pets by tags 81 + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 82 + * @param data The data for the request. 83 + * @param data.tags Tags to filter by 84 + * @returns Pet successful operation 85 + * @throws ApiError 86 + */ 87 + public static findPetsByTags( 88 + data: $OpenApiTs['/pet/findByTags']['get']['req'] = {}, 89 + ): CancelablePromise<$OpenApiTs['/pet/findByTags']['get']['res'][200]> { 90 + return __request(OpenAPI, { 91 + errors: { 92 + 400: 'Invalid tag value', 93 + }, 94 + method: 'GET', 95 + query: { 96 + tags: data.tags, 97 + }, 98 + url: '/pet/findByTags', 99 + }); 100 + } 101 + 102 + /** 103 + * Find pet by ID 104 + * Returns a single pet 105 + * @param data The data for the request. 106 + * @param data.petId ID of pet to return 107 + * @returns Pet successful operation 108 + * @throws ApiError 109 + */ 110 + public static getPetById( 111 + data: $OpenApiTs['/pet/{petId}']['get']['req'], 112 + ): CancelablePromise<$OpenApiTs['/pet/{petId}']['get']['res'][200]> { 113 + return __request(OpenAPI, { 114 + errors: { 115 + 400: 'Invalid ID supplied', 116 + 404: 'Pet not found', 117 + }, 118 + method: 'GET', 119 + path: { 120 + petId: data.petId, 121 + }, 122 + url: '/pet/{petId}', 123 + }); 124 + } 125 + 126 + /** 127 + * Updates a pet in the store with form data 128 + * @param data The data for the request. 129 + * @param data.petId ID of pet that needs to be updated 130 + * @param data.name Name of pet that needs to be updated 131 + * @param data.status Status of pet that needs to be updated 132 + * @throws ApiError 133 + */ 134 + public static updatePetWithForm( 135 + data: $OpenApiTs['/pet/{petId}']['post']['req'], 136 + ): CancelablePromise<void> { 137 + return __request(OpenAPI, { 138 + errors: { 139 + 405: 'Invalid input', 140 + }, 141 + method: 'POST', 142 + path: { 143 + petId: data.petId, 144 + }, 145 + query: { 146 + name: data.name, 147 + status: data.status, 148 + }, 149 + url: '/pet/{petId}', 150 + }); 151 + } 152 + 153 + /** 154 + * Deletes a pet 155 + * @param data The data for the request. 156 + * @param data.petId Pet id to delete 157 + * @param data.apiKey 158 + * @throws ApiError 159 + */ 160 + public static deletePet( 161 + data: $OpenApiTs['/pet/{petId}']['delete']['req'], 162 + ): CancelablePromise<void> { 163 + return __request(OpenAPI, { 164 + errors: { 165 + 400: 'Invalid pet value', 166 + }, 167 + headers: { 168 + api_key: data.apiKey, 169 + }, 170 + method: 'DELETE', 171 + path: { 172 + petId: data.petId, 173 + }, 174 + url: '/pet/{petId}', 175 + }); 176 + } 177 + 178 + /** 179 + * uploads an image 180 + * @param data The data for the request. 181 + * @param data.petId ID of pet to update 182 + * @param data.additionalMetadata Additional Metadata 183 + * @param data.requestBody 184 + * @returns ApiResponse successful operation 185 + * @throws ApiError 186 + */ 187 + public static uploadFile( 188 + data: $OpenApiTs['/pet/{petId}/uploadImage']['post']['req'], 189 + ): CancelablePromise< 190 + $OpenApiTs['/pet/{petId}/uploadImage']['post']['res'][200] 191 + > { 192 + return __request(OpenAPI, { 193 + body: data.requestBody, 194 + mediaType: 'application/octet-stream', 195 + method: 'POST', 196 + path: { 197 + petId: data.petId, 198 + }, 199 + query: { 200 + additionalMetadata: data.additionalMetadata, 201 + }, 202 + url: '/pet/{petId}/uploadImage', 203 + }); 204 + } 205 + } 206 + 207 + export class StoreService { 208 + /** 209 + * Returns pet inventories by status 210 + * Returns a map of status codes to quantities 211 + * @returns number successful operation 212 + * @throws ApiError 213 + */ 214 + public static getInventory(): CancelablePromise< 215 + $OpenApiTs['/store/inventory']['get']['res'][200] 216 + > { 217 + return __request(OpenAPI, { 218 + method: 'GET', 219 + url: '/store/inventory', 220 + }); 221 + } 222 + 223 + /** 224 + * Place an order for a pet 225 + * Place a new order in the store 226 + * @param data The data for the request. 227 + * @param data.requestBody 228 + * @returns Order successful operation 229 + * @throws ApiError 230 + */ 231 + public static placeOrder( 232 + data: $OpenApiTs['/store/order']['post']['req'] = {}, 233 + ): CancelablePromise<$OpenApiTs['/store/order']['post']['res'][200]> { 234 + return __request(OpenAPI, { 235 + body: data.requestBody, 236 + errors: { 237 + 405: 'Invalid input', 238 + }, 239 + mediaType: 'application/json', 240 + method: 'POST', 241 + url: '/store/order', 242 + }); 243 + } 244 + 245 + /** 246 + * Find purchase order by ID 247 + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 248 + * @param data The data for the request. 249 + * @param data.orderId ID of order that needs to be fetched 250 + * @returns Order successful operation 251 + * @throws ApiError 252 + */ 253 + public static getOrderById( 254 + data: $OpenApiTs['/store/order/{orderId}']['get']['req'], 255 + ): CancelablePromise< 256 + $OpenApiTs['/store/order/{orderId}']['get']['res'][200] 257 + > { 258 + return __request(OpenAPI, { 259 + errors: { 260 + 400: 'Invalid ID supplied', 261 + 404: 'Order not found', 262 + }, 263 + method: 'GET', 264 + path: { 265 + orderId: data.orderId, 266 + }, 267 + url: '/store/order/{orderId}', 268 + }); 269 + } 270 + 271 + /** 272 + * Delete purchase order by ID 273 + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors 274 + * @param data The data for the request. 275 + * @param data.orderId ID of the order that needs to be deleted 276 + * @throws ApiError 277 + */ 278 + public static deleteOrder( 279 + data: $OpenApiTs['/store/order/{orderId}']['delete']['req'], 280 + ): CancelablePromise<void> { 281 + return __request(OpenAPI, { 282 + errors: { 283 + 400: 'Invalid ID supplied', 284 + 404: 'Order not found', 285 + }, 286 + method: 'DELETE', 287 + path: { 288 + orderId: data.orderId, 289 + }, 290 + url: '/store/order/{orderId}', 291 + }); 292 + } 293 + } 294 + 295 + export class UserService { 296 + /** 297 + * Create user 298 + * This can only be done by the logged in user. 299 + * @param data The data for the request. 300 + * @param data.requestBody Created user object 301 + * @returns User successful operation 302 + * @throws ApiError 303 + */ 304 + public static createUser( 305 + data: $OpenApiTs['/user']['post']['req'] = {}, 306 + ): CancelablePromise<$OpenApiTs['/user']['post']['res'][200]> { 307 + return __request(OpenAPI, { 308 + body: data.requestBody, 309 + mediaType: 'application/json', 310 + method: 'POST', 311 + url: '/user', 312 + }); 313 + } 314 + 315 + /** 316 + * Creates list of users with given input array 317 + * Creates list of users with given input array 318 + * @param data The data for the request. 319 + * @param data.requestBody 320 + * @returns User Successful operation 321 + * @returns unknown successful operation 322 + * @throws ApiError 323 + */ 324 + public static createUsersWithListInput( 325 + data: $OpenApiTs['/user/createWithList']['post']['req'] = {}, 326 + ): CancelablePromise< 327 + | $OpenApiTs['/user/createWithList']['post']['res'][200] 328 + | $OpenApiTs['/user/createWithList']['post']['res'][200] 329 + > { 330 + return __request(OpenAPI, { 331 + body: data.requestBody, 332 + mediaType: 'application/json', 333 + method: 'POST', 334 + url: '/user/createWithList', 335 + }); 336 + } 337 + 338 + /** 339 + * Logs user into the system 340 + * @param data The data for the request. 341 + * @param data.username The user name for login 342 + * @param data.password The password for login in clear text 343 + * @returns string successful operation 344 + * @throws ApiError 345 + */ 346 + public static loginUser( 347 + data: $OpenApiTs['/user/login']['get']['req'] = {}, 348 + ): CancelablePromise<$OpenApiTs['/user/login']['get']['res'][200]> { 349 + return __request(OpenAPI, { 350 + errors: { 351 + 400: 'Invalid username/password supplied', 352 + }, 353 + method: 'GET', 354 + query: { 355 + password: data.password, 356 + username: data.username, 357 + }, 358 + url: '/user/login', 359 + }); 360 + } 361 + 362 + /** 363 + * Logs out current logged in user session 364 + * @returns unknown successful operation 365 + * @throws ApiError 366 + */ 367 + public static logoutUser(): CancelablePromise< 368 + $OpenApiTs['/user/logout']['get']['res'][200] 369 + > { 370 + return __request(OpenAPI, { 371 + method: 'GET', 372 + url: '/user/logout', 373 + }); 374 + } 375 + 376 + /** 377 + * Get user by user name 378 + * @param data The data for the request. 379 + * @param data.username The name that needs to be fetched. Use user1 for testing. 380 + * @returns User successful operation 381 + * @throws ApiError 382 + */ 383 + public static getUserByName( 384 + data: $OpenApiTs['/user/{username}']['get']['req'], 385 + ): CancelablePromise<$OpenApiTs['/user/{username}']['get']['res'][200]> { 386 + return __request(OpenAPI, { 387 + errors: { 388 + 400: 'Invalid username supplied', 389 + 404: 'User not found', 390 + }, 391 + method: 'GET', 392 + path: { 393 + username: data.username, 394 + }, 395 + url: '/user/{username}', 396 + }); 397 + } 398 + 399 + /** 400 + * Update user 401 + * This can only be done by the logged in user. 402 + * @param data The data for the request. 403 + * @param data.username name that needs to be updated 404 + * @param data.requestBody Update an existent user in the store 405 + * @returns unknown successful operation 406 + * @throws ApiError 407 + */ 408 + public static updateUser( 409 + data: $OpenApiTs['/user/{username}']['put']['req'], 410 + ): CancelablePromise<$OpenApiTs['/user/{username}']['put']['res'][200]> { 411 + return __request(OpenAPI, { 412 + body: data.requestBody, 413 + mediaType: 'application/json', 414 + method: 'PUT', 415 + path: { 416 + username: data.username, 417 + }, 418 + url: '/user/{username}', 419 + }); 420 + } 421 + 422 + /** 423 + * Delete user 424 + * This can only be done by the logged in user. 425 + * @param data The data for the request. 426 + * @param data.username The name that needs to be deleted 427 + * @throws ApiError 428 + */ 429 + public static deleteUser( 430 + data: $OpenApiTs['/user/{username}']['delete']['req'], 431 + ): CancelablePromise<void> { 432 + return __request(OpenAPI, { 433 + errors: { 434 + 400: 'Invalid username supplied', 435 + 404: 'User not found', 436 + }, 437 + method: 'DELETE', 438 + path: { 439 + username: data.username, 440 + }, 441 + url: '/user/{username}', 442 + }); 443 + } 444 + }
+433
examples/openapi-ts-fetch/src/client/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type Order = { 4 + id?: number; 5 + petId?: number; 6 + quantity?: number; 7 + shipDate?: string; 8 + /** 9 + * Order Status 10 + */ 11 + status?: 'placed' | 'approved' | 'delivered'; 12 + complete?: boolean; 13 + }; 14 + 15 + export type Customer = { 16 + id?: number; 17 + username?: string; 18 + address?: Array<Address>; 19 + }; 20 + 21 + export type Address = { 22 + street?: string; 23 + city?: string; 24 + state?: string; 25 + zip?: string; 26 + }; 27 + 28 + export type Category = { 29 + id?: number; 30 + name?: string; 31 + }; 32 + 33 + export type User = { 34 + id?: number; 35 + username?: string; 36 + firstName?: string; 37 + lastName?: string; 38 + email?: string; 39 + password?: string; 40 + phone?: string; 41 + /** 42 + * User Status 43 + */ 44 + userStatus?: number; 45 + }; 46 + 47 + export type Tag = { 48 + id?: number; 49 + name?: string; 50 + }; 51 + 52 + export type Pet = { 53 + id?: number; 54 + name: string; 55 + category?: Category; 56 + photoUrls: Array<string>; 57 + tags?: Array<Tag>; 58 + /** 59 + * pet status in the store 60 + */ 61 + status?: 'available' | 'pending' | 'sold'; 62 + }; 63 + 64 + export type ApiResponse = { 65 + code?: number; 66 + type?: string; 67 + message?: string; 68 + }; 69 + 70 + export type $OpenApiTs = { 71 + '/pet': { 72 + post: { 73 + req: { 74 + /** 75 + * Create a new pet in the store 76 + */ 77 + requestBody: Pet; 78 + }; 79 + res: { 80 + /** 81 + * Successful operation 82 + */ 83 + 200: Pet; 84 + /** 85 + * Invalid input 86 + */ 87 + 405: unknown; 88 + }; 89 + }; 90 + put: { 91 + req: { 92 + /** 93 + * Update an existent pet in the store 94 + */ 95 + requestBody: Pet; 96 + }; 97 + res: { 98 + /** 99 + * Successful operation 100 + */ 101 + 200: Pet; 102 + /** 103 + * Invalid ID supplied 104 + */ 105 + 400: unknown; 106 + /** 107 + * Pet not found 108 + */ 109 + 404: unknown; 110 + /** 111 + * Validation exception 112 + */ 113 + 405: unknown; 114 + }; 115 + }; 116 + }; 117 + '/pet/findByStatus': { 118 + get: { 119 + req: { 120 + /** 121 + * Status values that need to be considered for filter 122 + */ 123 + status?: 'available' | 'pending' | 'sold'; 124 + }; 125 + res: { 126 + /** 127 + * successful operation 128 + */ 129 + 200: Array<Pet>; 130 + /** 131 + * Invalid status value 132 + */ 133 + 400: unknown; 134 + }; 135 + }; 136 + }; 137 + '/pet/findByTags': { 138 + get: { 139 + req: { 140 + /** 141 + * Tags to filter by 142 + */ 143 + tags?: Array<string>; 144 + }; 145 + res: { 146 + /** 147 + * successful operation 148 + */ 149 + 200: Array<Pet>; 150 + /** 151 + * Invalid tag value 152 + */ 153 + 400: unknown; 154 + }; 155 + }; 156 + }; 157 + '/pet/{petId}': { 158 + get: { 159 + req: { 160 + /** 161 + * ID of pet to return 162 + */ 163 + petId: number; 164 + }; 165 + res: { 166 + /** 167 + * successful operation 168 + */ 169 + 200: Pet; 170 + /** 171 + * Invalid ID supplied 172 + */ 173 + 400: unknown; 174 + /** 175 + * Pet not found 176 + */ 177 + 404: unknown; 178 + }; 179 + }; 180 + post: { 181 + req: { 182 + /** 183 + * Name of pet that needs to be updated 184 + */ 185 + name?: string; 186 + /** 187 + * ID of pet that needs to be updated 188 + */ 189 + petId: number; 190 + /** 191 + * Status of pet that needs to be updated 192 + */ 193 + status?: string; 194 + }; 195 + res: { 196 + /** 197 + * Invalid input 198 + */ 199 + 405: unknown; 200 + }; 201 + }; 202 + delete: { 203 + req: { 204 + apiKey?: string; 205 + /** 206 + * Pet id to delete 207 + */ 208 + petId: number; 209 + }; 210 + res: { 211 + /** 212 + * Invalid pet value 213 + */ 214 + 400: unknown; 215 + }; 216 + }; 217 + }; 218 + '/pet/{petId}/uploadImage': { 219 + post: { 220 + req: { 221 + /** 222 + * Additional Metadata 223 + */ 224 + additionalMetadata?: string; 225 + /** 226 + * ID of pet to update 227 + */ 228 + petId: number; 229 + requestBody?: Blob | File; 230 + }; 231 + res: { 232 + /** 233 + * successful operation 234 + */ 235 + 200: ApiResponse; 236 + }; 237 + }; 238 + }; 239 + '/store/inventory': { 240 + get: { 241 + res: { 242 + /** 243 + * successful operation 244 + */ 245 + 200: { 246 + [key: string]: number; 247 + }; 248 + }; 249 + }; 250 + }; 251 + '/store/order': { 252 + post: { 253 + req: { 254 + requestBody?: Order; 255 + }; 256 + res: { 257 + /** 258 + * successful operation 259 + */ 260 + 200: Order; 261 + /** 262 + * Invalid input 263 + */ 264 + 405: unknown; 265 + }; 266 + }; 267 + }; 268 + '/store/order/{orderId}': { 269 + get: { 270 + req: { 271 + /** 272 + * ID of order that needs to be fetched 273 + */ 274 + orderId: number; 275 + }; 276 + res: { 277 + /** 278 + * successful operation 279 + */ 280 + 200: Order; 281 + /** 282 + * Invalid ID supplied 283 + */ 284 + 400: unknown; 285 + /** 286 + * Order not found 287 + */ 288 + 404: unknown; 289 + }; 290 + }; 291 + delete: { 292 + req: { 293 + /** 294 + * ID of the order that needs to be deleted 295 + */ 296 + orderId: number; 297 + }; 298 + res: { 299 + /** 300 + * Invalid ID supplied 301 + */ 302 + 400: unknown; 303 + /** 304 + * Order not found 305 + */ 306 + 404: unknown; 307 + }; 308 + }; 309 + }; 310 + '/user': { 311 + post: { 312 + req: { 313 + /** 314 + * Created user object 315 + */ 316 + requestBody?: User; 317 + }; 318 + res: { 319 + /** 320 + * successful operation 321 + */ 322 + 200: User; 323 + }; 324 + }; 325 + }; 326 + '/user/createWithList': { 327 + post: { 328 + req: { 329 + requestBody?: Array<User>; 330 + }; 331 + res: { 332 + /** 333 + * successful operation 334 + */ 335 + 200: unknown; 336 + }; 337 + }; 338 + }; 339 + '/user/login': { 340 + get: { 341 + req: { 342 + /** 343 + * The password for login in clear text 344 + */ 345 + password?: string; 346 + /** 347 + * The user name for login 348 + */ 349 + username?: string; 350 + }; 351 + res: { 352 + /** 353 + * successful operation 354 + */ 355 + 200: string; 356 + /** 357 + * Invalid username/password supplied 358 + */ 359 + 400: unknown; 360 + }; 361 + }; 362 + }; 363 + '/user/logout': { 364 + get: { 365 + res: { 366 + /** 367 + * successful operation 368 + */ 369 + 200: unknown; 370 + }; 371 + }; 372 + }; 373 + '/user/{username}': { 374 + get: { 375 + req: { 376 + /** 377 + * The name that needs to be fetched. Use user1 for testing. 378 + */ 379 + username: string; 380 + }; 381 + res: { 382 + /** 383 + * successful operation 384 + */ 385 + 200: User; 386 + /** 387 + * Invalid username supplied 388 + */ 389 + 400: unknown; 390 + /** 391 + * User not found 392 + */ 393 + 404: unknown; 394 + }; 395 + }; 396 + put: { 397 + req: { 398 + /** 399 + * Update an existent user in the store 400 + */ 401 + requestBody?: User; 402 + /** 403 + * name that needs to be updated 404 + */ 405 + username: string; 406 + }; 407 + res: { 408 + /** 409 + * successful operation 410 + */ 411 + 200: unknown; 412 + }; 413 + }; 414 + delete: { 415 + req: { 416 + /** 417 + * The name that needs to be deleted 418 + */ 419 + username: string; 420 + }; 421 + res: { 422 + /** 423 + * Invalid username supplied 424 + */ 425 + 400: unknown; 426 + /** 427 + * User not found 428 + */ 429 + 404: unknown; 430 + }; 431 + }; 432 + }; 433 + };
+68
examples/openapi-ts-fetch/src/index.css
··· 1 + :root { 2 + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 + line-height: 1.5; 4 + font-weight: 400; 5 + 6 + color-scheme: light dark; 7 + color: rgba(255, 255, 255, 0.87); 8 + background-color: #242424; 9 + 10 + font-synthesis: none; 11 + text-rendering: optimizeLegibility; 12 + -webkit-font-smoothing: antialiased; 13 + -moz-osx-font-smoothing: grayscale; 14 + } 15 + 16 + a { 17 + font-weight: 500; 18 + color: #646cff; 19 + text-decoration: inherit; 20 + } 21 + a:hover { 22 + color: #535bf2; 23 + } 24 + 25 + body { 26 + margin: 0; 27 + display: flex; 28 + place-items: center; 29 + min-width: 320px; 30 + min-height: 100vh; 31 + } 32 + 33 + h1 { 34 + font-size: 3.2em; 35 + line-height: 1.1; 36 + } 37 + 38 + button { 39 + border-radius: 8px; 40 + border: 1px solid transparent; 41 + padding: 0.6em 1.2em; 42 + font-size: 1em; 43 + font-weight: 500; 44 + font-family: inherit; 45 + background-color: #1a1a1a; 46 + cursor: pointer; 47 + transition: border-color 0.25s; 48 + } 49 + button:hover { 50 + border-color: #646cff; 51 + } 52 + button:focus, 53 + button:focus-visible { 54 + outline: 4px auto -webkit-focus-ring-color; 55 + } 56 + 57 + @media (prefers-color-scheme: light) { 58 + :root { 59 + color: #213547; 60 + background-color: #ffffff; 61 + } 62 + a:hover { 63 + color: #747bff; 64 + } 65 + button { 66 + background-color: #f9f9f9; 67 + } 68 + }
+12
examples/openapi-ts-fetch/src/main.tsx
··· 1 + import './index.css'; 2 + 3 + import React from 'react'; 4 + import ReactDOM from 'react-dom/client'; 5 + 6 + import App from './App.tsx'; 7 + 8 + ReactDOM.createRoot(document.getElementById('root')!).render( 9 + <React.StrictMode> 10 + <App /> 11 + </React.StrictMode>, 12 + );
+1
examples/openapi-ts-fetch/src/vite-env.d.ts
··· 1 + /// <reference types="vite/client" />
+25
examples/openapi-ts-fetch/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "target": "ES2020", 4 + "useDefineForClassFields": true, 5 + "lib": ["ES2020", "DOM", "DOM.Iterable"], 6 + "module": "ESNext", 7 + "skipLibCheck": true, 8 + 9 + /* Bundler mode */ 10 + "moduleResolution": "bundler", 11 + "allowImportingTsExtensions": true, 12 + "resolveJsonModule": true, 13 + "isolatedModules": true, 14 + "noEmit": true, 15 + "jsx": "react-jsx", 16 + 17 + /* Linting */ 18 + "strict": true, 19 + "noUnusedLocals": true, 20 + "noUnusedParameters": true, 21 + "noFallthroughCasesInSwitch": true 22 + }, 23 + "include": ["src"], 24 + "references": [{ "path": "./tsconfig.node.json" }] 25 + }
+11
examples/openapi-ts-fetch/tsconfig.node.json
··· 1 + { 2 + "compilerOptions": { 3 + "composite": true, 4 + "skipLibCheck": true, 5 + "module": "ESNext", 6 + "moduleResolution": "bundler", 7 + "allowSyntheticDefaultImports": true, 8 + "strict": true 9 + }, 10 + "include": ["vite.config.ts"] 11 + }
+7
examples/openapi-ts-fetch/vite.config.ts
··· 1 + import react from '@vitejs/plugin-react'; 2 + import { defineConfig } from 'vite'; 3 + 4 + // https://vitejs.dev/config/ 5 + export default defineConfig({ 6 + plugins: [react()], 7 + });
+2 -5
package.json
··· 16 16 "scripts": { 17 17 "build": "pnpm --recursive build", 18 18 "changeset": "changeset", 19 - "client-axios": "pnpm --filter @hey-api/client-axios --", 20 - "client-core": "pnpm --filter @hey-api/client-core --", 21 - "client-fetch": "pnpm --filter @hey-api/client-fetch --", 22 - "client-nextjs": "pnpm --filter @hey-api/client-nextjs --", 19 + "client": "sh ./scripts/client.sh", 23 20 "docs": "pnpm --filter @hey-api/docs --", 24 - "example": "pnpm --filter @examples/openapi-ts-axios --", 21 + "example": "sh ./scripts/example.sh", 25 22 "format": "prettier --write .", 26 23 "lint:fix": "prettier --check . && eslint . --fix", 27 24 "lint": "prettier --check . && eslint .",
+6 -3
packages/client-fetch/package.json
··· 26 26 "typescript", 27 27 "vue" 28 28 ], 29 - "main": "./dist/index.cjs", 30 - "types": "./dist/index.d.ts", 29 + "exports": { 30 + "import": "./dist/node/index.mjs", 31 + "require": "./dist/node/index.cjs", 32 + "types": "./dist/node/index.d.ts" 33 + }, 31 34 "scripts": { 32 35 "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", 33 36 "build-types-check": "tsc --project tsconfig.check.json", 34 37 "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", 35 - "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src", 38 + "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node", 36 39 "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", 37 40 "build": "pnpm clean && pnpm build-bundle && pnpm build-types", 38 41 "clean": "rimraf dist coverage node_modules/.cache",
+39 -19
packages/client-fetch/rollup.config.ts
··· 20 20 ]; 21 21 22 22 function createConfig(isProduction: boolean) { 23 - return defineConfig({ 24 - external: externalDependencies, 25 - input: path.resolve(__dirname, 'src/index.ts'), 26 - output: { 27 - file: path.resolve(__dirname, 'dist/index.cjs'), 28 - format: 'cjs', 29 - }, 30 - plugins: [ 31 - typescript({ 32 - declaration: false, 33 - tsconfig: path.resolve(__dirname, 'src/tsconfig.json'), 34 - }), 35 - commonjs({ 36 - sourceMap: false, 37 - }), 38 - isProduction && terser(), 39 - ], 40 - }); 23 + return [ 24 + defineConfig({ 25 + external: externalDependencies, 26 + input: path.resolve(__dirname, 'src/node/index.ts'), 27 + output: { 28 + file: path.resolve(__dirname, 'dist/node/index.cjs'), 29 + format: 'cjs', 30 + }, 31 + plugins: [ 32 + typescript({ 33 + declaration: false, 34 + tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), 35 + }), 36 + commonjs({ 37 + sourceMap: false, 38 + }), 39 + isProduction && terser(), 40 + ], 41 + }), 42 + defineConfig({ 43 + external: externalDependencies, 44 + input: path.resolve(__dirname, 'src/node/index.ts'), 45 + output: { 46 + file: path.resolve(__dirname, 'dist/node/index.mjs'), 47 + format: 'esm', 48 + }, 49 + plugins: [ 50 + typescript({ 51 + declaration: false, 52 + tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), 53 + }), 54 + commonjs({ 55 + sourceMap: false, 56 + }), 57 + isProduction && terser(), 58 + ], 59 + }), 60 + ]; 41 61 } 42 62 43 63 export default (commandLineArgs: any): RollupOptions[] => { 44 64 const isDev = commandLineArgs.watch; 45 65 const isProduction = !isDev; 46 - return defineConfig([createConfig(isProduction)]); 66 + return defineConfig(createConfig(isProduction)); 47 67 };
+2 -2
packages/client-fetch/rollup.dts.config.ts
··· 6 6 export default defineConfig({ 7 7 external: externalDependencies, 8 8 input: { 9 - index: './temp/index.d.ts', 9 + index: './temp/node/index.d.ts', 10 10 }, 11 11 output: { 12 - dir: './dist', 12 + dir: './dist/node', 13 13 format: 'cjs', 14 14 }, 15 15 plugins: [dts({ respectExternal: true })],
+34
packages/client-fetch/src/index.ts
··· 17 17 resolve, 18 18 } from '@hey-api/client-core'; 19 19 20 + type Middleware<T> = (value: T) => T | Promise<T>; 21 + 22 + class Interceptors<T> { 23 + _fns: Middleware<T>[]; 24 + 25 + constructor() { 26 + this._fns = []; 27 + } 28 + 29 + eject(fn: Middleware<T>) { 30 + const index = this._fns.indexOf(fn); 31 + if (index !== -1) { 32 + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; 33 + } 34 + } 35 + 36 + use(fn: Middleware<T>) { 37 + this._fns = [...this._fns, fn]; 38 + } 39 + } 40 + 41 + export const OpenAPI: OpenAPIConfig<RequestInit, Response> = { 42 + BASE: '', 43 + CREDENTIALS: 'include', 44 + ENCODE_PATH: undefined, 45 + HEADERS: undefined, 46 + PASSWORD: undefined, 47 + TOKEN: undefined, 48 + USERNAME: undefined, 49 + VERSION: '1.26.0', 50 + WITH_CREDENTIALS: false, 51 + interceptors: { request: new Interceptors(), response: new Interceptors() }, 52 + }; 53 + 20 54 export const getHeaders = async ( 21 55 config: OpenAPIConfig, 22 56 options: ApiRequestOptions,
+2
packages/client-fetch/src/node/index.ts
··· 1 + export { OpenAPI, request } from '../'; 2 + export type { CancelablePromise } from '@hey-api/client-core';
+9
packages/client-fetch/src/node/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "lib": ["ES2020", "DOM"], 4 + "stripInternal": true 5 + }, 6 + "exclude": ["../**/__tests__"], 7 + "extends": "../../tsconfig.base.json", 8 + "include": ["../"] 9 + }
-9
packages/client-fetch/src/tsconfig.json
··· 1 - { 2 - "compilerOptions": { 3 - "lib": ["ESNext"], 4 - "stripInternal": true 5 - }, 6 - "exclude": ["./**/__tests__"], 7 - "extends": "../tsconfig.base.json", 8 - "include": ["./"] 9 - }
+49
pnpm-lock.yaml
··· 134 134 specifier: 5.2.10 135 135 version: 5.2.10(@types/node@20.12.7) 136 136 137 + examples/openapi-ts-fetch: 138 + dependencies: 139 + '@hey-api/client-fetch': 140 + specifier: workspace:* 141 + version: link:../../packages/client-fetch 142 + react: 143 + specifier: 18.2.0 144 + version: 18.2.0 145 + react-dom: 146 + specifier: 18.2.0 147 + version: 18.2.0(react@18.2.0) 148 + devDependencies: 149 + '@hey-api/openapi-ts': 150 + specifier: workspace:* 151 + version: link:../../packages/openapi-ts 152 + '@types/react': 153 + specifier: 18.2.79 154 + version: 18.2.79 155 + '@types/react-dom': 156 + specifier: 18.2.25 157 + version: 18.2.25 158 + '@typescript-eslint/eslint-plugin': 159 + specifier: 7.7.1 160 + version: 7.7.1(@typescript-eslint/parser@7.7.1)(eslint@8.57.0)(typescript@5.4.5) 161 + '@typescript-eslint/parser': 162 + specifier: 7.7.1 163 + version: 7.7.1(eslint@8.57.0)(typescript@5.4.5) 164 + '@vitejs/plugin-react': 165 + specifier: 4.2.1 166 + version: 4.2.1(vite@5.2.10) 167 + eslint: 168 + specifier: 8.57.0 169 + version: 8.57.0 170 + eslint-plugin-react-hooks: 171 + specifier: 4.6.0 172 + version: 4.6.0(eslint@8.57.0) 173 + eslint-plugin-react-refresh: 174 + specifier: 0.4.6 175 + version: 0.4.6(eslint@8.57.0) 176 + prettier: 177 + specifier: 3.2.5 178 + version: 3.2.5 179 + typescript: 180 + specifier: 5.4.5 181 + version: 5.4.5 182 + vite: 183 + specifier: 5.2.10 184 + version: 5.2.10(@types/node@20.12.7) 185 + 137 186 packages/client-axios: 138 187 dependencies: 139 188 '@hey-api/client-core':
+3
scripts/client.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + pnpm --filter @hey-api/client-$1 -- $2
+3
scripts/example.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + pnpm --filter @example/openapi-ts-$1 -- $2