@twin.org/dataspace-data-plane-socket-client 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 Data Plane Socket Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides a WebSocket client for subscribing to activity log status notifications. It enables event-driven integrations that require timely status updates as activities progress through processing stages.
|
|
4
|
+
|
|
5
|
+
It complements request-response clients by covering real-time notification scenarios.
|
|
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-data-plane-socket-client-v0.0.3-next.19...dataspace-data-plane-socket-client-v0.0.3-next.20) (2026-03-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **dataspace-data-plane-socket-client:** 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-data-plane-socket-client-v0.0.3-next.18...dataspace-data-plane-socket-client-v0.0.3-next.19) (2026-03-12)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **dataspace-data-plane-socket-client:** 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-data-plane-socket-client-v0.0.3-next.17...dataspace-data-plane-socket-client-v0.0.3-next.18) (2026-03-09)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -345,4 +373,4 @@
|
|
|
345
373
|
* dependencies
|
|
346
374
|
* @twin.org/dataspace-models bumped from 0.0.1-next.0 to 0.0.1-next.1
|
|
347
375
|
|
|
348
|
-
##
|
|
376
|
+
## Changelog
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Data Plane Socket Client Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to consume activity updates over sockets and manage local subscription callbacks.
|
|
4
|
+
|
|
5
|
+
## DataspaceDataPlaneSocketClient
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { DataspaceDataPlaneSocketClient } from '@twin.org/dataspace-data-plane-socket-client';
|
|
9
|
+
|
|
10
|
+
const client = new DataspaceDataPlaneSocketClient({
|
|
11
|
+
config: {
|
|
12
|
+
endpoint: 'ws://localhost:8090'
|
|
13
|
+
},
|
|
14
|
+
loggingComponentType: 'logging'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(client.className()); // DataspaceDataPlaneSocketClient
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { DataspaceDataPlaneSocketClient } from '@twin.org/dataspace-data-plane-socket-client';
|
|
22
|
+
|
|
23
|
+
const client = new DataspaceDataPlaneSocketClient({
|
|
24
|
+
config: {
|
|
25
|
+
endpoint: 'ws://localhost:8090'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const subscriptionId = await client.subscribeToActivityLog(async notification => {
|
|
30
|
+
console.log(notification.id); // urn:activity-log:2001
|
|
31
|
+
console.log(notification.status); // completed
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await client.unSubscribeToActivityLog(subscriptionId);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { DataspaceDataPlaneSocketClient } from '@twin.org/dataspace-data-plane-socket-client';
|
|
39
|
+
|
|
40
|
+
const client = new DataspaceDataPlaneSocketClient({
|
|
41
|
+
config: {
|
|
42
|
+
endpoint: 'ws://localhost:8090'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
await client.getActivityLogEntry('urn:activity-log:2001');
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.log(error instanceof Error); // true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
await client.getDataAssetEntities(
|
|
54
|
+
{ entityType: 'https://vocabulary.uncefact.org/Consignment' },
|
|
55
|
+
'consumer-process-id',
|
|
56
|
+
undefined,
|
|
57
|
+
10,
|
|
58
|
+
'eyJhbGciOi...'
|
|
59
|
+
);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.log(error instanceof Error); // true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
await client.queryDataAsset('consumer-process-id', { query: {} }, undefined, 10, 'eyJhbGciOi...');
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log(error instanceof Error); // true
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { DataspaceDataPlaneSocketClient } from '@twin.org/dataspace-data-plane-socket-client';
|
|
73
|
+
import type { IActivityStreamsActivity } from '@twin.org/standards-w3c-activity-streams';
|
|
74
|
+
|
|
75
|
+
const client = new DataspaceDataPlaneSocketClient({
|
|
76
|
+
config: {
|
|
77
|
+
endpoint: 'ws://localhost:8090'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const activity: IActivityStreamsActivity = {
|
|
82
|
+
'@context': 'https://www.w3.org/ns/activitystreams',
|
|
83
|
+
id: 'urn:activity:2001',
|
|
84
|
+
type: 'Create'
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
await client.notifyActivity(activity);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.log(error instanceof Error); // true
|
|
91
|
+
}
|
|
92
|
+
```
|
|
@@ -36,7 +36,7 @@ Options for the client.
|
|
|
36
36
|
|
|
37
37
|
## Properties
|
|
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
|
-
### notifyActivity()
|
|
65
|
+
### notifyActivity() {#notifyactivity}
|
|
66
66
|
|
|
67
67
|
> **notifyActivity**(`activity`): `Promise`\<`string`\>
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ The Activity's identifier.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### subscribeToActivityLog()
|
|
91
|
+
### subscribeToActivityLog() {#subscribetoactivitylog}
|
|
92
92
|
|
|
93
93
|
> **subscribeToActivityLog**(`callback`, `subscriptionId?`): `Promise`\<`string`\>
|
|
94
94
|
|
|
@@ -120,7 +120,7 @@ The subscription Id.
|
|
|
120
120
|
|
|
121
121
|
***
|
|
122
122
|
|
|
123
|
-
### unSubscribeToActivityLog()
|
|
123
|
+
### unSubscribeToActivityLog() {#unsubscribetoactivitylog}
|
|
124
124
|
|
|
125
125
|
> **unSubscribeToActivityLog**(`subscriptionId`): `Promise`\<`void`\>
|
|
126
126
|
|
|
@@ -146,7 +146,7 @@ The subscription Id.
|
|
|
146
146
|
|
|
147
147
|
***
|
|
148
148
|
|
|
149
|
-
### getActivityLogEntry()
|
|
149
|
+
### getActivityLogEntry() {#getactivitylogentry}
|
|
150
150
|
|
|
151
151
|
> **getActivityLogEntry**(`logEntryId`): `Promise`\<`IActivityLogEntry`\>
|
|
152
152
|
|
|
@@ -176,7 +176,7 @@ NotFoundError if activity log entry is not known.
|
|
|
176
176
|
|
|
177
177
|
***
|
|
178
178
|
|
|
179
|
-
### getDataAssetEntities()
|
|
179
|
+
### getDataAssetEntities() {#getdataassetentities}
|
|
180
180
|
|
|
181
181
|
> **getDataAssetEntities**(`entitySet`, `consumerPid`, `cursor?`, `limit?`, `trustPayload?`): `Promise`\<`IDataAssetItemListResult`\>
|
|
182
182
|
|
|
@@ -227,7 +227,7 @@ The item list and optional cursor for pagination via Link headers.
|
|
|
227
227
|
|
|
228
228
|
***
|
|
229
229
|
|
|
230
|
-
### queryDataAsset()
|
|
230
|
+
### queryDataAsset() {#querydataasset}
|
|
231
231
|
|
|
232
232
|
> **queryDataAsset**(`consumerPid`, `query`, `cursor?`, `limit?`, `trustPayload?`): `Promise`\<`IDataAssetItemListResult`\>
|
|
233
233
|
|
|
@@ -278,7 +278,7 @@ The item list and optional cursor for pagination via Link headers.
|
|
|
278
278
|
|
|
279
279
|
***
|
|
280
280
|
|
|
281
|
-
### handleConnected()
|
|
281
|
+
### handleConnected() {#handleconnected}
|
|
282
282
|
|
|
283
283
|
> `protected` **handleConnected**(): `Promise`\<`void`\>
|
|
284
284
|
|
|
@@ -294,7 +294,7 @@ Handle the socket connection.
|
|
|
294
294
|
|
|
295
295
|
***
|
|
296
296
|
|
|
297
|
-
### handleError()
|
|
297
|
+
### handleError() {#handleerror}
|
|
298
298
|
|
|
299
299
|
> `protected` **handleError**(`err`): `Promise`\<`void`\>
|
|
300
300
|
|
|
@@ -4,7 +4,7 @@ The options for the dataspace data plane socket client.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### loggingComponentType?
|
|
7
|
+
### loggingComponentType? {#loggingcomponenttype}
|
|
8
8
|
|
|
9
9
|
> `optional` **loggingComponentType**: `string`
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ The type of logging component to use.
|
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
15
|
-
### config
|
|
15
|
+
### config {#config}
|
|
16
16
|
|
|
17
17
|
> **config**: [`IDataspaceDataPlaneSocketClientConfig`](IDataspaceDataPlaneSocketClientConfig.md)
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-data-plane-socket-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.20",
|
|
4
|
+
"description": "Provides a WebSocket client for subscribing to activity log status notifications.",
|
|
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/api-models": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
|
-
"@twin.org/dataspace-models": "0.0.3-next.
|
|
21
|
+
"@twin.org/dataspace-models": "0.0.3-next.20",
|
|
22
22
|
"@twin.org/logging-models": "next",
|
|
23
23
|
"@twin.org/nameof": "next"
|
|
24
24
|
},
|