File tree 8 files changed +23
-46
lines changed
algolia-typescript-template
8 files changed +23
-46
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,7 @@ export class HttpError extends Error {
19
19
20
20
export { RequestFile } from '../model/models';
21
21
22
+ export class searchClient extends SearchApi{ }
23
+
22
24
export const APIS = [{ {#apis} }{ {#operations} }{ { classname } }{ {/operations} }{ {^-last} }, { {/-last} }{ {/apis} }];
23
25
{ {/apiInfo} }
Original file line number Diff line number Diff line change @@ -59,27 +59,14 @@ export class {{classname}} {
59
59
60
60
protected interceptors: Interceptor[] = [];
61
61
62
- constructor(basePath?: string);
63
- { {#authMethods} }
64
- { {#isBasicBasic} }
65
- constructor(username: string, password: string, basePath?: string);
66
- { {/isBasicBasic} }
67
- { {/authMethods} }
68
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
69
- if (password) {
70
- {{#authMethods} }
71
- { {#isBasicBasic} }
72
- this.username = basePathOrUsername;
73
- this.password = password
74
- { {/isBasicBasic} }
75
- { {/authMethods} }
76
- if (basePath) {
77
- this.basePath = basePath;
78
- }
79
- } else {
80
- if (basePathOrUsername) {
81
- this.basePath = basePathOrUsername
82
- }
62
+ constructor(appId: string, apiKey: string, basePath?: string) {
63
+
64
+ this.setApiKey(SearchApiApiKeys.appId, appId);
65
+ this.setApiKey(SearchApiApiKeys.apiKey, apiKey);
66
+ this.basePath = ' https://' + appId + ' -1.algolianet.com' ;
67
+
68
+ if (basePath) {
69
+ this.basePath = basePath;
83
70
}
84
71
}
85
72
Original file line number Diff line number Diff line change 1
- import { searchClient } from './searchClient ' ;
1
+ import { searchClient } from 'algoliasearch-client-javascript ' ;
2
2
3
3
const appId = process . env . ALGOLIA_APPLICATION_ID_1 || '**** APP_ID *****' ;
4
4
const apiKey = process . env . ALGOLIA_ADMIN_KEY_1 || '**** API_KEY *****' ;
Original file line number Diff line number Diff line change @@ -11,4 +11,6 @@ export class HttpError extends Error {
11
11
12
12
export { RequestFile } from '../model/models' ;
13
13
14
+ export class searchClient extends SearchApi { }
15
+
14
16
export const APIS = [ SearchApi ] ;
Original file line number Diff line number Diff line change @@ -36,16 +36,13 @@ export class SearchApi {
36
36
37
37
protected interceptors : Interceptor [ ] = [ ] ;
38
38
39
- constructor ( basePath ?: string ) ;
40
- constructor ( basePathOrUsername : string , password ?: string , basePath ?: string ) {
41
- if ( password ) {
42
- if ( basePath ) {
43
- this . basePath = basePath ;
44
- }
45
- } else {
46
- if ( basePathOrUsername ) {
47
- this . basePath = basePathOrUsername ;
48
- }
39
+ constructor ( appId : string , apiKey : string , basePath ?: string ) {
40
+ this . setApiKey ( SearchApiApiKeys . appId , appId ) ;
41
+ this . setApiKey ( SearchApiApiKeys . apiKey , apiKey ) ;
42
+ this . basePath = 'https://' + appId + '-1.algolianet.com' ;
43
+
44
+ if ( basePath ) {
45
+ this . basePath = basePath ;
49
46
}
50
47
}
51
48
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 16
16
"outDir" : " dist" ,
17
17
"typeRoots" : [" node_modules/@types" ]
18
18
},
19
- "include" : [" searchClient.ts " , " app.ts" ]
19
+ "include" : [" app.ts" ]
20
20
}
Original file line number Diff line number Diff line change @@ -226,11 +226,11 @@ __metadata:
226
226
227
227
" algoliasearch-client-javascript@file:output/::locator=%40algolia%2Fautomation-javascript-client%40workspace%3A. " :
228
228
version : 5.0.0
229
- resolution : " algoliasearch-client-javascript@file:output/#output/::hash=d8075e &locator=%40algolia%2Fautomation-javascript-client%40workspace%3A."
229
+ resolution : " algoliasearch-client-javascript@file:output/#output/::hash=342434 &locator=%40algolia%2Fautomation-javascript-client%40workspace%3A."
230
230
dependencies :
231
231
" @types/request " : ^2.48.7
232
232
request : ^2.81.0
233
- checksum : e5b977ffab9bcff3a3d3ef9754c43424b825a47865cff391483674c4d837f579687d4ff5c8243acf3ca7a0d7d8f042dec1a1ed4659f7898ac6cc3851dfb02b40
233
+ checksum : 79ae2881a4d93698d4600f7710ea07512df105e9faf61982acc2cc8327d1666fe39f7e83c4a4d471b1876c321b932850a49923a49d22d474bacdf16dfaa81e71
234
234
languageName : node
235
235
linkType : hard
236
236
You can’t perform that action at this time.
0 commit comments