Skip to content

fix(api-single-template): correct return type #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion algolia-typescript-template/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class {{classname}} {
* @param {{paramName}} {{description}}
{{/allParams}}
*/
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{{{returnType}}}> {
const path = '{{{path}}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
let headers: Headers = {};
Expand Down
6 changes: 3 additions & 3 deletions output/client-search/searchApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class SearchApi {
indexName: string,
batchObject: BatchObject,
options: { headers: { [name: string]: string } } = { headers: {} }
): Promise<{ response: http.IncomingMessage; body: BatchResponse }> {
): Promise<BatchResponse> {
const path = '/1/indexes/{indexName}/batch'.replace(
'{' + 'indexName' + '}',
encodeURIComponent(String(indexName))
Expand Down Expand Up @@ -151,7 +151,7 @@ export class SearchApi {
public async multipleQueries(
multipleQueriesObject: MultipleQueriesObject,
options: { headers: { [name: string]: string } } = { headers: {} }
): Promise<{ response: http.IncomingMessage; body: MultipleQueriesResponse }> {
): Promise<MultipleQueriesResponse> {
const path = '/1/indexes/*/queries';
let headers: Headers = {};
let queryParameters: Record<string, string> = {};
Expand Down Expand Up @@ -218,7 +218,7 @@ export class SearchApi {
indexName: string,
requestBody: { [key: string]: object },
options: { headers: { [name: string]: string } } = { headers: {} }
): Promise<{ response: http.IncomingMessage; body: SaveObjectResponse }> {
): Promise<SaveObjectResponse> {
const path = '/1/indexes/{indexName}'.replace(
'{' + 'indexName' + '}',
encodeURIComponent(String(indexName))
Expand Down
1 change: 0 additions & 1 deletion output/complement

This file was deleted.

4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ __metadata:

"algoliasearch-client-javascript@file:output/::locator=%40algolia%2Fautomation-javascript-client%40workspace%3A.":
version: 5.0.0
resolution: "algoliasearch-client-javascript@file:output/#output/::hash=892be8&locator=%40algolia%2Fautomation-javascript-client%40workspace%3A."
checksum: efc65e36fc802d92d12c6d199daad038886325e334f9067d65242da736a3fd098b18ebaaf37914f58a04f95b3f474d4cfbc04264db8bd429c22f9785c6d2b804
resolution: "algoliasearch-client-javascript@file:output/#output/::hash=4ddc2e&locator=%40algolia%2Fautomation-javascript-client%40workspace%3A."
checksum: 2d82602e6f0874106d06f1118faa6dc32bdfbb367ff0a454890b82b4b7f5853270f509db510aeecd178646063840b03f920a5f5ea402f492d1f9a6101abaa592
languageName: node
linkType: hard

Expand Down