@twin.org/dataspace-control-plane-service 0.9.0 → 0.9.1-next.10
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/README.md +1 -1
- package/dist/es/dataspaceControlPlaneRoutes.js +79 -7
- package/dist/es/dataspaceControlPlaneRoutes.js.map +1 -1
- package/dist/es/dataspaceControlPlaneService.js +121 -356
- package/dist/es/dataspaceControlPlaneService.js.map +1 -1
- package/dist/es/factories/transferHandlerFactory.js +11 -0
- package/dist/es/factories/transferHandlerFactory.js.map +1 -0
- package/dist/es/handlers/httpDataPostTransferHandler.js +111 -0
- package/dist/es/handlers/httpDataPostTransferHandler.js.map +1 -0
- package/dist/es/handlers/httpDataPullTransferHandler.js +108 -0
- package/dist/es/handlers/httpDataPullTransferHandler.js.map +1 -0
- package/dist/es/handlers/httpDataPushTransferHandler.js +114 -0
- package/dist/es/handlers/httpDataPushTransferHandler.js.map +1 -0
- package/dist/es/index.js +7 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IDataspaceControlPlaneServiceConfig.js.map +1 -1
- package/dist/es/models/ITransferHandler.js +2 -0
- package/dist/es/models/ITransferHandler.js.map +1 -0
- package/dist/es/models/ITransferHandlerPrepareContext.js +4 -0
- package/dist/es/models/ITransferHandlerPrepareContext.js.map +1 -0
- package/dist/es/models/ITransferHandlerStartContext.js +2 -0
- package/dist/es/models/ITransferHandlerStartContext.js.map +1 -0
- package/dist/types/dataspaceControlPlaneRoutes.d.ts +1 -1
- package/dist/types/dataspaceControlPlaneService.d.ts +6 -1
- package/dist/types/factories/transferHandlerFactory.d.ts +8 -0
- package/dist/types/handlers/httpDataPostTransferHandler.d.ts +63 -0
- package/dist/types/handlers/httpDataPullTransferHandler.d.ts +63 -0
- package/dist/types/handlers/httpDataPushTransferHandler.d.ts +68 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/models/IDataspaceControlPlaneServiceConfig.d.ts +10 -5
- package/dist/types/models/ITransferHandler.d.ts +62 -0
- package/dist/types/models/ITransferHandlerPrepareContext.d.ts +21 -0
- package/dist/types/models/ITransferHandlerStartContext.d.ts +31 -0
- package/docs/changelog.md +190 -0
- package/docs/reference/classes/DataspaceControlPlaneService.md +18 -0
- package/docs/reference/classes/HttpDataPostTransferHandler.md +235 -0
- package/docs/reference/classes/HttpDataPullTransferHandler.md +235 -0
- package/docs/reference/classes/HttpDataPushTransferHandler.md +242 -0
- package/docs/reference/index.md +7 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConfig.md +10 -5
- package/docs/reference/interfaces/ITransferHandler.md +180 -0
- package/docs/reference/interfaces/ITransferHandlerPrepareContext.md +35 -0
- package/docs/reference/interfaces/ITransferHandlerStartContext.md +51 -0
- package/docs/reference/variables/TransferHandlerFactory.md +7 -0
- package/locales/en.json +14 -11
- package/package.json +18 -18
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Class: HttpDataPostTransferHandler
|
|
2
|
+
|
|
3
|
+
Transfer handler for HttpData-POST format (provider-initiated push).
|
|
4
|
+
The consumer does not supply a dataAddress. The provider returns its own /inbox URL
|
|
5
|
+
along with a signed JWT so the consumer can authenticate when posting activities there.
|
|
6
|
+
|
|
7
|
+
## Implements
|
|
8
|
+
|
|
9
|
+
- [`ITransferHandler`](../interfaces/ITransferHandler.md)
|
|
10
|
+
|
|
11
|
+
## Constructors
|
|
12
|
+
|
|
13
|
+
### Constructor
|
|
14
|
+
|
|
15
|
+
> **new HttpDataPostTransferHandler**(): `HttpDataPostTransferHandler`
|
|
16
|
+
|
|
17
|
+
#### Returns
|
|
18
|
+
|
|
19
|
+
`HttpDataPostTransferHandler`
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
### CLASS\_NAME {#class_name}
|
|
24
|
+
|
|
25
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
26
|
+
|
|
27
|
+
Runtime name for the class.
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### className() {#classname}
|
|
32
|
+
|
|
33
|
+
> **className**(): `string`
|
|
34
|
+
|
|
35
|
+
Returns the class name of the component.
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The class name of the component.
|
|
42
|
+
|
|
43
|
+
#### Implementation of
|
|
44
|
+
|
|
45
|
+
`ITransferHandler.className`
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### buildConsumerDataAddress() {#buildconsumerdataaddress}
|
|
50
|
+
|
|
51
|
+
> **buildConsumerDataAddress**(`ctx`): `IDataspaceProtocolDataAddress` \| `undefined`
|
|
52
|
+
|
|
53
|
+
POST consumers do not supply a dataAddress — provider returns its own /inbox on start.
|
|
54
|
+
|
|
55
|
+
#### Parameters
|
|
56
|
+
|
|
57
|
+
##### ctx
|
|
58
|
+
|
|
59
|
+
[`ITransferHandlerPrepareContext`](../interfaces/ITransferHandlerPrepareContext.md)
|
|
60
|
+
|
|
61
|
+
Prepare context (unused for POST).
|
|
62
|
+
|
|
63
|
+
#### Returns
|
|
64
|
+
|
|
65
|
+
`IDataspaceProtocolDataAddress` \| `undefined`
|
|
66
|
+
|
|
67
|
+
undefined.
|
|
68
|
+
|
|
69
|
+
#### Implementation of
|
|
70
|
+
|
|
71
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildConsumerDataAddress`](../interfaces/ITransferHandler.md#buildconsumerdataaddress)
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### buildProviderStartDataAddress() {#buildproviderstartdataaddress}
|
|
76
|
+
|
|
77
|
+
> **buildProviderStartDataAddress**(`ctx`): `Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
78
|
+
|
|
79
|
+
Build the provider's /inbox dataAddress and signed JWT for the TransferStartMessage.
|
|
80
|
+
|
|
81
|
+
#### Parameters
|
|
82
|
+
|
|
83
|
+
##### ctx
|
|
84
|
+
|
|
85
|
+
[`ITransferHandlerStartContext`](../interfaces/ITransferHandlerStartContext.md)
|
|
86
|
+
|
|
87
|
+
Start context containing entity, trust component, and path configuration.
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
92
|
+
|
|
93
|
+
The provider's ActivityStream inbox dataAddress with bearer token.
|
|
94
|
+
|
|
95
|
+
#### Throws
|
|
96
|
+
|
|
97
|
+
GeneralError When dataPlanePath is not configured or providerIdentity is missing.
|
|
98
|
+
|
|
99
|
+
#### Implementation of
|
|
100
|
+
|
|
101
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildProviderStartDataAddress`](../interfaces/ITransferHandler.md#buildproviderstartdataaddress)
|
|
102
|
+
|
|
103
|
+
***
|
|
104
|
+
|
|
105
|
+
### onProviderStart() {#onproviderstart}
|
|
106
|
+
|
|
107
|
+
> **onProviderStart**(`dataPlaneComponent`, `consumerPid`, `previousState`): `Promise`\<`void`\>
|
|
108
|
+
|
|
109
|
+
No-op: POST transfers do not involve a provider-managed push subscription on start.
|
|
110
|
+
|
|
111
|
+
#### Parameters
|
|
112
|
+
|
|
113
|
+
##### dataPlaneComponent
|
|
114
|
+
|
|
115
|
+
`IDataspaceDataPlaneComponent`
|
|
116
|
+
|
|
117
|
+
The data plane component instance.
|
|
118
|
+
|
|
119
|
+
##### consumerPid
|
|
120
|
+
|
|
121
|
+
`string`
|
|
122
|
+
|
|
123
|
+
The consumer process ID.
|
|
124
|
+
|
|
125
|
+
##### previousState
|
|
126
|
+
|
|
127
|
+
`DataspaceProtocolTransferProcessStateType`
|
|
128
|
+
|
|
129
|
+
The state before the STARTED transition.
|
|
130
|
+
|
|
131
|
+
#### Returns
|
|
132
|
+
|
|
133
|
+
`Promise`\<`void`\>
|
|
134
|
+
|
|
135
|
+
A promise that resolves immediately.
|
|
136
|
+
|
|
137
|
+
#### Implementation of
|
|
138
|
+
|
|
139
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onProviderStart`](../interfaces/ITransferHandler.md#onproviderstart)
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### onComplete() {#oncomplete}
|
|
144
|
+
|
|
145
|
+
> **onComplete**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
146
|
+
|
|
147
|
+
Tear down the data plane subscription when the transfer completes.
|
|
148
|
+
|
|
149
|
+
#### Parameters
|
|
150
|
+
|
|
151
|
+
##### dataPlaneComponent
|
|
152
|
+
|
|
153
|
+
`IDataspaceDataPlaneComponent`
|
|
154
|
+
|
|
155
|
+
The data plane component instance.
|
|
156
|
+
|
|
157
|
+
##### consumerPid
|
|
158
|
+
|
|
159
|
+
`string`
|
|
160
|
+
|
|
161
|
+
The consumer process ID.
|
|
162
|
+
|
|
163
|
+
#### Returns
|
|
164
|
+
|
|
165
|
+
`Promise`\<`void`\>
|
|
166
|
+
|
|
167
|
+
A promise that resolves when the subscription is torn down.
|
|
168
|
+
|
|
169
|
+
#### Implementation of
|
|
170
|
+
|
|
171
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onComplete`](../interfaces/ITransferHandler.md#oncomplete)
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### onSuspend() {#onsuspend}
|
|
176
|
+
|
|
177
|
+
> **onSuspend**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
178
|
+
|
|
179
|
+
Suspend the data plane subscription when the transfer is suspended.
|
|
180
|
+
|
|
181
|
+
#### Parameters
|
|
182
|
+
|
|
183
|
+
##### dataPlaneComponent
|
|
184
|
+
|
|
185
|
+
`IDataspaceDataPlaneComponent`
|
|
186
|
+
|
|
187
|
+
The data plane component instance.
|
|
188
|
+
|
|
189
|
+
##### consumerPid
|
|
190
|
+
|
|
191
|
+
`string`
|
|
192
|
+
|
|
193
|
+
The consumer process ID.
|
|
194
|
+
|
|
195
|
+
#### Returns
|
|
196
|
+
|
|
197
|
+
`Promise`\<`void`\>
|
|
198
|
+
|
|
199
|
+
A promise that resolves when the subscription is suspended.
|
|
200
|
+
|
|
201
|
+
#### Implementation of
|
|
202
|
+
|
|
203
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onSuspend`](../interfaces/ITransferHandler.md#onsuspend)
|
|
204
|
+
|
|
205
|
+
***
|
|
206
|
+
|
|
207
|
+
### onTerminate() {#onterminate}
|
|
208
|
+
|
|
209
|
+
> **onTerminate**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
210
|
+
|
|
211
|
+
Tear down the data plane subscription when the transfer terminates.
|
|
212
|
+
|
|
213
|
+
#### Parameters
|
|
214
|
+
|
|
215
|
+
##### dataPlaneComponent
|
|
216
|
+
|
|
217
|
+
`IDataspaceDataPlaneComponent`
|
|
218
|
+
|
|
219
|
+
The data plane component instance.
|
|
220
|
+
|
|
221
|
+
##### consumerPid
|
|
222
|
+
|
|
223
|
+
`string`
|
|
224
|
+
|
|
225
|
+
The consumer process ID.
|
|
226
|
+
|
|
227
|
+
#### Returns
|
|
228
|
+
|
|
229
|
+
`Promise`\<`void`\>
|
|
230
|
+
|
|
231
|
+
A promise that resolves when the subscription is torn down.
|
|
232
|
+
|
|
233
|
+
#### Implementation of
|
|
234
|
+
|
|
235
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onTerminate`](../interfaces/ITransferHandler.md#onterminate)
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Class: HttpDataPullTransferHandler
|
|
2
|
+
|
|
3
|
+
Transfer handler for HttpData-PULL format.
|
|
4
|
+
Consumer queries the provider's data endpoint using a bearer token supplied in the
|
|
5
|
+
TransferStartMessage dataAddress. No data-plane push subscription is involved.
|
|
6
|
+
|
|
7
|
+
## Implements
|
|
8
|
+
|
|
9
|
+
- [`ITransferHandler`](../interfaces/ITransferHandler.md)
|
|
10
|
+
|
|
11
|
+
## Constructors
|
|
12
|
+
|
|
13
|
+
### Constructor
|
|
14
|
+
|
|
15
|
+
> **new HttpDataPullTransferHandler**(): `HttpDataPullTransferHandler`
|
|
16
|
+
|
|
17
|
+
#### Returns
|
|
18
|
+
|
|
19
|
+
`HttpDataPullTransferHandler`
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
### CLASS\_NAME {#class_name}
|
|
24
|
+
|
|
25
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
26
|
+
|
|
27
|
+
Runtime name for the class.
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### className() {#classname}
|
|
32
|
+
|
|
33
|
+
> **className**(): `string`
|
|
34
|
+
|
|
35
|
+
Returns the class name of the component.
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The class name of the component.
|
|
42
|
+
|
|
43
|
+
#### Implementation of
|
|
44
|
+
|
|
45
|
+
`ITransferHandler.className`
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### buildConsumerDataAddress() {#buildconsumerdataaddress}
|
|
50
|
+
|
|
51
|
+
> **buildConsumerDataAddress**(`ctx`): `IDataspaceProtocolDataAddress` \| `undefined`
|
|
52
|
+
|
|
53
|
+
PULL consumers do not supply a dataAddress — the provider generates one on start.
|
|
54
|
+
|
|
55
|
+
#### Parameters
|
|
56
|
+
|
|
57
|
+
##### ctx
|
|
58
|
+
|
|
59
|
+
[`ITransferHandlerPrepareContext`](../interfaces/ITransferHandlerPrepareContext.md)
|
|
60
|
+
|
|
61
|
+
Prepare context (unused for PULL).
|
|
62
|
+
|
|
63
|
+
#### Returns
|
|
64
|
+
|
|
65
|
+
`IDataspaceProtocolDataAddress` \| `undefined`
|
|
66
|
+
|
|
67
|
+
undefined.
|
|
68
|
+
|
|
69
|
+
#### Implementation of
|
|
70
|
+
|
|
71
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildConsumerDataAddress`](../interfaces/ITransferHandler.md#buildconsumerdataaddress)
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### buildProviderStartDataAddress() {#buildproviderstartdataaddress}
|
|
76
|
+
|
|
77
|
+
> **buildProviderStartDataAddress**(`ctx`): `Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
78
|
+
|
|
79
|
+
Build the provider's data endpoint and bearer token for the TransferStartMessage.
|
|
80
|
+
|
|
81
|
+
#### Parameters
|
|
82
|
+
|
|
83
|
+
##### ctx
|
|
84
|
+
|
|
85
|
+
[`ITransferHandlerStartContext`](../interfaces/ITransferHandlerStartContext.md)
|
|
86
|
+
|
|
87
|
+
Start context containing entity, trust component, and path configuration.
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
92
|
+
|
|
93
|
+
The dataAddress carrying the query endpoint and bearer token.
|
|
94
|
+
|
|
95
|
+
#### Throws
|
|
96
|
+
|
|
97
|
+
GeneralError When dataPlanePath is not configured or providerIdentity is missing.
|
|
98
|
+
|
|
99
|
+
#### Implementation of
|
|
100
|
+
|
|
101
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildProviderStartDataAddress`](../interfaces/ITransferHandler.md#buildproviderstartdataaddress)
|
|
102
|
+
|
|
103
|
+
***
|
|
104
|
+
|
|
105
|
+
### onProviderStart() {#onproviderstart}
|
|
106
|
+
|
|
107
|
+
> **onProviderStart**(`dataPlaneComponent`, `consumerPid`, `previousState`): `Promise`\<`void`\>
|
|
108
|
+
|
|
109
|
+
No-op: PULL transfers require no push subscription.
|
|
110
|
+
|
|
111
|
+
#### Parameters
|
|
112
|
+
|
|
113
|
+
##### dataPlaneComponent
|
|
114
|
+
|
|
115
|
+
`IDataspaceDataPlaneComponent`
|
|
116
|
+
|
|
117
|
+
The data plane component instance.
|
|
118
|
+
|
|
119
|
+
##### consumerPid
|
|
120
|
+
|
|
121
|
+
`string`
|
|
122
|
+
|
|
123
|
+
The consumer process ID.
|
|
124
|
+
|
|
125
|
+
##### previousState
|
|
126
|
+
|
|
127
|
+
`DataspaceProtocolTransferProcessStateType`
|
|
128
|
+
|
|
129
|
+
The state before the STARTED transition.
|
|
130
|
+
|
|
131
|
+
#### Returns
|
|
132
|
+
|
|
133
|
+
`Promise`\<`void`\>
|
|
134
|
+
|
|
135
|
+
A promise that resolves immediately.
|
|
136
|
+
|
|
137
|
+
#### Implementation of
|
|
138
|
+
|
|
139
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onProviderStart`](../interfaces/ITransferHandler.md#onproviderstart)
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### onComplete() {#oncomplete}
|
|
144
|
+
|
|
145
|
+
> **onComplete**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
146
|
+
|
|
147
|
+
No-op: PULL transfers have no push subscription to tear down.
|
|
148
|
+
|
|
149
|
+
#### Parameters
|
|
150
|
+
|
|
151
|
+
##### dataPlaneComponent
|
|
152
|
+
|
|
153
|
+
`IDataspaceDataPlaneComponent`
|
|
154
|
+
|
|
155
|
+
The data plane component instance.
|
|
156
|
+
|
|
157
|
+
##### consumerPid
|
|
158
|
+
|
|
159
|
+
`string`
|
|
160
|
+
|
|
161
|
+
The consumer process ID.
|
|
162
|
+
|
|
163
|
+
#### Returns
|
|
164
|
+
|
|
165
|
+
`Promise`\<`void`\>
|
|
166
|
+
|
|
167
|
+
A promise that resolves immediately.
|
|
168
|
+
|
|
169
|
+
#### Implementation of
|
|
170
|
+
|
|
171
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onComplete`](../interfaces/ITransferHandler.md#oncomplete)
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### onSuspend() {#onsuspend}
|
|
176
|
+
|
|
177
|
+
> **onSuspend**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
178
|
+
|
|
179
|
+
No-op: PULL transfers have no push subscription to suspend.
|
|
180
|
+
|
|
181
|
+
#### Parameters
|
|
182
|
+
|
|
183
|
+
##### dataPlaneComponent
|
|
184
|
+
|
|
185
|
+
`IDataspaceDataPlaneComponent`
|
|
186
|
+
|
|
187
|
+
The data plane component instance.
|
|
188
|
+
|
|
189
|
+
##### consumerPid
|
|
190
|
+
|
|
191
|
+
`string`
|
|
192
|
+
|
|
193
|
+
The consumer process ID.
|
|
194
|
+
|
|
195
|
+
#### Returns
|
|
196
|
+
|
|
197
|
+
`Promise`\<`void`\>
|
|
198
|
+
|
|
199
|
+
A promise that resolves immediately.
|
|
200
|
+
|
|
201
|
+
#### Implementation of
|
|
202
|
+
|
|
203
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onSuspend`](../interfaces/ITransferHandler.md#onsuspend)
|
|
204
|
+
|
|
205
|
+
***
|
|
206
|
+
|
|
207
|
+
### onTerminate() {#onterminate}
|
|
208
|
+
|
|
209
|
+
> **onTerminate**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
210
|
+
|
|
211
|
+
No-op: PULL transfers have no push subscription to tear down.
|
|
212
|
+
|
|
213
|
+
#### Parameters
|
|
214
|
+
|
|
215
|
+
##### dataPlaneComponent
|
|
216
|
+
|
|
217
|
+
`IDataspaceDataPlaneComponent`
|
|
218
|
+
|
|
219
|
+
The data plane component instance.
|
|
220
|
+
|
|
221
|
+
##### consumerPid
|
|
222
|
+
|
|
223
|
+
`string`
|
|
224
|
+
|
|
225
|
+
The consumer process ID.
|
|
226
|
+
|
|
227
|
+
#### Returns
|
|
228
|
+
|
|
229
|
+
`Promise`\<`void`\>
|
|
230
|
+
|
|
231
|
+
A promise that resolves immediately.
|
|
232
|
+
|
|
233
|
+
#### Implementation of
|
|
234
|
+
|
|
235
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onTerminate`](../interfaces/ITransferHandler.md#onterminate)
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Class: HttpDataPushTransferHandler
|
|
2
|
+
|
|
3
|
+
Transfer handler for HttpData-PUSH format (consumer-initiated push).
|
|
4
|
+
The consumer supplies its /inbox endpoint in the TransferRequestMessage dataAddress.
|
|
5
|
+
The provider pushes ActivityStreams objects to that endpoint, and returns its own
|
|
6
|
+
/inbox in the TransferStartMessage so the consumer can route data notifications.
|
|
7
|
+
|
|
8
|
+
## Implements
|
|
9
|
+
|
|
10
|
+
- [`ITransferHandler`](../interfaces/ITransferHandler.md)
|
|
11
|
+
|
|
12
|
+
## Constructors
|
|
13
|
+
|
|
14
|
+
### Constructor
|
|
15
|
+
|
|
16
|
+
> **new HttpDataPushTransferHandler**(): `HttpDataPushTransferHandler`
|
|
17
|
+
|
|
18
|
+
#### Returns
|
|
19
|
+
|
|
20
|
+
`HttpDataPushTransferHandler`
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
### CLASS\_NAME {#class_name}
|
|
25
|
+
|
|
26
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
27
|
+
|
|
28
|
+
Runtime name for the class.
|
|
29
|
+
|
|
30
|
+
## Methods
|
|
31
|
+
|
|
32
|
+
### className() {#classname}
|
|
33
|
+
|
|
34
|
+
> **className**(): `string`
|
|
35
|
+
|
|
36
|
+
Returns the class name of the component.
|
|
37
|
+
|
|
38
|
+
#### Returns
|
|
39
|
+
|
|
40
|
+
`string`
|
|
41
|
+
|
|
42
|
+
The class name of the component.
|
|
43
|
+
|
|
44
|
+
#### Implementation of
|
|
45
|
+
|
|
46
|
+
`ITransferHandler.className`
|
|
47
|
+
|
|
48
|
+
***
|
|
49
|
+
|
|
50
|
+
### buildConsumerDataAddress() {#buildconsumerdataaddress}
|
|
51
|
+
|
|
52
|
+
> **buildConsumerDataAddress**(`ctx`): `IDataspaceProtocolDataAddress` \| `undefined`
|
|
53
|
+
|
|
54
|
+
Build the consumer's /inbox dataAddress for the TransferRequestMessage.
|
|
55
|
+
|
|
56
|
+
#### Parameters
|
|
57
|
+
|
|
58
|
+
##### ctx
|
|
59
|
+
|
|
60
|
+
[`ITransferHandlerPrepareContext`](../interfaces/ITransferHandlerPrepareContext.md)
|
|
61
|
+
|
|
62
|
+
Prepare context containing path and organization identity.
|
|
63
|
+
|
|
64
|
+
#### Returns
|
|
65
|
+
|
|
66
|
+
`IDataspaceProtocolDataAddress` \| `undefined`
|
|
67
|
+
|
|
68
|
+
The consumer's ActivityStream inbox dataAddress.
|
|
69
|
+
|
|
70
|
+
#### Throws
|
|
71
|
+
|
|
72
|
+
GeneralError When dataPlanePath is not configured.
|
|
73
|
+
|
|
74
|
+
#### Implementation of
|
|
75
|
+
|
|
76
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildConsumerDataAddress`](../interfaces/ITransferHandler.md#buildconsumerdataaddress)
|
|
77
|
+
|
|
78
|
+
***
|
|
79
|
+
|
|
80
|
+
### buildProviderStartDataAddress() {#buildproviderstartdataaddress}
|
|
81
|
+
|
|
82
|
+
> **buildProviderStartDataAddress**(`ctx`): `Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
83
|
+
|
|
84
|
+
Validate the consumer's dataAddress and build the provider's /inbox endpoint
|
|
85
|
+
for the TransferStartMessage. No bearer token is included — the consumer authenticates
|
|
86
|
+
via the DSP protocol trust payload on the push POST.
|
|
87
|
+
|
|
88
|
+
#### Parameters
|
|
89
|
+
|
|
90
|
+
##### ctx
|
|
91
|
+
|
|
92
|
+
[`ITransferHandlerStartContext`](../interfaces/ITransferHandlerStartContext.md)
|
|
93
|
+
|
|
94
|
+
Start context containing entity and path configuration.
|
|
95
|
+
|
|
96
|
+
#### Returns
|
|
97
|
+
|
|
98
|
+
`Promise`\<`IDataspaceProtocolDataAddress` \| `undefined`\>
|
|
99
|
+
|
|
100
|
+
The provider's ActivityStream inbox dataAddress.
|
|
101
|
+
|
|
102
|
+
#### Throws
|
|
103
|
+
|
|
104
|
+
GeneralError When the consumer dataAddress is invalid or dataPlanePath is not configured.
|
|
105
|
+
|
|
106
|
+
#### Implementation of
|
|
107
|
+
|
|
108
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`buildProviderStartDataAddress`](../interfaces/ITransferHandler.md#buildproviderstartdataaddress)
|
|
109
|
+
|
|
110
|
+
***
|
|
111
|
+
|
|
112
|
+
### onProviderStart() {#onproviderstart}
|
|
113
|
+
|
|
114
|
+
> **onProviderStart**(`dataPlaneComponent`, `consumerPid`, `previousState`): `Promise`\<`void`\>
|
|
115
|
+
|
|
116
|
+
Set up (or resume) the data-plane push subscription after state is persisted to STARTED.
|
|
117
|
+
|
|
118
|
+
#### Parameters
|
|
119
|
+
|
|
120
|
+
##### dataPlaneComponent
|
|
121
|
+
|
|
122
|
+
`IDataspaceDataPlaneComponent`
|
|
123
|
+
|
|
124
|
+
The data plane component instance.
|
|
125
|
+
|
|
126
|
+
##### consumerPid
|
|
127
|
+
|
|
128
|
+
`string`
|
|
129
|
+
|
|
130
|
+
The consumer process ID.
|
|
131
|
+
|
|
132
|
+
##### previousState
|
|
133
|
+
|
|
134
|
+
`DataspaceProtocolTransferProcessStateType`
|
|
135
|
+
|
|
136
|
+
The state before the STARTED transition.
|
|
137
|
+
|
|
138
|
+
#### Returns
|
|
139
|
+
|
|
140
|
+
`Promise`\<`void`\>
|
|
141
|
+
|
|
142
|
+
A promise that resolves when the subscription is established.
|
|
143
|
+
|
|
144
|
+
#### Implementation of
|
|
145
|
+
|
|
146
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onProviderStart`](../interfaces/ITransferHandler.md#onproviderstart)
|
|
147
|
+
|
|
148
|
+
***
|
|
149
|
+
|
|
150
|
+
### onComplete() {#oncomplete}
|
|
151
|
+
|
|
152
|
+
> **onComplete**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
153
|
+
|
|
154
|
+
Tear down the push subscription when the transfer completes.
|
|
155
|
+
|
|
156
|
+
#### Parameters
|
|
157
|
+
|
|
158
|
+
##### dataPlaneComponent
|
|
159
|
+
|
|
160
|
+
`IDataspaceDataPlaneComponent`
|
|
161
|
+
|
|
162
|
+
The data plane component instance.
|
|
163
|
+
|
|
164
|
+
##### consumerPid
|
|
165
|
+
|
|
166
|
+
`string`
|
|
167
|
+
|
|
168
|
+
The consumer process ID.
|
|
169
|
+
|
|
170
|
+
#### Returns
|
|
171
|
+
|
|
172
|
+
`Promise`\<`void`\>
|
|
173
|
+
|
|
174
|
+
A promise that resolves when the subscription is torn down.
|
|
175
|
+
|
|
176
|
+
#### Implementation of
|
|
177
|
+
|
|
178
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onComplete`](../interfaces/ITransferHandler.md#oncomplete)
|
|
179
|
+
|
|
180
|
+
***
|
|
181
|
+
|
|
182
|
+
### onSuspend() {#onsuspend}
|
|
183
|
+
|
|
184
|
+
> **onSuspend**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
185
|
+
|
|
186
|
+
Suspend the push subscription when the transfer is suspended.
|
|
187
|
+
|
|
188
|
+
#### Parameters
|
|
189
|
+
|
|
190
|
+
##### dataPlaneComponent
|
|
191
|
+
|
|
192
|
+
`IDataspaceDataPlaneComponent`
|
|
193
|
+
|
|
194
|
+
The data plane component instance.
|
|
195
|
+
|
|
196
|
+
##### consumerPid
|
|
197
|
+
|
|
198
|
+
`string`
|
|
199
|
+
|
|
200
|
+
The consumer process ID.
|
|
201
|
+
|
|
202
|
+
#### Returns
|
|
203
|
+
|
|
204
|
+
`Promise`\<`void`\>
|
|
205
|
+
|
|
206
|
+
A promise that resolves when the subscription is suspended.
|
|
207
|
+
|
|
208
|
+
#### Implementation of
|
|
209
|
+
|
|
210
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onSuspend`](../interfaces/ITransferHandler.md#onsuspend)
|
|
211
|
+
|
|
212
|
+
***
|
|
213
|
+
|
|
214
|
+
### onTerminate() {#onterminate}
|
|
215
|
+
|
|
216
|
+
> **onTerminate**(`dataPlaneComponent`, `consumerPid`): `Promise`\<`void`\>
|
|
217
|
+
|
|
218
|
+
Tear down the push subscription when the transfer terminates.
|
|
219
|
+
|
|
220
|
+
#### Parameters
|
|
221
|
+
|
|
222
|
+
##### dataPlaneComponent
|
|
223
|
+
|
|
224
|
+
`IDataspaceDataPlaneComponent`
|
|
225
|
+
|
|
226
|
+
The data plane component instance.
|
|
227
|
+
|
|
228
|
+
##### consumerPid
|
|
229
|
+
|
|
230
|
+
`string`
|
|
231
|
+
|
|
232
|
+
The consumer process ID.
|
|
233
|
+
|
|
234
|
+
#### Returns
|
|
235
|
+
|
|
236
|
+
`Promise`\<`void`\>
|
|
237
|
+
|
|
238
|
+
A promise that resolves when the subscription is torn down.
|
|
239
|
+
|
|
240
|
+
#### Implementation of
|
|
241
|
+
|
|
242
|
+
[`ITransferHandler`](../interfaces/ITransferHandler.md).[`onTerminate`](../interfaces/ITransferHandler.md#onterminate)
|