@twin.org/federated-catalogue-models 0.0.3-next.2 → 0.0.3-next.21
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/README.md +1 -1
- package/dist/es/index.js +8 -6
- 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/IDatasetGetRequest.js +2 -0
- package/dist/es/models/api/IDatasetGetRequest.js.map +1 -0
- package/dist/es/models/api/IDatasetGetResponse.js +2 -0
- package/dist/es/models/api/IDatasetGetResponse.js.map +1 -0
- package/dist/es/models/api/IDatasetRemoveRequest.js +2 -0
- package/dist/es/models/api/IDatasetRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IDatasetRemoveResponse.js +2 -0
- package/dist/es/models/api/IDatasetRemoveResponse.js.map +1 -0
- package/dist/es/models/api/IDatasetSetRequest.js +2 -0
- package/dist/es/models/api/IDatasetSetRequest.js.map +1 -0
- package/dist/es/models/api/IDatasetSetResponse.js +2 -0
- package/dist/es/models/api/IDatasetSetResponse.js.map +1 -0
- package/dist/types/index.d.ts +8 -6
- package/dist/types/models/IFederatedCatalogueComponent.d.ts +32 -19
- package/dist/types/models/IFederatedCatalogueFilter.d.ts +9 -6
- package/dist/types/models/api/ICatalogRequestRequest.d.ts +23 -2
- package/dist/types/models/api/ICatalogRequestResponse.d.ts +18 -3
- package/dist/types/models/api/IDatasetGetRequest.d.ts +21 -0
- package/dist/types/models/api/IDatasetGetResponse.d.ts +16 -0
- package/dist/types/models/api/IDatasetRemoveRequest.d.ts +21 -0
- package/dist/types/models/api/IDatasetRemoveResponse.d.ts +15 -0
- package/dist/types/models/api/IDatasetSetRequest.d.ts +17 -0
- package/dist/types/models/api/IDatasetSetResponse.d.ts +21 -0
- package/docs/changelog.md +136 -3
- package/docs/examples.md +55 -1
- package/docs/reference/index.md +6 -8
- package/docs/reference/interfaces/ICatalogRequestRequest.md +35 -2
- package/docs/reference/interfaces/ICatalogRequestResponse.md +27 -3
- package/docs/reference/interfaces/IDatasetGetRequest.md +29 -0
- package/docs/reference/interfaces/IDatasetGetResponse.md +19 -0
- package/docs/reference/interfaces/IDatasetRemoveRequest.md +29 -0
- package/docs/reference/interfaces/IDatasetRemoveResponse.md +19 -0
- package/docs/reference/interfaces/IDatasetSetRequest.md +23 -0
- package/docs/reference/interfaces/IDatasetSetResponse.md +31 -0
- package/docs/reference/interfaces/IFederatedCatalogueComponent.md +65 -33
- package/docs/reference/interfaces/IFederatedCatalogueFilter.md +25 -8
- package/package.json +7 -5
- package/dist/es/models/api/IGetDatasetRequest.js +0 -4
- package/dist/es/models/api/IGetDatasetRequest.js.map +0 -1
- package/dist/es/models/api/IGetDatasetResponse.js +0 -2
- package/dist/es/models/api/IGetDatasetResponse.js.map +0 -1
- package/dist/es/models/federatedCatalogueContexts.js +0 -13
- package/dist/es/models/federatedCatalogueContexts.js.map +0 -1
- package/dist/es/models/filters/IBaseFilter.js +0 -2
- package/dist/es/models/filters/IBaseFilter.js.map +0 -1
- package/dist/types/models/api/IGetDatasetRequest.d.ts +0 -14
- package/dist/types/models/api/IGetDatasetResponse.d.ts +0 -10
- package/dist/types/models/federatedCatalogueContexts.d.ts +0 -13
- package/dist/types/models/filters/IBaseFilter.d.ts +0 -34
- package/docs/reference/interfaces/IBaseFilter.md +0 -55
- package/docs/reference/interfaces/IGetDatasetRequest.md +0 -17
- package/docs/reference/interfaces/IGetDatasetResponse.md +0 -11
- package/docs/reference/type-aliases/FederatedCatalogueContexts.md +0 -5
- package/docs/reference/variables/FederatedCatalogueContexts.md +0 -13
package/docs/examples.md
CHANGED
|
@@ -1 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Federated Catalogue Models Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to register, discover and resolve filter components so catalogue services can select filtering logic at runtime.
|
|
4
|
+
|
|
5
|
+
## FederatedCatalogueFilterFactory
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { FederatedCatalogueFilterFactory } from '@twin.org/federated-catalogue-models';
|
|
9
|
+
|
|
10
|
+
FederatedCatalogueFilterFactory.clear();
|
|
11
|
+
|
|
12
|
+
FederatedCatalogueFilterFactory.register('PublisherFilter', () => ({
|
|
13
|
+
className() {
|
|
14
|
+
return 'PublisherFilter';
|
|
15
|
+
},
|
|
16
|
+
async query() {
|
|
17
|
+
return { datasets: [] };
|
|
18
|
+
},
|
|
19
|
+
async createIndex() {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
FederatedCatalogueFilterFactory.clear();
|
|
25
|
+
|
|
26
|
+
FederatedCatalogueFilterFactory.register('PublisherFilter', () => ({
|
|
27
|
+
className() {
|
|
28
|
+
return 'PublisherFilter';
|
|
29
|
+
},
|
|
30
|
+
async query() {
|
|
31
|
+
return { datasets: [] };
|
|
32
|
+
},
|
|
33
|
+
async createIndex() {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
const filterNames = FederatedCatalogueFilterFactory.names();
|
|
39
|
+
|
|
40
|
+
console.log(filterNames.includes('PublisherFilter')); // true
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { FederatedCatalogueFilterFactory } from '@twin.org/federated-catalogue-models';
|
|
45
|
+
|
|
46
|
+
const filter = FederatedCatalogueFilterFactory.get('PublisherFilter');
|
|
47
|
+
const queryResult = await filter.query([
|
|
48
|
+
{
|
|
49
|
+
'@type': 'PublisherFilter'
|
|
50
|
+
}
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
console.log(filter.className()); // PublisherFilter
|
|
54
|
+
console.log(queryResult.datasets.length); // 0
|
|
55
|
+
```
|
package/docs/reference/index.md
CHANGED
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
- [IFederatedCatalogueFilter](interfaces/IFederatedCatalogueFilter.md)
|
|
7
7
|
- [ICatalogRequestRequest](interfaces/ICatalogRequestRequest.md)
|
|
8
8
|
- [ICatalogRequestResponse](interfaces/ICatalogRequestResponse.md)
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- [FederatedCatalogueContexts](type-aliases/FederatedCatalogueContexts.md)
|
|
9
|
+
- [IDatasetGetRequest](interfaces/IDatasetGetRequest.md)
|
|
10
|
+
- [IDatasetGetResponse](interfaces/IDatasetGetResponse.md)
|
|
11
|
+
- [IDatasetRemoveRequest](interfaces/IDatasetRemoveRequest.md)
|
|
12
|
+
- [IDatasetRemoveResponse](interfaces/IDatasetRemoveResponse.md)
|
|
13
|
+
- [IDatasetSetRequest](interfaces/IDatasetSetRequest.md)
|
|
14
|
+
- [IDatasetSetResponse](interfaces/IDatasetSetResponse.md)
|
|
16
15
|
|
|
17
16
|
## Variables
|
|
18
17
|
|
|
19
18
|
- [FederatedCatalogueFilterFactory](variables/FederatedCatalogueFilterFactory.md)
|
|
20
|
-
- [FederatedCatalogueContexts](variables/FederatedCatalogueContexts.md)
|
|
@@ -4,8 +4,41 @@ The request parameters for the catalog request method.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### headers? {#headers}
|
|
8
8
|
|
|
9
|
-
> **
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
The request headers. Authorization header carries the trust token (Bearer scheme).
|
|
12
|
+
|
|
13
|
+
#### authorization?
|
|
14
|
+
|
|
15
|
+
> `optional` **authorization?**: `string`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### body {#body}
|
|
20
|
+
|
|
21
|
+
> **body**: `IDataspaceProtocolCatalogRequestMessage`
|
|
10
22
|
|
|
11
23
|
The request body containing the catalog query.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### query? {#query}
|
|
28
|
+
|
|
29
|
+
> `optional` **query?**: `object`
|
|
30
|
+
|
|
31
|
+
Optional query parameters for pagination.
|
|
32
|
+
Used when following Link header URLs per DS Protocol spec.
|
|
33
|
+
|
|
34
|
+
#### cursor?
|
|
35
|
+
|
|
36
|
+
> `optional` **cursor?**: `string`
|
|
37
|
+
|
|
38
|
+
Opaque cursor token for pagination.
|
|
39
|
+
|
|
40
|
+
#### limit?
|
|
41
|
+
|
|
42
|
+
> `optional` **limit?**: `string`
|
|
43
|
+
|
|
44
|
+
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
|
|
|
7
|
-
###
|
|
8
|
+
### headers? {#headers}
|
|
8
9
|
|
|
9
|
-
> **
|
|
10
|
+
> `optional` **headers?**: `object`
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Optional headers including RFC 8288 Link header for pagination.
|
|
13
|
+
|
|
14
|
+
#### link?
|
|
15
|
+
|
|
16
|
+
> `optional` **link?**: `string` \| `string`[]
|
|
17
|
+
|
|
18
|
+
***
|
|
19
|
+
|
|
20
|
+
### statusCode? {#statuscode}
|
|
21
|
+
|
|
22
|
+
> `optional` **statusCode?**: `HttpStatusCode`
|
|
23
|
+
|
|
24
|
+
Response status code.
|
|
25
|
+
Per DS Protocol: Returns appropriate HTTP code (e.g., 404) when returning CatalogError.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### body {#body}
|
|
30
|
+
|
|
31
|
+
> **body**: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`
|
|
32
|
+
|
|
33
|
+
The response payload containing the DS Protocol compliant catalog with participantId,
|
|
34
|
+
or a CatalogError if no datasets are found (404).
|
|
35
|
+
Per DS Protocol: Single participant returns flat catalog, multiple participants return nested catalogs.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interface: IDatasetGetRequest
|
|
2
|
+
|
|
3
|
+
The request parameters for the get dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers? {#headers}
|
|
8
|
+
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
The request headers. Authorization header carries the trust token (Bearer scheme).
|
|
12
|
+
|
|
13
|
+
#### authorization?
|
|
14
|
+
|
|
15
|
+
> `optional` **authorization?**: `string`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### pathParams {#pathparams}
|
|
20
|
+
|
|
21
|
+
> **pathParams**: `object`
|
|
22
|
+
|
|
23
|
+
The path parameters.
|
|
24
|
+
|
|
25
|
+
#### datasetId
|
|
26
|
+
|
|
27
|
+
> **datasetId**: `string`
|
|
28
|
+
|
|
29
|
+
The unique identifier of the dataset.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IDatasetGetResponse
|
|
2
|
+
|
|
3
|
+
The response payload for the get dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode? {#statuscode}
|
|
8
|
+
|
|
9
|
+
> `optional` **statusCode?**: `HttpStatusCode`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body {#body}
|
|
16
|
+
|
|
17
|
+
> **body**: `IDcatDataset` \| `IDataspaceProtocolCatalogError`
|
|
18
|
+
|
|
19
|
+
The response payload containing the dataset or error.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interface: IDatasetRemoveRequest
|
|
2
|
+
|
|
3
|
+
The request parameters for the remove dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers? {#headers}
|
|
8
|
+
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
The request headers. Authorization header carries the trust token (Bearer scheme).
|
|
12
|
+
|
|
13
|
+
#### authorization?
|
|
14
|
+
|
|
15
|
+
> `optional` **authorization?**: `string`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### pathParams {#pathparams}
|
|
20
|
+
|
|
21
|
+
> **pathParams**: `object`
|
|
22
|
+
|
|
23
|
+
The path parameters.
|
|
24
|
+
|
|
25
|
+
#### datasetId
|
|
26
|
+
|
|
27
|
+
> **datasetId**: `string`
|
|
28
|
+
|
|
29
|
+
The unique identifier of the dataset.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IDatasetRemoveResponse
|
|
2
|
+
|
|
3
|
+
The response payload for the remove dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode? {#statuscode}
|
|
8
|
+
|
|
9
|
+
> `optional` **statusCode?**: `HttpStatusCode`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body? {#body}
|
|
16
|
+
|
|
17
|
+
> `optional` **body?**: `IDataspaceProtocolCatalogError`
|
|
18
|
+
|
|
19
|
+
The response payload containing the dataset or error.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: IDatasetSetRequest
|
|
2
|
+
|
|
3
|
+
The request parameters for the set dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers? {#headers}
|
|
8
|
+
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
The request headers. Authorization header carries the trust token (Bearer scheme).
|
|
12
|
+
|
|
13
|
+
#### authorization?
|
|
14
|
+
|
|
15
|
+
> `optional` **authorization?**: `string`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### body {#body}
|
|
20
|
+
|
|
21
|
+
> **body**: `IDcatDataset`
|
|
22
|
+
|
|
23
|
+
The response payload containing the dataset or error.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: IDatasetSetResponse
|
|
2
|
+
|
|
3
|
+
The response payload for the set dataset method.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode? {#statuscode}
|
|
8
|
+
|
|
9
|
+
> `optional` **statusCode?**: `HttpStatusCode`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### headers? {#headers}
|
|
16
|
+
|
|
17
|
+
> `optional` **headers?**: `object`
|
|
18
|
+
|
|
19
|
+
Optional headers.
|
|
20
|
+
|
|
21
|
+
#### location?
|
|
22
|
+
|
|
23
|
+
> `optional` **location?**: `string`
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### body? {#body}
|
|
28
|
+
|
|
29
|
+
> `optional` **body?**: `IDataspaceProtocolCatalogError`
|
|
30
|
+
|
|
31
|
+
The response payload containing the dataset or error.
|
|
@@ -9,102 +9,134 @@ Provides Dataspace Protocol-compliant catalog endpoints for dataset registry and
|
|
|
9
9
|
|
|
10
10
|
## Methods
|
|
11
11
|
|
|
12
|
-
### get()
|
|
12
|
+
### get() {#get}
|
|
13
13
|
|
|
14
|
-
> **get**(`
|
|
14
|
+
> **get**(`datasetId`, `trustPayload`): `Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
|
|
15
15
|
|
|
16
16
|
Retrieve a dataset by its unique identifier.
|
|
17
17
|
|
|
18
18
|
#### Parameters
|
|
19
19
|
|
|
20
|
-
#####
|
|
20
|
+
##### datasetId
|
|
21
21
|
|
|
22
22
|
`string`
|
|
23
23
|
|
|
24
24
|
The unique identifier of the dataset.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
##### trustPayload
|
|
27
|
+
|
|
28
|
+
`unknown`
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
Optional payload for trust evaluation, if applicable.
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
#### Returns
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
`Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
The dataset if found, or a CatalogError if not found or an error occurs.
|
|
35
37
|
|
|
36
38
|
***
|
|
37
39
|
|
|
38
|
-
### set()
|
|
40
|
+
### set() {#set}
|
|
39
41
|
|
|
40
|
-
> **set**(`
|
|
42
|
+
> **set**(`dataset`, `trustPayload`): `Promise`\<`string` \| `IDataspaceProtocolCatalogError`\>
|
|
41
43
|
|
|
42
44
|
Insert or update a dataset in the catalogue.
|
|
43
45
|
This method is internal and should not be exposed via REST endpoints.
|
|
44
46
|
|
|
45
47
|
#### Parameters
|
|
46
48
|
|
|
47
|
-
#####
|
|
49
|
+
##### dataset
|
|
48
50
|
|
|
49
|
-
`
|
|
51
|
+
`IDcatDataset`
|
|
50
52
|
|
|
51
53
|
The dataset to store.
|
|
52
54
|
|
|
55
|
+
##### trustPayload
|
|
56
|
+
|
|
57
|
+
`unknown`
|
|
58
|
+
|
|
59
|
+
Optional payload for trust evaluation, if applicable.
|
|
60
|
+
|
|
53
61
|
#### Returns
|
|
54
62
|
|
|
55
|
-
`Promise`\<`
|
|
63
|
+
`Promise`\<`string` \| `IDataspaceProtocolCatalogError`\>
|
|
56
64
|
|
|
57
|
-
|
|
65
|
+
The unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
58
66
|
|
|
59
67
|
***
|
|
60
68
|
|
|
61
|
-
### query()
|
|
69
|
+
### query() {#query}
|
|
62
70
|
|
|
63
|
-
> **query**(`filter
|
|
71
|
+
> **query**(`filter`, `cursor`, `limit`, `trustPayload`): `Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
64
72
|
|
|
65
73
|
Execute a query against the catalogue using registered filter plugins.
|
|
66
|
-
Returns a
|
|
67
|
-
|
|
68
|
-
The
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
Returns a DS Protocol compliant Catalog object with participantId.
|
|
75
|
+
|
|
76
|
+
The root catalog's participantId is the requesting participant (from context).
|
|
77
|
+
Own datasets (matching requestingParticipantId) go directly in root dataset[].
|
|
78
|
+
Other participants' datasets are grouped in nested catalog[] entries.
|
|
79
|
+
|
|
80
|
+
For anonymous requests (no context), uses the first publisher found as fallback.
|
|
81
|
+
Returns CatalogError 404 when no datasets exist.
|
|
71
82
|
|
|
72
83
|
#### Parameters
|
|
73
84
|
|
|
74
|
-
##### filter
|
|
85
|
+
##### filter
|
|
75
86
|
|
|
76
|
-
`unknown`[]
|
|
87
|
+
`unknown`[] \| `undefined`
|
|
77
88
|
|
|
78
|
-
The filter criteria containing @type
|
|
89
|
+
The filter criteria containing @type.
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
##### cursor
|
|
92
|
+
|
|
93
|
+
`string` \| `undefined`
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
Optional cursor for pagination.
|
|
83
96
|
|
|
84
|
-
|
|
97
|
+
##### limit
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
`number` \| `undefined`
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
Optional limit for pagination.
|
|
102
|
+
|
|
103
|
+
##### trustPayload
|
|
104
|
+
|
|
105
|
+
`unknown`
|
|
106
|
+
|
|
107
|
+
Optional payload for trust evaluation, if applicable.
|
|
108
|
+
|
|
109
|
+
#### Returns
|
|
110
|
+
|
|
111
|
+
`Promise`\<\{ `result`: `IDataspaceProtocolCatalog` \| `IDataspaceProtocolCatalogError`; `cursor?`: `string`; \}\>
|
|
112
|
+
|
|
113
|
+
Complete IDataspaceProtocolCatalog with @context, @id, @type, participantId, dataset/catalog,
|
|
114
|
+
or IDataspaceProtocolCatalogError if no datasets found.
|
|
89
115
|
|
|
90
116
|
***
|
|
91
117
|
|
|
92
|
-
### remove()
|
|
118
|
+
### remove() {#remove}
|
|
93
119
|
|
|
94
|
-
> **remove**(`
|
|
120
|
+
> **remove**(`datasetId`, `trustPayload`): `Promise`\<`IDataspaceProtocolCatalogError` \| `undefined`\>
|
|
95
121
|
|
|
96
122
|
Remove a dataset from the catalogue by its unique identifier.
|
|
97
123
|
|
|
98
124
|
#### Parameters
|
|
99
125
|
|
|
100
|
-
#####
|
|
126
|
+
##### datasetId
|
|
101
127
|
|
|
102
128
|
`string`
|
|
103
129
|
|
|
104
130
|
The unique identifier of the dataset to remove.
|
|
105
131
|
|
|
132
|
+
##### trustPayload
|
|
133
|
+
|
|
134
|
+
`unknown`
|
|
135
|
+
|
|
136
|
+
Optional payload for trust evaluation, if applicable.
|
|
137
|
+
|
|
106
138
|
#### Returns
|
|
107
139
|
|
|
108
|
-
`Promise`\<`
|
|
140
|
+
`Promise`\<`IDataspaceProtocolCatalogError` \| `undefined`\>
|
|
109
141
|
|
|
110
142
|
Nothing.
|
|
@@ -10,42 +10,59 @@ Filters are registered by name in the FilterFactory and do not need to self-iden
|
|
|
10
10
|
|
|
11
11
|
## Methods
|
|
12
12
|
|
|
13
|
-
### query()
|
|
13
|
+
### query() {#query}
|
|
14
14
|
|
|
15
|
-
> **query**(`filter`): `Promise`\<\{ `datasets`: `
|
|
15
|
+
> **query**(`trustInfo`, `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
|
|
|
22
|
+
##### trustInfo
|
|
23
|
+
|
|
24
|
+
`ITrustVerificationInfo`
|
|
25
|
+
|
|
26
|
+
The trust verification information for the current request.
|
|
27
|
+
|
|
23
28
|
##### filter
|
|
24
29
|
|
|
25
30
|
`unknown`
|
|
26
31
|
|
|
27
32
|
The filter criteria (structure depends on the filter implementation).
|
|
28
33
|
|
|
34
|
+
##### cursor?
|
|
35
|
+
|
|
36
|
+
`string`
|
|
37
|
+
|
|
38
|
+
The pagination cursor from the previous query, if any.
|
|
39
|
+
|
|
40
|
+
##### limit?
|
|
41
|
+
|
|
42
|
+
`number`
|
|
43
|
+
|
|
44
|
+
The maximum number of results to return.
|
|
45
|
+
|
|
29
46
|
#### Returns
|
|
30
47
|
|
|
31
|
-
`Promise`\<\{ `datasets`: `
|
|
48
|
+
`Promise`\<\{ `datasets`: `IDcatDataset`[]; `cursor?`: `string`; \}\>
|
|
32
49
|
|
|
33
50
|
Object containing datasets matching the filter criteria and optional cursor for next page.
|
|
34
51
|
|
|
35
52
|
***
|
|
36
53
|
|
|
37
|
-
### createIndex()
|
|
54
|
+
### createIndex() {#createindex}
|
|
38
55
|
|
|
39
|
-
> **createIndex**(`
|
|
56
|
+
> **createIndex**(`dataset`): `Promise`\<\{\[`key`: `string`\]: `unknown`; \}\>
|
|
40
57
|
|
|
41
58
|
Generate filter indexes for a dataset to optimize future queries.
|
|
42
59
|
Indexes are stored as properties on the dataset entity itself.
|
|
43
60
|
|
|
44
61
|
#### Parameters
|
|
45
62
|
|
|
46
|
-
#####
|
|
63
|
+
##### dataset
|
|
47
64
|
|
|
48
|
-
`
|
|
65
|
+
`IDcatDataset`
|
|
49
66
|
|
|
50
67
|
The dataset to index.
|
|
51
68
|
|
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.21",
|
|
4
4
|
"description": "Models which define the structure of the Federated Catalogue Service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-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,9 @@
|
|
|
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/trust-models": "next",
|
|
25
|
+
"@twin.org/web": "next"
|
|
24
26
|
},
|
|
25
27
|
"main": "./dist/es/index.js",
|
|
26
28
|
"types": "./dist/types/index.d.ts",
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
"schemas"
|
|
51
53
|
],
|
|
52
54
|
"bugs": {
|
|
53
|
-
"url": "git+https://github.com/
|
|
55
|
+
"url": "git+https://github.com/iotaledger/twin-federated-catalogue/issues"
|
|
54
56
|
},
|
|
55
57
|
"homepage": "https://twindev.org"
|
|
56
58
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IGetDatasetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IGetDatasetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The request parameters for the get dataset method.\n */\nexport interface IGetDatasetRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The unique identifier of the dataset.\n\t\t */\n\t\tdatasetId: string;\n\t};\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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 { IDataset } 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: IDataset;\n}\n"]}
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBaseFilter.js","sourceRoot":"","sources":["../../../../src/models/filters/IBaseFilter.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Base filter interface with pagination support.\n * All filter objects in the federated catalogue extend this base.\n *\n * Per Eclipse Dataspace Protocol constraints, cursor and limit cannot be\n * top-level properties in CatalogRequestMessage. They must be embedded\n * within the filter object using a custom JSON-LD vocabulary.\n *\n * After JSON-LD compaction, properties use direct names (cursor, limit) rather\n * than prefixed names. Each filter implementation should extend this interface\n * to define its own filter-specific properties.\n */\nexport interface IBaseFilter extends IJsonLdNodeObject {\n\t/**\n\t * Filter type discriminator.\n\t * Used to route filter to appropriate filter implementation.\n\t * Example: \"FilterByExample\", \"FilterByPolicy\", etc.\n\t * Required for filter routing.\n\t */\n\t\"@type\": string;\n\n\t/**\n\t * Optional cursor for pagination.\n\t * When provided, returns results starting after this cursor.\n\t * Namespace: https://schema.twindev.org/federated-catalogue/cursor\n\t */\n\tcursor?: string;\n\n\t/**\n\t * Optional limit for number of results.\n\t * Defaults to implementation-specific value if not provided.\n\t * Namespace: https://schema.twindev.org/federated-catalogue/limit\n\t */\n\tlimit?: number;\n}\n"]}
|