@product-live/api-sdk 2.22.0 → 2.26.0
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/package.json +4 -35
- package/.openapi-generator/FILES +0 -74
- package/.openapi-generator/VERSION +0 -1
- package/.openapi-generator-ignore +0 -23
- package/DataFactoryFileApi.md +0 -182
- package/DefaultApi.md +0 -105
- package/ItemApi.md +0 -125
- package/JobApi.md +0 -333
- package/JobExecutionApi.md +0 -185
- package/README.md +0 -4
- package/TaskApi.md +0 -375
- package/TaskExecutionApi.md +0 -130
- package/VariableApi.md +0 -315
- package/apis/DataFactoryFileApi.ts +0 -307
- package/apis/DefaultApi.ts +0 -117
- package/apis/ItemApi.ts +0 -197
- package/apis/JobApi.ts +0 -507
- package/apis/JobExecutionApi.ts +0 -289
- package/apis/TaskApi.ts +0 -558
- package/apis/TaskExecutionApi.ts +0 -212
- package/apis/VariableApi.ts +0 -495
- package/apis/baseapi.ts +0 -37
- package/apis/exception.ts +0 -15
- package/auth/auth.ts +0 -107
- package/configuration.ts +0 -82
- package/dist/apis/DataFactoryFileApi.d.ts +0 -15
- package/dist/apis/DataFactoryFileApi.js +0 -359
- package/dist/apis/DataFactoryFileApi.js.map +0 -1
- package/dist/apis/DefaultApi.d.ts +0 -11
- package/dist/apis/DefaultApi.js +0 -172
- package/dist/apis/DefaultApi.js.map +0 -1
- package/dist/apis/ItemApi.d.ts +0 -13
- package/dist/apis/ItemApi.js +0 -249
- package/dist/apis/ItemApi.js.map +0 -1
- package/dist/apis/JobApi.d.ts +0 -21
- package/dist/apis/JobApi.js +0 -547
- package/dist/apis/JobApi.js.map +0 -1
- package/dist/apis/JobExecutionApi.d.ts +0 -16
- package/dist/apis/JobExecutionApi.js +0 -339
- package/dist/apis/JobExecutionApi.js.map +0 -1
- package/dist/apis/TaskApi.d.ts +0 -24
- package/dist/apis/TaskApi.js +0 -609
- package/dist/apis/TaskApi.js.map +0 -1
- package/dist/apis/TaskExecutionApi.d.ts +0 -13
- package/dist/apis/TaskExecutionApi.js +0 -259
- package/dist/apis/TaskExecutionApi.js.map +0 -1
- package/dist/apis/VariableApi.d.ts +0 -22
- package/dist/apis/VariableApi.js +0 -529
- package/dist/apis/VariableApi.js.map +0 -1
- package/dist/apis/baseapi.d.ts +0 -18
- package/dist/apis/baseapi.js +0 -46
- package/dist/apis/baseapi.js.map +0 -1
- package/dist/apis/exception.d.ts +0 -10
- package/dist/apis/exception.js +0 -32
- package/dist/apis/exception.js.map +0 -1
- package/dist/auth/auth.d.ts +0 -42
- package/dist/auth/auth.js +0 -45
- package/dist/auth/auth.js.map +0 -1
- package/dist/configuration.d.ts +0 -18
- package/dist/configuration.js +0 -22
- package/dist/configuration.js.map +0 -1
- package/dist/http/http.d.ts +0 -82
- package/dist/http/http.js +0 -229
- package/dist/http/http.js.map +0 -1
- package/dist/http/isomorphic-fetch.d.ts +0 -5
- package/dist/http/isomorphic-fetch.js +0 -34
- package/dist/http/isomorphic-fetch.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -36
- package/dist/index.js.map +0 -1
- package/dist/middleware.d.ts +0 -16
- package/dist/middleware.js +0 -18
- package/dist/middleware.js.map +0 -1
- package/dist/models/CreateJobDto.d.ts +0 -30
- package/dist/models/CreateJobDto.js +0 -82
- package/dist/models/CreateJobDto.js.map +0 -1
- package/dist/models/CreateJobExecutionDto.d.ts +0 -21
- package/dist/models/CreateJobExecutionDto.js +0 -34
- package/dist/models/CreateJobExecutionDto.js.map +0 -1
- package/dist/models/CreateTaskDto.d.ts +0 -21
- package/dist/models/CreateTaskDto.js +0 -46
- package/dist/models/CreateTaskDto.js.map +0 -1
- package/dist/models/CreateVariableDto.d.ts +0 -22
- package/dist/models/CreateVariableDto.js +0 -46
- package/dist/models/CreateVariableDto.js.map +0 -1
- package/dist/models/FileDto.d.ts +0 -23
- package/dist/models/FileDto.js +0 -52
- package/dist/models/FileDto.js.map +0 -1
- package/dist/models/FindVariablesRequest.d.ts +0 -23
- package/dist/models/FindVariablesRequest.js +0 -46
- package/dist/models/FindVariablesRequest.js.map +0 -1
- package/dist/models/GetFiles200Response.d.ts +0 -21
- package/dist/models/GetFiles200Response.js +0 -34
- package/dist/models/GetFiles200Response.js.map +0 -1
- package/dist/models/GetItems200Response.d.ts +0 -21
- package/dist/models/GetItems200Response.js +0 -34
- package/dist/models/GetItems200Response.js.map +0 -1
- package/dist/models/GetJobExecutionById400Response.d.ts +0 -17
- package/dist/models/GetJobExecutionById400Response.js +0 -22
- package/dist/models/GetJobExecutionById400Response.js.map +0 -1
- package/dist/models/GetJobExecutions200Response.d.ts +0 -21
- package/dist/models/GetJobExecutions200Response.js +0 -34
- package/dist/models/GetJobExecutions200Response.js.map +0 -1
- package/dist/models/GetJobs200Response.d.ts +0 -21
- package/dist/models/GetJobs200Response.js +0 -34
- package/dist/models/GetJobs200Response.js.map +0 -1
- package/dist/models/GetTasks200Response.d.ts +0 -21
- package/dist/models/GetTasks200Response.js +0 -34
- package/dist/models/GetTasks200Response.js.map +0 -1
- package/dist/models/GetVariables200Response.d.ts +0 -21
- package/dist/models/GetVariables200Response.js +0 -34
- package/dist/models/GetVariables200Response.js.map +0 -1
- package/dist/models/HighOrderQuery.d.ts +0 -19
- package/dist/models/HighOrderQuery.js +0 -28
- package/dist/models/HighOrderQuery.js.map +0 -1
- package/dist/models/ItemDto.d.ts +0 -28
- package/dist/models/ItemDto.js +0 -64
- package/dist/models/ItemDto.js.map +0 -1
- package/dist/models/ItemFieldDTO.d.ts +0 -19
- package/dist/models/ItemFieldDTO.js +0 -34
- package/dist/models/ItemFieldDTO.js.map +0 -1
- package/dist/models/ItemFieldFile.d.ts +0 -18
- package/dist/models/ItemFieldFile.js +0 -22
- package/dist/models/ItemFieldFile.js.map +0 -1
- package/dist/models/ItemFieldFileData.d.ts +0 -18
- package/dist/models/ItemFieldFileData.js +0 -28
- package/dist/models/ItemFieldFileData.js.map +0 -1
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantity.d.ts +0 -18
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantity.js +0 -22
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantity.js.map +0 -1
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantityData.d.ts +0 -19
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantityData.js +0 -34
- package/dist/models/ItemFieldMultipleSelectWithCommentAndQuantityData.js.map +0 -1
- package/dist/models/ItemFieldSimpleNumber.d.ts +0 -18
- package/dist/models/ItemFieldSimpleNumber.js +0 -28
- package/dist/models/ItemFieldSimpleNumber.js.map +0 -1
- package/dist/models/ItemFieldSimpleString.d.ts +0 -17
- package/dist/models/ItemFieldSimpleString.js +0 -22
- package/dist/models/ItemFieldSimpleString.js.map +0 -1
- package/dist/models/ItemFieldSimpleStringArray.d.ts +0 -17
- package/dist/models/ItemFieldSimpleStringArray.js +0 -22
- package/dist/models/ItemFieldSimpleStringArray.js.map +0 -1
- package/dist/models/ItemMetadataDTO.d.ts +0 -23
- package/dist/models/ItemMetadataDTO.js +0 -58
- package/dist/models/ItemMetadataDTO.js.map +0 -1
- package/dist/models/JobDto.d.ts +0 -35
- package/dist/models/JobDto.js +0 -106
- package/dist/models/JobDto.js.map +0 -1
- package/dist/models/JobExecutionDto.d.ts +0 -33
- package/dist/models/JobExecutionDto.js +0 -88
- package/dist/models/JobExecutionDto.js.map +0 -1
- package/dist/models/LowOrderQuery.d.ts +0 -22
- package/dist/models/LowOrderQuery.js +0 -40
- package/dist/models/LowOrderQuery.js.map +0 -1
- package/dist/models/LowOrderQueryValue.d.ts +0 -16
- package/dist/models/LowOrderQueryValue.js +0 -15
- package/dist/models/LowOrderQueryValue.js.map +0 -1
- package/dist/models/ObjectSerializer.d.ts +0 -45
- package/dist/models/ObjectSerializer.js +0 -347
- package/dist/models/ObjectSerializer.js.map +0 -1
- package/dist/models/PatchTaskExecutionDto.d.ts +0 -22
- package/dist/models/PatchTaskExecutionDto.js +0 -34
- package/dist/models/PatchTaskExecutionDto.js.map +0 -1
- package/dist/models/Query1.d.ts +0 -23
- package/dist/models/Query1.js +0 -46
- package/dist/models/Query1.js.map +0 -1
- package/dist/models/TaskDto.d.ts +0 -26
- package/dist/models/TaskDto.js +0 -70
- package/dist/models/TaskDto.js.map +0 -1
- package/dist/models/TaskExecutionDto.d.ts +0 -30
- package/dist/models/TaskExecutionDto.js +0 -64
- package/dist/models/TaskExecutionDto.js.map +0 -1
- package/dist/models/UpdateJobDto.d.ts +0 -31
- package/dist/models/UpdateJobDto.js +0 -88
- package/dist/models/UpdateJobDto.js.map +0 -1
- package/dist/models/UpdateTaskDto.d.ts +0 -22
- package/dist/models/UpdateTaskDto.js +0 -52
- package/dist/models/UpdateTaskDto.js.map +0 -1
- package/dist/models/UpdateVariableDto.d.ts +0 -23
- package/dist/models/UpdateVariableDto.js +0 -52
- package/dist/models/UpdateVariableDto.js.map +0 -1
- package/dist/models/VariableDto.d.ts +0 -27
- package/dist/models/VariableDto.js +0 -70
- package/dist/models/VariableDto.js.map +0 -1
- package/dist/models/all.d.ts +0 -36
- package/dist/models/all.js +0 -53
- package/dist/models/all.js.map +0 -1
- package/dist/rxjsStub.d.ts +0 -10
- package/dist/rxjsStub.js +0 -33
- package/dist/rxjsStub.js.map +0 -1
- package/dist/servers.d.ts +0 -17
- package/dist/servers.js +0 -32
- package/dist/servers.js.map +0 -1
- package/dist/types/ObjectParamAPI.d.ts +0 -187
- package/dist/types/ObjectParamAPI.js +0 -160
- package/dist/types/ObjectParamAPI.js.map +0 -1
- package/dist/types/ObservableAPI.d.ts +0 -109
- package/dist/types/ObservableAPI.js +0 -758
- package/dist/types/ObservableAPI.js.map +0 -1
- package/dist/types/PromiseAPI.d.ts +0 -92
- package/dist/types/PromiseAPI.js +0 -180
- package/dist/types/PromiseAPI.js.map +0 -1
- package/dist/util.d.ts +0 -2
- package/dist/util.js +0 -29
- package/dist/util.js.map +0 -1
- package/git_push.sh +0 -51
- package/http/http.ts +0 -229
- package/http/isomorphic-fetch.ts +0 -32
- package/index.ts +0 -12
- package/middleware.ts +0 -66
- package/models/CreateJobDto.ts +0 -108
- package/models/CreateJobExecutionDto.ts +0 -49
- package/models/CreateTaskDto.ts +0 -63
- package/models/CreateVariableDto.ts +0 -66
- package/models/FileDto.ts +0 -73
- package/models/FindVariablesRequest.ts +0 -68
- package/models/GetFiles200Response.ts +0 -53
- package/models/GetItems200Response.ts +0 -53
- package/models/GetJobExecutionById400Response.ts +0 -35
- package/models/GetJobExecutions200Response.ts +0 -53
- package/models/GetJobs200Response.ts +0 -53
- package/models/GetTasks200Response.ts +0 -53
- package/models/GetVariables200Response.ts +0 -53
- package/models/HighOrderQuery.ts +0 -45
- package/models/ItemDto.ts +0 -86
- package/models/ItemFieldDTO.ts +0 -49
- package/models/ItemFieldFile.ts +0 -36
- package/models/ItemFieldFileData.ts +0 -42
- package/models/ItemFieldMultipleSelectWithCommentAndQuantity.ts +0 -36
- package/models/ItemFieldMultipleSelectWithCommentAndQuantityData.ts +0 -49
- package/models/ItemFieldSimpleNumber.ts +0 -42
- package/models/ItemFieldSimpleString.ts +0 -35
- package/models/ItemFieldSimpleStringArray.ts +0 -35
- package/models/ItemMetadataDTO.ts +0 -77
- package/models/JobDto.ts +0 -137
- package/models/JobExecutionDto.ts +0 -115
- package/models/LowOrderQuery.ts +0 -60
- package/models/LowOrderQueryValue.ts +0 -29
- package/models/ObjectSerializer.ts +0 -358
- package/models/PatchTaskExecutionDto.ts +0 -52
- package/models/Query1.ts +0 -69
- package/models/TaskDto.ts +0 -94
- package/models/TaskExecutionDto.ts +0 -88
- package/models/UpdateJobDto.ts +0 -115
- package/models/UpdateTaskDto.ts +0 -70
- package/models/UpdateVariableDto.ts +0 -73
- package/models/VariableDto.ts +0 -95
- package/models/all.ts +0 -36
- package/rxjsStub.ts +0 -27
- package/servers.ts +0 -55
- package/tsconfig.json +0 -28
- package/types/ObjectParamAPI.ts +0 -675
- package/types/ObservableAPI.ts +0 -837
- package/types/PromiseAPI.ts +0 -452
- package/util.ts +0 -37
package/apis/VariableApi.ts
DELETED
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
// TODO: better import syntax?
|
|
2
|
-
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
|
|
3
|
-
import {Configuration} from '../configuration';
|
|
4
|
-
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
|
5
|
-
import * as FormData from "form-data";
|
|
6
|
-
import { URLSearchParams } from 'url';
|
|
7
|
-
import {ObjectSerializer} from '../models/ObjectSerializer';
|
|
8
|
-
import {ApiException} from './exception';
|
|
9
|
-
import {canConsumeForm, isCodeInRange} from '../util';
|
|
10
|
-
import {SecurityAuthentication} from '../auth/auth';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { CreateVariableDto } from '../models/CreateVariableDto';
|
|
14
|
-
import { FindVariablesRequest } from '../models/FindVariablesRequest';
|
|
15
|
-
import { GetJobExecutionById400Response } from '../models/GetJobExecutionById400Response';
|
|
16
|
-
import { GetVariables200Response } from '../models/GetVariables200Response';
|
|
17
|
-
import { UpdateVariableDto } from '../models/UpdateVariableDto';
|
|
18
|
-
import { VariableDto } from '../models/VariableDto';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* no description
|
|
22
|
-
*/
|
|
23
|
-
export class VariableApiRequestFactory extends BaseAPIRequestFactory {
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* (Experimental) - Create a Variable
|
|
27
|
-
* @param createVariableDto
|
|
28
|
-
*/
|
|
29
|
-
public async createVariable(createVariableDto: CreateVariableDto, _options?: Configuration): Promise<RequestContext> {
|
|
30
|
-
let _config = _options || this.configuration;
|
|
31
|
-
|
|
32
|
-
// verify required parameter 'createVariableDto' is not null or undefined
|
|
33
|
-
if (createVariableDto === null || createVariableDto === undefined) {
|
|
34
|
-
throw new RequiredError("VariableApi", "createVariable", "createVariableDto");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Path Params
|
|
39
|
-
const localVarPath = '/v1/data_factory/variables';
|
|
40
|
-
|
|
41
|
-
// Make Request Context
|
|
42
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
43
|
-
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// Body Params
|
|
47
|
-
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
48
|
-
"application/json"
|
|
49
|
-
]);
|
|
50
|
-
requestContext.setHeaderParam("Content-Type", contentType);
|
|
51
|
-
const serializedBody = ObjectSerializer.stringify(
|
|
52
|
-
ObjectSerializer.serialize(createVariableDto, "CreateVariableDto", ""),
|
|
53
|
-
contentType
|
|
54
|
-
);
|
|
55
|
-
requestContext.setBody(serializedBody);
|
|
56
|
-
|
|
57
|
-
let authMethod: SecurityAuthentication | undefined;
|
|
58
|
-
// Apply auth methods
|
|
59
|
-
authMethod = _config.authMethods["ApiKeyAuthQuery"]
|
|
60
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
61
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
62
|
-
}
|
|
63
|
-
// Apply auth methods
|
|
64
|
-
authMethod = _config.authMethods["ApiKeyAuthHeader"]
|
|
65
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
66
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
70
|
-
if (defaultAuth?.applySecurityAuthentication) {
|
|
71
|
-
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return requestContext;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* (Experimental) - Find a list of Variable
|
|
79
|
-
* @param findVariablesRequest
|
|
80
|
-
* @param size
|
|
81
|
-
* @param page
|
|
82
|
-
*/
|
|
83
|
-
public async findVariables(findVariablesRequest: FindVariablesRequest, size?: number, page?: number, _options?: Configuration): Promise<RequestContext> {
|
|
84
|
-
let _config = _options || this.configuration;
|
|
85
|
-
|
|
86
|
-
// verify required parameter 'findVariablesRequest' is not null or undefined
|
|
87
|
-
if (findVariablesRequest === null || findVariablesRequest === undefined) {
|
|
88
|
-
throw new RequiredError("VariableApi", "findVariables", "findVariablesRequest");
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// Path Params
|
|
95
|
-
const localVarPath = '/v1/data_factory/variables/find';
|
|
96
|
-
|
|
97
|
-
// Make Request Context
|
|
98
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
|
99
|
-
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
100
|
-
|
|
101
|
-
// Query Params
|
|
102
|
-
if (size !== undefined) {
|
|
103
|
-
requestContext.setQueryParam("size", ObjectSerializer.serialize(size, "number", ""));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Query Params
|
|
107
|
-
if (page !== undefined) {
|
|
108
|
-
requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", ""));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// Body Params
|
|
113
|
-
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
114
|
-
"application/json"
|
|
115
|
-
]);
|
|
116
|
-
requestContext.setHeaderParam("Content-Type", contentType);
|
|
117
|
-
const serializedBody = ObjectSerializer.stringify(
|
|
118
|
-
ObjectSerializer.serialize(findVariablesRequest, "FindVariablesRequest", ""),
|
|
119
|
-
contentType
|
|
120
|
-
);
|
|
121
|
-
requestContext.setBody(serializedBody);
|
|
122
|
-
|
|
123
|
-
let authMethod: SecurityAuthentication | undefined;
|
|
124
|
-
// Apply auth methods
|
|
125
|
-
authMethod = _config.authMethods["ApiKeyAuthQuery"]
|
|
126
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
127
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
128
|
-
}
|
|
129
|
-
// Apply auth methods
|
|
130
|
-
authMethod = _config.authMethods["ApiKeyAuthHeader"]
|
|
131
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
132
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
136
|
-
if (defaultAuth?.applySecurityAuthentication) {
|
|
137
|
-
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return requestContext;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* (Experimental) - Get a Variable by id
|
|
145
|
-
* @param id
|
|
146
|
-
*/
|
|
147
|
-
public async getVariableById(id: string, _options?: Configuration): Promise<RequestContext> {
|
|
148
|
-
let _config = _options || this.configuration;
|
|
149
|
-
|
|
150
|
-
// verify required parameter 'id' is not null or undefined
|
|
151
|
-
if (id === null || id === undefined) {
|
|
152
|
-
throw new RequiredError("VariableApi", "getVariableById", "id");
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
// Path Params
|
|
157
|
-
const localVarPath = '/v1/data_factory/variables/{id}'
|
|
158
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
159
|
-
|
|
160
|
-
// Make Request Context
|
|
161
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
162
|
-
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
let authMethod: SecurityAuthentication | undefined;
|
|
166
|
-
// Apply auth methods
|
|
167
|
-
authMethod = _config.authMethods["ApiKeyAuthQuery"]
|
|
168
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
169
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
170
|
-
}
|
|
171
|
-
// Apply auth methods
|
|
172
|
-
authMethod = _config.authMethods["ApiKeyAuthHeader"]
|
|
173
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
174
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
178
|
-
if (defaultAuth?.applySecurityAuthentication) {
|
|
179
|
-
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return requestContext;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* (Experimental) - Get a list of Variable
|
|
187
|
-
* @param size
|
|
188
|
-
* @param page
|
|
189
|
-
*/
|
|
190
|
-
public async getVariables(size?: number, page?: number, _options?: Configuration): Promise<RequestContext> {
|
|
191
|
-
let _config = _options || this.configuration;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
// Path Params
|
|
196
|
-
const localVarPath = '/v1/data_factory/variables';
|
|
197
|
-
|
|
198
|
-
// Make Request Context
|
|
199
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
|
200
|
-
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
201
|
-
|
|
202
|
-
// Query Params
|
|
203
|
-
if (size !== undefined) {
|
|
204
|
-
requestContext.setQueryParam("size", ObjectSerializer.serialize(size, "number", ""));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Query Params
|
|
208
|
-
if (page !== undefined) {
|
|
209
|
-
requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", ""));
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
let authMethod: SecurityAuthentication | undefined;
|
|
214
|
-
// Apply auth methods
|
|
215
|
-
authMethod = _config.authMethods["ApiKeyAuthQuery"]
|
|
216
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
217
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
218
|
-
}
|
|
219
|
-
// Apply auth methods
|
|
220
|
-
authMethod = _config.authMethods["ApiKeyAuthHeader"]
|
|
221
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
222
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
226
|
-
if (defaultAuth?.applySecurityAuthentication) {
|
|
227
|
-
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return requestContext;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* (Experimental) - Update a Variable
|
|
235
|
-
* @param id
|
|
236
|
-
* @param updateVariableDto
|
|
237
|
-
*/
|
|
238
|
-
public async updateVariable(id: string, updateVariableDto: UpdateVariableDto, _options?: Configuration): Promise<RequestContext> {
|
|
239
|
-
let _config = _options || this.configuration;
|
|
240
|
-
|
|
241
|
-
// verify required parameter 'id' is not null or undefined
|
|
242
|
-
if (id === null || id === undefined) {
|
|
243
|
-
throw new RequiredError("VariableApi", "updateVariable", "id");
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
// verify required parameter 'updateVariableDto' is not null or undefined
|
|
248
|
-
if (updateVariableDto === null || updateVariableDto === undefined) {
|
|
249
|
-
throw new RequiredError("VariableApi", "updateVariable", "updateVariableDto");
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
// Path Params
|
|
254
|
-
const localVarPath = '/v1/data_factory/variables/{id}'
|
|
255
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
256
|
-
|
|
257
|
-
// Make Request Context
|
|
258
|
-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
|
259
|
-
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// Body Params
|
|
263
|
-
const contentType = ObjectSerializer.getPreferredMediaType([
|
|
264
|
-
"application/json"
|
|
265
|
-
]);
|
|
266
|
-
requestContext.setHeaderParam("Content-Type", contentType);
|
|
267
|
-
const serializedBody = ObjectSerializer.stringify(
|
|
268
|
-
ObjectSerializer.serialize(updateVariableDto, "UpdateVariableDto", ""),
|
|
269
|
-
contentType
|
|
270
|
-
);
|
|
271
|
-
requestContext.setBody(serializedBody);
|
|
272
|
-
|
|
273
|
-
let authMethod: SecurityAuthentication | undefined;
|
|
274
|
-
// Apply auth methods
|
|
275
|
-
authMethod = _config.authMethods["ApiKeyAuthQuery"]
|
|
276
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
277
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
278
|
-
}
|
|
279
|
-
// Apply auth methods
|
|
280
|
-
authMethod = _config.authMethods["ApiKeyAuthHeader"]
|
|
281
|
-
if (authMethod?.applySecurityAuthentication) {
|
|
282
|
-
await authMethod?.applySecurityAuthentication(requestContext);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
|
|
286
|
-
if (defaultAuth?.applySecurityAuthentication) {
|
|
287
|
-
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return requestContext;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export class VariableApiResponseProcessor {
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
299
|
-
* to the expected objects
|
|
300
|
-
*
|
|
301
|
-
* @params response Response returned by the server for a request to createVariable
|
|
302
|
-
* @throws ApiException if the response code was not in [200, 299]
|
|
303
|
-
*/
|
|
304
|
-
public async createVariable(response: ResponseContext): Promise<VariableDto > {
|
|
305
|
-
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
306
|
-
if (isCodeInRange("201", response.httpStatusCode)) {
|
|
307
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
308
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
309
|
-
"VariableDto", ""
|
|
310
|
-
) as VariableDto;
|
|
311
|
-
return body;
|
|
312
|
-
}
|
|
313
|
-
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
314
|
-
const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
|
|
315
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
316
|
-
"GetJobExecutionById400Response", ""
|
|
317
|
-
) as GetJobExecutionById400Response;
|
|
318
|
-
throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
|
|
319
|
-
}
|
|
320
|
-
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
321
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
325
|
-
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
326
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
327
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
328
|
-
"VariableDto", ""
|
|
329
|
-
) as VariableDto;
|
|
330
|
-
return body;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
338
|
-
* to the expected objects
|
|
339
|
-
*
|
|
340
|
-
* @params response Response returned by the server for a request to findVariables
|
|
341
|
-
* @throws ApiException if the response code was not in [200, 299]
|
|
342
|
-
*/
|
|
343
|
-
public async findVariables(response: ResponseContext): Promise<GetVariables200Response > {
|
|
344
|
-
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
345
|
-
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
346
|
-
const body: GetVariables200Response = ObjectSerializer.deserialize(
|
|
347
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
348
|
-
"GetVariables200Response", ""
|
|
349
|
-
) as GetVariables200Response;
|
|
350
|
-
return body;
|
|
351
|
-
}
|
|
352
|
-
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
353
|
-
const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
|
|
354
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
355
|
-
"GetJobExecutionById400Response", ""
|
|
356
|
-
) as GetJobExecutionById400Response;
|
|
357
|
-
throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
|
|
358
|
-
}
|
|
359
|
-
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
360
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
364
|
-
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
365
|
-
const body: GetVariables200Response = ObjectSerializer.deserialize(
|
|
366
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
367
|
-
"GetVariables200Response", ""
|
|
368
|
-
) as GetVariables200Response;
|
|
369
|
-
return body;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
377
|
-
* to the expected objects
|
|
378
|
-
*
|
|
379
|
-
* @params response Response returned by the server for a request to getVariableById
|
|
380
|
-
* @throws ApiException if the response code was not in [200, 299]
|
|
381
|
-
*/
|
|
382
|
-
public async getVariableById(response: ResponseContext): Promise<VariableDto > {
|
|
383
|
-
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
384
|
-
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
385
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
386
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
387
|
-
"VariableDto", ""
|
|
388
|
-
) as VariableDto;
|
|
389
|
-
return body;
|
|
390
|
-
}
|
|
391
|
-
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
392
|
-
const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
|
|
393
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
394
|
-
"GetJobExecutionById400Response", ""
|
|
395
|
-
) as GetJobExecutionById400Response;
|
|
396
|
-
throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
|
|
397
|
-
}
|
|
398
|
-
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
399
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
400
|
-
}
|
|
401
|
-
if (isCodeInRange("404", response.httpStatusCode)) {
|
|
402
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Not found", undefined, response.headers);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
406
|
-
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
407
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
408
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
409
|
-
"VariableDto", ""
|
|
410
|
-
) as VariableDto;
|
|
411
|
-
return body;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
419
|
-
* to the expected objects
|
|
420
|
-
*
|
|
421
|
-
* @params response Response returned by the server for a request to getVariables
|
|
422
|
-
* @throws ApiException if the response code was not in [200, 299]
|
|
423
|
-
*/
|
|
424
|
-
public async getVariables(response: ResponseContext): Promise<GetVariables200Response > {
|
|
425
|
-
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
426
|
-
if (isCodeInRange("200", response.httpStatusCode)) {
|
|
427
|
-
const body: GetVariables200Response = ObjectSerializer.deserialize(
|
|
428
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
429
|
-
"GetVariables200Response", ""
|
|
430
|
-
) as GetVariables200Response;
|
|
431
|
-
return body;
|
|
432
|
-
}
|
|
433
|
-
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
434
|
-
const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
|
|
435
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
436
|
-
"GetJobExecutionById400Response", ""
|
|
437
|
-
) as GetJobExecutionById400Response;
|
|
438
|
-
throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
|
|
439
|
-
}
|
|
440
|
-
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
441
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
445
|
-
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
446
|
-
const body: GetVariables200Response = ObjectSerializer.deserialize(
|
|
447
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
448
|
-
"GetVariables200Response", ""
|
|
449
|
-
) as GetVariables200Response;
|
|
450
|
-
return body;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
458
|
-
* to the expected objects
|
|
459
|
-
*
|
|
460
|
-
* @params response Response returned by the server for a request to updateVariable
|
|
461
|
-
* @throws ApiException if the response code was not in [200, 299]
|
|
462
|
-
*/
|
|
463
|
-
public async updateVariable(response: ResponseContext): Promise<VariableDto > {
|
|
464
|
-
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
465
|
-
if (isCodeInRange("201", response.httpStatusCode)) {
|
|
466
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
467
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
468
|
-
"VariableDto", ""
|
|
469
|
-
) as VariableDto;
|
|
470
|
-
return body;
|
|
471
|
-
}
|
|
472
|
-
if (isCodeInRange("400", response.httpStatusCode)) {
|
|
473
|
-
const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
|
|
474
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
475
|
-
"GetJobExecutionById400Response", ""
|
|
476
|
-
) as GetJobExecutionById400Response;
|
|
477
|
-
throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
|
|
478
|
-
}
|
|
479
|
-
if (isCodeInRange("401", response.httpStatusCode)) {
|
|
480
|
-
throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
484
|
-
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
485
|
-
const body: VariableDto = ObjectSerializer.deserialize(
|
|
486
|
-
ObjectSerializer.parse(await response.body.text(), contentType),
|
|
487
|
-
"VariableDto", ""
|
|
488
|
-
) as VariableDto;
|
|
489
|
-
return body;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
}
|
package/apis/baseapi.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Configuration } from '../configuration'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @export
|
|
6
|
-
*/
|
|
7
|
-
export const COLLECTION_FORMATS = {
|
|
8
|
-
csv: ",",
|
|
9
|
-
ssv: " ",
|
|
10
|
-
tsv: "\t",
|
|
11
|
-
pipes: "|",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @export
|
|
18
|
-
* @class BaseAPI
|
|
19
|
-
*/
|
|
20
|
-
export class BaseAPIRequestFactory {
|
|
21
|
-
|
|
22
|
-
constructor(protected configuration: Configuration) {
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @export
|
|
29
|
-
* @class RequiredError
|
|
30
|
-
* @extends {Error}
|
|
31
|
-
*/
|
|
32
|
-
export class RequiredError extends Error {
|
|
33
|
-
name: "RequiredError" = "RequiredError";
|
|
34
|
-
constructor(public api: string, public method: string, public field: string) {
|
|
35
|
-
super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".");
|
|
36
|
-
}
|
|
37
|
-
}
|
package/apis/exception.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents an error caused by an api call i.e. it has attributes for a HTTP status code
|
|
3
|
-
* and the returned body object.
|
|
4
|
-
*
|
|
5
|
-
* Example
|
|
6
|
-
* API returns a ErrorMessageObject whenever HTTP status code is not in [200, 299]
|
|
7
|
-
* => ApiException(404, someErrorMessageObject)
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export class ApiException<T> extends Error {
|
|
11
|
-
public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) {
|
|
12
|
-
super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " +
|
|
13
|
-
JSON.stringify(headers))
|
|
14
|
-
}
|
|
15
|
-
}
|
package/auth/auth.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { RequestContext } from "../http/http";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interface authentication schemes.
|
|
5
|
-
*/
|
|
6
|
-
export interface SecurityAuthentication {
|
|
7
|
-
/*
|
|
8
|
-
* @return returns the name of the security authentication as specified in OAI
|
|
9
|
-
*/
|
|
10
|
-
getName(): string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Applies the authentication scheme to the request context
|
|
14
|
-
*
|
|
15
|
-
* @params context the request context which should use this authentication scheme
|
|
16
|
-
*/
|
|
17
|
-
applySecurityAuthentication(context: RequestContext): void | Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TokenProvider {
|
|
21
|
-
getToken(): Promise<string> | string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Applies apiKey authentication to the request context.
|
|
26
|
-
*/
|
|
27
|
-
export class ApiKeyAuthHeaderAuthentication implements SecurityAuthentication {
|
|
28
|
-
/**
|
|
29
|
-
* Configures this api key authentication with the necessary properties
|
|
30
|
-
*
|
|
31
|
-
* @param apiKey: The api key to be used for every request
|
|
32
|
-
*/
|
|
33
|
-
public constructor(private apiKey: string) {}
|
|
34
|
-
|
|
35
|
-
public getName(): string {
|
|
36
|
-
return "ApiKeyAuthHeader";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public applySecurityAuthentication(context: RequestContext) {
|
|
40
|
-
context.setHeaderParam("X-Api-Key", this.apiKey);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Applies apiKey authentication to the request context.
|
|
46
|
-
*/
|
|
47
|
-
export class ApiKeyAuthQueryAuthentication implements SecurityAuthentication {
|
|
48
|
-
/**
|
|
49
|
-
* Configures this api key authentication with the necessary properties
|
|
50
|
-
*
|
|
51
|
-
* @param apiKey: The api key to be used for every request
|
|
52
|
-
*/
|
|
53
|
-
public constructor(private apiKey: string) {}
|
|
54
|
-
|
|
55
|
-
public getName(): string {
|
|
56
|
-
return "ApiKeyAuthQuery";
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public applySecurityAuthentication(context: RequestContext) {
|
|
60
|
-
context.setQueryParam("api_key", this.apiKey);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export type AuthMethods = {
|
|
66
|
-
"default"?: SecurityAuthentication,
|
|
67
|
-
"ApiKeyAuthHeader"?: SecurityAuthentication,
|
|
68
|
-
"ApiKeyAuthQuery"?: SecurityAuthentication
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export type ApiKeyConfiguration = string;
|
|
72
|
-
export type HttpBasicConfiguration = { "username": string, "password": string };
|
|
73
|
-
export type HttpBearerConfiguration = { tokenProvider: TokenProvider };
|
|
74
|
-
export type OAuth2Configuration = { accessToken: string };
|
|
75
|
-
|
|
76
|
-
export type AuthMethodsConfiguration = {
|
|
77
|
-
"default"?: SecurityAuthentication,
|
|
78
|
-
"ApiKeyAuthHeader"?: ApiKeyConfiguration,
|
|
79
|
-
"ApiKeyAuthQuery"?: ApiKeyConfiguration
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates the authentication methods from a swagger description.
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
export function configureAuthMethods(config: AuthMethodsConfiguration | undefined): AuthMethods {
|
|
87
|
-
let authMethods: AuthMethods = {}
|
|
88
|
-
|
|
89
|
-
if (!config) {
|
|
90
|
-
return authMethods;
|
|
91
|
-
}
|
|
92
|
-
authMethods["default"] = config["default"]
|
|
93
|
-
|
|
94
|
-
if (config["ApiKeyAuthHeader"]) {
|
|
95
|
-
authMethods["ApiKeyAuthHeader"] = new ApiKeyAuthHeaderAuthentication(
|
|
96
|
-
config["ApiKeyAuthHeader"]
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (config["ApiKeyAuthQuery"]) {
|
|
101
|
-
authMethods["ApiKeyAuthQuery"] = new ApiKeyAuthQueryAuthentication(
|
|
102
|
-
config["ApiKeyAuthQuery"]
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return authMethods;
|
|
107
|
-
}
|