@twin.org/federated-catalogue-models 0.0.1-next.10

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 (97) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/cjs/index.cjs +1212 -0
  4. package/dist/esm/index.mjs +1206 -0
  5. package/dist/types/dataTypes/federatedCatalogueDataTypes.d.ts +9 -0
  6. package/dist/types/index.d.ts +42 -0
  7. package/dist/types/models/ICatalogueBase.d.ts +25 -0
  8. package/dist/types/models/ICatalogueEntry.d.ts +8 -0
  9. package/dist/types/models/IComplianceCredential.d.ts +37 -0
  10. package/dist/types/models/IComplianceEvidence.d.ts +26 -0
  11. package/dist/types/models/IComplianceVerificationResult.d.ts +19 -0
  12. package/dist/types/models/ICredential.d.ts +21 -0
  13. package/dist/types/models/IFederatedCatalogueComponent.d.ts +89 -0
  14. package/dist/types/models/IVerificationResult.d.ts +13 -0
  15. package/dist/types/models/api/ICatalogueEntryGetRequest.d.ts +15 -0
  16. package/dist/types/models/api/ICompliancePresentationRequest.d.ts +9 -0
  17. package/dist/types/models/api/IDataResourceGetResponse.d.ts +10 -0
  18. package/dist/types/models/api/IDataResourceListRequest.d.ts +27 -0
  19. package/dist/types/models/api/IDataResourceListResponse.d.ts +10 -0
  20. package/dist/types/models/api/IDataSpaceConnectorGetResponse.d.ts +10 -0
  21. package/dist/types/models/api/IDataSpaceConnectorListRequest.d.ts +27 -0
  22. package/dist/types/models/api/IDataSpaceConnectorListResponse.d.ts +10 -0
  23. package/dist/types/models/api/IFederatedCatalogueGetRequest.d.ts +12 -0
  24. package/dist/types/models/api/IParticipantGetResponse.d.ts +10 -0
  25. package/dist/types/models/api/IParticipantListRequest.d.ts +31 -0
  26. package/dist/types/models/api/IParticipantListResponse.d.ts +10 -0
  27. package/dist/types/models/api/IServiceOfferingGetResponse.d.ts +10 -0
  28. package/dist/types/models/api/IServiceOfferingListRequest.d.ts +27 -0
  29. package/dist/types/models/api/IServiceOfferingListResponse.d.ts +10 -0
  30. package/dist/types/models/data-resource/IDataResourceCredential.d.ts +11 -0
  31. package/dist/types/models/data-resource/IDataResourceEntry.d.ts +29 -0
  32. package/dist/types/models/data-resource/IDataResourceList.d.ts +25 -0
  33. package/dist/types/models/data-space-connector/IDataSpaceConnector.d.ts +77 -0
  34. package/dist/types/models/data-space-connector/IDataSpaceConnectorCredential.d.ts +11 -0
  35. package/dist/types/models/data-space-connector/IDataSpaceConnectorEntry.d.ts +18 -0
  36. package/dist/types/models/data-space-connector/IDataSpaceConnectorList.d.ts +25 -0
  37. package/dist/types/models/federatedCatalogueContextInstances.d.ts +14 -0
  38. package/dist/types/models/federatedCatalogueContextType.d.ts +11 -0
  39. package/dist/types/models/federatedCatalogueContexts.d.ts +13 -0
  40. package/dist/types/models/federatedCatalogueEntryType.d.ts +7 -0
  41. package/dist/types/models/federatedCatalogueTypes.d.ts +53 -0
  42. package/dist/types/models/participant/IParticipantCredential.d.ts +11 -0
  43. package/dist/types/models/participant/IParticipantEntry.d.ts +12 -0
  44. package/dist/types/models/participant/IParticipantList.d.ts +25 -0
  45. package/dist/types/models/service-offering/IServiceOfferingCredential.d.ts +11 -0
  46. package/dist/types/models/service-offering/IServiceOfferingEntry.d.ts +25 -0
  47. package/dist/types/models/service-offering/IServiceOfferingList.d.ts +25 -0
  48. package/dist/types/models/verificationFailureReasons.d.ts +53 -0
  49. package/docs/changelog.md +73 -0
  50. package/docs/examples.md +1 -0
  51. package/docs/reference/classes/FederatedCatalogueContextInstances.md +29 -0
  52. package/docs/reference/classes/FederatedCatalogueDataTypes.md +25 -0
  53. package/docs/reference/index.md +58 -0
  54. package/docs/reference/interfaces/ICatalogueEntryGetRequest.md +37 -0
  55. package/docs/reference/interfaces/IComplianceCredential.md +103 -0
  56. package/docs/reference/interfaces/IComplianceEvidence.md +45 -0
  57. package/docs/reference/interfaces/ICompliancePresentationRequest.md +11 -0
  58. package/docs/reference/interfaces/IComplianceVerificationResult.md +55 -0
  59. package/docs/reference/interfaces/ICredential.md +51 -0
  60. package/docs/reference/interfaces/IDataResourceCredential.md +43 -0
  61. package/docs/reference/interfaces/IDataResourceEntry.md +131 -0
  62. package/docs/reference/interfaces/IDataResourceGetResponse.md +11 -0
  63. package/docs/reference/interfaces/IDataResourceList.md +35 -0
  64. package/docs/reference/interfaces/IDataResourceListRequest.md +55 -0
  65. package/docs/reference/interfaces/IDataResourceListResponse.md +11 -0
  66. package/docs/reference/interfaces/IDataSpaceConnector.md +130 -0
  67. package/docs/reference/interfaces/IDataSpaceConnectorCredential.md +43 -0
  68. package/docs/reference/interfaces/IDataSpaceConnectorEntry.md +224 -0
  69. package/docs/reference/interfaces/IDataSpaceConnectorGetResponse.md +11 -0
  70. package/docs/reference/interfaces/IDataSpaceConnectorList.md +35 -0
  71. package/docs/reference/interfaces/IDataSpaceConnectorListRequest.md +55 -0
  72. package/docs/reference/interfaces/IDataSpaceConnectorListResponse.md +11 -0
  73. package/docs/reference/interfaces/IFederatedCatalogueComponent.md +313 -0
  74. package/docs/reference/interfaces/IFederatedCatalogueGetRequest.md +23 -0
  75. package/docs/reference/interfaces/IParticipantCredential.md +43 -0
  76. package/docs/reference/interfaces/IParticipantEntry.md +83 -0
  77. package/docs/reference/interfaces/IParticipantGetResponse.md +11 -0
  78. package/docs/reference/interfaces/IParticipantList.md +35 -0
  79. package/docs/reference/interfaces/IParticipantListRequest.md +61 -0
  80. package/docs/reference/interfaces/IParticipantListResponse.md +11 -0
  81. package/docs/reference/interfaces/IServiceOfferingCredential.md +43 -0
  82. package/docs/reference/interfaces/IServiceOfferingEntry.md +119 -0
  83. package/docs/reference/interfaces/IServiceOfferingGetResponse.md +11 -0
  84. package/docs/reference/interfaces/IServiceOfferingList.md +35 -0
  85. package/docs/reference/interfaces/IServiceOfferingListRequest.md +55 -0
  86. package/docs/reference/interfaces/IServiceOfferingListResponse.md +11 -0
  87. package/docs/reference/interfaces/IVerificationResult.md +23 -0
  88. package/docs/reference/type-aliases/FederatedCatalogueContextType.md +5 -0
  89. package/docs/reference/type-aliases/FederatedCatalogueContexts.md +5 -0
  90. package/docs/reference/type-aliases/FederatedCatalogueEntryType.md +5 -0
  91. package/docs/reference/type-aliases/FederatedCatalogueTypes.md +5 -0
  92. package/docs/reference/type-aliases/ICatalogueEntry.md +5 -0
  93. package/docs/reference/type-aliases/VerificationFailureReasons.md +5 -0
  94. package/docs/reference/variables/FederatedCatalogueContexts.md +13 -0
  95. package/docs/reference/variables/FederatedCatalogueTypes.md +73 -0
  96. package/docs/reference/variables/VerificationFailureReasons.md +73 -0
  97. package/package.json +45 -0
@@ -0,0 +1,1212 @@
1
+ 'use strict';
2
+
3
+ var standardsGaiaX = require('@twin.org/standards-gaia-x');
4
+ var standardsSchemaOrg = require('@twin.org/standards-schema-org');
5
+ var dataCore = require('@twin.org/data-core');
6
+
7
+ // Copyright 2024 IOTA Stiftung.
8
+ // SPDX-License-Identifier: Apache-2.0.
9
+ /**
10
+ * The types concerning the Federated Catalogue.
11
+ */
12
+ // eslint-disable-next-line @typescript-eslint/naming-convention
13
+ const FederatedCatalogueTypes = {
14
+ /**
15
+ * A Credential that is compliant.
16
+ */
17
+ CompliantCredential: "CompliantCredential",
18
+ /**
19
+ * A Compliance Credential.
20
+ */
21
+ ComplianceCredential: "ComplianceCredential",
22
+ /**
23
+ * A Data Space Connector.
24
+ */
25
+ DataSpaceConnector: "DataSpaceConnector",
26
+ /**
27
+ * A Data Resource Entry.
28
+ */
29
+ DataResourceEntry: "DataResourceEntry",
30
+ /**
31
+ * A Data Space Connector List.
32
+ */
33
+ DataResourceList: "DataResourceList",
34
+ /**
35
+ * A Data Space Connector Entry.
36
+ */
37
+ DataSpaceConnectorEntry: "DataSpaceConnectorEntry",
38
+ /**
39
+ * A Data Space Connector List.
40
+ */
41
+ DataSpaceConnectorList: "DataSpaceConnectorList",
42
+ /**
43
+ * A Participant Entry.
44
+ */
45
+ ParticipantEntry: "ParticipantEntry",
46
+ /**
47
+ * A Participant List.
48
+ */
49
+ ParticipantList: "ParticipantList",
50
+ /**
51
+ * A Service Offering Entry.
52
+ */
53
+ ServiceOfferingEntry: "ServiceOfferingEntry",
54
+ /**
55
+ * A Service Offering List.
56
+ */
57
+ ServiceOfferingList: "ServiceOfferingList"
58
+ };
59
+
60
+ // Copyright 2024 IOTA Stiftung.
61
+ // SPDX-License-Identifier: Apache-2.0.
62
+ /**
63
+ * The LD context concerning the Federated Catalogue.
64
+ */
65
+ // eslint-disable-next-line @typescript-eslint/naming-convention
66
+ const FederatedCatalogueContexts = {
67
+ /**
68
+ * The context root for the federated catalogue types.
69
+ */
70
+ ContextRoot: "https://schema.twindev.org/federated-catalogue/"
71
+ };
72
+
73
+ // Copyright 2024 IOTA Stiftung.
74
+ // SPDX-License-Identifier: Apache-2.0.
75
+ /**
76
+ * The LD context instances concerning the Federated Catalogue.
77
+ */
78
+ // eslint-disable-next-line @typescript-eslint/naming-convention
79
+ class FederatedCatalogueContextInstances {
80
+ /**
81
+ * The LD Context of a list of Catalogue entries.
82
+ */
83
+ static DEFAULT_LD_CONTEXT_ENTRY_LIST = [
84
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot,
85
+ standardsGaiaX.GaiaXContexts.ContextRoot,
86
+ FederatedCatalogueContexts.ContextRoot
87
+ ];
88
+ /**
89
+ * The LD Context of a Catalogue entry.
90
+ */
91
+ static DEFAULT_LD_CONTEXT_ENTRY = this.DEFAULT_LD_CONTEXT_ENTRY_LIST;
92
+ }
93
+
94
+ // Copyright 2024 IOTA Stiftung.
95
+ // SPDX-License-Identifier: Apache-2.0.
96
+ /**
97
+ * The verification failure reasons.
98
+ */
99
+ // eslint-disable-next-line @typescript-eslint/naming-convention
100
+ const VerificationFailureReasons = {
101
+ /**
102
+ * Credential type is invalid.
103
+ */
104
+ InvalidCredentialType: "invalidCredentialType",
105
+ /**
106
+ * The issuer is invalid.
107
+ */
108
+ InvalidIssuer: "invalidIssuer",
109
+ /**
110
+ * Credential is not valid yet.
111
+ */
112
+ NotValidYet: "notValidYet",
113
+ /**
114
+ * Credential ahs expired.
115
+ */
116
+ Expired: "expired",
117
+ /**
118
+ * Credential's evidence cannot be verified.
119
+ */
120
+ EvidenceCannotBeVerified: "evidenceCannotBeVerified",
121
+ /**
122
+ * Credential has no expiration.
123
+ */
124
+ NoValidityEndPeriod: "noValidityEndPeriod",
125
+ /**
126
+ * Credential's subject is missing.
127
+ */
128
+ MissingSubject: "missingSubject",
129
+ /**
130
+ * Credential's evidences are missing.
131
+ */
132
+ MissingEvidences: "missingEvidences",
133
+ /**
134
+ * General error happened while verifying and the credential cannot be deemed as verified.
135
+ */
136
+ GeneralVerificationError: "generalVerificationError",
137
+ /**
138
+ * Credential's integrity check has failed
139
+ */
140
+ IntegrityCheckFailed: "integrityCheckFailed",
141
+ /**
142
+ * Credential's Evidence cannot be retrieved.
143
+ */
144
+ EvidenceCannotBeRetrieved: "evidenceCannotBeRetrieved"
145
+ };
146
+
147
+ var $schema$7 = "https://json-schema.org/draft/2020-12/schema";
148
+ var $id$7 = "https://schema.twindev.org/federated-catalogue/DataResourceEntry";
149
+ var description$7 = "Interface describing a Data Resource entry.";
150
+ var type$7 = "object";
151
+ var properties$7 = {
152
+ "@context": {
153
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
154
+ description: "The LD Context"
155
+ },
156
+ "@id": {
157
+ anyOf: [
158
+ {
159
+ type: "string"
160
+ },
161
+ {
162
+ type: "array",
163
+ items: false,
164
+ prefixItems: [
165
+ {
166
+ type: "string"
167
+ }
168
+ ]
169
+ }
170
+ ]
171
+ },
172
+ "@included": {
173
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
174
+ },
175
+ "@graph": {
176
+ anyOf: [
177
+ {
178
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
179
+ },
180
+ {
181
+ type: "array",
182
+ items: false,
183
+ prefixItems: [
184
+ {
185
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
186
+ }
187
+ ]
188
+ }
189
+ ]
190
+ },
191
+ "@nest": {
192
+ anyOf: [
193
+ {
194
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
195
+ },
196
+ {
197
+ type: "array",
198
+ items: false,
199
+ prefixItems: [
200
+ {
201
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ },
207
+ "@type": {
208
+ anyOf: [
209
+ {
210
+ type: "string"
211
+ },
212
+ {
213
+ type: "array",
214
+ items: false,
215
+ prefixItems: [
216
+ {
217
+ type: "string"
218
+ }
219
+ ]
220
+ }
221
+ ]
222
+ },
223
+ "@reverse": {
224
+ type: "object",
225
+ additionalProperties: {
226
+ type: "string"
227
+ }
228
+ },
229
+ "@index": {
230
+ type: "string"
231
+ },
232
+ id: {
233
+ type: "string",
234
+ description: "Subject Id"
235
+ },
236
+ type: {
237
+ type: "string",
238
+ "const": "DataResource",
239
+ description: "Subject type"
240
+ },
241
+ description: {
242
+ type: "string",
243
+ description: "Description"
244
+ },
245
+ name: {
246
+ type: "string",
247
+ description: "The Resource Name"
248
+ },
249
+ exposedThrough: {
250
+ type: "string",
251
+ description: "Overwriting exposedThrough as we only store the id of the Data Exchange Component"
252
+ },
253
+ producedBy: {
254
+ type: "string",
255
+ description: "Overwriting producedBy as we only store the identifier"
256
+ },
257
+ license: {
258
+ type: "string",
259
+ description: "Pointer (URL) to the license"
260
+ },
261
+ copyrightOwnedBy: {
262
+ type: "string",
263
+ description: "Overwriting copyrightOwnedBy as we only store the identifier"
264
+ },
265
+ resourcePolicy: {
266
+ type: "array",
267
+ items: false,
268
+ description: "Overwriting to ensure always an array is stored",
269
+ prefixItems: [
270
+ {
271
+ $ref: "https://schema.twindev.org/federated-catalogue/OdrlPolicy"
272
+ }
273
+ ]
274
+ },
275
+ issuer: {
276
+ type: "string",
277
+ description: "The trusted issuer of the compliance credential"
278
+ },
279
+ validFrom: {
280
+ type: "string",
281
+ description: "Valid from (as per W3C VC Data Model v2)"
282
+ },
283
+ validUntil: {
284
+ type: "string",
285
+ description: "Valid until (as per W3C VC Data Model v2)"
286
+ },
287
+ dateCreated: {
288
+ type: "string",
289
+ description: "The creation date."
290
+ },
291
+ evidence: {
292
+ type: "array",
293
+ items: false,
294
+ description: "The evidences concerning the data resource.",
295
+ prefixItems: [
296
+ {
297
+ type: "string"
298
+ }
299
+ ]
300
+ }
301
+ };
302
+ var required$7 = [
303
+ "@context",
304
+ "copyrightOwnedBy",
305
+ "dateCreated",
306
+ "evidence",
307
+ "exposedThrough",
308
+ "id",
309
+ "issuer",
310
+ "license",
311
+ "name",
312
+ "producedBy",
313
+ "resourcePolicy",
314
+ "type",
315
+ "validFrom",
316
+ "validUntil"
317
+ ];
318
+ var additionalProperties$7 = {
319
+ anyOf: [
320
+ {
321
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodePrimitive"
322
+ },
323
+ {
324
+ $ref: "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
325
+ },
326
+ {
327
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIndexMap"
328
+ },
329
+ {
330
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
331
+ },
332
+ {
333
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIdMap"
334
+ },
335
+ {
336
+ $ref: "https://schema.twindev.org/json-ld/JsonLdTypeMap"
337
+ },
338
+ {
339
+ type: "array"
340
+ }
341
+ ]
342
+ };
343
+ var DataResourceEntrySchema = {
344
+ $schema: $schema$7,
345
+ $id: $id$7,
346
+ description: description$7,
347
+ type: type$7,
348
+ properties: properties$7,
349
+ required: required$7,
350
+ additionalProperties: additionalProperties$7
351
+ };
352
+
353
+ var $schema$6 = "https://json-schema.org/draft/2020-12/schema";
354
+ var $id$6 = "https://schema.twindev.org/federated-catalogue/DataResourceList";
355
+ var description$6 = "Interface describing a list of Data Resource entries.";
356
+ var type$6 = "object";
357
+ var properties$6 = {
358
+ "@context": {
359
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
360
+ description: "The LD Context."
361
+ },
362
+ type: {
363
+ type: "string",
364
+ "const": "ItemList",
365
+ description: "The type"
366
+ },
367
+ itemListElement: {
368
+ type: "array",
369
+ items: false,
370
+ description: "The components of the Collection",
371
+ prefixItems: [
372
+ {
373
+ $ref: "https://schema.twindev.org/federated-catalogue/Omit%3CIDataResourceEntry%2C%22%40context%22%3E"
374
+ }
375
+ ]
376
+ },
377
+ nextItem: {
378
+ type: "string",
379
+ description: "Next item cursor."
380
+ }
381
+ };
382
+ var required$6 = [
383
+ "@context",
384
+ "type",
385
+ "itemListElement"
386
+ ];
387
+ var additionalProperties$6 = false;
388
+ var DataResourceListSchema = {
389
+ $schema: $schema$6,
390
+ $id: $id$6,
391
+ description: description$6,
392
+ type: type$6,
393
+ properties: properties$6,
394
+ required: required$6,
395
+ additionalProperties: additionalProperties$6
396
+ };
397
+
398
+ var $schema$5 = "https://json-schema.org/draft/2020-12/schema";
399
+ var $id$5 = "https://schema.twindev.org/federated-catalogue/DataSpaceConnectorEntry";
400
+ var description$5 = "Interface describing a participant.";
401
+ var type$5 = "object";
402
+ var properties$5 = {
403
+ issuer: {
404
+ type: "string",
405
+ description: "The trusted issuer of the compliance credential"
406
+ },
407
+ validFrom: {
408
+ type: "string",
409
+ description: "Valid from (as per W3C VC Data Model v2)"
410
+ },
411
+ validUntil: {
412
+ type: "string",
413
+ description: "Valid until (as per W3C VC Data Model v2)"
414
+ },
415
+ dateCreated: {
416
+ type: "string",
417
+ description: "The creation date."
418
+ },
419
+ evidence: {
420
+ type: "array",
421
+ items: false,
422
+ description: "The evidences concerning the data resource.",
423
+ prefixItems: [
424
+ {
425
+ type: "string"
426
+ }
427
+ ]
428
+ },
429
+ "@context": {
430
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
431
+ description: "The LD Context"
432
+ },
433
+ "@id": {
434
+ anyOf: [
435
+ {
436
+ type: "string"
437
+ },
438
+ {
439
+ type: "array",
440
+ items: false,
441
+ prefixItems: [
442
+ {
443
+ type: "string"
444
+ }
445
+ ]
446
+ }
447
+ ]
448
+ },
449
+ "@included": {
450
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
451
+ },
452
+ "@graph": {
453
+ anyOf: [
454
+ {
455
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
456
+ },
457
+ {
458
+ type: "array",
459
+ items: false,
460
+ prefixItems: [
461
+ {
462
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
463
+ }
464
+ ]
465
+ }
466
+ ]
467
+ },
468
+ "@nest": {
469
+ anyOf: [
470
+ {
471
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
472
+ },
473
+ {
474
+ type: "array",
475
+ items: false,
476
+ prefixItems: [
477
+ {
478
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
479
+ }
480
+ ]
481
+ }
482
+ ]
483
+ },
484
+ "@type": {
485
+ anyOf: [
486
+ {
487
+ type: "string"
488
+ },
489
+ {
490
+ type: "array",
491
+ items: false,
492
+ prefixItems: [
493
+ {
494
+ type: "string"
495
+ }
496
+ ]
497
+ }
498
+ ]
499
+ },
500
+ "@reverse": {
501
+ type: "object",
502
+ additionalProperties: {
503
+ type: "string"
504
+ }
505
+ },
506
+ "@index": {
507
+ type: "string"
508
+ },
509
+ type: {
510
+ type: "array",
511
+ minItems: 2,
512
+ items: {
513
+ type: "string"
514
+ },
515
+ description: "A Connector is a Data Exchange Component",
516
+ prefixItems: [
517
+ {
518
+ type: "string",
519
+ "const": "DataExchangeComponent"
520
+ },
521
+ {
522
+ type: "string",
523
+ "const": "DataSpaceConnector"
524
+ }
525
+ ]
526
+ },
527
+ id: {
528
+ type: "string",
529
+ description: "A unique identifier given to this Data Space Connector."
530
+ },
531
+ identity: {
532
+ type: "string",
533
+ description: "Connector's Identity that allows to know public key of this Connector."
534
+ },
535
+ maintainer: {
536
+ type: "string",
537
+ description: "Who maintains this Data Space Connector."
538
+ },
539
+ name: {
540
+ type: "string",
541
+ description: "The name of this Data Space Connector"
542
+ },
543
+ description: {
544
+ type: "string",
545
+ description: "A description of this Data Space Connector"
546
+ },
547
+ defaultEndpoint: {
548
+ $ref: "https://schema.twindev.org/federated-catalogue/Endpoint",
549
+ description: "The default endpoint of the Connector. This endpoint can be used as a base to guess other endpoints in case they are not explicitly declared."
550
+ },
551
+ subscriptionActivityEndpoint: {
552
+ $ref: "https://schema.twindev.org/federated-catalogue/Endpoint",
553
+ description: "The endpoint used for data subscription by Consumers. If the endpoint URL is a relative reference to a URL then it should be resolved using the default endpoint URL as a base URL."
554
+ },
555
+ pushActivityEndpoint: {
556
+ $ref: "https://schema.twindev.org/federated-catalogue/Endpoint",
557
+ description: "The endpoint used by Providers to push data. If the endpoint URL is a relative reference to a URL then it should be resolved using the default endpoint URL as a base URL."
558
+ },
559
+ pullDataEndpoint: {
560
+ $ref: "https://schema.twindev.org/federated-catalogue/Endpoint",
561
+ description: "The endpoint used by Consumers to pull data from. If the endpoint URL is a relative reference to a URL then it should be resolved using the default endpoint URL as a base URL."
562
+ },
563
+ offeredResource: {
564
+ type: "array",
565
+ items: false,
566
+ description: "Offered resources. Probably in the future this wll be separated in a different entry so that a Data Space Connector entry does not need to be modified when a new Data Resource is offered.",
567
+ prefixItems: [
568
+ {
569
+ type: "string"
570
+ }
571
+ ]
572
+ }
573
+ };
574
+ var required$5 = [
575
+ "@context",
576
+ "dateCreated",
577
+ "defaultEndpoint",
578
+ "evidence",
579
+ "id",
580
+ "identity",
581
+ "issuer",
582
+ "maintainer",
583
+ "offeredResource",
584
+ "pullDataEndpoint",
585
+ "pushActivityEndpoint",
586
+ "type",
587
+ "validFrom",
588
+ "validUntil"
589
+ ];
590
+ var additionalProperties$5 = {
591
+ anyOf: [
592
+ {
593
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodePrimitive"
594
+ },
595
+ {
596
+ $ref: "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
597
+ },
598
+ {
599
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIndexMap"
600
+ },
601
+ {
602
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
603
+ },
604
+ {
605
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIdMap"
606
+ },
607
+ {
608
+ $ref: "https://schema.twindev.org/json-ld/JsonLdTypeMap"
609
+ },
610
+ {
611
+ type: "array"
612
+ }
613
+ ]
614
+ };
615
+ var DataSpaceConnectorEntrySchema = {
616
+ $schema: $schema$5,
617
+ $id: $id$5,
618
+ description: description$5,
619
+ type: type$5,
620
+ properties: properties$5,
621
+ required: required$5,
622
+ additionalProperties: additionalProperties$5
623
+ };
624
+
625
+ var $schema$4 = "https://json-schema.org/draft/2020-12/schema";
626
+ var $id$4 = "https://schema.twindev.org/federated-catalogue/DataSpaceConnectorList";
627
+ var description$4 = "Interface describing a list of Data Space Connectors.";
628
+ var type$4 = "object";
629
+ var properties$4 = {
630
+ "@context": {
631
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
632
+ description: "The LD Context."
633
+ },
634
+ type: {
635
+ type: "string",
636
+ "const": "ItemList",
637
+ description: "The type"
638
+ },
639
+ itemListElement: {
640
+ type: "array",
641
+ items: false,
642
+ description: "The components of the Collection",
643
+ prefixItems: [
644
+ {
645
+ $ref: "https://schema.twindev.org/federated-catalogue/Omit%3CIDataSpaceConnectorEntry%2C%22%40context%22%3E"
646
+ }
647
+ ]
648
+ },
649
+ nextItem: {
650
+ type: "string",
651
+ description: "Next item cursor."
652
+ }
653
+ };
654
+ var required$4 = [
655
+ "@context",
656
+ "type",
657
+ "itemListElement"
658
+ ];
659
+ var additionalProperties$4 = false;
660
+ var DataSpaceConnectorListSchema = {
661
+ $schema: $schema$4,
662
+ $id: $id$4,
663
+ description: description$4,
664
+ type: type$4,
665
+ properties: properties$4,
666
+ required: required$4,
667
+ additionalProperties: additionalProperties$4
668
+ };
669
+
670
+ var $schema$3 = "https://json-schema.org/draft/2020-12/schema";
671
+ var $id$3 = "https://schema.twindev.org/federated-catalogue/ParticipantEntry";
672
+ var description$3 = "Interface describing a participant.";
673
+ var type$3 = "object";
674
+ var properties$3 = {
675
+ issuer: {
676
+ type: "string",
677
+ description: "The trusted issuer of the compliance credential"
678
+ },
679
+ validFrom: {
680
+ type: "string",
681
+ description: "Valid from (as per W3C VC Data Model v2)"
682
+ },
683
+ validUntil: {
684
+ type: "string",
685
+ description: "Valid until (as per W3C VC Data Model v2)"
686
+ },
687
+ dateCreated: {
688
+ type: "string",
689
+ description: "The creation date."
690
+ },
691
+ evidence: {
692
+ type: "array",
693
+ items: false,
694
+ description: "The evidences concerning the data resource.",
695
+ prefixItems: [
696
+ {
697
+ type: "string"
698
+ }
699
+ ]
700
+ },
701
+ "@context": {
702
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
703
+ description: "The LD Context"
704
+ },
705
+ "@id": {
706
+ anyOf: [
707
+ {
708
+ type: "string"
709
+ },
710
+ {
711
+ type: "array",
712
+ items: false,
713
+ prefixItems: [
714
+ {
715
+ type: "string"
716
+ }
717
+ ]
718
+ }
719
+ ]
720
+ },
721
+ "@included": {
722
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
723
+ },
724
+ "@graph": {
725
+ anyOf: [
726
+ {
727
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
728
+ },
729
+ {
730
+ type: "array",
731
+ items: false,
732
+ prefixItems: [
733
+ {
734
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
735
+ }
736
+ ]
737
+ }
738
+ ]
739
+ },
740
+ "@nest": {
741
+ anyOf: [
742
+ {
743
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
744
+ },
745
+ {
746
+ type: "array",
747
+ items: false,
748
+ prefixItems: [
749
+ {
750
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
751
+ }
752
+ ]
753
+ }
754
+ ]
755
+ },
756
+ "@type": {
757
+ anyOf: [
758
+ {
759
+ type: "string"
760
+ },
761
+ {
762
+ type: "array",
763
+ items: false,
764
+ prefixItems: [
765
+ {
766
+ type: "string"
767
+ }
768
+ ]
769
+ }
770
+ ]
771
+ },
772
+ "@reverse": {
773
+ type: "object",
774
+ additionalProperties: {
775
+ type: "string"
776
+ }
777
+ },
778
+ "@index": {
779
+ type: "string"
780
+ },
781
+ id: {
782
+ type: "string",
783
+ description: "The participant Id."
784
+ },
785
+ type: {
786
+ type: "string",
787
+ "const": "LegalPerson",
788
+ description: "JSON-LD type."
789
+ },
790
+ registrationNumber: {
791
+ $ref: "https://schema.twindev.org/federated-catalogue/RegistrationNumber",
792
+ description: "The legal registration number."
793
+ },
794
+ legalName: {
795
+ type: "string",
796
+ description: "The legal name."
797
+ },
798
+ legalAddress: {
799
+ $ref: "https://schema.twindev.org/federated-catalogue/Address",
800
+ description: "Legal Address"
801
+ }
802
+ };
803
+ var required$3 = [
804
+ "@context",
805
+ "dateCreated",
806
+ "evidence",
807
+ "id",
808
+ "issuer",
809
+ "legalAddress",
810
+ "legalName",
811
+ "registrationNumber",
812
+ "type",
813
+ "validFrom",
814
+ "validUntil"
815
+ ];
816
+ var additionalProperties$3 = {
817
+ anyOf: [
818
+ {
819
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodePrimitive"
820
+ },
821
+ {
822
+ $ref: "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
823
+ },
824
+ {
825
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIndexMap"
826
+ },
827
+ {
828
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
829
+ },
830
+ {
831
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIdMap"
832
+ },
833
+ {
834
+ $ref: "https://schema.twindev.org/json-ld/JsonLdTypeMap"
835
+ },
836
+ {
837
+ type: "array"
838
+ }
839
+ ]
840
+ };
841
+ var ParticipantEntrySchema = {
842
+ $schema: $schema$3,
843
+ $id: $id$3,
844
+ description: description$3,
845
+ type: type$3,
846
+ properties: properties$3,
847
+ required: required$3,
848
+ additionalProperties: additionalProperties$3
849
+ };
850
+
851
+ var $schema$2 = "https://json-schema.org/draft/2020-12/schema";
852
+ var $id$2 = "https://schema.twindev.org/federated-catalogue/ParticipantList";
853
+ var description$2 = "Interface describing a participant entry list.";
854
+ var type$2 = "object";
855
+ var properties$2 = {
856
+ "@context": {
857
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
858
+ description: "The LD Context."
859
+ },
860
+ type: {
861
+ type: "string",
862
+ "const": "ItemList",
863
+ description: "The type"
864
+ },
865
+ itemListElement: {
866
+ type: "array",
867
+ items: false,
868
+ description: "The components of the Collection",
869
+ prefixItems: [
870
+ {
871
+ $ref: "https://schema.twindev.org/federated-catalogue/Omit%3CIParticipantEntry%2C%22%40context%22%3E"
872
+ }
873
+ ]
874
+ },
875
+ nextItem: {
876
+ type: "string",
877
+ description: "Next item cursor."
878
+ }
879
+ };
880
+ var required$2 = [
881
+ "@context",
882
+ "type",
883
+ "itemListElement"
884
+ ];
885
+ var additionalProperties$2 = false;
886
+ var ParticipantListSchema = {
887
+ $schema: $schema$2,
888
+ $id: $id$2,
889
+ description: description$2,
890
+ type: type$2,
891
+ properties: properties$2,
892
+ required: required$2,
893
+ additionalProperties: additionalProperties$2
894
+ };
895
+
896
+ var $schema$1 = "https://json-schema.org/draft/2020-12/schema";
897
+ var $id$1 = "https://schema.twindev.org/federated-catalogue/ServiceOfferingEntry";
898
+ var description$1 = "Interface describing a Service Offering.";
899
+ var type$1 = "object";
900
+ var properties$1 = {
901
+ "@context": {
902
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
903
+ description: "The LD Context"
904
+ },
905
+ "@id": {
906
+ anyOf: [
907
+ {
908
+ type: "string"
909
+ },
910
+ {
911
+ type: "array",
912
+ items: false,
913
+ prefixItems: [
914
+ {
915
+ type: "string"
916
+ }
917
+ ]
918
+ }
919
+ ]
920
+ },
921
+ "@included": {
922
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
923
+ },
924
+ "@graph": {
925
+ anyOf: [
926
+ {
927
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
928
+ },
929
+ {
930
+ type: "array",
931
+ items: false,
932
+ prefixItems: [
933
+ {
934
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject"
935
+ }
936
+ ]
937
+ }
938
+ ]
939
+ },
940
+ "@nest": {
941
+ anyOf: [
942
+ {
943
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
944
+ },
945
+ {
946
+ type: "array",
947
+ items: false,
948
+ prefixItems: [
949
+ {
950
+ $ref: "https://schema.twindev.org/json-ld/JsonLdJsonObject"
951
+ }
952
+ ]
953
+ }
954
+ ]
955
+ },
956
+ "@type": {
957
+ anyOf: [
958
+ {
959
+ type: "string"
960
+ },
961
+ {
962
+ type: "array",
963
+ items: false,
964
+ prefixItems: [
965
+ {
966
+ type: "string"
967
+ }
968
+ ]
969
+ }
970
+ ]
971
+ },
972
+ "@reverse": {
973
+ type: "object",
974
+ additionalProperties: {
975
+ type: "string"
976
+ }
977
+ },
978
+ "@index": {
979
+ type: "string"
980
+ },
981
+ id: {
982
+ type: "string",
983
+ description: "Id"
984
+ },
985
+ type: {
986
+ type: "string",
987
+ "const": "ServiceOffering",
988
+ description: "Type"
989
+ },
990
+ description: {
991
+ type: "string",
992
+ description: "Description"
993
+ },
994
+ name: {
995
+ type: "string",
996
+ description: "Name"
997
+ },
998
+ providedBy: {
999
+ type: "string",
1000
+ description: "Overwrites providedBy as we only store identifier as string"
1001
+ },
1002
+ servicePolicy: {
1003
+ type: "array",
1004
+ items: false,
1005
+ description: "The service policy is always stored as an array",
1006
+ prefixItems: [
1007
+ {
1008
+ $ref: "https://schema.twindev.org/federated-catalogue/OdrlPolicy"
1009
+ }
1010
+ ]
1011
+ },
1012
+ aggregationOfResources: {
1013
+ type: "array",
1014
+ items: false,
1015
+ description: "Overwrites aggregationOfResources as we only store identifier as string",
1016
+ prefixItems: [
1017
+ {
1018
+ type: "string"
1019
+ }
1020
+ ]
1021
+ },
1022
+ endpoint: {
1023
+ $ref: "https://schema.twindev.org/federated-catalogue/Endpoint",
1024
+ description: "The endpoint"
1025
+ },
1026
+ issuer: {
1027
+ type: "string",
1028
+ description: "The trusted issuer of the compliance credential"
1029
+ },
1030
+ validFrom: {
1031
+ type: "string",
1032
+ description: "Valid from (as per W3C VC Data Model v2)"
1033
+ },
1034
+ validUntil: {
1035
+ type: "string",
1036
+ description: "Valid until (as per W3C VC Data Model v2)"
1037
+ },
1038
+ dateCreated: {
1039
+ type: "string",
1040
+ description: "The creation date."
1041
+ },
1042
+ evidence: {
1043
+ type: "array",
1044
+ items: false,
1045
+ description: "The evidences concerning the data resource.",
1046
+ prefixItems: [
1047
+ {
1048
+ type: "string"
1049
+ }
1050
+ ]
1051
+ }
1052
+ };
1053
+ var required$1 = [
1054
+ "@context",
1055
+ "dateCreated",
1056
+ "endpoint",
1057
+ "evidence",
1058
+ "id",
1059
+ "issuer",
1060
+ "name",
1061
+ "providedBy",
1062
+ "servicePolicy",
1063
+ "type",
1064
+ "validFrom",
1065
+ "validUntil"
1066
+ ];
1067
+ var additionalProperties$1 = {
1068
+ anyOf: [
1069
+ {
1070
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodePrimitive"
1071
+ },
1072
+ {
1073
+ $ref: "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
1074
+ },
1075
+ {
1076
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIndexMap"
1077
+ },
1078
+ {
1079
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
1080
+ },
1081
+ {
1082
+ $ref: "https://schema.twindev.org/json-ld/JsonLdIdMap"
1083
+ },
1084
+ {
1085
+ $ref: "https://schema.twindev.org/json-ld/JsonLdTypeMap"
1086
+ },
1087
+ {
1088
+ type: "array"
1089
+ }
1090
+ ]
1091
+ };
1092
+ var ServiceOfferingEntrySchema = {
1093
+ $schema: $schema$1,
1094
+ $id: $id$1,
1095
+ description: description$1,
1096
+ type: type$1,
1097
+ properties: properties$1,
1098
+ required: required$1,
1099
+ additionalProperties: additionalProperties$1
1100
+ };
1101
+
1102
+ var $schema = "https://json-schema.org/draft/2020-12/schema";
1103
+ var $id = "https://schema.twindev.org/federated-catalogue/ServiceOfferingList";
1104
+ var description = "Interface describing a list of Service Offering Entries.";
1105
+ var type = "object";
1106
+ var properties = {
1107
+ "@context": {
1108
+ $ref: "https://schema.twindev.org/federated-catalogue/FederatedCatalogueContextType",
1109
+ description: "The LD Context."
1110
+ },
1111
+ type: {
1112
+ type: "string",
1113
+ "const": "ItemList",
1114
+ description: "The type"
1115
+ },
1116
+ itemListElement: {
1117
+ type: "array",
1118
+ items: false,
1119
+ description: "The components of the Collection",
1120
+ prefixItems: [
1121
+ {
1122
+ $ref: "https://schema.twindev.org/federated-catalogue/Omit%3CIServiceOfferingEntry%2C%22%40context%22%3E"
1123
+ }
1124
+ ]
1125
+ },
1126
+ nextItem: {
1127
+ type: "string",
1128
+ description: "Next item cursor."
1129
+ }
1130
+ };
1131
+ var required = [
1132
+ "@context",
1133
+ "type",
1134
+ "itemListElement"
1135
+ ];
1136
+ var additionalProperties = false;
1137
+ var ServiceOfferingListSchema = {
1138
+ $schema: $schema,
1139
+ $id: $id,
1140
+ description: description,
1141
+ type: type,
1142
+ properties: properties,
1143
+ required: required,
1144
+ additionalProperties: additionalProperties
1145
+ };
1146
+
1147
+ // Copyright 2024 IOTA Stiftung.
1148
+ // SPDX-License-Identifier: Apache-2.0.
1149
+ /**
1150
+ * Handle all the data types for federated catalogue.
1151
+ */
1152
+ class FederatedCatalogueDataTypes {
1153
+ /**
1154
+ * Register all the data types.
1155
+ */
1156
+ static registerTypes() {
1157
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.DataResourceEntry}`, () => ({
1158
+ context: FederatedCatalogueContexts.ContextRoot,
1159
+ type: FederatedCatalogueTypes.DataResourceEntry,
1160
+ defaultValue: {},
1161
+ jsonSchema: async () => DataResourceEntrySchema
1162
+ }));
1163
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.DataResourceList}`, () => ({
1164
+ context: FederatedCatalogueContexts.ContextRoot,
1165
+ type: FederatedCatalogueTypes.DataResourceList,
1166
+ defaultValue: {},
1167
+ jsonSchema: async () => DataResourceListSchema
1168
+ }));
1169
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.DataSpaceConnectorEntry}`, () => ({
1170
+ context: FederatedCatalogueContexts.ContextRoot,
1171
+ type: FederatedCatalogueTypes.DataSpaceConnectorEntry,
1172
+ defaultValue: {},
1173
+ jsonSchema: async () => DataSpaceConnectorEntrySchema
1174
+ }));
1175
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.DataSpaceConnectorList}`, () => ({
1176
+ context: FederatedCatalogueContexts.ContextRoot,
1177
+ type: FederatedCatalogueTypes.DataSpaceConnectorList,
1178
+ defaultValue: {},
1179
+ jsonSchema: async () => DataSpaceConnectorListSchema
1180
+ }));
1181
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.ParticipantEntry}`, () => ({
1182
+ context: FederatedCatalogueContexts.ContextRoot,
1183
+ type: FederatedCatalogueTypes.ParticipantEntry,
1184
+ defaultValue: {},
1185
+ jsonSchema: async () => ParticipantEntrySchema
1186
+ }));
1187
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.ParticipantList}`, () => ({
1188
+ context: FederatedCatalogueContexts.ContextRoot,
1189
+ type: FederatedCatalogueTypes.ParticipantList,
1190
+ defaultValue: {},
1191
+ jsonSchema: async () => ParticipantListSchema
1192
+ }));
1193
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.ServiceOfferingEntry}`, () => ({
1194
+ context: FederatedCatalogueContexts.ContextRoot,
1195
+ type: FederatedCatalogueTypes.ServiceOfferingEntry,
1196
+ defaultValue: {},
1197
+ jsonSchema: async () => ServiceOfferingEntrySchema
1198
+ }));
1199
+ dataCore.DataTypeHandlerFactory.register(`${FederatedCatalogueContexts.ContextRoot}${FederatedCatalogueTypes.ServiceOfferingList}`, () => ({
1200
+ context: FederatedCatalogueContexts.ContextRoot,
1201
+ type: FederatedCatalogueTypes.ServiceOfferingList,
1202
+ defaultValue: {},
1203
+ jsonSchema: async () => ServiceOfferingListSchema
1204
+ }));
1205
+ }
1206
+ }
1207
+
1208
+ exports.FederatedCatalogueContextInstances = FederatedCatalogueContextInstances;
1209
+ exports.FederatedCatalogueContexts = FederatedCatalogueContexts;
1210
+ exports.FederatedCatalogueDataTypes = FederatedCatalogueDataTypes;
1211
+ exports.FederatedCatalogueTypes = FederatedCatalogueTypes;
1212
+ exports.VerificationFailureReasons = VerificationFailureReasons;