@twin.org/federated-catalogue-models 0.0.3-next.4 → 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.
- package/dist/es/index.js +3 -4
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IFederatedCatalogueComponent.js.map +1 -1
- package/dist/es/models/IFederatedCatalogueFilter.js.map +1 -1
- package/dist/es/models/api/ICatalogRequestRequest.js.map +1 -1
- package/dist/es/models/api/ICatalogRequestResponse.js.map +1 -1
- package/dist/es/models/api/IGetDatasetResponse.js.map +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/types/models/IFederatedCatalogueComponent.d.ts +22 -13
- package/dist/types/models/IFederatedCatalogueFilter.d.ts +3 -2
- package/dist/types/models/api/ICatalogRequestRequest.d.ts +14 -0
- package/dist/types/models/api/ICatalogRequestResponse.d.ts +18 -3
- package/dist/types/models/api/IGetDatasetResponse.d.ts +8 -2
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +0 -5
- package/docs/reference/interfaces/IBaseFilter.md +1 -1
- package/docs/reference/interfaces/ICatalogRequestRequest.md +21 -0
- package/docs/reference/interfaces/ICatalogRequestResponse.md +26 -2
- package/docs/reference/interfaces/IFederatedCatalogueComponent.md +27 -19
- package/docs/reference/interfaces/IFederatedCatalogueFilter.md +13 -2
- package/docs/reference/interfaces/IGetDatasetResponse.md +10 -2
- package/package.json +4 -3
- package/dist/es/models/federatedCatalogueContexts.js +0 -13
- package/dist/es/models/federatedCatalogueContexts.js.map +0 -1
- package/dist/types/models/federatedCatalogueContexts.d.ts +0 -13
- package/docs/reference/type-aliases/FederatedCatalogueContexts.md +0 -5
- 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
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gDAAgD,CAAC;
|
|
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 {
|
|
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"]}
|
|
@@ -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 *
|
|
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 {
|
|
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"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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 {
|
|
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,25 @@ 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
|
|
25
|
-
*
|
|
26
|
-
* The
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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.
|
|
32
38
|
*/
|
|
33
|
-
query(filter?: unknown[]): Promise<
|
|
39
|
+
query(filter?: unknown[], cursor?: string, limit?: number): Promise<{
|
|
40
|
+
result: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
|
|
41
|
+
cursor?: string;
|
|
42
|
+
}>;
|
|
34
43
|
/**
|
|
35
44
|
* Remove a dataset from the catalogue by its unique identifier.
|
|
36
45
|
* @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 {
|
|
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
|
-
*
|
|
9
|
+
* Response status code.
|
|
10
|
+
* Per DS Protocol: Returns appropriate HTTP code (e.g., 404) when returning CatalogError.
|
|
8
11
|
*/
|
|
9
|
-
|
|
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
|
-
*
|
|
9
|
+
* Response status code.
|
|
8
10
|
*/
|
|
9
|
-
|
|
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,19 @@
|
|
|
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
|
+
|
|
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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* pagination and ld context ([#45](https://github.com/twinfoundation/federated-catalogue/issues/45)) ([e36f096](https://github.com/twinfoundation/federated-catalogue/commit/e36f096aa4fdc61eb5b929a0fc4403247dbd41ce))
|
|
16
|
+
|
|
3
17
|
## [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
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -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`[] \| `
|
|
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**: `
|
|
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
|
-
|
|
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
|
|
59
|
+
> **query**(`filter?`, `cursor?`, `limit?`): `Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
64
60
|
|
|
65
61
|
Execute a query against the catalogue using registered filter plugins.
|
|
66
|
-
Returns a
|
|
67
|
-
|
|
68
|
-
The
|
|
69
|
-
|
|
70
|
-
|
|
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,17 +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
|
|
77
|
+
The filter criteria containing @type.
|
|
79
78
|
|
|
80
|
-
|
|
79
|
+
##### cursor?
|
|
81
80
|
|
|
82
|
-
`
|
|
81
|
+
`string`
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
Optional cursor for pagination.
|
|
84
|
+
|
|
85
|
+
##### limit?
|
|
86
|
+
|
|
87
|
+
`number`
|
|
88
|
+
|
|
89
|
+
Optional limit for pagination.
|
|
90
|
+
|
|
91
|
+
#### Returns
|
|
85
92
|
|
|
86
|
-
|
|
93
|
+
`Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
|
|
96
|
+
or IDataspaceProtocolCatalogError if no datasets found.
|
|
89
97
|
|
|
90
98
|
***
|
|
91
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.
|
|
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",
|
|
7
7
|
"url": "https://github.com/twinfoundation/federated-catalogue.git",
|
|
8
8
|
"directory": "packages/federated-catalogue-models"
|
|
9
9
|
},
|
|
10
|
-
"author": "
|
|
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.
|