@twin.org/federated-catalogue-models 0.0.3-next.21 → 0.0.3-next.23
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/factories/federatedCatalogueFilterFactory.js +0 -1
- package/dist/es/factories/federatedCatalogueFilterFactory.js.map +1 -1
- package/dist/es/index.js +2 -0
- 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/IDatasetSetRequest.js.map +1 -1
- package/dist/es/models/federatedCatalogueMetricIds.js +33 -0
- package/dist/es/models/federatedCatalogueMetricIds.js.map +1 -0
- package/dist/es/models/federatedCatalogueMetrics.js +41 -0
- package/dist/es/models/federatedCatalogueMetrics.js.map +1 -0
- package/dist/types/factories/federatedCatalogueFilterFactory.d.ts +0 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/IFederatedCatalogueComponent.d.ts +7 -8
- package/dist/types/models/IFederatedCatalogueFilter.d.ts +2 -2
- package/dist/types/models/api/IDatasetSetRequest.d.ts +1 -1
- package/dist/types/models/federatedCatalogueMetricIds.d.ts +33 -0
- package/dist/types/models/federatedCatalogueMetrics.d.ts +5 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +6 -0
- package/docs/reference/interfaces/IDatasetSetRequest.md +1 -1
- package/docs/reference/interfaces/IFederatedCatalogueComponent.md +7 -8
- package/docs/reference/interfaces/IFederatedCatalogueFilter.md +2 -2
- package/docs/reference/type-aliases/FederatedCatalogueMetricIds.md +5 -0
- package/docs/reference/variables/FederatedCatalogueFilterFactory.md +0 -1
- package/docs/reference/variables/FederatedCatalogueMetricIds.md +43 -0
- package/docs/reference/variables/FederatedCatalogueMetrics.md +5 -0
- package/package.json +2 -1
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { Factory } from "@twin.org/core";
|
|
4
4
|
/**
|
|
5
5
|
* Factory for managing filter plugin registration and retrieval.
|
|
6
|
-
* Follows the TWIN Platform factory pattern used by ComponentFactory and EntityStorageConnectorFactory.
|
|
7
6
|
*/
|
|
8
7
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
8
|
export const FederatedCatalogueFilterFactory = Factory.createFactory("federated-catalogue-filter");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"federatedCatalogueFilterFactory.js","sourceRoot":"","sources":["../../../src/factories/federatedCatalogueFilterFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC
|
|
1
|
+
{"version":3,"file":"federatedCatalogueFilterFactory.js","sourceRoot":"","sources":["../../../src/factories/federatedCatalogueFilterFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,+BAA+B,GAAG,OAAO,CAAC,aAAa,CACnE,4BAA4B,CAC5B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@twin.org/core\";\nimport type { IFederatedCatalogueFilter } from \"../models/IFederatedCatalogueFilter.js\";\n\n/**\n * Factory for managing filter plugin registration and retrieval.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FederatedCatalogueFilterFactory = Factory.createFactory<IFederatedCatalogueFilter>(\n\t\"federated-catalogue-filter\"\n);\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export * from "./models/api/IDatasetRemoveRequest.js";
|
|
|
9
9
|
export * from "./models/api/IDatasetRemoveResponse.js";
|
|
10
10
|
export * from "./models/api/IDatasetSetRequest.js";
|
|
11
11
|
export * from "./models/api/IDatasetSetResponse.js";
|
|
12
|
+
export * from "./models/federatedCatalogueMetricIds.js";
|
|
13
|
+
export * from "./models/federatedCatalogueMetrics.js";
|
|
12
14
|
export * from "./models/IFederatedCatalogueComponent.js";
|
|
13
15
|
export * from "./models/IFederatedCatalogueFilter.js";
|
|
14
16
|
//# 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;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,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/IDatasetGetRequest.js\";\nexport * from \"./models/api/IDatasetGetResponse.js\";\nexport * from \"./models/api/IDatasetRemoveRequest.js\";\nexport * from \"./models/api/IDatasetRemoveResponse.js\";\nexport * from \"./models/api/IDatasetSetRequest.js\";\nexport * from \"./models/api/IDatasetSetResponse.js\";\nexport * from \"./models/IFederatedCatalogueComponent.js\";\nexport * from \"./models/IFederatedCatalogueFilter.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,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,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/IDatasetGetRequest.js\";\nexport * from \"./models/api/IDatasetGetResponse.js\";\nexport * from \"./models/api/IDatasetRemoveRequest.js\";\nexport * from \"./models/api/IDatasetRemoveResponse.js\";\nexport * from \"./models/api/IDatasetSetRequest.js\";\nexport * from \"./models/api/IDatasetSetResponse.js\";\nexport * from \"./models/federatedCatalogueMetricIds.js\";\nexport * from \"./models/federatedCatalogueMetrics.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 {\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 * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns
|
|
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 * @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\tget(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): 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 * @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\tset(\n\t\tdataset: IDcatDataset,\n\t\ttrustPayload: unknown\n\t): Promise<string | IDataspaceProtocolCatalogError>;\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.\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\tquery(\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\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 * @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\tremove(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolCatalogError | undefined>;\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\";\nimport type { ITrustVerificationInfo } from \"@twin.org/trust-models\";\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 trustInfo The trust verification information for the current request.\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
|
|
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\";\nimport type { ITrustVerificationInfo } from \"@twin.org/trust-models\";\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 trustInfo The trust verification information for the current request.\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 A promise that resolves with datasets matching the filter criteria and an optional cursor for the next page.\n\t */\n\tquery(\n\t\ttrustInfo: ITrustVerificationInfo,\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 A promise that resolves with a 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":"IDatasetSetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDatasetSetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\nimport type { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * The request parameters for the set dataset method.\n */\nexport interface IDatasetSetRequest {\n\t/**\n\t * The request headers. Authorization header carries the trust token (Bearer scheme).\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Authorization]?: string;\n\t};\n\n\t/**\n\t * The
|
|
1
|
+
{"version":3,"file":"IDatasetSetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDatasetSetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\nimport type { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * The request parameters for the set dataset method.\n */\nexport interface IDatasetSetRequest {\n\t/**\n\t * The request headers. Authorization header carries the trust token (Bearer scheme).\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Authorization]?: string;\n\t};\n\n\t/**\n\t * The request body containing the dataset to store.\n\t */\n\tbody: IDcatDataset;\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Metric IDs for the federated catalogue service.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const FederatedCatalogueMetricIds = {
|
|
8
|
+
/**
|
|
9
|
+
* Number of datasets retrieved.
|
|
10
|
+
*/
|
|
11
|
+
DatasetsRetrieved: "fc_datasets_retrieved",
|
|
12
|
+
/**
|
|
13
|
+
* Number of datasets stored.
|
|
14
|
+
*/
|
|
15
|
+
DatasetsStored: "fc_datasets_stored",
|
|
16
|
+
/**
|
|
17
|
+
* Number of datasets removed.
|
|
18
|
+
*/
|
|
19
|
+
DatasetsRemoved: "fc_datasets_removed",
|
|
20
|
+
/**
|
|
21
|
+
* Number of queries executed.
|
|
22
|
+
*/
|
|
23
|
+
QueriesExecuted: "fc_queries_executed",
|
|
24
|
+
/**
|
|
25
|
+
* Number of filter indexes created.
|
|
26
|
+
*/
|
|
27
|
+
FilterIndexesCreated: "fc_filter_indexes_created",
|
|
28
|
+
/**
|
|
29
|
+
* Number of filter index failures.
|
|
30
|
+
*/
|
|
31
|
+
FilterIndexFailures: "fc_filter_index_failures"
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=federatedCatalogueMetricIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federatedCatalogueMetricIds.js","sourceRoot":"","sources":["../../../src/models/federatedCatalogueMetricIds.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C;;OAEG;IACH,iBAAiB,EAAE,uBAAuB;IAE1C;;OAEG;IACH,cAAc,EAAE,oBAAoB;IAEpC;;OAEG;IACH,eAAe,EAAE,qBAAqB;IAEtC;;OAEG;IACH,eAAe,EAAE,qBAAqB;IAEtC;;OAEG;IACH,oBAAoB,EAAE,2BAA2B;IAEjD;;OAEG;IACH,mBAAmB,EAAE,0BAA0B;CACtC,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Metric IDs for the federated catalogue service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FederatedCatalogueMetricIds = {\n\t/**\n\t * Number of datasets retrieved.\n\t */\n\tDatasetsRetrieved: \"fc_datasets_retrieved\",\n\n\t/**\n\t * Number of datasets stored.\n\t */\n\tDatasetsStored: \"fc_datasets_stored\",\n\n\t/**\n\t * Number of datasets removed.\n\t */\n\tDatasetsRemoved: \"fc_datasets_removed\",\n\n\t/**\n\t * Number of queries executed.\n\t */\n\tQueriesExecuted: \"fc_queries_executed\",\n\n\t/**\n\t * Number of filter indexes created.\n\t */\n\tFilterIndexesCreated: \"fc_filter_indexes_created\",\n\n\t/**\n\t * Number of filter index failures.\n\t */\n\tFilterIndexFailures: \"fc_filter_index_failures\"\n} as const;\n\n/**\n * Metric IDs for the federated catalogue service.\n */\nexport type FederatedCatalogueMetricIds =\n\t(typeof FederatedCatalogueMetricIds)[keyof typeof FederatedCatalogueMetricIds];\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2025 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { MetricType } from "@twin.org/telemetry-models";
|
|
4
|
+
import { FederatedCatalogueMetricIds } from "./federatedCatalogueMetricIds.js";
|
|
5
|
+
/**
|
|
6
|
+
* Metrics registered by the federated catalogue service.
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
+
export const FederatedCatalogueMetrics = [
|
|
10
|
+
{
|
|
11
|
+
id: FederatedCatalogueMetricIds.DatasetsRetrieved,
|
|
12
|
+
label: "Datasets retrieved",
|
|
13
|
+
type: MetricType.Counter
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: FederatedCatalogueMetricIds.DatasetsStored,
|
|
17
|
+
label: "Datasets stored",
|
|
18
|
+
type: MetricType.Counter
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: FederatedCatalogueMetricIds.DatasetsRemoved,
|
|
22
|
+
label: "Datasets removed",
|
|
23
|
+
type: MetricType.Counter
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: FederatedCatalogueMetricIds.QueriesExecuted,
|
|
27
|
+
label: "Queries executed",
|
|
28
|
+
type: MetricType.Counter
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: FederatedCatalogueMetricIds.FilterIndexesCreated,
|
|
32
|
+
label: "Filter indexes created",
|
|
33
|
+
type: MetricType.Counter
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: FederatedCatalogueMetricIds.FilterIndexFailures,
|
|
37
|
+
label: "Filter index failures",
|
|
38
|
+
type: MetricType.Counter
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
//# sourceMappingURL=federatedCatalogueMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federatedCatalogueMetrics.js","sourceRoot":"","sources":["../../../src/models/federatedCatalogueMetrics.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAyB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAuB;IAC5D;QACC,EAAE,EAAE,2BAA2B,CAAC,iBAAiB;QACjD,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,cAAc;QAC9C,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,eAAe;QAC/C,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,eAAe;QAC/C,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,oBAAoB;QACpD,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,mBAAmB;QACnD,KAAK,EAAE,uBAAuB;QAC9B,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { type ITelemetryMetric, MetricType } from \"@twin.org/telemetry-models\";\nimport { FederatedCatalogueMetricIds } from \"./federatedCatalogueMetricIds.js\";\n\n/**\n * Metrics registered by the federated catalogue service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FederatedCatalogueMetrics: ITelemetryMetric[] = [\n\t{\n\t\tid: FederatedCatalogueMetricIds.DatasetsRetrieved,\n\t\tlabel: \"Datasets retrieved\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: FederatedCatalogueMetricIds.DatasetsStored,\n\t\tlabel: \"Datasets stored\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: FederatedCatalogueMetricIds.DatasetsRemoved,\n\t\tlabel: \"Datasets removed\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: FederatedCatalogueMetricIds.QueriesExecuted,\n\t\tlabel: \"Queries executed\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: FederatedCatalogueMetricIds.FilterIndexesCreated,\n\t\tlabel: \"Filter indexes created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: FederatedCatalogueMetricIds.FilterIndexFailures,\n\t\tlabel: \"Filter index failures\",\n\t\ttype: MetricType.Counter\n\t}\n];\n"]}
|
|
@@ -2,6 +2,5 @@ import { Factory } from "@twin.org/core";
|
|
|
2
2
|
import type { IFederatedCatalogueFilter } from "../models/IFederatedCatalogueFilter.js";
|
|
3
3
|
/**
|
|
4
4
|
* Factory for managing filter plugin registration and retrieval.
|
|
5
|
-
* Follows the TWIN Platform factory pattern used by ComponentFactory and EntityStorageConnectorFactory.
|
|
6
5
|
*/
|
|
7
6
|
export declare const FederatedCatalogueFilterFactory: Factory<IFederatedCatalogueFilter>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,5 +7,7 @@ export * from "./models/api/IDatasetRemoveRequest.js";
|
|
|
7
7
|
export * from "./models/api/IDatasetRemoveResponse.js";
|
|
8
8
|
export * from "./models/api/IDatasetSetRequest.js";
|
|
9
9
|
export * from "./models/api/IDatasetSetResponse.js";
|
|
10
|
+
export * from "./models/federatedCatalogueMetricIds.js";
|
|
11
|
+
export * from "./models/federatedCatalogueMetrics.js";
|
|
10
12
|
export * from "./models/IFederatedCatalogueComponent.js";
|
|
11
13
|
export * from "./models/IFederatedCatalogueFilter.js";
|
|
@@ -10,7 +10,7 @@ export interface IFederatedCatalogueComponent extends IComponent {
|
|
|
10
10
|
* Retrieve a dataset by its unique identifier.
|
|
11
11
|
* @param datasetId The unique identifier of the dataset.
|
|
12
12
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
13
|
-
* @returns
|
|
13
|
+
* @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.
|
|
14
14
|
*/
|
|
15
15
|
get(datasetId: string, trustPayload: unknown): Promise<IDcatDataset | IDataspaceProtocolCatalogError>;
|
|
16
16
|
/**
|
|
@@ -18,26 +18,25 @@ export interface IFederatedCatalogueComponent extends IComponent {
|
|
|
18
18
|
* This method is internal and should not be exposed via REST endpoints.
|
|
19
19
|
* @param dataset The dataset to store.
|
|
20
20
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
21
|
-
* @returns
|
|
21
|
+
* @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
22
22
|
*/
|
|
23
23
|
set(dataset: IDcatDataset, trustPayload: unknown): Promise<string | IDataspaceProtocolCatalogError>;
|
|
24
24
|
/**
|
|
25
25
|
* Execute a query against the catalogue using registered filter plugins.
|
|
26
|
-
* Returns a
|
|
26
|
+
* Returns a Dataspace Protocol compliant Catalog object with participantId.
|
|
27
27
|
*
|
|
28
28
|
* The root catalog's participantId is the requesting participant (from context).
|
|
29
29
|
* Own datasets (matching requestingParticipantId) go directly in root dataset[].
|
|
30
30
|
* Other participants' datasets are grouped in nested catalog[] entries.
|
|
31
31
|
*
|
|
32
32
|
* For anonymous requests (no context), uses the first publisher found as fallback.
|
|
33
|
-
* Returns CatalogError 404 when no datasets exist.
|
|
33
|
+
* Returns a CatalogError with status 404 when no datasets exist.
|
|
34
34
|
*
|
|
35
|
-
* @param filter The filter criteria
|
|
35
|
+
* @param filter The filter criteria array, where the first element contains @type.
|
|
36
36
|
* @param cursor Optional cursor for pagination.
|
|
37
37
|
* @param limit Optional limit for pagination.
|
|
38
38
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
39
|
-
* @returns
|
|
40
|
-
* or IDataspaceProtocolCatalogError if no datasets found.
|
|
39
|
+
* @returns A promise that resolves with the catalog result and optional next-page cursor.
|
|
41
40
|
*/
|
|
42
41
|
query(filter: unknown[] | undefined, cursor: string | undefined, limit: number | undefined, trustPayload: unknown): Promise<{
|
|
43
42
|
result: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
|
|
@@ -47,7 +46,7 @@ export interface IFederatedCatalogueComponent extends IComponent {
|
|
|
47
46
|
* Remove a dataset from the catalogue by its unique identifier.
|
|
48
47
|
* @param datasetId The unique identifier of the dataset to remove.
|
|
49
48
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
50
|
-
* @returns
|
|
49
|
+
* @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.
|
|
51
50
|
*/
|
|
52
51
|
remove(datasetId: string, trustPayload: unknown): Promise<IDataspaceProtocolCatalogError | undefined>;
|
|
53
52
|
}
|
|
@@ -14,7 +14,7 @@ export interface IFederatedCatalogueFilter extends IComponent {
|
|
|
14
14
|
* @param filter The filter criteria (structure depends on the filter implementation).
|
|
15
15
|
* @param cursor The pagination cursor from the previous query, if any.
|
|
16
16
|
* @param limit The maximum number of results to return.
|
|
17
|
-
* @returns
|
|
17
|
+
* @returns A promise that resolves with datasets matching the filter criteria and an optional cursor for the next page.
|
|
18
18
|
*/
|
|
19
19
|
query(trustInfo: ITrustVerificationInfo, filter: unknown, cursor?: string, limit?: number): Promise<{
|
|
20
20
|
datasets: IDcatDataset[];
|
|
@@ -24,7 +24,7 @@ export interface IFederatedCatalogueFilter extends IComponent {
|
|
|
24
24
|
* Generate filter indexes for a dataset to optimize future queries.
|
|
25
25
|
* Indexes are stored as properties on the dataset entity itself.
|
|
26
26
|
* @param dataset The dataset to index.
|
|
27
|
-
* @returns
|
|
27
|
+
* @returns A promise that resolves with a record mapping filter-specific index keys to values.
|
|
28
28
|
*/
|
|
29
29
|
createIndex(dataset: IDcatDataset): Promise<{
|
|
30
30
|
[key: string]: unknown;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metric IDs for the federated catalogue service.
|
|
3
|
+
*/
|
|
4
|
+
export declare const FederatedCatalogueMetricIds: {
|
|
5
|
+
/**
|
|
6
|
+
* Number of datasets retrieved.
|
|
7
|
+
*/
|
|
8
|
+
readonly DatasetsRetrieved: "fc_datasets_retrieved";
|
|
9
|
+
/**
|
|
10
|
+
* Number of datasets stored.
|
|
11
|
+
*/
|
|
12
|
+
readonly DatasetsStored: "fc_datasets_stored";
|
|
13
|
+
/**
|
|
14
|
+
* Number of datasets removed.
|
|
15
|
+
*/
|
|
16
|
+
readonly DatasetsRemoved: "fc_datasets_removed";
|
|
17
|
+
/**
|
|
18
|
+
* Number of queries executed.
|
|
19
|
+
*/
|
|
20
|
+
readonly QueriesExecuted: "fc_queries_executed";
|
|
21
|
+
/**
|
|
22
|
+
* Number of filter indexes created.
|
|
23
|
+
*/
|
|
24
|
+
readonly FilterIndexesCreated: "fc_filter_indexes_created";
|
|
25
|
+
/**
|
|
26
|
+
* Number of filter index failures.
|
|
27
|
+
*/
|
|
28
|
+
readonly FilterIndexFailures: "fc_filter_index_failures";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Metric IDs for the federated catalogue service.
|
|
32
|
+
*/
|
|
33
|
+
export type FederatedCatalogueMetricIds = (typeof FederatedCatalogueMetricIds)[keyof typeof FederatedCatalogueMetricIds];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.23](https://github.com/iotaledger/twin-federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.22...federated-catalogue-models-v0.0.3-next.23) (2026-06-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add telemetry metrics to federated catalogue ([#93](https://github.com/iotaledger/twin-federated-catalogue/issues/93)) ([abd8965](https://github.com/iotaledger/twin-federated-catalogue/commit/abd89657d3991e6a50f8ed3845186069549df769))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.22](https://github.com/iotaledger/twin-federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.21...federated-catalogue-models-v0.0.3-next.22) (2026-06-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **federated-catalogue-models:** Synchronize repo versions
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.21](https://github.com/iotaledger/twin-federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.20...federated-catalogue-models-v0.0.3-next.21) (2026-06-12)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
- [IDatasetSetRequest](interfaces/IDatasetSetRequest.md)
|
|
14
14
|
- [IDatasetSetResponse](interfaces/IDatasetSetResponse.md)
|
|
15
15
|
|
|
16
|
+
## Type Aliases
|
|
17
|
+
|
|
18
|
+
- [FederatedCatalogueMetricIds](type-aliases/FederatedCatalogueMetricIds.md)
|
|
19
|
+
|
|
16
20
|
## Variables
|
|
17
21
|
|
|
18
22
|
- [FederatedCatalogueFilterFactory](variables/FederatedCatalogueFilterFactory.md)
|
|
23
|
+
- [FederatedCatalogueMetricIds](variables/FederatedCatalogueMetricIds.md)
|
|
24
|
+
- [FederatedCatalogueMetrics](variables/FederatedCatalogueMetrics.md)
|
|
@@ -33,7 +33,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
33
33
|
|
|
34
34
|
`Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.
|
|
37
37
|
|
|
38
38
|
***
|
|
39
39
|
|
|
@@ -62,7 +62,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
62
62
|
|
|
63
63
|
`Promise`\<`string` \| `IDataspaceProtocolCatalogError`\>
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
66
66
|
|
|
67
67
|
***
|
|
68
68
|
|
|
@@ -71,14 +71,14 @@ The unique identifier of the stored dataset, or a CatalogError if an error occur
|
|
|
71
71
|
> **query**(`filter`, `cursor`, `limit`, `trustPayload`): `Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
72
72
|
|
|
73
73
|
Execute a query against the catalogue using registered filter plugins.
|
|
74
|
-
Returns a
|
|
74
|
+
Returns a Dataspace Protocol compliant Catalog object with participantId.
|
|
75
75
|
|
|
76
76
|
The root catalog's participantId is the requesting participant (from context).
|
|
77
77
|
Own datasets (matching requestingParticipantId) go directly in root dataset[].
|
|
78
78
|
Other participants' datasets are grouped in nested catalog[] entries.
|
|
79
79
|
|
|
80
80
|
For anonymous requests (no context), uses the first publisher found as fallback.
|
|
81
|
-
Returns CatalogError 404 when no datasets exist.
|
|
81
|
+
Returns a CatalogError with status 404 when no datasets exist.
|
|
82
82
|
|
|
83
83
|
#### Parameters
|
|
84
84
|
|
|
@@ -86,7 +86,7 @@ Returns CatalogError 404 when no datasets exist.
|
|
|
86
86
|
|
|
87
87
|
`unknown`[] \| `undefined`
|
|
88
88
|
|
|
89
|
-
The filter criteria
|
|
89
|
+
The filter criteria array, where the first element contains @type.
|
|
90
90
|
|
|
91
91
|
##### cursor
|
|
92
92
|
|
|
@@ -110,8 +110,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
110
110
|
|
|
111
111
|
`Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
or IDataspaceProtocolCatalogError if no datasets found.
|
|
113
|
+
A promise that resolves with the catalog result and optional next-page cursor.
|
|
115
114
|
|
|
116
115
|
***
|
|
117
116
|
|
|
@@ -139,4 +138,4 @@ Optional payload for trust evaluation, if applicable.
|
|
|
139
138
|
|
|
140
139
|
`Promise`\<`IDataspaceProtocolCatalogError` \| `undefined`\>
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
A promise that resolves with undefined on success, or a CatalogError if removal fails.
|
|
@@ -47,7 +47,7 @@ The maximum number of results to return.
|
|
|
47
47
|
|
|
48
48
|
`Promise`\<\{ `datasets`: `IDcatDataset`[]; `cursor?`: `string`; \}\>
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
A promise that resolves with datasets matching the filter criteria and an optional cursor for the next page.
|
|
51
51
|
|
|
52
52
|
***
|
|
53
53
|
|
|
@@ -70,4 +70,4 @@ The dataset to index.
|
|
|
70
70
|
|
|
71
71
|
`Promise`\<\{\[`key`: `string`\]: `unknown`; \}\>
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
A promise that resolves with a record mapping filter-specific index keys to values.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: FederatedCatalogueMetricIds
|
|
2
|
+
|
|
3
|
+
> **FederatedCatalogueMetricIds** = *typeof* [`FederatedCatalogueMetricIds`](../variables/FederatedCatalogueMetricIds.md)\[keyof *typeof* [`FederatedCatalogueMetricIds`](../variables/FederatedCatalogueMetricIds.md)\]
|
|
4
|
+
|
|
5
|
+
Metric IDs for the federated catalogue service.
|
|
@@ -3,4 +3,3 @@
|
|
|
3
3
|
> `const` **FederatedCatalogueFilterFactory**: `Factory`\<[`IFederatedCatalogueFilter`](../interfaces/IFederatedCatalogueFilter.md)\>
|
|
4
4
|
|
|
5
5
|
Factory for managing filter plugin registration and retrieval.
|
|
6
|
-
Follows the TWIN Platform factory pattern used by ComponentFactory and EntityStorageConnectorFactory.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Variable: FederatedCatalogueMetricIds
|
|
2
|
+
|
|
3
|
+
> `const` **FederatedCatalogueMetricIds**: `object`
|
|
4
|
+
|
|
5
|
+
Metric IDs for the federated catalogue service.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### DatasetsRetrieved {#datasetsretrieved}
|
|
10
|
+
|
|
11
|
+
> `readonly` **DatasetsRetrieved**: `"fc_datasets_retrieved"` = `"fc_datasets_retrieved"`
|
|
12
|
+
|
|
13
|
+
Number of datasets retrieved.
|
|
14
|
+
|
|
15
|
+
### DatasetsStored {#datasetsstored}
|
|
16
|
+
|
|
17
|
+
> `readonly` **DatasetsStored**: `"fc_datasets_stored"` = `"fc_datasets_stored"`
|
|
18
|
+
|
|
19
|
+
Number of datasets stored.
|
|
20
|
+
|
|
21
|
+
### DatasetsRemoved {#datasetsremoved}
|
|
22
|
+
|
|
23
|
+
> `readonly` **DatasetsRemoved**: `"fc_datasets_removed"` = `"fc_datasets_removed"`
|
|
24
|
+
|
|
25
|
+
Number of datasets removed.
|
|
26
|
+
|
|
27
|
+
### QueriesExecuted {#queriesexecuted}
|
|
28
|
+
|
|
29
|
+
> `readonly` **QueriesExecuted**: `"fc_queries_executed"` = `"fc_queries_executed"`
|
|
30
|
+
|
|
31
|
+
Number of queries executed.
|
|
32
|
+
|
|
33
|
+
### FilterIndexesCreated {#filterindexescreated}
|
|
34
|
+
|
|
35
|
+
> `readonly` **FilterIndexesCreated**: `"fc_filter_indexes_created"` = `"fc_filter_indexes_created"`
|
|
36
|
+
|
|
37
|
+
Number of filter indexes created.
|
|
38
|
+
|
|
39
|
+
### FilterIndexFailures {#filterindexfailures}
|
|
40
|
+
|
|
41
|
+
> `readonly` **FilterIndexFailures**: `"fc_filter_index_failures"` = `"fc_filter_index_failures"`
|
|
42
|
+
|
|
43
|
+
Number of filter index failures.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/federated-catalogue-models",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.23",
|
|
4
4
|
"description": "Models which define the structure of the Federated Catalogue Service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/standards-dataspace-protocol": "next",
|
|
23
23
|
"@twin.org/standards-w3c-dcat": "next",
|
|
24
|
+
"@twin.org/telemetry-models": "next",
|
|
24
25
|
"@twin.org/trust-models": "next",
|
|
25
26
|
"@twin.org/web": "next"
|
|
26
27
|
},
|