diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..c22a79329 --- /dev/null +++ b/.npmrc @@ -0,0 +1,4 @@ +registry=https://registry.npmjs.org/ +@agidens:registry=https://pkgs.dev.azure.com/agidens-mes/O2C/_packaging/Order2Cash/npm/registry/ + +always-auth=true diff --git a/package.json b/package.json index 9b56ef5e4..d518fa80c 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "openapi-typescript-codegen", - "version": "0.9.3", + "name": "@agidens/openapi-typescript-codegen", + "version": "0.9.3-1", "description": "Library that generates Typescript clients based on the OpenAPI specification.", "author": "Ferdi Koomen", - "homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen", + "homepage": "https://github.com/CommCody/openapi-typescript-codegen", "repository": { "type": "git", - "url": "git+https://github.com/ferdikoomen/openapi-typescript-codegen.git" + "url": "git+https://github.com/CommCody/openapi-typescript-codegen.git" }, "bugs": { - "url": "https://github.com/ferdikoomen/openapi-typescript-codegen/issues" + "url": "https://github.com/CommCody/openapi-typescript-codegen/issues" }, "license": "MIT", "keywords": [ diff --git a/src/templates/exportModel.hbs b/src/templates/exportModel.hbs index 2b3a082da..7ddb2c3e8 100644 --- a/src/templates/exportModel.hbs +++ b/src/templates/exportModel.hbs @@ -16,7 +16,11 @@ import type { {{{this}}} } from './{{{this}}}'; {{else equals export 'all-of'}} {{>exportComposition}} {{else equals export 'enum'}} +{{#if @root.useUnionTypes}} +{{>exportType}} +{{else}} {{>exportEnum}} +{{/if}} {{else}} {{>exportType}} {{/equals}} diff --git a/src/templates/index.hbs b/src/templates/index.hbs index e10436ba6..d1250b165 100644 --- a/src/templates/index.hbs +++ b/src/templates/index.hbs @@ -8,10 +8,10 @@ export { OpenAPI } from './core/OpenAPI'; {{#if models}} {{#each models}} -{{#if enum}} -export { {{{name}}} } from './models/{{{name}}}'; -{{else if @root.useUnionTypes}} +{{#if @root.useUnionTypes}} export type { {{{name}}} } from './models/{{{name}}}'; +{{else if enum}} +export { {{{name}}} } from './models/{{{name}}}'; {{else if enums}} export { {{{name}}} } from './models/{{{name}}}'; {{else}}