@twin.org/dataspace-control-plane-service 0.0.3-next.45 → 0.0.3-next.47

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.
@@ -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, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
77
+ requestTransfer(request: IDataspaceProtocolTransferRequestMessage, publicOrigin: string, options: {
78
+ autoStart?: boolean;
79
+ } | undefined, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
73
80
  /**
74
- * Start a data transfer as a Consumer.
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
- startDataTransfer(agreementId: string, providerEndpoint: string, publicOrigin: string, format: string, trustPayload: unknown): Promise<{
99
+ prepareTransfer(agreementId: string, providerEndpoint: string, publicOrigin: string, format: string, trustPayload: unknown): Promise<{
93
100
  consumerPid: string;
94
101
  }>;
95
102
  /**
@@ -103,6 +110,20 @@ export declare class DataspaceControlPlaneService implements IDataspaceControlPl
103
110
  * Role Performed: Provider / Consumer
104
111
  */
105
112
  startTransfer(message: IDataspaceProtocolTransferStartMessage, publicOrigin: string, trustPayload: unknown): Promise<IDataspaceProtocolTransferStartMessage | IDataspaceProtocolTransferError>;
113
+ /**
114
+ * Start a Transfer Process as the Provider.
115
+ * Builds a TransferStartMessage for a transfer already accepted by this node (REQUESTED, or
116
+ * SUSPENDED to resume), transitions it to STARTED, and POSTs the message to the consumer callback.
117
+ * consumerPid/providerPid/callbackAddress are resolved from the stored record; the call is then
118
+ * forwarded to startTransfer, the single owner of the start state machine (it verifies the caller is
119
+ * the provider, builds the dataAddress for PULL, persists STARTED, and delivers to the consumer).
120
+ * This is the provider-side mirror of prepareTransfer.
121
+ * @param pid The Process ID (consumerPid or providerPid) identifying the transfer to start.
122
+ * @param publicOrigin The public origin URL of this provider node (used to build the data plane endpoint for PULL transfers).
123
+ * @param trustPayload Trust payload proving the caller is the provider.
124
+ * @returns Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.
125
+ */
126
+ transferStarted(pid: string, publicOrigin: string, trustPayload: unknown): Promise<IDataspaceProtocolTransferStartMessage | IDataspaceProtocolTransferError>;
106
127
  /**
107
128
  * Complete a Transfer Process.
108
129
  * @param message Transfer completion message (DSP compliant).
@@ -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,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.47](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.46...dataspace-control-plane-service-v0.0.3-next.47) (2026-06-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * add transferStarted provider method to start a data transfer ([#206](https://github.com/iotaledger/twin-dataspace/issues/206)) ([3ec2dc8](https://github.com/iotaledger/twin-dataspace/commit/3ec2dc8943c8531cd8d8e4ab07cb970ef7b11090))
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.46 to 0.0.3-next.47
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * 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))
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.45 to 0.0.3-next.46
30
+
3
31
  ## [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
32
 
5
33
 
@@ -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
- ### startDataTransfer() {#startdatatransfer}
290
+ ### prepareTransfer() {#preparetransfer}
261
291
 
262
- > **startDataTransfer**(`agreementId`, `providerEndpoint`, `publicOrigin`, `format`, `trustPayload`): `Promise`\<\{ `consumerPid`: `string`; \}\>
292
+ > **prepareTransfer**(`agreementId`, `providerEndpoint`, `publicOrigin`, `format`, `trustPayload`): `Promise`\<\{ `consumerPid`: `string`; \}\>
263
293
 
264
- Start a data transfer as a Consumer.
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.startDataTransfer`
346
+ `IDataspaceControlPlaneComponent.prepareTransfer`
317
347
 
318
348
  ***
319
349
 
@@ -358,6 +388,50 @@ Role Performed: Provider / Consumer
358
388
 
359
389
  ***
360
390
 
391
+ ### transferStarted() {#transferstarted}
392
+
393
+ > **transferStarted**(`pid`, `publicOrigin`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferStartMessage`\>
394
+
395
+ Start a Transfer Process as the Provider.
396
+ Builds a TransferStartMessage for a transfer already accepted by this node (REQUESTED, or
397
+ SUSPENDED to resume), transitions it to STARTED, and POSTs the message to the consumer callback.
398
+ consumerPid/providerPid/callbackAddress are resolved from the stored record; the call is then
399
+ forwarded to startTransfer, the single owner of the start state machine (it verifies the caller is
400
+ the provider, builds the dataAddress for PULL, persists STARTED, and delivers to the consumer).
401
+ This is the provider-side mirror of prepareTransfer.
402
+
403
+ #### Parameters
404
+
405
+ ##### pid
406
+
407
+ `string`
408
+
409
+ The Process ID (consumerPid or providerPid) identifying the transfer to start.
410
+
411
+ ##### publicOrigin
412
+
413
+ `string`
414
+
415
+ The public origin URL of this provider node (used to build the data plane endpoint for PULL transfers).
416
+
417
+ ##### trustPayload
418
+
419
+ `unknown`
420
+
421
+ Trust payload proving the caller is the provider.
422
+
423
+ #### Returns
424
+
425
+ `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferStartMessage`\>
426
+
427
+ Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.
428
+
429
+ #### Implementation of
430
+
431
+ `IDataspaceControlPlaneComponent.transferStarted`
432
+
433
+ ***
434
+
361
435
  ### completeTransfer() {#completetransfer}
362
436
 
363
437
  > **completeTransfer**(`message`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferProcess`\>
@@ -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
- "startingDataTransfer": "Starting consumer-initiated data transfer (agreementId: {agreementId}, providerEndpoint: {providerEndpoint}, format: {format})",
27
- "dataTransferStarted": "Consumer data transfer started successfully (consumerPid: {consumerPid}, providerPid: {providerPid}, agreementId: {agreementId}, format: {format})"
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,12 +53,17 @@
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",
59
63
  "transferProcessTerminatedProvider": "Transfer Process \"{providerPid}\" is terminated and cannot be used",
60
64
  "invalidTransferRequest": "Transfer Request does not conform to Dataspace Protocol specification",
61
65
  "invalidStateForStart": "Transfer Process cannot be started: current state is \"{currentState}\", expected REQUESTED or SUSPENDED",
66
+ "transferStartNotProvider": "Transfer Process cannot be started by this node: it is not acting as the Provider for this transfer (pid: {pid}, role: {role})",
62
67
  "invalidStateForComplete": "Transfer Process cannot be completed: current state is \"{currentState}\", expected STARTED",
63
68
  "invalidStateForSuspend": "Transfer Process cannot be suspended: current state is \"{currentState}\", expected STARTED",
64
69
  "invalidTransferStartMessage": "Transfer Start Message does not conform to Dataspace Protocol specification",
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.45",
3
+ "version": "0.0.3-next.47",
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.45",
22
+ "@twin.org/dataspace-models": "0.0.3-next.47",
23
23
  "@twin.org/entity": "next",
24
24
  "@twin.org/entity-storage-models": "next",
25
25
  "@twin.org/federated-catalogue-models": "next",