@twin.org/dataspace-test-app 0.0.3-next.18 → 0.0.3-next.19
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
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Dataspace Test App
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides a sample dataspace app for local integration tests and development workflows. It gives a practical baseline for dataset handling, activity processing, and data request execution.
|
|
4
|
+
|
|
5
|
+
It is useful for validating service wiring and behaviour without building a custom app implementation first.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.19](https://github.com/twinfoundation/dataspace/compare/dataspace-test-app-v0.0.3-next.18...dataspace-test-app-v0.0.3-next.19) (2026-03-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **dataspace-test-app:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/dataspace-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.18](https://github.com/twinfoundation/dataspace/compare/dataspace-test-app-v0.0.3-next.17...dataspace-test-app-v0.0.3-next.18) (2026-03-09)
|
|
4
18
|
|
|
5
19
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Test App Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to prototype datasets, activity handling, and query responses in an application implementation.
|
|
4
|
+
|
|
5
|
+
## TestDataspaceDataPlaneApp
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { TestDataspaceDataPlaneApp } from '@twin.org/dataspace-test-app';
|
|
9
|
+
|
|
10
|
+
const app = new TestDataspaceDataPlaneApp({ loggingComponentType: 'logging' });
|
|
11
|
+
|
|
12
|
+
console.log(app.className()); // TestDataspaceDataPlaneApp
|
|
13
|
+
await app.start();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { TestDataspaceDataPlaneApp } from '@twin.org/dataspace-test-app';
|
|
18
|
+
|
|
19
|
+
const app = new TestDataspaceDataPlaneApp();
|
|
20
|
+
|
|
21
|
+
const datasets = await app.datasetsHandled();
|
|
22
|
+
const supportedQueryTypes = app.supportedQueryTypes();
|
|
23
|
+
const activities = app.activitiesHandled();
|
|
24
|
+
|
|
25
|
+
console.log(datasets.length); // 1
|
|
26
|
+
console.log(supportedQueryTypes[0]); // TestQueryType
|
|
27
|
+
console.log(activities[0].objectType); // https://vocabulary.uncefact.org/Consignment
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { TestDataspaceDataPlaneApp } from '@twin.org/dataspace-test-app';
|
|
32
|
+
import type { IDataspaceActivity } from '@twin.org/dataspace-models';
|
|
33
|
+
|
|
34
|
+
const app = new TestDataspaceDataPlaneApp();
|
|
35
|
+
|
|
36
|
+
const activity: IDataspaceActivity = {
|
|
37
|
+
'@context': 'https://www.w3.org/ns/activitystreams',
|
|
38
|
+
id: 'urn:activity:3001',
|
|
39
|
+
type: 'Create',
|
|
40
|
+
object: 'urn:ucr:24PLP051219453I002610799053311'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const activityResult = await app.handleActivity<string>(activity);
|
|
44
|
+
console.log(activityResult); // 1234
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { DataRequestType, type IDataRequest } from '@twin.org/dataspace-models';
|
|
49
|
+
import { TestDataspaceDataPlaneApp } from '@twin.org/dataspace-test-app';
|
|
50
|
+
|
|
51
|
+
const app = new TestDataspaceDataPlaneApp();
|
|
52
|
+
|
|
53
|
+
const entityRequest: IDataRequest = {
|
|
54
|
+
type: DataRequestType.DataAssetEntities,
|
|
55
|
+
entitySet: {
|
|
56
|
+
entityType: 'https://vocabulary.uncefact.org/Consignment',
|
|
57
|
+
entityId: ['urn:ucr:24PLP051219453I002610799053311']
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const entityResponse = await app.handleDataRequest(entityRequest, undefined, 10);
|
|
62
|
+
console.log(Array.isArray(entityResponse.data)); // false
|
|
63
|
+
|
|
64
|
+
const queryRequest: IDataRequest = {
|
|
65
|
+
type: DataRequestType.QueryDataAsset,
|
|
66
|
+
query: {
|
|
67
|
+
query: {
|
|
68
|
+
destinationCountry: {
|
|
69
|
+
equals: 'unece:CountryId#GB'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const queryResponse = await app.handleDataRequest(queryRequest, undefined, 10);
|
|
76
|
+
console.log(Array.isArray(queryResponse.data)); // true
|
|
77
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-test-app",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.19",
|
|
4
|
+
"description": "Provides a sample dataspace app for local integration tests and development workflows.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/dataspace.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/context": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-core": "next",
|
|
21
|
-
"@twin.org/dataspace-models": "0.0.3-next.
|
|
21
|
+
"@twin.org/dataspace-models": "0.0.3-next.19",
|
|
22
22
|
"@twin.org/engine-models": "next",
|
|
23
23
|
"@twin.org/engine-types": "next",
|
|
24
24
|
"@twin.org/logging-models": "next",
|