From d521cddc3b646c5cc767b7d20d1a269cefadd9e4 Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:56:35 +0200 Subject: [PATCH] Remove unnecessary files (#19769) --- .../default/api/advancedApi.ts | 252 ------------------ .../typescript-node/default/api/basicApi.ts | 250 ----------------- .../typescript-node/default/api/defaultApi.ts | 185 ------------- 3 files changed, 687 deletions(-) delete mode 100644 samples/client/petstore/typescript-node/default/api/advancedApi.ts delete mode 100644 samples/client/petstore/typescript-node/default/api/basicApi.ts delete mode 100644 samples/client/petstore/typescript-node/default/api/defaultApi.ts diff --git a/samples/client/petstore/typescript-node/default/api/advancedApi.ts b/samples/client/petstore/typescript-node/default/api/advancedApi.ts deleted file mode 100644 index 7a1cb0de90c..00000000000 --- a/samples/client/petstore/typescript-node/default/api/advancedApi.ts +++ /dev/null @@ -1,252 +0,0 @@ -/** - * Sample project - * Sample API Check \"API Key\" - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest from 'request'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { Group } from '../model/group'; -import { User } from '../model/user'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'http://localhost:5000/v1'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum AdvancedApiApiKeys { - ApiKeyAuth, -} - -export class AdvancedApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'BasicAuth': new HttpBasicAuth(), - 'BearerAuth': new HttpBearerAuth(), - 'ApiKeyAuth': new ApiKeyAuth('header', 'X-API-Key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(username: string, password: string, basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - this.username = basePathOrUsername; - this.password = password - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: AdvancedApiApiKeys, value: string) { - (this.authentications as any)[AdvancedApiApiKeys[key]].apiKey = value; - } - - set username(username: string) { - this.authentications.BasicAuth.username = username; - } - - set password(password: string) { - this.authentications.BasicAuth.password = password; - } - - set accessToken(accessToken: string | (() => string)) { - this.authentications.BearerAuth.accessToken = accessToken; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Get group of users - * @summary Get group by ID - * @param groupId group Id - */ - public async getGroupsGroupId (groupId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Group; }> { - const localVarPath = this.basePath + '/groups/{groupId}' - .replace('{' + 'groupId' + '}', encodeURIComponent(String(groupId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'groupId' is not null or undefined - if (groupId === null || groupId === undefined) { - throw new Error('Required parameter groupId was null or undefined when calling getGroupsGroupId.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Group; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Group"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Retrieve the information of the user with the matching user ID. - * @summary Get User Info by User ID - * @param userId Id of an existing user. - * @param strCode Code as header - * @param strCode2 Code as header2 - */ - public async getUsersUserId (userId: number, strCode?: string, strCode2?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> { - const localVarPath = this.basePath + '/users/{userId}' - .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'userId' is not null or undefined - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling getUsersUserId.'); - } - - localVarHeaderParams['strCode'] = ObjectSerializer.serialize(strCode, "string"); - localVarHeaderParams['strCode2'] = ObjectSerializer.serialize(strCode2, "string"); - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "User"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/samples/client/petstore/typescript-node/default/api/basicApi.ts b/samples/client/petstore/typescript-node/default/api/basicApi.ts deleted file mode 100644 index 8fa911ff35e..00000000000 --- a/samples/client/petstore/typescript-node/default/api/basicApi.ts +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Sample project - * Sample API Check \"API Key\" - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest from 'request'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { PostUserRequest } from '../model/postUserRequest'; -import { User } from '../model/user'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'http://localhost:5000/v1'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum BasicApiApiKeys { - ApiKeyAuth, -} - -export class BasicApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'BasicAuth': new HttpBasicAuth(), - 'BearerAuth': new HttpBearerAuth(), - 'ApiKeyAuth': new ApiKeyAuth('header', 'X-API-Key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(username: string, password: string, basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - this.username = basePathOrUsername; - this.password = password - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: BasicApiApiKeys, value: string) { - (this.authentications as any)[BasicApiApiKeys[key]].apiKey = value; - } - - set username(username: string) { - this.authentications.BasicAuth.username = username; - } - - set password(password: string) { - this.authentications.BasicAuth.password = password; - } - - set accessToken(accessToken: string | (() => string)) { - this.authentications.BearerAuth.accessToken = accessToken; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Retrieve the information of the user with the matching user ID. - * @summary Get User Info by Query Param - * @param pUserId Query Id. - * @param customHeader Custom HTTP header - * @param anotherCustomHeader Custom HTTP header with default - */ - public async getUsersQueryId (pUserId: string, customHeader?: string, anotherCustomHeader?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> { - const localVarPath = this.basePath + '/users/'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'pUserId' is not null or undefined - if (pUserId === null || pUserId === undefined) { - throw new Error('Required parameter pUserId was null or undefined when calling getUsersQueryId.'); - } - - if (pUserId !== undefined) { - localVarQueryParameters['pUserId'] = ObjectSerializer.serialize(pUserId, "string"); - } - - localVarHeaderParams['Custom-Header'] = ObjectSerializer.serialize(customHeader, "string"); - localVarHeaderParams['Another-Custom-Header'] = ObjectSerializer.serialize(anotherCustomHeader, "string"); - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "User"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Create a new user. - * @summary Create New User - * @param postUserRequest Post the necessary fields for the API to create a new user. - */ - public async postUser (postUserRequest?: PostUserRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> { - const localVarPath = this.basePath + '/user'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(postUserRequest, "PostUserRequest") - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "User"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/samples/client/petstore/typescript-node/default/api/defaultApi.ts b/samples/client/petstore/typescript-node/default/api/defaultApi.ts deleted file mode 100644 index 9786eacce90..00000000000 --- a/samples/client/petstore/typescript-node/default/api/defaultApi.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Sample project - * Sample API Check \"API Key\" - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest from 'request'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { PatchUsersUserIdRequest } from '../model/patchUsersUserIdRequest'; -import { User } from '../model/user'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'http://localhost:5000/v1'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum DefaultApiApiKeys { - ApiKeyAuth, -} - -export class DefaultApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'BasicAuth': new HttpBasicAuth(), - 'BearerAuth': new HttpBearerAuth(), - 'ApiKeyAuth': new ApiKeyAuth('header', 'X-API-Key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(username: string, password: string, basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - this.username = basePathOrUsername; - this.password = password - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: DefaultApiApiKeys, value: string) { - (this.authentications as any)[DefaultApiApiKeys[key]].apiKey = value; - } - - set username(username: string) { - this.authentications.BasicAuth.username = username; - } - - set password(password: string) { - this.authentications.BasicAuth.password = password; - } - - set accessToken(accessToken: string | (() => string)) { - this.authentications.BearerAuth.accessToken = accessToken; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Update the information of an existing user. - * @summary Update User Information - * @param userId Id of an existing user. - * @param strCode Code as header - * @param strCode2 Code as header2 - * @param patchUsersUserIdRequest Patch user properties to update. - */ - public async patchUsersUserId (userId: number, strCode?: string, strCode2?: string, patchUsersUserIdRequest?: PatchUsersUserIdRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> { - const localVarPath = this.basePath + '/users/{userId}' - .replace('{' + 'userId' + '}', encodeURIComponent(String(userId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'userId' is not null or undefined - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling patchUsersUserId.'); - } - - localVarHeaderParams['strCode'] = ObjectSerializer.serialize(strCode, "string"); - localVarHeaderParams['strCode2'] = ObjectSerializer.serialize(strCode2, "string"); - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(patchUsersUserIdRequest, "PatchUsersUserIdRequest") - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "User"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -}