@twin.org/dataspace-test-app 0.0.3-next.18 → 0.0.3-next.20
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,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.20](https://github.com/twinfoundation/dataspace/compare/dataspace-test-app-v0.0.3-next.19...dataspace-test-app-v0.0.3-next.20) (2026-03-17)
|
|
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.19 to 0.0.3-next.20
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **dataspace-test-app:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/dataspace-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
30
|
+
|
|
3
31
|
## [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
32
|
|
|
5
33
|
|
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
|
+
```
|
|
@@ -28,7 +28,7 @@ The constructor options.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### APP\_ID
|
|
31
|
+
### APP\_ID {#app_id}
|
|
32
32
|
|
|
33
33
|
> `readonly` `static` **APP\_ID**: `"https://twin.example.org/app1"` = `"https://twin.example.org/app1"`
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ App Name.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### CLASS\_NAME
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Runtime name for the class.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,7 +62,7 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### datasetsHandled()
|
|
65
|
+
### datasetsHandled() {#datasetshandled}
|
|
66
66
|
|
|
67
67
|
> **datasetsHandled**(): `Promise`\<`IDataspaceProtocolDataset`[]\>
|
|
68
68
|
|
|
@@ -80,7 +80,7 @@ Dataspace Protocol compliant datasets
|
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
83
|
-
### supportedQueryTypes()
|
|
83
|
+
### supportedQueryTypes() {#supportedquerytypes}
|
|
84
84
|
|
|
85
85
|
> **supportedQueryTypes**(): `string`[]
|
|
86
86
|
|
|
@@ -98,7 +98,7 @@ Types.
|
|
|
98
98
|
|
|
99
99
|
***
|
|
100
100
|
|
|
101
|
-
### start()
|
|
101
|
+
### start() {#start}
|
|
102
102
|
|
|
103
103
|
> **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
|
|
104
104
|
|
|
@@ -122,7 +122,7 @@ the logging component type of such a node.
|
|
|
122
122
|
|
|
123
123
|
***
|
|
124
124
|
|
|
125
|
-
### activitiesHandled()
|
|
125
|
+
### activitiesHandled() {#activitieshandled}
|
|
126
126
|
|
|
127
127
|
> **activitiesHandled**(): `IActivityQuery`[]
|
|
128
128
|
|
|
@@ -140,7 +140,7 @@ The activities handled by the App.
|
|
|
140
140
|
|
|
141
141
|
***
|
|
142
142
|
|
|
143
|
-
### handleActivity()
|
|
143
|
+
### handleActivity() {#handleactivity}
|
|
144
144
|
|
|
145
145
|
> **handleActivity**\<`T`\>(`activity`): `Promise`\<`T`\>
|
|
146
146
|
|
|
@@ -172,7 +172,7 @@ Activity processing result
|
|
|
172
172
|
|
|
173
173
|
***
|
|
174
174
|
|
|
175
|
-
### handleDataRequest()
|
|
175
|
+
### handleDataRequest() {#handledatarequest}
|
|
176
176
|
|
|
177
177
|
> **handleDataRequest**(`dataRequest`, `cursor?`, `limit?`): `Promise`\<\{ `data`: `IJsonLdDocument`; `cursor?`: `string`; \}\>
|
|
178
178
|
|
|
@@ -4,14 +4,8 @@ Test App Constructor options.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### loggingComponentType?
|
|
7
|
+
### loggingComponentType? {#loggingcomponenttype}
|
|
8
8
|
|
|
9
9
|
> `optional` **loggingComponentType**: `string`
|
|
10
10
|
|
|
11
11
|
Logging component type.
|
|
12
|
-
|
|
13
|
-
#### Default
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
logging
|
|
17
|
-
```
|
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.20",
|
|
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.20",
|
|
22
22
|
"@twin.org/engine-models": "next",
|
|
23
23
|
"@twin.org/engine-types": "next",
|
|
24
24
|
"@twin.org/logging-models": "next",
|