diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index f9dfb7c77e26..ef0e8cbedc68 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -60,7 +60,7 @@ export interface {{classname}}Interface { {{/summary}} */ {{^useSingleRequestParameter}} - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{^-last}}, {{/-last}}, {{/allParams}}initOverrides?: RequestInit): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>; + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>; {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>; @@ -331,7 +331,7 @@ export class {{classname}} extends runtime.BaseAPI { {{/summary}} */ {{^useSingleRequestParameter}} - async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{^-last}}, {{/-last}}, {{/allParams}}initOverrides?: RequestInit): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}{ {{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }, {{/allParams.0}}initOverrides); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts index 15a4a866e5b0..60f5804b68d7 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts @@ -136,7 +136,7 @@ export class PetApi extends runtime.BaseAPI { /** * Deletes a pet */ - async deletePet(petId: number, , apiKey?: string, initOverrides?: RequestInit): Promise { + async deletePet(petId: number, apiKey?: string, initOverrides?: RequestInit): Promise { await this.deletePetRaw({ petId: petId, apiKey: apiKey }, initOverrides); } @@ -348,7 +348,7 @@ export class PetApi extends runtime.BaseAPI { /** * Updates a pet in the store with form data */ - async updatePetWithForm(petId: number, , name?: string, , status?: string, initOverrides?: RequestInit): Promise { + async updatePetWithForm(petId: number, name?: string, status?: string, initOverrides?: RequestInit): Promise { await this.updatePetWithFormRaw({ petId: petId, name: name, status: status }, initOverrides); } @@ -407,7 +407,7 @@ export class PetApi extends runtime.BaseAPI { /** * uploads an image */ - async uploadFile(petId: number, , additionalMetadata?: string, , file?: Blob, initOverrides?: RequestInit): Promise { + async uploadFile(petId: number, additionalMetadata?: string, file?: Blob, initOverrides?: RequestInit): Promise { const response = await this.uploadFileRaw({ petId: petId, additionalMetadata: additionalMetadata, file: file }, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts index cc66bd9b1afb..a9bb0facaf2a 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts @@ -251,7 +251,7 @@ export class UserApi extends runtime.BaseAPI { /** * Logs user into the system */ - async loginUser(username: string, , password: string, initOverrides?: RequestInit): Promise { + async loginUser(username: string, password: string, initOverrides?: RequestInit): Promise { const response = await this.loginUserRaw({ username: username, password: password }, initOverrides); return await response.value(); } @@ -315,7 +315,7 @@ export class UserApi extends runtime.BaseAPI { * This can only be done by the logged in user. * Updated user */ - async updateUser(username: string, , body: User, initOverrides?: RequestInit): Promise { + async updateUser(username: string, body: User, initOverrides?: RequestInit): Promise { await this.updateUserRaw({ username: username, body: body }, initOverrides); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts index 262aaaa131f9..fa782af9b14b 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts @@ -153,7 +153,7 @@ export class PetApi extends runtime.BaseAPI { /** * Deletes a pet */ - async deletePet(petId: number, , apiKey?: string, initOverrides?: RequestInit): Promise { + async deletePet(petId: number, apiKey?: string, initOverrides?: RequestInit): Promise { await this.deletePetRaw({ petId: petId, apiKey: apiKey }, initOverrides); } @@ -447,7 +447,7 @@ export class PetApi extends runtime.BaseAPI { /** * Updates a pet in the store with form data */ - async updatePetWithForm(petId: number, , name?: string, , status?: string, initOverrides?: RequestInit): Promise { + async updatePetWithForm(petId: number, name?: string, status?: string, initOverrides?: RequestInit): Promise { await this.updatePetWithFormRaw({ petId: petId, name: name, status: status }, initOverrides); } @@ -506,7 +506,7 @@ export class PetApi extends runtime.BaseAPI { /** * uploads an image */ - async uploadFile(petId: number, , additionalMetadata?: string, , file?: Blob, initOverrides?: RequestInit): Promise { + async uploadFile(petId: number, additionalMetadata?: string, file?: Blob, initOverrides?: RequestInit): Promise { const response = await this.uploadFileRaw({ petId: petId, additionalMetadata: additionalMetadata, file: file }, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetPartApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetPartApi.ts index 1586d3f0a9d5..887bc3d5ebab 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetPartApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetPartApi.ts @@ -128,7 +128,7 @@ export class PetPartApi extends runtime.BaseAPI { /** * Get the matching parts for the given pet part. */ - async getMatchingParts(fakePetPartId: number, , _long: boolean, , smooth: boolean, , _short: boolean, , name?: string, , connectedPart?: string, initOverrides?: RequestInit): Promise { + async getMatchingParts(fakePetPartId: number, _long: boolean, smooth: boolean, _short: boolean, name?: string, connectedPart?: string, initOverrides?: RequestInit): Promise { const response = await this.getMatchingPartsRaw({ fakePetPartId: fakePetPartId, _long: _long, smooth: smooth, _short: _short, name: name, connectedPart: connectedPart }, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts index a55f4cf736ad..46b07183de4b 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts @@ -254,7 +254,7 @@ export class UserApi extends runtime.BaseAPI { /** * Logs user into the system */ - async loginUser(username: string, , password: string, initOverrides?: RequestInit): Promise { + async loginUser(username: string, password: string, initOverrides?: RequestInit): Promise { const response = await this.loginUserRaw({ username: username, password: password }, initOverrides); return await response.value(); } @@ -318,7 +318,7 @@ export class UserApi extends runtime.BaseAPI { * This can only be done by the logged in user. * Updated user */ - async updateUser(username: string, , body: User, initOverrides?: RequestInit): Promise { + async updateUser(username: string, body: User, initOverrides?: RequestInit): Promise { const response = await this.updateUserRaw({ username: username, body: body }, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/index.ts index 4a025f4ed411..4b267cb8ef60 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/index.ts @@ -1,3 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ export * from './SagaApiManager' export * from './allSagas' export * from './BehaviorApi'; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/index.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/index.ts index abbe33d5b208..9b0738124669 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/index.ts @@ -1,3 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ export * from './runtime'; export * from './runtimeSagasAndRecords'; export * from './ApiEntitiesRecord'; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/index.ts index 6881bb9feda5..b4f59662cbcc 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/index.ts @@ -1,3 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ export * from './BehaviorType'; export * from './Category'; export * from './CategoryRecord'; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json new file mode 100644 index 000000000000..ff53e4530f70 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "@openapitools/typescript-fetch-petstore", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + } + } +}