From f49efe02fd4e30fc43f785a9b83522fa574862b2 Mon Sep 17 00:00:00 2001 From: Simon Hanna <33220646+simhnna@users.noreply.github.com> Date: Thu, 23 May 2024 14:12:26 +0200 Subject: [PATCH] [typescript/nestjs] remove unused imports and allow async configuration (#18745) --- .../src/main/resources/typescript-nestjs/api.service.mustache | 4 ++-- .../main/resources/typescript-nestjs/configuration.mustache | 4 ++-- .../builds/default/api/pet.service.ts | 2 +- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/default/configuration.ts | 4 ++-- .../builds/default/api/pet.service.ts | 2 +- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/default/configuration.ts | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index f35185c8aff7..b5cf3848a931 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -2,11 +2,11 @@ /* tslint:disable:no-unused-variable member-ordering */ {{#useAxiosHttpModule}} -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; {{/useAxiosHttpModule}} {{^useAxiosHttpModule}} -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; {{/useAxiosHttpModule}} import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache index 39cf69ee6122..1ee763ae549f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts index 8b865f9e433f..8538bee92e79 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts index bc34e3910920..2e606c2e21f6 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts index 7019b9bde7a1..e881ccdff28c 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts index 39cf69ee6122..1ee763ae549f 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts index ceef83bd634a..7ba9521bf3c2 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts index 2520dfe41059..686e39af02a7 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts index f21364efad83..8086d2a99491 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts @@ -11,7 +11,7 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; import { Observable, from, of, switchMap } from 'rxjs'; diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts index 39cf69ee6122..1ee763ae549f 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean;