@twin.org/federated-catalogue-models 0.0.3-next.12 → 0.0.3-next.13
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/docs/changelog.md +8 -1
- package/docs/examples.md +55 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Federated Catalogue Models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package defines shared data contracts for catalogue interactions, including request and response models used by service and client components. It provides a stable schema layer so integrations can exchange catalogue data in a consistent format.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.13](https://github.com/twinfoundation/federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.12...federated-catalogue-models-v0.0.3-next.13) (2026-03-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **federated-catalogue-models:** Synchronize repo versions
|
|
2
9
|
|
|
3
10
|
## [0.0.3-next.12](https://github.com/twinfoundation/federated-catalogue/compare/federated-catalogue-models-v0.0.3-next.11...federated-catalogue-models-v0.0.3-next.12) (2026-03-06)
|
|
4
11
|
|
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
|
+
```
|