@researchdatabox/raido-openapi-generated-node 0.0.1

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 (62) hide show
  1. package/README.md +3 -0
  2. package/dist/api/adminExperimentalApi.js +1092 -0
  3. package/dist/api/apis.js +39 -0
  4. package/dist/api/basicRaidExperimentalApi.js +423 -0
  5. package/dist/api/publicExperimentalApi.js +264 -0
  6. package/dist/api/unauthzExperimentalApi.js +147 -0
  7. package/dist/api.js +19 -0
  8. package/dist/model/accessBlock.js +35 -0
  9. package/dist/model/accessType.js +19 -0
  10. package/dist/model/alternateUrlBlock.js +29 -0
  11. package/dist/model/apiKey.js +74 -0
  12. package/dist/model/appUser.js +83 -0
  13. package/dist/model/appUserExtraV1.js +44 -0
  14. package/dist/model/authzRequestExtraV1.js +104 -0
  15. package/dist/model/authzRequestStatus.js +20 -0
  16. package/dist/model/contributorBlock.js +47 -0
  17. package/dist/model/contributorIdentifierSchemeType.js +18 -0
  18. package/dist/model/contributorPosition.js +47 -0
  19. package/dist/model/contributorPositionRaidMetadataSchemaType.js +22 -0
  20. package/dist/model/contributorPositionSchemeType.js +18 -0
  21. package/dist/model/contributorRole.js +35 -0
  22. package/dist/model/contributorRoleCreditNisoOrgType.js +31 -0
  23. package/dist/model/contributorRoleSchemeType.js +18 -0
  24. package/dist/model/datesBlock.js +35 -0
  25. package/dist/model/descriptionBlock.js +35 -0
  26. package/dist/model/descriptionType.js +19 -0
  27. package/dist/model/generateApiTokenRequest.js +29 -0
  28. package/dist/model/generateApiTokenResponse.js +35 -0
  29. package/dist/model/idBlock.js +65 -0
  30. package/dist/model/legacyMetadataSchemaV1.js +68 -0
  31. package/dist/model/migrateLegacyRaidRequest.js +35 -0
  32. package/dist/model/migrateLegacyRaidRequestMintRequest.js +41 -0
  33. package/dist/model/mintRaidoSchemaV1Request.js +38 -0
  34. package/dist/model/mintRaidoSchemaV1RequestMintRequest.js +32 -0
  35. package/dist/model/mintResponse.js +41 -0
  36. package/dist/model/models.js +374 -0
  37. package/dist/model/organisationBlock.js +41 -0
  38. package/dist/model/organisationIdentifierSchemeType.js +18 -0
  39. package/dist/model/organisationRole.js +47 -0
  40. package/dist/model/organisationRoleSchemeType.js +18 -0
  41. package/dist/model/organisationRoleType.js +22 -0
  42. package/dist/model/publicClosedMetadataSchemaV1.js +41 -0
  43. package/dist/model/publicRaidMetadataSchemaV1.js +80 -0
  44. package/dist/model/publicReadRaidMetadataResponseV1.js +80 -0
  45. package/dist/model/publicReadRaidResponseV3.js +56 -0
  46. package/dist/model/publicServicePoint.js +38 -0
  47. package/dist/model/raidListItemV2.js +53 -0
  48. package/dist/model/raidListRequestV2.js +35 -0
  49. package/dist/model/raidoMetadataSchemaV1.js +80 -0
  50. package/dist/model/raidoMetaschema.js +22 -0
  51. package/dist/model/readRaidResponseV2.js +71 -0
  52. package/dist/model/readRaidV2Request.js +29 -0
  53. package/dist/model/servicePoint.js +62 -0
  54. package/dist/model/titleBlock.js +47 -0
  55. package/dist/model/titleType.js +19 -0
  56. package/dist/model/updateAuthzRequest.js +38 -0
  57. package/dist/model/updateAuthzRequestStatus.js +44 -0
  58. package/dist/model/updateAuthzResponse.js +29 -0
  59. package/dist/model/updateRaidoSchemaV1Request.js +29 -0
  60. package/dist/model/validationFailure.js +41 -0
  61. package/dist/model/versionResult.js +47 -0
  62. package/package.json +24 -0
@@ -0,0 +1,68 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.LegacyMetadataSchemaV1 = void 0;
15
+ /**
16
+ * This type is used for raid data imported from the legacy raid system (pre-raido) and for raid data still being minted via the (deprecated) V1 API. Started as a copy paste from RaidoMetadataSchemaV1; the structure could be simplified greatly, but then we\'d just have to have special logic for it, keeping it like this (especially, sharing the block types) makes it mostly structurally compatible with the original. See how it goes, if the structural similarity doesn\'t end up saving implementation effort, then it would make sense to simplify this.
17
+ */
18
+ class LegacyMetadataSchemaV1 {
19
+ 'metadataSchema';
20
+ 'id';
21
+ 'titles';
22
+ 'dates';
23
+ 'descriptions';
24
+ 'access';
25
+ 'alternateUrls';
26
+ static discriminator = undefined;
27
+ static attributeTypeMap = [
28
+ {
29
+ "name": "metadataSchema",
30
+ "baseName": "metadataSchema",
31
+ "type": "RaidoMetaschema"
32
+ },
33
+ {
34
+ "name": "id",
35
+ "baseName": "id",
36
+ "type": "IdBlock"
37
+ },
38
+ {
39
+ "name": "titles",
40
+ "baseName": "titles",
41
+ "type": "Array<TitleBlock>"
42
+ },
43
+ {
44
+ "name": "dates",
45
+ "baseName": "dates",
46
+ "type": "DatesBlock"
47
+ },
48
+ {
49
+ "name": "descriptions",
50
+ "baseName": "descriptions",
51
+ "type": "Array<DescriptionBlock>"
52
+ },
53
+ {
54
+ "name": "access",
55
+ "baseName": "access",
56
+ "type": "AccessBlock"
57
+ },
58
+ {
59
+ "name": "alternateUrls",
60
+ "baseName": "alternateUrls",
61
+ "type": "Array<AlternateUrlBlock>"
62
+ }
63
+ ];
64
+ static getAttributeTypeMap() {
65
+ return LegacyMetadataSchemaV1.attributeTypeMap;
66
+ }
67
+ }
68
+ exports.LegacyMetadataSchemaV1 = LegacyMetadataSchemaV1;
@@ -0,0 +1,35 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MigrateLegacyRaidRequest = void 0;
15
+ class MigrateLegacyRaidRequest {
16
+ 'mintRequest';
17
+ 'metadata';
18
+ static discriminator = undefined;
19
+ static attributeTypeMap = [
20
+ {
21
+ "name": "mintRequest",
22
+ "baseName": "mintRequest",
23
+ "type": "MigrateLegacyRaidRequestMintRequest"
24
+ },
25
+ {
26
+ "name": "metadata",
27
+ "baseName": "metadata",
28
+ "type": "LegacyMetadataSchemaV1"
29
+ }
30
+ ];
31
+ static getAttributeTypeMap() {
32
+ return MigrateLegacyRaidRequest.attributeTypeMap;
33
+ }
34
+ }
35
+ exports.MigrateLegacyRaidRequest = MigrateLegacyRaidRequest;
@@ -0,0 +1,41 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MigrateLegacyRaidRequestMintRequest = void 0;
15
+ class MigrateLegacyRaidRequestMintRequest {
16
+ 'servicePointId';
17
+ 'contentIndex';
18
+ 'createDate';
19
+ static discriminator = undefined;
20
+ static attributeTypeMap = [
21
+ {
22
+ "name": "servicePointId",
23
+ "baseName": "servicePointId",
24
+ "type": "number"
25
+ },
26
+ {
27
+ "name": "contentIndex",
28
+ "baseName": "contentIndex",
29
+ "type": "number"
30
+ },
31
+ {
32
+ "name": "createDate",
33
+ "baseName": "createDate",
34
+ "type": "Date"
35
+ }
36
+ ];
37
+ static getAttributeTypeMap() {
38
+ return MigrateLegacyRaidRequestMintRequest.attributeTypeMap;
39
+ }
40
+ }
41
+ exports.MigrateLegacyRaidRequestMintRequest = MigrateLegacyRaidRequestMintRequest;
@@ -0,0 +1,38 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MintRaidoSchemaV1Request = void 0;
15
+ /**
16
+ * `id` block is not required for minting and is ignored if set.
17
+ */
18
+ class MintRaidoSchemaV1Request {
19
+ 'mintRequest';
20
+ 'metadata';
21
+ static discriminator = undefined;
22
+ static attributeTypeMap = [
23
+ {
24
+ "name": "mintRequest",
25
+ "baseName": "mintRequest",
26
+ "type": "MintRaidoSchemaV1RequestMintRequest"
27
+ },
28
+ {
29
+ "name": "metadata",
30
+ "baseName": "metadata",
31
+ "type": "RaidoMetadataSchemaV1"
32
+ }
33
+ ];
34
+ static getAttributeTypeMap() {
35
+ return MintRaidoSchemaV1Request.attributeTypeMap;
36
+ }
37
+ }
38
+ exports.MintRaidoSchemaV1Request = MintRaidoSchemaV1Request;
@@ -0,0 +1,32 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MintRaidoSchemaV1RequestMintRequest = void 0;
15
+ /**
16
+ * Raido data that doesn\'t belong on the raid metadata. ServicePoint Id means nothing in a RAID context - it\'s purely a Raido implementation detail (that may change).
17
+ */
18
+ class MintRaidoSchemaV1RequestMintRequest {
19
+ 'servicePointId';
20
+ static discriminator = undefined;
21
+ static attributeTypeMap = [
22
+ {
23
+ "name": "servicePointId",
24
+ "baseName": "servicePointId",
25
+ "type": "number"
26
+ }
27
+ ];
28
+ static getAttributeTypeMap() {
29
+ return MintRaidoSchemaV1RequestMintRequest.attributeTypeMap;
30
+ }
31
+ }
32
+ exports.MintRaidoSchemaV1RequestMintRequest = MintRaidoSchemaV1RequestMintRequest;
@@ -0,0 +1,41 @@
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 this project).
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MintResponse = void 0;
15
+ class MintResponse {
16
+ 'success';
17
+ 'raid';
18
+ 'failures';
19
+ static discriminator = undefined;
20
+ static attributeTypeMap = [
21
+ {
22
+ "name": "success",
23
+ "baseName": "success",
24
+ "type": "boolean"
25
+ },
26
+ {
27
+ "name": "raid",
28
+ "baseName": "raid",
29
+ "type": "ReadRaidResponseV2"
30
+ },
31
+ {
32
+ "name": "failures",
33
+ "baseName": "failures",
34
+ "type": "Array<ValidationFailure>"
35
+ }
36
+ ];
37
+ static getAttributeTypeMap() {
38
+ return MintResponse.attributeTypeMap;
39
+ }
40
+ }
41
+ exports.MintResponse = MintResponse;
@@ -0,0 +1,374 @@
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.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;
18
+ __exportStar(require("./accessBlock"), exports);
19
+ __exportStar(require("./accessType"), exports);
20
+ __exportStar(require("./alternateUrlBlock"), exports);
21
+ __exportStar(require("./apiKey"), exports);
22
+ __exportStar(require("./appUser"), exports);
23
+ __exportStar(require("./appUserExtraV1"), exports);
24
+ __exportStar(require("./authzRequestExtraV1"), exports);
25
+ __exportStar(require("./authzRequestStatus"), exports);
26
+ __exportStar(require("./contributorBlock"), exports);
27
+ __exportStar(require("./contributorIdentifierSchemeType"), exports);
28
+ __exportStar(require("./contributorPosition"), exports);
29
+ __exportStar(require("./contributorPositionRaidMetadataSchemaType"), exports);
30
+ __exportStar(require("./contributorPositionSchemeType"), exports);
31
+ __exportStar(require("./contributorRole"), exports);
32
+ __exportStar(require("./contributorRoleCreditNisoOrgType"), exports);
33
+ __exportStar(require("./contributorRoleSchemeType"), exports);
34
+ __exportStar(require("./datesBlock"), exports);
35
+ __exportStar(require("./descriptionBlock"), exports);
36
+ __exportStar(require("./descriptionType"), exports);
37
+ __exportStar(require("./generateApiTokenRequest"), exports);
38
+ __exportStar(require("./generateApiTokenResponse"), exports);
39
+ __exportStar(require("./idBlock"), exports);
40
+ __exportStar(require("./legacyMetadataSchemaV1"), exports);
41
+ __exportStar(require("./migrateLegacyRaidRequest"), exports);
42
+ __exportStar(require("./migrateLegacyRaidRequestMintRequest"), exports);
43
+ __exportStar(require("./mintRaidoSchemaV1Request"), exports);
44
+ __exportStar(require("./mintRaidoSchemaV1RequestMintRequest"), exports);
45
+ __exportStar(require("./mintResponse"), exports);
46
+ __exportStar(require("./organisationBlock"), exports);
47
+ __exportStar(require("./organisationIdentifierSchemeType"), exports);
48
+ __exportStar(require("./organisationRole"), exports);
49
+ __exportStar(require("./organisationRoleSchemeType"), exports);
50
+ __exportStar(require("./organisationRoleType"), exports);
51
+ __exportStar(require("./publicClosedMetadataSchemaV1"), exports);
52
+ __exportStar(require("./publicRaidMetadataSchemaV1"), exports);
53
+ __exportStar(require("./publicReadRaidMetadataResponseV1"), exports);
54
+ __exportStar(require("./publicReadRaidResponseV3"), exports);
55
+ __exportStar(require("./publicServicePoint"), exports);
56
+ __exportStar(require("./raidListItemV2"), exports);
57
+ __exportStar(require("./raidListRequestV2"), exports);
58
+ __exportStar(require("./raidoMetadataSchemaV1"), exports);
59
+ __exportStar(require("./raidoMetaschema"), exports);
60
+ __exportStar(require("./readRaidResponseV2"), exports);
61
+ __exportStar(require("./readRaidV2Request"), exports);
62
+ __exportStar(require("./servicePoint"), exports);
63
+ __exportStar(require("./titleBlock"), exports);
64
+ __exportStar(require("./titleType"), exports);
65
+ __exportStar(require("./updateAuthzRequest"), exports);
66
+ __exportStar(require("./updateAuthzRequestStatus"), exports);
67
+ __exportStar(require("./updateAuthzResponse"), exports);
68
+ __exportStar(require("./updateRaidoSchemaV1Request"), exports);
69
+ __exportStar(require("./validationFailure"), exports);
70
+ __exportStar(require("./versionResult"), exports);
71
+ const accessBlock_1 = require("./accessBlock");
72
+ const accessType_1 = require("./accessType");
73
+ const alternateUrlBlock_1 = require("./alternateUrlBlock");
74
+ const apiKey_1 = require("./apiKey");
75
+ const appUser_1 = require("./appUser");
76
+ const appUserExtraV1_1 = require("./appUserExtraV1");
77
+ const authzRequestExtraV1_1 = require("./authzRequestExtraV1");
78
+ const authzRequestStatus_1 = require("./authzRequestStatus");
79
+ const contributorBlock_1 = require("./contributorBlock");
80
+ const contributorIdentifierSchemeType_1 = require("./contributorIdentifierSchemeType");
81
+ const contributorPosition_1 = require("./contributorPosition");
82
+ const contributorPositionRaidMetadataSchemaType_1 = require("./contributorPositionRaidMetadataSchemaType");
83
+ const contributorPositionSchemeType_1 = require("./contributorPositionSchemeType");
84
+ const contributorRole_1 = require("./contributorRole");
85
+ const contributorRoleCreditNisoOrgType_1 = require("./contributorRoleCreditNisoOrgType");
86
+ const contributorRoleSchemeType_1 = require("./contributorRoleSchemeType");
87
+ const datesBlock_1 = require("./datesBlock");
88
+ const descriptionBlock_1 = require("./descriptionBlock");
89
+ const descriptionType_1 = require("./descriptionType");
90
+ const generateApiTokenRequest_1 = require("./generateApiTokenRequest");
91
+ const generateApiTokenResponse_1 = require("./generateApiTokenResponse");
92
+ const idBlock_1 = require("./idBlock");
93
+ const legacyMetadataSchemaV1_1 = require("./legacyMetadataSchemaV1");
94
+ const migrateLegacyRaidRequest_1 = require("./migrateLegacyRaidRequest");
95
+ const migrateLegacyRaidRequestMintRequest_1 = require("./migrateLegacyRaidRequestMintRequest");
96
+ const mintRaidoSchemaV1Request_1 = require("./mintRaidoSchemaV1Request");
97
+ const mintRaidoSchemaV1RequestMintRequest_1 = require("./mintRaidoSchemaV1RequestMintRequest");
98
+ const mintResponse_1 = require("./mintResponse");
99
+ const organisationBlock_1 = require("./organisationBlock");
100
+ const organisationIdentifierSchemeType_1 = require("./organisationIdentifierSchemeType");
101
+ const organisationRole_1 = require("./organisationRole");
102
+ const organisationRoleSchemeType_1 = require("./organisationRoleSchemeType");
103
+ const organisationRoleType_1 = require("./organisationRoleType");
104
+ const publicClosedMetadataSchemaV1_1 = require("./publicClosedMetadataSchemaV1");
105
+ const publicRaidMetadataSchemaV1_1 = require("./publicRaidMetadataSchemaV1");
106
+ const publicReadRaidMetadataResponseV1_1 = require("./publicReadRaidMetadataResponseV1");
107
+ const publicReadRaidResponseV3_1 = require("./publicReadRaidResponseV3");
108
+ const publicServicePoint_1 = require("./publicServicePoint");
109
+ const raidListItemV2_1 = require("./raidListItemV2");
110
+ const raidListRequestV2_1 = require("./raidListRequestV2");
111
+ const raidoMetadataSchemaV1_1 = require("./raidoMetadataSchemaV1");
112
+ const raidoMetaschema_1 = require("./raidoMetaschema");
113
+ const readRaidResponseV2_1 = require("./readRaidResponseV2");
114
+ const readRaidV2Request_1 = require("./readRaidV2Request");
115
+ const servicePoint_1 = require("./servicePoint");
116
+ const titleBlock_1 = require("./titleBlock");
117
+ const titleType_1 = require("./titleType");
118
+ const updateAuthzRequest_1 = require("./updateAuthzRequest");
119
+ const updateAuthzRequestStatus_1 = require("./updateAuthzRequestStatus");
120
+ const updateAuthzResponse_1 = require("./updateAuthzResponse");
121
+ const updateRaidoSchemaV1Request_1 = require("./updateRaidoSchemaV1Request");
122
+ const validationFailure_1 = require("./validationFailure");
123
+ const versionResult_1 = require("./versionResult");
124
+ /* tslint:disable:no-unused-variable */
125
+ let primitives = [
126
+ "string",
127
+ "boolean",
128
+ "double",
129
+ "integer",
130
+ "long",
131
+ "float",
132
+ "number",
133
+ "any"
134
+ ];
135
+ let enumsMap = {
136
+ "AccessType": accessType_1.AccessType,
137
+ "AuthzRequestStatus": authzRequestStatus_1.AuthzRequestStatus,
138
+ "ContributorIdentifierSchemeType": contributorIdentifierSchemeType_1.ContributorIdentifierSchemeType,
139
+ "ContributorPositionRaidMetadataSchemaType": contributorPositionRaidMetadataSchemaType_1.ContributorPositionRaidMetadataSchemaType,
140
+ "ContributorPositionSchemeType": contributorPositionSchemeType_1.ContributorPositionSchemeType,
141
+ "ContributorRoleCreditNisoOrgType": contributorRoleCreditNisoOrgType_1.ContributorRoleCreditNisoOrgType,
142
+ "ContributorRoleSchemeType": contributorRoleSchemeType_1.ContributorRoleSchemeType,
143
+ "DescriptionType": descriptionType_1.DescriptionType,
144
+ "OrganisationIdentifierSchemeType": organisationIdentifierSchemeType_1.OrganisationIdentifierSchemeType,
145
+ "OrganisationRoleSchemeType": organisationRoleSchemeType_1.OrganisationRoleSchemeType,
146
+ "OrganisationRoleType": organisationRoleType_1.OrganisationRoleType,
147
+ "RaidoMetaschema": raidoMetaschema_1.RaidoMetaschema,
148
+ "TitleType": titleType_1.TitleType,
149
+ };
150
+ let typeMap = {
151
+ "AccessBlock": accessBlock_1.AccessBlock,
152
+ "AlternateUrlBlock": alternateUrlBlock_1.AlternateUrlBlock,
153
+ "ApiKey": apiKey_1.ApiKey,
154
+ "AppUser": appUser_1.AppUser,
155
+ "AppUserExtraV1": appUserExtraV1_1.AppUserExtraV1,
156
+ "AuthzRequestExtraV1": authzRequestExtraV1_1.AuthzRequestExtraV1,
157
+ "ContributorBlock": contributorBlock_1.ContributorBlock,
158
+ "ContributorPosition": contributorPosition_1.ContributorPosition,
159
+ "ContributorRole": contributorRole_1.ContributorRole,
160
+ "DatesBlock": datesBlock_1.DatesBlock,
161
+ "DescriptionBlock": descriptionBlock_1.DescriptionBlock,
162
+ "GenerateApiTokenRequest": generateApiTokenRequest_1.GenerateApiTokenRequest,
163
+ "GenerateApiTokenResponse": generateApiTokenResponse_1.GenerateApiTokenResponse,
164
+ "IdBlock": idBlock_1.IdBlock,
165
+ "LegacyMetadataSchemaV1": legacyMetadataSchemaV1_1.LegacyMetadataSchemaV1,
166
+ "MigrateLegacyRaidRequest": migrateLegacyRaidRequest_1.MigrateLegacyRaidRequest,
167
+ "MigrateLegacyRaidRequestMintRequest": migrateLegacyRaidRequestMintRequest_1.MigrateLegacyRaidRequestMintRequest,
168
+ "MintRaidoSchemaV1Request": mintRaidoSchemaV1Request_1.MintRaidoSchemaV1Request,
169
+ "MintRaidoSchemaV1RequestMintRequest": mintRaidoSchemaV1RequestMintRequest_1.MintRaidoSchemaV1RequestMintRequest,
170
+ "MintResponse": mintResponse_1.MintResponse,
171
+ "OrganisationBlock": organisationBlock_1.OrganisationBlock,
172
+ "OrganisationRole": organisationRole_1.OrganisationRole,
173
+ "PublicClosedMetadataSchemaV1": publicClosedMetadataSchemaV1_1.PublicClosedMetadataSchemaV1,
174
+ "PublicRaidMetadataSchemaV1": publicRaidMetadataSchemaV1_1.PublicRaidMetadataSchemaV1,
175
+ "PublicReadRaidMetadataResponseV1": publicReadRaidMetadataResponseV1_1.PublicReadRaidMetadataResponseV1,
176
+ "PublicReadRaidResponseV3": publicReadRaidResponseV3_1.PublicReadRaidResponseV3,
177
+ "PublicServicePoint": publicServicePoint_1.PublicServicePoint,
178
+ "RaidListItemV2": raidListItemV2_1.RaidListItemV2,
179
+ "RaidListRequestV2": raidListRequestV2_1.RaidListRequestV2,
180
+ "RaidoMetadataSchemaV1": raidoMetadataSchemaV1_1.RaidoMetadataSchemaV1,
181
+ "ReadRaidResponseV2": readRaidResponseV2_1.ReadRaidResponseV2,
182
+ "ReadRaidV2Request": readRaidV2Request_1.ReadRaidV2Request,
183
+ "ServicePoint": servicePoint_1.ServicePoint,
184
+ "TitleBlock": titleBlock_1.TitleBlock,
185
+ "UpdateAuthzRequest": updateAuthzRequest_1.UpdateAuthzRequest,
186
+ "UpdateAuthzRequestStatus": updateAuthzRequestStatus_1.UpdateAuthzRequestStatus,
187
+ "UpdateAuthzResponse": updateAuthzResponse_1.UpdateAuthzResponse,
188
+ "UpdateRaidoSchemaV1Request": updateRaidoSchemaV1Request_1.UpdateRaidoSchemaV1Request,
189
+ "ValidationFailure": validationFailure_1.ValidationFailure,
190
+ "VersionResult": versionResult_1.VersionResult,
191
+ };
192
+ class ObjectSerializer {
193
+ static findCorrectType(data, expectedType) {
194
+ if (data == undefined) {
195
+ return expectedType;
196
+ }
197
+ else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
198
+ return expectedType;
199
+ }
200
+ else if (expectedType === "Date") {
201
+ return expectedType;
202
+ }
203
+ else {
204
+ if (enumsMap[expectedType]) {
205
+ return expectedType;
206
+ }
207
+ if (!typeMap[expectedType]) {
208
+ return expectedType; // w/e we don't know the type
209
+ }
210
+ // Check the discriminator
211
+ let discriminatorProperty = typeMap[expectedType].discriminator;
212
+ if (discriminatorProperty == null) {
213
+ return expectedType; // the type does not have a discriminator. use it.
214
+ }
215
+ else {
216
+ if (data[discriminatorProperty]) {
217
+ var discriminatorType = data[discriminatorProperty];
218
+ if (typeMap[discriminatorType]) {
219
+ return discriminatorType; // use the type given in the discriminator
220
+ }
221
+ else {
222
+ return expectedType; // discriminator did not map to a type
223
+ }
224
+ }
225
+ else {
226
+ return expectedType; // discriminator was not present (or an empty string)
227
+ }
228
+ }
229
+ }
230
+ }
231
+ static serialize(data, type) {
232
+ if (data == undefined) {
233
+ return data;
234
+ }
235
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
236
+ return data;
237
+ }
238
+ else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
239
+ let subType = type.replace("Array<", ""); // Array<Type> => Type>
240
+ subType = subType.substring(0, subType.length - 1); // Type> => Type
241
+ let transformedData = [];
242
+ for (let index = 0; index < data.length; index++) {
243
+ let datum = data[index];
244
+ transformedData.push(ObjectSerializer.serialize(datum, subType));
245
+ }
246
+ return transformedData;
247
+ }
248
+ else if (type === "Date") {
249
+ return data.toISOString();
250
+ }
251
+ else {
252
+ if (enumsMap[type]) {
253
+ return data;
254
+ }
255
+ if (!typeMap[type]) { // in case we dont know the type
256
+ return data;
257
+ }
258
+ // Get the actual type of this object
259
+ type = this.findCorrectType(data, type);
260
+ // get the map for the correct type.
261
+ let attributeTypes = typeMap[type].getAttributeTypeMap();
262
+ let instance = {};
263
+ for (let index = 0; index < attributeTypes.length; index++) {
264
+ let attributeType = attributeTypes[index];
265
+ instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
266
+ }
267
+ return instance;
268
+ }
269
+ }
270
+ static deserialize(data, type) {
271
+ // polymorphism may change the actual type.
272
+ type = ObjectSerializer.findCorrectType(data, type);
273
+ if (data == undefined) {
274
+ return data;
275
+ }
276
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
277
+ return data;
278
+ }
279
+ else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
280
+ let subType = type.replace("Array<", ""); // Array<Type> => Type>
281
+ subType = subType.substring(0, subType.length - 1); // Type> => Type
282
+ let transformedData = [];
283
+ for (let index = 0; index < data.length; index++) {
284
+ let datum = data[index];
285
+ transformedData.push(ObjectSerializer.deserialize(datum, subType));
286
+ }
287
+ return transformedData;
288
+ }
289
+ else if (type === "Date") {
290
+ return new Date(data);
291
+ }
292
+ else {
293
+ if (enumsMap[type]) { // is Enum
294
+ return data;
295
+ }
296
+ if (!typeMap[type]) { // dont know the type
297
+ return data;
298
+ }
299
+ let instance = new typeMap[type]();
300
+ let attributeTypes = typeMap[type].getAttributeTypeMap();
301
+ for (let index = 0; index < attributeTypes.length; index++) {
302
+ let attributeType = attributeTypes[index];
303
+ instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
304
+ }
305
+ return instance;
306
+ }
307
+ }
308
+ }
309
+ exports.ObjectSerializer = ObjectSerializer;
310
+ class HttpBasicAuth {
311
+ username = '';
312
+ password = '';
313
+ applyToRequest(requestOptions) {
314
+ requestOptions.auth = {
315
+ username: this.username, password: this.password
316
+ };
317
+ }
318
+ }
319
+ exports.HttpBasicAuth = HttpBasicAuth;
320
+ class HttpBearerAuth {
321
+ accessToken = '';
322
+ applyToRequest(requestOptions) {
323
+ if (requestOptions && requestOptions.headers) {
324
+ const accessToken = typeof this.accessToken === 'function'
325
+ ? this.accessToken()
326
+ : this.accessToken;
327
+ requestOptions.headers["Authorization"] = "Bearer " + accessToken;
328
+ }
329
+ }
330
+ }
331
+ exports.HttpBearerAuth = HttpBearerAuth;
332
+ class ApiKeyAuth {
333
+ location;
334
+ paramName;
335
+ apiKey = '';
336
+ constructor(location, paramName) {
337
+ this.location = location;
338
+ this.paramName = paramName;
339
+ }
340
+ applyToRequest(requestOptions) {
341
+ if (this.location == "query") {
342
+ requestOptions.qs[this.paramName] = this.apiKey;
343
+ }
344
+ else if (this.location == "header" && requestOptions && requestOptions.headers) {
345
+ requestOptions.headers[this.paramName] = this.apiKey;
346
+ }
347
+ else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
348
+ if (requestOptions.headers['Cookie']) {
349
+ requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
350
+ }
351
+ else {
352
+ requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
353
+ }
354
+ }
355
+ }
356
+ }
357
+ exports.ApiKeyAuth = ApiKeyAuth;
358
+ class OAuth {
359
+ accessToken = '';
360
+ applyToRequest(requestOptions) {
361
+ if (requestOptions && requestOptions.headers) {
362
+ requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
363
+ }
364
+ }
365
+ }
366
+ exports.OAuth = OAuth;
367
+ class VoidAuth {
368
+ username = '';
369
+ password = '';
370
+ applyToRequest(_) {
371
+ // Do nothing
372
+ }
373
+ }
374
+ exports.VoidAuth = VoidAuth;