Skip to content

Commit d4e2278

Browse files
authored
Merge pull request #10 from algolia/fix/api-single-return-type
fix(api-single-template): correct return type
2 parents 8a22000 + 713a681 commit d4e2278

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

algolia-typescript-template/api-single.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class {{classname}} {
127127
* @param {{paramName}} {{description}}
128128
{{/allParams}}
129129
*/
130-
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}} }> {
130+
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{{{returnType}}}> {
131131
const path = '{{{path}}}'{{#pathParams}}
132132
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
133133
let headers: Headers = {};

output/client-search/searchApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class SearchApi {
8080
indexName: string,
8181
batchObject: BatchObject,
8282
options: { headers: { [name: string]: string } } = { headers: {} }
83-
): Promise<{ response: http.IncomingMessage; body: BatchResponse }> {
83+
): Promise<BatchResponse> {
8484
const path = '/1/indexes/{indexName}/batch'.replace(
8585
'{' + 'indexName' + '}',
8686
encodeURIComponent(String(indexName))
@@ -151,7 +151,7 @@ export class SearchApi {
151151
public async multipleQueries(
152152
multipleQueriesObject: MultipleQueriesObject,
153153
options: { headers: { [name: string]: string } } = { headers: {} }
154-
): Promise<{ response: http.IncomingMessage; body: MultipleQueriesResponse }> {
154+
): Promise<MultipleQueriesResponse> {
155155
const path = '/1/indexes/*/queries';
156156
let headers: Headers = {};
157157
let queryParameters: Record<string, string> = {};
@@ -218,7 +218,7 @@ export class SearchApi {
218218
indexName: string,
219219
requestBody: { [key: string]: object },
220220
options: { headers: { [name: string]: string } } = { headers: {} }
221-
): Promise<{ response: http.IncomingMessage; body: SaveObjectResponse }> {
221+
): Promise<SaveObjectResponse> {
222222
const path = '/1/indexes/{indexName}'.replace(
223223
'{' + 'indexName' + '}',
224224
encodeURIComponent(String(indexName))

output/complement

Lines changed: 0 additions & 1 deletion
This file was deleted.

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ __metadata:
188188

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

0 commit comments

Comments
 (0)