Skip to content

Commit bf79b1e

Browse files
committed
rebase on cleaned repository
1 parent b94d232 commit bf79b1e

File tree

207 files changed

+1087
-848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1087
-848
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.18.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.yarn/install-state.gz

109 KB
Binary file not shown.

README.md

Lines changed: 10 additions & 4 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{#apiInfo}}
2+
{{#apis}}
3+
{{#operations}}
4+
export * from './{{ classFilename }}';
5+
import { {{ classname }} } from './{{ classFilename }}';
6+
{{/operations}}
7+
{{#withInterfaces}}
8+
export * from './{{ classFilename }}Interface'
9+
{{/withInterfaces}}
10+
{{/apis}}
11+
import * as http from 'http';
12+
13+
export class HttpError extends Error {
14+
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
15+
super('HTTP request failed');
16+
this.name = 'HttpError';
17+
}
18+
}
19+
20+
export { RequestFile } from '../model/models';
21+
22+
export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}];
23+
{{/apiInfo}}
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
{{>licenseInfo}}
2+
3+
import localVarRequest from 'request';
4+
import http from 'http';
5+
6+
/* tslint:disable:no-unused-locals */
7+
{{#imports}}
8+
import { {{classname}} } from '{{filename}}';
9+
{{/imports}}
10+
11+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
12+
{{#hasAuthMethods}}
13+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
14+
{{/hasAuthMethods}}
15+
16+
import { HttpError, RequestFile } from './apis';
17+
18+
let defaultBasePath = '{{{basePath}}}';
19+
20+
// ===============================================
21+
// This file is autogenerated - Please do not edit
22+
// ===============================================
23+
24+
{{#operations}}
25+
{{#description}}
26+
/**
27+
* {{&description}}
28+
*/
29+
{{/description}}
30+
export enum {{classname}}ApiKeys {
31+
{{#authMethods}}
32+
{{#isApiKey}}
33+
{{name}},
34+
{{/isApiKey}}
35+
{{/authMethods}}
36+
}
37+
38+
export class {{classname}} {
39+
protected _basePath = defaultBasePath;
40+
protected _defaultHeaders : any = {};
41+
protected _useQuerystring : boolean = false;
42+
43+
protected authentications = {
44+
'default': <Authentication>new VoidAuth(),
45+
{{#hasAuthMethods}}
46+
{{#authMethods}}
47+
{{#isBasicBasic}}
48+
'{{name}}': new HttpBasicAuth(),
49+
{{/isBasicBasic}}
50+
{{#isBasicBearer}}
51+
'{{name}}': new HttpBearerAuth(),
52+
{{/isBasicBearer}}
53+
{{#isApiKey}}
54+
'{{name}}': new ApiKeyAuth({{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}{{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}, '{{keyParamName}}'),
55+
{{/isApiKey}}
56+
{{#isOAuth}}
57+
'{{name}}': new OAuth(),
58+
{{/isOAuth}}
59+
{{/authMethods}}
60+
{{/hasAuthMethods}}
61+
}
62+
63+
protected interceptors: Interceptor[] = [];
64+
65+
constructor(basePath?: string);
66+
{{#authMethods}}
67+
{{#isBasicBasic}}
68+
constructor(username: string, password: string, basePath?: string);
69+
{{/isBasicBasic}}
70+
{{/authMethods}}
71+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
72+
if (password) {
73+
{{#authMethods}}
74+
{{#isBasicBasic}}
75+
this.username = basePathOrUsername;
76+
this.password = password
77+
{{/isBasicBasic}}
78+
{{/authMethods}}
79+
if (basePath) {
80+
this.basePath = basePath;
81+
}
82+
} else {
83+
if (basePathOrUsername) {
84+
this.basePath = basePathOrUsername
85+
}
86+
}
87+
}
88+
89+
set useQuerystring(value: boolean) {
90+
this._useQuerystring = value;
91+
}
92+
93+
set basePath(basePath: string) {
94+
this._basePath = basePath;
95+
}
96+
97+
set defaultHeaders(defaultHeaders: any) {
98+
this._defaultHeaders = defaultHeaders;
99+
}
100+
101+
get defaultHeaders() {
102+
return this._defaultHeaders;
103+
}
104+
105+
get basePath() {
106+
return this._basePath;
107+
}
108+
109+
public setDefaultAuthentication(auth: Authentication) {
110+
this.authentications.default = auth;
111+
}
112+
113+
public setApiKey(key: {{classname}}ApiKeys, value: string) {
114+
(this.authentications as any)[{{classname}}ApiKeys[key]].apiKey = value;
115+
}
116+
{{#hasAuthMethods}}
117+
{{#authMethods}}
118+
{{#isBasicBasic}}
119+
120+
set username(username: string) {
121+
this.authentications.{{name}}.username = username;
122+
}
123+
124+
set password(password: string) {
125+
this.authentications.{{name}}.password = password;
126+
}
127+
{{/isBasicBasic}}
128+
{{#isBasicBearer}}
129+
130+
set accessToken(accessToken: string | (() => string)) {
131+
this.authentications.{{name}}.accessToken = accessToken;
132+
}
133+
{{/isBasicBearer}}
134+
{{#isOAuth}}
135+
136+
set accessToken(token: string) {
137+
this.authentications.{{name}}.accessToken = token;
138+
}
139+
{{/isOAuth}}
140+
{{/authMethods}}
141+
{{/hasAuthMethods}}
142+
143+
public addInterceptor(interceptor: Interceptor) {
144+
this.interceptors.push(interceptor);
145+
}
146+
147+
{{#operation}}
148+
/**
149+
* {{&notes}}
150+
{{#summary}}
151+
* @summary {{&summary}}
152+
{{/summary}}
153+
{{#allParams}}
154+
* @param {{paramName}} {{description}}
155+
{{/allParams}}
156+
*/
157+
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}} }> {
158+
const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}
159+
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
160+
let localVarQueryParameters: any = {};
161+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
162+
{{#hasProduces}}
163+
const produces = [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}];
164+
// give precedence to 'application/json'
165+
if (produces.indexOf('application/json') >= 0) {
166+
localVarHeaderParams.Accept = 'application/json';
167+
} else {
168+
localVarHeaderParams.Accept = produces.join(',');
169+
}
170+
{{/hasProduces}}
171+
let localVarFormParams: any = {};
172+
173+
{{#allParams}}
174+
{{#required}}
175+
// verify required parameter '{{paramName}}' is not null or undefined
176+
if ({{paramName}} === null || {{paramName}} === undefined) {
177+
throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.');
178+
}
179+
180+
{{/required}}
181+
{{/allParams}}
182+
{{#queryParams}}
183+
if ({{paramName}} !== undefined) {
184+
localVarQueryParameters['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}");
185+
}
186+
187+
{{/queryParams}}
188+
{{#headerParams}}
189+
localVarHeaderParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}");
190+
{{/headerParams}}
191+
(<any>Object).assign(localVarHeaderParams, options.headers);
192+
193+
let localVarUseFormData = false;
194+
195+
{{#formParams}}
196+
if ({{paramName}} !== undefined) {
197+
{{#isFile}}
198+
localVarFormParams['{{baseName}}'] = {{paramName}};
199+
{{/isFile}}
200+
{{^isFile}}
201+
localVarFormParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}");
202+
{{/isFile}}
203+
}
204+
{{#isFile}}
205+
localVarUseFormData = true;
206+
{{/isFile}}
207+
208+
{{/formParams}}
209+
let localVarRequestOptions: localVarRequest.Options = {
210+
method: '{{httpMethod}}',
211+
qs: localVarQueryParameters,
212+
headers: localVarHeaderParams,
213+
uri: localVarPath,
214+
useQuerystring: this._useQuerystring,
215+
{{^isResponseFile}}
216+
json: true,
217+
{{/isResponseFile}}
218+
{{#isResponseFile}}
219+
encoding: null,
220+
{{/isResponseFile}}
221+
{{#bodyParam}}
222+
body: ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}")
223+
{{/bodyParam}}
224+
};
225+
226+
let authenticationPromise = Promise.resolve();
227+
{{#authMethods}}
228+
{{#isApiKey}}
229+
if (this.authentications.{{name}}.apiKey) {
230+
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
231+
}
232+
{{/isApiKey}}
233+
{{#isBasicBasic}}
234+
if (this.authentications.{{name}}.username && this.authentications.{{name}}.password) {
235+
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
236+
}
237+
{{/isBasicBasic}}
238+
{{#isBasicBearer}}
239+
if (this.authentications.{{name}}.accessToken) {
240+
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
241+
}
242+
{{/isBasicBearer}}
243+
{{#isOAuth}}
244+
if (this.authentications.{{name}}.accessToken) {
245+
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
246+
}
247+
{{/isOAuth}}
248+
{{/authMethods}}
249+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
250+
251+
let interceptorPromise = authenticationPromise;
252+
for (const interceptor of this.interceptors) {
253+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
254+
}
255+
256+
return interceptorPromise.then(() => {
257+
if (Object.keys(localVarFormParams).length) {
258+
if (localVarUseFormData) {
259+
(<any>localVarRequestOptions).formData = localVarFormParams;
260+
} else {
261+
localVarRequestOptions.form = localVarFormParams;
262+
}
263+
}
264+
return new Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => {
265+
localVarRequest(localVarRequestOptions, (error, response, body) => {
266+
if (error) {
267+
reject(error);
268+
} else {
269+
{{#returnType}}
270+
body = ObjectSerializer.deserialize(body, "{{{returnType}}}");
271+
{{/returnType}}
272+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
273+
resolve({ response: response, body: body });
274+
} else {
275+
reject(new HttpError(response, body, response.statusCode));
276+
}
277+
}
278+
});
279+
});
280+
});
281+
}
282+
{{/operation}}
283+
}
284+
{{/operations}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This is the entrypoint for the package
2+
export * from './client-search/apis';
3+
export * from './model/models';

algolia-typescript-template/gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
typings
3+
dist
4+
build
5+
.env
6+
.vscode
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* {{{appName}}}
3+
* {{{appDescription}}}
4+
*
5+
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
6+
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/

0 commit comments

Comments
 (0)