openapi-gen-typescript
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -145,3 +145,4 @@ "use strict"; | ||
schemasTypesCode.push(`export type ${schemaKey} = ${transformObject}`); | ||
schemasClassCode.push(`export class ${schemaKey} ${transformObject.replace(/[()]/g, '')}\n`); | ||
const classObject = transformObject.replace(/[()]/g, '').replace(/components.schemas./g, ''); | ||
schemasClassCode.push(`export class ${schemaKey} ${classObject}\n`); | ||
}); | ||
@@ -301,11 +302,6 @@ } | ||
constants_1.NotModifyCode, | ||
`import fetchImpl from '${path.relative(outputDir, fetchModuleFile).replace(/\.ts$/, '')}';`, | ||
`export namespace components { export namespace schemas { ${schemasTypesCode.join('\n')} } } `, | ||
`export namespace Api { ${pathsCode.join('\n')} } `, | ||
].join('\n'); | ||
const schemasCode = [ | ||
constants_1.NotModifyCode, | ||
`import { components } from './index';\n`, | ||
schemasClassCode.join('\n'), | ||
].join('\n'); | ||
const schemasCode = [constants_1.NotModifyCode, schemasClassCode.join('\n')].join('\n'); | ||
fs.writeFileSync(`${outputDir}/index.ts`, util_1.format(typesCode)); | ||
@@ -312,0 +308,0 @@ fs.writeFileSync(`${outputDir}/schemas.ts`, util_1.format(schemasCode)); |
{ | ||
"name": "openapi-gen-typescript", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -203,3 +203,4 @@ // @ts-ignore | ||
schemasTypesCode.push(`export type ${schemaKey} = ${transformObject}`); | ||
schemasClassCode.push(`export class ${schemaKey} ${transformObject.replace(/[()]/g, '')}\n`); | ||
const classObject = transformObject.replace(/[()]/g, '').replace(/components.schemas./g, ''); | ||
schemasClassCode.push(`export class ${schemaKey} ${classObject}\n`); | ||
}); | ||
@@ -427,3 +428,2 @@ } | ||
NotModifyCode, | ||
`import fetchImpl from '${path.relative(outputDir, fetchModuleFile).replace(/\.ts$/, '')}';`, | ||
`export namespace components { export namespace schemas { ${schemasTypesCode.join('\n')} } } `, | ||
@@ -433,7 +433,3 @@ `export namespace Api { ${pathsCode.join('\n')} } `, | ||
const schemasCode = [ | ||
NotModifyCode, | ||
`import { components } from './index';\n`, | ||
schemasClassCode.join('\n'), | ||
].join('\n'); | ||
const schemasCode = [NotModifyCode, schemasClassCode.join('\n')].join('\n'); | ||
@@ -440,0 +436,0 @@ fs.writeFileSync(`${outputDir}/index.ts`, format(typesCode)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63734
1360