@3sixty/document-management-models 0.0.0-stage → 0.20.0-next.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 (110) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/compiled/validators.js +600 -0
  4. package/dist/es/compiled/validators.js.map +1 -0
  5. package/dist/es/dataTypes/documentManagementDataTypes.js +59 -0
  6. package/dist/es/dataTypes/documentManagementDataTypes.js.map +1 -0
  7. package/dist/es/index.js +25 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/models/IDocument.js +2 -0
  10. package/dist/es/models/IDocument.js.map +1 -0
  11. package/dist/es/models/IDocumentAttestation.js +2 -0
  12. package/dist/es/models/IDocumentAttestation.js.map +1 -0
  13. package/dist/es/models/IDocumentBase.js +2 -0
  14. package/dist/es/models/IDocumentBase.js.map +1 -0
  15. package/dist/es/models/IDocumentHydrated.js +2 -0
  16. package/dist/es/models/IDocumentHydrated.js.map +1 -0
  17. package/dist/es/models/IDocumentList.js +2 -0
  18. package/dist/es/models/IDocumentList.js.map +1 -0
  19. package/dist/es/models/IDocumentManagementComponent.js +2 -0
  20. package/dist/es/models/IDocumentManagementComponent.js.map +1 -0
  21. package/dist/es/models/IDocumentManagementEdgeEntry.js +2 -0
  22. package/dist/es/models/IDocumentManagementEdgeEntry.js.map +1 -0
  23. package/dist/es/models/api/IDocumentManagementCreateRequest.js +2 -0
  24. package/dist/es/models/api/IDocumentManagementCreateRequest.js.map +1 -0
  25. package/dist/es/models/api/IDocumentManagementGetRequest.js +2 -0
  26. package/dist/es/models/api/IDocumentManagementGetRequest.js.map +1 -0
  27. package/dist/es/models/api/IDocumentManagementGetResponse.js +2 -0
  28. package/dist/es/models/api/IDocumentManagementGetResponse.js.map +1 -0
  29. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js +2 -0
  30. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js.map +1 -0
  31. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js +2 -0
  32. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js.map +1 -0
  33. package/dist/es/models/api/IDocumentManagementQueryRequest.js +2 -0
  34. package/dist/es/models/api/IDocumentManagementQueryRequest.js.map +1 -0
  35. package/dist/es/models/api/IDocumentManagementQueryResponse.js +2 -0
  36. package/dist/es/models/api/IDocumentManagementQueryResponse.js.map +1 -0
  37. package/dist/es/models/api/IDocumentManagementRemoveRequest.js +4 -0
  38. package/dist/es/models/api/IDocumentManagementRemoveRequest.js.map +1 -0
  39. package/dist/es/models/api/IDocumentManagementUpdatePartialRequest.js +2 -0
  40. package/dist/es/models/api/IDocumentManagementUpdatePartialRequest.js.map +1 -0
  41. package/dist/es/models/documentContexts.js +33 -0
  42. package/dist/es/models/documentContexts.js.map +1 -0
  43. package/dist/es/models/documentManagementMetricIds.js +29 -0
  44. package/dist/es/models/documentManagementMetricIds.js.map +1 -0
  45. package/dist/es/models/documentManagementMetrics.js +36 -0
  46. package/dist/es/models/documentManagementMetrics.js.map +1 -0
  47. package/dist/es/models/documentTypes.js +25 -0
  48. package/dist/es/models/documentTypes.js.map +1 -0
  49. package/dist/es/schemas/Document.json +86 -0
  50. package/dist/es/schemas/DocumentAttestation.json +60 -0
  51. package/dist/es/schemas/DocumentBase.json +29 -0
  52. package/dist/es/schemas/DocumentHydrated.json +25 -0
  53. package/dist/es/schemas/DocumentList.json +51 -0
  54. package/dist/types/compiled/validators.d.ts +21 -0
  55. package/dist/types/dataTypes/documentManagementDataTypes.d.ts +9 -0
  56. package/dist/types/index.d.ts +22 -0
  57. package/dist/types/models/IDocument.d.ts +72 -0
  58. package/dist/types/models/IDocumentAttestation.d.ts +46 -0
  59. package/dist/types/models/IDocumentBase.d.ts +27 -0
  60. package/dist/types/models/IDocumentHydrated.d.ts +23 -0
  61. package/dist/types/models/IDocumentList.d.ts +32 -0
  62. package/dist/types/models/IDocumentManagementComponent.d.ts +123 -0
  63. package/dist/types/models/IDocumentManagementEdgeEntry.d.ts +18 -0
  64. package/dist/types/models/api/IDocumentManagementCreateRequest.d.ts +42 -0
  65. package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +68 -0
  66. package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +18 -0
  67. package/dist/types/models/api/IDocumentManagementGetRevisionRequest.d.ts +53 -0
  68. package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +17 -0
  69. package/dist/types/models/api/IDocumentManagementQueryRequest.d.ts +29 -0
  70. package/dist/types/models/api/IDocumentManagementQueryResponse.d.ts +18 -0
  71. package/dist/types/models/api/IDocumentManagementRemoveRequest.d.ts +18 -0
  72. package/dist/types/models/api/IDocumentManagementUpdatePartialRequest.d.ts +61 -0
  73. package/dist/types/models/documentContexts.d.ts +33 -0
  74. package/dist/types/models/documentManagementMetricIds.d.ts +29 -0
  75. package/dist/types/models/documentManagementMetrics.d.ts +5 -0
  76. package/dist/types/models/documentTypes.d.ts +25 -0
  77. package/docs/changelog.md +9 -0
  78. package/docs/examples.md +23 -0
  79. package/docs/reference/classes/DocumentManagementDataTypes.md +25 -0
  80. package/docs/reference/index.md +42 -0
  81. package/docs/reference/interfaces/IDocument.md +155 -0
  82. package/docs/reference/interfaces/IDocumentAttestation.md +59 -0
  83. package/docs/reference/interfaces/IDocumentBase.md +39 -0
  84. package/docs/reference/interfaces/IDocumentHydrated.md +223 -0
  85. package/docs/reference/interfaces/IDocumentList.md +35 -0
  86. package/docs/reference/interfaces/IDocumentManagementComponent.md +348 -0
  87. package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +53 -0
  88. package/docs/reference/interfaces/IDocumentManagementEdgeEntry.md +27 -0
  89. package/docs/reference/interfaces/IDocumentManagementGetRequest.md +127 -0
  90. package/docs/reference/interfaces/IDocumentManagementGetResponse.md +27 -0
  91. package/docs/reference/interfaces/IDocumentManagementGetRevisionRequest.md +91 -0
  92. package/docs/reference/interfaces/IDocumentManagementGetRevisionResponse.md +23 -0
  93. package/docs/reference/interfaces/IDocumentManagementQueryRequest.md +41 -0
  94. package/docs/reference/interfaces/IDocumentManagementQueryResponse.md +27 -0
  95. package/docs/reference/interfaces/IDocumentManagementRemoveRequest.md +23 -0
  96. package/docs/reference/interfaces/IDocumentManagementUpdatePartialRequest.md +80 -0
  97. package/docs/reference/type-aliases/DocumentContexts.md +5 -0
  98. package/docs/reference/type-aliases/DocumentManagementMetricIds.md +5 -0
  99. package/docs/reference/type-aliases/DocumentTypes.md +5 -0
  100. package/docs/reference/variables/CompiledDocument.md +5 -0
  101. package/docs/reference/variables/CompiledDocumentAttestation.md +5 -0
  102. package/docs/reference/variables/CompiledDocumentBase.md +5 -0
  103. package/docs/reference/variables/CompiledDocumentHydrated.md +5 -0
  104. package/docs/reference/variables/CompiledDocumentList.md +5 -0
  105. package/docs/reference/variables/DocumentContexts.md +43 -0
  106. package/docs/reference/variables/DocumentManagementMetricIds.md +37 -0
  107. package/docs/reference/variables/DocumentManagementMetrics.md +5 -0
  108. package/docs/reference/variables/DocumentTypes.md +31 -0
  109. package/locales/en.json +3 -0
  110. package/package.json +63 -5
@@ -0,0 +1,600 @@
1
+ import * as external0 from "@3sixty/standards-unece";
2
+ import * as external1 from "@3sixty/data-json-ld";
3
+ import * as external2 from "@3sixty/blob-storage-models";
4
+ import * as external3 from "@3sixty/attestation-models";
5
+ const MESSAGES = ["must be string", "must be object", "must NOT have fewer than 3 items", "must be equal to constant", "must be array", "must be number", "must NOT have more than 3 items"];
6
+ function createError(instancePath, schemaPath, keyword, params, message) {
7
+ return { instancePath, schemaPath, keyword, params, ["message"]: typeof message === "number" ? MESSAGES[message] : message };
8
+ }
9
+ function pushError(errors, error) {
10
+ if (errors === null) {
11
+ return [error];
12
+ }
13
+ errors.push(error);
14
+ return errors;
15
+ }
16
+ /**
17
+ * Compiled validator for the Document schema.
18
+ */
19
+ export const CompiledDocument = validate52;
20
+ const keyword0 = external0["CompiledUneceDocumentCodeList"];
21
+ const keyword1 = external1["CompiledJsonLdNodeObject"];
22
+ function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
23
+ /*# sourceURL="https://schema.3sixty.global/documents/DocumentBase" */ ;
24
+ let vErrors = null;
25
+ let errors = 0;
26
+ const evaluated0 = validate53.evaluated;
27
+ if (evaluated0.dynamicProps) {
28
+ evaluated0.props = undefined;
29
+ }
30
+ if (evaluated0.dynamicItems) {
31
+ evaluated0.items = undefined;
32
+ }
33
+ if (data && typeof data == "object" && !Array.isArray(data)) {
34
+ if (data.documentId === undefined) {
35
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "documentId" }, "must have required property '" + "documentId" + "'");
36
+ vErrors = pushError(vErrors, err0);
37
+ errors++;
38
+ }
39
+ if (data.documentCode === undefined) {
40
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "documentCode" }, "must have required property '" + "documentCode" + "'");
41
+ vErrors = pushError(vErrors, err1);
42
+ errors++;
43
+ }
44
+ if (data.documentId !== undefined) {
45
+ if (typeof data.documentId !== "string") {
46
+ const err2 = createError(instancePath + "/documentId", "#/properties/documentId/type", "type", { type: "string" }, 0);
47
+ vErrors = pushError(vErrors, err2);
48
+ errors++;
49
+ }
50
+ }
51
+ if (data.documentIdFormat !== undefined) {
52
+ if (typeof data.documentIdFormat !== "string") {
53
+ const err3 = createError(instancePath + "/documentIdFormat", "#/properties/documentIdFormat/type", "type", { type: "string" }, 0);
54
+ vErrors = pushError(vErrors, err3);
55
+ errors++;
56
+ }
57
+ }
58
+ if (data.documentCode !== undefined) {
59
+ if (!(keyword0(data.documentCode, { instancePath: instancePath + "/documentCode", parentData: data, parentDataProperty: "documentCode", rootData, dynamicAnchors }))) {
60
+ vErrors = vErrors === null ? keyword0.errors : vErrors.concat(keyword0.errors);
61
+ errors = vErrors.length;
62
+ }
63
+ }
64
+ if (data.annotationObject !== undefined) {
65
+ if (!(keyword1(data.annotationObject, { instancePath: instancePath + "/annotationObject", parentData: data, parentDataProperty: "annotationObject", rootData, dynamicAnchors }))) {
66
+ vErrors = vErrors === null ? keyword1.errors : vErrors.concat(keyword1.errors);
67
+ errors = vErrors.length;
68
+ }
69
+ }
70
+ }
71
+ else {
72
+ const err4 = createError(instancePath, "#/type", "type", { type: "object" }, 1);
73
+ vErrors = pushError(vErrors, err4);
74
+ errors++;
75
+ }
76
+ validate53.errors = vErrors;
77
+ return errors === 0;
78
+ }
79
+ validate53.evaluated = { "props": { "documentId": true, "documentIdFormat": true, "documentCode": true, "annotationObject": true }, "dynamicProps": false, "dynamicItems": false };
80
+ const keyword2 = external1["CompiledJsonLdContextDefinitionElement"];
81
+ function validate52(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
82
+ /*# sourceURL="https://schema.3sixty.global/documents/Document" */ ;
83
+ let vErrors = null;
84
+ let errors = 0;
85
+ const evaluated0 = validate52.evaluated;
86
+ if (evaluated0.dynamicProps) {
87
+ evaluated0.props = undefined;
88
+ }
89
+ if (evaluated0.dynamicItems) {
90
+ evaluated0.items = undefined;
91
+ }
92
+ if (!(validate53(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
93
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
94
+ errors = vErrors.length;
95
+ }
96
+ if (data && typeof data == "object" && !Array.isArray(data)) {
97
+ if (data["@context"] === undefined) {
98
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@context" }, "must have required property '" + "@context" + "'");
99
+ vErrors = pushError(vErrors, err0);
100
+ errors++;
101
+ }
102
+ if (data.type === undefined) {
103
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "type" }, "must have required property '" + "type" + "'");
104
+ vErrors = pushError(vErrors, err1);
105
+ errors++;
106
+ }
107
+ if (data.id === undefined) {
108
+ const err2 = createError(instancePath, "#/required", "required", { missingProperty: "id" }, "must have required property '" + "id" + "'");
109
+ vErrors = pushError(vErrors, err2);
110
+ errors++;
111
+ }
112
+ if (data.documentRevision === undefined) {
113
+ const err3 = createError(instancePath, "#/required", "required", { missingProperty: "documentRevision" }, "must have required property '" + "documentRevision" + "'");
114
+ vErrors = pushError(vErrors, err3);
115
+ errors++;
116
+ }
117
+ if (data.blobStorageId === undefined) {
118
+ const err4 = createError(instancePath, "#/required", "required", { missingProperty: "blobStorageId" }, "must have required property '" + "blobStorageId" + "'");
119
+ vErrors = pushError(vErrors, err4);
120
+ errors++;
121
+ }
122
+ if (data.integrity === undefined) {
123
+ const err5 = createError(instancePath, "#/required", "required", { missingProperty: "integrity" }, "must have required property '" + "integrity" + "'");
124
+ vErrors = pushError(vErrors, err5);
125
+ errors++;
126
+ }
127
+ if (data.dateCreated === undefined) {
128
+ const err6 = createError(instancePath, "#/required", "required", { missingProperty: "dateCreated" }, "must have required property '" + "dateCreated" + "'");
129
+ vErrors = pushError(vErrors, err6);
130
+ errors++;
131
+ }
132
+ if (data["@context"] !== undefined) {
133
+ let data0 = data["@context"];
134
+ if (Array.isArray(data0)) {
135
+ if (data0.length < 3) {
136
+ const err7 = createError(instancePath + "/@context", "#/properties/%40context/minItems", "minItems", { limit: 3 }, 2);
137
+ vErrors = pushError(vErrors, err7);
138
+ errors++;
139
+ }
140
+ const len0 = data0.length;
141
+ if (len0 > 0) {
142
+ if ("https://schema.org" !== data0[0]) {
143
+ const err8 = createError(instancePath + "/@context/0", "#/properties/%40context/prefixItems/0/const", "const", { allowedValue: "https://schema.org" }, 3);
144
+ vErrors = pushError(vErrors, err8);
145
+ errors++;
146
+ }
147
+ }
148
+ if (len0 > 1) {
149
+ if ("https://schema.3sixty.global/documents/" !== data0[1]) {
150
+ const err9 = createError(instancePath + "/@context/1", "#/properties/%40context/prefixItems/1/const", "const", { allowedValue: "https://schema.3sixty.global/documents/" }, 3);
151
+ vErrors = pushError(vErrors, err9);
152
+ errors++;
153
+ }
154
+ }
155
+ if (len0 > 2) {
156
+ if ("https://schema.3sixty.global/common/" !== data0[2]) {
157
+ const err10 = createError(instancePath + "/@context/2", "#/properties/%40context/prefixItems/2/const", "const", { allowedValue: "https://schema.3sixty.global/common/" }, 3);
158
+ vErrors = pushError(vErrors, err10);
159
+ errors++;
160
+ }
161
+ }
162
+ const len1 = data0.length;
163
+ var valid3 = len1 <= 3;
164
+ if (!valid3) {
165
+ for (let i0 = 3; i0 < len1; i0++) {
166
+ const _errs7 = errors;
167
+ if (!(keyword2(data0[i0], { instancePath: instancePath + "/@context/" + i0, parentData: data0, parentDataProperty: i0, rootData, dynamicAnchors }))) {
168
+ vErrors = vErrors === null ? keyword2.errors : vErrors.concat(keyword2.errors);
169
+ errors = vErrors.length;
170
+ }
171
+ var valid3 = _errs7 === errors;
172
+ }
173
+ }
174
+ }
175
+ else {
176
+ const err11 = createError(instancePath + "/@context", "#/properties/%40context/type", "type", { type: "array" }, 4);
177
+ vErrors = pushError(vErrors, err11);
178
+ errors++;
179
+ }
180
+ }
181
+ if (data.type !== undefined) {
182
+ if ("Document" !== data.type) {
183
+ const err12 = createError(instancePath + "/type", "#/properties/type/const", "const", { allowedValue: "Document" }, 3);
184
+ vErrors = pushError(vErrors, err12);
185
+ errors++;
186
+ }
187
+ }
188
+ if (data.id !== undefined) {
189
+ if (typeof data.id !== "string") {
190
+ const err13 = createError(instancePath + "/id", "#/properties/id/type", "type", { type: "string" }, 0);
191
+ vErrors = pushError(vErrors, err13);
192
+ errors++;
193
+ }
194
+ }
195
+ if (data.documentRevision !== undefined) {
196
+ let data7 = data.documentRevision;
197
+ if (!((typeof data7 == "number") && (isFinite(data7)))) {
198
+ const err14 = createError(instancePath + "/documentRevision", "#/properties/documentRevision/type", "type", { type: "number" }, 5);
199
+ vErrors = pushError(vErrors, err14);
200
+ errors++;
201
+ }
202
+ }
203
+ if (data.blobStorageId !== undefined) {
204
+ if (typeof data.blobStorageId !== "string") {
205
+ const err15 = createError(instancePath + "/blobStorageId", "#/properties/blobStorageId/type", "type", { type: "string" }, 0);
206
+ vErrors = pushError(vErrors, err15);
207
+ errors++;
208
+ }
209
+ }
210
+ if (data.integrity !== undefined) {
211
+ if (typeof data.integrity !== "string") {
212
+ const err16 = createError(instancePath + "/integrity", "#/properties/integrity/type", "type", { type: "string" }, 0);
213
+ vErrors = pushError(vErrors, err16);
214
+ errors++;
215
+ }
216
+ }
217
+ if (data.attestationId !== undefined) {
218
+ if (typeof data.attestationId !== "string") {
219
+ const err17 = createError(instancePath + "/attestationId", "#/properties/attestationId/type", "type", { type: "string" }, 0);
220
+ vErrors = pushError(vErrors, err17);
221
+ errors++;
222
+ }
223
+ }
224
+ if (data.dateCreated !== undefined) {
225
+ if (typeof data.dateCreated !== "string") {
226
+ const err18 = createError(instancePath + "/dateCreated", "#/properties/dateCreated/type", "type", { type: "string" }, 0);
227
+ vErrors = pushError(vErrors, err18);
228
+ errors++;
229
+ }
230
+ }
231
+ if (data.dateModified !== undefined) {
232
+ if (typeof data.dateModified !== "string") {
233
+ const err19 = createError(instancePath + "/dateModified", "#/properties/dateModified/type", "type", { type: "string" }, 0);
234
+ vErrors = pushError(vErrors, err19);
235
+ errors++;
236
+ }
237
+ }
238
+ if (data.dateDeleted !== undefined) {
239
+ if (typeof data.dateDeleted !== "string") {
240
+ const err20 = createError(instancePath + "/dateDeleted", "#/properties/dateDeleted/type", "type", { type: "string" }, 0);
241
+ vErrors = pushError(vErrors, err20);
242
+ errors++;
243
+ }
244
+ }
245
+ if (data.organizationIdentity !== undefined) {
246
+ if (typeof data.organizationIdentity !== "string") {
247
+ const err21 = createError(instancePath + "/organizationIdentity", "#/properties/organizationIdentity/type", "type", { type: "string" }, 0);
248
+ vErrors = pushError(vErrors, err21);
249
+ errors++;
250
+ }
251
+ }
252
+ if (data.userIdentity !== undefined) {
253
+ if (typeof data.userIdentity !== "string") {
254
+ const err22 = createError(instancePath + "/userIdentity", "#/properties/userIdentity/type", "type", { type: "string" }, 0);
255
+ vErrors = pushError(vErrors, err22);
256
+ errors++;
257
+ }
258
+ }
259
+ }
260
+ else {
261
+ const err23 = createError(instancePath, "#/type", "type", { type: "object" }, 1);
262
+ vErrors = pushError(vErrors, err23);
263
+ errors++;
264
+ }
265
+ validate52.errors = vErrors;
266
+ return errors === 0;
267
+ }
268
+ validate52.evaluated = { "props": { "@context": true, "type": true, "id": true, "documentRevision": true, "blobStorageId": true, "integrity": true, "attestationId": true, "dateCreated": true, "dateModified": true, "dateDeleted": true, "organizationIdentity": true, "userIdentity": true, "documentId": true, "documentIdFormat": true, "documentCode": true, "annotationObject": true }, "dynamicProps": false, "dynamicItems": false };
269
+ /**
270
+ * Compiled validator for the DocumentAttestation schema.
271
+ */
272
+ export const CompiledDocumentAttestation = validate55;
273
+ function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
274
+ /*# sourceURL="https://schema.3sixty.global/documents/DocumentAttestation" */ ;
275
+ let vErrors = null;
276
+ let errors = 0;
277
+ const evaluated0 = validate55.evaluated;
278
+ if (evaluated0.dynamicProps) {
279
+ evaluated0.props = undefined;
280
+ }
281
+ if (evaluated0.dynamicItems) {
282
+ evaluated0.items = undefined;
283
+ }
284
+ if (data && typeof data == "object" && !Array.isArray(data)) {
285
+ if (data["@context"] === undefined) {
286
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@context" }, "must have required property '" + "@context" + "'");
287
+ vErrors = pushError(vErrors, err0);
288
+ errors++;
289
+ }
290
+ if (data.type === undefined) {
291
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "type" }, "must have required property '" + "type" + "'");
292
+ vErrors = pushError(vErrors, err1);
293
+ errors++;
294
+ }
295
+ if (data.documentId === undefined) {
296
+ const err2 = createError(instancePath, "#/required", "required", { missingProperty: "documentId" }, "must have required property '" + "documentId" + "'");
297
+ vErrors = pushError(vErrors, err2);
298
+ errors++;
299
+ }
300
+ if (data.documentCode === undefined) {
301
+ const err3 = createError(instancePath, "#/required", "required", { missingProperty: "documentCode" }, "must have required property '" + "documentCode" + "'");
302
+ vErrors = pushError(vErrors, err3);
303
+ errors++;
304
+ }
305
+ if (data.documentRevision === undefined) {
306
+ const err4 = createError(instancePath, "#/required", "required", { missingProperty: "documentRevision" }, "must have required property '" + "documentRevision" + "'");
307
+ vErrors = pushError(vErrors, err4);
308
+ errors++;
309
+ }
310
+ if (data.dateCreated === undefined) {
311
+ const err5 = createError(instancePath, "#/required", "required", { missingProperty: "dateCreated" }, "must have required property '" + "dateCreated" + "'");
312
+ vErrors = pushError(vErrors, err5);
313
+ errors++;
314
+ }
315
+ if (data.integrity === undefined) {
316
+ const err6 = createError(instancePath, "#/required", "required", { missingProperty: "integrity" }, "must have required property '" + "integrity" + "'");
317
+ vErrors = pushError(vErrors, err6);
318
+ errors++;
319
+ }
320
+ if (data["@context"] !== undefined) {
321
+ let data0 = data["@context"];
322
+ if (Array.isArray(data0)) {
323
+ if (data0.length > 3) {
324
+ const err7 = createError(instancePath + "/@context", "#/properties/%40context/maxItems", "maxItems", { limit: 3 }, 6);
325
+ vErrors = pushError(vErrors, err7);
326
+ errors++;
327
+ }
328
+ if (data0.length < 3) {
329
+ const err8 = createError(instancePath + "/@context", "#/properties/%40context/minItems", "minItems", { limit: 3 }, 2);
330
+ vErrors = pushError(vErrors, err8);
331
+ errors++;
332
+ }
333
+ const len0 = data0.length;
334
+ if (len0 > 0) {
335
+ if ("https://schema.org" !== data0[0]) {
336
+ const err9 = createError(instancePath + "/@context/0", "#/properties/%40context/prefixItems/0/const", "const", { allowedValue: "https://schema.org" }, 3);
337
+ vErrors = pushError(vErrors, err9);
338
+ errors++;
339
+ }
340
+ }
341
+ if (len0 > 1) {
342
+ if ("https://schema.3sixty.global/documents/" !== data0[1]) {
343
+ const err10 = createError(instancePath + "/@context/1", "#/properties/%40context/prefixItems/1/const", "const", { allowedValue: "https://schema.3sixty.global/documents/" }, 3);
344
+ vErrors = pushError(vErrors, err10);
345
+ errors++;
346
+ }
347
+ }
348
+ if (len0 > 2) {
349
+ if ("https://schema.3sixty.global/common/" !== data0[2]) {
350
+ const err11 = createError(instancePath + "/@context/2", "#/properties/%40context/prefixItems/2/const", "const", { allowedValue: "https://schema.3sixty.global/common/" }, 3);
351
+ vErrors = pushError(vErrors, err11);
352
+ errors++;
353
+ }
354
+ }
355
+ const len1 = data0.length;
356
+ if (!(len1 <= 3)) {
357
+ const err12 = createError(instancePath + "/@context", "#/properties/%40context/items", "items", { limit: 3 }, 6);
358
+ vErrors = pushError(vErrors, err12);
359
+ errors++;
360
+ }
361
+ }
362
+ else {
363
+ const err13 = createError(instancePath + "/@context", "#/properties/%40context/type", "type", { type: "array" }, 4);
364
+ vErrors = pushError(vErrors, err13);
365
+ errors++;
366
+ }
367
+ }
368
+ if (data.type !== undefined) {
369
+ if ("DocumentAttestation" !== data.type) {
370
+ const err14 = createError(instancePath + "/type", "#/properties/type/const", "const", { allowedValue: "DocumentAttestation" }, 3);
371
+ vErrors = pushError(vErrors, err14);
372
+ errors++;
373
+ }
374
+ }
375
+ if (data.documentId !== undefined) {
376
+ if (typeof data.documentId !== "string") {
377
+ const err15 = createError(instancePath + "/documentId", "#/properties/documentId/type", "type", { type: "string" }, 0);
378
+ vErrors = pushError(vErrors, err15);
379
+ errors++;
380
+ }
381
+ }
382
+ if (data.documentCode !== undefined) {
383
+ if (!(keyword0(data.documentCode, { instancePath: instancePath + "/documentCode", parentData: data, parentDataProperty: "documentCode", rootData, dynamicAnchors }))) {
384
+ vErrors = vErrors === null ? keyword0.errors : vErrors.concat(keyword0.errors);
385
+ errors = vErrors.length;
386
+ }
387
+ }
388
+ if (data.documentRevision !== undefined) {
389
+ let data7 = data.documentRevision;
390
+ if (!((typeof data7 == "number") && (isFinite(data7)))) {
391
+ const err16 = createError(instancePath + "/documentRevision", "#/properties/documentRevision/type", "type", { type: "number" }, 5);
392
+ vErrors = pushError(vErrors, err16);
393
+ errors++;
394
+ }
395
+ }
396
+ if (data.dateCreated !== undefined) {
397
+ if (typeof data.dateCreated !== "string") {
398
+ const err17 = createError(instancePath + "/dateCreated", "#/properties/dateCreated/type", "type", { type: "string" }, 0);
399
+ vErrors = pushError(vErrors, err17);
400
+ errors++;
401
+ }
402
+ }
403
+ if (data.integrity !== undefined) {
404
+ if (typeof data.integrity !== "string") {
405
+ const err18 = createError(instancePath + "/integrity", "#/properties/integrity/type", "type", { type: "string" }, 0);
406
+ vErrors = pushError(vErrors, err18);
407
+ errors++;
408
+ }
409
+ }
410
+ }
411
+ else {
412
+ const err19 = createError(instancePath, "#/type", "type", { type: "object" }, 1);
413
+ vErrors = pushError(vErrors, err19);
414
+ errors++;
415
+ }
416
+ validate55.errors = vErrors;
417
+ return errors === 0;
418
+ }
419
+ validate55.evaluated = { "props": { "@context": true, "type": true, "documentId": true, "documentCode": true, "documentRevision": true, "dateCreated": true, "integrity": true }, "dynamicProps": false, "dynamicItems": false };
420
+ /**
421
+ * Compiled validator for the DocumentBase schema.
422
+ */
423
+ export const CompiledDocumentBase = validate53;
424
+ /**
425
+ * Compiled validator for the DocumentHydrated schema.
426
+ */
427
+ export const CompiledDocumentHydrated = validate56;
428
+ const keyword4 = external2["CompiledBlobStorageEntry"];
429
+ const keyword5 = external3["CompiledAttestationInformation"];
430
+ function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
431
+ /*# sourceURL="https://schema.3sixty.global/documents/DocumentHydrated" */ ;
432
+ let vErrors = null;
433
+ let errors = 0;
434
+ const evaluated0 = validate56.evaluated;
435
+ if (evaluated0.dynamicProps) {
436
+ evaluated0.props = undefined;
437
+ }
438
+ if (evaluated0.dynamicItems) {
439
+ evaluated0.items = undefined;
440
+ }
441
+ if (!(validate52(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
442
+ vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);
443
+ errors = vErrors.length;
444
+ }
445
+ if (data && typeof data == "object" && !Array.isArray(data)) {
446
+ if (data.blobStorageEntry !== undefined) {
447
+ if (!(keyword4(data.blobStorageEntry, { instancePath: instancePath + "/blobStorageEntry", parentData: data, parentDataProperty: "blobStorageEntry", rootData, dynamicAnchors }))) {
448
+ vErrors = vErrors === null ? keyword4.errors : vErrors.concat(keyword4.errors);
449
+ errors = vErrors.length;
450
+ }
451
+ }
452
+ if (data.attestationInformation !== undefined) {
453
+ if (!(keyword5(data.attestationInformation, { instancePath: instancePath + "/attestationInformation", parentData: data, parentDataProperty: "attestationInformation", rootData, dynamicAnchors }))) {
454
+ vErrors = vErrors === null ? keyword5.errors : vErrors.concat(keyword5.errors);
455
+ errors = vErrors.length;
456
+ }
457
+ }
458
+ }
459
+ else {
460
+ const err0 = createError(instancePath, "#/type", "type", { type: "object" }, 1);
461
+ vErrors = pushError(vErrors, err0);
462
+ errors++;
463
+ }
464
+ validate56.errors = vErrors;
465
+ return errors === 0;
466
+ }
467
+ validate56.evaluated = { "props": { "blobStorageEntry": true, "extractedData": true, "attestationInformation": true, "@context": true, "type": true, "id": true, "documentRevision": true, "blobStorageId": true, "integrity": true, "attestationId": true, "dateCreated": true, "dateModified": true, "dateDeleted": true, "organizationIdentity": true, "userIdentity": true, "documentId": true, "documentIdFormat": true, "documentCode": true, "annotationObject": true }, "dynamicProps": false, "dynamicItems": false };
468
+ /**
469
+ * Compiled validator for the DocumentList schema.
470
+ */
471
+ export const CompiledDocumentList = validate58;
472
+ function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
473
+ /*# sourceURL="https://schema.3sixty.global/documents/DocumentList" */ ;
474
+ let vErrors = null;
475
+ let errors = 0;
476
+ const evaluated0 = validate58.evaluated;
477
+ if (evaluated0.dynamicProps) {
478
+ evaluated0.props = undefined;
479
+ }
480
+ if (evaluated0.dynamicItems) {
481
+ evaluated0.items = undefined;
482
+ }
483
+ if (data && typeof data == "object" && !Array.isArray(data)) {
484
+ if (data["@context"] === undefined) {
485
+ const err0 = createError(instancePath, "#/required", "required", { missingProperty: "@context" }, "must have required property '" + "@context" + "'");
486
+ vErrors = pushError(vErrors, err0);
487
+ errors++;
488
+ }
489
+ if (data.type === undefined) {
490
+ const err1 = createError(instancePath, "#/required", "required", { missingProperty: "type" }, "must have required property '" + "type" + "'");
491
+ vErrors = pushError(vErrors, err1);
492
+ errors++;
493
+ }
494
+ if (data.itemListElement === undefined) {
495
+ const err2 = createError(instancePath, "#/required", "required", { missingProperty: "itemListElement" }, "must have required property '" + "itemListElement" + "'");
496
+ vErrors = pushError(vErrors, err2);
497
+ errors++;
498
+ }
499
+ if (data["@context"] !== undefined) {
500
+ let data0 = data["@context"];
501
+ if (Array.isArray(data0)) {
502
+ if (data0.length < 3) {
503
+ const err3 = createError(instancePath + "/@context", "#/properties/%40context/minItems", "minItems", { limit: 3 }, 2);
504
+ vErrors = pushError(vErrors, err3);
505
+ errors++;
506
+ }
507
+ const len0 = data0.length;
508
+ if (len0 > 0) {
509
+ if ("https://schema.org" !== data0[0]) {
510
+ const err4 = createError(instancePath + "/@context/0", "#/properties/%40context/prefixItems/0/const", "const", { allowedValue: "https://schema.org" }, 3);
511
+ vErrors = pushError(vErrors, err4);
512
+ errors++;
513
+ }
514
+ }
515
+ if (len0 > 1) {
516
+ if ("https://schema.3sixty.global/documents/" !== data0[1]) {
517
+ const err5 = createError(instancePath + "/@context/1", "#/properties/%40context/prefixItems/1/const", "const", { allowedValue: "https://schema.3sixty.global/documents/" }, 3);
518
+ vErrors = pushError(vErrors, err5);
519
+ errors++;
520
+ }
521
+ }
522
+ if (len0 > 2) {
523
+ if ("https://schema.3sixty.global/common/" !== data0[2]) {
524
+ const err6 = createError(instancePath + "/@context/2", "#/properties/%40context/prefixItems/2/const", "const", { allowedValue: "https://schema.3sixty.global/common/" }, 3);
525
+ vErrors = pushError(vErrors, err6);
526
+ errors++;
527
+ }
528
+ }
529
+ const len1 = data0.length;
530
+ var valid2 = len1 <= 3;
531
+ if (!valid2) {
532
+ for (let i0 = 3; i0 < len1; i0++) {
533
+ const _errs6 = errors;
534
+ if (!(keyword2(data0[i0], { instancePath: instancePath + "/@context/" + i0, parentData: data0, parentDataProperty: i0, rootData, dynamicAnchors }))) {
535
+ vErrors = vErrors === null ? keyword2.errors : vErrors.concat(keyword2.errors);
536
+ errors = vErrors.length;
537
+ }
538
+ var valid2 = _errs6 === errors;
539
+ }
540
+ }
541
+ }
542
+ else {
543
+ const err7 = createError(instancePath + "/@context", "#/properties/%40context/type", "type", { type: "array" }, 4);
544
+ vErrors = pushError(vErrors, err7);
545
+ errors++;
546
+ }
547
+ }
548
+ if (data.type !== undefined) {
549
+ if ("ItemList" !== data.type) {
550
+ const err8 = createError(instancePath + "/type", "#/properties/type/const", "const", { allowedValue: "ItemList" }, 3);
551
+ vErrors = pushError(vErrors, err8);
552
+ errors++;
553
+ }
554
+ }
555
+ if (data.itemListElement !== undefined) {
556
+ let data6 = data.itemListElement;
557
+ if (Array.isArray(data6)) {
558
+ const len2 = data6.length;
559
+ for (let i1 = 0; i1 < len2; i1++) {
560
+ if (!(validate56(data6[i1], { instancePath: instancePath + "/itemListElement/" + i1, parentData: data6, parentDataProperty: i1, rootData, dynamicAnchors }))) {
561
+ vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
562
+ errors = vErrors.length;
563
+ }
564
+ }
565
+ }
566
+ else {
567
+ const err9 = createError(instancePath + "/itemListElement", "#/properties/itemListElement/type", "type", { type: "array" }, 4);
568
+ vErrors = pushError(vErrors, err9);
569
+ errors++;
570
+ }
571
+ }
572
+ if (data.edges !== undefined) {
573
+ let data8 = data.edges;
574
+ if (Array.isArray(data8)) {
575
+ const len3 = data8.length;
576
+ for (let i2 = 0; i2 < len3; i2++) {
577
+ if (typeof data8[i2] !== "string") {
578
+ const err10 = createError(instancePath + "/edges/" + i2, "#/properties/edges/items/type", "type", { type: "string" }, 0);
579
+ vErrors = pushError(vErrors, err10);
580
+ errors++;
581
+ }
582
+ }
583
+ }
584
+ else {
585
+ const err11 = createError(instancePath + "/edges", "#/properties/edges/type", "type", { type: "array" }, 4);
586
+ vErrors = pushError(vErrors, err11);
587
+ errors++;
588
+ }
589
+ }
590
+ }
591
+ else {
592
+ const err12 = createError(instancePath, "#/type", "type", { type: "object" }, 1);
593
+ vErrors = pushError(vErrors, err12);
594
+ errors++;
595
+ }
596
+ validate58.errors = vErrors;
597
+ return errors === 0;
598
+ }
599
+ validate58.evaluated = { "props": { "@context": true, "type": true, "itemListElement": true, "edges": true }, "dynamicProps": false, "dynamicItems": false };
600
+ //# sourceMappingURL=validators.js.map