@twin.org/dataspace-data-plane-service 0.0.3-next.44 → 0.0.3-next.45

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.
@@ -20,12 +20,12 @@ export function generateSocketRoutesDataspaceDataPlane(baseRouteName, componentN
20
20
  return [activityLogStatusWsRoute];
21
21
  }
22
22
  /**
23
- * Provides an status update.
23
+ * Handles an activity log subscribe or unsubscribe operation over a WebSocket.
24
24
  * @param socketRequestContext The request context for the API.
25
25
  * @param componentName The name of the component to use in the routes.
26
26
  * @param request The request.
27
27
  * @param emitter The emitter to send message back.
28
- * @returns The response object with additional http response properties.
28
+ * @returns A promise that resolves when the subscribe or unsubscribe operation is complete.
29
29
  */
30
30
  export async function activityLogStatusUpdate(socketRequestContext, componentName, request, emitter) {
31
31
  Guards.object(ROUTES_SOURCE, "request", request);
@@ -49,6 +49,7 @@ export async function activityLogStatusUpdate(socketRequestContext, componentNam
49
49
  * Executes when there is a disconnection.
50
50
  * @param socketRequestContext Socket Request Context
51
51
  * @param componentName Component name.
52
+ * @returns A promise that resolves when the socket subscription has been removed.
52
53
  */
53
54
  export async function activityLogStatusDisconnected(socketRequestContext, componentName) {
54
55
  const logger = ComponentFactory.getIfExists(socketRequestContext.loggingComponentType);
@@ -64,8 +65,9 @@ export async function activityLogStatusDisconnected(socketRequestContext, compon
64
65
  await component.unSubscribeToActivityLog(socketRequestContext.socketId);
65
66
  }
66
67
  /**
67
- * Executes when there is a disconnection.
68
+ * Executes when a new socket connection is established.
68
69
  * @param socketRequestContext Socket Request Context
70
+ * @returns A promise that resolves when the connection event has been logged.
69
71
  */
70
72
  export async function activityLogStatusConnected(socketRequestContext) {
71
73
  const logger = ComponentFactory.getIfExists(socketRequestContext.loggingComponentType);
@@ -1 +1 @@
1
- {"version":3,"file":"dataspaceDataPlaneSocketRoutes.js","sourceRoot":"","sources":["../../src/dataspaceDataPlaneSocketRoutes.ts"],"names":[],"mappings":"AAGA,OAAO,E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,OAAO,CAAC,SAAS,EAAE;oBACxB,IAAI,EAAE,KAAK;iBACX,CAAC,CAAC;YACJ,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAChC,MAAM;QACP,KAAK,aAAa;YACjB,MAAM,SAAS,CAAC,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACtE,MAAM;IACR,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,oBAA2C,EAC3C,aAAqB;IAErB,MAAM,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAC1C,oBAAoB,CAAC,oBAAoB,CACzC,CAAC;IACF,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAA+B,aAAa,CAAC,CAAC;IAEpF,MAAM,MAAM,EAAE,GAAG,CAAC;QACjB,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,+BAA+B;QACxC,IAAI,EAAE;YACL,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;SACvC;KACD,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,oBAA2C;IAE3C,MAAM,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAC1C,oBAAoB,CAAC,oBAAoB,CACzC,CAAC;IAEF,MAAM,MAAM,EAAE,GAAG,CAAC;QACjB,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,4BAA4B;QACrC,IAAI,EAAE;YACL,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;SACvC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISocketRequestContext, ISocketRoute } from \"@twin.org/api-models\";\nimport { ComponentFactory, Guards } from \"@twin.org/core\";\nimport type {\n\tIActivityLogStatusNotificationPayload,\n\tIActivityLogStatusRequest,\n\tIDataspaceDataPlaneComponent\n} from \"@twin.org/dataspace-models\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"dataspaceDataPlaneSocketRoutes\";\n\n/**\n * The socket routes for the Dataspace Data Plane.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateSocketRoutesDataspaceDataPlane(\n\tbaseRouteName: string,\n\tcomponentName: string\n): ISocketRoute[] {\n\tconst activityLogStatusWsRoute: ISocketRoute<\n\t\tIActivityLogStatusRequest,\n\t\tIActivityLogStatusNotificationPayload\n\t> = {\n\t\toperationId: \"statusQuery\",\n\t\tpath: `${baseRouteName}/activity-logs/status`,\n\t\thandler: async (socketRequestContext, request, emitter) =>\n\t\t\tactivityLogStatusUpdate(socketRequestContext, componentName, request, emitter),\n\t\tconnected: async socketRequestContext => activityLogStatusConnected(socketRequestContext),\n\t\tdisconnected: async socketRequestContext =>\n\t\t\tactivityLogStatusDisconnected(socketRequestContext, componentName)\n\t};\n\n\treturn [activityLogStatusWsRoute];\n}\n\n/**\n * Provides an status update.\n * @param socketRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @param emitter The emitter to send message back.\n * @returns The response object with additional http response properties.\n */\nexport async function activityLogStatusUpdate(\n\tsocketRequestContext: ISocketRequestContext,\n\tcomponentName: string,\n\trequest: IActivityLogStatusRequest,\n\temitter: (topic: string, response: IActivityLogStatusNotificationPayload) => Promise<void>\n): Promise<void> {\n\tGuards.object<IActivityLogStatusRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.body.operation), request.body.operation);\n\tGuards.stringValue(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body.subscriptionId),\n\t\trequest.body.subscriptionId\n\t);\n\n\tconst component = ComponentFactory.get<IDataspaceDataPlaneComponent>(componentName);\n\n\tswitch (request.body.operation) {\n\t\tcase \"subscribe\":\n\t\t\tawait component.subscribeToActivityLog(async event => {\n\t\t\t\tawait emitter(\"publish\", {\n\t\t\t\t\tbody: event\n\t\t\t\t});\n\t\t\t}, request.body.subscriptionId);\n\t\t\tbreak;\n\t\tcase \"unsubscribe\":\n\t\t\tawait component.unSubscribeToActivityLog(request.body.subscriptionId);\n\t\t\tbreak;\n\t}\n}\n\n/**\n * Executes when there is a disconnection.\n * @param socketRequestContext Socket Request Context\n * @param componentName Component name.\n */\nexport async function activityLogStatusDisconnected(\n\tsocketRequestContext: ISocketRequestContext,\n\tcomponentName: string\n): Promise<void> {\n\tconst logger = ComponentFactory.getIfExists<ILoggingComponent>(\n\t\tsocketRequestContext.loggingComponentType\n\t);\n\tconst component = ComponentFactory.get<IDataspaceDataPlaneComponent>(componentName);\n\n\tawait logger?.log({\n\t\tsource: ROUTES_SOURCE,\n\t\tlevel: \"debug\",\n\t\tmessage: \"activityLogStatusDisconnected\",\n\t\tdata: {\n\t\t\tsocketId: socketRequestContext.socketId\n\t\t}\n\t});\n\n\tawait component.unSubscribeToActivityLog(socketRequestContext.socketId);\n}\n\n/**\n * Executes when there is a disconnection.\n * @param socketRequestContext Socket Request Context\n */\nexport async function activityLogStatusConnected(\n\tsocketRequestContext: ISocketRequestContext\n): Promise<void> {\n\tconst logger = ComponentFactory.getIfExists<ILoggingComponent>(\n\t\tsocketRequestContext.loggingComponentType\n\t);\n\n\tawait logger?.log({\n\t\tsource: ROUTES_SOURCE,\n\t\tlevel: \"debug\",\n\t\tmessage: \"activityLogStatusConnected\",\n\t\tdata: {\n\t\t\tsocketId: socketRequestContext.socketId\n\t\t}\n\t});\n}\n"]}
1
+ {"version":3,"file":"dataspaceDataPlaneSocketRoutes.js","s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2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISocketRequestContext, ISocketRoute } from \"@twin.org/api-models\";\nimport { ComponentFactory, Guards } from \"@twin.org/core\";\nimport type {\n\tIActivityLogStatusNotificationPayload,\n\tIActivityLogStatusRequest,\n\tIDataspaceDataPlaneComponent\n} from \"@twin.org/dataspace-models\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"dataspaceDataPlaneSocketRoutes\";\n\n/**\n * The socket routes for the Dataspace Data Plane.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateSocketRoutesDataspaceDataPlane(\n\tbaseRouteName: string,\n\tcomponentName: string\n): ISocketRoute[] {\n\tconst activityLogStatusWsRoute: ISocketRoute<\n\t\tIActivityLogStatusRequest,\n\t\tIActivityLogStatusNotificationPayload\n\t> = {\n\t\toperationId: \"statusQuery\",\n\t\tpath: `${baseRouteName}/activity-logs/status`,\n\t\thandler: async (socketRequestContext, request, emitter) =>\n\t\t\tactivityLogStatusUpdate(socketRequestContext, componentName, request, emitter),\n\t\tconnected: async socketRequestContext => activityLogStatusConnected(socketRequestContext),\n\t\tdisconnected: async socketRequestContext =>\n\t\t\tactivityLogStatusDisconnected(socketRequestContext, componentName)\n\t};\n\n\treturn [activityLogStatusWsRoute];\n}\n\n/**\n * Handles an activity log subscribe or unsubscribe operation over a WebSocket.\n * @param socketRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @param emitter The emitter to send message back.\n * @returns A promise that resolves when the subscribe or unsubscribe operation is complete.\n */\nexport async function activityLogStatusUpdate(\n\tsocketRequestContext: ISocketRequestContext,\n\tcomponentName: string,\n\trequest: IActivityLogStatusRequest,\n\temitter: (topic: string, response: IActivityLogStatusNotificationPayload) => Promise<void>\n): Promise<void> {\n\tGuards.object<IActivityLogStatusRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.body.operation), request.body.operation);\n\tGuards.stringValue(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body.subscriptionId),\n\t\trequest.body.subscriptionId\n\t);\n\n\tconst component = ComponentFactory.get<IDataspaceDataPlaneComponent>(componentName);\n\n\tswitch (request.body.operation) {\n\t\tcase \"subscribe\":\n\t\t\tawait component.subscribeToActivityLog(async event => {\n\t\t\t\tawait emitter(\"publish\", {\n\t\t\t\t\tbody: event\n\t\t\t\t});\n\t\t\t}, request.body.subscriptionId);\n\t\t\tbreak;\n\t\tcase \"unsubscribe\":\n\t\t\tawait component.unSubscribeToActivityLog(request.body.subscriptionId);\n\t\t\tbreak;\n\t}\n}\n\n/**\n * Executes when there is a disconnection.\n * @param socketRequestContext Socket Request Context\n * @param componentName Component name.\n * @returns A promise that resolves when the socket subscription has been removed.\n */\nexport async function activityLogStatusDisconnected(\n\tsocketRequestContext: ISocketRequestContext,\n\tcomponentName: string\n): Promise<void> {\n\tconst logger = ComponentFactory.getIfExists<ILoggingComponent>(\n\t\tsocketRequestContext.loggingComponentType\n\t);\n\tconst component = ComponentFactory.get<IDataspaceDataPlaneComponent>(componentName);\n\n\tawait logger?.log({\n\t\tsource: ROUTES_SOURCE,\n\t\tlevel: \"debug\",\n\t\tmessage: \"activityLogStatusDisconnected\",\n\t\tdata: {\n\t\t\tsocketId: socketRequestContext.socketId\n\t\t}\n\t});\n\n\tawait component.unSubscribeToActivityLog(socketRequestContext.socketId);\n}\n\n/**\n * Executes when a new socket connection is established.\n * @param socketRequestContext Socket Request Context\n * @returns A promise that resolves when the connection event has been logged.\n */\nexport async function activityLogStatusConnected(\n\tsocketRequestContext: ISocketRequestContext\n): Promise<void> {\n\tconst logger = ComponentFactory.getIfExists<ILoggingComponent>(\n\t\tsocketRequestContext.loggingComponentType\n\t);\n\n\tawait logger?.log({\n\t\tsource: ROUTES_SOURCE,\n\t\tlevel: \"debug\",\n\t\tmessage: \"activityLogStatusConnected\",\n\t\tdata: {\n\t\t\tsocketId: socketRequestContext.socketId\n\t\t}\n\t});\n}\n"]}
@@ -6,13 +6,22 @@ import { entity, property, SortDirection } from "@twin.org/entity";
6
6
  * Primary key = consumerPid (same as TransferProcess).
7
7
  */
8
8
  let PushSubscription = class PushSubscription {
9
+ /**
10
+ * Consumer process ID identifying the transfer. Also the primary key for this entity.
11
+ */
9
12
  consumerPid;
13
+ /**
14
+ * Provider process ID from the DSP Transfer Process.
15
+ */
10
16
  providerPid;
11
17
  /**
12
18
  * ID of the Follow activity that created this subscription.
13
19
  * Used by Undo to reference it on teardown.
14
20
  */
15
21
  followActivityId;
22
+ /**
23
+ * Dataset ID identifying which dataset is being delivered.
24
+ */
16
25
  datasetId;
17
26
  /**
18
27
  * The tenant that owns this subscription, captured from the request context at
@@ -21,13 +30,23 @@ let PushSubscription = class PushSubscription {
21
30
  * into `consumerEndpoint` so cross-node push deliveries route to the right tenant.
22
31
  */
23
32
  tenantId;
33
+ /**
34
+ * The consumer's /inbox endpoint URL where activities are POSTed.
35
+ */
24
36
  consumerEndpoint;
37
+ /**
38
+ * Pre-packaged bearer token for authenticating pushes to the consumer endpoint.
39
+ * When absent a fresh JWT is generated at delivery time.
40
+ */
25
41
  consumerAuthToken;
26
42
  /**
27
43
  * When true deliveries are skipped (transfer SUSPENDED).
28
44
  * When false deliveries are flowing normally.
29
45
  */
30
46
  paused;
47
+ /**
48
+ * Creation timestamp (ISO string format).
49
+ */
31
50
  dateCreated;
32
51
  /**
33
52
  * Last-modified timestamp. Updated on suspend/resume (when `paused` flips) and on
@@ -1 +1 @@
1
- {"version":3,"file":"pushSubscription.js","sourceRoot":"","sources":["../../../src/entities/pushSubscription.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB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E;GACI,gBAAgB,CAiD5B","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\n\n/**\n * Persists a push subscription. One row per active push transfer.\n * Primary key = consumerPid (same as TransferProcess).\n */\n@entity()\nexport class PushSubscription {\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic consumerPid!: string;\n\n\t@property({ type: \"string\" })\n\tpublic providerPid!: string;\n\n\t/**\n\t * ID of the Follow activity that created this subscription.\n\t * Used by Undo to reference it on teardown.\n\t */\n\t@property({ type: \"string\" })\n\tpublic followActivityId!: string;\n\n\t@property({ type: \"string\" })\n\tpublic datasetId!: string;\n\n\t/**\n\t * The tenant that owns this subscription, captured from the request context at\n\t * write time. Optional — single-tenant nodes (no `TWIN_TENANT_ENABLED`) register\n\t * subscriptions without a tenant context. The encrypted tenant token is also baked\n\t * into `consumerEndpoint` so cross-node push deliveries route to the right tenant.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic tenantId?: string;\n\n\t@property({ type: \"string\" })\n\tpublic consumerEndpoint!: string;\n\n\t@property({ type: \"string\", optional: true })\n\tpublic consumerAuthToken?: string;\n\n\t/**\n\t * When true deliveries are skipped (transfer SUSPENDED).\n\t * When false deliveries are flowing normally.\n\t */\n\t@property({ type: \"boolean\" })\n\tpublic paused!: boolean;\n\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * Last-modified timestamp. Updated on suspend/resume (when `paused` flips) and on\n\t * any subscription mutation. Matches the codebase convention of pairing `dateCreated`\n\t * with `dateModified` on entities whose state mutates.\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n}\n"]}
1
+ {"version":3,"file":"pushSubscription.js","sourceRoot":"","sources":["../../../src/entities/pushSubscription.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,M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;AAQrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;;sDACrB;AAnEjB,gBAAgB;IAD5B,MAAM,EAAE;GACI,gBAAgB,CAoE5B","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\n\n/**\n * Persists a push subscription. One row per active push transfer.\n * Primary key = consumerPid (same as TransferProcess).\n */\n@entity()\nexport class PushSubscription {\n\t/**\n\t * Consumer process ID identifying the transfer. Also the primary key for this entity.\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic consumerPid!: string;\n\n\t/**\n\t * Provider process ID from the DSP Transfer Process.\n\t */\n\t@property({ type: \"string\" })\n\tpublic providerPid!: string;\n\n\t/**\n\t * ID of the Follow activity that created this subscription.\n\t * Used by Undo to reference it on teardown.\n\t */\n\t@property({ type: \"string\" })\n\tpublic followActivityId!: string;\n\n\t/**\n\t * Dataset ID identifying which dataset is being delivered.\n\t */\n\t@property({ type: \"string\" })\n\tpublic datasetId!: string;\n\n\t/**\n\t * The tenant that owns this subscription, captured from the request context at\n\t * write time. Optional — single-tenant nodes (no `TWIN_TENANT_ENABLED`) register\n\t * subscriptions without a tenant context. The encrypted tenant token is also baked\n\t * into `consumerEndpoint` so cross-node push deliveries route to the right tenant.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic tenantId?: string;\n\n\t/**\n\t * The consumer's /inbox endpoint URL where activities are POSTed.\n\t */\n\t@property({ type: \"string\" })\n\tpublic consumerEndpoint!: string;\n\n\t/**\n\t * Pre-packaged bearer token for authenticating pushes to the consumer endpoint.\n\t * When absent a fresh JWT is generated at delivery time.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic consumerAuthToken?: string;\n\n\t/**\n\t * When true deliveries are skipped (transfer SUSPENDED).\n\t * When false deliveries are flowing normally.\n\t */\n\t@property({ type: \"boolean\" })\n\tpublic paused!: boolean;\n\n\t/**\n\t * Creation timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * Last-modified timestamp. Updated on suspend/resume (when `paused` flips) and on\n\t * any subscription mutation. Matches the codebase convention of pairing `dateCreated`\n\t * with `dateModified` on entities whose state mutates.\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n}\n"]}
@@ -1,4 +1,8 @@
1
1
  import { generateRestRoutesDataspaceDataPlane, tagsDataspaceDataPlane } from "./dataspaceDataPlaneRoutes.js";
2
+ /**
3
+ * Entry points for the REST API.
4
+ * Defines REST routes for the Dataspace Data Plane.
5
+ */
2
6
  export const restEntryPoints = [
3
7
  {
4
8
  name: "dataspace-data-plane",
@@ -1 +1 @@
1
- {"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport {\n\tgenerateRestRoutesDataspaceDataPlane,\n\ttagsDataspaceDataPlane\n} from \"./dataspaceDataPlaneRoutes.js\";\n\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"dataspace-data-plane\",\n\t\tdefaultBaseRoute: \"dataspace-data-plane\",\n\t\ttags: tagsDataspaceDataPlane,\n\t\tgenerateRoutes: generateRestRoutesDataspaceDataPlane\n\t}\n];\n"]}
1
+ {"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport {\n\tgenerateRestRoutesDataspaceDataPlane,\n\ttagsDataspaceDataPlane\n} from \"./dataspaceDataPlaneRoutes.js\";\n\n/**\n * Entry points for the REST API.\n * Defines REST routes for the Dataspace Data Plane.\n */\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"dataspace-data-plane\",\n\t\tdefaultBaseRoute: \"dataspace-data-plane\",\n\t\ttags: tagsDataspaceDataPlane,\n\t\tgenerateRoutes: generateRestRoutesDataspaceDataPlane\n\t}\n];\n"]}
@@ -1,5 +1,9 @@
1
1
  import { tagsDataspaceDataPlane } from "./dataspaceDataPlaneRoutes.js";
2
2
  import { generateSocketRoutesDataspaceDataPlane } from "./dataspaceDataPlaneSocketRoutes.js";
3
+ /**
4
+ * Entry points for the WebSocket API.
5
+ * Defines socket routes for the Dataspace Data Plane activity log subscription.
6
+ */
3
7
  export const socketEntryPoints = [
4
8
  {
5
9
  name: "dataspace-data-plane",
@@ -1 +1 @@
1
- {"version":3,"file":"socketEntryPoints.js","sourceRoot":"","sources":["../../src/socketEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sCAAsC,EAAE,MAAM,qCAAqC,CAAC;AAE7F,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IAC1D;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,sCAAsC;KACtD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISocketRouteEntryPoint } from \"@twin.org/api-models\";\nimport { tagsDataspaceDataPlane } from \"./dataspaceDataPlaneRoutes.js\";\nimport { generateSocketRoutesDataspaceDataPlane } from \"./dataspaceDataPlaneSocketRoutes.js\";\n\nexport const socketEntryPoints: ISocketRouteEntryPoint[] = [\n\t{\n\t\tname: \"dataspace-data-plane\",\n\t\tdefaultBaseRoute: \"dataspace-data-plane\",\n\t\ttags: tagsDataspaceDataPlane,\n\t\tgenerateRoutes: generateSocketRoutesDataspaceDataPlane\n\t}\n];\n"]}
1
+ {"version":3,"file":"socketEntryPoints.js","sourceRoot":"","sources":["../../src/socketEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sCAAsC,EAAE,MAAM,qCAAqC,CAAC;AAE7F;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IAC1D;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,sCAAsC;KACtD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISocketRouteEntryPoint } from \"@twin.org/api-models\";\nimport { tagsDataspaceDataPlane } from \"./dataspaceDataPlaneRoutes.js\";\nimport { generateSocketRoutesDataspaceDataPlane } from \"./dataspaceDataPlaneSocketRoutes.js\";\n\n/**\n * Entry points for the WebSocket API.\n * Defines socket routes for the Dataspace Data Plane activity log subscription.\n */\nexport const socketEntryPoints: ISocketRouteEntryPoint[] = [\n\t{\n\t\tname: \"dataspace-data-plane\",\n\t\tdefaultBaseRoute: \"dataspace-data-plane\",\n\t\ttags: tagsDataspaceDataPlane,\n\t\tgenerateRoutes: generateSocketRoutesDataspaceDataPlane\n\t}\n];\n"]}
@@ -27,6 +27,7 @@ export declare class DataspaceDataPlaneService implements IDataspaceDataPlaneCom
27
27
  /**
28
28
  * The service needs to be started when the application is initialized.
29
29
  * @param nodeLoggingComponentType The node logging component type.
30
+ * @returns A promise that resolves when the push-delivery handler and cleanup task are registered.
30
31
  */
31
32
  start(nodeLoggingComponentType?: string): Promise<void>;
32
33
  /**
@@ -44,17 +45,21 @@ export declare class DataspaceDataPlaneService implements IDataspaceDataPlaneCom
44
45
  */
45
46
  subscribeToActivityLog(callback: (notification: IActivityLogStatusNotification) => Promise<void>, subscriptionId?: string): Promise<string>;
46
47
  /**
47
- * Subscribes to the activity log.
48
- * @param subscriptionId The Subscription Id.
48
+ * Unsubscribes from the activity log.
49
+ * @param subscriptionId The subscription Id to remove.
50
+ * @returns A promise that resolves when the subscription has been removed.
49
51
  */
50
52
  unSubscribeToActivityLog(subscriptionId: string): Promise<void>;
51
53
  /**
52
- * Returns the activity processing details of an activity.
54
+ * Returns Activity Log Entry which contains the Activity processing details.
55
+ * Verifies the trust payload and asserts the caller is the entry's generator.
53
56
  * @param logEntryId The Id of the Activity Log Entry (a URI).
57
+ * @param trustPayload Trust payload to verify the requester's identity.
54
58
  * @returns the Activity Log Entry with the processing details.
55
59
  * @throws NotFoundError if activity log entry is not known.
60
+ * @throws UnauthorizedError if trustPayload is absent or the verified identity is not the entry generator.
56
61
  */
57
- getActivityLogEntry(logEntryId: string): Promise<IActivityLogEntry>;
62
+ getActivityLogEntry(logEntryId: string, trustPayload?: unknown): Promise<IActivityLogEntry>;
58
63
  /**
59
64
  * Get Data Asset entities. Allows to retrieve entities by their type or id.
60
65
  * @param entitySet The set of entities to be retrieved.
@@ -120,6 +125,7 @@ export declare class DataspaceDataPlaneService implements IDataspaceDataPlaneCom
120
125
  /**
121
126
  * Schedule a push delivery when the app has new outbound data.
122
127
  * @param activity The outbound activity carrying the data payload.
128
+ * @returns A promise that resolves when the push delivery task has been scheduled.
123
129
  */
124
130
  processOutboxActivity(activity: IActivityStreamsActivity): Promise<void>;
125
131
  }
@@ -8,22 +8,24 @@ import type { IActivityLogStatusNotificationPayload, IActivityLogStatusRequest }
8
8
  */
9
9
  export declare function generateSocketRoutesDataspaceDataPlane(baseRouteName: string, componentName: string): ISocketRoute[];
10
10
  /**
11
- * Provides an status update.
11
+ * Handles an activity log subscribe or unsubscribe operation over a WebSocket.
12
12
  * @param socketRequestContext The request context for the API.
13
13
  * @param componentName The name of the component to use in the routes.
14
14
  * @param request The request.
15
15
  * @param emitter The emitter to send message back.
16
- * @returns The response object with additional http response properties.
16
+ * @returns A promise that resolves when the subscribe or unsubscribe operation is complete.
17
17
  */
18
18
  export declare function activityLogStatusUpdate(socketRequestContext: ISocketRequestContext, componentName: string, request: IActivityLogStatusRequest, emitter: (topic: string, response: IActivityLogStatusNotificationPayload) => Promise<void>): Promise<void>;
19
19
  /**
20
20
  * Executes when there is a disconnection.
21
21
  * @param socketRequestContext Socket Request Context
22
22
  * @param componentName Component name.
23
+ * @returns A promise that resolves when the socket subscription has been removed.
23
24
  */
24
25
  export declare function activityLogStatusDisconnected(socketRequestContext: ISocketRequestContext, componentName: string): Promise<void>;
25
26
  /**
26
- * Executes when there is a disconnection.
27
+ * Executes when a new socket connection is established.
27
28
  * @param socketRequestContext Socket Request Context
29
+ * @returns A promise that resolves when the connection event has been logged.
28
30
  */
29
31
  export declare function activityLogStatusConnected(socketRequestContext: ISocketRequestContext): Promise<void>;
@@ -3,13 +3,22 @@
3
3
  * Primary key = consumerPid (same as TransferProcess).
4
4
  */
5
5
  export declare class PushSubscription {
6
+ /**
7
+ * Consumer process ID identifying the transfer. Also the primary key for this entity.
8
+ */
6
9
  consumerPid: string;
10
+ /**
11
+ * Provider process ID from the DSP Transfer Process.
12
+ */
7
13
  providerPid: string;
8
14
  /**
9
15
  * ID of the Follow activity that created this subscription.
10
16
  * Used by Undo to reference it on teardown.
11
17
  */
12
18
  followActivityId: string;
19
+ /**
20
+ * Dataset ID identifying which dataset is being delivered.
21
+ */
13
22
  datasetId: string;
14
23
  /**
15
24
  * The tenant that owns this subscription, captured from the request context at
@@ -18,13 +27,23 @@ export declare class PushSubscription {
18
27
  * into `consumerEndpoint` so cross-node push deliveries route to the right tenant.
19
28
  */
20
29
  tenantId?: string;
30
+ /**
31
+ * The consumer's /inbox endpoint URL where activities are POSTed.
32
+ */
21
33
  consumerEndpoint: string;
34
+ /**
35
+ * Pre-packaged bearer token for authenticating pushes to the consumer endpoint.
36
+ * When absent a fresh JWT is generated at delivery time.
37
+ */
22
38
  consumerAuthToken?: string;
23
39
  /**
24
40
  * When true deliveries are skipped (transfer SUSPENDED).
25
41
  * When false deliveries are flowing normally.
26
42
  */
27
43
  paused: boolean;
44
+ /**
45
+ * Creation timestamp (ISO string format).
46
+ */
28
47
  dateCreated: string;
29
48
  /**
30
49
  * Last-modified timestamp. Updated on suspend/resume (when `paused` flips) and on
@@ -1,2 +1,6 @@
1
1
  import type { IRestRouteEntryPoint } from "@twin.org/api-models";
2
+ /**
3
+ * Entry points for the REST API.
4
+ * Defines REST routes for the Dataspace Data Plane.
5
+ */
2
6
  export declare const restEntryPoints: IRestRouteEntryPoint[];
@@ -1,2 +1,6 @@
1
1
  import type { ISocketRouteEntryPoint } from "@twin.org/api-models";
2
+ /**
3
+ * Entry points for the WebSocket API.
4
+ * Defines socket routes for the Dataspace Data Plane activity log subscription.
5
+ */
2
6
  export declare const socketEntryPoints: ISocketRouteEntryPoint[];
package/docs/changelog.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.45](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-service-v0.0.3-next.44...dataspace-data-plane-service-v0.0.3-next.45) (2026-06-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * get activity log add trust payload ([#201](https://github.com/iotaledger/twin-dataspace/issues/201)) ([cdb5486](https://github.com/iotaledger/twin-dataspace/commit/cdb5486942c1b94ddf6435236b9b9d190bea0407))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove incorrect comment ([c846908](https://github.com/iotaledger/twin-dataspace/commit/c846908c4c20a7ea4fb7184739b524a95b5086db))
14
+ * use async getStore in tests ([739531e](https://github.com/iotaledger/twin-dataspace/commit/739531e1a159f728301835cd39cf06eab7a7bf4a))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * The following workspace dependencies were updated
20
+ * dependencies
21
+ * @twin.org/dataspace-app-runner bumped from 0.0.3-next.44 to 0.0.3-next.45
22
+ * @twin.org/dataspace-models bumped from 0.0.3-next.44 to 0.0.3-next.45
23
+ * devDependencies
24
+ * @twin.org/dataspace-test-app bumped from 0.0.3-next.44 to 0.0.3-next.45
25
+
3
26
  ## [0.0.3-next.44](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-service-v0.0.3-next.43...dataspace-data-plane-service-v0.0.3-next.44) (2026-06-12)
4
27
 
5
28
 
@@ -138,16 +138,20 @@
138
138
  },
139
139
  "style": "simple",
140
140
  "example": "urn:x-activity-log:1234567"
141
- }
142
- ],
143
- "security": [
141
+ },
144
142
  {
145
- "jwtBearerAuthScheme": []
143
+ "name": "authorization",
144
+ "in": "header",
145
+ "required": true,
146
+ "schema": {
147
+ "type": "string"
148
+ },
149
+ "style": "simple"
146
150
  }
147
151
  ],
148
152
  "responses": {
149
153
  "200": {
150
- "description": "Service Offering response",
154
+ "description": "Response containing a single activity log entry.",
151
155
  "content": {
152
156
  "application/json": {
153
157
  "schema": {
@@ -195,24 +199,6 @@
195
199
  }
196
200
  }
197
201
  },
198
- "401": {
199
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
200
- "content": {
201
- "application/json": {
202
- "schema": {
203
- "$ref": "#/components/schemas/Error"
204
- },
205
- "examples": {
206
- "exampleResponse": {
207
- "value": {
208
- "name": "UnauthorizedError",
209
- "message": "errorMessage"
210
- }
211
- }
212
- }
213
- }
214
- }
215
- },
216
202
  "500": {
217
203
  "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
218
204
  "content": {
@@ -80,6 +80,8 @@ The node logging component type.
80
80
 
81
81
  `Promise`\<`void`\>
82
82
 
83
+ A promise that resolves when the push-delivery handler and cleanup task are registered.
84
+
83
85
  #### Implementation of
84
86
 
85
87
  `IDataspaceDataPlaneComponent.start`
@@ -154,7 +156,7 @@ The subscription Id.
154
156
 
155
157
  > **unSubscribeToActivityLog**(`subscriptionId`): `Promise`\<`void`\>
156
158
 
157
- Subscribes to the activity log.
159
+ Unsubscribes from the activity log.
158
160
 
159
161
  #### Parameters
160
162
 
@@ -162,12 +164,14 @@ Subscribes to the activity log.
162
164
 
163
165
  `string`
164
166
 
165
- The Subscription Id.
167
+ The subscription Id to remove.
166
168
 
167
169
  #### Returns
168
170
 
169
171
  `Promise`\<`void`\>
170
172
 
173
+ A promise that resolves when the subscription has been removed.
174
+
171
175
  #### Implementation of
172
176
 
173
177
  `IDataspaceDataPlaneComponent.unSubscribeToActivityLog`
@@ -176,9 +180,10 @@ The Subscription Id.
176
180
 
177
181
  ### getActivityLogEntry() {#getactivitylogentry}
178
182
 
179
- > **getActivityLogEntry**(`logEntryId`): `Promise`\<`IActivityLogEntry`\>
183
+ > **getActivityLogEntry**(`logEntryId`, `trustPayload?`): `Promise`\<`IActivityLogEntry`\>
180
184
 
181
- Returns the activity processing details of an activity.
185
+ Returns Activity Log Entry which contains the Activity processing details.
186
+ Verifies the trust payload and asserts the caller is the entry's generator.
182
187
 
183
188
  #### Parameters
184
189
 
@@ -188,6 +193,12 @@ Returns the activity processing details of an activity.
188
193
 
189
194
  The Id of the Activity Log Entry (a URI).
190
195
 
196
+ ##### trustPayload?
197
+
198
+ `unknown`
199
+
200
+ Trust payload to verify the requester's identity.
201
+
191
202
  #### Returns
192
203
 
193
204
  `Promise`\<`IActivityLogEntry`\>
@@ -198,6 +209,10 @@ the Activity Log Entry with the processing details.
198
209
 
199
210
  NotFoundError if activity log entry is not known.
200
211
 
212
+ #### Throws
213
+
214
+ UnauthorizedError if trustPayload is absent or the verified identity is not the entry generator.
215
+
201
216
  #### Implementation of
202
217
 
203
218
  `IDataspaceDataPlaneComponent.getActivityLogEntry`
@@ -470,6 +485,8 @@ The outbound activity carrying the data payload.
470
485
 
471
486
  `Promise`\<`void`\>
472
487
 
488
+ A promise that resolves when the push delivery task has been scheduled.
489
+
473
490
  #### Implementation of
474
491
 
475
492
  `IDataspaceDataPlaneComponent.processOutboxActivity`
@@ -19,12 +19,16 @@ Primary key = consumerPid (same as TransferProcess).
19
19
 
20
20
  > **consumerPid**: `string`
21
21
 
22
+ Consumer process ID identifying the transfer. Also the primary key for this entity.
23
+
22
24
  ***
23
25
 
24
26
  ### providerPid {#providerpid}
25
27
 
26
28
  > **providerPid**: `string`
27
29
 
30
+ Provider process ID from the DSP Transfer Process.
31
+
28
32
  ***
29
33
 
30
34
  ### followActivityId {#followactivityid}
@@ -40,6 +44,8 @@ Used by Undo to reference it on teardown.
40
44
 
41
45
  > **datasetId**: `string`
42
46
 
47
+ Dataset ID identifying which dataset is being delivered.
48
+
43
49
  ***
44
50
 
45
51
  ### tenantId? {#tenantid}
@@ -57,12 +63,17 @@ into `consumerEndpoint` so cross-node push deliveries route to the right tenant.
57
63
 
58
64
  > **consumerEndpoint**: `string`
59
65
 
66
+ The consumer's /inbox endpoint URL where activities are POSTed.
67
+
60
68
  ***
61
69
 
62
70
  ### consumerAuthToken? {#consumerauthtoken}
63
71
 
64
72
  > `optional` **consumerAuthToken?**: `string`
65
73
 
74
+ Pre-packaged bearer token for authenticating pushes to the consumer endpoint.
75
+ When absent a fresh JWT is generated at delivery time.
76
+
66
77
  ***
67
78
 
68
79
  ### paused {#paused}
@@ -78,6 +89,8 @@ When false deliveries are flowing normally.
78
89
 
79
90
  > **dateCreated**: `string`
80
91
 
92
+ Creation timestamp (ISO string format).
93
+
81
94
  ***
82
95
 
83
96
  ### dateModified {#datemodified}
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **activityLogStatusConnected**(`socketRequestContext`): `Promise`\<`void`\>
4
4
 
5
- Executes when there is a disconnection.
5
+ Executes when a new socket connection is established.
6
6
 
7
7
  ## Parameters
8
8
 
@@ -15,3 +15,5 @@ Socket Request Context
15
15
  ## Returns
16
16
 
17
17
  `Promise`\<`void`\>
18
+
19
+ A promise that resolves when the connection event has been logged.
@@ -21,3 +21,5 @@ Component name.
21
21
  ## Returns
22
22
 
23
23
  `Promise`\<`void`\>
24
+
25
+ A promise that resolves when the socket subscription has been removed.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **activityLogStatusUpdate**(`socketRequestContext`, `componentName`, `request`, `emitter`): `Promise`\<`void`\>
4
4
 
5
- Provides an status update.
5
+ Handles an activity log subscribe or unsubscribe operation over a WebSocket.
6
6
 
7
7
  ## Parameters
8
8
 
@@ -34,4 +34,4 @@ The emitter to send message back.
34
34
 
35
35
  `Promise`\<`void`\>
36
36
 
37
- The response object with additional http response properties.
37
+ A promise that resolves when the subscribe or unsubscribe operation is complete.
@@ -1,3 +1,6 @@
1
1
  # Variable: restEntryPoints
2
2
 
3
3
  > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
4
+
5
+ Entry points for the REST API.
6
+ Defines REST routes for the Dataspace Data Plane.
@@ -1,3 +1,6 @@
1
1
  # Variable: socketEntryPoints
2
2
 
3
3
  > `const` **socketEntryPoints**: `ISocketRouteEntryPoint`[]
4
+
5
+ Entry points for the WebSocket API.
6
+ Defines socket routes for the Dataspace Data Plane activity log subscription.
package/locales/en.json CHANGED
@@ -21,6 +21,7 @@
21
21
  "invalidProcessingGroupId": "Invalid processing group id \"{processingGroupId}\" specified in activity query",
22
22
  "missingHandleActivity": "Handler App \"{dataspaceAppId}\" does not export a \"handleActivity\" function",
23
23
  "pushSubscriptionNotFound": "Push subscription not found for consumerPid \"{notFoundId}\"",
24
+ "activityLogEntryNotAuthorized": "Unauthorised access to activity log entry — the verified identity is not the entry generator",
24
25
  "pushActivityNotAuthorized": "Unauthorized push activity — no matching STARTED transfer found for the activity generator",
25
26
  "pushActivityNotPermittedByPolicy": "Push activity rejected — the transfer's agreement (\"{agreementId}\") does not permit the activity for consumerPid \"{consumerPid}\"",
26
27
  "processOutboxActivityMultipleTo": "processOutboxActivity does not support multiple recipients — activity.to contains {count} values, expected exactly one consumerPid",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/dataspace-data-plane-service",
3
- "version": "0.0.3-next.44",
3
+ "version": "0.0.3-next.45",
4
4
  "description": "Processes activities and data requests while enforcing transfer and policy constraints in the data plane.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,8 +21,8 @@
21
21
  "@twin.org/crypto": "next",
22
22
  "@twin.org/data-core": "next",
23
23
  "@twin.org/data-json-ld": "next",
24
- "@twin.org/dataspace-app-runner": "0.0.3-next.44",
25
- "@twin.org/dataspace-models": "0.0.3-next.44",
24
+ "@twin.org/dataspace-app-runner": "0.0.3-next.45",
25
+ "@twin.org/dataspace-models": "0.0.3-next.45",
26
26
  "@twin.org/engine-models": "next",
27
27
  "@twin.org/entity": "next",
28
28
  "@twin.org/entity-storage-models": "next",