@twin.org/federated-catalogue-models 0.0.3-next.5 → 0.0.3-next.6

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":"IFederatedCatalogueComponent.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tIDataspaceProtocolCatalog,\n\tIDataspaceProtocolCatalogError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * Interface describing a federated catalogue component.\n * Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and query.\n */\nexport interface IFederatedCatalogueComponent extends IComponent {\n\t/**\n\t * Retrieve a dataset by its unique identifier.\n\t * @param dataSetId The unique identifier of the dataset.\n\t * @returns The dataset if found, or a CatalogError if not found or an error occurs.\n\t */\n\tget(dataSetId: string): Promise<IDcatDataset | IDataspaceProtocolCatalogError>;\n\n\t/**\n\t * Insert or update a dataset in the catalogue.\n\t * This method is internal and should not be exposed via REST endpoints.\n\t * @param dataSet The dataset to store.\n\t * @returns Nothing.\n\t */\n\tset(dataSet: IDcatDataset): Promise<void>;\n\n\t/**\n\t * Execute a query against the catalogue using registered filter plugins.\n\t * Returns a DS 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 CatalogError 404 when no datasets exist.\n\t *\n\t * @param filter The filter criteria containing @type.\n\t * @param cursor Optional cursor for pagination.\n\t * @param limit Optional limit for pagination.\n\t * @returns Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,\n\t * or IDataspaceProtocolCatalogError if no datasets found.\n\t * @throws NotFoundError if the @type field is missing or if the filter type is not registered.\n\t */\n\tquery(\n\t\tfilter?: unknown[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tcatalog: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Remove a dataset from the catalogue by its unique identifier.\n\t * @param dataSetId The unique identifier of the dataset to remove.\n\t * @returns Nothing.\n\t */\n\tremove(dataSetId: string): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"IFederatedCatalogueComponent.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tIDataspaceProtocolCatalog,\n\tIDataspaceProtocolCatalogError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * Interface describing a federated catalogue component.\n * Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and query.\n */\nexport interface IFederatedCatalogueComponent extends IComponent {\n\t/**\n\t * Retrieve a dataset by its unique identifier.\n\t * @param dataSetId The unique identifier of the dataset.\n\t * @returns The dataset if found, or a CatalogError if not found or an error occurs.\n\t */\n\tget(dataSetId: string): Promise<IDcatDataset | IDataspaceProtocolCatalogError>;\n\n\t/**\n\t * Insert or update a dataset in the catalogue.\n\t * This method is internal and should not be exposed via REST endpoints.\n\t * @param dataSet The dataset to store.\n\t * @returns Nothing.\n\t */\n\tset(dataSet: IDcatDataset): Promise<void>;\n\n\t/**\n\t * Execute a query against the catalogue using registered filter plugins.\n\t * Returns a DS 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 CatalogError 404 when no datasets exist.\n\t *\n\t * @param filter The filter criteria containing @type.\n\t * @param cursor Optional cursor for pagination.\n\t * @param limit Optional limit for pagination.\n\t * @returns Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,\n\t * or IDataspaceProtocolCatalogError if no datasets found.\n\t */\n\tquery(\n\t\tfilter?: unknown[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tresult: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Remove a dataset from the catalogue by its unique identifier.\n\t * @param dataSetId The unique identifier of the dataset to remove.\n\t * @returns Nothing.\n\t */\n\tremove(dataSetId: string): Promise<void>;\n}\n"]}
@@ -35,10 +35,9 @@ export interface IFederatedCatalogueComponent extends IComponent {
35
35
  * @param limit Optional limit for pagination.
36
36
  * @returns Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
37
37
  * or IDataspaceProtocolCatalogError if no datasets found.
38
- * @throws NotFoundError if the @type field is missing or if the filter type is not registered.
39
38
  */
40
39
  query(filter?: unknown[], cursor?: string, limit?: number): Promise<{
41
- catalog: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
40
+ result: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
42
41
  cursor?: string;
43
42
  }>;
44
43
  /**
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @twin.org/federated-catalogue-models - Changelog
2
2
 
3
+ ## [0.0.3-next.6](https://github.com/twinfoundation/federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.5...federated-catalogue-models-v0.0.3-next.6) (2026-01-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * transform GuardError to CatalogError for DS Protocol compliance ([#49](https://github.com/twinfoundation/federated-catalogue/issues/49)) ([d0f1090](https://github.com/twinfoundation/federated-catalogue/commit/d0f10900c251b9abc18e58c90562c393c3265727))
9
+
3
10
  ## [0.0.3-next.5](https://github.com/twinfoundation/federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.4...federated-catalogue-models-v0.0.3-next.5) (2026-01-15)
4
11
 
5
12
 
@@ -56,7 +56,7 @@ Nothing.
56
56
 
57
57
  ### query()
58
58
 
59
- > **query**(`filter?`, `cursor?`, `limit?`): `Promise`\<\{ `catalog`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
59
+ > **query**(`filter?`, `cursor?`, `limit?`): `Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
60
60
 
61
61
  Execute a query against the catalogue using registered filter plugins.
62
62
  Returns a DS Protocol compliant Catalog object with participantId.
@@ -90,15 +90,11 @@ Optional limit for pagination.
90
90
 
91
91
  #### Returns
92
92
 
93
- `Promise`\<\{ `catalog`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
93
+ `Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
94
94
 
95
95
  Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
96
96
  or IDataspaceProtocolCatalogError if no datasets found.
97
97
 
98
- #### Throws
99
-
100
- NotFoundError if the
101
-
102
98
  ***
103
99
 
104
100
  ### remove()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/federated-catalogue-models",
3
- "version": "0.0.3-next.5",
3
+ "version": "0.0.3-next.6",
4
4
  "description": "Models which define the structure of the Federated Catalogue Service",
5
5
  "repository": {
6
6
  "type": "git",