@nestbox-ai/instances 1.0.50 → 1.0.61
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.
- package/.openapi-generator/VERSION +1 -1
- package/README.md +2 -2
- package/api.ts +1 -68
- package/base.ts +0 -24
- package/common.ts +14 -38
- package/configuration.ts +24 -18
- package/dist/api.d.ts +6 -65
- package/dist/api.js +0 -27
- package/dist/base.d.ts +0 -24
- package/dist/base.js +0 -19
- package/dist/common.d.ts +4 -35
- package/dist/common.js +15 -38
- package/dist/configuration.d.ts +24 -17
- package/dist/configuration.js +1 -1
- package/dist/esm/api.d.ts +6 -65
- package/dist/esm/api.js +0 -27
- package/dist/esm/base.d.ts +0 -24
- package/dist/esm/base.js +0 -19
- package/dist/esm/common.d.ts +4 -35
- package/dist/esm/common.js +13 -37
- package/dist/esm/configuration.d.ts +24 -17
- package/dist/esm/configuration.js +1 -1
- package/git_push.sh +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.19.0
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @nestbox-ai/instances@1.0.
|
|
1
|
+
## @nestbox-ai/instances@1.0.61
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @nestbox-ai/instances@1.0.
|
|
39
|
+
npm install @nestbox-ai/instances@1.0.61 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/api.ts
CHANGED
|
@@ -18,58 +18,25 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
|
18
18
|
import globalAxios from 'axios';
|
|
19
19
|
// Some imports not used depending on template conditions
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
21
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from './common';
|
|
22
22
|
import type { RequestArgs } from './base';
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @export
|
|
29
|
-
* @interface CreateMachineAgentDto
|
|
30
|
-
*/
|
|
31
26
|
export interface CreateMachineAgentDto {
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @type {string}
|
|
35
|
-
* @memberof CreateMachineAgentDto
|
|
36
|
-
*/
|
|
37
27
|
'name': string;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @type {string}
|
|
41
|
-
* @memberof CreateMachineAgentDto
|
|
42
|
-
*/
|
|
43
28
|
'description'?: string;
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* @type {string}
|
|
47
|
-
* @memberof CreateMachineAgentDto
|
|
48
|
-
*/
|
|
49
29
|
'entryFunctionName'?: string;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @type {string}
|
|
53
|
-
* @memberof CreateMachineAgentDto
|
|
54
|
-
*/
|
|
55
30
|
'type': string;
|
|
56
|
-
/**
|
|
57
|
-
*
|
|
58
|
-
* @type {string}
|
|
59
|
-
* @memberof CreateMachineAgentDto
|
|
60
|
-
*/
|
|
61
31
|
'machineManifestId'?: string;
|
|
62
32
|
/**
|
|
63
33
|
* Optional Input Schema JSON for agent.
|
|
64
|
-
* @type {object}
|
|
65
|
-
* @memberof CreateMachineAgentDto
|
|
66
34
|
*/
|
|
67
35
|
'inputSchema'?: object;
|
|
68
36
|
}
|
|
69
37
|
|
|
70
38
|
/**
|
|
71
39
|
* AgentsApi - axios parameter creator
|
|
72
|
-
* @export
|
|
73
40
|
*/
|
|
74
41
|
export const AgentsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
75
42
|
return {
|
|
@@ -94,8 +61,6 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
94
61
|
const localVarHeaderParameter = {} as any;
|
|
95
62
|
const localVarQueryParameter = {} as any;
|
|
96
63
|
|
|
97
|
-
|
|
98
|
-
|
|
99
64
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
100
65
|
|
|
101
66
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -131,7 +96,6 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
131
96
|
const localVarQueryParameter = {} as any;
|
|
132
97
|
|
|
133
98
|
|
|
134
|
-
|
|
135
99
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
136
100
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
101
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -165,7 +129,6 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
165
129
|
}
|
|
166
130
|
|
|
167
131
|
|
|
168
|
-
|
|
169
132
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
170
133
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
171
134
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -200,8 +163,6 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
200
163
|
const localVarHeaderParameter = {} as any;
|
|
201
164
|
const localVarQueryParameter = {} as any;
|
|
202
165
|
|
|
203
|
-
|
|
204
|
-
|
|
205
166
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
206
167
|
|
|
207
168
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -219,7 +180,6 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
219
180
|
|
|
220
181
|
/**
|
|
221
182
|
* AgentsApi - functional programming interface
|
|
222
|
-
* @export
|
|
223
183
|
*/
|
|
224
184
|
export const AgentsApiFp = function(configuration?: Configuration) {
|
|
225
185
|
const localVarAxiosParamCreator = AgentsApiAxiosParamCreator(configuration)
|
|
@@ -278,7 +238,6 @@ export const AgentsApiFp = function(configuration?: Configuration) {
|
|
|
278
238
|
|
|
279
239
|
/**
|
|
280
240
|
* AgentsApi - factory interface
|
|
281
|
-
* @export
|
|
282
241
|
*/
|
|
283
242
|
export const AgentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
284
243
|
const localVarFp = AgentsApiFp(configuration)
|
|
@@ -325,9 +284,6 @@ export const AgentsApiFactory = function (configuration?: Configuration, basePat
|
|
|
325
284
|
|
|
326
285
|
/**
|
|
327
286
|
* AgentsApi - object-oriented interface
|
|
328
|
-
* @export
|
|
329
|
-
* @class AgentsApi
|
|
330
|
-
* @extends {BaseAPI}
|
|
331
287
|
*/
|
|
332
288
|
export class AgentsApi extends BaseAPI {
|
|
333
289
|
/**
|
|
@@ -335,7 +291,6 @@ export class AgentsApi extends BaseAPI {
|
|
|
335
291
|
* @param {CreateMachineAgentDto} createMachineAgentDto
|
|
336
292
|
* @param {*} [options] Override http request option.
|
|
337
293
|
* @throws {RequiredError}
|
|
338
|
-
* @memberof AgentsApi
|
|
339
294
|
*/
|
|
340
295
|
public agentManagementControllerCreateNewAgent(createMachineAgentDto: CreateMachineAgentDto, options?: RawAxiosRequestConfig) {
|
|
341
296
|
return AgentsApiFp(this.configuration).agentManagementControllerCreateNewAgent(createMachineAgentDto, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -346,7 +301,6 @@ export class AgentsApi extends BaseAPI {
|
|
|
346
301
|
* @param {string} id
|
|
347
302
|
* @param {*} [options] Override http request option.
|
|
348
303
|
* @throws {RequiredError}
|
|
349
|
-
* @memberof AgentsApi
|
|
350
304
|
*/
|
|
351
305
|
public agentManagementControllerDeleteAgent(id: string, options?: RawAxiosRequestConfig) {
|
|
352
306
|
return AgentsApiFp(this.configuration).agentManagementControllerDeleteAgent(id, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -357,7 +311,6 @@ export class AgentsApi extends BaseAPI {
|
|
|
357
311
|
* @param {AgentManagementControllerGetAllAgentsTypeEnum} [type] Type of agent.
|
|
358
312
|
* @param {*} [options] Override http request option.
|
|
359
313
|
* @throws {RequiredError}
|
|
360
|
-
* @memberof AgentsApi
|
|
361
314
|
*/
|
|
362
315
|
public agentManagementControllerGetAllAgents(type?: AgentManagementControllerGetAllAgentsTypeEnum, options?: RawAxiosRequestConfig) {
|
|
363
316
|
return AgentsApiFp(this.configuration).agentManagementControllerGetAllAgents(type, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -369,16 +322,12 @@ export class AgentsApi extends BaseAPI {
|
|
|
369
322
|
* @param {object} body
|
|
370
323
|
* @param {*} [options] Override http request option.
|
|
371
324
|
* @throws {RequiredError}
|
|
372
|
-
* @memberof AgentsApi
|
|
373
325
|
*/
|
|
374
326
|
public agentManagementControllerUpdateMachineAgent(id: string, body: object, options?: RawAxiosRequestConfig) {
|
|
375
327
|
return AgentsApiFp(this.configuration).agentManagementControllerUpdateMachineAgent(id, body, options).then((request) => request(this.axios, this.basePath));
|
|
376
328
|
}
|
|
377
329
|
}
|
|
378
330
|
|
|
379
|
-
/**
|
|
380
|
-
* @export
|
|
381
|
-
*/
|
|
382
331
|
export const AgentManagementControllerGetAllAgentsTypeEnum = {
|
|
383
332
|
Regular: 'REGULAR',
|
|
384
333
|
Chat: 'CHAT'
|
|
@@ -388,7 +337,6 @@ export type AgentManagementControllerGetAllAgentsTypeEnum = typeof AgentManageme
|
|
|
388
337
|
|
|
389
338
|
/**
|
|
390
339
|
* ManifestApi - axios parameter creator
|
|
391
|
-
* @export
|
|
392
340
|
*/
|
|
393
341
|
export const ManifestApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
394
342
|
return {
|
|
@@ -411,7 +359,6 @@ export const ManifestApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
411
359
|
const localVarQueryParameter = {} as any;
|
|
412
360
|
|
|
413
361
|
|
|
414
|
-
|
|
415
362
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
416
363
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
417
364
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -426,7 +373,6 @@ export const ManifestApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
426
373
|
|
|
427
374
|
/**
|
|
428
375
|
* ManifestApi - functional programming interface
|
|
429
|
-
* @export
|
|
430
376
|
*/
|
|
431
377
|
export const ManifestApiFp = function(configuration?: Configuration) {
|
|
432
378
|
const localVarAxiosParamCreator = ManifestApiAxiosParamCreator(configuration)
|
|
@@ -447,7 +393,6 @@ export const ManifestApiFp = function(configuration?: Configuration) {
|
|
|
447
393
|
|
|
448
394
|
/**
|
|
449
395
|
* ManifestApi - factory interface
|
|
450
|
-
* @export
|
|
451
396
|
*/
|
|
452
397
|
export const ManifestApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
453
398
|
const localVarFp = ManifestApiFp(configuration)
|
|
@@ -465,16 +410,12 @@ export const ManifestApiFactory = function (configuration?: Configuration, baseP
|
|
|
465
410
|
|
|
466
411
|
/**
|
|
467
412
|
* ManifestApi - object-oriented interface
|
|
468
|
-
* @export
|
|
469
|
-
* @class ManifestApi
|
|
470
|
-
* @extends {BaseAPI}
|
|
471
413
|
*/
|
|
472
414
|
export class ManifestApi extends BaseAPI {
|
|
473
415
|
/**
|
|
474
416
|
*
|
|
475
417
|
* @param {*} [options] Override http request option.
|
|
476
418
|
* @throws {RequiredError}
|
|
477
|
-
* @memberof ManifestApi
|
|
478
419
|
*/
|
|
479
420
|
public agentManagementManifestControllerGetManifest(options?: RawAxiosRequestConfig) {
|
|
480
421
|
return ManifestApiFp(this.configuration).agentManagementManifestControllerGetManifest(options).then((request) => request(this.axios, this.basePath));
|
|
@@ -485,7 +426,6 @@ export class ManifestApi extends BaseAPI {
|
|
|
485
426
|
|
|
486
427
|
/**
|
|
487
428
|
* ServerLiveStatusApi - axios parameter creator
|
|
488
|
-
* @export
|
|
489
429
|
*/
|
|
490
430
|
export const ServerLiveStatusApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
491
431
|
return {
|
|
@@ -508,7 +448,6 @@ export const ServerLiveStatusApiAxiosParamCreator = function (configuration?: Co
|
|
|
508
448
|
const localVarQueryParameter = {} as any;
|
|
509
449
|
|
|
510
450
|
|
|
511
|
-
|
|
512
451
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
513
452
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
514
453
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -523,7 +462,6 @@ export const ServerLiveStatusApiAxiosParamCreator = function (configuration?: Co
|
|
|
523
462
|
|
|
524
463
|
/**
|
|
525
464
|
* ServerLiveStatusApi - functional programming interface
|
|
526
|
-
* @export
|
|
527
465
|
*/
|
|
528
466
|
export const ServerLiveStatusApiFp = function(configuration?: Configuration) {
|
|
529
467
|
const localVarAxiosParamCreator = ServerLiveStatusApiAxiosParamCreator(configuration)
|
|
@@ -544,7 +482,6 @@ export const ServerLiveStatusApiFp = function(configuration?: Configuration) {
|
|
|
544
482
|
|
|
545
483
|
/**
|
|
546
484
|
* ServerLiveStatusApi - factory interface
|
|
547
|
-
* @export
|
|
548
485
|
*/
|
|
549
486
|
export const ServerLiveStatusApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
550
487
|
const localVarFp = ServerLiveStatusApiFp(configuration)
|
|
@@ -562,16 +499,12 @@ export const ServerLiveStatusApiFactory = function (configuration?: Configuratio
|
|
|
562
499
|
|
|
563
500
|
/**
|
|
564
501
|
* ServerLiveStatusApi - object-oriented interface
|
|
565
|
-
* @export
|
|
566
|
-
* @class ServerLiveStatusApi
|
|
567
|
-
* @extends {BaseAPI}
|
|
568
502
|
*/
|
|
569
503
|
export class ServerLiveStatusApi extends BaseAPI {
|
|
570
504
|
/**
|
|
571
505
|
*
|
|
572
506
|
* @param {*} [options] Override http request option.
|
|
573
507
|
* @throws {RequiredError}
|
|
574
|
-
* @memberof ServerLiveStatusApi
|
|
575
508
|
*/
|
|
576
509
|
public appControllerGetStatus(options?: RawAxiosRequestConfig) {
|
|
577
510
|
return ServerLiveStatusApiFp(this.configuration).appControllerGetStatus(options).then((request) => request(this.axios, this.basePath));
|
package/base.ts
CHANGED
|
@@ -21,10 +21,6 @@ import globalAxios from 'axios';
|
|
|
21
21
|
|
|
22
22
|
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @export
|
|
27
|
-
*/
|
|
28
24
|
export const COLLECTION_FORMATS = {
|
|
29
25
|
csv: ",",
|
|
30
26
|
ssv: " ",
|
|
@@ -32,21 +28,11 @@ export const COLLECTION_FORMATS = {
|
|
|
32
28
|
pipes: "|",
|
|
33
29
|
};
|
|
34
30
|
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @export
|
|
38
|
-
* @interface RequestArgs
|
|
39
|
-
*/
|
|
40
31
|
export interface RequestArgs {
|
|
41
32
|
url: string;
|
|
42
33
|
options: RawAxiosRequestConfig;
|
|
43
34
|
}
|
|
44
35
|
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @export
|
|
48
|
-
* @class BaseAPI
|
|
49
|
-
*/
|
|
50
36
|
export class BaseAPI {
|
|
51
37
|
protected configuration: Configuration | undefined;
|
|
52
38
|
|
|
@@ -58,12 +44,6 @@ export class BaseAPI {
|
|
|
58
44
|
}
|
|
59
45
|
};
|
|
60
46
|
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @export
|
|
64
|
-
* @class RequiredError
|
|
65
|
-
* @extends {Error}
|
|
66
|
-
*/
|
|
67
47
|
export class RequiredError extends Error {
|
|
68
48
|
constructor(public field: string, msg?: string) {
|
|
69
49
|
super(msg);
|
|
@@ -78,9 +58,5 @@ interface ServerMap {
|
|
|
78
58
|
}[];
|
|
79
59
|
}
|
|
80
60
|
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @export
|
|
84
|
-
*/
|
|
85
61
|
export const operationServerMap: ServerMap = {
|
|
86
62
|
}
|
package/common.ts
CHANGED
|
@@ -12,22 +12,16 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
import type { Configuration } from "./configuration";
|
|
17
16
|
import type { RequestArgs } from "./base";
|
|
18
17
|
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
19
18
|
import { RequiredError } from "./base";
|
|
20
19
|
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @export
|
|
24
|
-
*/
|
|
25
20
|
export const DUMMY_BASE_URL = 'https://example.com'
|
|
26
21
|
|
|
27
22
|
/**
|
|
28
23
|
*
|
|
29
24
|
* @throws {RequiredError}
|
|
30
|
-
* @export
|
|
31
25
|
*/
|
|
32
26
|
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
|
33
27
|
if (paramValue === null || paramValue === undefined) {
|
|
@@ -35,10 +29,6 @@ export const assertParamExists = function (functionName: string, paramName: stri
|
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @export
|
|
41
|
-
*/
|
|
42
32
|
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
|
43
33
|
if (configuration && configuration.apiKey) {
|
|
44
34
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -48,20 +38,12 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri
|
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @export
|
|
54
|
-
*/
|
|
55
41
|
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
|
56
42
|
if (configuration && (configuration.username || configuration.password)) {
|
|
57
43
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
58
44
|
}
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @export
|
|
64
|
-
*/
|
|
65
47
|
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
|
66
48
|
if (configuration && configuration.accessToken) {
|
|
67
49
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -71,10 +53,6 @@ export const setBearerAuthToObject = async function (object: any, configuration?
|
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @export
|
|
77
|
-
*/
|
|
78
56
|
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
|
79
57
|
if (configuration && configuration.accessToken) {
|
|
80
58
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -84,10 +62,11 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
84
62
|
}
|
|
85
63
|
}
|
|
86
64
|
|
|
65
|
+
|
|
87
66
|
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
|
88
67
|
if (parameter == null) return;
|
|
89
68
|
if (typeof parameter === "object") {
|
|
90
|
-
if (Array.isArray(parameter)) {
|
|
69
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
91
70
|
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
92
71
|
}
|
|
93
72
|
else {
|
|
@@ -106,10 +85,6 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
|
|
|
106
85
|
}
|
|
107
86
|
}
|
|
108
87
|
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @export
|
|
112
|
-
*/
|
|
113
88
|
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
114
89
|
const searchParams = new URLSearchParams(url.search);
|
|
115
90
|
setFlattenedQueryParams(searchParams, objects);
|
|
@@ -117,31 +92,32 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
|
117
92
|
}
|
|
118
93
|
|
|
119
94
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
95
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
96
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
97
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
122
98
|
*/
|
|
99
|
+
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
|
|
100
|
+
if (value instanceof Set) {
|
|
101
|
+
return Array.from(value);
|
|
102
|
+
} else {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
123
107
|
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
|
124
108
|
const nonString = typeof value !== 'string';
|
|
125
109
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
126
110
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
127
111
|
: nonString;
|
|
128
112
|
return needsSerialization
|
|
129
|
-
? JSON.stringify(value !== undefined ? value : {})
|
|
113
|
+
? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
|
|
130
114
|
: (value || "");
|
|
131
115
|
}
|
|
132
116
|
|
|
133
|
-
/**
|
|
134
|
-
*
|
|
135
|
-
* @export
|
|
136
|
-
*/
|
|
137
117
|
export const toPathString = function (url: URL) {
|
|
138
118
|
return url.pathname + url.search + url.hash
|
|
139
119
|
}
|
|
140
120
|
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @export
|
|
144
|
-
*/
|
|
145
121
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
146
122
|
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
147
123
|
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
package/configuration.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
2
|
/**
|
|
4
3
|
* Nestbox API Agents API
|
|
5
4
|
* API for Nestbox Agents, control your agents
|
|
@@ -12,12 +11,24 @@
|
|
|
12
11
|
* Do not edit the class manually.
|
|
13
12
|
*/
|
|
14
13
|
|
|
14
|
+
interface AWSv4Configuration {
|
|
15
|
+
options?: {
|
|
16
|
+
region?: string
|
|
17
|
+
service?: string
|
|
18
|
+
}
|
|
19
|
+
credentials?: {
|
|
20
|
+
accessKeyId?: string
|
|
21
|
+
secretAccessKey?: string,
|
|
22
|
+
sessionToken?: string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
15
25
|
|
|
16
26
|
export interface ConfigurationParameters {
|
|
17
27
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
18
28
|
username?: string;
|
|
19
29
|
password?: string;
|
|
20
30
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
31
|
+
awsv4?: AWSv4Configuration;
|
|
21
32
|
basePath?: string;
|
|
22
33
|
serverIndex?: number;
|
|
23
34
|
baseOptions?: any;
|
|
@@ -28,49 +39,43 @@ export class Configuration {
|
|
|
28
39
|
/**
|
|
29
40
|
* parameter for apiKey security
|
|
30
41
|
* @param name security name
|
|
31
|
-
* @memberof Configuration
|
|
32
42
|
*/
|
|
33
43
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
34
44
|
/**
|
|
35
45
|
* parameter for basic security
|
|
36
|
-
*
|
|
37
|
-
* @type {string}
|
|
38
|
-
* @memberof Configuration
|
|
39
46
|
*/
|
|
40
47
|
username?: string;
|
|
41
48
|
/**
|
|
42
49
|
* parameter for basic security
|
|
43
|
-
*
|
|
44
|
-
* @type {string}
|
|
45
|
-
* @memberof Configuration
|
|
46
50
|
*/
|
|
47
51
|
password?: string;
|
|
48
52
|
/**
|
|
49
53
|
* parameter for oauth2 security
|
|
50
54
|
* @param name security name
|
|
51
55
|
* @param scopes oauth2 scope
|
|
52
|
-
* @memberof Configuration
|
|
53
56
|
*/
|
|
54
57
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
55
58
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @
|
|
59
|
+
* parameter for aws4 signature security
|
|
60
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
61
|
+
* @param {string} options.region - aws region
|
|
62
|
+
* @param {string} options.service - name of the service.
|
|
63
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
64
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
65
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
59
66
|
* @memberof Configuration
|
|
60
67
|
*/
|
|
68
|
+
awsv4?: AWSv4Configuration;
|
|
69
|
+
/**
|
|
70
|
+
* override base path
|
|
71
|
+
*/
|
|
61
72
|
basePath?: string;
|
|
62
73
|
/**
|
|
63
74
|
* override server index
|
|
64
|
-
*
|
|
65
|
-
* @type {number}
|
|
66
|
-
* @memberof Configuration
|
|
67
75
|
*/
|
|
68
76
|
serverIndex?: number;
|
|
69
77
|
/**
|
|
70
78
|
* base options for axios calls
|
|
71
|
-
*
|
|
72
|
-
* @type {any}
|
|
73
|
-
* @memberof Configuration
|
|
74
79
|
*/
|
|
75
80
|
baseOptions?: any;
|
|
76
81
|
/**
|
|
@@ -87,6 +92,7 @@ export class Configuration {
|
|
|
87
92
|
this.username = param.username;
|
|
88
93
|
this.password = param.password;
|
|
89
94
|
this.accessToken = param.accessToken;
|
|
95
|
+
this.awsv4 = param.awsv4;
|
|
90
96
|
this.basePath = param.basePath;
|
|
91
97
|
this.serverIndex = param.serverIndex;
|
|
92
98
|
this.baseOptions = {
|