@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.
Files changed (114) hide show
  1. package/dist/api.d.ts +1679 -0
  2. package/dist/api.js +701 -16
  3. package/dist/base.d.ts +55 -0
  4. package/dist/base.js +69 -0
  5. package/dist/common.d.ts +65 -0
  6. package/dist/common.js +144 -0
  7. package/dist/configuration.d.ts +83 -0
  8. package/dist/configuration.js +92 -0
  9. package/dist/{model/accessType.js → index.d.ts} +3 -9
  10. package/dist/index.js +32 -0
  11. package/package.json +12 -7
  12. package/dist/api/adminExperimentalApi.js +0 -1092
  13. package/dist/api/apis.js +0 -41
  14. package/dist/api/basicRaidExperimentalApi.js +0 -561
  15. package/dist/api/publicExperimentalApi.js +0 -264
  16. package/dist/api/raidoStableV1Api.js +0 -369
  17. package/dist/api/unapprovedExperimentalApi.js +0 -147
  18. package/dist/model/access.js +0 -44
  19. package/dist/model/accessBlock.js +0 -35
  20. package/dist/model/accessStatement.js +0 -35
  21. package/dist/model/accessTypeWithSchemaUri.js +0 -35
  22. package/dist/model/alternateIdentifier.js +0 -35
  23. package/dist/model/alternateIdentifierBlock.js +0 -35
  24. package/dist/model/alternateUrl.js +0 -29
  25. package/dist/model/alternateUrlBlock.js +0 -29
  26. package/dist/model/apiKey.js +0 -74
  27. package/dist/model/appUser.js +0 -83
  28. package/dist/model/appUserExtraV1.js +0 -44
  29. package/dist/model/authzRequestExtraV1.js +0 -104
  30. package/dist/model/authzRequestStatus.js +0 -20
  31. package/dist/model/closedRaid.js +0 -35
  32. package/dist/model/contributor.js +0 -59
  33. package/dist/model/contributorBlock.js +0 -47
  34. package/dist/model/contributorIdentifierSchemeType.js +0 -18
  35. package/dist/model/contributorPosition.js +0 -47
  36. package/dist/model/contributorPositionRaidMetadataSchemaType.js +0 -22
  37. package/dist/model/contributorPositionSchemeType.js +0 -18
  38. package/dist/model/contributorPositionWithSchemaUri.js +0 -47
  39. package/dist/model/contributorRole.js +0 -35
  40. package/dist/model/contributorRoleCreditNisoOrgType.js +0 -31
  41. package/dist/model/contributorRoleSchemeType.js +0 -18
  42. package/dist/model/contributorRoleWithSchemaUri.js +0 -35
  43. package/dist/model/datesBlock.js +0 -35
  44. package/dist/model/description.js +0 -41
  45. package/dist/model/descriptionBlock.js +0 -35
  46. package/dist/model/descriptionType.js +0 -19
  47. package/dist/model/descriptionTypeWithSchemaUri.js +0 -35
  48. package/dist/model/failureResponse.js +0 -53
  49. package/dist/model/generateApiTokenRequest.js +0 -29
  50. package/dist/model/generateApiTokenResponse.js +0 -35
  51. package/dist/model/id.js +0 -89
  52. package/dist/model/idBlock.js +0 -95
  53. package/dist/model/language.js +0 -35
  54. package/dist/model/legacyMetadataSchemaV1.js +0 -68
  55. package/dist/model/migrateLegacyRaidRequest.js +0 -35
  56. package/dist/model/migrateLegacyRaidRequestMintRequest.js +0 -41
  57. package/dist/model/mintRaidoSchemaV1Request.js +0 -38
  58. package/dist/model/mintRaidoSchemaV1RequestMintRequest.js +0 -32
  59. package/dist/model/mintResponse.js +0 -41
  60. package/dist/model/modelDate.js +0 -38
  61. package/dist/model/models.js +0 -506
  62. package/dist/model/organisation.js +0 -41
  63. package/dist/model/organisationBlock.js +0 -41
  64. package/dist/model/organisationIdentifierSchemeType.js +0 -18
  65. package/dist/model/organisationRole.js +0 -47
  66. package/dist/model/organisationRoleSchemeType.js +0 -18
  67. package/dist/model/organisationRoleType.js +0 -22
  68. package/dist/model/organisationRoleWithSchemaUri.js +0 -47
  69. package/dist/model/owner.js +0 -47
  70. package/dist/model/publicClosedMetadataSchemaV1.js +0 -41
  71. package/dist/model/publicRaidMetadataSchemaV1.js +0 -116
  72. package/dist/model/publicReadRaidMetadataResponseV1.js +0 -116
  73. package/dist/model/publicReadRaidResponseV3.js +0 -56
  74. package/dist/model/publicServicePoint.js +0 -38
  75. package/dist/model/raidCreateRequest.js +0 -107
  76. package/dist/model/raidDto.js +0 -107
  77. package/dist/model/raidListItemV2.js +0 -53
  78. package/dist/model/raidListItemV3.js +0 -53
  79. package/dist/model/raidListRequestV2.js +0 -35
  80. package/dist/model/raidUpdateRequest.js +0 -107
  81. package/dist/model/raidoMetadataSchemaV1.js +0 -116
  82. package/dist/model/raidoMetadataSchemaV2.js +0 -116
  83. package/dist/model/raidoMetaschema.js +0 -22
  84. package/dist/model/raidoMetaschemaV2.js +0 -23
  85. package/dist/model/readRaidResponseV2.js +0 -71
  86. package/dist/model/readRaidV2Request.js +0 -29
  87. package/dist/model/registrationAgency.js +0 -38
  88. package/dist/model/relatedObject.js +0 -47
  89. package/dist/model/relatedObjectBlock.js +0 -53
  90. package/dist/model/relatedObjectCategory.js +0 -35
  91. package/dist/model/relatedObjectType.js +0 -35
  92. package/dist/model/relatedRaid.js +0 -35
  93. package/dist/model/relatedRaidBlock.js +0 -41
  94. package/dist/model/relatedRaidType.js +0 -35
  95. package/dist/model/servicePoint.js +0 -74
  96. package/dist/model/spatialCoverage.js +0 -47
  97. package/dist/model/spatialCoverageBlock.js +0 -41
  98. package/dist/model/subject.js +0 -41
  99. package/dist/model/subjectBlock.js +0 -41
  100. package/dist/model/subjectKeyword.js +0 -35
  101. package/dist/model/title.js +0 -53
  102. package/dist/model/titleBlock.js +0 -47
  103. package/dist/model/titleType.js +0 -19
  104. package/dist/model/titleTypeWithSchemaUri.js +0 -35
  105. package/dist/model/traditionalKnowledgeLabel.js +0 -35
  106. package/dist/model/traditionalKnowledgeLabelBlock.js +0 -29
  107. package/dist/model/updateAuthzRequest.js +0 -35
  108. package/dist/model/updateAuthzRequestStatus.js +0 -47
  109. package/dist/model/updateAuthzResponse.js +0 -35
  110. package/dist/model/updateRaidoSchemaV1Request.js +0 -29
  111. package/dist/model/updateRaidoSchemaV2Request.js +0 -29
  112. package/dist/model/validationFailure.js +0 -41
  113. package/dist/model/validationFailureResponse.js +0 -59
  114. package/dist/model/versionResult.js +0 -47
package/dist/api/apis.js DELETED
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.APIS = exports.HttpError = void 0;
18
- __exportStar(require("./adminExperimentalApi"), exports);
19
- const adminExperimentalApi_1 = require("./adminExperimentalApi");
20
- __exportStar(require("./basicRaidExperimentalApi"), exports);
21
- const basicRaidExperimentalApi_1 = require("./basicRaidExperimentalApi");
22
- __exportStar(require("./publicExperimentalApi"), exports);
23
- const publicExperimentalApi_1 = require("./publicExperimentalApi");
24
- __exportStar(require("./raidoStableV1Api"), exports);
25
- const raidoStableV1Api_1 = require("./raidoStableV1Api");
26
- __exportStar(require("./unapprovedExperimentalApi"), exports);
27
- const unapprovedExperimentalApi_1 = require("./unapprovedExperimentalApi");
28
- class HttpError extends Error {
29
- response;
30
- body;
31
- statusCode;
32
- constructor(response, body, statusCode) {
33
- super('HTTP request failed');
34
- this.response = response;
35
- this.body = body;
36
- this.statusCode = statusCode;
37
- this.name = 'HttpError';
38
- }
39
- }
40
- exports.HttpError = HttpError;
41
- exports.APIS = [adminExperimentalApi_1.AdminExperimentalApi, basicRaidExperimentalApi_1.BasicRaidExperimentalApi, publicExperimentalApi_1.PublicExperimentalApi, raidoStableV1Api_1.RaidoStableV1Api, unapprovedExperimentalApi_1.UnapprovedExperimentalApi];
@@ -1,561 +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.BasicRaidExperimentalApi = exports.BasicRaidExperimentalApiApiKeys = 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 BasicRaidExperimentalApiApiKeys;
27
- (function (BasicRaidExperimentalApiApiKeys) {
28
- })(BasicRaidExperimentalApiApiKeys = exports.BasicRaidExperimentalApiApiKeys || (exports.BasicRaidExperimentalApiApiKeys = {}));
29
- class BasicRaidExperimentalApi {
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[BasicRaidExperimentalApiApiKeys[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 list raids
80
- * @param raidListRequestV2
81
- */
82
- async listRaidV2(raidListRequestV2, options = { headers: {} }) {
83
- const localVarPath = this.basePath + '/v2/experimental/list-raid/v2';
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 'raidListRequestV2' is not null or undefined
96
- if (raidListRequestV2 === null || raidListRequestV2 === undefined) {
97
- throw new Error('Required parameter raidListRequestV2 was null or undefined when calling listRaidV2.');
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(raidListRequestV2, "RaidListRequestV2")
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, "Array<RaidListItemV2>");
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 raidListRequestV2
150
- */
151
- async listRaidV3(raidListRequestV2, options = { headers: {} }) {
152
- const localVarPath = this.basePath + '/v2/experimental/list-raid/v3';
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
- // verify required parameter 'raidListRequestV2' is not null or undefined
165
- if (raidListRequestV2 === null || raidListRequestV2 === undefined) {
166
- throw new Error('Required parameter raidListRequestV2 was null or undefined when calling listRaidV3.');
167
- }
168
- Object.assign(localVarHeaderParams, options.headers);
169
- let localVarUseFormData = false;
170
- let localVarRequestOptions = {
171
- method: 'POST',
172
- qs: localVarQueryParameters,
173
- headers: localVarHeaderParams,
174
- uri: localVarPath,
175
- useQuerystring: this._useQuerystring,
176
- json: true,
177
- body: models_1.ObjectSerializer.serialize(raidListRequestV2, "RaidListRequestV2")
178
- };
179
- let authenticationPromise = Promise.resolve();
180
- if (this.authentications.bearerAuth.accessToken) {
181
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
182
- }
183
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
184
- let interceptorPromise = authenticationPromise;
185
- for (const interceptor of this.interceptors) {
186
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
187
- }
188
- return interceptorPromise.then(() => {
189
- if (Object.keys(localVarFormParams).length) {
190
- if (localVarUseFormData) {
191
- localVarRequestOptions.formData = localVarFormParams;
192
- }
193
- else {
194
- localVarRequestOptions.form = localVarFormParams;
195
- }
196
- }
197
- return new Promise((resolve, reject) => {
198
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
199
- if (error) {
200
- reject(error);
201
- }
202
- else {
203
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
204
- body = models_1.ObjectSerializer.deserialize(body, "Array<RaidListItemV3>");
205
- resolve({ response: response, body: body });
206
- }
207
- else {
208
- reject(new apis_1.HttpError(response, body, response.statusCode));
209
- }
210
- }
211
- });
212
- });
213
- });
214
- }
215
- /**
216
- *
217
- * @summary mint a raido-metadata-schema-v1 raid
218
- * @param mintRaidoSchemaV1Request
219
- */
220
- async mintRaidoSchemaV1(mintRaidoSchemaV1Request, options = { headers: {} }) {
221
- const localVarPath = this.basePath + '/v2/experimental/mint-raido-schema/v1';
222
- let localVarQueryParameters = {};
223
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
224
- const produces = ['application/json'];
225
- // give precedence to 'application/json'
226
- if (produces.indexOf('application/json') >= 0) {
227
- localVarHeaderParams.Accept = 'application/json';
228
- }
229
- else {
230
- localVarHeaderParams.Accept = produces.join(',');
231
- }
232
- let localVarFormParams = {};
233
- // verify required parameter 'mintRaidoSchemaV1Request' is not null or undefined
234
- if (mintRaidoSchemaV1Request === null || mintRaidoSchemaV1Request === undefined) {
235
- throw new Error('Required parameter mintRaidoSchemaV1Request was null or undefined when calling mintRaidoSchemaV1.');
236
- }
237
- Object.assign(localVarHeaderParams, options.headers);
238
- let localVarUseFormData = false;
239
- let localVarRequestOptions = {
240
- method: 'POST',
241
- qs: localVarQueryParameters,
242
- headers: localVarHeaderParams,
243
- uri: localVarPath,
244
- useQuerystring: this._useQuerystring,
245
- json: true,
246
- body: models_1.ObjectSerializer.serialize(mintRaidoSchemaV1Request, "MintRaidoSchemaV1Request")
247
- };
248
- let authenticationPromise = Promise.resolve();
249
- if (this.authentications.bearerAuth.accessToken) {
250
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
251
- }
252
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
253
- let interceptorPromise = authenticationPromise;
254
- for (const interceptor of this.interceptors) {
255
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
256
- }
257
- return interceptorPromise.then(() => {
258
- if (Object.keys(localVarFormParams).length) {
259
- if (localVarUseFormData) {
260
- localVarRequestOptions.formData = localVarFormParams;
261
- }
262
- else {
263
- localVarRequestOptions.form = localVarFormParams;
264
- }
265
- }
266
- return new Promise((resolve, reject) => {
267
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
268
- if (error) {
269
- reject(error);
270
- }
271
- else {
272
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
273
- body = models_1.ObjectSerializer.deserialize(body, "MintResponse");
274
- resolve({ response: response, body: body });
275
- }
276
- else {
277
- reject(new apis_1.HttpError(response, body, response.statusCode));
278
- }
279
- }
280
- });
281
- });
282
- });
283
- }
284
- /**
285
- *
286
- * @summary read a raid, caller must be authorized
287
- * @param readRaidV2Request
288
- */
289
- async readRaidV2(readRaidV2Request, options = { headers: {} }) {
290
- const localVarPath = this.basePath + '/v2/experimental/read-raid/v2';
291
- let localVarQueryParameters = {};
292
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
293
- const produces = ['application/json'];
294
- // give precedence to 'application/json'
295
- if (produces.indexOf('application/json') >= 0) {
296
- localVarHeaderParams.Accept = 'application/json';
297
- }
298
- else {
299
- localVarHeaderParams.Accept = produces.join(',');
300
- }
301
- let localVarFormParams = {};
302
- // verify required parameter 'readRaidV2Request' is not null or undefined
303
- if (readRaidV2Request === null || readRaidV2Request === undefined) {
304
- throw new Error('Required parameter readRaidV2Request was null or undefined when calling readRaidV2.');
305
- }
306
- Object.assign(localVarHeaderParams, options.headers);
307
- let localVarUseFormData = false;
308
- let localVarRequestOptions = {
309
- method: 'POST',
310
- qs: localVarQueryParameters,
311
- headers: localVarHeaderParams,
312
- uri: localVarPath,
313
- useQuerystring: this._useQuerystring,
314
- json: true,
315
- body: models_1.ObjectSerializer.serialize(readRaidV2Request, "ReadRaidV2Request")
316
- };
317
- let authenticationPromise = Promise.resolve();
318
- if (this.authentications.bearerAuth.accessToken) {
319
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
320
- }
321
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
322
- let interceptorPromise = authenticationPromise;
323
- for (const interceptor of this.interceptors) {
324
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
325
- }
326
- return interceptorPromise.then(() => {
327
- if (Object.keys(localVarFormParams).length) {
328
- if (localVarUseFormData) {
329
- localVarRequestOptions.formData = localVarFormParams;
330
- }
331
- else {
332
- localVarRequestOptions.form = localVarFormParams;
333
- }
334
- }
335
- return new Promise((resolve, reject) => {
336
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
337
- if (error) {
338
- reject(error);
339
- }
340
- else {
341
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
342
- body = models_1.ObjectSerializer.deserialize(body, "ReadRaidResponseV2");
343
- resolve({ response: response, body: body });
344
- }
345
- else {
346
- reject(new apis_1.HttpError(response, body, response.statusCode));
347
- }
348
- }
349
- });
350
- });
351
- });
352
- }
353
- /**
354
- *
355
- * @summary update a raido-metadata-schema-v1 raid
356
- * @param updateRaidoSchemaV1Request
357
- */
358
- async updateRaidoSchemaV1(updateRaidoSchemaV1Request, options = { headers: {} }) {
359
- const localVarPath = this.basePath + '/v2/experimental/update-raido-schema/v1';
360
- let localVarQueryParameters = {};
361
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
362
- const produces = ['application/json'];
363
- // give precedence to 'application/json'
364
- if (produces.indexOf('application/json') >= 0) {
365
- localVarHeaderParams.Accept = 'application/json';
366
- }
367
- else {
368
- localVarHeaderParams.Accept = produces.join(',');
369
- }
370
- let localVarFormParams = {};
371
- // verify required parameter 'updateRaidoSchemaV1Request' is not null or undefined
372
- if (updateRaidoSchemaV1Request === null || updateRaidoSchemaV1Request === undefined) {
373
- throw new Error('Required parameter updateRaidoSchemaV1Request was null or undefined when calling updateRaidoSchemaV1.');
374
- }
375
- Object.assign(localVarHeaderParams, options.headers);
376
- let localVarUseFormData = false;
377
- let localVarRequestOptions = {
378
- method: 'POST',
379
- qs: localVarQueryParameters,
380
- headers: localVarHeaderParams,
381
- uri: localVarPath,
382
- useQuerystring: this._useQuerystring,
383
- json: true,
384
- body: models_1.ObjectSerializer.serialize(updateRaidoSchemaV1Request, "UpdateRaidoSchemaV1Request")
385
- };
386
- let authenticationPromise = Promise.resolve();
387
- if (this.authentications.bearerAuth.accessToken) {
388
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
389
- }
390
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
391
- let interceptorPromise = authenticationPromise;
392
- for (const interceptor of this.interceptors) {
393
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
394
- }
395
- return interceptorPromise.then(() => {
396
- if (Object.keys(localVarFormParams).length) {
397
- if (localVarUseFormData) {
398
- localVarRequestOptions.formData = localVarFormParams;
399
- }
400
- else {
401
- localVarRequestOptions.form = localVarFormParams;
402
- }
403
- }
404
- return new Promise((resolve, reject) => {
405
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
406
- if (error) {
407
- reject(error);
408
- }
409
- else {
410
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
411
- body = models_1.ObjectSerializer.deserialize(body, "MintResponse");
412
- resolve({ response: response, body: body });
413
- }
414
- else {
415
- reject(new apis_1.HttpError(response, body, response.statusCode));
416
- }
417
- }
418
- });
419
- });
420
- });
421
- }
422
- /**
423
- *
424
- * @summary update a raido-metadata-schema-v2 raid
425
- * @param updateRaidoSchemaV2Request
426
- */
427
- async updateRaidoSchemaV2(updateRaidoSchemaV2Request, options = { headers: {} }) {
428
- const localVarPath = this.basePath + '/v2/experimental/update-raido-schema/v2';
429
- let localVarQueryParameters = {};
430
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
431
- const produces = ['application/json'];
432
- // give precedence to 'application/json'
433
- if (produces.indexOf('application/json') >= 0) {
434
- localVarHeaderParams.Accept = 'application/json';
435
- }
436
- else {
437
- localVarHeaderParams.Accept = produces.join(',');
438
- }
439
- let localVarFormParams = {};
440
- // verify required parameter 'updateRaidoSchemaV2Request' is not null or undefined
441
- if (updateRaidoSchemaV2Request === null || updateRaidoSchemaV2Request === undefined) {
442
- throw new Error('Required parameter updateRaidoSchemaV2Request was null or undefined when calling updateRaidoSchemaV2.');
443
- }
444
- Object.assign(localVarHeaderParams, options.headers);
445
- let localVarUseFormData = false;
446
- let localVarRequestOptions = {
447
- method: 'POST',
448
- qs: localVarQueryParameters,
449
- headers: localVarHeaderParams,
450
- uri: localVarPath,
451
- useQuerystring: this._useQuerystring,
452
- json: true,
453
- body: models_1.ObjectSerializer.serialize(updateRaidoSchemaV2Request, "UpdateRaidoSchemaV2Request")
454
- };
455
- let authenticationPromise = Promise.resolve();
456
- if (this.authentications.bearerAuth.accessToken) {
457
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
458
- }
459
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
460
- let interceptorPromise = authenticationPromise;
461
- for (const interceptor of this.interceptors) {
462
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
463
- }
464
- return interceptorPromise.then(() => {
465
- if (Object.keys(localVarFormParams).length) {
466
- if (localVarUseFormData) {
467
- localVarRequestOptions.formData = localVarFormParams;
468
- }
469
- else {
470
- localVarRequestOptions.form = localVarFormParams;
471
- }
472
- }
473
- return new Promise((resolve, reject) => {
474
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
475
- if (error) {
476
- reject(error);
477
- }
478
- else {
479
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
480
- body = models_1.ObjectSerializer.deserialize(body, "MintResponse");
481
- resolve({ response: response, body: body });
482
- }
483
- else {
484
- reject(new apis_1.HttpError(response, body, response.statusCode));
485
- }
486
- }
487
- });
488
- });
489
- });
490
- }
491
- /**
492
- *
493
- * @summary upgrade (i.e. change the schema) of a legacy raid to be a raido-metadata-schema-v1 raid, but supplying the missing data
494
- * @param updateRaidoSchemaV1Request
495
- */
496
- async upgradeLegacyToRaidoSchema(updateRaidoSchemaV1Request, options = { headers: {} }) {
497
- const localVarPath = this.basePath + '/v2/experimental/upgrade-legacy-to-raido-schema/v1';
498
- let localVarQueryParameters = {};
499
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
500
- const produces = ['application/json'];
501
- // give precedence to 'application/json'
502
- if (produces.indexOf('application/json') >= 0) {
503
- localVarHeaderParams.Accept = 'application/json';
504
- }
505
- else {
506
- localVarHeaderParams.Accept = produces.join(',');
507
- }
508
- let localVarFormParams = {};
509
- // verify required parameter 'updateRaidoSchemaV1Request' is not null or undefined
510
- if (updateRaidoSchemaV1Request === null || updateRaidoSchemaV1Request === undefined) {
511
- throw new Error('Required parameter updateRaidoSchemaV1Request was null or undefined when calling upgradeLegacyToRaidoSchema.');
512
- }
513
- Object.assign(localVarHeaderParams, options.headers);
514
- let localVarUseFormData = false;
515
- let localVarRequestOptions = {
516
- method: 'POST',
517
- qs: localVarQueryParameters,
518
- headers: localVarHeaderParams,
519
- uri: localVarPath,
520
- useQuerystring: this._useQuerystring,
521
- json: true,
522
- body: models_1.ObjectSerializer.serialize(updateRaidoSchemaV1Request, "UpdateRaidoSchemaV1Request")
523
- };
524
- let authenticationPromise = Promise.resolve();
525
- if (this.authentications.bearerAuth.accessToken) {
526
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
527
- }
528
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
529
- let interceptorPromise = authenticationPromise;
530
- for (const interceptor of this.interceptors) {
531
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
532
- }
533
- return interceptorPromise.then(() => {
534
- if (Object.keys(localVarFormParams).length) {
535
- if (localVarUseFormData) {
536
- localVarRequestOptions.formData = localVarFormParams;
537
- }
538
- else {
539
- localVarRequestOptions.form = localVarFormParams;
540
- }
541
- }
542
- return new Promise((resolve, reject) => {
543
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
544
- if (error) {
545
- reject(error);
546
- }
547
- else {
548
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
549
- body = models_1.ObjectSerializer.deserialize(body, "MintResponse");
550
- resolve({ response: response, body: body });
551
- }
552
- else {
553
- reject(new apis_1.HttpError(response, body, response.statusCode));
554
- }
555
- }
556
- });
557
- });
558
- });
559
- }
560
- }
561
- exports.BasicRaidExperimentalApi = BasicRaidExperimentalApi;