@explo-tech/fido-api 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/core/ApiError.ts +24 -0
  2. package/core/ApiRequestOptions.ts +16 -0
  3. package/core/ApiResult.ts +10 -0
  4. package/core/CancelablePromise.ts +130 -0
  5. package/core/OpenAPI.ts +31 -0
  6. package/core/request.ts +307 -0
  7. package/index.ts +47 -0
  8. package/models/BooleanPropertyValue.ts +8 -0
  9. package/models/ClientError.ts +9 -0
  10. package/models/ComputedViewRunRequest.ts +13 -0
  11. package/models/DataPage.ts +10 -0
  12. package/models/DataRequestParameters.ts +11 -0
  13. package/models/DataResponseMetadata.ts +12 -0
  14. package/models/DataSchema.ts +10 -0
  15. package/models/DataSource.ts +15 -0
  16. package/models/DataSourceConfiguration.ts +10 -0
  17. package/models/DataSourceRequest.ts +10 -0
  18. package/models/DataSourceResponse.ts +10 -0
  19. package/models/DataSourceTablePreviewRequest.ts +11 -0
  20. package/models/DatePropertyValue.ts +10 -0
  21. package/models/DateTimePropertyValue.ts +10 -0
  22. package/models/DecimalPropertyValue.ts +8 -0
  23. package/models/DoublePropertyValue.ts +8 -0
  24. package/models/Duration.ts +5 -0
  25. package/models/Instant.ts +5 -0
  26. package/models/IntegerPropertyValue.ts +8 -0
  27. package/models/LocalDate.ts +5 -0
  28. package/models/Namespace.ts +11 -0
  29. package/models/NamespaceRequest.ts +10 -0
  30. package/models/NamespaceResponse.ts +12 -0
  31. package/models/NamespaceResponseMetadata.ts +10 -0
  32. package/models/PagingConfiguration.ts +9 -0
  33. package/models/PropertySchema.ts +13 -0
  34. package/models/PropertyType.ts +14 -0
  35. package/models/PropertyValue.ts +14 -0
  36. package/models/QueryExecutionResponse.ts +15 -0
  37. package/models/Record.ts +10 -0
  38. package/models/RequestTelemetry.ts +12 -0
  39. package/models/StringPropertyValue.ts +8 -0
  40. package/models/Tunnel.ts +5 -0
  41. package/models/UUID.ts +5 -0
  42. package/package.json +1 -1
  43. package/services/DatasourceResourceService.ts +106 -0
  44. package/services/HealthResourceService.ts +45 -0
  45. package/services/NamespaceResourceService.ts +99 -0
  46. package/services/QueryResourceService.ts +65 -0
  47. package/.openapi-generator/FILES +0 -32
  48. package/.openapi-generator/VERSION +0 -1
  49. package/.openapi-generator-ignore +0 -23
  50. package/.tool-versions +0 -1
  51. package/api/apis.ts +0 -20
  52. package/api/datasourceResourceApi.ts +0 -412
  53. package/api/healthResourceApi.ts +0 -239
  54. package/api/namespaceResourceApi.ts +0 -389
  55. package/api/queryResourceApi.ts +0 -261
  56. package/api.ts +0 -3
  57. package/git_push.sh +0 -57
  58. package/model/clientError.ts +0 -37
  59. package/model/computedViewRunRequest.ts +0 -50
  60. package/model/dataPage.ts +0 -32
  61. package/model/dataRequestParameters.ts +0 -38
  62. package/model/dataResponseMetadata.ts +0 -44
  63. package/model/dataSchema.ts +0 -32
  64. package/model/dataSource.ts +0 -56
  65. package/model/dataSourceConfiguration.ts +0 -31
  66. package/model/dataSourceRequest.ts +0 -32
  67. package/model/dataSourceResponse.ts +0 -32
  68. package/model/dataSourceTablePreviewRequest.ts +0 -38
  69. package/model/models.ts +0 -288
  70. package/model/namespace.ts +0 -37
  71. package/model/namespaceRequest.ts +0 -32
  72. package/model/namespaceResponse.ts +0 -39
  73. package/model/namespaceResponseMeta.ts +0 -32
  74. package/model/namespaceResponseMetadata.ts +0 -32
  75. package/model/pagingConfiguration.ts +0 -37
  76. package/model/propertySchema.ts +0 -52
  77. package/model/propertyType.ts +0 -24
  78. package/model/queryExecutionResponse.ts +0 -52
  79. package/model/queryExecutionResponseRequestTelemetry.ts +0 -43
  80. package/model/record.ts +0 -31
  81. package/model/requestTelemetry.ts +0 -43
package/api/apis.ts DELETED
@@ -1,20 +0,0 @@
1
- export * from './datasourceResourceApi';
2
- import { DatasourceResourceApi } from './datasourceResourceApi';
3
- export * from './healthResourceApi';
4
- import { HealthResourceApi } from './healthResourceApi';
5
- export * from './namespaceResourceApi';
6
- import { NamespaceResourceApi } from './namespaceResourceApi';
7
- export * from './queryResourceApi';
8
- import { QueryResourceApi } from './queryResourceApi';
9
- import * as http from 'http';
10
-
11
- export class HttpError extends Error {
12
- constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
13
- super('HTTP request failed');
14
- this.name = 'HttpError';
15
- }
16
- }
17
-
18
- export { RequestFile } from '../model/models';
19
-
20
- export const APIS = [DatasourceResourceApi, HealthResourceApi, NamespaceResourceApi, QueryResourceApi];
@@ -1,412 +0,0 @@
1
- /**
2
- * fido API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: unspecified
6
- *
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
- */
12
-
13
-
14
- import localVarRequest from 'request';
15
- import http from 'http';
16
-
17
- /* tslint:disable:no-unused-locals */
18
- import { ClientError } from '../model/clientError';
19
- import { DataSourceRequest } from '../model/dataSourceRequest';
20
- import { DataSourceResponse } from '../model/dataSourceResponse';
21
-
22
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
23
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
24
-
25
- import { HttpError, RequestFile } from './apis';
26
-
27
- let defaultBasePath = 'http://localhost';
28
-
29
- // ===============================================
30
- // This file is autogenerated - Please do not edit
31
- // ===============================================
32
-
33
- export enum DatasourceResourceApiApiKeys {
34
- }
35
-
36
- export class DatasourceResourceApi {
37
- protected _basePath = defaultBasePath;
38
- protected _defaultHeaders : any = {};
39
- protected _useQuerystring : boolean = false;
40
-
41
- protected authentications = {
42
- 'default': <Authentication>new VoidAuth(),
43
- 'SecurityScheme': new HttpBasicAuth(),
44
- }
45
-
46
- protected interceptors: Interceptor[] = [];
47
-
48
- constructor(basePath?: string);
49
- constructor(username: string, password: string, basePath?: string);
50
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
51
- if (password) {
52
- this.username = basePathOrUsername;
53
- this.password = password
54
- if (basePath) {
55
- this.basePath = basePath;
56
- }
57
- } else {
58
- if (basePathOrUsername) {
59
- this.basePath = basePathOrUsername
60
- }
61
- }
62
- }
63
-
64
- set useQuerystring(value: boolean) {
65
- this._useQuerystring = value;
66
- }
67
-
68
- set basePath(basePath: string) {
69
- this._basePath = basePath;
70
- }
71
-
72
- set defaultHeaders(defaultHeaders: any) {
73
- this._defaultHeaders = defaultHeaders;
74
- }
75
-
76
- get defaultHeaders() {
77
- return this._defaultHeaders;
78
- }
79
-
80
- get basePath() {
81
- return this._basePath;
82
- }
83
-
84
- public setDefaultAuthentication(auth: Authentication) {
85
- this.authentications.default = auth;
86
- }
87
-
88
- public setApiKey(key: DatasourceResourceApiApiKeys, value: string) {
89
- (this.authentications as any)[DatasourceResourceApiApiKeys[key]].apiKey = value;
90
- }
91
-
92
- set username(username: string) {
93
- this.authentications.SecurityScheme.username = username;
94
- }
95
-
96
- set password(password: string) {
97
- this.authentications.SecurityScheme.password = password;
98
- }
99
-
100
- public addInterceptor(interceptor: Interceptor) {
101
- this.interceptors.push(interceptor);
102
- }
103
-
104
- /**
105
- *
106
- * @summary Creates a data source
107
- * @param id
108
- * @param namespaceId
109
- * @param dataSourceRequest
110
- */
111
- public async createDataSource (id: string, namespaceId: string, dataSourceRequest?: DataSourceRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }> {
112
- const localVarPath = this.basePath + '/v1/namespaces/{namespaceId}/data-sources/{id}'
113
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
114
- .replace('{' + 'namespaceId' + '}', encodeURIComponent(String(namespaceId)));
115
- let localVarQueryParameters: any = {};
116
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
117
- const produces = ['application/json'];
118
- // give precedence to 'application/json'
119
- if (produces.indexOf('application/json') >= 0) {
120
- localVarHeaderParams.Accept = 'application/json';
121
- } else {
122
- localVarHeaderParams.Accept = produces.join(',');
123
- }
124
- let localVarFormParams: any = {};
125
-
126
- // verify required parameter 'id' is not null or undefined
127
- if (id === null || id === undefined) {
128
- throw new Error('Required parameter id was null or undefined when calling createDataSource.');
129
- }
130
-
131
- // verify required parameter 'namespaceId' is not null or undefined
132
- if (namespaceId === null || namespaceId === undefined) {
133
- throw new Error('Required parameter namespaceId was null or undefined when calling createDataSource.');
134
- }
135
-
136
- (<any>Object).assign(localVarHeaderParams, options.headers);
137
-
138
- let localVarUseFormData = false;
139
-
140
- let localVarRequestOptions: localVarRequest.Options = {
141
- method: 'POST',
142
- qs: localVarQueryParameters,
143
- headers: localVarHeaderParams,
144
- uri: localVarPath,
145
- useQuerystring: this._useQuerystring,
146
- json: true,
147
- body: ObjectSerializer.serialize(dataSourceRequest, "DataSourceRequest")
148
- };
149
-
150
- let authenticationPromise = Promise.resolve();
151
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
152
-
153
- let interceptorPromise = authenticationPromise;
154
- for (const interceptor of this.interceptors) {
155
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
156
- }
157
-
158
- return interceptorPromise.then(() => {
159
- if (Object.keys(localVarFormParams).length) {
160
- if (localVarUseFormData) {
161
- (<any>localVarRequestOptions).formData = localVarFormParams;
162
- } else {
163
- localVarRequestOptions.form = localVarFormParams;
164
- }
165
- }
166
- return new Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }>((resolve, reject) => {
167
- localVarRequest(localVarRequestOptions, (error, response, body) => {
168
- if (error) {
169
- reject(error);
170
- } else {
171
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
172
- body = ObjectSerializer.deserialize(body, "DataSourceResponse");
173
- resolve({ response: response, body: body });
174
- } else {
175
- reject(new HttpError(response, body, response.statusCode));
176
- }
177
- }
178
- });
179
- });
180
- });
181
- }
182
- /**
183
- *
184
- * @summary Deletes a data source
185
- * @param id
186
- * @param namespaceId
187
- */
188
- public async deleteDataSource (id: string, namespaceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
189
- const localVarPath = this.basePath + '/v1/namespaces/{namespaceId}/data-sources/{id}'
190
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
191
- .replace('{' + 'namespaceId' + '}', encodeURIComponent(String(namespaceId)));
192
- let localVarQueryParameters: any = {};
193
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
194
- const produces = ['application/json'];
195
- // give precedence to 'application/json'
196
- if (produces.indexOf('application/json') >= 0) {
197
- localVarHeaderParams.Accept = 'application/json';
198
- } else {
199
- localVarHeaderParams.Accept = produces.join(',');
200
- }
201
- let localVarFormParams: any = {};
202
-
203
- // verify required parameter 'id' is not null or undefined
204
- if (id === null || id === undefined) {
205
- throw new Error('Required parameter id was null or undefined when calling deleteDataSource.');
206
- }
207
-
208
- // verify required parameter 'namespaceId' is not null or undefined
209
- if (namespaceId === null || namespaceId === undefined) {
210
- throw new Error('Required parameter namespaceId was null or undefined when calling deleteDataSource.');
211
- }
212
-
213
- (<any>Object).assign(localVarHeaderParams, options.headers);
214
-
215
- let localVarUseFormData = false;
216
-
217
- let localVarRequestOptions: localVarRequest.Options = {
218
- method: 'DELETE',
219
- qs: localVarQueryParameters,
220
- headers: localVarHeaderParams,
221
- uri: localVarPath,
222
- useQuerystring: this._useQuerystring,
223
- json: true,
224
- };
225
-
226
- let authenticationPromise = Promise.resolve();
227
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
228
-
229
- let interceptorPromise = authenticationPromise;
230
- for (const interceptor of this.interceptors) {
231
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
232
- }
233
-
234
- return interceptorPromise.then(() => {
235
- if (Object.keys(localVarFormParams).length) {
236
- if (localVarUseFormData) {
237
- (<any>localVarRequestOptions).formData = localVarFormParams;
238
- } else {
239
- localVarRequestOptions.form = localVarFormParams;
240
- }
241
- }
242
- return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
243
- localVarRequest(localVarRequestOptions, (error, response, body) => {
244
- if (error) {
245
- reject(error);
246
- } else {
247
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
248
- body = ObjectSerializer.deserialize(body, "object");
249
- resolve({ response: response, body: body });
250
- } else {
251
- reject(new HttpError(response, body, response.statusCode));
252
- }
253
- }
254
- });
255
- });
256
- });
257
- }
258
- /**
259
- *
260
- * @summary Gets a data source
261
- * @param id
262
- * @param namespaceId
263
- */
264
- public async getDataSource (id: string, namespaceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }> {
265
- const localVarPath = this.basePath + '/v1/namespaces/{namespaceId}/data-sources/{id}'
266
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
267
- .replace('{' + 'namespaceId' + '}', encodeURIComponent(String(namespaceId)));
268
- let localVarQueryParameters: any = {};
269
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
270
- const produces = ['application/json'];
271
- // give precedence to 'application/json'
272
- if (produces.indexOf('application/json') >= 0) {
273
- localVarHeaderParams.Accept = 'application/json';
274
- } else {
275
- localVarHeaderParams.Accept = produces.join(',');
276
- }
277
- let localVarFormParams: any = {};
278
-
279
- // verify required parameter 'id' is not null or undefined
280
- if (id === null || id === undefined) {
281
- throw new Error('Required parameter id was null or undefined when calling getDataSource.');
282
- }
283
-
284
- // verify required parameter 'namespaceId' is not null or undefined
285
- if (namespaceId === null || namespaceId === undefined) {
286
- throw new Error('Required parameter namespaceId was null or undefined when calling getDataSource.');
287
- }
288
-
289
- (<any>Object).assign(localVarHeaderParams, options.headers);
290
-
291
- let localVarUseFormData = false;
292
-
293
- let localVarRequestOptions: localVarRequest.Options = {
294
- method: 'GET',
295
- qs: localVarQueryParameters,
296
- headers: localVarHeaderParams,
297
- uri: localVarPath,
298
- useQuerystring: this._useQuerystring,
299
- json: true,
300
- };
301
-
302
- let authenticationPromise = Promise.resolve();
303
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
304
-
305
- let interceptorPromise = authenticationPromise;
306
- for (const interceptor of this.interceptors) {
307
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
308
- }
309
-
310
- return interceptorPromise.then(() => {
311
- if (Object.keys(localVarFormParams).length) {
312
- if (localVarUseFormData) {
313
- (<any>localVarRequestOptions).formData = localVarFormParams;
314
- } else {
315
- localVarRequestOptions.form = localVarFormParams;
316
- }
317
- }
318
- return new Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }>((resolve, reject) => {
319
- localVarRequest(localVarRequestOptions, (error, response, body) => {
320
- if (error) {
321
- reject(error);
322
- } else {
323
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
324
- body = ObjectSerializer.deserialize(body, "DataSourceResponse");
325
- resolve({ response: response, body: body });
326
- } else {
327
- reject(new HttpError(response, body, response.statusCode));
328
- }
329
- }
330
- });
331
- });
332
- });
333
- }
334
- /**
335
- *
336
- * @summary Updates a data source\'s metadata
337
- * @param id
338
- * @param namespaceId
339
- * @param dataSourceRequest
340
- */
341
- public async updateDataSource (id: string, namespaceId: string, dataSourceRequest?: DataSourceRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }> {
342
- const localVarPath = this.basePath + '/v1/namespaces/{namespaceId}/data-sources/{id}'
343
- .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
344
- .replace('{' + 'namespaceId' + '}', encodeURIComponent(String(namespaceId)));
345
- let localVarQueryParameters: any = {};
346
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
347
- const produces = ['application/json'];
348
- // give precedence to 'application/json'
349
- if (produces.indexOf('application/json') >= 0) {
350
- localVarHeaderParams.Accept = 'application/json';
351
- } else {
352
- localVarHeaderParams.Accept = produces.join(',');
353
- }
354
- let localVarFormParams: any = {};
355
-
356
- // verify required parameter 'id' is not null or undefined
357
- if (id === null || id === undefined) {
358
- throw new Error('Required parameter id was null or undefined when calling updateDataSource.');
359
- }
360
-
361
- // verify required parameter 'namespaceId' is not null or undefined
362
- if (namespaceId === null || namespaceId === undefined) {
363
- throw new Error('Required parameter namespaceId was null or undefined when calling updateDataSource.');
364
- }
365
-
366
- (<any>Object).assign(localVarHeaderParams, options.headers);
367
-
368
- let localVarUseFormData = false;
369
-
370
- let localVarRequestOptions: localVarRequest.Options = {
371
- method: 'PUT',
372
- qs: localVarQueryParameters,
373
- headers: localVarHeaderParams,
374
- uri: localVarPath,
375
- useQuerystring: this._useQuerystring,
376
- json: true,
377
- body: ObjectSerializer.serialize(dataSourceRequest, "DataSourceRequest")
378
- };
379
-
380
- let authenticationPromise = Promise.resolve();
381
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
382
-
383
- let interceptorPromise = authenticationPromise;
384
- for (const interceptor of this.interceptors) {
385
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
386
- }
387
-
388
- return interceptorPromise.then(() => {
389
- if (Object.keys(localVarFormParams).length) {
390
- if (localVarUseFormData) {
391
- (<any>localVarRequestOptions).formData = localVarFormParams;
392
- } else {
393
- localVarRequestOptions.form = localVarFormParams;
394
- }
395
- }
396
- return new Promise<{ response: http.IncomingMessage; body: DataSourceResponse; }>((resolve, reject) => {
397
- localVarRequest(localVarRequestOptions, (error, response, body) => {
398
- if (error) {
399
- reject(error);
400
- } else {
401
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
402
- body = ObjectSerializer.deserialize(body, "DataSourceResponse");
403
- resolve({ response: response, body: body });
404
- } else {
405
- reject(new HttpError(response, body, response.statusCode));
406
- }
407
- }
408
- });
409
- });
410
- });
411
- }
412
- }
@@ -1,239 +0,0 @@
1
- /**
2
- * fido API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: unspecified
6
- *
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
- */
12
-
13
-
14
- import localVarRequest from 'request';
15
- import http from 'http';
16
-
17
- /* tslint:disable:no-unused-locals */
18
-
19
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
20
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
21
-
22
- import { HttpError, RequestFile } from './apis';
23
-
24
- let defaultBasePath = 'http://localhost';
25
-
26
- // ===============================================
27
- // This file is autogenerated - Please do not edit
28
- // ===============================================
29
-
30
- export enum HealthResourceApiApiKeys {
31
- }
32
-
33
- export class HealthResourceApi {
34
- protected _basePath = defaultBasePath;
35
- protected _defaultHeaders : any = {};
36
- protected _useQuerystring : boolean = false;
37
-
38
- protected authentications = {
39
- 'default': <Authentication>new VoidAuth(),
40
- 'SecurityScheme': new HttpBasicAuth(),
41
- }
42
-
43
- protected interceptors: Interceptor[] = [];
44
-
45
- constructor(basePath?: string);
46
- constructor(username: string, password: string, basePath?: string);
47
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
48
- if (password) {
49
- this.username = basePathOrUsername;
50
- this.password = password
51
- if (basePath) {
52
- this.basePath = basePath;
53
- }
54
- } else {
55
- if (basePathOrUsername) {
56
- this.basePath = basePathOrUsername
57
- }
58
- }
59
- }
60
-
61
- set useQuerystring(value: boolean) {
62
- this._useQuerystring = value;
63
- }
64
-
65
- set basePath(basePath: string) {
66
- this._basePath = basePath;
67
- }
68
-
69
- set defaultHeaders(defaultHeaders: any) {
70
- this._defaultHeaders = defaultHeaders;
71
- }
72
-
73
- get defaultHeaders() {
74
- return this._defaultHeaders;
75
- }
76
-
77
- get basePath() {
78
- return this._basePath;
79
- }
80
-
81
- public setDefaultAuthentication(auth: Authentication) {
82
- this.authentications.default = auth;
83
- }
84
-
85
- public setApiKey(key: HealthResourceApiApiKeys, value: string) {
86
- (this.authentications as any)[HealthResourceApiApiKeys[key]].apiKey = value;
87
- }
88
-
89
- set username(username: string) {
90
- this.authentications.SecurityScheme.username = username;
91
- }
92
-
93
- set password(password: string) {
94
- this.authentications.SecurityScheme.password = password;
95
- }
96
-
97
- public addInterceptor(interceptor: Interceptor) {
98
- this.interceptors.push(interceptor);
99
- }
100
-
101
- /**
102
- *
103
- * @summary Verifies that the DataSourceConnection verticle is alive
104
- * @param dataSourceId
105
- * @param namespaceId
106
- */
107
- public async getDataSourceConnectionHealth (dataSourceId: string, namespaceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
108
- const localVarPath = this.basePath + '/v1/health/data-source-connection/{namespaceId}/{dataSourceId}'
109
- .replace('{' + 'dataSourceId' + '}', encodeURIComponent(String(dataSourceId)))
110
- .replace('{' + 'namespaceId' + '}', encodeURIComponent(String(namespaceId)));
111
- let localVarQueryParameters: any = {};
112
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
113
- const produces = ['application/json'];
114
- // give precedence to 'application/json'
115
- if (produces.indexOf('application/json') >= 0) {
116
- localVarHeaderParams.Accept = 'application/json';
117
- } else {
118
- localVarHeaderParams.Accept = produces.join(',');
119
- }
120
- let localVarFormParams: any = {};
121
-
122
- // verify required parameter 'dataSourceId' is not null or undefined
123
- if (dataSourceId === null || dataSourceId === undefined) {
124
- throw new Error('Required parameter dataSourceId was null or undefined when calling getDataSourceConnectionHealth.');
125
- }
126
-
127
- // verify required parameter 'namespaceId' is not null or undefined
128
- if (namespaceId === null || namespaceId === undefined) {
129
- throw new Error('Required parameter namespaceId was null or undefined when calling getDataSourceConnectionHealth.');
130
- }
131
-
132
- (<any>Object).assign(localVarHeaderParams, options.headers);
133
-
134
- let localVarUseFormData = false;
135
-
136
- let localVarRequestOptions: localVarRequest.Options = {
137
- method: 'GET',
138
- qs: localVarQueryParameters,
139
- headers: localVarHeaderParams,
140
- uri: localVarPath,
141
- useQuerystring: this._useQuerystring,
142
- json: true,
143
- };
144
-
145
- let authenticationPromise = Promise.resolve();
146
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
147
-
148
- let interceptorPromise = authenticationPromise;
149
- for (const interceptor of this.interceptors) {
150
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
151
- }
152
-
153
- return interceptorPromise.then(() => {
154
- if (Object.keys(localVarFormParams).length) {
155
- if (localVarUseFormData) {
156
- (<any>localVarRequestOptions).formData = localVarFormParams;
157
- } else {
158
- localVarRequestOptions.form = localVarFormParams;
159
- }
160
- }
161
- return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
162
- localVarRequest(localVarRequestOptions, (error, response, body) => {
163
- if (error) {
164
- reject(error);
165
- } else {
166
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
167
- body = ObjectSerializer.deserialize(body, "object");
168
- resolve({ response: response, body: body });
169
- } else {
170
- reject(new HttpError(response, body, response.statusCode));
171
- }
172
- }
173
- });
174
- });
175
- });
176
- }
177
- /**
178
- *
179
- * @summary Returns the entire state of the FIDO application
180
- */
181
- public async getFidoHealth (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
182
- const localVarPath = this.basePath + '/v1/health';
183
- let localVarQueryParameters: any = {};
184
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
185
- const produces = ['application/json'];
186
- // give precedence to 'application/json'
187
- if (produces.indexOf('application/json') >= 0) {
188
- localVarHeaderParams.Accept = 'application/json';
189
- } else {
190
- localVarHeaderParams.Accept = produces.join(',');
191
- }
192
- let localVarFormParams: any = {};
193
-
194
- (<any>Object).assign(localVarHeaderParams, options.headers);
195
-
196
- let localVarUseFormData = false;
197
-
198
- let localVarRequestOptions: localVarRequest.Options = {
199
- method: 'GET',
200
- qs: localVarQueryParameters,
201
- headers: localVarHeaderParams,
202
- uri: localVarPath,
203
- useQuerystring: this._useQuerystring,
204
- json: true,
205
- };
206
-
207
- let authenticationPromise = Promise.resolve();
208
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
209
-
210
- let interceptorPromise = authenticationPromise;
211
- for (const interceptor of this.interceptors) {
212
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
213
- }
214
-
215
- return interceptorPromise.then(() => {
216
- if (Object.keys(localVarFormParams).length) {
217
- if (localVarUseFormData) {
218
- (<any>localVarRequestOptions).formData = localVarFormParams;
219
- } else {
220
- localVarRequestOptions.form = localVarFormParams;
221
- }
222
- }
223
- return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
224
- localVarRequest(localVarRequestOptions, (error, response, body) => {
225
- if (error) {
226
- reject(error);
227
- } else {
228
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
229
- body = ObjectSerializer.deserialize(body, "object");
230
- resolve({ response: response, body: body });
231
- } else {
232
- reject(new HttpError(response, body, response.statusCode));
233
- }
234
- }
235
- });
236
- });
237
- });
238
- }
239
- }