@3sixty/federated-catalogue-service 0.20.0-next.0 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../../src/entities/dataset.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;;GAIG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAO;IACnB;;;OAGG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,OAAO,CAAU;IAExB;;OAEG;IAEI,UAAU,CAA4B;IAE7C;;OAEG;IAEI,OAAO,CAAyB;IAEvC;;OAEG;IAEI,eAAe,CAAiC;IAEvD;;OAEG;IAEI,qBAAqB,CAAuC;IAEnE;;OAEG;IAEI,oBAAoB,CAAsC;IAEjE;;OAEG;IAEI,gBAAgB,CAAkC;IAEzD;;OAEG;IAEI,kBAAkB,CAAoC;IAE7D;;OAEG;IAEI,kBAAkB,CAAoC;IAE7D;;OAEG;IAEI,mBAAmB,CAAqC;IAE/D;;OAEG;IAEI,iBAAiB,CAAmC;IAE3D;;OAEG;IAEI,sBAAsB,CAAwC;IAErE;;OAEG;IAEI,iBAAiB,CAAmC;IAE3D;;OAEG;IAEI,gBAAgB,CAAkC;IAEzD;;OAEG;IAEI,oBAAoB,CAAsC;IAEjE;;OAEG;IAEI,cAAc,CAAgC;IAErD;;OAEG;IAEI,mBAAmB,CAAqC;IAE/D;;OAEG;IAEI,cAAc,CAAgC;IAErD;;OAEG;IAEI,YAAY,CAA8B;IAEjD;;OAEG;IAEI,kBAAkB,CAAoC;IAE7D;;OAEG;IAEI,wBAAwB,CAA0C;IAEzE;;OAEG;IAEI,gBAAgB,CAAkC;IAEzD;;OAEG;IAEI,mBAAmB,CAAqC;IAE/D;;OAEG;IAEI,4BAA4B,CAA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I,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACY;AAMlD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACkB;AAMxD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACoB;AAM1E;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAMhD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACc;AAMpD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DAC4C;AAMlF;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACgB;AAMtD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC8B;AAMpE;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACsB;AA1LvD,OAAO;IADnB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,OAAO,CA2LnB","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\n\n/**\n * Class describing a DCAT dataset for entity storage.\n * This wrapper enables efficient database indexing and querying while preserving\n * the full IDcatDataset JSON-LD structure.\n */\n@entity({ version: 1 })\nexport class Dataset {\n\t/**\n\t * The unique identifier for the dataset (mapped from JSON-LD identifier).\n\t * Bounded so storage backends index it in full rather than by prefix.\n\t */\n\t@property({ type: \"string\", isPrimary: true, maxLength: 255 })\n\tpublic id!: string;\n\n\t/**\n\t * The owner of the dataset.\n\t */\n\t@property({ type: \"string\", maxLength: 255, isSecondary: true })\n\tpublic ownerId!: string;\n\n\t/**\n\t * The JSON-LD context for the dataset.\n\t */\n\t@property({ type: \"object\" })\n\tpublic \"@context\"!: IDcatDataset[\"@context\"];\n\n\t/**\n\t * The type of the resource (typically \"Dataset\").\n\t */\n\t@property({ type: \"string\", maxLength: 128 })\n\tpublic \"@type\"!: IDcatDataset[\"@type\"];\n\n\t/**\n\t * A name given to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:title\"?: IDcatDataset[\"dcterms:title\"];\n\n\t/**\n\t * A free-text account of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:description\"?: IDcatDataset[\"dcterms:description\"];\n\n\t/**\n\t * A unique identifier of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:identifier\"?: IDcatDataset[\"dcterms:identifier\"];\n\n\t/**\n\t * Date of formal issuance (publication) of the resource.\n\t */\n\t@property({ type: \"string\", format: \"date-time\", optional: true })\n\tpublic \"dcterms:issued\"?: IDcatDataset[\"dcterms:issued\"];\n\n\t/**\n\t * Most recent date on which the resource was changed, updated or modified.\n\t */\n\t@property({ type: \"string\", format: \"date-time\", optional: true })\n\tpublic \"dcterms:modified\"?: IDcatDataset[\"dcterms:modified\"];\n\n\t/**\n\t * A language of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:language\"?: IDcatDataset[\"dcterms:language\"];\n\n\t/**\n\t * An entity responsible for making the resource available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:publisher\"?: IDcatDataset[\"dcterms:publisher\"];\n\n\t/**\n\t * An entity responsible for producing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:creator\"?: IDcatDataset[\"dcterms:creator\"];\n\n\t/**\n\t * Information about who can access the resource or an indication of its security status.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:accessRights\"?: IDcatDataset[\"dcterms:accessRights\"];\n\n\t/**\n\t * A legal document under which the resource is made available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:license\"?: IDcatDataset[\"dcterms:license\"];\n\n\t/**\n\t * Information about rights held in and over the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:rights\"?: IDcatDataset[\"dcterms:rights\"];\n\n\t/**\n\t * An established standard to which the resource conforms.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:conformsTo\"?: IDcatDataset[\"dcterms:conformsTo\"];\n\n\t/**\n\t * The nature or genre of the resource.\n\t */\n\t@property({ type: \"string\", maxLength: 255, optional: true })\n\tpublic \"dcterms:type\"?: IDcatDataset[\"dcterms:type\"];\n\n\t/**\n\t * Relevant contact information for the catalogued resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:contactPoint\"?: IDcatDataset[\"dcat:contactPoint\"];\n\n\t/**\n\t * A keyword or tag describing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:keyword\"?: IDcatDataset[\"dcat:keyword\"];\n\n\t/**\n\t * A main category of the resource. A resource can have multiple themes.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:theme\"?: IDcatDataset[\"dcat:theme\"];\n\n\t/**\n\t * A Web page that can be navigated to gain access to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:landingPage\"?: IDcatDataset[\"dcat:landingPage\"];\n\n\t/**\n\t * Link to a description of a relationship with another resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:qualifiedRelation\"?: IDcatDataset[\"dcat:qualifiedRelation\"];\n\n\t/**\n\t * An ODRL conformant policy expressing the rights associated with the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"odrl:hasPolicy\"?: IDcatDataset[\"odrl:hasPolicy\"];\n\n\t/**\n\t * An available distribution of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:distribution\"?: IDcatDataset[\"dcat:distribution\"];\n\n\t/**\n\t * The frequency at which the dataset is published.\n\t */\n\t@property({ type: \"string\", maxLength: 128, optional: true })\n\tpublic \"dcterms:accrualPeriodicity\"?: IDcatDataset[\"dcterms:accrualPeriodicity\"];\n\n\t/**\n\t * A dataset series of which the dataset is part.\n\t */\n\t@property({ type: \"string\", maxLength: 255, optional: true })\n\tpublic \"dcat:inSeries\"?: IDcatDataset[\"dcat:inSeries\"];\n\n\t/**\n\t * The geographical area covered by the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:spatial\"?: IDcatDataset[\"dcterms:spatial\"];\n\n\t/**\n\t * Minimum spatial separation resolvable in a dataset, measured in meters.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:spatialResolutionInMeters\"?: IDcatDataset[\"dcat:spatialResolutionInMeters\"];\n\n\t/**\n\t * The temporal period that the dataset covers.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:temporal\"?: IDcatDataset[\"dcterms:temporal\"];\n\n\t/**\n\t * Minimum time period resolvable in the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:temporalResolution\"?: IDcatDataset[\"dcat:temporalResolution\"];\n\n\t/**\n\t * An activity that generated, or provides the business context for, the creation of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"prov:wasGeneratedBy\"?: IDcatDataset[\"prov:wasGeneratedBy\"];\n}\n"]}
1
+ {"version":3,"file":"dataset.js","sources":["../../../src/entities/dataset.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,Q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B;AAM1E;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAMhD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACc;AAMpD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DAC4C;AAMlF;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACgB;AAMtD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC8B;AAMpE;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACsB;AA1LvD,OAAO;IADnB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,OAAO,CA2LnB","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\n\n/**\n * Class describing a DCAT dataset for entity storage.\n * This wrapper enables efficient database indexing and querying while preserving\n * the full IDcatDataset JSON-LD structure.\n */\n@entity({ version: 1 })\nexport class Dataset {\n\t/**\n\t * The unique identifier for the dataset (mapped from JSON-LD identifier).\n\t * Bounded so storage backends index it in full rather than by prefix.\n\t */\n\t@property({ type: \"string\", isPrimary: true, maxLength: 255 })\n\tpublic id!: string;\n\n\t/**\n\t * The owner of the dataset.\n\t */\n\t@property({ type: \"string\", maxLength: 255, isSecondary: true })\n\tpublic ownerId!: string;\n\n\t/**\n\t * The JSON-LD context for the dataset.\n\t */\n\t@property({ type: \"object\" })\n\tpublic \"@context\"!: IDcatDataset[\"@context\"];\n\n\t/**\n\t * The type of the resource (typically \"Dataset\").\n\t */\n\t@property({ type: \"string\", maxLength: 128 })\n\tpublic \"@type\"!: IDcatDataset[\"@type\"];\n\n\t/**\n\t * A name given to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:title\"?: IDcatDataset[\"dcterms:title\"];\n\n\t/**\n\t * A free-text account of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:description\"?: IDcatDataset[\"dcterms:description\"];\n\n\t/**\n\t * A unique identifier of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:identifier\"?: IDcatDataset[\"dcterms:identifier\"];\n\n\t/**\n\t * Date of formal issuance (publication) of the resource.\n\t */\n\t@property({ type: \"string\", format: \"date-time\", optional: true })\n\tpublic \"dcterms:issued\"?: IDcatDataset[\"dcterms:issued\"];\n\n\t/**\n\t * Most recent date on which the resource was changed, updated or modified.\n\t */\n\t@property({ type: \"string\", format: \"date-time\", optional: true })\n\tpublic \"dcterms:modified\"?: IDcatDataset[\"dcterms:modified\"];\n\n\t/**\n\t * A language of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:language\"?: IDcatDataset[\"dcterms:language\"];\n\n\t/**\n\t * An entity responsible for making the resource available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:publisher\"?: IDcatDataset[\"dcterms:publisher\"];\n\n\t/**\n\t * An entity responsible for producing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:creator\"?: IDcatDataset[\"dcterms:creator\"];\n\n\t/**\n\t * Information about who can access the resource or an indication of its security status.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:accessRights\"?: IDcatDataset[\"dcterms:accessRights\"];\n\n\t/**\n\t * A legal document under which the resource is made available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:license\"?: IDcatDataset[\"dcterms:license\"];\n\n\t/**\n\t * Information about rights held in and over the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:rights\"?: IDcatDataset[\"dcterms:rights\"];\n\n\t/**\n\t * An established standard to which the resource conforms.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:conformsTo\"?: IDcatDataset[\"dcterms:conformsTo\"];\n\n\t/**\n\t * The nature or genre of the resource.\n\t */\n\t@property({ type: \"string\", maxLength: 255, optional: true })\n\tpublic \"dcterms:type\"?: IDcatDataset[\"dcterms:type\"];\n\n\t/**\n\t * Relevant contact information for the catalogued resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:contactPoint\"?: IDcatDataset[\"dcat:contactPoint\"];\n\n\t/**\n\t * A keyword or tag describing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:keyword\"?: IDcatDataset[\"dcat:keyword\"];\n\n\t/**\n\t * A main category of the resource. A resource can have multiple themes.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:theme\"?: IDcatDataset[\"dcat:theme\"];\n\n\t/**\n\t * A Web page that can be navigated to gain access to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:landingPage\"?: IDcatDataset[\"dcat:landingPage\"];\n\n\t/**\n\t * Link to a description of a relationship with another resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:qualifiedRelation\"?: IDcatDataset[\"dcat:qualifiedRelation\"];\n\n\t/**\n\t * An ODRL conformant policy expressing the rights associated with the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"odrl:hasPolicy\"?: IDcatDataset[\"odrl:hasPolicy\"];\n\n\t/**\n\t * An available distribution of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:distribution\"?: IDcatDataset[\"dcat:distribution\"];\n\n\t/**\n\t * The frequency at which the dataset is published.\n\t */\n\t@property({ type: \"string\", maxLength: 128, optional: true })\n\tpublic \"dcterms:accrualPeriodicity\"?: IDcatDataset[\"dcterms:accrualPeriodicity\"];\n\n\t/**\n\t * A dataset series of which the dataset is part.\n\t */\n\t@property({ type: \"string\", maxLength: 255, optional: true })\n\tpublic \"dcat:inSeries\"?: IDcatDataset[\"dcat:inSeries\"];\n\n\t/**\n\t * The geographical area covered by the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:spatial\"?: IDcatDataset[\"dcterms:spatial\"];\n\n\t/**\n\t * Minimum spatial separation resolvable in a dataset, measured in meters.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:spatialResolutionInMeters\"?: IDcatDataset[\"dcat:spatialResolutionInMeters\"];\n\n\t/**\n\t * The temporal period that the dataset covers.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:temporal\"?: IDcatDataset[\"dcterms:temporal\"];\n\n\t/**\n\t * Minimum time period resolvable in the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:temporalResolution\"?: IDcatDataset[\"dcat:temporalResolution\"];\n\n\t/**\n\t * An activity that generated, or provides the business context for, the creation of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"prov:wasGeneratedBy\"?: IDcatDataset[\"prov:wasGeneratedBy\"];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"datasetV0.js","sourceRoot":"","sources":["../../../src/entities/datasetV0.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;;GAIG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAS;IACrB;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,OAAO,CAAU;IAExB;;OAEG;IAEI,UAAU,CAA4B;IAE7C;;OAEG;IAEI,OAAO,CAAyB;IAEvC;;OAEG;IAEI,eAAe,CAA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AAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAC8B;AAMpE;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACsB;AAzLvD,SAAS;IADrB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,SAAS,CA0LrB","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\n\n/**\n * Class describing a DCAT dataset for entity storage, version 0.\n * This wrapper enables efficient database indexing and querying while preserving\n * the full IDcatDataset JSON-LD structure.\n */\n@entity({ version: 0 })\nexport class DatasetV0 {\n\t/**\n\t * The unique identifier for the dataset (mapped from JSON-LD identifier).\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic id!: string;\n\n\t/**\n\t * The owner of the dataset.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic ownerId!: string;\n\n\t/**\n\t * The JSON-LD context for the dataset.\n\t */\n\t@property({ type: \"object\" })\n\tpublic \"@context\"!: IDcatDataset[\"@context\"];\n\n\t/**\n\t * The type of the resource (typically \"Dataset\").\n\t */\n\t@property({ type: \"string\" })\n\tpublic \"@type\"!: IDcatDataset[\"@type\"];\n\n\t/**\n\t * A name given to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:title\"?: IDcatDataset[\"dcterms:title\"];\n\n\t/**\n\t * A free-text account of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:description\"?: IDcatDataset[\"dcterms:description\"];\n\n\t/**\n\t * A unique identifier of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:identifier\"?: IDcatDataset[\"dcterms:identifier\"];\n\n\t/**\n\t * Date of formal issuance (publication) of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:issued\"?: IDcatDataset[\"dcterms:issued\"];\n\n\t/**\n\t * Most recent date on which the resource was changed, updated or modified.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:modified\"?: IDcatDataset[\"dcterms:modified\"];\n\n\t/**\n\t * A language of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:language\"?: IDcatDataset[\"dcterms:language\"];\n\n\t/**\n\t * An entity responsible for making the resource available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:publisher\"?: IDcatDataset[\"dcterms:publisher\"];\n\n\t/**\n\t * An entity responsible for producing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:creator\"?: IDcatDataset[\"dcterms:creator\"];\n\n\t/**\n\t * Information about who can access the resource or an indication of its security status.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:accessRights\"?: IDcatDataset[\"dcterms:accessRights\"];\n\n\t/**\n\t * A legal document under which the resource is made available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:license\"?: IDcatDataset[\"dcterms:license\"];\n\n\t/**\n\t * Information about rights held in and over the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:rights\"?: IDcatDataset[\"dcterms:rights\"];\n\n\t/**\n\t * An established standard to which the resource conforms.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:conformsTo\"?: IDcatDataset[\"dcterms:conformsTo\"];\n\n\t/**\n\t * The nature or genre of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:type\"?: IDcatDataset[\"dcterms:type\"];\n\n\t/**\n\t * Relevant contact information for the catalogued resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:contactPoint\"?: IDcatDataset[\"dcat:contactPoint\"];\n\n\t/**\n\t * A keyword or tag describing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:keyword\"?: IDcatDataset[\"dcat:keyword\"];\n\n\t/**\n\t * A main category of the resource. A resource can have multiple themes.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:theme\"?: IDcatDataset[\"dcat:theme\"];\n\n\t/**\n\t * A Web page that can be navigated to gain access to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:landingPage\"?: IDcatDataset[\"dcat:landingPage\"];\n\n\t/**\n\t * Link to a description of a relationship with another resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:qualifiedRelation\"?: IDcatDataset[\"dcat:qualifiedRelation\"];\n\n\t/**\n\t * An ODRL conformant policy expressing the rights associated with the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"odrl:hasPolicy\"?: IDcatDataset[\"odrl:hasPolicy\"];\n\n\t/**\n\t * An available distribution of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:distribution\"?: IDcatDataset[\"dcat:distribution\"];\n\n\t/**\n\t * The frequency at which the dataset is published.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:accrualPeriodicity\"?: IDcatDataset[\"dcterms:accrualPeriodicity\"];\n\n\t/**\n\t * A dataset series of which the dataset is part.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcat:inSeries\"?: IDcatDataset[\"dcat:inSeries\"];\n\n\t/**\n\t * The geographical area covered by the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:spatial\"?: IDcatDataset[\"dcterms:spatial\"];\n\n\t/**\n\t * Minimum spatial separation resolvable in a dataset, measured in meters.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:spatialResolutionInMeters\"?: IDcatDataset[\"dcat:spatialResolutionInMeters\"];\n\n\t/**\n\t * The temporal period that the dataset covers.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:temporal\"?: IDcatDataset[\"dcterms:temporal\"];\n\n\t/**\n\t * Minimum time period resolvable in the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:temporalResolution\"?: IDcatDataset[\"dcat:temporalResolution\"];\n\n\t/**\n\t * An activity that generated, or provides the business context for, the creation of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"prov:wasGeneratedBy\"?: IDcatDataset[\"prov:wasGeneratedBy\"];\n}\n"]}
1
+ {"version":3,"file":"datasetV0.js","sources":["../../../src/entities/datasetV0.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;;GAIG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAS;IACrB;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,OAAO,CAAU;IAExB;;OAEG;IAEI,UAAU,CAA4B;IAE7C;;OAEG;IAEI,OAAO,CAAyB;IAEvC;;OAEG;IAEI,eAAe,CAAiC;IAEvD;;OAEG;IAEI,qBAAqB,CAAuC;IAEnE;;OAEG;IAEI,oBAAoB,CAAsC;IAEjE;;OAEG;IAEI,gBAAgB,CAAkC;IAEzD;;OAEG;IAEI,kBAAkB,CAAoC;IAE7D;;OAEG;IAEI,kBAAkB,CAAoC;IAE7D;;OAEG;IAEI,mBAAmB,CAAqC;IAE/D;;OAEG;IAEI,iBAAiB,CAAmC;IAE3D;;OAEG;IAEI,sBAAsB,CAAwC;IAErE;;OAEG;IAEI,iBAAiB,CAAmC;IAE3D;;OAEG;IAEI,gBAAgB,CAAkC;IAEzD;;OAEG;IAEI,oBAAoB,CAAsC;IAEjE;;OAEG;IAEI,cAAc,CAAgC;IAErD;;OAEG;IAEI,mBAAmB,CAAqC;IAE/D;;OAEG;IAEI,cAAc,CAAgC;IAErD;;OAEG;IAEI,YAAY,CAA8B;IAEjD;;OAEG;IAEI,kBAAkB,C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,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACY;AAMlD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACkB;AAMxD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACoC;AAM1E;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACU;AAMhD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACc;AAMpD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEAC4C;AAMlF;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACgB;AAMtD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAC8B;AAMpE;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACsB;AAzLvD,SAAS;IADrB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,SAAS,CA0LrB","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@3sixty/entity\";\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\n\n/**\n * Class describing a DCAT dataset for entity storage, version 0.\n * This wrapper enables efficient database indexing and querying while preserving\n * the full IDcatDataset JSON-LD structure.\n */\n@entity({ version: 0 })\nexport class DatasetV0 {\n\t/**\n\t * The unique identifier for the dataset (mapped from JSON-LD identifier).\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic id!: string;\n\n\t/**\n\t * The owner of the dataset.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic ownerId!: string;\n\n\t/**\n\t * The JSON-LD context for the dataset.\n\t */\n\t@property({ type: \"object\" })\n\tpublic \"@context\"!: IDcatDataset[\"@context\"];\n\n\t/**\n\t * The type of the resource (typically \"Dataset\").\n\t */\n\t@property({ type: \"string\" })\n\tpublic \"@type\"!: IDcatDataset[\"@type\"];\n\n\t/**\n\t * A name given to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:title\"?: IDcatDataset[\"dcterms:title\"];\n\n\t/**\n\t * A free-text account of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:description\"?: IDcatDataset[\"dcterms:description\"];\n\n\t/**\n\t * A unique identifier of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:identifier\"?: IDcatDataset[\"dcterms:identifier\"];\n\n\t/**\n\t * Date of formal issuance (publication) of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:issued\"?: IDcatDataset[\"dcterms:issued\"];\n\n\t/**\n\t * Most recent date on which the resource was changed, updated or modified.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:modified\"?: IDcatDataset[\"dcterms:modified\"];\n\n\t/**\n\t * A language of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:language\"?: IDcatDataset[\"dcterms:language\"];\n\n\t/**\n\t * An entity responsible for making the resource available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:publisher\"?: IDcatDataset[\"dcterms:publisher\"];\n\n\t/**\n\t * An entity responsible for producing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:creator\"?: IDcatDataset[\"dcterms:creator\"];\n\n\t/**\n\t * Information about who can access the resource or an indication of its security status.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:accessRights\"?: IDcatDataset[\"dcterms:accessRights\"];\n\n\t/**\n\t * A legal document under which the resource is made available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:license\"?: IDcatDataset[\"dcterms:license\"];\n\n\t/**\n\t * Information about rights held in and over the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:rights\"?: IDcatDataset[\"dcterms:rights\"];\n\n\t/**\n\t * An established standard to which the resource conforms.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:conformsTo\"?: IDcatDataset[\"dcterms:conformsTo\"];\n\n\t/**\n\t * The nature or genre of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:type\"?: IDcatDataset[\"dcterms:type\"];\n\n\t/**\n\t * Relevant contact information for the catalogued resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:contactPoint\"?: IDcatDataset[\"dcat:contactPoint\"];\n\n\t/**\n\t * A keyword or tag describing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:keyword\"?: IDcatDataset[\"dcat:keyword\"];\n\n\t/**\n\t * A main category of the resource. A resource can have multiple themes.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:theme\"?: IDcatDataset[\"dcat:theme\"];\n\n\t/**\n\t * A Web page that can be navigated to gain access to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:landingPage\"?: IDcatDataset[\"dcat:landingPage\"];\n\n\t/**\n\t * Link to a description of a relationship with another resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:qualifiedRelation\"?: IDcatDataset[\"dcat:qualifiedRelation\"];\n\n\t/**\n\t * An ODRL conformant policy expressing the rights associated with the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"odrl:hasPolicy\"?: IDcatDataset[\"odrl:hasPolicy\"];\n\n\t/**\n\t * An available distribution of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:distribution\"?: IDcatDataset[\"dcat:distribution\"];\n\n\t/**\n\t * The frequency at which the dataset is published.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:accrualPeriodicity\"?: IDcatDataset[\"dcterms:accrualPeriodicity\"];\n\n\t/**\n\t * A dataset series of which the dataset is part.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcat:inSeries\"?: IDcatDataset[\"dcat:inSeries\"];\n\n\t/**\n\t * The geographical area covered by the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:spatial\"?: IDcatDataset[\"dcterms:spatial\"];\n\n\t/**\n\t * Minimum spatial separation resolvable in a dataset, measured in meters.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:spatialResolutionInMeters\"?: IDcatDataset[\"dcat:spatialResolutionInMeters\"];\n\n\t/**\n\t * The temporal period that the dataset covers.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:temporal\"?: IDcatDataset[\"dcterms:temporal\"];\n\n\t/**\n\t * Minimum time period resolvable in the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:temporalResolution\"?: IDcatDataset[\"dcat:temporalResolution\"];\n\n\t/**\n\t * An activity that generated, or provides the business context for, the creation of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"prov:wasGeneratedBy\"?: IDcatDataset[\"prov:wasGeneratedBy\"];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"federatedCatalogueRoutes.js","sourceRoot":"","sources":["../../src/federatedCatalogueRoutes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,O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c,CAAC,UAAU;YACjF,IAAI,EAAE,YAAY;SAClB,CAAC;IACH,CAAC;AACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tHttpContextIdKeys,\n\tHttpHeaderHelper,\n\tHttpUrlHelper,\n\ttype IHttpRequestContext,\n\ttype IRestRoute,\n\ttype ITag\n} from \"@3sixty/api-models\";\nimport { ContextIdStore } from \"@3sixty/context\";\nimport { Coerce, ComponentFactory, Guards, Is } from \"@3sixty/core\";\nimport type {\n\tICatalogRequestRequest,\n\tICatalogRequestResponse,\n\tIDatasetGetRequest,\n\tIDatasetGetResponse,\n\tIDatasetRemoveRequest,\n\tIDatasetRemoveResponse,\n\tIDatasetSetRequest,\n\tIDatasetSetResponse,\n\tIFederatedCatalogueComponent\n} from \"@3sixty/federated-catalogue-models\";\nimport { nameof } from \"@3sixty/nameof\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { DcatClasses, type DcatContextType } from \"@3sixty/standards-w3c-dcat\";\nimport { OdrlPolicyType } from \"@3sixty/standards-w3c-odrl\";\nimport { HeaderHelper, HeaderTypes, HttpStatusCode, type IHttpHeaders } from \"@3sixty/web\";\nimport { transformErrorToStatusCode, transformToCatalogError } from \"./utils/catalogErrorUtils.js\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"federatedCatalogueRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsFederatedCatalogue: ITag[] = [\n\t{\n\t\tname: \"Federated Catalogue\",\n\t\tdescription:\n\t\t\t\"Service providing Dataspace Protocol-compliant catalogue endpoints for dataset discovery and query.\"\n\t}\n];\n\n/**\n * The REST routes for federated catalogue.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesFederatedCatalogue(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst catalogRequestRoute: IRestRoute<ICatalogRequestRequest, ICatalogRequestResponse> = {\n\t\toperationId: \"catalogRequest\",\n\t\tsummary: \"Query the federated catalogue for datasets\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/request`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tcatalogRequest(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ICatalogRequestRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogRequestMessage,\n\t\t\t\t\t\t\tfilter: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestNoFilterExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogRequestMessage\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICatalogRequestResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"catalogRequestResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\t\"@id\":\n\t\t\t\t\t\t\t\t\t\"urn:x-catalog:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2\",\n\t\t\t\t\t\t\t\t\"@type\": \"Catalog\",\n\t\t\t\t\t\t\t\tparticipantId: \"did:example:node-identity-123\",\n\t\t\t\t\t\t\t\tdataset: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\t\t\"@type\": \"Dataset\",\n\t\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\",\n\t\t\t\t\t\t\t\t\t\thasPolicy: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:policy-456\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Offer,\n\t\t\t\t\t\t\t\t\t\t\t\tassigner: \"did:example:data-provider-789\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tdistribution: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:distribution-789\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": \"Distribution\",\n\t\t\t\t\t\t\t\t\t\t\t\tformat: \"application/json\",\n\t\t\t\t\t\t\t\t\t\t\t\taccessService: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:access-service-321\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": \"DataService\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tendpointURL: \"https://example.com/data-access\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst getDatasetRoute: IRestRoute<IDatasetGetRequest, IDatasetGetResponse> = {\n\t\toperationId: \"getDataset\",\n\t\tsummary: \"Retrieve a specific dataset by ID\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/datasets/:datasetId`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tgetDataset(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IDatasetGetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"getDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tdatasetId: \"urn:uuid:dataset-123\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IDatasetGetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"getDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": DataspaceProtocolContexts.Context as unknown as DcatContextType,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst setDatasetRoute: IRestRoute<IDatasetSetRequest, IDatasetSetResponse> = {\n\t\toperationId: \"setDataset\",\n\t\tsummary: \"Insert or update a dataset in the catalogue\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/datasets`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tsetDataset(httpRequestContext, componentName, request, baseRouteName),\n\t\trequestType: {\n\t\t\ttype: nameof<IDatasetSetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"setDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": DataspaceProtocolContexts.Context as unknown as DcatContextType,\n\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IDatasetSetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"setDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.noContent\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst removeDatasetRoute: IRestRoute<IDatasetRemoveRequest, IDatasetRemoveResponse> = {\n\t\toperationId: \"removeDataset\",\n\t\tsummary: \"Remove a dataset from the catalogue by ID\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/datasets/:datasetId`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tremoveDataset(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IDatasetRemoveRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"removeDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tdatasetId: \"urn:uuid:dataset-123\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IDatasetRemoveResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"removeDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.noContent\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\treturn [catalogRequestRoute, getDatasetRoute, setDatasetRoute, removeDatasetRoute];\n}\n\n/**\n * Handle the catalog request operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the catalog response, including pagination headers and status code.\n */\nasync function catalogRequest(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ICatalogRequestRequest\n): Promise<ICatalogRequestResponse> {\n\ttry {\n\t\tGuards.object<ICatalogRequestRequest>(ROUTES_SOURCE, nameof(request), request);\n\t\tGuards.object(ROUTES_SOURCE, nameof(request.body), request.body);\n\t\tGuards.stringValue(ROUTES_SOURCE, \"@type\", request.body[\"@type\"]);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.query(\n\t\t\trequest.body.filter,\n\t\t\trequest.query?.cursor,\n\t\t\tCoerce.integer(request.query?.limit),\n\t\t\ttrustPayload\n\t\t);\n\n\t\tconst headers: ICatalogRequestResponse[\"headers\"] = {};\n\n\t\tconst contextIds = await ContextIdStore.getContextIds();\n\t\tHttpHeaderHelper.buildCursor(\n\t\t\theaders,\n\t\t\thttpRequestContext.serverRequest.url,\n\t\t\tcontextIds?.[HttpContextIdKeys.PublicOrigin],\n\t\t\tresult.cursor\n\t\t);\n\n\t\treturn {\n\t\t\theaders,\n\t\t\tstatusCode: transformErrorToStatusCode(result.result),\n\t\t\tbody: result.result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the get dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the dataset response, containing the dataset or a CatalogError.\n */\nasync function getDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetGetRequest\n): Promise<IDatasetGetResponse> {\n\ttry {\n\t\tGuards.object<IDatasetGetRequest>(ROUTES_SOURCE, nameof(request), request);\n\t\tGuards.object(ROUTES_SOURCE, nameof(request.pathParams), request.pathParams);\n\t\tGuards.stringValue(\n\t\t\tROUTES_SOURCE,\n\t\t\tnameof(request.pathParams.datasetId),\n\t\t\trequest.pathParams.datasetId\n\t\t);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.get(request.pathParams.datasetId, trustPayload);\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result),\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the set dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @param baseRouteName The base route name for constructing the Location header.\n * @returns A promise that resolves with the set response, including a Location header on creation or a CatalogError on failure.\n */\nasync function setDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetSetRequest,\n\tbaseRouteName: string\n): Promise<IDatasetSetResponse> {\n\ttry {\n\t\tGuards.object<IDatasetSetRequest>(ROUTES_SOURCE, nameof(request), request);\n\t\tGuards.object(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.set(request.body, trustPayload);\n\n\t\tif (Is.stringValue(result)) {\n\t\t\tconst contextIds = await ContextIdStore.getContextIds();\n\t\t\tconst publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];\n\n\t\t\tconst headers: IHttpHeaders = {};\n\t\t\tHttpHeaderHelper.buildId(\n\t\t\t\theaders,\n\t\t\t\tresult,\n\t\t\t\tHttpUrlHelper.combineOriginPath(publicOrigin, `${baseRouteName}/datasets/:id`)\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\theaders\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result),\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the remove dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the remove response, containing no content on success or a CatalogError on failure.\n */\nasync function removeDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetRemoveRequest\n): Promise<IDatasetRemoveResponse> {\n\ttry {\n\t\tGuards.object<IDatasetRemoveRequest>(ROUTES_SOURCE, nameof(request), request);\n\t\tGuards.object(ROUTES_SOURCE, nameof(request.pathParams), request.pathParams);\n\t\tGuards.stringValue(\n\t\t\tROUTES_SOURCE,\n\t\t\tnameof(request.pathParams.datasetId),\n\t\t\trequest.pathParams.datasetId\n\t\t);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.remove(request.pathParams.datasetId, trustPayload);\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result) ?? HttpStatusCode.noContent,\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"federatedCatalogueRoutes.js","sources":["../../src/federatedCatalogueRoutes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAapE,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAwB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAqB,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEnG;;GAEG;AACH,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC7C;QACC,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACV,qGAAqG;KACtG;CACD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CACnD,aAAqB,EACrB,aAAqB;IAErB,MAAM,mBAAmB,GAAgE;QACxF,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,4CAA4C;QACrD,GAAG,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI;QACnC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,GAAG,aAAa,UAAU;QAChC,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAA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,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;QAE9F,MAAM,SAAS,GAAiC,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAEpF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAElF,OAAO;YACN,UAAU,EAAE,0BAA0B,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,SAAS;YAC1E,IAAI,EAAE,MAAM;SACZ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACpD,OAAO;YACN,UAAU,EAAE,0BAA0B,CAAC,YAAY,CAAC,IAAI,cAAc,CAAC,UAAU;YACjF,IAAI,EAAE,YAAY;SAClB,CAAC;IACH,CAAC;AACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tHttpContextIdKeys,\n\tHttpHeaderHelper,\n\tHttpUrlHelper,\n\ttype IHttpRequestContext,\n\ttype IRestRoute,\n\ttype ITag\n} from \"@3sixty/api-models\";\nimport { ContextIdStore } from \"@3sixty/context\";\nimport { Coerce, ComponentFactory, Guards, Is } from \"@3sixty/core\";\nimport type {\n\tICatalogRequestRequest,\n\tICatalogRequestResponse,\n\tIDatasetGetRequest,\n\tIDatasetGetResponse,\n\tIDatasetRemoveRequest,\n\tIDatasetRemoveResponse,\n\tIDatasetSetRequest,\n\tIDatasetSetResponse,\n\tIFederatedCatalogueComponent\n} from \"@3sixty/federated-catalogue-models\";\n\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { DcatClasses, type DcatContextType } from \"@3sixty/standards-w3c-dcat\";\nimport { OdrlPolicyType } from \"@3sixty/standards-w3c-odrl\";\nimport { HeaderHelper, HeaderTypes, HttpStatusCode, type IHttpHeaders } from \"@3sixty/web\";\nimport { transformErrorToStatusCode, transformToCatalogError } from \"./utils/catalogErrorUtils.js\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"federatedCatalogueRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsFederatedCatalogue: ITag[] = [\n\t{\n\t\tname: \"Federated Catalogue\",\n\t\tdescription:\n\t\t\t\"Service providing Dataspace Protocol-compliant catalogue endpoints for dataset discovery and query.\"\n\t}\n];\n\n/**\n * The REST routes for federated catalogue.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesFederatedCatalogue(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst catalogRequestRoute: IRestRoute<ICatalogRequestRequest, ICatalogRequestResponse> = {\n\t\toperationId: \"catalogRequest\",\n\t\tsummary: \"Query the federated catalogue for datasets\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/request`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tcatalogRequest(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: \"ICatalogRequestRequest\",\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogRequestMessage,\n\t\t\t\t\t\t\tfilter: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestNoFilterExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogRequestMessage\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"ICatalogRequestResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"catalogRequestResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\t\t\"@id\":\n\t\t\t\t\t\t\t\t\t\"urn:x-catalog:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2\",\n\t\t\t\t\t\t\t\t\"@type\": \"Catalog\",\n\t\t\t\t\t\t\t\tparticipantId: \"did:example:node-identity-123\",\n\t\t\t\t\t\t\t\tdataset: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\t\t\"@type\": \"Dataset\",\n\t\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\",\n\t\t\t\t\t\t\t\t\t\thasPolicy: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:policy-456\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": OdrlPolicyType.Offer,\n\t\t\t\t\t\t\t\t\t\t\t\tassigner: \"did:example:data-provider-789\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tdistribution: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:distribution-789\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": \"Distribution\",\n\t\t\t\t\t\t\t\t\t\t\t\tformat: \"application/json\",\n\t\t\t\t\t\t\t\t\t\t\t\taccessService: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:access-service-321\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\": \"DataService\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tendpointURL: \"https://example.com/data-access\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst getDatasetRoute: IRestRoute<IDatasetGetRequest, IDatasetGetResponse> = {\n\t\toperationId: \"getDataset\",\n\t\tsummary: \"Retrieve a specific dataset by ID\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/datasets/:datasetId`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tgetDataset(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: \"IDatasetGetRequest\",\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"getDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tdatasetId: \"urn:uuid:dataset-123\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IDatasetGetResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"getDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": DataspaceProtocolContexts.Context as unknown as DcatContextType,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst setDatasetRoute: IRestRoute<IDatasetSetRequest, IDatasetSetResponse> = {\n\t\toperationId: \"setDataset\",\n\t\tsummary: \"Insert or update a dataset in the catalogue\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/datasets`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tsetDataset(httpRequestContext, componentName, request, baseRouteName),\n\t\trequestType: {\n\t\t\ttype: \"IDatasetSetRequest\",\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"setDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": DataspaceProtocolContexts.Context as unknown as DcatContextType,\n\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IDatasetSetResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"setDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.noContent\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\tconst removeDatasetRoute: IRestRoute<IDatasetRemoveRequest, IDatasetRemoveResponse> = {\n\t\toperationId: \"removeDataset\",\n\t\tsummary: \"Remove a dataset from the catalogue by ID\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/datasets/:datasetId`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tremoveDataset(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: \"IDatasetRemoveRequest\",\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"removeDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t[HeaderTypes.Authorization]: \"Bearer <trust-token>\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tdatasetId: \"urn:uuid:dataset-123\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: \"IDatasetRemoveResponse\",\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"removeDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.noContent\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\tskipAuth: true,\n\t\tskipTenant: true\n\t};\n\n\treturn [catalogRequestRoute, getDatasetRoute, setDatasetRoute, removeDatasetRoute];\n}\n\n/**\n * Handle the catalog request operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the catalog response, including pagination headers and status code.\n */\nasync function catalogRequest(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ICatalogRequestRequest\n): Promise<ICatalogRequestResponse> {\n\ttry {\n\t\tGuards.object<ICatalogRequestRequest>(ROUTES_SOURCE, \"request\", request);\n\t\tGuards.object(ROUTES_SOURCE, \"request.body\", request.body);\n\t\tGuards.stringValue(ROUTES_SOURCE, \"@type\", request.body[\"@type\"]);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.query(\n\t\t\trequest.body.filter,\n\t\t\trequest.query?.cursor,\n\t\t\tCoerce.integer(request.query?.limit),\n\t\t\ttrustPayload\n\t\t);\n\n\t\tconst headers: ICatalogRequestResponse[\"headers\"] = {};\n\n\t\tconst contextIds = await ContextIdStore.getContextIds();\n\t\tHttpHeaderHelper.buildCursor(\n\t\t\theaders,\n\t\t\thttpRequestContext.serverRequest.url,\n\t\t\tcontextIds?.[HttpContextIdKeys.PublicOrigin],\n\t\t\tresult.cursor\n\t\t);\n\n\t\treturn {\n\t\t\theaders,\n\t\t\tstatusCode: transformErrorToStatusCode(result.result),\n\t\t\tbody: result.result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the get dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the dataset response, containing the dataset or a CatalogError.\n */\nasync function getDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetGetRequest\n): Promise<IDatasetGetResponse> {\n\ttry {\n\t\tGuards.object<IDatasetGetRequest>(ROUTES_SOURCE, \"request\", request);\n\t\tGuards.object(ROUTES_SOURCE, \"request.pathParams\", request.pathParams);\n\t\tGuards.stringValue(\n\t\t\tROUTES_SOURCE,\n\t\t\t\"request.pathParams.datasetId\",\n\t\t\trequest.pathParams.datasetId\n\t\t);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.get(request.pathParams.datasetId, trustPayload);\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result),\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the set dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @param baseRouteName The base route name for constructing the Location header.\n * @returns A promise that resolves with the set response, including a Location header on creation or a CatalogError on failure.\n */\nasync function setDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetSetRequest,\n\tbaseRouteName: string\n): Promise<IDatasetSetResponse> {\n\ttry {\n\t\tGuards.object<IDatasetSetRequest>(ROUTES_SOURCE, \"request\", request);\n\t\tGuards.object(ROUTES_SOURCE, \"request.body\", request.body);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.set(request.body, trustPayload);\n\n\t\tif (Is.stringValue(result)) {\n\t\t\tconst contextIds = await ContextIdStore.getContextIds();\n\t\t\tconst publicOrigin = contextIds?.[HttpContextIdKeys.PublicOrigin];\n\n\t\t\tconst headers: IHttpHeaders = {};\n\t\t\tHttpHeaderHelper.buildId(\n\t\t\t\theaders,\n\t\t\t\tresult,\n\t\t\t\tHttpUrlHelper.combineOriginPath(publicOrigin, `${baseRouteName}/datasets/:id`)\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\theaders\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result),\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n\n/**\n * Handle the remove dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns A promise that resolves with the remove response, containing no content on success or a CatalogError on failure.\n */\nasync function removeDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IDatasetRemoveRequest\n): Promise<IDatasetRemoveResponse> {\n\ttry {\n\t\tGuards.object<IDatasetRemoveRequest>(ROUTES_SOURCE, \"request\", request);\n\t\tGuards.object(ROUTES_SOURCE, \"request.pathParams\", request.pathParams);\n\t\tGuards.stringValue(\n\t\t\tROUTES_SOURCE,\n\t\t\t\"request.pathParams.datasetId\",\n\t\t\trequest.pathParams.datasetId\n\t\t);\n\n\t\tconst trustPayload = HeaderHelper.extractBearer(request.headers?.[HeaderTypes.Authorization]);\n\n\t\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\t\tconst result = await component.remove(request.pathParams.datasetId, trustPayload);\n\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(result) ?? HttpStatusCode.noContent,\n\t\t\tbody: result\n\t\t};\n\t} catch (error) {\n\t\tconst catalogError = transformToCatalogError(error);\n\t\treturn {\n\t\t\tstatusCode: transformErrorToStatusCode(catalogError) ?? HttpStatusCode.badRequest,\n\t\t\tbody: catalogError\n\t\t};\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,yCAAyC,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entities/dataset.js\";\nexport * from \"./entities/datasetV0.js\";\nexport * from \"./federatedCatalogueRoutes.js\";\nexport * from \"./models/IFederatedCatalogueServiceConfig.js\";\nexport * from \"./models/IFederatedCatalogueServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\nexport * from \"./services/federatedCatalogueService.js\";\nexport * from \"./utils/catalogErrorUtils.js\";\nexport * from \"./utils/datasetConverters.js\";\n"]}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,yCAAyC,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entities/dataset.js\";\nexport * from \"./entities/datasetV0.js\";\nexport * from \"./federatedCatalogueRoutes.js\";\nexport * from \"./models/IFederatedCatalogueServiceConfig.js\";\nexport * from \"./models/IFederatedCatalogueServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\nexport * from \"./services/federatedCatalogueService.js\";\nexport * from \"./utils/catalogErrorUtils.js\";\nexport * from \"./utils/datasetConverters.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IFederatedCatalogueServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the FederatedCatalogueService.\n */\nexport interface IFederatedCatalogueServiceConfig {\n\t/**\n\t * Timeout in milliseconds for acquiring a mutex lock, defaults to 5000ms.\n\t */\n\tmutexTimeoutMs?: number;\n}\n"]}
1
+ {"version":3,"file":"IFederatedCatalogueServiceConfig.js","sources":["../../../src/models/IFederatedCatalogueServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the FederatedCatalogueService.\n */\nexport interface IFederatedCatalogueServiceConfig {\n\t/**\n\t * Timeout in milliseconds for acquiring a mutex lock, defaults to 5000ms.\n\t */\n\tmutexTimeoutMs?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IFederatedCatalogueServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IFederatedCatalogueServiceConfig } from \"./IFederatedCatalogueServiceConfig.js\";\n\n/**\n * Options for the FederatedCatalogueService constructor.\n */\nexport interface IFederatedCatalogueServiceConstructorOptions {\n\t/**\n\t * The entity storage for datasets.\n\t * @default dataset\n\t */\n\tdatasetEntityStorageType?: string;\n\n\t/**\n\t * The logging component for the service.\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Trust component type for trust verification.\n\t * @default trust\n\t */\n\ttrustComponentType?: string;\n\n\t/**\n\t * The component type for the optional telemetry component used for event metrics, defaults to no telemetry.\n\t */\n\ttelemetryComponentType?: string;\n\n\t/**\n\t * Configuration for the federated catalogue service.\n\t */\n\tconfig?: IFederatedCatalogueServiceConfig;\n}\n"]}
1
+ {"version":3,"file":"IFederatedCatalogueServiceConstructorOptions.js","sources":["../../../src/models/IFederatedCatalogueServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IFederatedCatalogueServiceConfig } from \"./IFederatedCatalogueServiceConfig.js\";\n\n/**\n * Options for the FederatedCatalogueService constructor.\n */\nexport interface IFederatedCatalogueServiceConstructorOptions {\n\t/**\n\t * The entity storage for datasets.\n\t * @default dataset\n\t */\n\tdatasetEntityStorageType?: string;\n\n\t/**\n\t * The logging component for the service.\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Trust component type for trust verification.\n\t * @default trust\n\t */\n\ttrustComponentType?: string;\n\n\t/**\n\t * The component type for the optional telemetry component used for event metrics, defaults to no telemetry.\n\t */\n\ttelemetryComponentType?: string;\n\n\t/**\n\t * Configuration for the federated catalogue service.\n\t */\n\tconfig?: IFederatedCatalogueServiceConfig;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,qBAAqB;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@3sixty/api-models\";\nimport {\n\tgenerateRestRoutesFederatedCatalogue,\n\ttagsFederatedCatalogue\n} from \"./federatedCatalogueRoutes.js\";\n\n/**\n * REST route entry points for the federated catalogue service.\n */\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"federated-catalogue\",\n\t\tdefaultBaseRoute: \"catalog\",\n\t\ttags: tagsFederatedCatalogue,\n\t\tgenerateRoutes: generateRestRoutesFederatedCatalogue\n\t}\n];\n"]}
1
+ {"version":3,"file":"restEntryPoints.js","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,qBAAqB;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@3sixty/api-models\";\nimport {\n\tgenerateRestRoutesFederatedCatalogue,\n\ttagsFederatedCatalogue\n} from \"./federatedCatalogueRoutes.js\";\n\n/**\n * REST route entry points for the federated catalogue service.\n */\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"federated-catalogue\",\n\t\tdefaultBaseRoute: \"catalog\",\n\t\ttags: tagsFederatedCatalogue,\n\t\tgenerateRoutes: generateRestRoutesFederatedCatalogue\n\t}\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,UAAU;IACzB,mBAAmB,CAAC,QAAQ,YAAoB,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7F,mBAAmB,CAAC,QAAQ,cAAsB,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntitySchemaFactory, EntitySchemaHelper } from \"@3sixty/entity\";\nimport { nameof } from \"@3sixty/nameof\";\nimport { Dataset } from \"./entities/dataset.js\";\nimport { DatasetV0 } from \"./entities/datasetV0.js\";\n\n/**\n * Initialize the schema for the federated catalogue entity storage.\n */\nexport function initSchema(): void {\n\tEntitySchemaFactory.register(nameof<Dataset>(), () => EntitySchemaHelper.getSchema(Dataset));\n\tEntitySchemaFactory.register(nameof<DatasetV0>(), () => EntitySchemaHelper.getSchema(DatasetV0));\n}\n"]}
1
+ {"version":3,"file":"schema.js","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,UAAU;IACzB,mBAAmB,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACrF,mBAAmB,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntitySchemaFactory, EntitySchemaHelper } from \"@3sixty/entity\";\n\nimport { Dataset } from \"./entities/dataset.js\";\nimport { DatasetV0 } from \"./entities/datasetV0.js\";\n\n/**\n * Initialize the schema for the federated catalogue entity storage.\n */\nexport function initSchema(): void {\n\tEntitySchemaFactory.register(\"Dataset\", () => EntitySchemaHelper.getSchema(Dataset));\n\tEntitySchemaFactory.register(\"DatasetV0\", () => EntitySchemaHelper.getSchema(DatasetV0));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"federatedCatalogueService.js","sourceRoot":"","sources":["../../../src/services/federatedCatalogueService.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,O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,iBAAiB,CAAC,QAAwB,EAAE,aAAqB;QACxE,MAAM,UAAU,GAAG,QAAQ;aACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aAClB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;aAChC,IAAI,EAAE,CAAC;QAET,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC;YAChD,OAAO,EAAE,6BAA6B,CAAC,OAAO;YAC9C,aAAa;YACb,QAAQ,EAAE,UAAU;SACpB,CAAC,CAAC;QAEH,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC/D,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QACzE,OAAO,iBAAiB,WAAW,EAAE,CAAC;IACvC,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { HttpUrlHelper } from \"@3sixty/api-models\";\nimport { ContextIdKeys } from \"@3sixty/context\";\nimport {\n\tArrayHelper,\n\tBaseError,\n\tCoerce,\n\tComponentFactory,\n\tConverter,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tJsonHelper,\n\tMutex,\n\tNotFoundError,\n\tObjectHelper,\n\tUrl,\n\tUrn,\n\tValidation\n} from \"@3sixty/core\";\nimport { Blake2b } from \"@3sixty/crypto\";\nimport { JsonLdHelper, JsonLdProcessor } from \"@3sixty/data-json-ld\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@3sixty/entity-storage-models\";\nimport {\n\tFederatedCatalogueFilterFactory,\n\tFederatedCatalogueMetricIds,\n\tFederatedCatalogueMetrics,\n\ttype IFederatedCatalogueComponent\n} from \"@3sixty/federated-catalogue-models\";\nimport type { ILoggingComponent } from \"@3sixty/logging-models\";\nimport { nameof } from \"@3sixty/nameof\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\tDataspaceProtocolDataTypes,\n\tDataspaceProtocolHelper,\n\ttype IDataspaceProtocolCatalog,\n\ttype IDataspaceProtocolCatalogError\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { DublinCoreContexts, DublinCoreDataTypes } from \"@3sixty/standards-dublin-core\";\nimport { FoafDataTypes } from \"@3sixty/standards-foaf\";\nimport {\n\tDcatContexts,\n\tDcatDataTypes,\n\ttype DcatContextType,\n\ttype IDcatDataset\n} from \"@3sixty/standards-w3c-dcat\";\nimport { OdrlContexts } from \"@3sixty/standards-w3c-odrl\";\nimport { MetricHelper, type ITelemetryComponent } from \"@3sixty/telemetry-models\";\nimport { TrustHelper, type ITrustComponent } from \"@3sixty/trust-models\";\nimport type { Dataset } from \"../entities/dataset.js\";\nimport type { IFederatedCatalogueServiceConstructorOptions } from \"../models/IFederatedCatalogueServiceConstructorOptions.js\";\nimport { transformToCatalogError } from \"../utils/catalogErrorUtils.js\";\nimport { datasetEntityToModel, datasetModelToEntity } from \"../utils/datasetConverters.js\";\n\n/**\n * Service for managing federated catalogue operations.\n * Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and query.\n */\nexport class FederatedCatalogueService implements IFederatedCatalogueComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<FederatedCatalogueService>();\n\n\t/**\n\t * The logging component for the federated catalogue service.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * The entity storage connector for datasets.\n\t * @internal\n\t */\n\tprivate readonly _datasetStorage: IEntityStorageConnector<Dataset>;\n\n\t/**\n\t * The trust component for token verification and generation.\n\t * @internal\n\t */\n\tprivate readonly _trustComponent: ITrustComponent;\n\n\t/**\n\t * The optional telemetry component for event metrics.\n\t * @internal\n\t */\n\tprivate readonly _telemetryComponent?: ITelemetryComponent;\n\n\t/**\n\t * Timeout in milliseconds for acquiring a mutex lock.\n\t * @internal\n\t */\n\tprivate readonly _mutexTimeoutMs?: number;\n\n\t/**\n\t * Create a new instance of FederatedCatalogueService.\n\t * @param options The options for the service.\n\t */\n\tconstructor(options?: IFederatedCatalogueServiceConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\n\t\tthis._datasetStorage = EntityStorageConnectorFactory.get(\n\t\t\toptions?.datasetEntityStorageType ?? \"dataset\"\n\t\t);\n\n\t\tthis._trustComponent = ComponentFactory.get<ITrustComponent>(\n\t\t\toptions?.trustComponentType ?? \"trust\"\n\t\t);\n\n\t\tthis._telemetryComponent = ComponentFactory.getIfExists<ITelemetryComponent>(\n\t\t\toptions?.telemetryComponentType\n\t\t);\n\t\tthis._mutexTimeoutMs = Coerce.integer(options?.config?.mutexTimeoutMs);\n\n\t\t// Register JSON-LD redirects for offline processing\n\t\tDcatDataTypes.registerRedirects();\n\t\tDublinCoreDataTypes.registerRedirects();\n\t\tFoafDataTypes.registerRedirects();\n\t\tDataspaceProtocolDataTypes.registerRedirects();\n\n\t\t// Register DS Protocol data types for conformance checking\n\t\tDataspaceProtocolDataTypes.registerTypes();\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn FederatedCatalogueService.CLASS_NAME;\n\t}\n\n\t/**\n\t * Register all federated catalogue metrics with the telemetry component.\n\t * @returns A promise that resolves when all metrics have been registered.\n\t */\n\tpublic async start(): Promise<void> {\n\t\tawait MetricHelper.createMetrics(this._telemetryComponent, FederatedCatalogueMetrics);\n\t}\n\n\t/**\n\t * Retrieve a dataset by its unique identifier.\n\t * @param datasetId The unique identifier of the dataset.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.\n\t */\n\tpublic async get(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDcatDataset | IDataspaceProtocolCatalogError> {\n\t\ttry {\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, nameof(datasetId), datasetId);\n\t\t\tawait TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"get\");\n\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"datasetRetrieve\",\n\t\t\t\tdata: { datasetId }\n\t\t\t});\n\n\t\t\tconst datasetEntity = await this._datasetStorage.get(datasetId);\n\n\t\t\tif (!datasetEntity) {\n\t\t\t\tthrow new NotFoundError(FederatedCatalogueService.CLASS_NAME, \"datasetNotFound\", datasetId);\n\t\t\t}\n\n\t\t\tconst dataset = datasetEntityToModel(datasetEntity);\n\n\t\t\t// Normalize to DS Protocol compliant format\n\t\t\t// This ensures the payload matches exactly what the DS Protocol mandates\n\t\t\tconst normalizedDataset = await DataspaceProtocolHelper.normalize(\n\t\t\t\tJsonLdHelper.toNodeObject(dataset)\n\t\t\t);\n\n\t\t\tconst structured = JsonLdHelper.toStructuredObject<IDcatDataset>(normalizedDataset);\n\n\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\tthis._telemetryComponent,\n\t\t\t\tFederatedCatalogueMetricIds.DatasetsRetrieved\n\t\t\t);\n\n\t\t\treturn structured;\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Insert or update a dataset in the catalogue.\n\t * @param dataset The dataset to store.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.\n\t */\n\tpublic async set(\n\t\tdataset: IDcatDataset,\n\t\ttrustPayload: unknown\n\t): Promise<string | IDataspaceProtocolCatalogError> {\n\t\ttry {\n\t\t\tGuards.object(FederatedCatalogueService.CLASS_NAME, nameof(dataset), dataset);\n\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"set\");\n\n\t\t\t// Normalize @id from dcterms:identifier if provided\n\t\t\tconst datasetId = dataset[\"@id\"] ?? dataset[\"dcterms:identifier\"];\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, nameof(datasetId), datasetId);\n\n\t\t\t// Set @id if it was derived from dcterms:identifier\n\t\t\tif (Is.empty(dataset[\"@id\"]) && !Is.empty(dataset[\"dcterms:identifier\"])) {\n\t\t\t\tdataset[\"@id\"] = datasetId;\n\t\t\t}\n\n\t\t\t// Validate @id is a valid URI (URN or URL) per DS Protocol\n\t\t\tconst isValidUrn = !Is.empty(Urn.tryParseExact(datasetId));\n\t\t\tconst isValidUrl = !Is.empty(Url.tryParseExact(datasetId));\n\t\t\tif (!isValidUrn && !isValidUrl) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetIdInvalidUri\", {\n\t\t\t\t\tdatasetId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Validate @type exists\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"@type\", dataset[\"@type\"]);\n\n\t\t\t// Validate dcterms:publisher exists (required for multi-participant catalog)\n\t\t\t// The publisher is used to derive participantId when returning catalog query results\n\t\t\tconst publisher = dataset[\"dcterms:publisher\"];\n\t\t\tif (Is.empty(publisher)) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetMissingPublisher\", {\n\t\t\t\t\tdatasetId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// DS Protocol compliance validation\n\t\t\tconst validationFailures = await DataspaceProtocolHelper.validate(\n\t\t\t\tJsonLdHelper.toNodeObject(dataset)\n\t\t\t);\n\n\t\t\tValidation.asValidationError(\n\t\t\t\tFederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\"dataset\",\n\t\t\t\tvalidationFailures\n\t\t\t);\n\n\t\t\t// Normalize dataset for storage using JSON-LD compaction\n\t\t\t// This ensures the dataset uses prefixed properties that entity storage expects\n\t\t\t// Entity storage schema uses DCAT-prefixed properties (dcat:distribution, not distribution)\n\t\t\t// Use a standard context with prefixes to ensure proper normalization\n\t\t\tconst storageContext: DcatContextType = {\n\t\t\t\tdcat: DcatContexts.Namespace,\n\t\t\t\tdcterms: DublinCoreContexts.NamespaceTerms,\n\t\t\t\todrl: OdrlContexts.Namespace\n\t\t\t};\n\t\t\tconst normalizedDataset = await JsonLdProcessor.compact(dataset, storageContext);\n\n\t\t\tconst datasetEntity = datasetModelToEntity(normalizedDataset, trustInfo.identity);\n\n\t\t\t// Serialise the read-check-write cycle so concurrent requests for the\n\t\t\t// same dataset cannot both pass the ownership check and overwrite each other.\n\t\t\tawait Mutex.lock(datasetId, { throwOnTimeout: true, timeoutMs: this._mutexTimeoutMs });\n\t\t\ttry {\n\t\t\t\tconst existingEntity = await this._datasetStorage.get(datasetId);\n\t\t\t\tif (!Is.empty(existingEntity) && existingEntity.ownerId !== trustInfo.identity) {\n\t\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetOwnerMismatch\", {\n\t\t\t\t\t\tdatasetId\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Bake the publishing organization into distribution accessService URLs\n\t\t\t\tawait this.bakeOrganizationIntoDistributions(datasetEntity, trustInfo.identity);\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"datasetSet\",\n\t\t\t\t\tdata: { datasetId }\n\t\t\t\t});\n\n\t\t\t\tconst filterNames = FederatedCatalogueFilterFactory.names();\n\t\t\t\tfor (const filterType of filterNames) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst filter = FederatedCatalogueFilterFactory.get(filterType);\n\t\t\t\t\t\tconst filterIndexes = await filter.createIndex(normalizedDataset);\n\n\t\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\t\tmessage: \"filterIndexPersisted\",\n\t\t\t\t\t\t\tdata: { datasetId, filterType, indexCount: Object.keys(filterIndexes).length }\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\t\t\tFederatedCatalogueMetricIds.FilterIndexesCreated,\n\t\t\t\t\t\t\t{ filterType, indexCount: Object.keys(filterIndexes).length }\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\t\tmessage: \"filterIndexCreationFailed\",\n\t\t\t\t\t\t\tdata: { datasetId, filterType },\n\t\t\t\t\t\t\terror: BaseError.fromError(error)\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\t\t\tFederatedCatalogueMetricIds.FilterIndexFailures,\n\t\t\t\t\t\t\t{ filterType }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tawait this._datasetStorage.set(datasetEntity);\n\n\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\tFederatedCatalogueMetricIds.DatasetsStored\n\t\t\t\t);\n\n\t\t\t\treturn datasetId;\n\t\t\t} finally {\n\t\t\t\tMutex.unlock(datasetId);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Remove a dataset from the catalogue by its unique identifier.\n\t * Indexes are automatically removed as they are stored with the dataset.\n\t * @param datasetId The unique identifier of the dataset to remove.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.\n\t */\n\tpublic async remove(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolCatalogError | undefined> {\n\t\ttry {\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, nameof(datasetId), datasetId);\n\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"remove\");\n\n\t\t\tawait Mutex.lock(datasetId, { throwOnTimeout: true, timeoutMs: this._mutexTimeoutMs });\n\t\t\ttry {\n\t\t\t\tconst existingEntity = await this._datasetStorage.get(datasetId);\n\t\t\t\tif (!Is.empty(existingEntity) && existingEntity.ownerId !== trustInfo.identity) {\n\t\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetRemoveNotOwner\", {\n\t\t\t\t\t\tdatasetId\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"datasetRemove\",\n\t\t\t\t\tdata: { datasetId }\n\t\t\t\t});\n\n\t\t\t\tawait this._datasetStorage.remove(datasetId);\n\n\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\tFederatedCatalogueMetricIds.DatasetsRemoved\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tMutex.unlock(datasetId);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Execute a query against the catalogue using registered filter plugins.\n\t * Returns a Dataspace Protocol compliant Catalog object with participantId.\n\t *\n\t * The root catalog's participantId is the requesting participant (from context).\n\t * Own datasets (matching requestingParticipantId) go directly in root dataset[].\n\t * Other participants' datasets are grouped in nested catalog[] entries.\n\t *\n\t * For anonymous requests (no context), uses the first publisher found as fallback.\n\t * Returns a CatalogError with status 404 when no datasets exist, or status 400 for invalid requests.\n\t *\n\t * @param filter The filter criteria array, where the first element contains @type.\n\t * @param cursor Optional cursor for pagination.\n\t * @param limit Optional limit for pagination.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the catalog result and optional next-page cursor.\n\t */\n\tpublic async query(\n\t\tfilter: unknown[] | undefined,\n\t\tcursor: string | undefined,\n\t\tlimit: number | undefined,\n\t\ttrustPayload: unknown\n\t): Promise<{\n\t\tresult: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\t\tcursor?: string;\n\t}> {\n\t\ttry {\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"query\");\n\n\t\t\tlet datasets: IDcatDataset[];\n\t\t\tlet resultCursor: string | undefined;\n\n\t\t\tif (!Is.empty(filter) && !Is.array(filter)) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"filterMustBeArray\");\n\t\t\t}\n\n\t\t\tif (!Is.arrayValue(filter)) {\n\t\t\t\tconst result = await this._datasetStorage.query(\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit\n\t\t\t\t);\n\t\t\t\tdatasets = result.entities.map(entity => datasetEntityToModel(entity));\n\t\t\t\tresultCursor = result.cursor;\n\t\t\t} else if (filter.length > 1) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"multipleFiltersNotSupported\");\n\t\t\t} else {\n\t\t\t\tconst singleFilter = filter[0] as { \"@type\"?: string } | undefined;\n\n\t\t\t\tconst filterType = singleFilter?.[\"@type\"];\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"catalogQuery\",\n\t\t\t\t\tdata: { filterType: filterType ?? \"\", cursor: cursor ?? \"\", limit: limit ?? \"\" }\n\t\t\t\t});\n\n\t\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, nameof(filterType), filterType);\n\n\t\t\t\tconst selectedFilter = FederatedCatalogueFilterFactory.get(filterType);\n\n\t\t\t\t// Pass the filter CRITERIA object (filter[0]) to the handler, not the array wrapper,\n\t\t\t\t// and strip the selector \"@type\" from that object. Passing the array makes\n\t\t\t\t// Is.objectValue() false inside the handler, which silently returns ALL datasets\n\t\t\t\t// unfiltered, so the criteria (e.g. \"dcterms:type\") never narrows the result.\n\t\t\t\tObjectHelper.propertyDelete(singleFilter, \"@type\");\n\t\t\t\tconst result = await selectedFilter.query(trustInfo, singleFilter, cursor, limit);\n\n\t\t\t\tdatasets = result.datasets;\n\t\t\t\tresultCursor = result.cursor;\n\t\t\t}\n\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"catalogQueryComplete\",\n\t\t\t\tdata: { resultCount: datasets.length, hasMore: Is.stringValue(resultCursor) }\n\t\t\t});\n\n\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\tthis._telemetryComponent,\n\t\t\t\tFederatedCatalogueMetricIds.QueriesExecuted,\n\t\t\t\t{ resultCount: datasets.length, hasMore: Is.stringValue(resultCursor) }\n\t\t\t);\n\n\t\t\t// Return CatalogError 404 when no datasets exist\n\t\t\tif (!Is.arrayValue(datasets)) {\n\t\t\t\tthrow new NotFoundError(FederatedCatalogueService.CLASS_NAME, \"noDatasetsFound\");\n\t\t\t}\n\n\t\t\tlet requestingParticipantId = trustInfo.identity;\n\n\t\t\t// Group datasets by dcterms:publisher (participantId)\n\t\t\tconst datasetsByParticipant = new Map<string, IDcatDataset[]>();\n\t\t\tfor (const dataset of datasets) {\n\t\t\t\tconst publisher = this.extractPublisher(dataset);\n\t\t\t\tconst participantId = publisher ?? \"unknown\";\n\t\t\t\tconst existing = datasetsByParticipant.get(participantId) ?? [];\n\t\t\t\texisting.push(dataset);\n\t\t\t\tdatasetsByParticipant.set(participantId, existing);\n\t\t\t}\n\n\t\t\tconst participantIds = [...datasetsByParticipant.keys()];\n\n\t\t\t// For anonymous requests (no context), use first publisher as fallback\n\t\t\tif (!Is.stringValue(requestingParticipantId)) {\n\t\t\t\trequestingParticipantId = participantIds[0] ?? \"unknown\";\n\t\t\t}\n\n\t\t\t// Separate own datasets from other participants' datasets\n\t\t\tconst ownDatasets = datasetsByParticipant.get(requestingParticipantId) ?? [];\n\t\t\tconst otherParticipantIds = participantIds.filter(id => id !== requestingParticipantId);\n\n\t\t\tlet catalog: IDataspaceProtocolCatalog;\n\n\t\t\tif (!Is.arrayValue(otherParticipantIds)) {\n\t\t\t\t// Only own datasets (or all datasets belong to requesting participant)\n\t\t\t\tconst catalogId = this.generateCatalogId(ownDatasets, requestingParticipantId);\n\n\t\t\t\tcatalog = {\n\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\"@id\": catalogId,\n\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\tparticipantId: requestingParticipantId,\n\t\t\t\t\tdataset: ownDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"]\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Mixed: own datasets at root level, others in nested catalogs\n\t\t\t\tconst nestedCatalogs: IDataspaceProtocolCatalog[] = [];\n\n\t\t\t\tfor (const participantId of otherParticipantIds) {\n\t\t\t\t\tconst participantDatasets = datasetsByParticipant.get(participantId) ?? [];\n\t\t\t\t\tconst subCatalogId = this.generateCatalogId(participantDatasets, participantId);\n\n\t\t\t\t\tconst subCatalog: IDataspaceProtocolCatalog = {\n\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\"@id\": subCatalogId,\n\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\t\tparticipantId,\n\t\t\t\t\t\tdataset: participantDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"]\n\t\t\t\t\t};\n\n\t\t\t\t\tnestedCatalogs.push(subCatalog);\n\t\t\t\t}\n\n\t\t\t\t// Root catalog contains own datasets and nested catalogs for others\n\t\t\t\tconst rootCatalogId = this.generateCatalogId(datasets, requestingParticipantId);\n\n\t\t\t\tcatalog = {\n\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\"@id\": rootCatalogId,\n\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\tparticipantId: requestingParticipantId,\n\t\t\t\t\tdataset: ownDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"],\n\t\t\t\t\tcatalog: nestedCatalogs\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Normalize to DS Protocol compliant format\n\t\t\t// This ensures the payload matches exactly what the DS Protocol mandates\n\t\t\tconst normalizedCatalog = await DataspaceProtocolHelper.normalize(\n\t\t\t\tJsonLdHelper.toNodeObject(catalog)\n\t\t\t);\n\n\t\t\tconst structuredResult: IDataspaceProtocolCatalog =\n\t\t\t\tJsonLdHelper.toStructuredObject(normalizedCatalog);\n\n\t\t\treturn {\n\t\t\t\tresult: structuredResult,\n\t\t\t\tcursor: resultCursor\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tresult: transformToCatalogError(error)\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Extract publisher from dataset.\n\t * Publisher can be a string or an IFoafAgent object with @id.\n\t * @param dataset The dataset to extract publisher from.\n\t * @returns The publisher string or undefined if not found.\n\t * @internal\n\t */\n\tprivate extractPublisher(dataset: IDcatDataset): string | undefined {\n\t\tconst publisher = dataset[\"dcterms:publisher\"];\n\n\t\t// Handle case where publisher is an object with @id (IFoafAgent)\n\t\tif (Is.object<{ \"@id\"?: string }>(publisher)) {\n\t\t\tconst publisherId = publisher[\"@id\"];\n\t\t\treturn Is.stringValue(publisherId) ? publisherId : undefined;\n\t\t}\n\n\t\treturn Is.stringValue(publisher) ? publisher : undefined;\n\t}\n\n\t/**\n\t * Bake the publishing organization token into each distribution's accessService URL.\n\t * @param entity The dataset entity to modify in place.\n\t * @param organizationId The publishing organization id to bake.\n\t * @returns A promise that resolves when all distribution URLs have been updated.\n\t * @internal\n\t */\n\tprivate async bakeOrganizationIntoDistributions(\n\t\tentity: Dataset,\n\t\torganizationId: string\n\t): Promise<void> {\n\t\t// Storage uses the prefixed JSON-LD key \"dcat:accessService\" (not the unprefixed\n\t\t// \"accessService\" that appears in compacted query responses).\n\t\tconst distributions = ArrayHelper.fromObjectOrArray(entity[\"dcat:distribution\"]) ?? [];\n\t\tfor (const dist of distributions) {\n\t\t\tconst accessService = dist?.[\"dcat:accessService\"];\n\t\t\tif (Is.stringValue(accessService)) {\n\t\t\t\tdist[\"dcat:accessService\"] = HttpUrlHelper.addQueryStringParam(\n\t\t\t\t\taccessService,\n\t\t\t\t\tContextIdKeys.Organization,\n\t\t\t\t\torganizationId\n\t\t\t\t);\n\t\t\t} else if (Is.objectValue(accessService)) {\n\t\t\t\t// DCAT object form: a dcat:DataService with an endpointURL.\n\t\t\t\tconst dataService = accessService as { \"dcat:endpointURL\"?: unknown };\n\t\t\t\tif (Is.stringValue(dataService[\"dcat:endpointURL\"])) {\n\t\t\t\t\tdataService[\"dcat:endpointURL\"] = HttpUrlHelper.addQueryStringParam(\n\t\t\t\t\t\tdataService[\"dcat:endpointURL\"],\n\t\t\t\t\t\tContextIdKeys.Organization,\n\t\t\t\t\t\torganizationId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Generate a deterministic catalog ID using canonical hash.\n\t * @param datasets The datasets to include in the hash.\n\t * @param participantId The participant ID to include in the hash.\n\t * @returns A URN-formatted catalog ID.\n\t * @internal\n\t */\n\tprivate generateCatalogId(datasets: IDcatDataset[], participantId: string): string {\n\t\tconst datasetIds = datasets\n\t\t\t.map(d => d[\"@id\"])\n\t\t\t.filter(id => Is.stringValue(id))\n\t\t\t.sort();\n\n\t\tconst canonicalContent = JsonHelper.canonicalize({\n\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\tparticipantId,\n\t\t\tdatasets: datasetIds\n\t\t});\n\n\t\tconst canonicalBytes = Converter.utf8ToBytes(canonicalContent);\n\t\tconst catalogHash = Converter.bytesToHex(Blake2b.sum256(canonicalBytes));\n\t\treturn `urn:x-catalog:${catalogHash}`;\n\t}\n}\n"]}
1
+ {"version":3,"file":"federatedCatalogueService.js","sources":["../../../src/services/federatedCatalogueService.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACN,WAAW,EACX,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,MAAM,EACN,EAAE,EACF,UAAU,EACV,KAAK,EACL,aAAa,EACb,YAAY,EACZ,GAAG,EACH,GAAG,EACH,UAAU,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACN,6BAA6B,EAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EAEzB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACN,6BAA6B,EAC7B,yBAA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AAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC/D,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QACzE,OAAO,iBAAiB,WAAW,EAAE,CAAC;IACvC,CAAC;CACD","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { HttpUrlHelper } from \"@3sixty/api-models\";\nimport { ContextIdKeys } from \"@3sixty/context\";\nimport {\n\tArrayHelper,\n\tBaseError,\n\tCoerce,\n\tComponentFactory,\n\tConverter,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tJsonHelper,\n\tMutex,\n\tNotFoundError,\n\tObjectHelper,\n\tUrl,\n\tUrn,\n\tValidation\n} from \"@3sixty/core\";\nimport { Blake2b } from \"@3sixty/crypto\";\nimport { JsonLdHelper, JsonLdProcessor } from \"@3sixty/data-json-ld\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@3sixty/entity-storage-models\";\nimport {\n\tFederatedCatalogueFilterFactory,\n\tFederatedCatalogueMetricIds,\n\tFederatedCatalogueMetrics,\n\ttype IFederatedCatalogueComponent\n} from \"@3sixty/federated-catalogue-models\";\nimport type { ILoggingComponent } from \"@3sixty/logging-models\";\n\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\tDataspaceProtocolDataTypes,\n\tDataspaceProtocolHelper,\n\ttype IDataspaceProtocolCatalog,\n\ttype IDataspaceProtocolCatalogError\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { DublinCoreContexts, DublinCoreDataTypes } from \"@3sixty/standards-dublin-core\";\nimport { FoafDataTypes } from \"@3sixty/standards-foaf\";\nimport {\n\tDcatContexts,\n\tDcatDataTypes,\n\ttype DcatContextType,\n\ttype IDcatDataset\n} from \"@3sixty/standards-w3c-dcat\";\nimport { OdrlContexts } from \"@3sixty/standards-w3c-odrl\";\nimport { MetricHelper, type ITelemetryComponent } from \"@3sixty/telemetry-models\";\nimport { TrustHelper, type ITrustComponent } from \"@3sixty/trust-models\";\nimport type { Dataset } from \"../entities/dataset.js\";\nimport type { IFederatedCatalogueServiceConstructorOptions } from \"../models/IFederatedCatalogueServiceConstructorOptions.js\";\nimport { transformToCatalogError } from \"../utils/catalogErrorUtils.js\";\nimport { datasetEntityToModel, datasetModelToEntity } from \"../utils/datasetConverters.js\";\n\n/**\n * Service for managing federated catalogue operations.\n * Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and query.\n */\nexport class FederatedCatalogueService implements IFederatedCatalogueComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"FederatedCatalogueService\";\n\n\t/**\n\t * The logging component for the federated catalogue service.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * The entity storage connector for datasets.\n\t * @internal\n\t */\n\tprivate readonly _datasetStorage: IEntityStorageConnector<Dataset>;\n\n\t/**\n\t * The trust component for token verification and generation.\n\t * @internal\n\t */\n\tprivate readonly _trustComponent: ITrustComponent;\n\n\t/**\n\t * The optional telemetry component for event metrics.\n\t * @internal\n\t */\n\tprivate readonly _telemetryComponent?: ITelemetryComponent;\n\n\t/**\n\t * Timeout in milliseconds for acquiring a mutex lock.\n\t * @internal\n\t */\n\tprivate readonly _mutexTimeoutMs?: number;\n\n\t/**\n\t * Create a new instance of FederatedCatalogueService.\n\t * @param options The options for the service.\n\t */\n\tconstructor(options?: IFederatedCatalogueServiceConstructorOptions) {\n\t\tthis._logging = ComponentFactory.getIfExists<ILoggingComponent>(options?.loggingComponentType);\n\n\t\tthis._datasetStorage = EntityStorageConnectorFactory.get(\n\t\t\toptions?.datasetEntityStorageType ?? \"dataset\"\n\t\t);\n\n\t\tthis._trustComponent = ComponentFactory.get<ITrustComponent>(\n\t\t\toptions?.trustComponentType ?? \"trust\"\n\t\t);\n\n\t\tthis._telemetryComponent = ComponentFactory.getIfExists<ITelemetryComponent>(\n\t\t\toptions?.telemetryComponentType\n\t\t);\n\t\tthis._mutexTimeoutMs = Coerce.integer(options?.config?.mutexTimeoutMs);\n\n\t\t// Register JSON-LD redirects for offline processing\n\t\tDcatDataTypes.registerRedirects();\n\t\tDublinCoreDataTypes.registerRedirects();\n\t\tFoafDataTypes.registerRedirects();\n\t\tDataspaceProtocolDataTypes.registerRedirects();\n\n\t\t// Register DS Protocol data types for conformance checking\n\t\tDataspaceProtocolDataTypes.registerTypes();\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn FederatedCatalogueService.CLASS_NAME;\n\t}\n\n\t/**\n\t * Register all federated catalogue metrics with the telemetry component.\n\t * @returns A promise that resolves when all metrics have been registered.\n\t */\n\tpublic async start(): Promise<void> {\n\t\tawait MetricHelper.createMetrics(this._telemetryComponent, FederatedCatalogueMetrics);\n\t}\n\n\t/**\n\t * Retrieve a dataset by its unique identifier.\n\t * @param datasetId The unique identifier of the dataset.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.\n\t */\n\tpublic async get(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDcatDataset | IDataspaceProtocolCatalogError> {\n\t\ttry {\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"datasetId\", datasetId);\n\t\t\tawait TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"get\");\n\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"datasetRetrieve\",\n\t\t\t\tdata: { datasetId }\n\t\t\t});\n\n\t\t\tconst datasetEntity = await this._datasetStorage.get(datasetId);\n\n\t\t\tif (!datasetEntity) {\n\t\t\t\tthrow new NotFoundError(FederatedCatalogueService.CLASS_NAME, \"datasetNotFound\", datasetId);\n\t\t\t}\n\n\t\t\tconst dataset = datasetEntityToModel(datasetEntity);\n\n\t\t\t// Normalize to DS Protocol compliant format\n\t\t\t// This ensures the payload matches exactly what the DS Protocol mandates\n\t\t\tconst normalizedDataset = await DataspaceProtocolHelper.normalize(\n\t\t\t\tJsonLdHelper.toNodeObject(dataset)\n\t\t\t);\n\n\t\t\tconst structured = JsonLdHelper.toStructuredObject<IDcatDataset>(normalizedDataset);\n\n\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\tthis._telemetryComponent,\n\t\t\t\tFederatedCatalogueMetricIds.DatasetsRetrieved\n\t\t\t);\n\n\t\t\treturn structured;\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Insert or update a dataset in the catalogue.\n\t * @param dataset The dataset to store.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.\n\t */\n\tpublic async set(\n\t\tdataset: IDcatDataset,\n\t\ttrustPayload: unknown\n\t): Promise<string | IDataspaceProtocolCatalogError> {\n\t\ttry {\n\t\t\tGuards.object(FederatedCatalogueService.CLASS_NAME, \"dataset\", dataset);\n\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"set\");\n\n\t\t\t// Normalize @id from dcterms:identifier if provided\n\t\t\tconst datasetId = dataset[\"@id\"] ?? dataset[\"dcterms:identifier\"];\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"datasetId\", datasetId);\n\n\t\t\t// Set @id if it was derived from dcterms:identifier\n\t\t\tif (Is.empty(dataset[\"@id\"]) && !Is.empty(dataset[\"dcterms:identifier\"])) {\n\t\t\t\tdataset[\"@id\"] = datasetId;\n\t\t\t}\n\n\t\t\t// Validate @id is a valid URI (URN or URL) per DS Protocol\n\t\t\tconst isValidUrn = !Is.empty(Urn.tryParseExact(datasetId));\n\t\t\tconst isValidUrl = !Is.empty(Url.tryParseExact(datasetId));\n\t\t\tif (!isValidUrn && !isValidUrl) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetIdInvalidUri\", {\n\t\t\t\t\tdatasetId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Validate @type exists\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"@type\", dataset[\"@type\"]);\n\n\t\t\t// Validate dcterms:publisher exists (required for multi-participant catalog)\n\t\t\t// The publisher is used to derive participantId when returning catalog query results\n\t\t\tconst publisher = dataset[\"dcterms:publisher\"];\n\t\t\tif (Is.empty(publisher)) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetMissingPublisher\", {\n\t\t\t\t\tdatasetId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// DS Protocol compliance validation\n\t\t\tconst validationFailures = await DataspaceProtocolHelper.validate(\n\t\t\t\tJsonLdHelper.toNodeObject(dataset)\n\t\t\t);\n\n\t\t\tValidation.asValidationError(\n\t\t\t\tFederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\"dataset\",\n\t\t\t\tvalidationFailures\n\t\t\t);\n\n\t\t\t// Normalize dataset for storage using JSON-LD compaction\n\t\t\t// This ensures the dataset uses prefixed properties that entity storage expects\n\t\t\t// Entity storage schema uses DCAT-prefixed properties (dcat:distribution, not distribution)\n\t\t\t// Use a standard context with prefixes to ensure proper normalization\n\t\t\tconst storageContext: DcatContextType = {\n\t\t\t\tdcat: DcatContexts.Namespace,\n\t\t\t\tdcterms: DublinCoreContexts.NamespaceTerms,\n\t\t\t\todrl: OdrlContexts.Namespace\n\t\t\t};\n\t\t\tconst normalizedDataset = await JsonLdProcessor.compact(dataset, storageContext);\n\n\t\t\tconst datasetEntity = datasetModelToEntity(normalizedDataset, trustInfo.identity);\n\n\t\t\t// Serialise the read-check-write cycle so concurrent requests for the\n\t\t\t// same dataset cannot both pass the ownership check and overwrite each other.\n\t\t\tawait Mutex.lock(datasetId, { throwOnTimeout: true, timeoutMs: this._mutexTimeoutMs });\n\t\t\ttry {\n\t\t\t\tconst existingEntity = await this._datasetStorage.get(datasetId);\n\t\t\t\tif (!Is.empty(existingEntity) && existingEntity.ownerId !== trustInfo.identity) {\n\t\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetOwnerMismatch\", {\n\t\t\t\t\t\tdatasetId\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Bake the publishing organization into distribution accessService URLs\n\t\t\t\tawait this.bakeOrganizationIntoDistributions(datasetEntity, trustInfo.identity);\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"datasetSet\",\n\t\t\t\t\tdata: { datasetId }\n\t\t\t\t});\n\n\t\t\t\tconst filterNames = FederatedCatalogueFilterFactory.names();\n\t\t\t\tfor (const filterType of filterNames) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst filter = FederatedCatalogueFilterFactory.get(filterType);\n\t\t\t\t\t\tconst filterIndexes = await filter.createIndex(normalizedDataset);\n\n\t\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\t\tmessage: \"filterIndexPersisted\",\n\t\t\t\t\t\t\tdata: { datasetId, filterType, indexCount: Object.keys(filterIndexes).length }\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\t\t\tFederatedCatalogueMetricIds.FilterIndexesCreated,\n\t\t\t\t\t\t\t{ filterType, indexCount: Object.keys(filterIndexes).length }\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\t\tmessage: \"filterIndexCreationFailed\",\n\t\t\t\t\t\t\tdata: { datasetId, filterType },\n\t\t\t\t\t\t\terror: BaseError.fromError(error)\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\t\t\tFederatedCatalogueMetricIds.FilterIndexFailures,\n\t\t\t\t\t\t\t{ filterType }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tawait this._datasetStorage.set(datasetEntity);\n\n\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\tFederatedCatalogueMetricIds.DatasetsStored\n\t\t\t\t);\n\n\t\t\t\treturn datasetId;\n\t\t\t} finally {\n\t\t\t\tMutex.unlock(datasetId);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Remove a dataset from the catalogue by its unique identifier.\n\t * Indexes are automatically removed as they are stored with the dataset.\n\t * @param datasetId The unique identifier of the dataset to remove.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.\n\t */\n\tpublic async remove(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolCatalogError | undefined> {\n\t\ttry {\n\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"datasetId\", datasetId);\n\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"remove\");\n\n\t\t\tawait Mutex.lock(datasetId, { throwOnTimeout: true, timeoutMs: this._mutexTimeoutMs });\n\t\t\ttry {\n\t\t\t\tconst existingEntity = await this._datasetStorage.get(datasetId);\n\t\t\t\tif (!Is.empty(existingEntity) && existingEntity.ownerId !== trustInfo.identity) {\n\t\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"datasetRemoveNotOwner\", {\n\t\t\t\t\t\tdatasetId\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"datasetRemove\",\n\t\t\t\t\tdata: { datasetId }\n\t\t\t\t});\n\n\t\t\t\tawait this._datasetStorage.remove(datasetId);\n\n\t\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\t\tthis._telemetryComponent,\n\t\t\t\t\tFederatedCatalogueMetricIds.DatasetsRemoved\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tMutex.unlock(datasetId);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn transformToCatalogError(error);\n\t\t}\n\t}\n\n\t/**\n\t * Execute a query against the catalogue using registered filter plugins.\n\t * Returns a Dataspace Protocol compliant Catalog object with participantId.\n\t *\n\t * The root catalog's participantId is the requesting participant (from context).\n\t * Own datasets (matching requestingParticipantId) go directly in root dataset[].\n\t * Other participants' datasets are grouped in nested catalog[] entries.\n\t *\n\t * For anonymous requests (no context), uses the first publisher found as fallback.\n\t * Returns a CatalogError with status 404 when no datasets exist, or status 400 for invalid requests.\n\t *\n\t * @param filter The filter criteria array, where the first element contains @type.\n\t * @param cursor Optional cursor for pagination.\n\t * @param limit Optional limit for pagination.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the catalog result and optional next-page cursor.\n\t */\n\tpublic async query(\n\t\tfilter: unknown[] | undefined,\n\t\tcursor: string | undefined,\n\t\tlimit: number | undefined,\n\t\ttrustPayload: unknown\n\t): Promise<{\n\t\tresult: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\t\tcursor?: string;\n\t}> {\n\t\ttry {\n\t\t\tconst trustInfo = await TrustHelper.verifyTrust(this._trustComponent, trustPayload, \"query\");\n\n\t\t\tlet datasets: IDcatDataset[];\n\t\t\tlet resultCursor: string | undefined;\n\n\t\t\tif (!Is.empty(filter) && !Is.array(filter)) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"filterMustBeArray\");\n\t\t\t}\n\n\t\t\tif (!Is.arrayValue(filter)) {\n\t\t\t\tconst result = await this._datasetStorage.query(\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit\n\t\t\t\t);\n\t\t\t\tdatasets = result.entities.map(entity => datasetEntityToModel(entity));\n\t\t\t\tresultCursor = result.cursor;\n\t\t\t} else if (filter.length > 1) {\n\t\t\t\tthrow new GeneralError(FederatedCatalogueService.CLASS_NAME, \"multipleFiltersNotSupported\");\n\t\t\t} else {\n\t\t\t\tconst singleFilter = filter[0] as { \"@type\"?: string } | undefined;\n\n\t\t\t\tconst filterType = singleFilter?.[\"@type\"];\n\n\t\t\t\tawait this._logging?.log({\n\t\t\t\t\tlevel: \"info\",\n\t\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\t\tts: Date.now(),\n\t\t\t\t\tmessage: \"catalogQuery\",\n\t\t\t\t\tdata: { filterType: filterType ?? \"\", cursor: cursor ?? \"\", limit: limit ?? \"\" }\n\t\t\t\t});\n\n\t\t\t\tGuards.stringValue(FederatedCatalogueService.CLASS_NAME, \"filterType\", filterType);\n\n\t\t\t\tconst selectedFilter = FederatedCatalogueFilterFactory.get(filterType);\n\n\t\t\t\t// Pass the filter CRITERIA object (filter[0]) to the handler, not the array wrapper,\n\t\t\t\t// and strip the selector \"@type\" from that object. Passing the array makes\n\t\t\t\t// Is.objectValue() false inside the handler, which silently returns ALL datasets\n\t\t\t\t// unfiltered, so the criteria (e.g. \"dcterms:type\") never narrows the result.\n\t\t\t\tObjectHelper.propertyDelete(singleFilter, \"@type\");\n\t\t\t\tconst result = await selectedFilter.query(trustInfo, singleFilter, cursor, limit);\n\n\t\t\t\tdatasets = result.datasets;\n\t\t\t\tresultCursor = result.cursor;\n\t\t\t}\n\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: FederatedCatalogueService.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"catalogQueryComplete\",\n\t\t\t\tdata: { resultCount: datasets.length, hasMore: Is.stringValue(resultCursor) }\n\t\t\t});\n\n\t\t\tawait MetricHelper.metricIncrement(\n\t\t\t\tthis._telemetryComponent,\n\t\t\t\tFederatedCatalogueMetricIds.QueriesExecuted,\n\t\t\t\t{ resultCount: datasets.length, hasMore: Is.stringValue(resultCursor) }\n\t\t\t);\n\n\t\t\t// Return CatalogError 404 when no datasets exist\n\t\t\tif (!Is.arrayValue(datasets)) {\n\t\t\t\tthrow new NotFoundError(FederatedCatalogueService.CLASS_NAME, \"noDatasetsFound\");\n\t\t\t}\n\n\t\t\tlet requestingParticipantId = trustInfo.identity;\n\n\t\t\t// Group datasets by dcterms:publisher (participantId)\n\t\t\tconst datasetsByParticipant = new Map<string, IDcatDataset[]>();\n\t\t\tfor (const dataset of datasets) {\n\t\t\t\tconst publisher = this.extractPublisher(dataset);\n\t\t\t\tconst participantId = publisher ?? \"unknown\";\n\t\t\t\tconst existing = datasetsByParticipant.get(participantId) ?? [];\n\t\t\t\texisting.push(dataset);\n\t\t\t\tdatasetsByParticipant.set(participantId, existing);\n\t\t\t}\n\n\t\t\tconst participantIds = [...datasetsByParticipant.keys()];\n\n\t\t\t// For anonymous requests (no context), use first publisher as fallback\n\t\t\tif (!Is.stringValue(requestingParticipantId)) {\n\t\t\t\trequestingParticipantId = participantIds[0] ?? \"unknown\";\n\t\t\t}\n\n\t\t\t// Separate own datasets from other participants' datasets\n\t\t\tconst ownDatasets = datasetsByParticipant.get(requestingParticipantId) ?? [];\n\t\t\tconst otherParticipantIds = participantIds.filter(id => id !== requestingParticipantId);\n\n\t\t\tlet catalog: IDataspaceProtocolCatalog;\n\n\t\t\tif (!Is.arrayValue(otherParticipantIds)) {\n\t\t\t\t// Only own datasets (or all datasets belong to requesting participant)\n\t\t\t\tconst catalogId = this.generateCatalogId(ownDatasets, requestingParticipantId);\n\n\t\t\t\tcatalog = {\n\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\"@id\": catalogId,\n\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\tparticipantId: requestingParticipantId,\n\t\t\t\t\tdataset: ownDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"]\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Mixed: own datasets at root level, others in nested catalogs\n\t\t\t\tconst nestedCatalogs: IDataspaceProtocolCatalog[] = [];\n\n\t\t\t\tfor (const participantId of otherParticipantIds) {\n\t\t\t\t\tconst participantDatasets = datasetsByParticipant.get(participantId) ?? [];\n\t\t\t\t\tconst subCatalogId = this.generateCatalogId(participantDatasets, participantId);\n\n\t\t\t\t\tconst subCatalog: IDataspaceProtocolCatalog = {\n\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\t\"@id\": subCatalogId,\n\t\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\t\tparticipantId,\n\t\t\t\t\t\tdataset: participantDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"]\n\t\t\t\t\t};\n\n\t\t\t\t\tnestedCatalogs.push(subCatalog);\n\t\t\t\t}\n\n\t\t\t\t// Root catalog contains own datasets and nested catalogs for others\n\t\t\t\tconst rootCatalogId = this.generateCatalogId(datasets, requestingParticipantId);\n\n\t\t\t\tcatalog = {\n\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\"@id\": rootCatalogId,\n\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\t\t\tparticipantId: requestingParticipantId,\n\t\t\t\t\tdataset: ownDatasets as unknown as IDataspaceProtocolCatalog[\"dataset\"],\n\t\t\t\t\tcatalog: nestedCatalogs\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Normalize to DS Protocol compliant format\n\t\t\t// This ensures the payload matches exactly what the DS Protocol mandates\n\t\t\tconst normalizedCatalog = await DataspaceProtocolHelper.normalize(\n\t\t\t\tJsonLdHelper.toNodeObject(catalog)\n\t\t\t);\n\n\t\t\tconst structuredResult: IDataspaceProtocolCatalog =\n\t\t\t\tJsonLdHelper.toStructuredObject(normalizedCatalog);\n\n\t\t\treturn {\n\t\t\t\tresult: structuredResult,\n\t\t\t\tcursor: resultCursor\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tresult: transformToCatalogError(error)\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Extract publisher from dataset.\n\t * Publisher can be a string or an IFoafAgent object with @id.\n\t * @param dataset The dataset to extract publisher from.\n\t * @returns The publisher string or undefined if not found.\n\t * @internal\n\t */\n\tprivate extractPublisher(dataset: IDcatDataset): string | undefined {\n\t\tconst publisher = dataset[\"dcterms:publisher\"];\n\n\t\t// Handle case where publisher is an object with @id (IFoafAgent)\n\t\tif (Is.object<{ \"@id\"?: string }>(publisher)) {\n\t\t\tconst publisherId = publisher[\"@id\"];\n\t\t\treturn Is.stringValue(publisherId) ? publisherId : undefined;\n\t\t}\n\n\t\treturn Is.stringValue(publisher) ? publisher : undefined;\n\t}\n\n\t/**\n\t * Bake the publishing organization token into each distribution's accessService URL.\n\t * @param entity The dataset entity to modify in place.\n\t * @param organizationId The publishing organization id to bake.\n\t * @returns A promise that resolves when all distribution URLs have been updated.\n\t * @internal\n\t */\n\tprivate async bakeOrganizationIntoDistributions(\n\t\tentity: Dataset,\n\t\torganizationId: string\n\t): Promise<void> {\n\t\t// Storage uses the prefixed JSON-LD key \"dcat:accessService\" (not the unprefixed\n\t\t// \"accessService\" that appears in compacted query responses).\n\t\tconst distributions = ArrayHelper.fromObjectOrArray(entity[\"dcat:distribution\"]) ?? [];\n\t\tfor (const dist of distributions) {\n\t\t\tconst accessService = dist?.[\"dcat:accessService\"];\n\t\t\tif (Is.stringValue(accessService)) {\n\t\t\t\tdist[\"dcat:accessService\"] = HttpUrlHelper.addQueryStringParam(\n\t\t\t\t\taccessService,\n\t\t\t\t\tContextIdKeys.Organization,\n\t\t\t\t\torganizationId\n\t\t\t\t);\n\t\t\t} else if (Is.objectValue(accessService)) {\n\t\t\t\t// DCAT object form: a dcat:DataService with an endpointURL.\n\t\t\t\tconst dataService = accessService as { \"dcat:endpointURL\"?: unknown };\n\t\t\t\tif (Is.stringValue(dataService[\"dcat:endpointURL\"])) {\n\t\t\t\t\tdataService[\"dcat:endpointURL\"] = HttpUrlHelper.addQueryStringParam(\n\t\t\t\t\t\tdataService[\"dcat:endpointURL\"],\n\t\t\t\t\t\tContextIdKeys.Organization,\n\t\t\t\t\t\torganizationId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Generate a deterministic catalog ID using canonical hash.\n\t * @param datasets The datasets to include in the hash.\n\t * @param participantId The participant ID to include in the hash.\n\t * @returns A URN-formatted catalog ID.\n\t * @internal\n\t */\n\tprivate generateCatalogId(datasets: IDcatDataset[], participantId: string): string {\n\t\tconst datasetIds = datasets\n\t\t\t.map(d => d[\"@id\"])\n\t\t\t.filter(id => Is.stringValue(id))\n\t\t\t.sort();\n\n\t\tconst canonicalContent = JsonHelper.canonicalize({\n\t\t\t\"@type\": DataspaceProtocolCatalogTypes.Catalog,\n\t\t\tparticipantId,\n\t\t\tdatasets: datasetIds\n\t\t});\n\n\t\tconst canonicalBytes = Converter.utf8ToBytes(canonicalContent);\n\t\tconst catalogHash = Converter.bytesToHex(Blake2b.sum256(canonicalBytes));\n\t\treturn `urn:x-catalog:${catalogHash}`;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"catalogErrorUtils.js","sourceRoot":"","sources":["../../../src/utils/catalogErrorUtils.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAe,EAAE,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACrD,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,2EAA2E;IAC3E,iEAAiE;IACjE,wFAAwF;IACxF,wEAAwE;IACxE,+DAA+D;IAC/D,gJAAgJ;IAChJ,OAAO;QACN,UAAU,EAAE,yBAAyB,CAAC,OAAO;QAC7C,OAAO,EAAE,6BAA6B,CAAC,YAAY;QACnD,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;QACpD,MAAM,EAAE,SAAS;KACjB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAe;IACzD,4BAA4B;IAC5B,IACC,EAAE,CAAC,MAAM,CAAiC,MAAM,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,KAAK,6BAA6B,CAAC,YAAY,EAC7D,CAAC;QACF,sEAAsE;QACtE,wCAAwC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;IAC9E,CAAC;IAED,qBAAqB;IACrB,IAAI,EAAE,CAAC,MAAM,CAAS,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,kFAAkF;QAClF,OAAO,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { HttpErrorHelper } from \"@3sixty/api-models\";\nimport { BaseError, type IError, Is } from \"@3sixty/core\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\ttype IDataspaceProtocolCatalogError\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * Transform an error to Dataspace Protocol CatalogError format.\n * @param error The error to transform.\n * @returns A CatalogError object with the error code and flattened reason array.\n */\nexport function transformToCatalogError(error: unknown): IDataspaceProtocolCatalogError {\n\tconst flattened = BaseError.flatten(error);\n\n\t// We maintain the reason as the flattened array of errors for more context\n\t// this also helps preserve the original error messages and types\n\t// The code property can be any machine-readable string, we use the top-level error name\n\t// The schema allows for an array of any objects for the reason property\n\t// and is not limited to just strings or specific error formats\n\t// https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/blob/main/artifacts/src/main/resources/catalog/catalog-error-schema.json\n\treturn {\n\t\t\"@context\": DataspaceProtocolContexts.Context,\n\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogError,\n\t\tcode: `${flattened[0].name}:${flattened[0].message}`,\n\t\treason: flattened\n\t};\n}\n\n/**\n * Map a Dataspace Protocol result to an HTTP status code.\n * @param result The result to evaluate.\n * @returns The HTTP status code if the result is a CatalogError or an error object, otherwise undefined.\n */\nexport function transformErrorToStatusCode(result: unknown): HttpStatusCode | undefined {\n\t// Is this an catalog error?\n\tif (\n\t\tIs.object<IDataspaceProtocolCatalogError>(result) &&\n\t\tresult[\"@type\"] === DataspaceProtocolCatalogTypes.CatalogError\n\t) {\n\t\t// As per the method above the result.code is the IError name property\n\t\t// so we use that to map to status codes\n\t\tconst codePart = result.code.split(\":\")[0];\n\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[codePart] ?? HttpStatusCode.badRequest;\n\t}\n\n\t// Or a regular error\n\tif (Is.object<IError>(result) && !BaseError.isEmpty(result)) {\n\t\t// If this is a regular error, we can use the name property to map to status codes\n\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[result.name] ?? HttpStatusCode.badRequest;\n\t}\n\n\treturn undefined;\n}\n"]}
1
+ {"version":3,"file":"catalogErrorUtils.js","sources":["../../../src/utils/catalogErrorUtils.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAe,EAAE,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACrD,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,2EAA2E;IAC3E,iEAAiE;IACjE,wFAAwF;IACxF,wEAAwE;IACxE,+DAA+D;IAC/D,gJAAgJ;IAChJ,OAAO;QACN,UAAU,EAAE,yBAAyB,CAAC,OAAO;QAC7C,OAAO,EAAE,6BAA6B,CAAC,YAAY;QACnD,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;QACpD,MAAM,EAAE,SAAS;KACjB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAe;IACzD,4BAA4B;IAC5B,IACC,EAAE,CAAC,MAAM,CAAiC,MAAM,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,KAAK,6BAA6B,CAAC,YAAY,EAC7D,CAAC;QACF,sEAAsE;QACtE,wCAAwC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;IAC9E,CAAC;IAED,qBAAqB;IACrB,IAAI,EAAE,CAAC,MAAM,CAAS,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,kFAAkF;QAClF,OAAO,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { HttpErrorHelper } from \"@3sixty/api-models\";\nimport { BaseError, type IError, Is } from \"@3sixty/core\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\ttype IDataspaceProtocolCatalogError\n} from \"@3sixty/standards-dataspace-protocol\";\nimport { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * Transform an error to Dataspace Protocol CatalogError format.\n * @param error The error to transform.\n * @returns A CatalogError object with the error code and flattened reason array.\n */\nexport function transformToCatalogError(error: unknown): IDataspaceProtocolCatalogError {\n\tconst flattened = BaseError.flatten(error);\n\n\t// We maintain the reason as the flattened array of errors for more context\n\t// this also helps preserve the original error messages and types\n\t// The code property can be any machine-readable string, we use the top-level error name\n\t// The schema allows for an array of any objects for the reason property\n\t// and is not limited to just strings or specific error formats\n\t// https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/blob/main/artifacts/src/main/resources/catalog/catalog-error-schema.json\n\treturn {\n\t\t\"@context\": DataspaceProtocolContexts.Context,\n\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogError,\n\t\tcode: `${flattened[0].name}:${flattened[0].message}`,\n\t\treason: flattened\n\t};\n}\n\n/**\n * Map a Dataspace Protocol result to an HTTP status code.\n * @param result The result to evaluate.\n * @returns The HTTP status code if the result is a CatalogError or an error object, otherwise undefined.\n */\nexport function transformErrorToStatusCode(result: unknown): HttpStatusCode | undefined {\n\t// Is this an catalog error?\n\tif (\n\t\tIs.object<IDataspaceProtocolCatalogError>(result) &&\n\t\tresult[\"@type\"] === DataspaceProtocolCatalogTypes.CatalogError\n\t) {\n\t\t// As per the method above the result.code is the IError name property\n\t\t// so we use that to map to status codes\n\t\tconst codePart = result.code.split(\":\")[0];\n\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[codePart] ?? HttpStatusCode.badRequest;\n\t}\n\n\t// Or a regular error\n\tif (Is.object<IError>(result) && !BaseError.isEmpty(result)) {\n\t\t// If this is a regular error, we can use the name property to map to status codes\n\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[result.name] ?? HttpStatusCode.badRequest;\n\t}\n\n\treturn undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"datasetConverters.js","sourceRoot":"","sources":["../../../src/utils/datasetConverters.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAkC;IACtE,MAAM,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,6EAA6E;IAC7E,OAAO,KAAK,CAAC,EAAE,CAAC;IAChB,OAAO,KAAK,CAAC,OAAO,CAAC;IAErB,OAAO;QACN,GAAG,KAAK;QACR,KAAK,EAAE,EAAE;KACO,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAmB,EAAE,OAAe;IACxE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/C,OAAO;QACN,GAAG,YAAY;QACf,EAAE,EAAE,IAAI;QACR,OAAO;KACI,CAAC;AACd,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\nimport type { Dataset } from \"../entities/dataset.js\";\n\n/**\n * Convert a Dataset entity to an IDcatDataset model.\n * Maps entity.id back to model[\"@id\"] and strips the storage-only id field.\n * @param entity The dataset entity from storage (may be partial from query results).\n * @returns The IDcatDataset model for API responses.\n */\nexport function datasetEntityToModel(entity: Dataset | Partial<Dataset>): IDcatDataset {\n\tconst model = { ...entity };\n\tconst { id } = model;\n\n\t// Remove storage-specific fields that should not be exposed in the API model\n\tdelete model.id;\n\tdelete model.ownerId;\n\n\treturn {\n\t\t...model,\n\t\t\"@id\": id\n\t} as IDcatDataset;\n}\n\n/**\n * Convert an IDcatDataset model to a Dataset entity.\n * Maps model[\"@id\"] to entity.id.\n * @param model The IDcatDataset model from API requests.\n * @param ownerId The owner ID to associate with the dataset entity.\n * @returns The Dataset entity for storage.\n */\nexport function datasetModelToEntity(model: IDcatDataset, ownerId: string): Dataset {\n\tconst { \"@id\": atId, ...datasetModel } = model;\n\n\treturn {\n\t\t...datasetModel,\n\t\tid: atId,\n\t\townerId\n\t} as Dataset;\n}\n"]}
1
+ {"version":3,"file":"datasetConverters.js","sources":["../../../src/utils/datasetConverters.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAkC;IACtE,MAAM,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,6EAA6E;IAC7E,OAAO,KAAK,CAAC,EAAE,CAAC;IAChB,OAAO,KAAK,CAAC,OAAO,CAAC;IAErB,OAAO;QACN,GAAG,KAAK;QACR,KAAK,EAAE,EAAE;KACO,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAmB,EAAE,OAAe;IACxE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/C,OAAO;QACN,GAAG,YAAY;QACf,EAAE,EAAE,IAAI;QACR,OAAO;KACI,CAAC;AACd,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatDataset } from \"@3sixty/standards-w3c-dcat\";\nimport type { Dataset } from \"../entities/dataset.js\";\n\n/**\n * Convert a Dataset entity to an IDcatDataset model.\n * Maps entity.id back to model[\"@id\"] and strips the storage-only id field.\n * @param entity The dataset entity from storage (may be partial from query results).\n * @returns The IDcatDataset model for API responses.\n */\nexport function datasetEntityToModel(entity: Dataset | Partial<Dataset>): IDcatDataset {\n\tconst model = { ...entity };\n\tconst { id } = model;\n\n\t// Remove storage-specific fields that should not be exposed in the API model\n\tdelete model.id;\n\tdelete model.ownerId;\n\n\treturn {\n\t\t...model,\n\t\t\"@id\": id\n\t} as IDcatDataset;\n}\n\n/**\n * Convert an IDcatDataset model to a Dataset entity.\n * Maps model[\"@id\"] to entity.id.\n * @param model The IDcatDataset model from API requests.\n * @param ownerId The owner ID to associate with the dataset entity.\n * @returns The Dataset entity for storage.\n */\nexport function datasetModelToEntity(model: IDcatDataset, ownerId: string): Dataset {\n\tconst { \"@id\": atId, ...datasetModel } = model;\n\n\treturn {\n\t\t...datasetModel,\n\t\tid: atId,\n\t\townerId\n\t} as Dataset;\n}\n"]}
package/docs/changelog.md CHANGED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## [0.20.0-next.1](https://github.com/3sixtyglobal/federated-catalogue/compare/federated-catalogue-service-v0.20.0-next.0...federated-catalogue-service-v0.20.0-next.1) (2026-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * publish packages under the [@3sixty](https://github.com/3sixty) namespace ([79bdb62](https://github.com/3sixtyglobal/federated-catalogue/commit/79bdb626f38f05531692035fcb1b6316075516b6))
9
+ * updated ts compile ([9d539d3](https://github.com/3sixtyglobal/federated-catalogue/commit/9d539d356467b78109bb7392aa64861834d110ed))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @3sixty/federated-catalogue-models bumped from 0.20.0-next.0 to 0.20.0-next.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3sixty/federated-catalogue-service",
3
- "version": "0.20.0-next.0",
3
+ "version": "0.20.0-next.1",
4
4
  "description": "Federated Catalogue contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "@3sixty/data-json-ld": "next",
22
22
  "@3sixty/entity": "next",
23
23
  "@3sixty/entity-storage-models": "next",
24
- "@3sixty/federated-catalogue-models": "0.20.0-next.0",
24
+ "@3sixty/federated-catalogue-models": "0.20.0-next.1",
25
25
  "@3sixty/logging-models": "next",
26
26
  "@3sixty/nameof": "next",
27
27
  "@3sixty/standards-dataspace-protocol": "next",