@twin.org/dataspace-control-plane-service 0.0.3-next.45 → 0.0.3-next.46
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/dist/es/dataspaceControlPlaneRoutes.js +2 -1
- package/dist/es/dataspaceControlPlaneRoutes.js.map +1 -1
- package/dist/es/dataspaceControlPlaneService.js +217 -31
- package/dist/es/dataspaceControlPlaneService.js.map +1 -1
- package/dist/es/models/IDataspaceControlPlaneServiceConfig.js.map +1 -1
- package/dist/types/dataspaceControlPlaneService.d.ts +10 -3
- package/dist/types/models/IDataspaceControlPlaneServiceConfig.d.ts +8 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/DataspaceControlPlaneService.md +35 -5
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConfig.md +12 -0
- package/locales/en.json +6 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDataspaceControlPlaneServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IDataspaceControlPlaneServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Dataspace Control Plane service configuration.\n */\nexport interface IDataspaceControlPlaneServiceConfig {\n\t/**\n\t * Override the default trust generator type for token generation.\n\t * If not specified, the default trust generator configured in the trust component will be used.\n\t */\n\toverrideTrustGeneratorType?: string;\n\n\t/**\n\t * Data plane endpoint path for PULL transfers (path only, not full URL).\n\t * Will be combined with the public origin from the hosting component.\n\t *\n\t * REQUIRED if PULL transfers are supported.\n\t * If not specified, PULL transfers will not be available.\n\t *\n\t * Example: \"data-plane/data\" or \"api/data-plane/data\"\n\t */\n\tdataPlanePath?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IDataspaceControlPlaneServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IDataspaceControlPlaneServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Dataspace Control Plane service configuration.\n */\nexport interface IDataspaceControlPlaneServiceConfig {\n\t/**\n\t * Override the default trust generator type for token generation.\n\t * If not specified, the default trust generator configured in the trust component will be used.\n\t */\n\toverrideTrustGeneratorType?: string;\n\n\t/**\n\t * Data plane endpoint path for PULL transfers (path only, not full URL).\n\t * Will be combined with the public origin from the hosting component.\n\t *\n\t * REQUIRED if PULL transfers are supported.\n\t * If not specified, PULL transfers will not be available.\n\t *\n\t * Example: \"data-plane/data\" or \"api/data-plane/data\"\n\t */\n\tdataPlanePath?: string;\n\n\t/**\n\t * Control plane callback mount path (path only). Combined with this node's public origin to form the\n\t * consumer callbackAddress a provider POSTs DSP transfer messages back to (e.g.\n\t * `<origin>/<callbackPath>/transfers/:pid/start`), with `?organization=` appended for tenant routing.\n\t *\n\t * Example: \"dataspace\" or \"api/dataspace\".\n\t */\n\tcallbackPath?: string;\n}\n"]}
|
|
@@ -63,15 +63,22 @@ export declare class DataspaceControlPlaneService implements IDataspaceControlPl
|
|
|
63
63
|
* Request a Transfer Process.
|
|
64
64
|
* Creates a new Transfer Process in REQUESTED state.
|
|
65
65
|
* @param request Transfer request message (DSP compliant).
|
|
66
|
+
* @param publicOrigin The public origin of this provider node, resolved by the REST route from the
|
|
67
|
+
* hosting component; used to build the data-plane endpoint when auto-starting.
|
|
68
|
+
* @param options Request options.
|
|
69
|
+
* @param options.autoStart When true, the provider immediately starts the requested transfer (scheduled
|
|
70
|
+
* on the next tick); when omitted/false the provider start must be triggered explicitly.
|
|
66
71
|
* @param trustPayload Trust payload containing authorization information (Base64-encoded token).
|
|
67
72
|
* @returns Transfer Process (DSP compliant) with state REQUESTED, or TransferError if the operation fails.
|
|
68
73
|
*
|
|
69
74
|
* Role Performed: Provider
|
|
70
75
|
* Called by: Consumer when it wants to request a new Transfer Process
|
|
71
76
|
*/
|
|
72
|
-
requestTransfer(request: IDataspaceProtocolTransferRequestMessage,
|
|
77
|
+
requestTransfer(request: IDataspaceProtocolTransferRequestMessage, publicOrigin: string, options: {
|
|
78
|
+
autoStart?: boolean;
|
|
79
|
+
} | undefined, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
73
80
|
/**
|
|
74
|
-
*
|
|
81
|
+
* Prepare a data transfer as a Consumer.
|
|
75
82
|
* Generates a consumerPid, POSTs a TransferRequestMessage to the provider's DSP endpoint,
|
|
76
83
|
* and (only if the provider accepts) persists a local TransferProcess in REQUESTED state.
|
|
77
84
|
* @param agreementId The finalized agreement ID from contract negotiation.
|
|
@@ -89,7 +96,7 @@ export declare class DataspaceControlPlaneService implements IDataspaceControlPl
|
|
|
89
96
|
* registration ignores the runtime `endpoint` arg and silently POSTs to its
|
|
90
97
|
* static endpoint instead.
|
|
91
98
|
*/
|
|
92
|
-
|
|
99
|
+
prepareTransfer(agreementId: string, providerEndpoint: string, publicOrigin: string, format: string, trustPayload: unknown): Promise<{
|
|
93
100
|
consumerPid: string;
|
|
94
101
|
}>;
|
|
95
102
|
/**
|
|
@@ -17,4 +17,12 @@ export interface IDataspaceControlPlaneServiceConfig {
|
|
|
17
17
|
* Example: "data-plane/data" or "api/data-plane/data"
|
|
18
18
|
*/
|
|
19
19
|
dataPlanePath?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Control plane callback mount path (path only). Combined with this node's public origin to form the
|
|
22
|
+
* consumer callbackAddress a provider POSTs DSP transfer messages back to (e.g.
|
|
23
|
+
* `<origin>/<callbackPath>/transfers/:pid/start`), with `?organization=` appended for tenant routing.
|
|
24
|
+
*
|
|
25
|
+
* Example: "dataspace" or "api/dataspace".
|
|
26
|
+
*/
|
|
27
|
+
callbackPath?: string;
|
|
20
28
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.46](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.45...dataspace-control-plane-service-v0.0.3-next.46) (2026-06-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* cross-node transfer callbacks and DataTransferManager auto-start ([#199](https://github.com/iotaledger/twin-dataspace/issues/199)) ([1089aa3](https://github.com/iotaledger/twin-dataspace/commit/1089aa344e3598e382f37a82ca03230c5cf6cacd))
|
|
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.45 to 0.0.3-next.46
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.45](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.44...dataspace-control-plane-service-v0.0.3-next.45) (2026-06-17)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -223,7 +223,7 @@ A promise that resolves when the cleanup task has been removed.
|
|
|
223
223
|
|
|
224
224
|
### requestTransfer() {#requesttransfer}
|
|
225
225
|
|
|
226
|
-
> **requestTransfer**(`request`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferProcess`\>
|
|
226
|
+
> **requestTransfer**(`request`, `publicOrigin`, `options`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferProcess`\>
|
|
227
227
|
|
|
228
228
|
Request a Transfer Process.
|
|
229
229
|
Creates a new Transfer Process in REQUESTED state.
|
|
@@ -236,6 +236,36 @@ Creates a new Transfer Process in REQUESTED state.
|
|
|
236
236
|
|
|
237
237
|
Transfer request message (DSP compliant).
|
|
238
238
|
|
|
239
|
+
##### publicOrigin
|
|
240
|
+
|
|
241
|
+
`string`
|
|
242
|
+
|
|
243
|
+
The public origin of this provider node, resolved by the REST route from the
|
|
244
|
+
hosting component; used to build the data-plane endpoint when auto-starting.
|
|
245
|
+
|
|
246
|
+
##### options
|
|
247
|
+
|
|
248
|
+
\{ `autoStart?`: `boolean`; \} \| `undefined`
|
|
249
|
+
|
|
250
|
+
Request options.
|
|
251
|
+
|
|
252
|
+
###### Type Literal
|
|
253
|
+
|
|
254
|
+
\{ `autoStart?`: `boolean`; \}
|
|
255
|
+
|
|
256
|
+
Request options.
|
|
257
|
+
|
|
258
|
+
###### autoStart?
|
|
259
|
+
|
|
260
|
+
`boolean`
|
|
261
|
+
|
|
262
|
+
When true, the provider immediately starts the requested transfer (scheduled
|
|
263
|
+
on the next tick); when omitted/false the provider start must be triggered explicitly.
|
|
264
|
+
|
|
265
|
+
***
|
|
266
|
+
|
|
267
|
+
`undefined`
|
|
268
|
+
|
|
239
269
|
##### trustPayload
|
|
240
270
|
|
|
241
271
|
`unknown`
|
|
@@ -257,11 +287,11 @@ Called by: Consumer when it wants to request a new Transfer Process
|
|
|
257
287
|
|
|
258
288
|
***
|
|
259
289
|
|
|
260
|
-
###
|
|
290
|
+
### prepareTransfer() {#preparetransfer}
|
|
261
291
|
|
|
262
|
-
> **
|
|
292
|
+
> **prepareTransfer**(`agreementId`, `providerEndpoint`, `publicOrigin`, `format`, `trustPayload`): `Promise`\<\{ `consumerPid`: `string`; \}\>
|
|
263
293
|
|
|
264
|
-
|
|
294
|
+
Prepare a data transfer as a Consumer.
|
|
265
295
|
Generates a consumerPid, POSTs a TransferRequestMessage to the provider's DSP endpoint,
|
|
266
296
|
and (only if the provider accepts) persists a local TransferProcess in REQUESTED state.
|
|
267
297
|
|
|
@@ -313,7 +343,7 @@ static endpoint instead.
|
|
|
313
343
|
|
|
314
344
|
#### Implementation of
|
|
315
345
|
|
|
316
|
-
`IDataspaceControlPlaneComponent.
|
|
346
|
+
`IDataspaceControlPlaneComponent.prepareTransfer`
|
|
317
347
|
|
|
318
348
|
***
|
|
319
349
|
|
|
@@ -24,3 +24,15 @@ REQUIRED if PULL transfers are supported.
|
|
|
24
24
|
If not specified, PULL transfers will not be available.
|
|
25
25
|
|
|
26
26
|
Example: "data-plane/data" or "api/data-plane/data"
|
|
27
|
+
|
|
28
|
+
***
|
|
29
|
+
|
|
30
|
+
### callbackPath? {#callbackpath}
|
|
31
|
+
|
|
32
|
+
> `optional` **callbackPath?**: `string`
|
|
33
|
+
|
|
34
|
+
Control plane callback mount path (path only). Combined with this node's public origin to form the
|
|
35
|
+
consumer callbackAddress a provider POSTs DSP transfer messages back to (e.g.
|
|
36
|
+
`<origin>/<callbackPath>/transfers/:pid/start`), with `?organization=` appended for tenant routing.
|
|
37
|
+
|
|
38
|
+
Example: "dataspace" or "api/dataspace".
|
package/locales/en.json
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"negotiationHistoryRetrieved": "Negotiation history retrieved successfully",
|
|
24
24
|
"stalledNegotiationsCleanupComplete": "Stalled negotiations cleanup completed (cleanedUp: {cleanedUp})",
|
|
25
25
|
"pushTransferStarted": "PUSH transfer started (consumerPid: {consumerPid}, providerPid: {providerPid}, endpoint: {endpoint})",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"preparingTransfer": "Preparing consumer-initiated data transfer (agreementId: {agreementId}, providerEndpoint: {providerEndpoint}, format: {format})",
|
|
27
|
+
"transferPrepared": "Consumer data transfer prepared successfully (consumerPid: {consumerPid}, providerPid: {providerPid}, agreementId: {agreementId}, format: {format})"
|
|
28
28
|
},
|
|
29
29
|
"dataspaceControlPlanePolicyRequester": {
|
|
30
30
|
"offerReceived": "Offer received from provider (negotiationId: {negotiationId}, offerId: {offerId})",
|
|
@@ -53,6 +53,10 @@
|
|
|
53
53
|
},
|
|
54
54
|
"error": {
|
|
55
55
|
"dataspaceControlPlaneService": {
|
|
56
|
+
"transferCallbackRejected": "Consumer rejected a transfer state-change callback (messageKind: {messageKind}, consumerPid: {consumerPid}, providerPid: {providerPid}, callbackAddress: {callbackAddress})",
|
|
57
|
+
"transferCallbackFailed": "Failed to deliver a transfer state-change callback to the consumer (messageKind: {messageKind}, consumerPid: {consumerPid}, providerPid: {providerPid}, callbackAddress: {callbackAddress})",
|
|
58
|
+
"autoStartFailed": "Provider auto-start of a requested transfer failed (consumerPid: {consumerPid})",
|
|
59
|
+
"autoStartPublicOriginMissing": "Cannot auto-start the transfer: this node's public origin could not be resolved; holding the transfer in REQUESTED (consumerPid: {consumerPid})",
|
|
56
60
|
"transferProcessNotFound": "Transfer Process not found",
|
|
57
61
|
"pullTransfersNotSupported": "PULL transfers are not supported. Configure dataPlanePath in service configuration to enable PULL transfers.",
|
|
58
62
|
"transferProcessTerminated": "Transfer Process \"{consumerPid}\" is terminated and cannot be used",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-control-plane-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.46",
|
|
4
4
|
"description": "Implements agreement negotiation and transfer process lifecycle management for control plane operations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/context": "next",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/crypto": "next",
|
|
22
|
-
"@twin.org/dataspace-models": "0.0.3-next.
|
|
22
|
+
"@twin.org/dataspace-models": "0.0.3-next.46",
|
|
23
23
|
"@twin.org/entity": "next",
|
|
24
24
|
"@twin.org/entity-storage-models": "next",
|
|
25
25
|
"@twin.org/federated-catalogue-models": "next",
|