12345678910111213141516171819202122232425262728293031323334353637 |
- const { generateApi } = require('swagger-typescript-api')
- const path = require('path')
- const apis = [
- {
- output: path.resolve(__dirname, '../src/api/admin'),
- url: import.meta.env.VITE_API_URL + '/swagger/admin/swagger.json',
- },
- ]
- apis?.forEach((api) => {
- generateApi({
- output: api.output,
- templates: path.resolve(__dirname, './templates'),
- url: api.url,
- httpClientType: 'axios',
- modular: true,
- cleanOutput: true,
- moduleNameIndex: 2,
- moduleNameFirstTag: true,
- unwrapResponseData: true,
- generateUnionEnums: true,
- defaultResponseType: 'AxiosResponse',
-
-
-
-
- })
- .then((r) => {
-
-
-
- })
- .catch((e) => console.error(e))
- })
|