@researchdatabox/raido-openapi-generated-node 0.0.2 → 5.0.0-RC1
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/dist/api.d.ts +1679 -0
- package/dist/api.js +701 -16
- package/dist/base.d.ts +55 -0
- package/dist/base.js +69 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +144 -0
- package/dist/configuration.d.ts +83 -0
- package/dist/configuration.js +92 -0
- package/dist/{model/accessType.js → index.d.ts} +3 -9
- package/dist/index.js +32 -0
- package/package.json +12 -7
- package/dist/api/adminExperimentalApi.js +0 -1092
- package/dist/api/apis.js +0 -41
- package/dist/api/basicRaidExperimentalApi.js +0 -561
- package/dist/api/publicExperimentalApi.js +0 -264
- package/dist/api/raidoStableV1Api.js +0 -369
- package/dist/api/unapprovedExperimentalApi.js +0 -147
- package/dist/model/access.js +0 -44
- package/dist/model/accessBlock.js +0 -35
- package/dist/model/accessStatement.js +0 -35
- package/dist/model/accessTypeWithSchemaUri.js +0 -35
- package/dist/model/alternateIdentifier.js +0 -35
- package/dist/model/alternateIdentifierBlock.js +0 -35
- package/dist/model/alternateUrl.js +0 -29
- package/dist/model/alternateUrlBlock.js +0 -29
- package/dist/model/apiKey.js +0 -74
- package/dist/model/appUser.js +0 -83
- package/dist/model/appUserExtraV1.js +0 -44
- package/dist/model/authzRequestExtraV1.js +0 -104
- package/dist/model/authzRequestStatus.js +0 -20
- package/dist/model/closedRaid.js +0 -35
- package/dist/model/contributor.js +0 -59
- package/dist/model/contributorBlock.js +0 -47
- package/dist/model/contributorIdentifierSchemeType.js +0 -18
- package/dist/model/contributorPosition.js +0 -47
- package/dist/model/contributorPositionRaidMetadataSchemaType.js +0 -22
- package/dist/model/contributorPositionSchemeType.js +0 -18
- package/dist/model/contributorPositionWithSchemaUri.js +0 -47
- package/dist/model/contributorRole.js +0 -35
- package/dist/model/contributorRoleCreditNisoOrgType.js +0 -31
- package/dist/model/contributorRoleSchemeType.js +0 -18
- package/dist/model/contributorRoleWithSchemaUri.js +0 -35
- package/dist/model/datesBlock.js +0 -35
- package/dist/model/description.js +0 -41
- package/dist/model/descriptionBlock.js +0 -35
- package/dist/model/descriptionType.js +0 -19
- package/dist/model/descriptionTypeWithSchemaUri.js +0 -35
- package/dist/model/failureResponse.js +0 -53
- package/dist/model/generateApiTokenRequest.js +0 -29
- package/dist/model/generateApiTokenResponse.js +0 -35
- package/dist/model/id.js +0 -89
- package/dist/model/idBlock.js +0 -95
- package/dist/model/language.js +0 -35
- package/dist/model/legacyMetadataSchemaV1.js +0 -68
- package/dist/model/migrateLegacyRaidRequest.js +0 -35
- package/dist/model/migrateLegacyRaidRequestMintRequest.js +0 -41
- package/dist/model/mintRaidoSchemaV1Request.js +0 -38
- package/dist/model/mintRaidoSchemaV1RequestMintRequest.js +0 -32
- package/dist/model/mintResponse.js +0 -41
- package/dist/model/modelDate.js +0 -38
- package/dist/model/models.js +0 -506
- package/dist/model/organisation.js +0 -41
- package/dist/model/organisationBlock.js +0 -41
- package/dist/model/organisationIdentifierSchemeType.js +0 -18
- package/dist/model/organisationRole.js +0 -47
- package/dist/model/organisationRoleSchemeType.js +0 -18
- package/dist/model/organisationRoleType.js +0 -22
- package/dist/model/organisationRoleWithSchemaUri.js +0 -47
- package/dist/model/owner.js +0 -47
- package/dist/model/publicClosedMetadataSchemaV1.js +0 -41
- package/dist/model/publicRaidMetadataSchemaV1.js +0 -116
- package/dist/model/publicReadRaidMetadataResponseV1.js +0 -116
- package/dist/model/publicReadRaidResponseV3.js +0 -56
- package/dist/model/publicServicePoint.js +0 -38
- package/dist/model/raidCreateRequest.js +0 -107
- package/dist/model/raidDto.js +0 -107
- package/dist/model/raidListItemV2.js +0 -53
- package/dist/model/raidListItemV3.js +0 -53
- package/dist/model/raidListRequestV2.js +0 -35
- package/dist/model/raidUpdateRequest.js +0 -107
- package/dist/model/raidoMetadataSchemaV1.js +0 -116
- package/dist/model/raidoMetadataSchemaV2.js +0 -116
- package/dist/model/raidoMetaschema.js +0 -22
- package/dist/model/raidoMetaschemaV2.js +0 -23
- package/dist/model/readRaidResponseV2.js +0 -71
- package/dist/model/readRaidV2Request.js +0 -29
- package/dist/model/registrationAgency.js +0 -38
- package/dist/model/relatedObject.js +0 -47
- package/dist/model/relatedObjectBlock.js +0 -53
- package/dist/model/relatedObjectCategory.js +0 -35
- package/dist/model/relatedObjectType.js +0 -35
- package/dist/model/relatedRaid.js +0 -35
- package/dist/model/relatedRaidBlock.js +0 -41
- package/dist/model/relatedRaidType.js +0 -35
- package/dist/model/servicePoint.js +0 -74
- package/dist/model/spatialCoverage.js +0 -47
- package/dist/model/spatialCoverageBlock.js +0 -41
- package/dist/model/subject.js +0 -41
- package/dist/model/subjectBlock.js +0 -41
- package/dist/model/subjectKeyword.js +0 -35
- package/dist/model/title.js +0 -53
- package/dist/model/titleBlock.js +0 -47
- package/dist/model/titleType.js +0 -19
- package/dist/model/titleTypeWithSchemaUri.js +0 -35
- package/dist/model/traditionalKnowledgeLabel.js +0 -35
- package/dist/model/traditionalKnowledgeLabelBlock.js +0 -29
- package/dist/model/updateAuthzRequest.js +0 -35
- package/dist/model/updateAuthzRequestStatus.js +0 -47
- package/dist/model/updateAuthzResponse.js +0 -35
- package/dist/model/updateRaidoSchemaV1Request.js +0 -29
- package/dist/model/updateRaidoSchemaV2Request.js +0 -29
- package/dist/model/validationFailure.js +0 -41
- package/dist/model/validationFailureResponse.js +0 -59
- package/dist/model/versionResult.js +0 -47
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* RAID v2 API
|
|
4
|
-
* This file is where all the endpoint paths are defined, it\'s the \"top level\' of the OpenAPI definition that links all the different files together. The `3.0` in the filename refers to this file being based on OpenAPI 3.0 as opposed to OpenAPI 3.1, which the tooling doesn\'t support yet. The `2.0.0` in the version field refers to the fact that there\'s already a `1.0.0` used for the legacy RAiD application (not used in this project, see ../idl-raid-v1). Note that swagger ui doesn\'t currently work with our spec, see https://github.com/swagger-api/swagger-ui/issues/7724 But the spec works fine with openapi-generator tooling.
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 2.0.0
|
|
7
|
-
* Contact: contact@raid.org
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PublicExperimentalApi = exports.PublicExperimentalApiApiKeys = void 0;
|
|
18
|
-
const request_1 = __importDefault(require("request"));
|
|
19
|
-
const models_1 = require("../model/models");
|
|
20
|
-
const models_2 = require("../model/models");
|
|
21
|
-
const apis_1 = require("./apis");
|
|
22
|
-
let defaultBasePath = 'https://api.prod.raid.org.au';
|
|
23
|
-
// ===============================================
|
|
24
|
-
// This file is autogenerated - Please do not edit
|
|
25
|
-
// ===============================================
|
|
26
|
-
var PublicExperimentalApiApiKeys;
|
|
27
|
-
(function (PublicExperimentalApiApiKeys) {
|
|
28
|
-
})(PublicExperimentalApiApiKeys = exports.PublicExperimentalApiApiKeys || (exports.PublicExperimentalApiApiKeys = {}));
|
|
29
|
-
class PublicExperimentalApi {
|
|
30
|
-
_basePath = defaultBasePath;
|
|
31
|
-
_defaultHeaders = {};
|
|
32
|
-
_useQuerystring = false;
|
|
33
|
-
authentications = {
|
|
34
|
-
'default': new models_1.VoidAuth(),
|
|
35
|
-
'bearerAuth': new models_2.HttpBearerAuth(),
|
|
36
|
-
};
|
|
37
|
-
interceptors = [];
|
|
38
|
-
constructor(basePathOrUsername, password, basePath) {
|
|
39
|
-
if (password) {
|
|
40
|
-
if (basePath) {
|
|
41
|
-
this.basePath = basePath;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (basePathOrUsername) {
|
|
46
|
-
this.basePath = basePathOrUsername;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
set useQuerystring(value) {
|
|
51
|
-
this._useQuerystring = value;
|
|
52
|
-
}
|
|
53
|
-
set basePath(basePath) {
|
|
54
|
-
this._basePath = basePath;
|
|
55
|
-
}
|
|
56
|
-
set defaultHeaders(defaultHeaders) {
|
|
57
|
-
this._defaultHeaders = defaultHeaders;
|
|
58
|
-
}
|
|
59
|
-
get defaultHeaders() {
|
|
60
|
-
return this._defaultHeaders;
|
|
61
|
-
}
|
|
62
|
-
get basePath() {
|
|
63
|
-
return this._basePath;
|
|
64
|
-
}
|
|
65
|
-
setDefaultAuthentication(auth) {
|
|
66
|
-
this.authentications.default = auth;
|
|
67
|
-
}
|
|
68
|
-
setApiKey(key, value) {
|
|
69
|
-
this.authentications[PublicExperimentalApiApiKeys[key]].apiKey = value;
|
|
70
|
-
}
|
|
71
|
-
set accessToken(accessToken) {
|
|
72
|
-
this.authentications.bearerAuth.accessToken = accessToken;
|
|
73
|
-
}
|
|
74
|
-
addInterceptor(interceptor) {
|
|
75
|
-
this.interceptors.push(interceptor);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Returns only enabled service-points - intended for use on the authz-request page. Note that it is not paginated nor does it have a limit on the number of records it returns. May need to be refactored to something more scalable in future, if we ever have a lot of service-points.
|
|
79
|
-
* @summary list service point data that un-authn users can see
|
|
80
|
-
*/
|
|
81
|
-
async publicListServicePoint(options = { headers: {} }) {
|
|
82
|
-
const localVarPath = this.basePath + '/v2/public/list-service-point/v1';
|
|
83
|
-
let localVarQueryParameters = {};
|
|
84
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
85
|
-
const produces = ['application/json'];
|
|
86
|
-
// give precedence to 'application/json'
|
|
87
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
88
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
92
|
-
}
|
|
93
|
-
let localVarFormParams = {};
|
|
94
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
95
|
-
let localVarUseFormData = false;
|
|
96
|
-
let localVarRequestOptions = {
|
|
97
|
-
method: 'GET',
|
|
98
|
-
qs: localVarQueryParameters,
|
|
99
|
-
headers: localVarHeaderParams,
|
|
100
|
-
uri: localVarPath,
|
|
101
|
-
useQuerystring: this._useQuerystring,
|
|
102
|
-
json: true,
|
|
103
|
-
};
|
|
104
|
-
let authenticationPromise = Promise.resolve();
|
|
105
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
106
|
-
let interceptorPromise = authenticationPromise;
|
|
107
|
-
for (const interceptor of this.interceptors) {
|
|
108
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
109
|
-
}
|
|
110
|
-
return interceptorPromise.then(() => {
|
|
111
|
-
if (Object.keys(localVarFormParams).length) {
|
|
112
|
-
if (localVarUseFormData) {
|
|
113
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return new Promise((resolve, reject) => {
|
|
120
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
121
|
-
if (error) {
|
|
122
|
-
reject(error);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
126
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<PublicServicePoint>");
|
|
127
|
-
resolve({ response: response, body: body });
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
* @summary read raid data
|
|
140
|
-
* @param handle handle
|
|
141
|
-
*/
|
|
142
|
-
async publicReadRaidV3(handle, options = { headers: {} }) {
|
|
143
|
-
const localVarPath = this.basePath + '/v2/public/handle/v3/{handle}'
|
|
144
|
-
.replace('{' + 'handle' + '}', encodeURIComponent(String(handle)));
|
|
145
|
-
let localVarQueryParameters = {};
|
|
146
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
147
|
-
const produces = ['application/json'];
|
|
148
|
-
// give precedence to 'application/json'
|
|
149
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
150
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
154
|
-
}
|
|
155
|
-
let localVarFormParams = {};
|
|
156
|
-
// verify required parameter 'handle' is not null or undefined
|
|
157
|
-
if (handle === null || handle === undefined) {
|
|
158
|
-
throw new Error('Required parameter handle was null or undefined when calling publicReadRaidV3.');
|
|
159
|
-
}
|
|
160
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
161
|
-
let localVarUseFormData = false;
|
|
162
|
-
let localVarRequestOptions = {
|
|
163
|
-
method: 'GET',
|
|
164
|
-
qs: localVarQueryParameters,
|
|
165
|
-
headers: localVarHeaderParams,
|
|
166
|
-
uri: localVarPath,
|
|
167
|
-
useQuerystring: this._useQuerystring,
|
|
168
|
-
json: true,
|
|
169
|
-
};
|
|
170
|
-
let authenticationPromise = Promise.resolve();
|
|
171
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
172
|
-
let interceptorPromise = authenticationPromise;
|
|
173
|
-
for (const interceptor of this.interceptors) {
|
|
174
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
175
|
-
}
|
|
176
|
-
return interceptorPromise.then(() => {
|
|
177
|
-
if (Object.keys(localVarFormParams).length) {
|
|
178
|
-
if (localVarUseFormData) {
|
|
179
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return new Promise((resolve, reject) => {
|
|
186
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
187
|
-
if (error) {
|
|
188
|
-
reject(error);
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
192
|
-
body = models_1.ObjectSerializer.deserialize(body, "PublicReadRaidResponseV3");
|
|
193
|
-
resolve({ response: response, body: body });
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
*
|
|
205
|
-
* @summary get info about server
|
|
206
|
-
*/
|
|
207
|
-
async version(options = { headers: {} }) {
|
|
208
|
-
const localVarPath = this.basePath + '/v2/public/version';
|
|
209
|
-
let localVarQueryParameters = {};
|
|
210
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
211
|
-
const produces = ['application/json'];
|
|
212
|
-
// give precedence to 'application/json'
|
|
213
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
214
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
218
|
-
}
|
|
219
|
-
let localVarFormParams = {};
|
|
220
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
221
|
-
let localVarUseFormData = false;
|
|
222
|
-
let localVarRequestOptions = {
|
|
223
|
-
method: 'GET',
|
|
224
|
-
qs: localVarQueryParameters,
|
|
225
|
-
headers: localVarHeaderParams,
|
|
226
|
-
uri: localVarPath,
|
|
227
|
-
useQuerystring: this._useQuerystring,
|
|
228
|
-
json: true,
|
|
229
|
-
};
|
|
230
|
-
let authenticationPromise = Promise.resolve();
|
|
231
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
232
|
-
let interceptorPromise = authenticationPromise;
|
|
233
|
-
for (const interceptor of this.interceptors) {
|
|
234
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
235
|
-
}
|
|
236
|
-
return interceptorPromise.then(() => {
|
|
237
|
-
if (Object.keys(localVarFormParams).length) {
|
|
238
|
-
if (localVarUseFormData) {
|
|
239
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return new Promise((resolve, reject) => {
|
|
246
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
247
|
-
if (error) {
|
|
248
|
-
reject(error);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
252
|
-
body = models_1.ObjectSerializer.deserialize(body, "VersionResult");
|
|
253
|
-
resolve({ response: response, body: body });
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
exports.PublicExperimentalApi = PublicExperimentalApi;
|
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* RAID v2 API
|
|
4
|
-
* This file is where all the endpoint paths are defined, it\'s the \"top level\' of the OpenAPI definition that links all the different files together. The `3.0` in the filename refers to this file being based on OpenAPI 3.0 as opposed to OpenAPI 3.1, which the tooling doesn\'t support yet. The `2.0.0` in the version field refers to the fact that there\'s already a `1.0.0` used for the legacy RAiD application (not used in this project, see ../idl-raid-v1). Note that swagger ui doesn\'t currently work with our spec, see https://github.com/swagger-api/swagger-ui/issues/7724 But the spec works fine with openapi-generator tooling.
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 2.0.0
|
|
7
|
-
* Contact: contact@raid.org
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RaidoStableV1Api = exports.RaidoStableV1ApiApiKeys = void 0;
|
|
18
|
-
const request_1 = __importDefault(require("request"));
|
|
19
|
-
const models_1 = require("../model/models");
|
|
20
|
-
const models_2 = require("../model/models");
|
|
21
|
-
const apis_1 = require("./apis");
|
|
22
|
-
let defaultBasePath = 'https://api.prod.raid.org.au';
|
|
23
|
-
// ===============================================
|
|
24
|
-
// This file is autogenerated - Please do not edit
|
|
25
|
-
// ===============================================
|
|
26
|
-
var RaidoStableV1ApiApiKeys;
|
|
27
|
-
(function (RaidoStableV1ApiApiKeys) {
|
|
28
|
-
})(RaidoStableV1ApiApiKeys = exports.RaidoStableV1ApiApiKeys || (exports.RaidoStableV1ApiApiKeys = {}));
|
|
29
|
-
class RaidoStableV1Api {
|
|
30
|
-
_basePath = defaultBasePath;
|
|
31
|
-
_defaultHeaders = {};
|
|
32
|
-
_useQuerystring = false;
|
|
33
|
-
authentications = {
|
|
34
|
-
'default': new models_1.VoidAuth(),
|
|
35
|
-
'bearerAuth': new models_2.HttpBearerAuth(),
|
|
36
|
-
};
|
|
37
|
-
interceptors = [];
|
|
38
|
-
constructor(basePathOrUsername, password, basePath) {
|
|
39
|
-
if (password) {
|
|
40
|
-
if (basePath) {
|
|
41
|
-
this.basePath = basePath;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (basePathOrUsername) {
|
|
46
|
-
this.basePath = basePathOrUsername;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
set useQuerystring(value) {
|
|
51
|
-
this._useQuerystring = value;
|
|
52
|
-
}
|
|
53
|
-
set basePath(basePath) {
|
|
54
|
-
this._basePath = basePath;
|
|
55
|
-
}
|
|
56
|
-
set defaultHeaders(defaultHeaders) {
|
|
57
|
-
this._defaultHeaders = defaultHeaders;
|
|
58
|
-
}
|
|
59
|
-
get defaultHeaders() {
|
|
60
|
-
return this._defaultHeaders;
|
|
61
|
-
}
|
|
62
|
-
get basePath() {
|
|
63
|
-
return this._basePath;
|
|
64
|
-
}
|
|
65
|
-
setDefaultAuthentication(auth) {
|
|
66
|
-
this.authentications.default = auth;
|
|
67
|
-
}
|
|
68
|
-
setApiKey(key, value) {
|
|
69
|
-
this.authentications[RaidoStableV1ApiApiKeys[key]].apiKey = value;
|
|
70
|
-
}
|
|
71
|
-
set accessToken(accessToken) {
|
|
72
|
-
this.authentications.bearerAuth.accessToken = accessToken;
|
|
73
|
-
}
|
|
74
|
-
addInterceptor(interceptor) {
|
|
75
|
-
this.interceptors.push(interceptor);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @summary mint a raid
|
|
80
|
-
* @param raidCreateRequest
|
|
81
|
-
*/
|
|
82
|
-
async createRaidV1(raidCreateRequest, options = { headers: {} }) {
|
|
83
|
-
const localVarPath = this.basePath + '/raid';
|
|
84
|
-
let localVarQueryParameters = {};
|
|
85
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
86
|
-
const produces = ['application/json'];
|
|
87
|
-
// give precedence to 'application/json'
|
|
88
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
89
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
93
|
-
}
|
|
94
|
-
let localVarFormParams = {};
|
|
95
|
-
// verify required parameter 'raidCreateRequest' is not null or undefined
|
|
96
|
-
if (raidCreateRequest === null || raidCreateRequest === undefined) {
|
|
97
|
-
throw new Error('Required parameter raidCreateRequest was null or undefined when calling createRaidV1.');
|
|
98
|
-
}
|
|
99
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
100
|
-
let localVarUseFormData = false;
|
|
101
|
-
let localVarRequestOptions = {
|
|
102
|
-
method: 'POST',
|
|
103
|
-
qs: localVarQueryParameters,
|
|
104
|
-
headers: localVarHeaderParams,
|
|
105
|
-
uri: localVarPath,
|
|
106
|
-
useQuerystring: this._useQuerystring,
|
|
107
|
-
json: true,
|
|
108
|
-
body: models_1.ObjectSerializer.serialize(raidCreateRequest, "RaidCreateRequest")
|
|
109
|
-
};
|
|
110
|
-
let authenticationPromise = Promise.resolve();
|
|
111
|
-
if (this.authentications.bearerAuth.accessToken) {
|
|
112
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
113
|
-
}
|
|
114
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
115
|
-
let interceptorPromise = authenticationPromise;
|
|
116
|
-
for (const interceptor of this.interceptors) {
|
|
117
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
118
|
-
}
|
|
119
|
-
return interceptorPromise.then(() => {
|
|
120
|
-
if (Object.keys(localVarFormParams).length) {
|
|
121
|
-
if (localVarUseFormData) {
|
|
122
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return new Promise((resolve, reject) => {
|
|
129
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
130
|
-
if (error) {
|
|
131
|
-
reject(error);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
135
|
-
body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
|
|
136
|
-
resolve({ response: response, body: body });
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
*
|
|
148
|
-
* @summary list raids
|
|
149
|
-
* @param servicePointId
|
|
150
|
-
*/
|
|
151
|
-
async listRaidsV1(servicePointId, options = { headers: {} }) {
|
|
152
|
-
const localVarPath = this.basePath + '/raid';
|
|
153
|
-
let localVarQueryParameters = {};
|
|
154
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
155
|
-
const produces = ['application/json'];
|
|
156
|
-
// give precedence to 'application/json'
|
|
157
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
158
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
162
|
-
}
|
|
163
|
-
let localVarFormParams = {};
|
|
164
|
-
if (servicePointId !== undefined) {
|
|
165
|
-
localVarQueryParameters['servicePointId'] = models_1.ObjectSerializer.serialize(servicePointId, "number");
|
|
166
|
-
}
|
|
167
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
168
|
-
let localVarUseFormData = false;
|
|
169
|
-
let localVarRequestOptions = {
|
|
170
|
-
method: 'GET',
|
|
171
|
-
qs: localVarQueryParameters,
|
|
172
|
-
headers: localVarHeaderParams,
|
|
173
|
-
uri: localVarPath,
|
|
174
|
-
useQuerystring: this._useQuerystring,
|
|
175
|
-
json: true,
|
|
176
|
-
};
|
|
177
|
-
let authenticationPromise = Promise.resolve();
|
|
178
|
-
if (this.authentications.bearerAuth.accessToken) {
|
|
179
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
180
|
-
}
|
|
181
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
182
|
-
let interceptorPromise = authenticationPromise;
|
|
183
|
-
for (const interceptor of this.interceptors) {
|
|
184
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
185
|
-
}
|
|
186
|
-
return interceptorPromise.then(() => {
|
|
187
|
-
if (Object.keys(localVarFormParams).length) {
|
|
188
|
-
if (localVarUseFormData) {
|
|
189
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return new Promise((resolve, reject) => {
|
|
196
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
197
|
-
if (error) {
|
|
198
|
-
reject(error);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
202
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<RaidDto>");
|
|
203
|
-
resolve({ response: response, body: body });
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
*
|
|
215
|
-
* @summary read a raid, caller must be authorized
|
|
216
|
-
* @param prefix Prefix of the raid handle
|
|
217
|
-
* @param suffix Suffix of the raid handle
|
|
218
|
-
*/
|
|
219
|
-
async readRaidV1(prefix, suffix, options = { headers: {} }) {
|
|
220
|
-
const localVarPath = this.basePath + '/raid/{prefix}/{suffix}'
|
|
221
|
-
.replace('{' + 'prefix' + '}', encodeURIComponent(String(prefix)))
|
|
222
|
-
.replace('{' + 'suffix' + '}', encodeURIComponent(String(suffix)));
|
|
223
|
-
let localVarQueryParameters = {};
|
|
224
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
225
|
-
const produces = ['application/json'];
|
|
226
|
-
// give precedence to 'application/json'
|
|
227
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
228
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
232
|
-
}
|
|
233
|
-
let localVarFormParams = {};
|
|
234
|
-
// verify required parameter 'prefix' is not null or undefined
|
|
235
|
-
if (prefix === null || prefix === undefined) {
|
|
236
|
-
throw new Error('Required parameter prefix was null or undefined when calling readRaidV1.');
|
|
237
|
-
}
|
|
238
|
-
// verify required parameter 'suffix' is not null or undefined
|
|
239
|
-
if (suffix === null || suffix === undefined) {
|
|
240
|
-
throw new Error('Required parameter suffix was null or undefined when calling readRaidV1.');
|
|
241
|
-
}
|
|
242
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
243
|
-
let localVarUseFormData = false;
|
|
244
|
-
let localVarRequestOptions = {
|
|
245
|
-
method: 'GET',
|
|
246
|
-
qs: localVarQueryParameters,
|
|
247
|
-
headers: localVarHeaderParams,
|
|
248
|
-
uri: localVarPath,
|
|
249
|
-
useQuerystring: this._useQuerystring,
|
|
250
|
-
json: true,
|
|
251
|
-
};
|
|
252
|
-
let authenticationPromise = Promise.resolve();
|
|
253
|
-
if (this.authentications.bearerAuth.accessToken) {
|
|
254
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
255
|
-
}
|
|
256
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
257
|
-
let interceptorPromise = authenticationPromise;
|
|
258
|
-
for (const interceptor of this.interceptors) {
|
|
259
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
260
|
-
}
|
|
261
|
-
return interceptorPromise.then(() => {
|
|
262
|
-
if (Object.keys(localVarFormParams).length) {
|
|
263
|
-
if (localVarUseFormData) {
|
|
264
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return new Promise((resolve, reject) => {
|
|
271
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
272
|
-
if (error) {
|
|
273
|
-
reject(error);
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
277
|
-
body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
|
|
278
|
-
resolve({ response: response, body: body });
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
*
|
|
290
|
-
* @param prefix Prefix of the raid handle
|
|
291
|
-
* @param suffix Suffix of the raid handle
|
|
292
|
-
* @param raidUpdateRequest
|
|
293
|
-
*/
|
|
294
|
-
async updateRaidV1(prefix, suffix, raidUpdateRequest, options = { headers: {} }) {
|
|
295
|
-
const localVarPath = this.basePath + '/raid/{prefix}/{suffix}'
|
|
296
|
-
.replace('{' + 'prefix' + '}', encodeURIComponent(String(prefix)))
|
|
297
|
-
.replace('{' + 'suffix' + '}', encodeURIComponent(String(suffix)));
|
|
298
|
-
let localVarQueryParameters = {};
|
|
299
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
300
|
-
const produces = ['application/json'];
|
|
301
|
-
// give precedence to 'application/json'
|
|
302
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
303
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
307
|
-
}
|
|
308
|
-
let localVarFormParams = {};
|
|
309
|
-
// verify required parameter 'prefix' is not null or undefined
|
|
310
|
-
if (prefix === null || prefix === undefined) {
|
|
311
|
-
throw new Error('Required parameter prefix was null or undefined when calling updateRaidV1.');
|
|
312
|
-
}
|
|
313
|
-
// verify required parameter 'suffix' is not null or undefined
|
|
314
|
-
if (suffix === null || suffix === undefined) {
|
|
315
|
-
throw new Error('Required parameter suffix was null or undefined when calling updateRaidV1.');
|
|
316
|
-
}
|
|
317
|
-
// verify required parameter 'raidUpdateRequest' is not null or undefined
|
|
318
|
-
if (raidUpdateRequest === null || raidUpdateRequest === undefined) {
|
|
319
|
-
throw new Error('Required parameter raidUpdateRequest was null or undefined when calling updateRaidV1.');
|
|
320
|
-
}
|
|
321
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
322
|
-
let localVarUseFormData = false;
|
|
323
|
-
let localVarRequestOptions = {
|
|
324
|
-
method: 'PUT',
|
|
325
|
-
qs: localVarQueryParameters,
|
|
326
|
-
headers: localVarHeaderParams,
|
|
327
|
-
uri: localVarPath,
|
|
328
|
-
useQuerystring: this._useQuerystring,
|
|
329
|
-
json: true,
|
|
330
|
-
body: models_1.ObjectSerializer.serialize(raidUpdateRequest, "RaidUpdateRequest")
|
|
331
|
-
};
|
|
332
|
-
let authenticationPromise = Promise.resolve();
|
|
333
|
-
if (this.authentications.bearerAuth.accessToken) {
|
|
334
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
335
|
-
}
|
|
336
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
337
|
-
let interceptorPromise = authenticationPromise;
|
|
338
|
-
for (const interceptor of this.interceptors) {
|
|
339
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
340
|
-
}
|
|
341
|
-
return interceptorPromise.then(() => {
|
|
342
|
-
if (Object.keys(localVarFormParams).length) {
|
|
343
|
-
if (localVarUseFormData) {
|
|
344
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
return new Promise((resolve, reject) => {
|
|
351
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
352
|
-
if (error) {
|
|
353
|
-
reject(error);
|
|
354
|
-
}
|
|
355
|
-
else {
|
|
356
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
357
|
-
body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
|
|
358
|
-
resolve({ response: response, body: body });
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
exports.RaidoStableV1Api = RaidoStableV1Api;
|