@researchdatabox/raido-openapi-generated-node 0.0.3 → 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 (54) 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/alternateUrl.js → index.d.ts} +2 -18
  10. package/dist/index.js +32 -0
  11. package/package.json +11 -6
  12. package/dist/api/apis.js +0 -35
  13. package/dist/api/raidApi.js +0 -452
  14. package/dist/api/servicePointApi.js +0 -350
  15. package/dist/model/access.js +0 -44
  16. package/dist/model/accessStatement.js +0 -35
  17. package/dist/model/accessType.js +0 -35
  18. package/dist/model/alternateIdentifier.js +0 -35
  19. package/dist/model/closedRaid.js +0 -35
  20. package/dist/model/contributor.js +0 -59
  21. package/dist/model/contributorPosition.js +0 -47
  22. package/dist/model/contributorRole.js +0 -35
  23. package/dist/model/description.js +0 -41
  24. package/dist/model/descriptionType.js +0 -35
  25. package/dist/model/failureResponse.js +0 -53
  26. package/dist/model/id.js +0 -80
  27. package/dist/model/language.js +0 -35
  28. package/dist/model/modelDate.js +0 -38
  29. package/dist/model/models.js +0 -334
  30. package/dist/model/organisation.js +0 -41
  31. package/dist/model/organisationRole.js +0 -47
  32. package/dist/model/owner.js +0 -47
  33. package/dist/model/raidChange.js +0 -53
  34. package/dist/model/raidCreateRequest.js +0 -107
  35. package/dist/model/raidDto.js +0 -107
  36. package/dist/model/raidUpdateRequest.js +0 -107
  37. package/dist/model/registrationAgency.js +0 -38
  38. package/dist/model/relatedObject.js +0 -47
  39. package/dist/model/relatedObjectCategory.js +0 -35
  40. package/dist/model/relatedObjectType.js +0 -35
  41. package/dist/model/relatedRaid.js +0 -35
  42. package/dist/model/relatedRaidType.js +0 -35
  43. package/dist/model/servicePoint.js +0 -92
  44. package/dist/model/servicePointCreateRequest.js +0 -104
  45. package/dist/model/servicePointUpdateRequest.js +0 -113
  46. package/dist/model/spatialCoverage.js +0 -41
  47. package/dist/model/spatialCoveragePlace.js +0 -35
  48. package/dist/model/subject.js +0 -41
  49. package/dist/model/subjectKeyword.js +0 -35
  50. package/dist/model/title.js +0 -53
  51. package/dist/model/titleType.js +0 -35
  52. package/dist/model/traditionalKnowledgeLabel.js +0 -35
  53. package/dist/model/validationFailure.js +0 -41
  54. package/dist/model/validationFailureResponse.js +0 -59
@@ -1,452 +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. 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.RaidApi = exports.RaidApiApiKeys = 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 RaidApiApiKeys;
27
- (function (RaidApiApiKeys) {
28
- })(RaidApiApiKeys = exports.RaidApiApiKeys || (exports.RaidApiApiKeys = {}));
29
- class RaidApi {
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[RaidApiApiKeys[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 servicePointId
81
- * @param includeFields The top level fields to include in each RAiD in the response body. Excludes all other fields.
82
- */
83
- async findAllRaids(servicePointId, includeFields, options = { headers: {} }) {
84
- const localVarPath = this.basePath + '/raid/';
85
- let localVarQueryParameters = {};
86
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
87
- const produces = ['application/json'];
88
- // give precedence to 'application/json'
89
- if (produces.indexOf('application/json') >= 0) {
90
- localVarHeaderParams.Accept = 'application/json';
91
- }
92
- else {
93
- localVarHeaderParams.Accept = produces.join(',');
94
- }
95
- let localVarFormParams = {};
96
- if (servicePointId !== undefined) {
97
- localVarQueryParameters['servicePointId'] = models_1.ObjectSerializer.serialize(servicePointId, "number");
98
- }
99
- if (includeFields !== undefined) {
100
- localVarQueryParameters['includeFields'] = models_1.ObjectSerializer.serialize(includeFields, "Array<string>");
101
- }
102
- Object.assign(localVarHeaderParams, options.headers);
103
- let localVarUseFormData = false;
104
- let localVarRequestOptions = {
105
- method: 'GET',
106
- qs: localVarQueryParameters,
107
- headers: localVarHeaderParams,
108
- uri: localVarPath,
109
- useQuerystring: this._useQuerystring,
110
- json: true,
111
- };
112
- let authenticationPromise = Promise.resolve();
113
- if (this.authentications.bearerAuth.accessToken) {
114
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
115
- }
116
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
117
- let interceptorPromise = authenticationPromise;
118
- for (const interceptor of this.interceptors) {
119
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
120
- }
121
- return interceptorPromise.then(() => {
122
- if (Object.keys(localVarFormParams).length) {
123
- if (localVarUseFormData) {
124
- localVarRequestOptions.formData = localVarFormParams;
125
- }
126
- else {
127
- localVarRequestOptions.form = localVarFormParams;
128
- }
129
- }
130
- return new Promise((resolve, reject) => {
131
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
132
- if (error) {
133
- reject(error);
134
- }
135
- else {
136
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
137
- body = models_1.ObjectSerializer.deserialize(body, "Array<RaidDto>");
138
- resolve({ response: response, body: body });
139
- }
140
- else {
141
- reject(new apis_1.HttpError(response, body, response.statusCode));
142
- }
143
- }
144
- });
145
- });
146
- });
147
- }
148
- /**
149
- *
150
- * @summary read a raid, caller must be authorized
151
- * @param prefix Prefix of the raid handle
152
- * @param suffix Suffix of the raid handle
153
- * @param version The version of the raid
154
- */
155
- async findRaidByName(prefix, suffix, version, options = { headers: {} }) {
156
- const localVarPath = this.basePath + '/raid/{prefix}/{suffix}'
157
- .replace('{' + 'prefix' + '}', encodeURIComponent(String(prefix)))
158
- .replace('{' + 'suffix' + '}', encodeURIComponent(String(suffix)));
159
- let localVarQueryParameters = {};
160
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
161
- const produces = ['application/json'];
162
- // give precedence to 'application/json'
163
- if (produces.indexOf('application/json') >= 0) {
164
- localVarHeaderParams.Accept = 'application/json';
165
- }
166
- else {
167
- localVarHeaderParams.Accept = produces.join(',');
168
- }
169
- let localVarFormParams = {};
170
- // verify required parameter 'prefix' is not null or undefined
171
- if (prefix === null || prefix === undefined) {
172
- throw new Error('Required parameter prefix was null or undefined when calling findRaidByName.');
173
- }
174
- // verify required parameter 'suffix' is not null or undefined
175
- if (suffix === null || suffix === undefined) {
176
- throw new Error('Required parameter suffix was null or undefined when calling findRaidByName.');
177
- }
178
- if (version !== undefined) {
179
- localVarQueryParameters['version'] = models_1.ObjectSerializer.serialize(version, "number");
180
- }
181
- Object.assign(localVarHeaderParams, options.headers);
182
- let localVarUseFormData = false;
183
- let localVarRequestOptions = {
184
- method: 'GET',
185
- qs: localVarQueryParameters,
186
- headers: localVarHeaderParams,
187
- uri: localVarPath,
188
- useQuerystring: this._useQuerystring,
189
- json: true,
190
- };
191
- let authenticationPromise = Promise.resolve();
192
- if (this.authentications.bearerAuth.accessToken) {
193
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
194
- }
195
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
196
- let interceptorPromise = authenticationPromise;
197
- for (const interceptor of this.interceptors) {
198
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
199
- }
200
- return interceptorPromise.then(() => {
201
- if (Object.keys(localVarFormParams).length) {
202
- if (localVarUseFormData) {
203
- localVarRequestOptions.formData = localVarFormParams;
204
- }
205
- else {
206
- localVarRequestOptions.form = localVarFormParams;
207
- }
208
- }
209
- return new Promise((resolve, reject) => {
210
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
211
- if (error) {
212
- reject(error);
213
- }
214
- else {
215
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
216
- body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
217
- resolve({ response: response, body: body });
218
- }
219
- else {
220
- reject(new apis_1.HttpError(response, body, response.statusCode));
221
- }
222
- }
223
- });
224
- });
225
- });
226
- }
227
- /**
228
- *
229
- * @summary mint a raid
230
- * @param raidCreateRequest
231
- */
232
- async mintRaid(raidCreateRequest, options = { headers: {} }) {
233
- const localVarPath = this.basePath + '/raid/';
234
- let localVarQueryParameters = {};
235
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
236
- const produces = ['application/json'];
237
- // give precedence to 'application/json'
238
- if (produces.indexOf('application/json') >= 0) {
239
- localVarHeaderParams.Accept = 'application/json';
240
- }
241
- else {
242
- localVarHeaderParams.Accept = produces.join(',');
243
- }
244
- let localVarFormParams = {};
245
- // verify required parameter 'raidCreateRequest' is not null or undefined
246
- if (raidCreateRequest === null || raidCreateRequest === undefined) {
247
- throw new Error('Required parameter raidCreateRequest was null or undefined when calling mintRaid.');
248
- }
249
- Object.assign(localVarHeaderParams, options.headers);
250
- let localVarUseFormData = false;
251
- let localVarRequestOptions = {
252
- method: 'POST',
253
- qs: localVarQueryParameters,
254
- headers: localVarHeaderParams,
255
- uri: localVarPath,
256
- useQuerystring: this._useQuerystring,
257
- json: true,
258
- body: models_1.ObjectSerializer.serialize(raidCreateRequest, "RaidCreateRequest")
259
- };
260
- let authenticationPromise = Promise.resolve();
261
- if (this.authentications.bearerAuth.accessToken) {
262
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
263
- }
264
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
265
- let interceptorPromise = authenticationPromise;
266
- for (const interceptor of this.interceptors) {
267
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
268
- }
269
- return interceptorPromise.then(() => {
270
- if (Object.keys(localVarFormParams).length) {
271
- if (localVarUseFormData) {
272
- localVarRequestOptions.formData = localVarFormParams;
273
- }
274
- else {
275
- localVarRequestOptions.form = localVarFormParams;
276
- }
277
- }
278
- return new Promise((resolve, reject) => {
279
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
280
- if (error) {
281
- reject(error);
282
- }
283
- else {
284
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
285
- body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
286
- resolve({ response: response, body: body });
287
- }
288
- else {
289
- reject(new apis_1.HttpError(response, body, response.statusCode));
290
- }
291
- }
292
- });
293
- });
294
- });
295
- }
296
- /**
297
- *
298
- * @summary A list of the changes to the raid
299
- * @param prefix Prefix of the raid handle
300
- * @param suffix Suffix of the raid handle
301
- */
302
- async raidHistory(prefix, suffix, options = { headers: {} }) {
303
- const localVarPath = this.basePath + '/raid/{prefix}/{suffix}/history'
304
- .replace('{' + 'prefix' + '}', encodeURIComponent(String(prefix)))
305
- .replace('{' + 'suffix' + '}', encodeURIComponent(String(suffix)));
306
- let localVarQueryParameters = {};
307
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
308
- const produces = ['application/json'];
309
- // give precedence to 'application/json'
310
- if (produces.indexOf('application/json') >= 0) {
311
- localVarHeaderParams.Accept = 'application/json';
312
- }
313
- else {
314
- localVarHeaderParams.Accept = produces.join(',');
315
- }
316
- let localVarFormParams = {};
317
- // verify required parameter 'prefix' is not null or undefined
318
- if (prefix === null || prefix === undefined) {
319
- throw new Error('Required parameter prefix was null or undefined when calling raidHistory.');
320
- }
321
- // verify required parameter 'suffix' is not null or undefined
322
- if (suffix === null || suffix === undefined) {
323
- throw new Error('Required parameter suffix was null or undefined when calling raidHistory.');
324
- }
325
- Object.assign(localVarHeaderParams, options.headers);
326
- let localVarUseFormData = false;
327
- let localVarRequestOptions = {
328
- method: 'GET',
329
- qs: localVarQueryParameters,
330
- headers: localVarHeaderParams,
331
- uri: localVarPath,
332
- useQuerystring: this._useQuerystring,
333
- json: true,
334
- };
335
- let authenticationPromise = Promise.resolve();
336
- if (this.authentications.bearerAuth.accessToken) {
337
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
338
- }
339
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
340
- let interceptorPromise = authenticationPromise;
341
- for (const interceptor of this.interceptors) {
342
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
343
- }
344
- return interceptorPromise.then(() => {
345
- if (Object.keys(localVarFormParams).length) {
346
- if (localVarUseFormData) {
347
- localVarRequestOptions.formData = localVarFormParams;
348
- }
349
- else {
350
- localVarRequestOptions.form = localVarFormParams;
351
- }
352
- }
353
- return new Promise((resolve, reject) => {
354
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
355
- if (error) {
356
- reject(error);
357
- }
358
- else {
359
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
360
- body = models_1.ObjectSerializer.deserialize(body, "Array<RaidChange>");
361
- resolve({ response: response, body: body });
362
- }
363
- else {
364
- reject(new apis_1.HttpError(response, body, response.statusCode));
365
- }
366
- }
367
- });
368
- });
369
- });
370
- }
371
- /**
372
- *
373
- * @param prefix Prefix of the raid handle
374
- * @param suffix Suffix of the raid handle
375
- * @param raidUpdateRequest
376
- */
377
- async updateRaid(prefix, suffix, raidUpdateRequest, options = { headers: {} }) {
378
- const localVarPath = this.basePath + '/raid/{prefix}/{suffix}'
379
- .replace('{' + 'prefix' + '}', encodeURIComponent(String(prefix)))
380
- .replace('{' + 'suffix' + '}', encodeURIComponent(String(suffix)));
381
- let localVarQueryParameters = {};
382
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
383
- const produces = ['application/json'];
384
- // give precedence to 'application/json'
385
- if (produces.indexOf('application/json') >= 0) {
386
- localVarHeaderParams.Accept = 'application/json';
387
- }
388
- else {
389
- localVarHeaderParams.Accept = produces.join(',');
390
- }
391
- let localVarFormParams = {};
392
- // verify required parameter 'prefix' is not null or undefined
393
- if (prefix === null || prefix === undefined) {
394
- throw new Error('Required parameter prefix was null or undefined when calling updateRaid.');
395
- }
396
- // verify required parameter 'suffix' is not null or undefined
397
- if (suffix === null || suffix === undefined) {
398
- throw new Error('Required parameter suffix was null or undefined when calling updateRaid.');
399
- }
400
- // verify required parameter 'raidUpdateRequest' is not null or undefined
401
- if (raidUpdateRequest === null || raidUpdateRequest === undefined) {
402
- throw new Error('Required parameter raidUpdateRequest was null or undefined when calling updateRaid.');
403
- }
404
- Object.assign(localVarHeaderParams, options.headers);
405
- let localVarUseFormData = false;
406
- let localVarRequestOptions = {
407
- method: 'PUT',
408
- qs: localVarQueryParameters,
409
- headers: localVarHeaderParams,
410
- uri: localVarPath,
411
- useQuerystring: this._useQuerystring,
412
- json: true,
413
- body: models_1.ObjectSerializer.serialize(raidUpdateRequest, "RaidUpdateRequest")
414
- };
415
- let authenticationPromise = Promise.resolve();
416
- if (this.authentications.bearerAuth.accessToken) {
417
- authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
418
- }
419
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
420
- let interceptorPromise = authenticationPromise;
421
- for (const interceptor of this.interceptors) {
422
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
423
- }
424
- return interceptorPromise.then(() => {
425
- if (Object.keys(localVarFormParams).length) {
426
- if (localVarUseFormData) {
427
- localVarRequestOptions.formData = localVarFormParams;
428
- }
429
- else {
430
- localVarRequestOptions.form = localVarFormParams;
431
- }
432
- }
433
- return new Promise((resolve, reject) => {
434
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
435
- if (error) {
436
- reject(error);
437
- }
438
- else {
439
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
440
- body = models_1.ObjectSerializer.deserialize(body, "RaidDto");
441
- resolve({ response: response, body: body });
442
- }
443
- else {
444
- reject(new apis_1.HttpError(response, body, response.statusCode));
445
- }
446
- }
447
- });
448
- });
449
- });
450
- }
451
- }
452
- exports.RaidApi = RaidApi;