123456789101112131415161718192021222324252627282930313233343536373839 |
- const { generateApi } = require('swagger-typescript-api')
- const path = require('path')
- const apis = [
- {
- output: path.resolve(__dirname, '../src/api/admin'),
- url: 'http://localhost:8000/admin/swagger/admin/swagger.json',
- },
- ]
- apis?.forEach((api, index) => {
- setTimeout(() => {
- generateApi({
- output: api.output,
- templates: path.resolve(__dirname, './templates'),
- url: api.url,
- httpClientType: 'axios',
- modular: true,
- cleanOutput: false,
- moduleNameIndex: 2,
- moduleNameFirstTag: true,
- unwrapResponseData: true,
- generateUnionEnums: true,
- defaultResponseType: 'AxiosResponse',
-
-
-
-
- })
- .then((r) => {
-
-
-
- })
- .catch((e) => console.error(e))
- }, index * 1500)
- })
|