@twin.org/dataspace-control-plane-service 0.0.3-next.15
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/LICENSE +201 -0
- package/README.md +119 -0
- package/dist/es/dataspaceControlPlanePolicyRequester.js +228 -0
- package/dist/es/dataspaceControlPlanePolicyRequester.js.map +1 -0
- package/dist/es/dataspaceControlPlaneRoutes.js +202 -0
- package/dist/es/dataspaceControlPlaneRoutes.js.map +1 -0
- package/dist/es/dataspaceControlPlaneService.js +1420 -0
- package/dist/es/dataspaceControlPlaneService.js.map +1 -0
- package/dist/es/index.js +11 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IDataspaceControlPlaneServiceConfig.js +4 -0
- package/dist/es/models/IDataspaceControlPlaneServiceConfig.js.map +1 -0
- package/dist/es/models/IDataspaceControlPlaneServiceConstructorOptions.js +2 -0
- package/dist/es/models/IDataspaceControlPlaneServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/INegotiationState.js +4 -0
- package/dist/es/models/INegotiationState.js.map +1 -0
- package/dist/es/restEntryPoints.js +15 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/schema.js +11 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/es/utils/dataHelpers.js +22 -0
- package/dist/es/utils/dataHelpers.js.map +1 -0
- package/dist/es/utils/transferErrorUtils.js +78 -0
- package/dist/es/utils/transferErrorUtils.js.map +1 -0
- package/dist/types/dataspaceControlPlanePolicyRequester.d.ts +80 -0
- package/dist/types/dataspaceControlPlaneRoutes.d.ts +17 -0
- package/dist/types/dataspaceControlPlaneService.d.ts +153 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/models/IDataspaceControlPlaneServiceConfig.d.ts +20 -0
- package/dist/types/models/IDataspaceControlPlaneServiceConstructorOptions.d.ts +69 -0
- package/dist/types/models/INegotiationState.d.ts +27 -0
- package/dist/types/restEntryPoints.d.ts +7 -0
- package/dist/types/schema.d.ts +4 -0
- package/dist/types/utils/dataHelpers.d.ts +1 -0
- package/dist/types/utils/transferErrorUtils.d.ts +39 -0
- package/docs/API.md +341 -0
- package/docs/changelog.md +31 -0
- package/docs/examples.md +1 -0
- package/docs/reference/classes/DataspaceControlPlanePolicyRequester.md +244 -0
- package/docs/reference/classes/DataspaceControlPlaneService.md +549 -0
- package/docs/reference/functions/generateRestRoutesDataspaceControlPlane.md +29 -0
- package/docs/reference/functions/initSchema.md +9 -0
- package/docs/reference/index.md +22 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConfig.md +26 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConstructorOptions.md +160 -0
- package/docs/reference/interfaces/INegotiationState.md +43 -0
- package/docs/reference/variables/restEntryPoints.md +7 -0
- package/docs/reference/variables/tagsDataspaceControlPlane.md +5 -0
- package/locales/en.json +93 -0
- package/package.json +70 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.15](https://github.com/twinfoundation/dataspace/compare/dataspace-control-plane-service-v0.0.3-next.14...dataspace-control-plane-service-v0.0.3-next.15) (2026-03-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* unification of the data exchange and the data space connector ([#57](https://github.com/twinfoundation/dataspace/issues/57)) ([df2644d](https://github.com/twinfoundation/dataspace/commit/df2644d989471e07dadd83d27bef736179e31bf4))
|
|
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.14 to 0.0.3-next.15
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/data-exchange/compare/data-exchange-service-v0.0.3-next.0...data-exchange-service-v0.0.3-next.1) (2026-01-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* mocking data exchange basic methods ([#5](https://github.com/twinfoundation/data-exchange/issues/5)) ([6cb00c0](https://github.com/twinfoundation/data-exchange/commit/6cb00c029aacf46da7bed0b3c97a21ef4102784a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/data-exchange-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
30
|
+
|
|
31
|
+
## @twin.org/data-exchange-service - Changelog
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @twin.org/data-exchange-service - Examples
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Class: DataspaceControlPlanePolicyRequester
|
|
2
|
+
|
|
3
|
+
Policy Requester for Dataspace Control Plane.
|
|
4
|
+
|
|
5
|
+
Handles contract negotiation callbacks from PNP and forwards state changes
|
|
6
|
+
to the control plane service via the INegotiationCallback interface.
|
|
7
|
+
|
|
8
|
+
Callback Flow:
|
|
9
|
+
1. Control Plane initiates negotiation via PNP.sendRequestToProvider()
|
|
10
|
+
2. PNP calls offer() → auto-accept, notify control plane
|
|
11
|
+
3. PNP calls agreement() → store agreement, notify control plane
|
|
12
|
+
4. PNP calls finalised() → notify control plane with agreementId
|
|
13
|
+
5. Control plane notifies upstream caller (e.g. supply-chain)
|
|
14
|
+
|
|
15
|
+
## Implements
|
|
16
|
+
|
|
17
|
+
- `IPolicyRequester`
|
|
18
|
+
|
|
19
|
+
## Constructors
|
|
20
|
+
|
|
21
|
+
### Constructor
|
|
22
|
+
|
|
23
|
+
> **new DataspaceControlPlanePolicyRequester**(`loggingComponentType?`, `callback?`): `DataspaceControlPlanePolicyRequester`
|
|
24
|
+
|
|
25
|
+
Create a new instance of DataspaceControlPlanePolicyRequester.
|
|
26
|
+
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
##### loggingComponentType?
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
Optional logging component type.
|
|
34
|
+
|
|
35
|
+
##### callback?
|
|
36
|
+
|
|
37
|
+
`INegotiationCallback`
|
|
38
|
+
|
|
39
|
+
Optional callback interface for state change notifications.
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`DataspaceControlPlanePolicyRequester`
|
|
44
|
+
|
|
45
|
+
## Properties
|
|
46
|
+
|
|
47
|
+
### CLASS\_NAME
|
|
48
|
+
|
|
49
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
50
|
+
|
|
51
|
+
Runtime name for the class.
|
|
52
|
+
|
|
53
|
+
## Methods
|
|
54
|
+
|
|
55
|
+
### className()
|
|
56
|
+
|
|
57
|
+
> **className**(): `string`
|
|
58
|
+
|
|
59
|
+
Returns the class name of the component.
|
|
60
|
+
|
|
61
|
+
#### Returns
|
|
62
|
+
|
|
63
|
+
`string`
|
|
64
|
+
|
|
65
|
+
The class name of the component.
|
|
66
|
+
|
|
67
|
+
#### Implementation of
|
|
68
|
+
|
|
69
|
+
`IPolicyRequester.className`
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### trackNegotiation()
|
|
74
|
+
|
|
75
|
+
> **trackNegotiation**(`negotiationId`): `void`
|
|
76
|
+
|
|
77
|
+
Register a negotiation for tracking.
|
|
78
|
+
Called by the control plane service after initiating a negotiation via PNP.
|
|
79
|
+
|
|
80
|
+
#### Parameters
|
|
81
|
+
|
|
82
|
+
##### negotiationId
|
|
83
|
+
|
|
84
|
+
`string`
|
|
85
|
+
|
|
86
|
+
The negotiation ID returned by PNP.sendRequestToProvider().
|
|
87
|
+
|
|
88
|
+
#### Returns
|
|
89
|
+
|
|
90
|
+
`void`
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
94
|
+
### getActiveNegotiations()
|
|
95
|
+
|
|
96
|
+
> **getActiveNegotiations**(): `Map`\<`string`, [`INegotiationState`](../interfaces/INegotiationState.md)\>
|
|
97
|
+
|
|
98
|
+
Get all active negotiations (for stalled cleanup).
|
|
99
|
+
|
|
100
|
+
#### Returns
|
|
101
|
+
|
|
102
|
+
`Map`\<`string`, [`INegotiationState`](../interfaces/INegotiationState.md)\>
|
|
103
|
+
|
|
104
|
+
Map of negotiationId to negotiation state.
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
108
|
+
### removeNegotiation()
|
|
109
|
+
|
|
110
|
+
> **removeNegotiation**(`negotiationId`): `void`
|
|
111
|
+
|
|
112
|
+
Remove a negotiation from tracking (for cleanup).
|
|
113
|
+
|
|
114
|
+
#### Parameters
|
|
115
|
+
|
|
116
|
+
##### negotiationId
|
|
117
|
+
|
|
118
|
+
`string`
|
|
119
|
+
|
|
120
|
+
The negotiation ID to remove.
|
|
121
|
+
|
|
122
|
+
#### Returns
|
|
123
|
+
|
|
124
|
+
`void`
|
|
125
|
+
|
|
126
|
+
***
|
|
127
|
+
|
|
128
|
+
### offer()
|
|
129
|
+
|
|
130
|
+
> **offer**(`negotiationId`, `offer`): `Promise`\<`boolean`\>
|
|
131
|
+
|
|
132
|
+
A policy has been offered by a provider.
|
|
133
|
+
Called by PNP when provider sends an OfferMessage.
|
|
134
|
+
|
|
135
|
+
#### Parameters
|
|
136
|
+
|
|
137
|
+
##### negotiationId
|
|
138
|
+
|
|
139
|
+
`string`
|
|
140
|
+
|
|
141
|
+
The id of the negotiation.
|
|
142
|
+
|
|
143
|
+
##### offer
|
|
144
|
+
|
|
145
|
+
`IOdrlOffer`
|
|
146
|
+
|
|
147
|
+
The offer sent by the provider.
|
|
148
|
+
|
|
149
|
+
#### Returns
|
|
150
|
+
|
|
151
|
+
`Promise`\<`boolean`\>
|
|
152
|
+
|
|
153
|
+
True if the offer was accepted, false otherwise.
|
|
154
|
+
|
|
155
|
+
#### Implementation of
|
|
156
|
+
|
|
157
|
+
`IPolicyRequester.offer`
|
|
158
|
+
|
|
159
|
+
***
|
|
160
|
+
|
|
161
|
+
### agreement()
|
|
162
|
+
|
|
163
|
+
> **agreement**(`negotiationId`, `agreement`): `Promise`\<`boolean`\>
|
|
164
|
+
|
|
165
|
+
A policy agreement has been sent by a provider.
|
|
166
|
+
Called by PNP when provider sends an AgreementMessage.
|
|
167
|
+
|
|
168
|
+
#### Parameters
|
|
169
|
+
|
|
170
|
+
##### negotiationId
|
|
171
|
+
|
|
172
|
+
`string`
|
|
173
|
+
|
|
174
|
+
The id of the negotiation.
|
|
175
|
+
|
|
176
|
+
##### agreement
|
|
177
|
+
|
|
178
|
+
`IOdrlAgreement`
|
|
179
|
+
|
|
180
|
+
The agreement sent by the provider.
|
|
181
|
+
|
|
182
|
+
#### Returns
|
|
183
|
+
|
|
184
|
+
`Promise`\<`boolean`\>
|
|
185
|
+
|
|
186
|
+
True if the agreement was accepted, false otherwise.
|
|
187
|
+
|
|
188
|
+
#### Implementation of
|
|
189
|
+
|
|
190
|
+
`IPolicyRequester.agreement`
|
|
191
|
+
|
|
192
|
+
***
|
|
193
|
+
|
|
194
|
+
### finalised()
|
|
195
|
+
|
|
196
|
+
> **finalised**(`negotiationId`): `Promise`\<`void`\>
|
|
197
|
+
|
|
198
|
+
A policy finalisation has been sent by a provider.
|
|
199
|
+
Called by PNP when provider sends a FinalizedEvent.
|
|
200
|
+
|
|
201
|
+
#### Parameters
|
|
202
|
+
|
|
203
|
+
##### negotiationId
|
|
204
|
+
|
|
205
|
+
`string`
|
|
206
|
+
|
|
207
|
+
The id of the negotiation.
|
|
208
|
+
|
|
209
|
+
#### Returns
|
|
210
|
+
|
|
211
|
+
`Promise`\<`void`\>
|
|
212
|
+
|
|
213
|
+
Nothing.
|
|
214
|
+
|
|
215
|
+
#### Implementation of
|
|
216
|
+
|
|
217
|
+
`IPolicyRequester.finalised`
|
|
218
|
+
|
|
219
|
+
***
|
|
220
|
+
|
|
221
|
+
### terminated()
|
|
222
|
+
|
|
223
|
+
> **terminated**(`negotiationId`): `Promise`\<`void`\>
|
|
224
|
+
|
|
225
|
+
A policy termination has been sent by a provider.
|
|
226
|
+
Called by PNP when provider sends a TerminatedMessage or negotiation fails.
|
|
227
|
+
|
|
228
|
+
#### Parameters
|
|
229
|
+
|
|
230
|
+
##### negotiationId
|
|
231
|
+
|
|
232
|
+
`string`
|
|
233
|
+
|
|
234
|
+
The id of the negotiation.
|
|
235
|
+
|
|
236
|
+
#### Returns
|
|
237
|
+
|
|
238
|
+
`Promise`\<`void`\>
|
|
239
|
+
|
|
240
|
+
Nothing.
|
|
241
|
+
|
|
242
|
+
#### Implementation of
|
|
243
|
+
|
|
244
|
+
`IPolicyRequester.terminated`
|