@twin.org/dataspace-control-plane-service 0.0.3-next.52 → 0.0.3-next.53
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 +1 -1
- package/dist/es/dataspaceControlPlaneRoutes.js.map +1 -1
- package/dist/es/dataspaceControlPlaneService.js +132 -11
- package/dist/es/dataspaceControlPlaneService.js.map +1 -1
- package/dist/es/models/IDataspaceControlPlaneServiceConfig.js.map +1 -1
- package/dist/types/dataspaceControlPlaneService.d.ts +3 -7
- package/dist/types/models/IDataspaceControlPlaneServiceConfig.d.ts +25 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/DataspaceControlPlaneService.md +3 -25
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConfig.md +37 -0
- package/locales/en.json +3 -1
- 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.\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"]}
|
|
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.\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\t/**\n\t * Whether the provider immediately starts a transfer once it has been requested. This is a\n\t * provider-side decision only; the consumer cannot request or influence auto-start. When false\n\t * (the default) the transfer stays in REQUESTED until the provider explicitly calls transferStarted.\n\t *\n\t * Defaults to false.\n\t */\n\tautoStartTransfers?: boolean;\n\n\t/**\n\t * How long (ms) a negotiation may sit without progress before the periodic cleanup treats it as\n\t * timed out, removes it, and notifies the registered callbacks (onTimeout, falling back to\n\t * onFailed with reason \"negotiationStalled\"). Requires a task-scheduler component to be configured.\n\t *\n\t * Defaults to 1800000 (30 minutes).\n\t */\n\tstalledNegotiationTimeoutMs?: number;\n\n\t/**\n\t * How long (ms) a consumer-initiated transfer may sit in REQUESTED without the provider progressing\n\t * it before the periodic cleanup treats it as timed out, removes it, and notifies the registered\n\t * transfer callbacks (onTimeout, falling back to onFailed with reason \"transferStalled\"). Requires a\n\t * task-scheduler component to be configured.\n\t *\n\t * Defaults to 1800000 (30 minutes).\n\t */\n\tstalledTransferTimeoutMs?: number;\n}\n"]}
|
|
@@ -61,20 +61,16 @@ export declare class DataspaceControlPlaneService implements IDataspaceControlPl
|
|
|
61
61
|
stop(nodeLoggingComponentType?: string): Promise<void>;
|
|
62
62
|
/**
|
|
63
63
|
* Request a Transfer Process.
|
|
64
|
-
* Creates a new Transfer Process in REQUESTED state.
|
|
64
|
+
* Creates a new Transfer Process in REQUESTED state. Whether it auto-starts is a provider-side
|
|
65
|
+
* decision (the `autoStartTransfers` service config), never something the consumer can request.
|
|
65
66
|
* @param request Transfer request message (DSP compliant).
|
|
66
|
-
* @param options Request options.
|
|
67
|
-
* @param options.autoStart When true, the provider immediately starts the requested transfer (scheduled
|
|
68
|
-
* on the next tick); when omitted/false the provider start must be triggered explicitly.
|
|
69
67
|
* @param trustPayload Trust payload containing authorization information.
|
|
70
68
|
* @returns Transfer Process (DSP compliant) with state REQUESTED, or TransferError if the operation fails.
|
|
71
69
|
*
|
|
72
70
|
* Role Performed: Provider
|
|
73
71
|
* Called by: Consumer when it wants to request a new Transfer Process
|
|
74
72
|
*/
|
|
75
|
-
requestTransfer(request: IDataspaceProtocolTransferRequestMessage,
|
|
76
|
-
autoStart?: boolean;
|
|
77
|
-
} | undefined, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
73
|
+
requestTransfer(request: IDataspaceProtocolTransferRequestMessage, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
78
74
|
/**
|
|
79
75
|
* Prepare a data transfer as a Consumer.
|
|
80
76
|
* Generates a consumerPid, POSTs a TransferRequestMessage to the provider's DSP endpoint,
|
|
@@ -25,4 +25,29 @@ export interface IDataspaceControlPlaneServiceConfig {
|
|
|
25
25
|
* Example: "dataspace" or "api/dataspace".
|
|
26
26
|
*/
|
|
27
27
|
callbackPath?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the provider immediately starts a transfer once it has been requested. This is a
|
|
30
|
+
* provider-side decision only; the consumer cannot request or influence auto-start. When false
|
|
31
|
+
* (the default) the transfer stays in REQUESTED until the provider explicitly calls transferStarted.
|
|
32
|
+
*
|
|
33
|
+
* Defaults to false.
|
|
34
|
+
*/
|
|
35
|
+
autoStartTransfers?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* How long (ms) a negotiation may sit without progress before the periodic cleanup treats it as
|
|
38
|
+
* timed out, removes it, and notifies the registered callbacks (onTimeout, falling back to
|
|
39
|
+
* onFailed with reason "negotiationStalled"). Requires a task-scheduler component to be configured.
|
|
40
|
+
*
|
|
41
|
+
* Defaults to 1800000 (30 minutes).
|
|
42
|
+
*/
|
|
43
|
+
stalledNegotiationTimeoutMs?: number;
|
|
44
|
+
/**
|
|
45
|
+
* How long (ms) a consumer-initiated transfer may sit in REQUESTED without the provider progressing
|
|
46
|
+
* it before the periodic cleanup treats it as timed out, removes it, and notifies the registered
|
|
47
|
+
* transfer callbacks (onTimeout, falling back to onFailed with reason "transferStalled"). Requires a
|
|
48
|
+
* task-scheduler component to be configured.
|
|
49
|
+
*
|
|
50
|
+
* Defaults to 1800000 (30 minutes).
|
|
51
|
+
*/
|
|
52
|
+
stalledTransferTimeoutMs?: number;
|
|
28
53
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.53](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.52...dataspace-control-plane-service-v0.0.3-next.53) (2026-06-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* provider-side transfer auto-start and negotiation/transfer timeout callbacks ([#227](https://github.com/iotaledger/twin-dataspace/issues/227)) ([619d858](https://github.com/iotaledger/twin-dataspace/commit/619d858e8d44e59744dc8a0f73e06be976932b53))
|
|
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.52 to 0.0.3-next.53
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.52](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.51...dataspace-control-plane-service-v0.0.3-next.52) (2026-06-21)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -223,10 +223,11 @@ A promise that resolves when the cleanup task has been removed.
|
|
|
223
223
|
|
|
224
224
|
### requestTransfer() {#requesttransfer}
|
|
225
225
|
|
|
226
|
-
> **requestTransfer**(`request`, `
|
|
226
|
+
> **requestTransfer**(`request`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferProcess`\>
|
|
227
227
|
|
|
228
228
|
Request a Transfer Process.
|
|
229
|
-
Creates a new Transfer Process in REQUESTED state.
|
|
229
|
+
Creates a new Transfer Process in REQUESTED state. Whether it auto-starts is a provider-side
|
|
230
|
+
decision (the `autoStartTransfers` service config), never something the consumer can request.
|
|
230
231
|
|
|
231
232
|
#### Parameters
|
|
232
233
|
|
|
@@ -236,29 +237,6 @@ Creates a new Transfer Process in REQUESTED state.
|
|
|
236
237
|
|
|
237
238
|
Transfer request message (DSP compliant).
|
|
238
239
|
|
|
239
|
-
##### options
|
|
240
|
-
|
|
241
|
-
\{ `autoStart?`: `boolean`; \} \| `undefined`
|
|
242
|
-
|
|
243
|
-
Request options.
|
|
244
|
-
|
|
245
|
-
###### Type Literal
|
|
246
|
-
|
|
247
|
-
\{ `autoStart?`: `boolean`; \}
|
|
248
|
-
|
|
249
|
-
Request options.
|
|
250
|
-
|
|
251
|
-
###### autoStart?
|
|
252
|
-
|
|
253
|
-
`boolean`
|
|
254
|
-
|
|
255
|
-
When true, the provider immediately starts the requested transfer (scheduled
|
|
256
|
-
on the next tick); when omitted/false the provider start must be triggered explicitly.
|
|
257
|
-
|
|
258
|
-
***
|
|
259
|
-
|
|
260
|
-
`undefined`
|
|
261
|
-
|
|
262
240
|
##### trustPayload
|
|
263
241
|
|
|
264
242
|
`unknown`
|
|
@@ -36,3 +36,40 @@ consumer callbackAddress a provider POSTs DSP transfer messages back to (e.g.
|
|
|
36
36
|
`<origin>/<callbackPath>/transfers/:pid/start`), with `?organization=` appended for tenant routing.
|
|
37
37
|
|
|
38
38
|
Example: "dataspace" or "api/dataspace".
|
|
39
|
+
|
|
40
|
+
***
|
|
41
|
+
|
|
42
|
+
### autoStartTransfers? {#autostarttransfers}
|
|
43
|
+
|
|
44
|
+
> `optional` **autoStartTransfers?**: `boolean`
|
|
45
|
+
|
|
46
|
+
Whether the provider immediately starts a transfer once it has been requested. This is a
|
|
47
|
+
provider-side decision only; the consumer cannot request or influence auto-start. When false
|
|
48
|
+
(the default) the transfer stays in REQUESTED until the provider explicitly calls transferStarted.
|
|
49
|
+
|
|
50
|
+
Defaults to false.
|
|
51
|
+
|
|
52
|
+
***
|
|
53
|
+
|
|
54
|
+
### stalledNegotiationTimeoutMs? {#stallednegotiationtimeoutms}
|
|
55
|
+
|
|
56
|
+
> `optional` **stalledNegotiationTimeoutMs?**: `number`
|
|
57
|
+
|
|
58
|
+
How long (ms) a negotiation may sit without progress before the periodic cleanup treats it as
|
|
59
|
+
timed out, removes it, and notifies the registered callbacks (onTimeout, falling back to
|
|
60
|
+
onFailed with reason "negotiationStalled"). Requires a task-scheduler component to be configured.
|
|
61
|
+
|
|
62
|
+
Defaults to 1800000 (30 minutes).
|
|
63
|
+
|
|
64
|
+
***
|
|
65
|
+
|
|
66
|
+
### stalledTransferTimeoutMs? {#stalledtransfertimeoutms}
|
|
67
|
+
|
|
68
|
+
> `optional` **stalledTransferTimeoutMs?**: `number`
|
|
69
|
+
|
|
70
|
+
How long (ms) a consumer-initiated transfer may sit in REQUESTED without the provider progressing
|
|
71
|
+
it before the periodic cleanup treats it as timed out, removes it, and notifies the registered
|
|
72
|
+
transfer callbacks (onTimeout, falling back to onFailed with reason "transferStalled"). Requires a
|
|
73
|
+
task-scheduler component to be configured.
|
|
74
|
+
|
|
75
|
+
Defaults to 1800000 (30 minutes).
|
package/locales/en.json
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"getNegotiationHistory": "Retrieving negotiation history",
|
|
25
25
|
"negotiationHistoryRetrieved": "Negotiation history retrieved successfully",
|
|
26
26
|
"stalledNegotiationsCleanupComplete": "Stalled negotiations cleanup completed (cleanedUp: {cleanedUp})",
|
|
27
|
+
"stalledTransfersCleanupComplete": "Stalled transfers cleanup completed (cleanedUp: {cleanedUp})",
|
|
27
28
|
"pushTransferStarted": "PUSH transfer started (consumerPid: {consumerPid}, providerPid: {providerPid}, endpoint: {endpoint})",
|
|
28
29
|
"preparingTransfer": "Preparing consumer-initiated data transfer (agreementId: {agreementId}, providerEndpoint: {providerEndpoint}, format: {format})",
|
|
29
30
|
"transferPrepared": "Consumer data transfer prepared successfully (consumerPid: {consumerPid}, providerPid: {providerPid}, agreementId: {agreementId}, format: {format})"
|
|
@@ -45,7 +46,8 @@
|
|
|
45
46
|
"warn": {
|
|
46
47
|
"dataspaceControlPlaneService": {
|
|
47
48
|
"catalogDatasetHasNoOffers": "Dataset has no Offers (odrl:hasPolicy) in Federated Catalogue",
|
|
48
|
-
"stalledNegotiationCleanedUp": "Stalled negotiation cleaned up (negotiationId: {negotiationId})"
|
|
49
|
+
"stalledNegotiationCleanedUp": "Stalled negotiation cleaned up (negotiationId: {negotiationId})",
|
|
50
|
+
"stalledTransferCleanedUp": "Stalled transfer cleaned up (consumerPid: {consumerPid})"
|
|
49
51
|
},
|
|
50
52
|
"dataspaceControlPlanePolicyRequester": {
|
|
51
53
|
"unknownNegotiationFinalized": "Unknown negotiation finalized (negotiationId: {negotiationId})",
|
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.53",
|
|
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.53",
|
|
23
23
|
"@twin.org/entity": "next",
|
|
24
24
|
"@twin.org/entity-storage-models": "next",
|
|
25
25
|
"@twin.org/federated-catalogue-models": "next",
|