From c9fe45cc9a49af95de4c2a4955632bce8f9fd743 Mon Sep 17 00:00:00 2001 From: Ashim Raiani Date: Thu, 2 Mar 2023 10:15:11 -0700 Subject: [PATCH 1/3] changing services to proxies --- src/utils/writeClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/writeClient.ts b/src/utils/writeClient.ts index cea2f3d88..f66c873fe 100644 --- a/src/utils/writeClient.ts +++ b/src/utils/writeClient.ts @@ -54,7 +54,7 @@ export const writeClient = async ( const outputPathCore = resolve(outputPath, 'core'); const outputPathModels = resolve(outputPath, 'models'); const outputPathSchemas = resolve(outputPath, 'schemas'); - const outputPathServices = resolve(outputPath, 'services'); + const outputPathServices = resolve(outputPath, 'proxies'); if (!isSubDirectory(process.cwd(), output)) { throw new Error(`Output folder is not a subdirectory of the current working directory`); From e4a38c63f74e5424d082548eb21cc1910a36fce7 Mon Sep 17 00:00:00 2001 From: Ashim Raiani Date: Thu, 2 Mar 2023 15:31:31 -0700 Subject: [PATCH 2/3] aa-openapi-typescript-codegen --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f801755be..3d53a7a08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "openapi-typescript-codegen", - "version": "0.23.0", + "name": "aa-openapi-typescript-codegen", + "version": "1.23.0", "description": "Library that generates Typescript clients based on the OpenAPI specification.", "author": "Ferdi Koomen", "homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen", From 50c3fed770df870c14ba411bf0281d0f36f012d2 Mon Sep 17 00:00:00 2001 From: Ashim Raiani Date: Thu, 2 Mar 2023 17:36:59 -0700 Subject: [PATCH 3/3] 1.23.1 --- bin/index.js | 4 ++-- package.json | 11 +---------- src/templates/index.hbs | 2 +- src/utils/writeClientIndex.ts | 6 +++++- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/bin/index.js b/bin/index.js index ed8b0889b..46d93075a 100755 --- a/bin/index.js +++ b/bin/index.js @@ -21,8 +21,8 @@ const params = program .option('--exportModels ', 'Write models to disk', true) .option('--exportSchemas ', 'Write schemas to disk', false) .option('--indent ', 'Indentation options [4, 2, tabs]', '4') - .option('--postfix ', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service') - .option('--postfixServices ', 'Service name postfix', 'Service') + .option('--postfix ', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Proxy') + .option('--postfixServices ', 'Service name postfix', 'Proxy') .option('--postfixModels ', 'Model name postfix') .option('--request ', 'Path to custom request file') .parse(process.argv) diff --git a/package.json b/package.json index 3d53a7a08..0ec42e603 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,7 @@ { "name": "aa-openapi-typescript-codegen", - "version": "1.23.0", + "version": "1.23.1", "description": "Library that generates Typescript clients based on the OpenAPI specification.", - "author": "Ferdi Koomen", - "homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen", - "repository": { - "type": "git", - "url": "git+https://github.com/ferdikoomen/openapi-typescript-codegen.git" - }, - "bugs": { - "url": "https://github.com/ferdikoomen/openapi-typescript-codegen/issues" - }, "license": "MIT", "keywords": [ "openapi", diff --git a/src/templates/index.hbs b/src/templates/index.hbs index 6f5b27d8c..bbb193a7c 100644 --- a/src/templates/index.hbs +++ b/src/templates/index.hbs @@ -41,7 +41,7 @@ export { ${{{name}}} } from './schemas/${{{name}}}'; {{#if services}} {{#each services}} -export { {{{name}}}{{{@root.postfixServices}}} } from './services/{{{name}}}{{{@root.postfixServices}}}'; +export { {{{name}}}{{{@root.postfixServices}}} } from './proxies/{{{name}}}{{{@root.postfixServices}}}'; {{/each}} {{/if}} {{/if}} diff --git a/src/utils/writeClientIndex.ts b/src/utils/writeClientIndex.ts index 5044294d5..e9026c1ec 100644 --- a/src/utils/writeClientIndex.ts +++ b/src/utils/writeClientIndex.ts @@ -36,6 +36,9 @@ export const writeClientIndex = async ( postfixModels: string, clientName?: string ): Promise => { + const servicesName = sortServicesByName(client.services); + //console.log("servicesName",servicesName); + const templateResult = templates.index({ exportCore, exportServices, @@ -48,9 +51,10 @@ export const writeClientIndex = async ( server: client.server, version: client.version, models: sortModelsByName(client.models), - services: sortServicesByName(client.services), + services: servicesName, exportClient: isDefined(clientName), }); + //console.log("templateResult",templateResult); await writeFile(resolve(outputPath, 'index.ts'), templateResult); };