@twin.org/dataspace-models 0.9.2-next.10 → 0.9.2-next.11
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":"INegotiationCallback.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/INegotiationCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tDataspaceProtocolContractNegotiationStateType,\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer\n} from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * Callback interface for negotiation state change notifications.\n * Upstream modules register an implementation of this interface\n * via IDataspaceControlPlaneComponent.registerNegotiationCallback()\n * to be notified when PNP callbacks fire.\n */\nexport interface INegotiationCallback {\n\t/**\n\t * Called when the negotiation state changes (offer received, agreement received).\n\t * @param negotiationId The negotiation ID.\n\t * @param state The new state.\n\t * @param data Optional data associated with the state change.\n\t * @param data.offer The offer received from the provider.\n\t * @param data.agreement The agreement received from the provider.\n\t * @returns Nothing.\n\t */\n\tonStateChanged(\n\t\tnegotiationId: string,\n\t\tstate: DataspaceProtocolContractNegotiationStateType,\n\t\tdata?: { offer?: IDataspaceProtocolOffer; agreement?: IDataspaceProtocolAgreement }\n\t): Promise<void>;\n\n\t/**\n\t * Called when the negotiation finalizes.\n\t * @param negotiationId The negotiation ID, or undefined for implicit-trust
|
|
1
|
+
{"version":3,"file":"INegotiationCallback.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/INegotiationCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tDataspaceProtocolContractNegotiationStateType,\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer\n} from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * Callback interface for negotiation state change notifications.\n * Upstream modules register an implementation of this interface\n * via IDataspaceControlPlaneComponent.registerNegotiationCallback()\n * to be notified when PNP callbacks fire.\n */\nexport interface INegotiationCallback {\n\t/**\n\t * Called when the negotiation state changes (offer received, agreement received).\n\t * @param negotiationId The negotiation ID.\n\t * @param state The new state.\n\t * @param data Optional data associated with the state change.\n\t * @param data.offer The offer received from the provider.\n\t * @param data.agreement The agreement received from the provider.\n\t * @returns Nothing.\n\t */\n\tonStateChanged(\n\t\tnegotiationId: string,\n\t\tstate: DataspaceProtocolContractNegotiationStateType,\n\t\tdata?: { offer?: IDataspaceProtocolOffer; agreement?: IDataspaceProtocolAgreement }\n\t): Promise<void>;\n\n\t/**\n\t * Called when the negotiation finalizes.\n\t * @param negotiationId The negotiation ID, or undefined for implicit-trust or agreement-reuse paths.\n\t * @param agreementId The agreement ID (from agreement.uid).\n\t * @param offerId The offer ID that triggered the negotiation; present when negotiationId is undefined so\n\t * callers with concurrent negotiations can discriminate which finalization belongs to them.\n\t * @returns Nothing.\n\t */\n\tonFinalized(\n\t\tnegotiationId: string | undefined,\n\t\tagreementId: string,\n\t\tofferId?: string\n\t): Promise<void>;\n\n\t/**\n\t * Called when the negotiation fails (terminated or stalled).\n\t * @param negotiationId The negotiation ID.\n\t * @param reason The failure reason.\n\t * @returns Nothing.\n\t */\n\tonFailed(negotiationId: string, reason: string): Promise<void>;\n\n\t/**\n\t * Called when the negotiation times out, i.e. the provider did not progress it within the configured\n\t * window. Optional: implement it to be notified specifically of a non-response (otherwise the\n\t * control plane falls back to `onFailed(negotiationId, \"negotiationStalled\")`).\n\t * @param negotiationId The negotiation ID.\n\t * @returns Nothing.\n\t */\n\tonTimeout?(negotiationId: string): Promise<void>;\n}\n"]}
|
|
@@ -21,11 +21,13 @@ export interface INegotiationCallback {
|
|
|
21
21
|
}): Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Called when the negotiation finalizes.
|
|
24
|
-
* @param negotiationId The negotiation ID, or undefined for implicit-trust
|
|
24
|
+
* @param negotiationId The negotiation ID, or undefined for implicit-trust or agreement-reuse paths.
|
|
25
25
|
* @param agreementId The agreement ID (from agreement.uid).
|
|
26
|
+
* @param offerId The offer ID that triggered the negotiation; present when negotiationId is undefined so
|
|
27
|
+
* callers with concurrent negotiations can discriminate which finalization belongs to them.
|
|
26
28
|
* @returns Nothing.
|
|
27
29
|
*/
|
|
28
|
-
onFinalized(negotiationId: string | undefined, agreementId: string): Promise<void>;
|
|
30
|
+
onFinalized(negotiationId: string | undefined, agreementId: string, offerId?: string): Promise<void>;
|
|
29
31
|
/**
|
|
30
32
|
* Called when the negotiation fails (terminated or stalled).
|
|
31
33
|
* @param negotiationId The negotiation ID.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.2-next.11](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.9.2-next.10...dataspace-models-v0.9.2-next.11) (2026-08-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add correlation callbacks ([#354](https://github.com/iotaledger/twin-dataspace/issues/354)) ([d362fb6](https://github.com/iotaledger/twin-dataspace/commit/d362fb6b0816a62f72a77478d78fb3959a437b3c))
|
|
9
|
+
|
|
3
10
|
## [0.9.2-next.10](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.9.2-next.9...dataspace-models-v0.9.2-next.10) (2026-08-16)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -53,7 +53,7 @@ Nothing.
|
|
|
53
53
|
|
|
54
54
|
### onFinalized() {#onfinalized}
|
|
55
55
|
|
|
56
|
-
> **onFinalized**(`negotiationId`, `agreementId`): `Promise`\<`void`\>
|
|
56
|
+
> **onFinalized**(`negotiationId`, `agreementId`, `offerId?`): `Promise`\<`void`\>
|
|
57
57
|
|
|
58
58
|
Called when the negotiation finalizes.
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ Called when the negotiation finalizes.
|
|
|
63
63
|
|
|
64
64
|
`string` \| `undefined`
|
|
65
65
|
|
|
66
|
-
The negotiation ID, or undefined for implicit-trust
|
|
66
|
+
The negotiation ID, or undefined for implicit-trust or agreement-reuse paths.
|
|
67
67
|
|
|
68
68
|
##### agreementId
|
|
69
69
|
|
|
@@ -71,6 +71,13 @@ The negotiation ID, or undefined for implicit-trust agreements.
|
|
|
71
71
|
|
|
72
72
|
The agreement ID (from agreement.uid).
|
|
73
73
|
|
|
74
|
+
##### offerId?
|
|
75
|
+
|
|
76
|
+
`string`
|
|
77
|
+
|
|
78
|
+
The offer ID that triggered the negotiation; present when negotiationId is undefined so
|
|
79
|
+
callers with concurrent negotiations can discriminate which finalization belongs to them.
|
|
80
|
+
|
|
74
81
|
#### Returns
|
|
75
82
|
|
|
76
83
|
`Promise`\<`void`\>
|
package/package.json
CHANGED