@twin.org/dataspace-models 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 +63 -0
- package/dist/es/entities/transferProcess.js +137 -0
- package/dist/es/entities/transferProcess.js.map +1 -0
- package/dist/es/factories/dataspaceAppFactory.js +9 -0
- package/dist/es/factories/dataspaceAppFactory.js.map +1 -0
- package/dist/es/index.js +58 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IActivityLogDates.js +4 -0
- package/dist/es/models/IActivityLogDates.js.map +1 -0
- package/dist/es/models/IActivityLogDetails.js +4 -0
- package/dist/es/models/IActivityLogDetails.js.map +1 -0
- package/dist/es/models/IActivityLogEntry.js +2 -0
- package/dist/es/models/IActivityLogEntry.js.map +1 -0
- package/dist/es/models/IActivityLogStatusNotification.js +2 -0
- package/dist/es/models/IActivityLogStatusNotification.js.map +1 -0
- package/dist/es/models/IActivityTask.js +2 -0
- package/dist/es/models/IActivityTask.js.map +1 -0
- package/dist/es/models/IDataAssetItemList.js +2 -0
- package/dist/es/models/IDataAssetItemList.js.map +1 -0
- package/dist/es/models/IDataAssetItemListResult.js +2 -0
- package/dist/es/models/IDataAssetItemListResult.js.map +1 -0
- package/dist/es/models/IEntitySet.js +4 -0
- package/dist/es/models/IEntitySet.js.map +1 -0
- package/dist/es/models/IExecutionPayload.js +2 -0
- package/dist/es/models/IExecutionPayload.js.map +1 -0
- package/dist/es/models/IFilteringQuery.js +2 -0
- package/dist/es/models/IFilteringQuery.js.map +1 -0
- package/dist/es/models/ITaskApp.js +4 -0
- package/dist/es/models/ITaskApp.js.map +1 -0
- package/dist/es/models/activityProcessingStatus.js +29 -0
- package/dist/es/models/activityProcessingStatus.js.map +1 -0
- package/dist/es/models/api/IActivityLogEntryGetRequest.js +4 -0
- package/dist/es/models/api/IActivityLogEntryGetRequest.js.map +1 -0
- package/dist/es/models/api/IActivityLogEntryGetResponse.js +2 -0
- package/dist/es/models/api/IActivityLogEntryGetResponse.js.map +1 -0
- package/dist/es/models/api/IActivityLogStatusNotificationPayload.js +2 -0
- package/dist/es/models/api/IActivityLogStatusNotificationPayload.js.map +1 -0
- package/dist/es/models/api/IActivityLogStatusRequest.js +4 -0
- package/dist/es/models/api/IActivityLogStatusRequest.js.map +1 -0
- package/dist/es/models/api/IActivityStreamNotifyRequest.js +2 -0
- package/dist/es/models/api/IActivityStreamNotifyRequest.js.map +1 -0
- package/dist/es/models/api/IDataAssetEntitiesResponse.js +2 -0
- package/dist/es/models/api/IDataAssetEntitiesResponse.js.map +1 -0
- package/dist/es/models/api/IDataAssetGetEntitiesRequest.js +2 -0
- package/dist/es/models/api/IDataAssetGetEntitiesRequest.js.map +1 -0
- package/dist/es/models/api/IDataAssetQueryRequest.js +2 -0
- package/dist/es/models/api/IDataAssetQueryRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/ICompleteTransferRequest.js +2 -0
- package/dist/es/models/api/control-plane/ICompleteTransferRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/ICompleteTransferResponse.js +2 -0
- package/dist/es/models/api/control-plane/ICompleteTransferResponse.js.map +1 -0
- package/dist/es/models/api/control-plane/IGetTransferProcessRequest.js +2 -0
- package/dist/es/models/api/control-plane/IGetTransferProcessRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/IGetTransferProcessResponse.js +2 -0
- package/dist/es/models/api/control-plane/IGetTransferProcessResponse.js.map +1 -0
- package/dist/es/models/api/control-plane/IRequestTransferRequest.js +2 -0
- package/dist/es/models/api/control-plane/IRequestTransferRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/IRequestTransferResponse.js +2 -0
- package/dist/es/models/api/control-plane/IRequestTransferResponse.js.map +1 -0
- package/dist/es/models/api/control-plane/IStartTransferRequest.js +2 -0
- package/dist/es/models/api/control-plane/IStartTransferRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/IStartTransferResponse.js +2 -0
- package/dist/es/models/api/control-plane/IStartTransferResponse.js.map +1 -0
- package/dist/es/models/api/control-plane/ISuspendTransferRequest.js +2 -0
- package/dist/es/models/api/control-plane/ISuspendTransferRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/ISuspendTransferResponse.js +2 -0
- package/dist/es/models/api/control-plane/ISuspendTransferResponse.js.map +1 -0
- package/dist/es/models/api/control-plane/ITerminateTransferRequest.js +2 -0
- package/dist/es/models/api/control-plane/ITerminateTransferRequest.js.map +1 -0
- package/dist/es/models/api/control-plane/ITerminateTransferResponse.js +2 -0
- package/dist/es/models/api/control-plane/ITerminateTransferResponse.js.map +1 -0
- package/dist/es/models/app/IActivityQuery.js +4 -0
- package/dist/es/models/app/IActivityQuery.js.map +1 -0
- package/dist/es/models/app/IDataAssetEntitiesRequest.js +2 -0
- package/dist/es/models/app/IDataAssetEntitiesRequest.js.map +1 -0
- package/dist/es/models/app/IDataAssetQuery.js +4 -0
- package/dist/es/models/app/IDataAssetQuery.js.map +1 -0
- package/dist/es/models/app/IDataRequest.js +2 -0
- package/dist/es/models/app/IDataRequest.js.map +1 -0
- package/dist/es/models/app/IDataspaceApp.js +2 -0
- package/dist/es/models/app/IDataspaceApp.js.map +1 -0
- package/dist/es/models/app/IQueryDataAssetRequest.js +2 -0
- package/dist/es/models/app/IQueryDataAssetRequest.js.map +1 -0
- package/dist/es/models/app/dataRequestType.js +17 -0
- package/dist/es/models/app/dataRequestType.js.map +1 -0
- package/dist/es/models/control-plane/IDataspaceControlPlaneComponent.js +2 -0
- package/dist/es/models/control-plane/IDataspaceControlPlaneComponent.js.map +1 -0
- package/dist/es/models/control-plane/IDataspaceControlPlaneResolverComponent.js +2 -0
- package/dist/es/models/control-plane/IDataspaceControlPlaneResolverComponent.js.map +1 -0
- package/dist/es/models/control-plane/INegotiationCallback.js +4 -0
- package/dist/es/models/control-plane/INegotiationCallback.js.map +1 -0
- package/dist/es/models/control-plane/ITransferContext.js +2 -0
- package/dist/es/models/control-plane/ITransferContext.js.map +1 -0
- package/dist/es/models/control-plane/ITransferProcess.js +2 -0
- package/dist/es/models/control-plane/ITransferProcess.js.map +1 -0
- package/dist/es/models/control-plane/api/ITransferContextResponse.js +2 -0
- package/dist/es/models/control-plane/api/ITransferContextResponse.js.map +1 -0
- package/dist/es/models/control-plane/transferProcessRole.js +18 -0
- package/dist/es/models/control-plane/transferProcessRole.js.map +1 -0
- package/dist/es/models/data-plane/IDataspaceDataPlaneComponent.js +2 -0
- package/dist/es/models/data-plane/IDataspaceDataPlaneComponent.js.map +1 -0
- package/dist/types/entities/transferProcess.d.ts +71 -0
- package/dist/types/factories/dataspaceAppFactory.d.ts +6 -0
- package/dist/types/index.d.ts +49 -0
- package/dist/types/models/IActivityLogDates.d.ts +13 -0
- package/dist/types/models/IActivityLogDetails.d.ts +29 -0
- package/dist/types/models/IActivityLogEntry.d.ts +40 -0
- package/dist/types/models/IActivityLogStatusNotification.d.ts +31 -0
- package/dist/types/models/IActivityTask.d.ts +14 -0
- package/dist/types/models/IDataAssetItemList.d.ts +21 -0
- package/dist/types/models/IDataAssetItemListResult.d.ts +16 -0
- package/dist/types/models/IEntitySet.d.ts +13 -0
- package/dist/types/models/IExecutionPayload.d.ts +18 -0
- package/dist/types/models/IFilteringQuery.d.ts +18 -0
- package/dist/types/models/ITaskApp.d.ts +13 -0
- package/dist/types/models/activityProcessingStatus.d.ts +29 -0
- package/dist/types/models/api/IActivityLogEntryGetRequest.d.ts +14 -0
- package/dist/types/models/api/IActivityLogEntryGetResponse.d.ts +10 -0
- package/dist/types/models/api/IActivityLogStatusNotificationPayload.d.ts +10 -0
- package/dist/types/models/api/IActivityLogStatusRequest.d.ts +18 -0
- package/dist/types/models/api/IActivityStreamNotifyRequest.d.ts +10 -0
- package/dist/types/models/api/IDataAssetEntitiesResponse.d.ts +17 -0
- package/dist/types/models/api/IDataAssetGetEntitiesRequest.d.ts +43 -0
- package/dist/types/models/api/IDataAssetQueryRequest.d.ts +42 -0
- package/dist/types/models/api/control-plane/ICompleteTransferRequest.d.ts +26 -0
- package/dist/types/models/api/control-plane/ICompleteTransferResponse.d.ts +15 -0
- package/dist/types/models/api/control-plane/IGetTransferProcessRequest.d.ts +21 -0
- package/dist/types/models/api/control-plane/IGetTransferProcessResponse.d.ts +15 -0
- package/dist/types/models/api/control-plane/IRequestTransferRequest.d.ts +17 -0
- package/dist/types/models/api/control-plane/IRequestTransferResponse.d.ts +15 -0
- package/dist/types/models/api/control-plane/IStartTransferRequest.d.ts +26 -0
- package/dist/types/models/api/control-plane/IStartTransferResponse.d.ts +15 -0
- package/dist/types/models/api/control-plane/ISuspendTransferRequest.d.ts +26 -0
- package/dist/types/models/api/control-plane/ISuspendTransferResponse.d.ts +15 -0
- package/dist/types/models/api/control-plane/ITerminateTransferRequest.d.ts +26 -0
- package/dist/types/models/api/control-plane/ITerminateTransferResponse.d.ts +15 -0
- package/dist/types/models/app/IActivityQuery.d.ts +17 -0
- package/dist/types/models/app/IDataAssetEntitiesRequest.d.ts +20 -0
- package/dist/types/models/app/IDataAssetQuery.d.ts +15 -0
- package/dist/types/models/app/IDataRequest.d.ts +6 -0
- package/dist/types/models/app/IDataspaceApp.d.ts +43 -0
- package/dist/types/models/app/IQueryDataAssetRequest.d.ts +20 -0
- package/dist/types/models/app/dataRequestType.d.ts +17 -0
- package/dist/types/models/control-plane/IDataspaceControlPlaneComponent.d.ts +179 -0
- package/dist/types/models/control-plane/IDataspaceControlPlaneResolverComponent.d.ts +55 -0
- package/dist/types/models/control-plane/INegotiationCallback.d.ts +37 -0
- package/dist/types/models/control-plane/ITransferContext.d.ts +52 -0
- package/dist/types/models/control-plane/ITransferProcess.d.ts +81 -0
- package/dist/types/models/control-plane/api/ITransferContextResponse.d.ts +12 -0
- package/dist/types/models/control-plane/transferProcessRole.d.ts +18 -0
- package/dist/types/models/data-plane/IDataspaceDataPlaneComponent.d.ts +65 -0
- package/docs/changelog.md +162 -0
- package/docs/examples.md +1 -0
- package/docs/reference/classes/TransferProcess.md +137 -0
- package/docs/reference/index.md +65 -0
- package/docs/reference/interfaces/IActivityLogDates.md +19 -0
- package/docs/reference/interfaces/IActivityLogDetails.md +55 -0
- package/docs/reference/interfaces/IActivityLogEntry.md +119 -0
- package/docs/reference/interfaces/IActivityLogEntryGetRequest.md +17 -0
- package/docs/reference/interfaces/IActivityLogEntryGetResponse.md +11 -0
- package/docs/reference/interfaces/IActivityLogStatusNotification.md +45 -0
- package/docs/reference/interfaces/IActivityLogStatusNotificationPayload.md +11 -0
- package/docs/reference/interfaces/IActivityLogStatusRequest.md +23 -0
- package/docs/reference/interfaces/IActivityQuery.md +27 -0
- package/docs/reference/interfaces/IActivityStreamNotifyRequest.md +11 -0
- package/docs/reference/interfaces/IActivityTask.md +19 -0
- package/docs/reference/interfaces/ICompleteTransferRequest.md +37 -0
- package/docs/reference/interfaces/ICompleteTransferResponse.md +19 -0
- package/docs/reference/interfaces/IDataAssetEntitiesRequest.md +27 -0
- package/docs/reference/interfaces/IDataAssetEntitiesResponse.md +23 -0
- package/docs/reference/interfaces/IDataAssetGetEntitiesRequest.md +61 -0
- package/docs/reference/interfaces/IDataAssetItemList.md +28 -0
- package/docs/reference/interfaces/IDataAssetItemListResult.md +21 -0
- package/docs/reference/interfaces/IDataAssetQuery.md +19 -0
- package/docs/reference/interfaces/IDataAssetQueryRequest.md +58 -0
- package/docs/reference/interfaces/IDataspaceApp.md +111 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneComponent.md +402 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneResolverComponent.md +113 -0
- package/docs/reference/interfaces/IDataspaceDataPlaneComponent.md +200 -0
- package/docs/reference/interfaces/IEntitySet.md +19 -0
- package/docs/reference/interfaces/IExecutionPayload.md +27 -0
- package/docs/reference/interfaces/IFilteringQuery.md +27 -0
- package/docs/reference/interfaces/IGetTransferProcessRequest.md +29 -0
- package/docs/reference/interfaces/IGetTransferProcessResponse.md +19 -0
- package/docs/reference/interfaces/INegotiationCallback.md +106 -0
- package/docs/reference/interfaces/IQueryDataAssetRequest.md +27 -0
- package/docs/reference/interfaces/IRequestTransferRequest.md +23 -0
- package/docs/reference/interfaces/IRequestTransferResponse.md +19 -0
- package/docs/reference/interfaces/IStartTransferRequest.md +37 -0
- package/docs/reference/interfaces/IStartTransferResponse.md +19 -0
- package/docs/reference/interfaces/ISuspendTransferRequest.md +37 -0
- package/docs/reference/interfaces/ISuspendTransferResponse.md +19 -0
- package/docs/reference/interfaces/ITaskApp.md +19 -0
- package/docs/reference/interfaces/ITerminateTransferRequest.md +37 -0
- package/docs/reference/interfaces/ITerminateTransferResponse.md +19 -0
- package/docs/reference/interfaces/ITransferContext.md +84 -0
- package/docs/reference/interfaces/ITransferContextResponse.md +13 -0
- package/docs/reference/interfaces/ITransferProcess.md +137 -0
- package/docs/reference/type-aliases/ActivityProcessingStatus.md +5 -0
- package/docs/reference/type-aliases/DataRequestType.md +5 -0
- package/docs/reference/type-aliases/IDataRequest.md +5 -0
- package/docs/reference/type-aliases/TransferProcessRole.md +5 -0
- package/docs/reference/variables/ActivityProcessingStatus.md +37 -0
- package/docs/reference/variables/DataRequestType.md +19 -0
- package/docs/reference/variables/DataspaceAppFactory.md +5 -0
- package/docs/reference/variables/TransferProcessRole.md +20 -0
- package/package.json +62 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IDataspaceProtocolTransferProcess, IDataspaceProtocolTransferError } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { HttpStatusCode } from "@twin.org/web";
|
|
3
|
+
/**
|
|
4
|
+
* API response for terminating a transfer process.
|
|
5
|
+
*/
|
|
6
|
+
export interface ITerminateTransferResponse {
|
|
7
|
+
/**
|
|
8
|
+
* Transfer Process (DSP compliant) with state TERMINATED, or error.
|
|
9
|
+
*/
|
|
10
|
+
body: IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError;
|
|
11
|
+
/**
|
|
12
|
+
* HTTP status code for the response.
|
|
13
|
+
*/
|
|
14
|
+
statusCode?: HttpStatusCode;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (Activity,Object,Target) query for denoting combinations to be handled by a Dataspace App.
|
|
3
|
+
*/
|
|
4
|
+
export interface IActivityQuery {
|
|
5
|
+
/**
|
|
6
|
+
* FQN of the Activity type.
|
|
7
|
+
*/
|
|
8
|
+
activityType?: string;
|
|
9
|
+
/**
|
|
10
|
+
* FQN of the Object Type.
|
|
11
|
+
*/
|
|
12
|
+
objectType: string;
|
|
13
|
+
/**
|
|
14
|
+
* FQN of the target type.
|
|
15
|
+
*/
|
|
16
|
+
targetType?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IDataspaceProtocolDataset } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { IEntitySet } from "../IEntitySet.js";
|
|
3
|
+
import type { DataRequestType } from "./dataRequestType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data Request type for representing data requests received by Dataspace Apps.
|
|
6
|
+
*/
|
|
7
|
+
export interface IDataAssetEntitiesRequest {
|
|
8
|
+
/**
|
|
9
|
+
* Data Asset Entities type.
|
|
10
|
+
*/
|
|
11
|
+
type: typeof DataRequestType.DataAssetEntities;
|
|
12
|
+
/**
|
|
13
|
+
* The data asset we are referring to.
|
|
14
|
+
*/
|
|
15
|
+
dataAsset: IDataspaceProtocolDataset;
|
|
16
|
+
/**
|
|
17
|
+
* The entity set.
|
|
18
|
+
* */
|
|
19
|
+
entitySet: IEntitySet;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Asset query for internal service matching of datasets to apps.
|
|
3
|
+
*
|
|
4
|
+
* This interface is used internally by the Dataspace Data Plane service to match
|
|
5
|
+
* datasets with their corresponding apps. Apps should use `datasetsHandled(): IDataset[]`
|
|
6
|
+
* to declare which datasets they handle.
|
|
7
|
+
*
|
|
8
|
+
* @see IDataspaceDataPlaneApp.datasetsHandled
|
|
9
|
+
*/
|
|
10
|
+
export interface IDataAssetQuery {
|
|
11
|
+
/**
|
|
12
|
+
* Id of the dataset in the Catalogue (dataset @id).
|
|
13
|
+
*/
|
|
14
|
+
datasetId: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDataAssetEntitiesRequest } from "./IDataAssetEntitiesRequest.js";
|
|
2
|
+
import type { IQueryDataAssetRequest } from "./IQueryDataAssetRequest.js";
|
|
3
|
+
/**
|
|
4
|
+
* Data Request type for representing data requests received by Dataspace Data Plane Apps.
|
|
5
|
+
*/
|
|
6
|
+
export type IDataRequest = IDataAssetEntitiesRequest | IQueryDataAssetRequest;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
import type { IJsonLdDocument } from "@twin.org/data-json-ld";
|
|
3
|
+
import type { IDataspaceProtocolDataset } from "@twin.org/standards-dataspace-protocol";
|
|
4
|
+
import type { IActivityStreamsActivity } from "@twin.org/standards-w3c-activity-streams";
|
|
5
|
+
import type { IActivityQuery } from "./IActivityQuery.js";
|
|
6
|
+
import type { IDataRequest } from "./IDataRequest.js";
|
|
7
|
+
/**
|
|
8
|
+
* Interface describes a Dataspace App.
|
|
9
|
+
*/
|
|
10
|
+
export interface IDataspaceApp extends IComponent {
|
|
11
|
+
/**
|
|
12
|
+
* The activities handled by the App.
|
|
13
|
+
* @returns A query that describes the set of activities handled by the App.
|
|
14
|
+
*/
|
|
15
|
+
activitiesHandled(): IActivityQuery[];
|
|
16
|
+
/**
|
|
17
|
+
* The datasets handled by the App.
|
|
18
|
+
* @returns The Dataspace Protocol compliant datasets handled by the App.
|
|
19
|
+
*/
|
|
20
|
+
datasetsHandled(): Promise<IDataspaceProtocolDataset[]>;
|
|
21
|
+
/**
|
|
22
|
+
* The types of queries supported.
|
|
23
|
+
* @returns The types of queries supported by the Dataspace App to retrieve data.
|
|
24
|
+
*/
|
|
25
|
+
supportedQueryTypes(): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Handles an Activity and report about results through the Dataspace Data Plane Callback
|
|
28
|
+
* @param activity The Activity to be handled
|
|
29
|
+
* @returns The result of executing the Activity.
|
|
30
|
+
*/
|
|
31
|
+
handleActivity?<T>(activity: IActivityStreamsActivity): Promise<T>;
|
|
32
|
+
/**
|
|
33
|
+
* Handles a Data Request.
|
|
34
|
+
* @param dataRequest The data request.
|
|
35
|
+
* @param cursor Cursor that points to the next item in the result set.
|
|
36
|
+
* @param limit Maximum number of entries retrieved or to be retrieved.
|
|
37
|
+
* @returns Data as JSON-Ld.
|
|
38
|
+
*/
|
|
39
|
+
handleDataRequest?(dataRequest: IDataRequest, cursor?: string, limit?: number): Promise<{
|
|
40
|
+
data: IJsonLdDocument;
|
|
41
|
+
cursor?: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IDataspaceProtocolDataset } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { IFilteringQuery } from "../IFilteringQuery.js";
|
|
3
|
+
import type { DataRequestType } from "./dataRequestType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data Request type for representing data requests received by Dataspace Apps.
|
|
6
|
+
*/
|
|
7
|
+
export interface IQueryDataAssetRequest {
|
|
8
|
+
/**
|
|
9
|
+
* Data Asset Entities type.
|
|
10
|
+
*/
|
|
11
|
+
type: typeof DataRequestType.QueryDataAsset;
|
|
12
|
+
/**
|
|
13
|
+
* The data asset we are referring to.
|
|
14
|
+
*/
|
|
15
|
+
dataAsset: IDataspaceProtocolDataset;
|
|
16
|
+
/**
|
|
17
|
+
* Query to perform filtering.
|
|
18
|
+
*/
|
|
19
|
+
query: IFilteringQuery;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Request Types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const DataRequestType: {
|
|
5
|
+
/**
|
|
6
|
+
* Data Asset Entities
|
|
7
|
+
*/
|
|
8
|
+
readonly DataAssetEntities: "DataAssetEntities";
|
|
9
|
+
/**
|
|
10
|
+
* Query over a data asset
|
|
11
|
+
*/
|
|
12
|
+
readonly QueryDataAsset: "QueryDataAsset";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Data Request Types.
|
|
16
|
+
*/
|
|
17
|
+
export type DataRequestType = (typeof DataRequestType)[keyof typeof DataRequestType];
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
import type { IDataspaceProtocolContractNegotiation, IDataspaceProtocolContractNegotiationError, IDataspaceProtocolTransferCompletionMessage, IDataspaceProtocolTransferError, IDataspaceProtocolTransferProcess, IDataspaceProtocolTransferRequestMessage, IDataspaceProtocolTransferStartMessage, IDataspaceProtocolTransferSuspensionMessage, IDataspaceProtocolTransferTerminationMessage } from "@twin.org/standards-dataspace-protocol";
|
|
3
|
+
import type { INegotiationCallback } from "./INegotiationCallback.js";
|
|
4
|
+
/**
|
|
5
|
+
* Dataspace Control Plane Component interface.
|
|
6
|
+
* Implements Eclipse Dataspace Protocol (DSP) specifications:
|
|
7
|
+
* - Contract Negotiation Protocol
|
|
8
|
+
* - Transfer Process Protocol
|
|
9
|
+
*
|
|
10
|
+
* This component acts as the Control Plane for contract negotiation and
|
|
11
|
+
* data transfers between nodes in a dataspace.
|
|
12
|
+
*
|
|
13
|
+
* DSP 2025-1 Specification: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/
|
|
14
|
+
*/
|
|
15
|
+
export interface IDataspaceControlPlaneComponent extends IComponent {
|
|
16
|
+
/**
|
|
17
|
+
* Register a callback to receive negotiation state change notifications.
|
|
18
|
+
* Upstream modules (e.g. supply-chain) register their callback here
|
|
19
|
+
* to be notified when negotiations complete, fail, or change state.
|
|
20
|
+
* @param key A unique key identifying this callback registration.
|
|
21
|
+
* @param callback The callback interface to register.
|
|
22
|
+
*/
|
|
23
|
+
registerNegotiationCallback(key: string, callback: INegotiationCallback): void;
|
|
24
|
+
/**
|
|
25
|
+
* Unregister a previously registered negotiation callback.
|
|
26
|
+
* @param key The key used when registering the callback.
|
|
27
|
+
*/
|
|
28
|
+
unregisterNegotiationCallback(key: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Negotiate a contract agreement with a provider.
|
|
31
|
+
* Implements DSP Contract Negotiation Protocol.
|
|
32
|
+
*
|
|
33
|
+
* Returns immediately with a negotiationId. The caller is notified
|
|
34
|
+
* via the registered INegotiationCallback when the negotiation completes.
|
|
35
|
+
* The negotiation follows DSP state machine: REQUESTED → OFFERED → AGREED → VERIFIED → FINALIZED.
|
|
36
|
+
*
|
|
37
|
+
* This method has NO REST client implementation — it is only accessible via ComponentFactory.get().
|
|
38
|
+
*
|
|
39
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol
|
|
40
|
+
*
|
|
41
|
+
* @param offerId The offer ID from the provider's catalog.
|
|
42
|
+
* @param providerEndpoint The provider's contract negotiation endpoint URL.
|
|
43
|
+
* @param publicOrigin The public origin URL of this control plane (for callbacks).
|
|
44
|
+
* @param trustPayload Trust payload for authentication (JWT or Verifiable Credential).
|
|
45
|
+
* @returns The negotiation ID for tracking. Use registered callback for completion.
|
|
46
|
+
*/
|
|
47
|
+
negotiateAgreement(offerId: string, providerEndpoint: string, publicOrigin: string, trustPayload: unknown): Promise<{
|
|
48
|
+
negotiationId: string;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Get the current state of a contract negotiation.
|
|
52
|
+
* Implements DSP Contract Negotiation Protocol.
|
|
53
|
+
*
|
|
54
|
+
* Queries the current state of an ongoing or completed negotiation.
|
|
55
|
+
* Use this to monitor negotiation progress.
|
|
56
|
+
* Returns the DSP-compliant negotiation state or error.
|
|
57
|
+
*
|
|
58
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol
|
|
59
|
+
*
|
|
60
|
+
* @param negotiationId The unique identifier of the negotiation.
|
|
61
|
+
* @param trustPayload Trust payload for authentication.
|
|
62
|
+
* @returns DSP ContractNegotiation with current state, or error.
|
|
63
|
+
*/
|
|
64
|
+
getNegotiation(negotiationId: string, trustPayload: unknown): Promise<IDataspaceProtocolContractNegotiation | IDataspaceProtocolContractNegotiationError>;
|
|
65
|
+
/**
|
|
66
|
+
* Get negotiation history.
|
|
67
|
+
* Queries past contract negotiations for audit trails and debugging.
|
|
68
|
+
*
|
|
69
|
+
* Returns a list of past negotiations with their states and metadata.
|
|
70
|
+
* Supports optional filtering by state and pagination via cursor.
|
|
71
|
+
*
|
|
72
|
+
* @param state Optional filter by negotiation state (e.g., "FINALIZED", "TERMINATED").
|
|
73
|
+
* @param cursor Optional pagination cursor for fetching next page.
|
|
74
|
+
* @param trustPayload Trust payload for authentication.
|
|
75
|
+
* @returns List of negotiation history entries with pagination cursor.
|
|
76
|
+
*/
|
|
77
|
+
getNegotiationHistory(state: string | undefined, cursor: string | undefined, trustPayload: unknown): Promise<{
|
|
78
|
+
negotiations: {
|
|
79
|
+
negotiation: IDataspaceProtocolContractNegotiation | IDataspaceProtocolContractNegotiationError;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
offerId?: string;
|
|
82
|
+
agreementId?: string;
|
|
83
|
+
}[];
|
|
84
|
+
cursor?: string;
|
|
85
|
+
count: number;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Request a Transfer Process.
|
|
89
|
+
* Creates a new Transfer Process in REQUESTED state.
|
|
90
|
+
*
|
|
91
|
+
* Role Performed: Provider
|
|
92
|
+
* Called by: Consumer when it wants to request a new Transfer Process
|
|
93
|
+
*
|
|
94
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-request-message
|
|
95
|
+
*
|
|
96
|
+
* @param request Transfer request message (DSP compliant) containing agreementId,
|
|
97
|
+
* consumerPid, callbackAddress, and format.
|
|
98
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
99
|
+
* The consumer must prove their identity by providing a valid trust payload.
|
|
100
|
+
* @returns Transfer Process (DSP compliant) with state REQUESTED, including
|
|
101
|
+
* both consumerPid and providerPid, or TransferError if the operation fails.
|
|
102
|
+
*/
|
|
103
|
+
requestTransfer(request: IDataspaceProtocolTransferRequestMessage, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
104
|
+
/**
|
|
105
|
+
* Start a Transfer Process.
|
|
106
|
+
* Transitions Transfer Process from REQUESTED to STARTED state, or resumes from SUSPENDED state.
|
|
107
|
+
*
|
|
108
|
+
* Role Performed: Provider / Consumer
|
|
109
|
+
* Called by: Provider when a Transfer Process starts, or Consumer to attempt to start a Transfer Process after it has been suspended
|
|
110
|
+
*
|
|
111
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-start-message
|
|
112
|
+
*
|
|
113
|
+
* @param message Transfer start message (DSP compliant).
|
|
114
|
+
* @param publicOrigin The public origin URL of this service (used to construct data plane endpoint for PULL transfers).
|
|
115
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
116
|
+
* @returns Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.
|
|
117
|
+
*/
|
|
118
|
+
startTransfer(message: IDataspaceProtocolTransferStartMessage, publicOrigin: string, trustPayload: unknown): Promise<IDataspaceProtocolTransferStartMessage | IDataspaceProtocolTransferError>;
|
|
119
|
+
/**
|
|
120
|
+
* Complete a Transfer Process.
|
|
121
|
+
* Transitions Transfer Process to COMPLETED state.
|
|
122
|
+
*
|
|
123
|
+
* Role Performed: Consumer / Provider
|
|
124
|
+
* Called by: Provider or Consumer when a Transfer process is completed on their side
|
|
125
|
+
*
|
|
126
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-completion-message
|
|
127
|
+
*
|
|
128
|
+
* @param message Transfer completion message (DSP compliant).
|
|
129
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
130
|
+
* @returns Transfer Process (DSP compliant) with state COMPLETED, or TransferError if the operation fails.
|
|
131
|
+
*/
|
|
132
|
+
completeTransfer(message: IDataspaceProtocolTransferCompletionMessage, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
133
|
+
/**
|
|
134
|
+
* Suspend a Transfer Process.
|
|
135
|
+
* Transitions Transfer Process to SUSPENDED state.
|
|
136
|
+
*
|
|
137
|
+
* Role Performed: Consumer / Provider
|
|
138
|
+
* Called by: Provider or Consumer when a Transfer process needs to be temporarily suspended on their side
|
|
139
|
+
*
|
|
140
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-suspension-message
|
|
141
|
+
*
|
|
142
|
+
* @param message Transfer suspension message (DSP compliant) with optional reason.
|
|
143
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
144
|
+
* @returns Transfer Process (DSP compliant) with state SUSPENDED, or TransferError if the operation fails.
|
|
145
|
+
*/
|
|
146
|
+
suspendTransfer(message: IDataspaceProtocolTransferSuspensionMessage, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
147
|
+
/**
|
|
148
|
+
* Terminate a Transfer Process.
|
|
149
|
+
* Transitions Transfer Process to TERMINATED state.
|
|
150
|
+
*
|
|
151
|
+
* Role Performed: Consumer / Provider
|
|
152
|
+
* Called by: Provider or Consumer when a Transfer process needs to be terminated on their side (e.g., due to error)
|
|
153
|
+
*
|
|
154
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-termination-message
|
|
155
|
+
*
|
|
156
|
+
* @param message Transfer termination message (DSP compliant) with optional reason.
|
|
157
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
158
|
+
* @returns Transfer Process (DSP compliant) with state TERMINATED, or TransferError if the operation fails.
|
|
159
|
+
*/
|
|
160
|
+
terminateTransfer(message: IDataspaceProtocolTransferTerminationMessage, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
161
|
+
/**
|
|
162
|
+
* Get Transfer Process State.
|
|
163
|
+
* Query the current state of a Transfer Process.
|
|
164
|
+
*
|
|
165
|
+
* Role Performed: Consumer / Provider
|
|
166
|
+
* Called by: Provider or Consumer when they need to check the status of a Transfer process on their side
|
|
167
|
+
*
|
|
168
|
+
* Supports role-agnostic lookup using either consumerPid or providerPid.
|
|
169
|
+
* The service will automatically detect which role the caller is acting as
|
|
170
|
+
* (Consumer or Provider) based on the PID provided.
|
|
171
|
+
*
|
|
172
|
+
* DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#ack-transfer-process
|
|
173
|
+
*
|
|
174
|
+
* @param pid The Process ID (consumerPid or providerPid) used to identify the transfer.
|
|
175
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
176
|
+
* @returns Transfer Process (DSP compliant) with current state, or TransferError if the operation fails.
|
|
177
|
+
*/
|
|
178
|
+
getTransferProcess(pid: string, trustPayload: unknown): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;
|
|
179
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
import type { ITransferContext } from "./ITransferContext.js";
|
|
3
|
+
/**
|
|
4
|
+
* Dataspace Control Plane Resolver Component interface.
|
|
5
|
+
* Provides methods for resolving transfer process information.
|
|
6
|
+
* Used by dataspace-data-plane to retrieve dataset and policy information for data access.
|
|
7
|
+
*
|
|
8
|
+
* These methods are NOT part of the Eclipse Dataspace Protocol specification.
|
|
9
|
+
* They are TWIN-specific extensions for internal service communication.
|
|
10
|
+
*
|
|
11
|
+
* IMPORTANT: This interface has NO REST client implementation - methods are only
|
|
12
|
+
* accessible via ComponentFactory.get() for local, in-process service access.
|
|
13
|
+
*/
|
|
14
|
+
export interface IDataspaceControlPlaneResolverComponent extends IComponent {
|
|
15
|
+
/**
|
|
16
|
+
* Resolve consumerPid to Transfer Context.
|
|
17
|
+
* Returns Transfer Context with Agreement, datasetId, and Transfer Process metadata.
|
|
18
|
+
* Validates that Agreement assigner matches current organization ID for security.
|
|
19
|
+
* This method is called by the dataspace-data-plane to resolve a consumerPid
|
|
20
|
+
* to the corresponding Agreement and dataset information for data retrieval (pull mode).
|
|
21
|
+
*
|
|
22
|
+
* This method is only available via ComponentFactory.get().
|
|
23
|
+
* There is no REST client implementation.
|
|
24
|
+
*
|
|
25
|
+
* @param consumerPid Consumer Process ID from the transfer request.
|
|
26
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
27
|
+
* The trust service handles verification and extracts identity and token.
|
|
28
|
+
* @returns Transfer Context with Agreement, datasetId, and Transfer Process metadata.
|
|
29
|
+
* @throws NotFoundError if Transfer Process not found.
|
|
30
|
+
* @throws UnauthorizedError if trust verification fails or Agreement assigner doesn't match current organization.
|
|
31
|
+
* @throws GeneralError if Transfer Process is terminated or Agreement lookup fails.
|
|
32
|
+
*/
|
|
33
|
+
resolveConsumerPid(consumerPid: string, trustPayload: unknown): Promise<ITransferContext>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve providerPid to Transfer Context.
|
|
36
|
+
* Returns Transfer Context with Agreement, datasetId, and Transfer Process metadata.
|
|
37
|
+
* Used for push mode data transfer where Provider needs to push data to Consumer via Activity Stream.
|
|
38
|
+
* Validates that Agreement assigner matches current organization ID and assignee matches expected consumer for security.
|
|
39
|
+
*
|
|
40
|
+
* This method is called by the Provider's dataspace-data-plane when it receives an Activity
|
|
41
|
+
* referencing a providerPid and needs to resolve it to get Agreement, dataset, and consumer's dataAddress.
|
|
42
|
+
*
|
|
43
|
+
* This method is only available via ComponentFactory.get().
|
|
44
|
+
* There is no REST client implementation.
|
|
45
|
+
*
|
|
46
|
+
* @param providerPid Provider Process ID from the transfer process.
|
|
47
|
+
* @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).
|
|
48
|
+
* The trust service handles verification and extracts identity and token.
|
|
49
|
+
* @returns Transfer Context with Agreement, datasetId, and Transfer Process metadata.
|
|
50
|
+
* @throws NotFoundError if Transfer Process not found.
|
|
51
|
+
* @throws UnauthorizedError if trust verification fails, Agreement assigner doesn't match current organization, or assignee doesn't match expected consumer.
|
|
52
|
+
* @throws GeneralError if Transfer Process is terminated or Agreement lookup fails.
|
|
53
|
+
*/
|
|
54
|
+
resolveProviderPid(providerPid: string, trustPayload: unknown): Promise<ITransferContext>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DataspaceProtocolContractNegotiationStateType } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { IOdrlAgreement, IOdrlOffer } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
/**
|
|
4
|
+
* Callback interface for negotiation state change notifications.
|
|
5
|
+
* Upstream modules register an implementation of this interface
|
|
6
|
+
* via IDataspaceControlPlaneComponent.registerNegotiationCallback()
|
|
7
|
+
* to be notified when PNP callbacks fire.
|
|
8
|
+
*/
|
|
9
|
+
export interface INegotiationCallback {
|
|
10
|
+
/**
|
|
11
|
+
* Called when the negotiation state changes (offer received, agreement received).
|
|
12
|
+
* @param negotiationId The negotiation ID.
|
|
13
|
+
* @param state The new state.
|
|
14
|
+
* @param data Optional data associated with the state change.
|
|
15
|
+
* @param data.offer The offer received from the provider.
|
|
16
|
+
* @param data.agreement The agreement received from the provider.
|
|
17
|
+
* @returns Nothing.
|
|
18
|
+
*/
|
|
19
|
+
onStateChanged(negotiationId: string, state: DataspaceProtocolContractNegotiationStateType, data?: {
|
|
20
|
+
offer?: IOdrlOffer;
|
|
21
|
+
agreement?: IOdrlAgreement;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the negotiation completes successfully (finalized).
|
|
25
|
+
* @param negotiationId The negotiation ID.
|
|
26
|
+
* @param agreementId The agreement ID (from agreement.uid).
|
|
27
|
+
* @returns Nothing.
|
|
28
|
+
*/
|
|
29
|
+
onCompleted(negotiationId: string, agreementId: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Called when the negotiation fails (terminated or stalled).
|
|
32
|
+
* @param negotiationId The negotiation ID.
|
|
33
|
+
* @param reason The failure reason.
|
|
34
|
+
* @returns Nothing.
|
|
35
|
+
*/
|
|
36
|
+
onFailed(negotiationId: string, reason: string): Promise<void>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DataspaceProtocolTransferProcessStateType, IDataspaceProtocolDataAddress } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { IOdrlAgreement } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
/**
|
|
4
|
+
* Transfer Context data structure.
|
|
5
|
+
* Contains all information needed by DSC to execute queries.
|
|
6
|
+
* This is NOT part of the DSP protocol - it's a TWIN internal API
|
|
7
|
+
* used by dataspace-control-plane to resolve consumerPid to datasetId and policies.
|
|
8
|
+
*/
|
|
9
|
+
export interface ITransferContext {
|
|
10
|
+
/**
|
|
11
|
+
* Consumer Process ID.
|
|
12
|
+
*/
|
|
13
|
+
consumerPid: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provider Process ID.
|
|
16
|
+
*/
|
|
17
|
+
providerPid: string;
|
|
18
|
+
/**
|
|
19
|
+
* Agreement associated with this Transfer Process.
|
|
20
|
+
* Contains permissions, obligations, and prohibitions that DSC uses for runtime policy enforcement.
|
|
21
|
+
*/
|
|
22
|
+
agreement: IOdrlAgreement;
|
|
23
|
+
/**
|
|
24
|
+
* Dataset ID - what the DSC needs to execute the query.
|
|
25
|
+
* Convenience field extracted from agreement.target for quick access.
|
|
26
|
+
*/
|
|
27
|
+
datasetId: string;
|
|
28
|
+
/**
|
|
29
|
+
* Offer ID.
|
|
30
|
+
*/
|
|
31
|
+
offerId: string;
|
|
32
|
+
/**
|
|
33
|
+
* Current Transfer Process state.
|
|
34
|
+
* DSC should only allow queries if state is STARTED.
|
|
35
|
+
*/
|
|
36
|
+
state: DataspaceProtocolTransferProcessStateType;
|
|
37
|
+
/**
|
|
38
|
+
* Consumer identity (for auditing).
|
|
39
|
+
*/
|
|
40
|
+
consumerIdentity?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Provider identity (for auditing).
|
|
43
|
+
* Extracted from Agreement's assigner field.
|
|
44
|
+
*/
|
|
45
|
+
providerIdentity?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Data address for push mode transfers.
|
|
48
|
+
* Contains endpoint information where data should be pushed (for Activity Stream push mode).
|
|
49
|
+
* Only present when format is Http-Push-Activity-Stream-Format or Http-Post-Activity-Stream-Format.
|
|
50
|
+
*/
|
|
51
|
+
dataAddress?: IDataspaceProtocolDataAddress;
|
|
52
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { DataspaceProtocolTransferProcessStateType, IDataspaceProtocolDataAddress } from "@twin.org/standards-dataspace-protocol";
|
|
2
|
+
import type { IOdrlPolicy } from "@twin.org/standards-w3c-odrl";
|
|
3
|
+
/**
|
|
4
|
+
* Transfer Process for internal storage.
|
|
5
|
+
* Combines DSP protocol fields with internal TWIN fields.
|
|
6
|
+
* This is NOT the DSP wire format (use ITransferProcess from standards for that).
|
|
7
|
+
*/
|
|
8
|
+
export interface ITransferProcess {
|
|
9
|
+
/**
|
|
10
|
+
* Internal UUID (primary key for entity storage).
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Consumer Process ID from the DSP protocol.
|
|
15
|
+
* Refers to the transfer identifier on the Consumer side.
|
|
16
|
+
*/
|
|
17
|
+
consumerPid: string;
|
|
18
|
+
/**
|
|
19
|
+
* Provider Process ID from the DSP protocol.
|
|
20
|
+
* Refers to the transfer identifier on the Provider side.
|
|
21
|
+
*/
|
|
22
|
+
providerPid: string;
|
|
23
|
+
/**
|
|
24
|
+
* Transfer Process state from the DSP protocol.
|
|
25
|
+
* One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.
|
|
26
|
+
*/
|
|
27
|
+
state: DataspaceProtocolTransferProcessStateType;
|
|
28
|
+
/**
|
|
29
|
+
* Agreement ID linking to the rights-management Agreement.
|
|
30
|
+
* Used to resolve policies and permissions.
|
|
31
|
+
*/
|
|
32
|
+
agreementId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Dataset ID for DSC resolution.
|
|
35
|
+
* Identifies the dataset being transferred.
|
|
36
|
+
*/
|
|
37
|
+
datasetId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Offer ID from the original Catalog offer.
|
|
40
|
+
*/
|
|
41
|
+
offerId: string;
|
|
42
|
+
/**
|
|
43
|
+
* Policies from the Agreement.
|
|
44
|
+
* Used by DSC for runtime policy enforcement.
|
|
45
|
+
*/
|
|
46
|
+
policies?: IOdrlPolicy[];
|
|
47
|
+
/**
|
|
48
|
+
* Consumer identity (DID or URI).
|
|
49
|
+
* Used for auditing and access control.
|
|
50
|
+
*/
|
|
51
|
+
consumerIdentity?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Provider identity (DID or URI).
|
|
54
|
+
* Used for auditing.
|
|
55
|
+
*/
|
|
56
|
+
providerIdentity?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Callback address for Consumer notifications.
|
|
59
|
+
* URI where messages to the Consumer should be sent.
|
|
60
|
+
*/
|
|
61
|
+
callbackAddress?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Data format from the Dataset Distribution.
|
|
64
|
+
* Specified by a Distribution for the Dataset associated with the Agreement.
|
|
65
|
+
*/
|
|
66
|
+
format?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Data address for push mode transfers.
|
|
69
|
+
* Contains endpoint information where data should be pushed (for Activity Stream push mode).
|
|
70
|
+
* Only present when format is Http-Push-Activity-Stream-Format or Http-Post-Activity-Stream-Format.
|
|
71
|
+
*/
|
|
72
|
+
dataAddress?: IDataspaceProtocolDataAddress;
|
|
73
|
+
/**
|
|
74
|
+
* Creation timestamp.
|
|
75
|
+
*/
|
|
76
|
+
dateCreated: Date;
|
|
77
|
+
/**
|
|
78
|
+
* Last update timestamp.
|
|
79
|
+
*/
|
|
80
|
+
dateModified: Date;
|
|
81
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ITransferContext } from "../ITransferContext.js";
|
|
2
|
+
/**
|
|
3
|
+
* Transfer Context Response (INTERNAL API for DSC).
|
|
4
|
+
* This is NOT part of the DSP protocol - it's a TWIN internal API
|
|
5
|
+
* used by dataspace-control-plane to resolve consumerPid to datasetId and policies.
|
|
6
|
+
*/
|
|
7
|
+
export interface ITransferContextResponse {
|
|
8
|
+
/**
|
|
9
|
+
* Request body
|
|
10
|
+
*/
|
|
11
|
+
body: ITransferContext;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The role of a participant in a Transfer Process.
|
|
3
|
+
* Determines whether the party is acting as Consumer or Provider.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TransferProcessRole: {
|
|
6
|
+
/**
|
|
7
|
+
* Consumer role - the party requesting data.
|
|
8
|
+
*/
|
|
9
|
+
readonly Consumer: "consumer";
|
|
10
|
+
/**
|
|
11
|
+
* Provider role - the party providing data.
|
|
12
|
+
*/
|
|
13
|
+
readonly Provider: "provider";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Type for TransferProcessRole values.
|
|
17
|
+
*/
|
|
18
|
+
export type TransferProcessRole = (typeof TransferProcessRole)[keyof typeof TransferProcessRole];
|