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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/es/index.js +3 -4
  2. package/dist/es/index.js.map +1 -1
  3. package/dist/es/models/IFederatedCatalogueComponent.js.map +1 -1
  4. package/dist/es/models/IFederatedCatalogueFilter.js.map +1 -1
  5. package/dist/es/models/api/ICatalogRequestRequest.js.map +1 -1
  6. package/dist/es/models/api/ICatalogRequestResponse.js.map +1 -1
  7. package/dist/es/models/api/IGetDatasetResponse.js.map +1 -1
  8. package/dist/types/index.d.ts +3 -4
  9. package/dist/types/models/IFederatedCatalogueComponent.d.ts +22 -12
  10. package/dist/types/models/IFederatedCatalogueFilter.d.ts +3 -2
  11. package/dist/types/models/api/ICatalogRequestRequest.d.ts +14 -0
  12. package/dist/types/models/api/ICatalogRequestResponse.d.ts +18 -3
  13. package/dist/types/models/api/IGetDatasetResponse.d.ts +8 -2
  14. package/docs/changelog.md +7 -0
  15. package/docs/reference/index.md +0 -5
  16. package/docs/reference/interfaces/IBaseFilter.md +1 -1
  17. package/docs/reference/interfaces/ICatalogRequestRequest.md +21 -0
  18. package/docs/reference/interfaces/ICatalogRequestResponse.md +26 -2
  19. package/docs/reference/interfaces/IFederatedCatalogueComponent.md +28 -16
  20. package/docs/reference/interfaces/IFederatedCatalogueFilter.md +13 -2
  21. package/docs/reference/interfaces/IGetDatasetResponse.md +10 -2
  22. package/package.json +4 -3
  23. package/dist/es/models/federatedCatalogueContexts.js +0 -13
  24. package/dist/es/models/federatedCatalogueContexts.js.map +0 -1
  25. package/dist/types/models/federatedCatalogueContexts.d.ts +0 -13
  26. package/docs/reference/type-aliases/FederatedCatalogueContexts.md +0 -5
  27. package/docs/reference/variables/FederatedCatalogueContexts.md +0 -13
package/dist/es/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  // Copyright 2025 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
3
  export * from "./factories/federatedCatalogueFilterFactory.js";
4
- export * from "./models/federatedCatalogueContexts.js";
5
- export * from "./models/filters/IBaseFilter.js";
6
- export * from "./models/IFederatedCatalogueComponent.js";
7
- export * from "./models/IFederatedCatalogueFilter.js";
8
4
  export * from "./models/api/ICatalogRequestRequest.js";
9
5
  export * from "./models/api/ICatalogRequestResponse.js";
10
6
  export * from "./models/api/IGetDatasetRequest.js";
11
7
  export * from "./models/api/IGetDatasetResponse.js";
8
+ export * from "./models/filters/IBaseFilter.js";
9
+ export * from "./models/IFederatedCatalogueComponent.js";
10
+ export * from "./models/IFederatedCatalogueFilter.js";
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gDAAgD,CAAC;AAE/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/federatedCatalogueFilterFactory.js\";\n\nexport * from \"./models/federatedCatalogueContexts.js\";\nexport * from \"./models/filters/IBaseFilter.js\";\nexport * from \"./models/IFederatedCatalogueComponent.js\";\nexport * from \"./models/IFederatedCatalogueFilter.js\";\n\nexport * from \"./models/api/ICatalogRequestRequest.js\";\nexport * from \"./models/api/ICatalogRequestResponse.js\";\nexport * from \"./models/api/IGetDatasetRequest.js\";\nexport * from \"./models/api/IGetDatasetResponse.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/federatedCatalogueFilterFactory.js\";\nexport * from \"./models/api/ICatalogRequestRequest.js\";\nexport * from \"./models/api/ICatalogRequestResponse.js\";\nexport * from \"./models/api/IGetDatasetRequest.js\";\nexport * from \"./models/api/IGetDatasetResponse.js\";\nexport * from \"./models/filters/IBaseFilter.js\";\nexport * from \"./models/IFederatedCatalogueComponent.js\";\nexport * from \"./models/IFederatedCatalogueFilter.js\";\n"]}
@@ -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 { IDcatCatalog, 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.\n\t * @throws NotFoundError if the dataset does not exist.\n\t */\n\tget(dataSetId: string): Promise<IDcatDataset>;\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 complete DCAT Catalog object with proper JSON-LD context, metadata, and datasets.\n\t * Filter plugins must be registered in FilterFactory before service initialization.\n\t * The filter payload is evaluated by the appropriate filter plugin based on its structure.\n\t * Pagination properties (cursor, limit) and filter type (@type) should be included\n\t * within the filter object per Eclipse Dataspace Protocol JSON-LD extension patterns.\n\t * @param filter The filter criteria containing @type, optional cursor and limit properties.\n\t * @returns Complete ICatalog object with @context, @id, @type, dcat:dataset, and optional cursor.\n\t * @throws NotFoundError if the @type field is missing or if the filter type is not registered.\n\t */\n\tquery(filter?: unknown[]): Promise<IDcatCatalog>;\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 * @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 +1 @@
1
- {"version":3,"file":"IFederatedCatalogueFilter.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueFilter.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * Interface describing a filter plugin for the federated catalogue.\n * Filter plugins provide extensible query semantics and indexing strategies.\n * Filters are registered by name in the FilterFactory and do not need to self-identify.\n */\nexport interface IFederatedCatalogueFilter extends IComponent {\n\t/**\n\t * Execute a filter-specific query over the catalogue.\n\t * Each filter interprets the payload according to its own semantics.\n\t * Pagination properties (cursor, limit) are extracted from the filter object by the service layer.\n\t * @param filter The filter criteria (structure depends on the filter implementation).\n\t * @returns Object containing datasets matching the filter criteria and optional cursor for next page.\n\t */\n\tquery(filter: unknown): Promise<{ datasets: IDcatDataset[]; cursor?: string }>;\n\n\t/**\n\t * Generate filter indexes for a dataset to optimize future queries.\n\t * Indexes are stored as properties on the dataset entity itself.\n\t * @param dataSet The dataset to index.\n\t * @returns Record mapping filter-specific index keys to values.\n\t */\n\tcreateIndex(dataSet: IDcatDataset): Promise<{ [key: string]: unknown }>;\n}\n"]}
1
+ {"version":3,"file":"IFederatedCatalogueFilter.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueFilter.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * Interface describing a filter plugin for the federated catalogue.\n * Filter plugins provide extensible query semantics and indexing strategies.\n * Filters are registered by name in the FilterFactory and do not need to self-identify.\n */\nexport interface IFederatedCatalogueFilter extends IComponent {\n\t/**\n\t * Execute a filter-specific query over the catalogue.\n\t * Each filter interprets the payload according to its own semantics.\n\t * @param filter The filter criteria (structure depends on the filter implementation).\n\t * @param cursor The pagination cursor from the previous query, if any.\n\t * @param limit The maximum number of results to return.\n\t * @returns Object containing datasets matching the filter criteria and optional cursor for next page.\n\t */\n\tquery(\n\t\tfilter: unknown,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{ datasets: IDcatDataset[]; cursor?: string }>;\n\n\t/**\n\t * Generate filter indexes for a dataset to optimize future queries.\n\t * Indexes are stored as properties on the dataset entity itself.\n\t * @param dataSet The dataset to index.\n\t * @returns Record mapping filter-specific index keys to values.\n\t */\n\tcreateIndex(dataSet: IDcatDataset): Promise<{ [key: string]: unknown }>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ICatalogRequestRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ICatalogRequestRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDataspaceProtocolCatalogRequestMessage } from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * The request parameters for the catalog request method.\n */\nexport interface ICatalogRequestRequest {\n\t/**\n\t * The request body containing the catalog query.\n\t */\n\tbody: IDataspaceProtocolCatalogRequestMessage;\n}\n"]}
1
+ {"version":3,"file":"ICatalogRequestRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ICatalogRequestRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDataspaceProtocolCatalogRequestMessage } from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * The request parameters for the catalog request method.\n */\nexport interface ICatalogRequestRequest {\n\t/**\n\t * The request body containing the catalog query.\n\t */\n\tbody: IDataspaceProtocolCatalogRequestMessage;\n\n\t/**\n\t * Optional query parameters for pagination.\n\t * Used when following Link header URLs per DS Protocol spec.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Opaque cursor token for pagination.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit for pagination.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ICatalogRequestResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ICatalogRequestResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatCatalog } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * The response payload for the catalog request method.\n */\nexport interface ICatalogRequestResponse {\n\t/**\n\t * The response payload containing the catalog with matching datasets.\n\t */\n\tbody: IDcatCatalog;\n}\n"]}
1
+ {"version":3,"file":"ICatalogRequestResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ICatalogRequestResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tIDataspaceProtocolCatalog,\n\tIDataspaceProtocolCatalogError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { HeaderTypes, HttpStatusCode } from \"@twin.org/web\";\n\n/**\n * The response payload for the catalog request method.\n * Returns a DS Protocol compliant Catalog with participantId, or CatalogError if no datasets found.\n */\nexport interface ICatalogRequestResponse {\n\t/**\n\t * Response status code.\n\t * Per DS Protocol: Returns appropriate HTTP code (e.g., 404) when returning CatalogError.\n\t */\n\tstatusCode?: HttpStatusCode;\n\n\t/**\n\t * The response payload containing the DS Protocol compliant catalog with participantId,\n\t * or a CatalogError if no datasets are found (404).\n\t * Per DS Protocol: Single participant returns flat catalog, multiple participants return nested catalogs.\n\t */\n\tbody: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\n\t/**\n\t * Optional headers including RFC 8288 Link header for pagination.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Link]?: string | string[];\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IGetDatasetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IGetDatasetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * The response payload for the get dataset method.\n */\nexport interface IGetDatasetResponse {\n\t/**\n\t * The response payload containing the dataset.\n\t */\n\tbody: IDcatDataset;\n}\n"]}
1
+ {"version":3,"file":"IGetDatasetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IGetDatasetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDataspaceProtocolCatalogError } from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\nimport type { HttpStatusCode } from \"@twin.org/web\";\n\n/**\n * The response payload for the get dataset method.\n */\nexport interface IGetDatasetResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode?: HttpStatusCode;\n\n\t/**\n\t * The response payload containing the dataset or error.\n\t */\n\tbody: IDcatDataset | IDataspaceProtocolCatalogError;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  export * from "./factories/federatedCatalogueFilterFactory.js";
2
- export * from "./models/federatedCatalogueContexts.js";
3
- export * from "./models/filters/IBaseFilter.js";
4
- export * from "./models/IFederatedCatalogueComponent.js";
5
- export * from "./models/IFederatedCatalogueFilter.js";
6
2
  export * from "./models/api/ICatalogRequestRequest.js";
7
3
  export * from "./models/api/ICatalogRequestResponse.js";
8
4
  export * from "./models/api/IGetDatasetRequest.js";
9
5
  export * from "./models/api/IGetDatasetResponse.js";
6
+ export * from "./models/filters/IBaseFilter.js";
7
+ export * from "./models/IFederatedCatalogueComponent.js";
8
+ export * from "./models/IFederatedCatalogueFilter.js";
@@ -1,5 +1,6 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
- import type { IDcatCatalog, IDcatDataset } from "@twin.org/standards-w3c-dcat";
2
+ import type { IDataspaceProtocolCatalog, IDataspaceProtocolCatalogError } from "@twin.org/standards-dataspace-protocol";
3
+ import type { IDcatDataset } from "@twin.org/standards-w3c-dcat";
3
4
  /**
4
5
  * Interface describing a federated catalogue component.
5
6
  * Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and query.
@@ -8,10 +9,9 @@ export interface IFederatedCatalogueComponent extends IComponent {
8
9
  /**
9
10
  * Retrieve a dataset by its unique identifier.
10
11
  * @param dataSetId The unique identifier of the dataset.
11
- * @returns The dataset if found.
12
- * @throws NotFoundError if the dataset does not exist.
12
+ * @returns The dataset if found, or a CatalogError if not found or an error occurs.
13
13
  */
14
- get(dataSetId: string): Promise<IDcatDataset>;
14
+ get(dataSetId: string): Promise<IDcatDataset | IDataspaceProtocolCatalogError>;
15
15
  /**
16
16
  * Insert or update a dataset in the catalogue.
17
17
  * This method is internal and should not be exposed via REST endpoints.
@@ -21,16 +21,26 @@ export interface IFederatedCatalogueComponent extends IComponent {
21
21
  set(dataSet: IDcatDataset): Promise<void>;
22
22
  /**
23
23
  * Execute a query against the catalogue using registered filter plugins.
24
- * Returns a complete DCAT Catalog object with proper JSON-LD context, metadata, and datasets.
25
- * Filter plugins must be registered in FilterFactory before service initialization.
26
- * The filter payload is evaluated by the appropriate filter plugin based on its structure.
27
- * Pagination properties (cursor, limit) and filter type (@type) should be included
28
- * within the filter object per Eclipse Dataspace Protocol JSON-LD extension patterns.
29
- * @param filter The filter criteria containing @type, optional cursor and limit properties.
30
- * @returns Complete ICatalog object with @context, @id, @type, dcat:dataset, and optional cursor.
24
+ * Returns a DS Protocol compliant Catalog object with participantId.
25
+ *
26
+ * The root catalog's participantId is the requesting participant (from context).
27
+ * Own datasets (matching requestingParticipantId) go directly in root dataset[].
28
+ * Other participants' datasets are grouped in nested catalog[] entries.
29
+ *
30
+ * For anonymous requests (no context), uses the first publisher found as fallback.
31
+ * Returns CatalogError 404 when no datasets exist.
32
+ *
33
+ * @param filter The filter criteria containing @type.
34
+ * @param cursor Optional cursor for pagination.
35
+ * @param limit Optional limit for pagination.
36
+ * @returns Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
37
+ * or IDataspaceProtocolCatalogError if no datasets found.
31
38
  * @throws NotFoundError if the @type field is missing or if the filter type is not registered.
32
39
  */
33
- query(filter?: unknown[]): Promise<IDcatCatalog>;
40
+ query(filter?: unknown[], cursor?: string, limit?: number): Promise<{
41
+ catalog: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
42
+ cursor?: string;
43
+ }>;
34
44
  /**
35
45
  * Remove a dataset from the catalogue by its unique identifier.
36
46
  * @param dataSetId The unique identifier of the dataset to remove.
@@ -9,11 +9,12 @@ export interface IFederatedCatalogueFilter extends IComponent {
9
9
  /**
10
10
  * Execute a filter-specific query over the catalogue.
11
11
  * Each filter interprets the payload according to its own semantics.
12
- * Pagination properties (cursor, limit) are extracted from the filter object by the service layer.
13
12
  * @param filter The filter criteria (structure depends on the filter implementation).
13
+ * @param cursor The pagination cursor from the previous query, if any.
14
+ * @param limit The maximum number of results to return.
14
15
  * @returns Object containing datasets matching the filter criteria and optional cursor for next page.
15
16
  */
16
- query(filter: unknown): Promise<{
17
+ query(filter: unknown, cursor?: string, limit?: number): Promise<{
17
18
  datasets: IDcatDataset[];
18
19
  cursor?: string;
19
20
  }>;
@@ -7,4 +7,18 @@ export interface ICatalogRequestRequest {
7
7
  * The request body containing the catalog query.
8
8
  */
9
9
  body: IDataspaceProtocolCatalogRequestMessage;
10
+ /**
11
+ * Optional query parameters for pagination.
12
+ * Used when following Link header URLs per DS Protocol spec.
13
+ */
14
+ query?: {
15
+ /**
16
+ * Opaque cursor token for pagination.
17
+ */
18
+ cursor?: string;
19
+ /**
20
+ * Limit for pagination.
21
+ */
22
+ limit?: string;
23
+ };
10
24
  }
@@ -1,10 +1,25 @@
1
- import type { IDcatCatalog } from "@twin.org/standards-w3c-dcat";
1
+ import type { IDataspaceProtocolCatalog, IDataspaceProtocolCatalogError } from "@twin.org/standards-dataspace-protocol";
2
+ import type { HeaderTypes, HttpStatusCode } from "@twin.org/web";
2
3
  /**
3
4
  * The response payload for the catalog request method.
5
+ * Returns a DS Protocol compliant Catalog with participantId, or CatalogError if no datasets found.
4
6
  */
5
7
  export interface ICatalogRequestResponse {
6
8
  /**
7
- * The response payload containing the catalog with matching datasets.
9
+ * Response status code.
10
+ * Per DS Protocol: Returns appropriate HTTP code (e.g., 404) when returning CatalogError.
8
11
  */
9
- body: IDcatCatalog;
12
+ statusCode?: HttpStatusCode;
13
+ /**
14
+ * The response payload containing the DS Protocol compliant catalog with participantId,
15
+ * or a CatalogError if no datasets are found (404).
16
+ * Per DS Protocol: Single participant returns flat catalog, multiple participants return nested catalogs.
17
+ */
18
+ body: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
19
+ /**
20
+ * Optional headers including RFC 8288 Link header for pagination.
21
+ */
22
+ headers?: {
23
+ [HeaderTypes.Link]?: string | string[];
24
+ };
10
25
  }
@@ -1,10 +1,16 @@
1
+ import type { IDataspaceProtocolCatalogError } from "@twin.org/standards-dataspace-protocol";
1
2
  import type { IDcatDataset } from "@twin.org/standards-w3c-dcat";
3
+ import type { HttpStatusCode } from "@twin.org/web";
2
4
  /**
3
5
  * The response payload for the get dataset method.
4
6
  */
5
7
  export interface IGetDatasetResponse {
6
8
  /**
7
- * The response payload containing the dataset.
9
+ * Response status code.
8
10
  */
9
- body: IDcatDataset;
11
+ statusCode?: HttpStatusCode;
12
+ /**
13
+ * The response payload containing the dataset or error.
14
+ */
15
+ body: IDcatDataset | IDataspaceProtocolCatalogError;
10
16
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @twin.org/federated-catalogue-models - Changelog
2
2
 
3
+ ## [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
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * pagination and ld context ([#45](https://github.com/twinfoundation/federated-catalogue/issues/45)) ([e36f096](https://github.com/twinfoundation/federated-catalogue/commit/e36f096aa4fdc61eb5b929a0fc4403247dbd41ce))
9
+
3
10
  ## [0.0.3-next.4](https://github.com/twinfoundation/federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.3...federated-catalogue-models-v0.0.3-next.4) (2026-01-06)
4
11
 
5
12
 
@@ -10,11 +10,6 @@
10
10
  - [IGetDatasetResponse](interfaces/IGetDatasetResponse.md)
11
11
  - [IBaseFilter](interfaces/IBaseFilter.md)
12
12
 
13
- ## Type Aliases
14
-
15
- - [FederatedCatalogueContexts](type-aliases/FederatedCatalogueContexts.md)
16
-
17
13
  ## Variables
18
14
 
19
15
  - [FederatedCatalogueFilterFactory](variables/FederatedCatalogueFilterFactory.md)
20
- - [FederatedCatalogueContexts](variables/FederatedCatalogueContexts.md)
@@ -17,7 +17,7 @@ to define its own filter-specific properties.
17
17
 
18
18
  ## Indexable
19
19
 
20
- \[`key`: `string`\]: `string` \| `number` \| `boolean` \| `IJsonLdNodeObject` \| `IJsonLdGraphObject` \| `object` & `object` \| `object` & `object` \| `object` & `object` \| `IJsonLdListObject` \| `IJsonLdSetObject` \| `IJsonLdNodePrimitive`[] \| `IJsonLdLanguageMap` \| `IJsonLdIndexMap` \| `IJsonLdNodeObject`[] \| `IJsonLdIdMap` \| `IJsonLdTypeMap` \| `IJsonLdContextDefinition` \| `IJsonLdContextDefinitionElement`[] \| `string`[] \| `IJsonLdJsonObject` \| `IJsonLdJsonObject`[] \| \{\[`key`: `string`\]: `string`; \} \| `null` \| `undefined`
20
+ \[`key`: `string`\]: `string` \| `number` \| `boolean` \| `IJsonLdNodeObject` \| `string`[] \| `IJsonLdGraphObject` \| `object` & `object` \| `object` & `object` \| `object` & `object` \| `IJsonLdListObject` \| `IJsonLdSetObject` \| `IJsonLdNodePrimitive`[] \| `IJsonLdLanguageMap` \| `IJsonLdIndexMap` \| `IJsonLdNodeObject`[] \| `IJsonLdIdMap` \| `IJsonLdTypeMap` \| `IJsonLdContextDefinition` \| `IJsonLdContextDefinitionElement`[] \| `IJsonLdJsonObject` \| `IJsonLdJsonObject`[] \| \{\[`key`: `string`\]: `string`; \} \| `null` \| `undefined`
21
21
 
22
22
  ## Properties
23
23
 
@@ -9,3 +9,24 @@ The request parameters for the catalog request method.
9
9
  > **body**: `IDataspaceProtocolCatalogRequestMessage`
10
10
 
11
11
  The request body containing the catalog query.
12
+
13
+ ***
14
+
15
+ ### query?
16
+
17
+ > `optional` **query**: `object`
18
+
19
+ Optional query parameters for pagination.
20
+ Used when following Link header URLs per DS Protocol spec.
21
+
22
+ #### cursor?
23
+
24
+ > `optional` **cursor**: `string`
25
+
26
+ Opaque cursor token for pagination.
27
+
28
+ #### limit?
29
+
30
+ > `optional` **limit**: `string`
31
+
32
+ Limit for pagination.
@@ -1,11 +1,35 @@
1
1
  # Interface: ICatalogRequestResponse
2
2
 
3
3
  The response payload for the catalog request method.
4
+ Returns a DS Protocol compliant Catalog with participantId, or CatalogError if no datasets found.
4
5
 
5
6
  ## Properties
6
7
 
8
+ ### statusCode?
9
+
10
+ > `optional` **statusCode**: `HttpStatusCode`
11
+
12
+ Response status code.
13
+ Per DS Protocol: Returns appropriate HTTP code (e.g., 404) when returning CatalogError.
14
+
15
+ ***
16
+
7
17
  ### body
8
18
 
9
- > **body**: `IDcatCatalog`
19
+ > **body**: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`
20
+
21
+ The response payload containing the DS Protocol compliant catalog with participantId,
22
+ or a CatalogError if no datasets are found (404).
23
+ Per DS Protocol: Single participant returns flat catalog, multiple participants return nested catalogs.
24
+
25
+ ***
26
+
27
+ ### headers?
28
+
29
+ > `optional` **headers**: `object`
30
+
31
+ Optional headers including RFC 8288 Link header for pagination.
32
+
33
+ #### link?
10
34
 
11
- The response payload containing the catalog with matching datasets.
35
+ > `optional` **link**: `string` \| `string`[]
@@ -11,7 +11,7 @@ Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and
11
11
 
12
12
  ### get()
13
13
 
14
- > **get**(`dataSetId`): `Promise`\<`IDcatDataset`\>
14
+ > **get**(`dataSetId`): `Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
15
15
 
16
16
  Retrieve a dataset by its unique identifier.
17
17
 
@@ -25,13 +25,9 @@ The unique identifier of the dataset.
25
25
 
26
26
  #### Returns
27
27
 
28
- `Promise`\<`IDcatDataset`\>
28
+ `Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
29
29
 
30
- The dataset if found.
31
-
32
- #### Throws
33
-
34
- NotFoundError if the dataset does not exist.
30
+ The dataset if found, or a CatalogError if not found or an error occurs.
35
31
 
36
32
  ***
37
33
 
@@ -60,14 +56,17 @@ Nothing.
60
56
 
61
57
  ### query()
62
58
 
63
- > **query**(`filter?`): `Promise`\<`IDcatCatalog`\>
59
+ > **query**(`filter?`, `cursor?`, `limit?`): `Promise`\<\{ `catalog`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
64
60
 
65
61
  Execute a query against the catalogue using registered filter plugins.
66
- Returns a complete DCAT Catalog object with proper JSON-LD context, metadata, and datasets.
67
- Filter plugins must be registered in FilterFactory before service initialization.
68
- The filter payload is evaluated by the appropriate filter plugin based on its structure.
69
- Pagination properties (cursor, limit) and filter type (@type) should be included
70
- within the filter object per Eclipse Dataspace Protocol JSON-LD extension patterns.
62
+ Returns a DS Protocol compliant Catalog object with participantId.
63
+
64
+ The root catalog's participantId is the requesting participant (from context).
65
+ Own datasets (matching requestingParticipantId) go directly in root dataset[].
66
+ Other participants' datasets are grouped in nested catalog[] entries.
67
+
68
+ For anonymous requests (no context), uses the first publisher found as fallback.
69
+ Returns CatalogError 404 when no datasets exist.
71
70
 
72
71
  #### Parameters
73
72
 
@@ -75,13 +74,26 @@ within the filter object per Eclipse Dataspace Protocol JSON-LD extension patter
75
74
 
76
75
  `unknown`[]
77
76
 
78
- The filter criteria containing @type, optional cursor and limit properties.
77
+ The filter criteria containing @type.
78
+
79
+ ##### cursor?
80
+
81
+ `string`
82
+
83
+ Optional cursor for pagination.
84
+
85
+ ##### limit?
86
+
87
+ `number`
88
+
89
+ Optional limit for pagination.
79
90
 
80
91
  #### Returns
81
92
 
82
- `Promise`\<`IDcatCatalog`\>
93
+ `Promise`\<\{ `catalog`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
83
94
 
84
- Complete ICatalog object with @context, @id, @type, dcat:dataset, and optional cursor.
95
+ Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
96
+ or IDataspaceProtocolCatalogError if no datasets found.
85
97
 
86
98
  #### Throws
87
99
 
@@ -12,11 +12,10 @@ Filters are registered by name in the FilterFactory and do not need to self-iden
12
12
 
13
13
  ### query()
14
14
 
15
- > **query**(`filter`): `Promise`\<\{ `datasets`: `IDcatDataset`[]; `cursor?`: `string`; \}\>
15
+ > **query**(`filter`, `cursor?`, `limit?`): `Promise`\<\{ `datasets`: `IDcatDataset`[]; `cursor?`: `string`; \}\>
16
16
 
17
17
  Execute a filter-specific query over the catalogue.
18
18
  Each filter interprets the payload according to its own semantics.
19
- Pagination properties (cursor, limit) are extracted from the filter object by the service layer.
20
19
 
21
20
  #### Parameters
22
21
 
@@ -26,6 +25,18 @@ Pagination properties (cursor, limit) are extracted from the filter object by th
26
25
 
27
26
  The filter criteria (structure depends on the filter implementation).
28
27
 
28
+ ##### cursor?
29
+
30
+ `string`
31
+
32
+ The pagination cursor from the previous query, if any.
33
+
34
+ ##### limit?
35
+
36
+ `number`
37
+
38
+ The maximum number of results to return.
39
+
29
40
  #### Returns
30
41
 
31
42
  `Promise`\<\{ `datasets`: `IDcatDataset`[]; `cursor?`: `string`; \}\>
@@ -4,8 +4,16 @@ The response payload for the get dataset method.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### statusCode?
8
+
9
+ > `optional` **statusCode**: `HttpStatusCode`
10
+
11
+ Response status code.
12
+
13
+ ***
14
+
7
15
  ### body
8
16
 
9
- > **body**: `IDcatDataset`
17
+ > **body**: `IDcatDataset` \| `IDataspaceProtocolCatalogError`
10
18
 
11
- The response payload containing the dataset.
19
+ The response payload containing the dataset or error.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@twin.org/federated-catalogue-models",
3
- "version": "0.0.3-next.4",
3
+ "version": "0.0.3-next.5",
4
4
  "description": "Models which define the structure of the Federated Catalogue Service",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/twinfoundation/federated-catalogue.git",
8
8
  "directory": "packages/federated-catalogue-models"
9
9
  },
10
- "author": "jose.cantera@iota.org",
10
+ "author": "cornel.filip@iota.org",
11
11
  "license": "Apache-2.0",
12
12
  "type": "module",
13
13
  "engines": {
@@ -20,7 +20,8 @@
20
20
  "@twin.org/entity": "next",
21
21
  "@twin.org/nameof": "next",
22
22
  "@twin.org/standards-dataspace-protocol": "next",
23
- "@twin.org/standards-w3c-dcat": "next"
23
+ "@twin.org/standards-w3c-dcat": "next",
24
+ "@twin.org/web": "next"
24
25
  },
25
26
  "main": "./dist/es/index.js",
26
27
  "types": "./dist/types/index.d.ts",
@@ -1,13 +0,0 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
- /**
4
- * The contexts of federated catalogue data.
5
- */
6
- // eslint-disable-next-line @typescript-eslint/naming-convention
7
- export const FederatedCatalogueContexts = {
8
- /**
9
- * The context root for the federated catalogue types.
10
- */
11
- ContextRoot: "https://schema.twindev.org/federated-catalogue/"
12
- };
13
- //# sourceMappingURL=federatedCatalogueContexts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"federatedCatalogueContexts.js","sourceRoot":"","sources":["../../../src/models/federatedCatalogueContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC;;OAEG;IACH,WAAW,EAAE,iDAAiD;CACrD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of federated catalogue data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FederatedCatalogueContexts = {\n\t/**\n\t * The context root for the federated catalogue types.\n\t */\n\tContextRoot: \"https://schema.twindev.org/federated-catalogue/\"\n} as const;\n\n/**\n * The contexts of federated catalogue data.\n */\nexport type FederatedCatalogueContexts =\n\t(typeof FederatedCatalogueContexts)[keyof typeof FederatedCatalogueContexts];\n"]}
@@ -1,13 +0,0 @@
1
- /**
2
- * The contexts of federated catalogue data.
3
- */
4
- export declare const FederatedCatalogueContexts: {
5
- /**
6
- * The context root for the federated catalogue types.
7
- */
8
- readonly ContextRoot: "https://schema.twindev.org/federated-catalogue/";
9
- };
10
- /**
11
- * The contexts of federated catalogue data.
12
- */
13
- export type FederatedCatalogueContexts = (typeof FederatedCatalogueContexts)[keyof typeof FederatedCatalogueContexts];
@@ -1,5 +0,0 @@
1
- # Type Alias: FederatedCatalogueContexts
2
-
3
- > **FederatedCatalogueContexts** = *typeof* [`FederatedCatalogueContexts`](../variables/FederatedCatalogueContexts.md)\[keyof *typeof* [`FederatedCatalogueContexts`](../variables/FederatedCatalogueContexts.md)\]
4
-
5
- The contexts of federated catalogue data.
@@ -1,13 +0,0 @@
1
- # Variable: FederatedCatalogueContexts
2
-
3
- > `const` **FederatedCatalogueContexts**: `object`
4
-
5
- The contexts of federated catalogue data.
6
-
7
- ## Type Declaration
8
-
9
- ### ContextRoot
10
-
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/federated-catalogue/"` = `"https://schema.twindev.org/federated-catalogue/"`
12
-
13
- The context root for the federated catalogue types.