@twin.org/dataspace-data-plane-socket-client 0.0.3-next.25 → 0.0.3-next.27
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/dist/es/dataspaceDataPlaneSocketClient.js +1 -1
- package/dist/es/dataspaceDataPlaneSocketClient.js.map +1 -1
- package/dist/types/dataspaceDataPlaneSocketClient.d.ts +2 -2
- package/docs/changelog.md +82 -54
- package/docs/reference/classes/DataspaceDataPlaneSocketClient.md +3 -3
- package/package.json +4 -4
|
@@ -51,7 +51,7 @@ export class DataspaceDataPlaneSocketClient extends BaseSocketClient {
|
|
|
51
51
|
/**
|
|
52
52
|
* Notify an Activity to the Dataspace Activity Stream - implemented in REST Client.
|
|
53
53
|
* @param activity The Activity notified.
|
|
54
|
-
* @returns The
|
|
54
|
+
* @returns The activity's id or entry.
|
|
55
55
|
*/
|
|
56
56
|
async notifyActivity(activity) {
|
|
57
57
|
// This method is in the REST client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataspaceDataPlaneSocketClient.js","sourceRoot":"","sources":["../../src/dataspaceDataPlaneSocketClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,MAAM,EAEN,EAAE,EACF,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAgBxB;;GAEG;AACH,MAAM,OAAO,8BACZ,SAAQ,gBAAgB;IAGxB;;OAEG;IACI,MAAM,CAAU,UAAU,oCAAoD;IAErF;;;OAGG;IACK,MAAM,CAAU,mBAAmB,GAAG,cAAc,CAAC;IAE7D;;OAEG;IACK,MAAM,CAAU,0BAA0B,GAAG,sBAAsB,CAAC;IAE5E;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACc,yBAAy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BACxB,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,8BAA8B,CAAC,UAAU;wBACjD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;wBACd,OAAO,EAAE,UAAU;wBACnB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;wBACjC,IAAI,EAAE;4BACL,cAAc;yBACd;qBACD,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseSocketClient } from \"@twin.org/api-core\";\nimport type { IHttpResponse } from \"@twin.org/api-models\";\nimport {\n\tBaseError,\n\tComponentFactory,\n\tConverter,\n\tGuards,\n\ttype IError,\n\tIs,\n\tNotImplementedError,\n\tNotSupportedError,\n\tRandomHelper\n} from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type {\n\tIActivityLogEntry,\n\tIActivityLogStatusNotification,\n\tIActivityLogStatusRequest,\n\tIDataAssetItemListResult,\n\tIDataspaceDataPlaneComponent,\n\tIEntitySet,\n\tIFilteringQuery\n} from \"@twin.org/dataspace-models\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IActivityStreamsActivity } from \"@twin.org/standards-w3c-activity-streams\";\nimport type { IDataspaceDataPlaneSocketClientConstructorOptions } from \"./models/IDataspaceDataPlaneSocketClientConstructorOptions.js\";\n\n/**\n * Dataspace data plane client which publishes using REST API and websockets.\n */\nexport class DataspaceDataPlaneSocketClient\n\textends BaseSocketClient\n\timplements IDataspaceDataPlaneComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DataspaceDataPlaneSocketClient>();\n\n\t/**\n\t * The topic for activity log events.\n\t * @internal\n\t */\n\tprivate static readonly _ACTIVITY_LOG_TOPIC = \"activity-log\";\n\n\t/**\n\t * Activity processing details route.\n\t */\n\tprivate static readonly _ACTIVITY_LOG_STATUS_ROUTE = \"activity-logs/status\";\n\n\t/**\n\t * The logging service for information.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * Subscriptions to the events.\n\t * @internal\n\t */\n\tprivate readonly _activityLogSubscriptions: {\n\t\tsubscriptionId?: string;\n\t\tsubscriberCallbacks: {\n\t\t\t[subscriptionId: string]: (notification: IActivityLogStatusNotification) => Promise<void>;\n\t\t};\n\t};\n\n\t/**\n\t * Create a new instance of DataspaceDataPlaneSocketClient.\n\t * @param options Options for the client.\n\t */\n\tconstructor(options: IDataspaceDataPlaneSocketClientConstructorOptions) {\n\t\tsuper(nameof<DataspaceDataPlaneSocketClient>(), options?.config, \"dataspace-data-plane\");\n\n\t\tthis._activityLogSubscriptions = {\n\t\t\tsubscriberCallbacks: {}\n\t\t};\n\n\t\tthis._logging = ComponentFactory.getIfExists(options?.loggingComponentType ?? \"logging\");\n\n\t\tsuper.onEvent<IHttpResponse<IActivityLogStatusNotification>>(\"publish\", async data =>\n\t\t\tthis.incomingPublishActivityLog(data)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DataspaceDataPlaneSocketClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Notify an Activity to the Dataspace Activity Stream - implemented in REST Client.\n\t * @param activity The Activity notified.\n\t * @returns The Activity's identifier.\n\t */\n\tpublic async notifyActivity(activity: IActivityStreamsActivity): Promise<string> {\n\t\t// This method is in the REST client\n\t\tthrow new NotImplementedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notifyActivity\");\n\t}\n\n\t/**\n\t * Subscribes to the activity log.\n\t * @param callback The callback to be called when Activity Log is called.\n\t * @param subscriptionId The subscription Id.\n\t * @returns The subscription Id.\n\t */\n\tpublic async subscribeToActivityLog(\n\t\tcallback: (notification: IActivityLogStatusNotification) => Promise<void>,\n\t\tsubscriptionId?: string\n\t): Promise<string> {\n\t\tGuards.function(DataspaceDataPlaneSocketClient.CLASS_NAME, nameof(callback), callback);\n\n\t\tlet needsConnect = false;\n\n\t\t// If we don't yet have an activity log subscription id then create one.\n\t\t// we will also need to connect to the socket.\n\t\tif (!Is.stringValue(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\tthis._activityLogSubscriptions.subscriptionId = Converter.bytesToHex(\n\t\t\t\tRandomHelper.generate(16)\n\t\t\t);\n\t\t\tneedsConnect = true;\n\t\t}\n\n\t\t// Store the callback for the specific local subscription\n\t\tconst localSubscriptionId = subscriptionId ?? Converter.bytesToHex(RandomHelper.generate(16));\n\t\tthis._activityLogSubscriptions.subscriberCallbacks[localSubscriptionId] = callback;\n\n\t\t// If this the first subscription for the activity logs then send a subscribe to the socket.\n\t\tif (needsConnect && super.socketConnect()) {\n\t\t\tconst request: IActivityLogStatusRequest = {\n\t\t\t\tbody: {\n\t\t\t\t\toperation: \"subscribe\",\n\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t}\n\t\t\t};\n\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, request);\n\t\t}\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"subscribeActivityLogs\",\n\t\t\tdata: {\n\t\t\t\ttopic: DataspaceDataPlaneSocketClient._ACTIVITY_LOG_TOPIC,\n\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t}\n\t\t});\n\n\t\treturn localSubscriptionId;\n\t}\n\n\t/**\n\t * Unsubscribes to the activity log.\n\t * @param subscriptionId The subscription Id.\n\t * @returns The subscription Id.\n\t */\n\tpublic async unSubscribeToActivityLog(subscriptionId: string): Promise<void> {\n\t\tGuards.stringValue(\n\t\t\tDataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tnameof(subscriptionId),\n\t\t\tsubscriptionId\n\t\t);\n\n\t\tif (this._activityLogSubscriptions.subscriberCallbacks[subscriptionId]) {\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"unsubscribeActivityLogs\",\n\t\t\t\tdata: {\n\t\t\t\t\tsubscriptionId\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// We found the subscription id so remove it.\n\t\t\tdelete this._activityLogSubscriptions.subscriberCallbacks[subscriptionId];\n\n\t\t\t// If there are no more subscriptions for the activity logs then send an unsubscribe to the socket.\n\t\t\tif (super.socketConnect() && Is.stringValue(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\t\tconst request: IActivityLogStatusRequest = {\n\t\t\t\t\tbody: {\n\t\t\t\t\t\toperation: \"unsubscribe\",\n\t\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, request);\n\t\t\t}\n\t\t}\n\n\t\t// There are no more subscriptions so disconnect the socket\n\t\tif (Is.empty(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\tsuper.socketDisconnect();\n\t\t}\n\t}\n\n\t/**\n\t * Returns Activity Log Entry which contains the Activity processing details - implemented in REST Client.\n\t * @param logEntryId The Id of the Activity Log Entry (a URI).\n\t * @returns the Activity Log Entry with the processing details.\n\t * @throws NotFoundError if activity log entry is not known.\n\t */\n\tpublic async getActivityLogEntry(logEntryId: string): Promise<IActivityLogEntry> {\n\t\t// This method is in the REST client\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"getActivityLogEntry\"\n\t\t});\n\t}\n\n\t/**\n\t * Get Data Asset entities. Allows to retrieve entities by their type or id.\n\t * @param entitySet The set of entities to be retrieved.\n\t * @param entitySet.jsonLdContext The JSON-LD Context to be used to expand the referred entityType.\n\t * @param consumerPid The consumer Process ID from the DSP Transfer Process.\n\t * Used to resolve datasetId from the Transfer Process.\n\t * @param cursor Pagination details - cursor.\n\t * @param limit Pagination details - max number of entities.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns The item list and optional cursor for pagination via Link headers.\n\t */\n\tpublic async getDataAssetEntities(\n\t\tentitySet: IEntitySet & {\n\t\t\tjsonLdContext?: IJsonLdContextDefinitionElement[];\n\t\t},\n\t\tconsumerPid: string,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\ttrustPayload?: unknown\n\t): Promise<IDataAssetItemListResult> {\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"getDataAssetEntities\"\n\t\t});\n\t}\n\n\t/**\n\t * Queries a data asset controlled by this Dataspace App.\n\t * @param consumerPid The consumer Process ID from the DSP Transfer Process.\n\t * Used to resolve datasetId from the Transfer Process.\n\t * @param query The filtering query.\n\t * @param cursor Pagination details - cursor.\n\t * @param limit Pagination details - max number of entities.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns The item list and optional cursor for pagination via Link headers.\n\t */\n\tpublic async queryDataAsset(\n\t\tconsumerPid: string,\n\t\tquery: IFilteringQuery,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\ttrustPayload?: unknown\n\t): Promise<IDataAssetItemListResult> {\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"queryDataAsset\"\n\t\t});\n\t}\n\n\t/**\n\t * Handle the socket connection.\n\t */\n\tprotected async handleConnected(): Promise<void> {\n\t\t// The socket has reconnected so send subscribe requests\n\t\t// for all the current subscriptions\n\t\tif (\n\t\t\tObject.keys(this._activityLogSubscriptions.subscriberCallbacks).length > 0 &&\n\t\t\tIs.stringValue(this._activityLogSubscriptions.subscriptionId)\n\t\t) {\n\t\t\tconst subscribeEmit: IActivityLogStatusRequest = {\n\t\t\t\tbody: {\n\t\t\t\t\toperation: \"subscribe\",\n\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t}\n\t\t\t};\n\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, subscribeEmit);\n\t\t}\n\t}\n\n\t/**\n\t * Handle an error.\n\t * @param err The error to handle.\n\t */\n\tprotected async handleError(err: IError): Promise<void> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"error\",\n\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"socketConnect\",\n\t\t\terror: err\n\t\t});\n\t}\n\n\t/**\n\t * Handle an incoming publish event.\n\t * @param topic The incoming topic.\n\t * @param event The incoming data.\n\t * @internal\n\t */\n\tprivate async incomingPublishActivityLog(\n\t\tevent: IHttpResponse<IActivityLogStatusNotification>\n\t): Promise<void> {\n\t\tif (!Is.empty(event.body)) {\n\t\t\tfor (const subscriptionId in this._activityLogSubscriptions.subscriberCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tawait this._activityLogSubscriptions.subscriberCallbacks[subscriptionId](event.body);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\tmessage: \"callback\",\n\t\t\t\t\t\terror: BaseError.fromError(error),\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tsubscriptionId\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dataspaceDataPlaneSocketClient.js","sourceRoot":"","sources":["../../src/dataspaceDataPlaneSocketClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,MAAM,EAEN,EAAE,EACF,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAgBxB;;GAEG;AACH,MAAM,OAAO,8BACZ,SAAQ,gBAAgB;IAGxB;;OAEG;IACI,MAAM,CAAU,UAAU,oCAAoD;IAErF;;;OAGG;IACK,MAAM,CAAU,mBAAmB,GAAG,cAAc,CAAC;IAE7D;;OAEG;IACK,MAAM,CAAU,0BAA0B,GAAG,sBAAsB,CAAC;IAE5E;;;OAGG;IACc,QAAQ,CAAqB;IAE9C;;;OAGG;IACc,yBAAyB,CAKxC;IAEF;;;OAGG;IACH,YAAY,OAA0D;QACrE,KAAK,mCAA2C,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;QAEzF,IAAI,CAAC,yBAAyB,GAAG;YAChC,mBAAmB,EAAE,EAAE;SACvB,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,WAAW,CAAC,OAAO,EAAE,oBAAoB,IAAI,SAAS,CAAC,CAAC;QAEzF,KAAK,CAAC,OAAO,CAAgD,SAAS,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE,CACpF,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,CACrC,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,8BAA8B,CAAC,UAAU,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAC1B,QAAkC;QAElC,oCAAoC;QACpC,MAAM,IAAI,mBAAmB,CAAC,8BAA8B,CAAC,UAAU,EAAE,gBAAgB,CA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K,EAAE,OAAO;YACd,MAAM,EAAE,8BAA8B,CAAC,UAAU;YACjD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,eAAe;YACxB,KAAK,EAAE,GAAG;SACV,CAAC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,0BAA0B,CACvC,KAAoD;QAEpD,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,yBAAyB,CAAC,mBAAmB,EAAE,CAAC;gBACjF,IAAI,CAAC;oBACJ,MAAM,IAAI,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACtF,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;wBACxB,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,8BAA8B,CAAC,UAAU;wBACjD,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;wBACd,OAAO,EAAE,UAAU;wBACnB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;wBACjC,IAAI,EAAE;4BACL,cAAc;yBACd;qBACD,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseSocketClient } from \"@twin.org/api-core\";\nimport type { IHttpResponse } from \"@twin.org/api-models\";\nimport {\n\tBaseError,\n\tComponentFactory,\n\tConverter,\n\tGuards,\n\ttype IError,\n\tIs,\n\tNotImplementedError,\n\tNotSupportedError,\n\tRandomHelper\n} from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type {\n\tIActivityLogEntry,\n\tIActivityLogStatusNotification,\n\tIActivityLogStatusRequest,\n\tIDataAssetItemListResult,\n\tIDataspaceDataPlaneComponent,\n\tIEntitySet,\n\tIFilteringQuery\n} from \"@twin.org/dataspace-models\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IActivityStreamsActivity } from \"@twin.org/standards-w3c-activity-streams\";\nimport type { IDataspaceDataPlaneSocketClientConstructorOptions } from \"./models/IDataspaceDataPlaneSocketClientConstructorOptions.js\";\n\n/**\n * Dataspace data plane client which publishes using REST API and websockets.\n */\nexport class DataspaceDataPlaneSocketClient\n\textends BaseSocketClient\n\timplements IDataspaceDataPlaneComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DataspaceDataPlaneSocketClient>();\n\n\t/**\n\t * The topic for activity log events.\n\t * @internal\n\t */\n\tprivate static readonly _ACTIVITY_LOG_TOPIC = \"activity-log\";\n\n\t/**\n\t * Activity processing details route.\n\t */\n\tprivate static readonly _ACTIVITY_LOG_STATUS_ROUTE = \"activity-logs/status\";\n\n\t/**\n\t * The logging service for information.\n\t * @internal\n\t */\n\tprivate readonly _logging?: ILoggingComponent;\n\n\t/**\n\t * Subscriptions to the events.\n\t * @internal\n\t */\n\tprivate readonly _activityLogSubscriptions: {\n\t\tsubscriptionId?: string;\n\t\tsubscriberCallbacks: {\n\t\t\t[subscriptionId: string]: (notification: IActivityLogStatusNotification) => Promise<void>;\n\t\t};\n\t};\n\n\t/**\n\t * Create a new instance of DataspaceDataPlaneSocketClient.\n\t * @param options Options for the client.\n\t */\n\tconstructor(options: IDataspaceDataPlaneSocketClientConstructorOptions) {\n\t\tsuper(nameof<DataspaceDataPlaneSocketClient>(), options?.config, \"dataspace-data-plane\");\n\n\t\tthis._activityLogSubscriptions = {\n\t\t\tsubscriberCallbacks: {}\n\t\t};\n\n\t\tthis._logging = ComponentFactory.getIfExists(options?.loggingComponentType ?? \"logging\");\n\n\t\tsuper.onEvent<IHttpResponse<IActivityLogStatusNotification>>(\"publish\", async data =>\n\t\t\tthis.incomingPublishActivityLog(data)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DataspaceDataPlaneSocketClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Notify an Activity to the Dataspace Activity Stream - implemented in REST Client.\n\t * @param activity The Activity notified.\n\t * @returns The activity's id or entry.\n\t */\n\tpublic async notifyActivity(\n\t\tactivity: IActivityStreamsActivity\n\t): Promise<string | IActivityLogEntry> {\n\t\t// This method is in the REST client\n\t\tthrow new NotImplementedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notifyActivity\");\n\t}\n\n\t/**\n\t * Subscribes to the activity log.\n\t * @param callback The callback to be called when Activity Log is called.\n\t * @param subscriptionId The subscription Id.\n\t * @returns The subscription Id.\n\t */\n\tpublic async subscribeToActivityLog(\n\t\tcallback: (notification: IActivityLogStatusNotification) => Promise<void>,\n\t\tsubscriptionId?: string\n\t): Promise<string> {\n\t\tGuards.function(DataspaceDataPlaneSocketClient.CLASS_NAME, nameof(callback), callback);\n\n\t\tlet needsConnect = false;\n\n\t\t// If we don't yet have an activity log subscription id then create one.\n\t\t// we will also need to connect to the socket.\n\t\tif (!Is.stringValue(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\tthis._activityLogSubscriptions.subscriptionId = Converter.bytesToHex(\n\t\t\t\tRandomHelper.generate(16)\n\t\t\t);\n\t\t\tneedsConnect = true;\n\t\t}\n\n\t\t// Store the callback for the specific local subscription\n\t\tconst localSubscriptionId = subscriptionId ?? Converter.bytesToHex(RandomHelper.generate(16));\n\t\tthis._activityLogSubscriptions.subscriberCallbacks[localSubscriptionId] = callback;\n\n\t\t// If this the first subscription for the activity logs then send a subscribe to the socket.\n\t\tif (needsConnect && super.socketConnect()) {\n\t\t\tconst request: IActivityLogStatusRequest = {\n\t\t\t\tbody: {\n\t\t\t\t\toperation: \"subscribe\",\n\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t}\n\t\t\t};\n\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, request);\n\t\t}\n\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"subscribeActivityLogs\",\n\t\t\tdata: {\n\t\t\t\ttopic: DataspaceDataPlaneSocketClient._ACTIVITY_LOG_TOPIC,\n\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t}\n\t\t});\n\n\t\treturn localSubscriptionId;\n\t}\n\n\t/**\n\t * Unsubscribes to the activity log.\n\t * @param subscriptionId The subscription Id.\n\t * @returns The subscription Id.\n\t */\n\tpublic async unSubscribeToActivityLog(subscriptionId: string): Promise<void> {\n\t\tGuards.stringValue(\n\t\t\tDataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tnameof(subscriptionId),\n\t\t\tsubscriptionId\n\t\t);\n\n\t\tif (this._activityLogSubscriptions.subscriberCallbacks[subscriptionId]) {\n\t\t\tawait this._logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"unsubscribeActivityLogs\",\n\t\t\t\tdata: {\n\t\t\t\t\tsubscriptionId\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// We found the subscription id so remove it.\n\t\t\tdelete this._activityLogSubscriptions.subscriberCallbacks[subscriptionId];\n\n\t\t\t// If there are no more subscriptions for the activity logs then send an unsubscribe to the socket.\n\t\t\tif (super.socketConnect() && Is.stringValue(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\t\tconst request: IActivityLogStatusRequest = {\n\t\t\t\t\tbody: {\n\t\t\t\t\t\toperation: \"unsubscribe\",\n\t\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, request);\n\t\t\t}\n\t\t}\n\n\t\t// There are no more subscriptions so disconnect the socket\n\t\tif (Is.empty(this._activityLogSubscriptions.subscriptionId)) {\n\t\t\tsuper.socketDisconnect();\n\t\t}\n\t}\n\n\t/**\n\t * Returns Activity Log Entry which contains the Activity processing details - implemented in REST Client.\n\t * @param logEntryId The Id of the Activity Log Entry (a URI).\n\t * @returns the Activity Log Entry with the processing details.\n\t * @throws NotFoundError if activity log entry is not known.\n\t */\n\tpublic async getActivityLogEntry(logEntryId: string): Promise<IActivityLogEntry> {\n\t\t// This method is in the REST client\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"getActivityLogEntry\"\n\t\t});\n\t}\n\n\t/**\n\t * Get Data Asset entities. Allows to retrieve entities by their type or id.\n\t * @param entitySet The set of entities to be retrieved.\n\t * @param entitySet.jsonLdContext The JSON-LD Context to be used to expand the referred entityType.\n\t * @param consumerPid The consumer Process ID from the DSP Transfer Process.\n\t * Used to resolve datasetId from the Transfer Process.\n\t * @param cursor Pagination details - cursor.\n\t * @param limit Pagination details - max number of entities.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns The item list and optional cursor for pagination via Link headers.\n\t */\n\tpublic async getDataAssetEntities(\n\t\tentitySet: IEntitySet & {\n\t\t\tjsonLdContext?: IJsonLdContextDefinitionElement[];\n\t\t},\n\t\tconsumerPid: string,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\ttrustPayload?: unknown\n\t): Promise<IDataAssetItemListResult> {\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"getDataAssetEntities\"\n\t\t});\n\t}\n\n\t/**\n\t * Queries a data asset controlled by this Dataspace App.\n\t * @param consumerPid The consumer Process ID from the DSP Transfer Process.\n\t * Used to resolve datasetId from the Transfer Process.\n\t * @param query The filtering query.\n\t * @param cursor Pagination details - cursor.\n\t * @param limit Pagination details - max number of entities.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns The item list and optional cursor for pagination via Link headers.\n\t */\n\tpublic async queryDataAsset(\n\t\tconsumerPid: string,\n\t\tquery: IFilteringQuery,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\ttrustPayload?: unknown\n\t): Promise<IDataAssetItemListResult> {\n\t\tthrow new NotSupportedError(DataspaceDataPlaneSocketClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"queryDataAsset\"\n\t\t});\n\t}\n\n\t/**\n\t * Handle the socket connection.\n\t */\n\tprotected async handleConnected(): Promise<void> {\n\t\t// The socket has reconnected so send subscribe requests\n\t\t// for all the current subscriptions\n\t\tif (\n\t\t\tObject.keys(this._activityLogSubscriptions.subscriberCallbacks).length > 0 &&\n\t\t\tIs.stringValue(this._activityLogSubscriptions.subscriptionId)\n\t\t) {\n\t\t\tconst subscribeEmit: IActivityLogStatusRequest = {\n\t\t\t\tbody: {\n\t\t\t\t\toperation: \"subscribe\",\n\t\t\t\t\tsubscriptionId: this._activityLogSubscriptions.subscriptionId\n\t\t\t\t}\n\t\t\t};\n\t\t\tsuper.sendEvent(DataspaceDataPlaneSocketClient._ACTIVITY_LOG_STATUS_ROUTE, subscribeEmit);\n\t\t}\n\t}\n\n\t/**\n\t * Handle an error.\n\t * @param err The error to handle.\n\t */\n\tprotected async handleError(err: IError): Promise<void> {\n\t\tawait this._logging?.log({\n\t\t\tlevel: \"error\",\n\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"socketConnect\",\n\t\t\terror: err\n\t\t});\n\t}\n\n\t/**\n\t * Handle an incoming publish event.\n\t * @param topic The incoming topic.\n\t * @param event The incoming data.\n\t * @internal\n\t */\n\tprivate async incomingPublishActivityLog(\n\t\tevent: IHttpResponse<IActivityLogStatusNotification>\n\t): Promise<void> {\n\t\tif (!Is.empty(event.body)) {\n\t\t\tfor (const subscriptionId in this._activityLogSubscriptions.subscriberCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tawait this._activityLogSubscriptions.subscriberCallbacks[subscriptionId](event.body);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait this._logging?.log({\n\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\tsource: DataspaceDataPlaneSocketClient.CLASS_NAME,\n\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\tmessage: \"callback\",\n\t\t\t\t\t\terror: BaseError.fromError(error),\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tsubscriptionId\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -29,9 +29,9 @@ export declare class DataspaceDataPlaneSocketClient extends BaseSocketClient imp
|
|
|
29
29
|
/**
|
|
30
30
|
* Notify an Activity to the Dataspace Activity Stream - implemented in REST Client.
|
|
31
31
|
* @param activity The Activity notified.
|
|
32
|
-
* @returns The
|
|
32
|
+
* @returns The activity's id or entry.
|
|
33
33
|
*/
|
|
34
|
-
notifyActivity(activity: IActivityStreamsActivity): Promise<string>;
|
|
34
|
+
notifyActivity(activity: IActivityStreamsActivity): Promise<string | IActivityLogEntry>;
|
|
35
35
|
/**
|
|
36
36
|
* Subscribes to the activity log.
|
|
37
37
|
* @param callback The callback to be called when Activity Log is called.
|
package/docs/changelog.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.27](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.26...dataspace-data-plane-socket-client-v0.0.3-next.27) (2026-05-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **dataspace-data-plane-socket-client:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/dataspace-models bumped from 0.0.3-next.26 to 0.0.3-next.27
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.26](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.25...dataspace-data-plane-socket-client-v0.0.3-next.26) (2026-04-14)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add inline tasks and concurrent options ([#104](https://github.com/iotaledger/twin-dataspace/issues/104)) ([2227a21](https://github.com/iotaledger/twin-dataspace/commit/2227a212d906f58ba77850c79bb20bf2cb7195a8))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/dataspace-models bumped from 0.0.3-next.25 to 0.0.3-next.26
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.25](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.24...dataspace-data-plane-socket-client-v0.0.3-next.25) (2026-04-10)
|
|
4
32
|
|
|
5
33
|
|
|
6
34
|
### Miscellaneous Chores
|
|
@@ -14,7 +42,7 @@
|
|
|
14
42
|
* dependencies
|
|
15
43
|
* @twin.org/dataspace-models bumped from 0.0.3-next.24 to 0.0.3-next.25
|
|
16
44
|
|
|
17
|
-
## [0.0.3-next.24](https://github.com/
|
|
45
|
+
## [0.0.3-next.24](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.23...dataspace-data-plane-socket-client-v0.0.3-next.24) (2026-03-31)
|
|
18
46
|
|
|
19
47
|
|
|
20
48
|
### Miscellaneous Chores
|
|
@@ -28,7 +56,7 @@
|
|
|
28
56
|
* dependencies
|
|
29
57
|
* @twin.org/dataspace-models bumped from 0.0.3-next.23 to 0.0.3-next.24
|
|
30
58
|
|
|
31
|
-
## [0.0.3-next.23](https://github.com/
|
|
59
|
+
## [0.0.3-next.23](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.22...dataspace-data-plane-socket-client-v0.0.3-next.23) (2026-03-25)
|
|
32
60
|
|
|
33
61
|
|
|
34
62
|
### Miscellaneous Chores
|
|
@@ -42,7 +70,7 @@
|
|
|
42
70
|
* dependencies
|
|
43
71
|
* @twin.org/dataspace-models bumped from 0.0.3-next.22 to 0.0.3-next.23
|
|
44
72
|
|
|
45
|
-
## [0.0.3-next.22](https://github.com/
|
|
73
|
+
## [0.0.3-next.22](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.21...dataspace-data-plane-socket-client-v0.0.3-next.22) (2026-03-20)
|
|
46
74
|
|
|
47
75
|
|
|
48
76
|
### Miscellaneous Chores
|
|
@@ -56,12 +84,12 @@
|
|
|
56
84
|
* dependencies
|
|
57
85
|
* @twin.org/dataspace-models bumped from 0.0.3-next.21 to 0.0.3-next.22
|
|
58
86
|
|
|
59
|
-
## [0.0.3-next.21](https://github.com/
|
|
87
|
+
## [0.0.3-next.21](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.20...dataspace-data-plane-socket-client-v0.0.3-next.21) (2026-03-17)
|
|
60
88
|
|
|
61
89
|
|
|
62
90
|
### Features
|
|
63
91
|
|
|
64
|
-
* improve open-api examples ([1368dbe](https://github.com/
|
|
92
|
+
* improve open-api examples ([1368dbe](https://github.com/iotaledger/twin-dataspace/commit/1368dbed5c36e074b4854942304a19b9ce51e088))
|
|
65
93
|
|
|
66
94
|
|
|
67
95
|
### Dependencies
|
|
@@ -70,7 +98,7 @@
|
|
|
70
98
|
* dependencies
|
|
71
99
|
* @twin.org/dataspace-models bumped from 0.0.3-next.20 to 0.0.3-next.21
|
|
72
100
|
|
|
73
|
-
## [0.0.3-next.20](https://github.com/
|
|
101
|
+
## [0.0.3-next.20](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.19...dataspace-data-plane-socket-client-v0.0.3-next.20) (2026-03-17)
|
|
74
102
|
|
|
75
103
|
|
|
76
104
|
### Miscellaneous Chores
|
|
@@ -84,7 +112,7 @@
|
|
|
84
112
|
* dependencies
|
|
85
113
|
* @twin.org/dataspace-models bumped from 0.0.3-next.19 to 0.0.3-next.20
|
|
86
114
|
|
|
87
|
-
## [0.0.3-next.19](https://github.com/
|
|
115
|
+
## [0.0.3-next.19](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.18...dataspace-data-plane-socket-client-v0.0.3-next.19) (2026-03-12)
|
|
88
116
|
|
|
89
117
|
|
|
90
118
|
### Miscellaneous Chores
|
|
@@ -98,7 +126,7 @@
|
|
|
98
126
|
* dependencies
|
|
99
127
|
* @twin.org/dataspace-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
100
128
|
|
|
101
|
-
## [0.0.3-next.18](https://github.com/
|
|
129
|
+
## [0.0.3-next.18](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.17...dataspace-data-plane-socket-client-v0.0.3-next.18) (2026-03-09)
|
|
102
130
|
|
|
103
131
|
|
|
104
132
|
### Miscellaneous Chores
|
|
@@ -112,7 +140,7 @@
|
|
|
112
140
|
* dependencies
|
|
113
141
|
* @twin.org/dataspace-models bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
114
142
|
|
|
115
|
-
## [0.0.3-next.17](https://github.com/
|
|
143
|
+
## [0.0.3-next.17](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.16...dataspace-data-plane-socket-client-v0.0.3-next.17) (2026-03-06)
|
|
116
144
|
|
|
117
145
|
|
|
118
146
|
### Miscellaneous Chores
|
|
@@ -126,7 +154,7 @@
|
|
|
126
154
|
* dependencies
|
|
127
155
|
* @twin.org/dataspace-models bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
128
156
|
|
|
129
|
-
## [0.0.3-next.16](https://github.com/
|
|
157
|
+
## [0.0.3-next.16](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.15...dataspace-data-plane-socket-client-v0.0.3-next.16) (2026-03-02)
|
|
130
158
|
|
|
131
159
|
|
|
132
160
|
### Miscellaneous Chores
|
|
@@ -140,12 +168,12 @@
|
|
|
140
168
|
* dependencies
|
|
141
169
|
* @twin.org/dataspace-models bumped from 0.0.3-next.15 to 0.0.3-next.16
|
|
142
170
|
|
|
143
|
-
## [0.0.3-next.15](https://github.com/
|
|
171
|
+
## [0.0.3-next.15](https://github.com/iotaledger/twin-dataspace/compare/dataspace-data-plane-socket-client-v0.0.3-next.14...dataspace-data-plane-socket-client-v0.0.3-next.15) (2026-03-02)
|
|
144
172
|
|
|
145
173
|
|
|
146
174
|
### Features
|
|
147
175
|
|
|
148
|
-
* unification of the data exchange and the data space connector ([#57](https://github.com/
|
|
176
|
+
* unification of the data exchange and the data space connector ([#57](https://github.com/iotaledger/twin-dataspace/issues/57)) ([df2644d](https://github.com/iotaledger/twin-dataspace/commit/df2644d989471e07dadd83d27bef736179e31bf4))
|
|
149
177
|
|
|
150
178
|
|
|
151
179
|
### Dependencies
|
|
@@ -154,7 +182,7 @@
|
|
|
154
182
|
* dependencies
|
|
155
183
|
* @twin.org/dataspace-models bumped from 0.0.3-next.14 to 0.0.3-next.15
|
|
156
184
|
|
|
157
|
-
## [0.0.3-next.12](https://github.com/
|
|
185
|
+
## [0.0.3-next.12](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.11...dataspace-socket-client-v0.0.3-next.12) (2026-01-22)
|
|
158
186
|
|
|
159
187
|
|
|
160
188
|
### Miscellaneous Chores
|
|
@@ -168,7 +196,7 @@
|
|
|
168
196
|
* dependencies
|
|
169
197
|
* @twin.org/dataspace-models bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
170
198
|
|
|
171
|
-
## [0.0.3-next.11](https://github.com/
|
|
199
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.10...dataspace-socket-client-v0.0.3-next.11) (2026-01-22)
|
|
172
200
|
|
|
173
201
|
|
|
174
202
|
### Miscellaneous Chores
|
|
@@ -182,12 +210,12 @@
|
|
|
182
210
|
* dependencies
|
|
183
211
|
* @twin.org/dataspace-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
184
212
|
|
|
185
|
-
## [0.0.3-next.10](https://github.com/
|
|
213
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.9...dataspace-socket-client-v0.0.3-next.10) (2026-01-19)
|
|
186
214
|
|
|
187
215
|
|
|
188
216
|
### Features
|
|
189
217
|
|
|
190
|
-
* replace registerApp with factory pattern ([#51](https://github.com/
|
|
218
|
+
* replace registerApp with factory pattern ([#51](https://github.com/iotaledger/twin-dataspace/issues/51)) ([a7ef328](https://github.com/iotaledger/twin-dataspace/commit/a7ef32873f5781f7b1f8aa3670f5fb612dd17018))
|
|
191
219
|
|
|
192
220
|
|
|
193
221
|
### Dependencies
|
|
@@ -196,13 +224,13 @@
|
|
|
196
224
|
* dependencies
|
|
197
225
|
* @twin.org/dataspace-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
198
226
|
|
|
199
|
-
## [0.0.3-next.9](https://github.com/
|
|
227
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.8...dataspace-socket-client-v0.0.3-next.9) (2026-01-19)
|
|
200
228
|
|
|
201
229
|
|
|
202
230
|
### Features
|
|
203
231
|
|
|
204
|
-
* update data space connector to use trust service ([#47](https://github.com/
|
|
205
|
-
* update order of trustPayload parameter ([0656ddd](https://github.com/
|
|
232
|
+
* update data space connector to use trust service ([#47](https://github.com/iotaledger/twin-dataspace/issues/47)) ([41c5113](https://github.com/iotaledger/twin-dataspace/commit/41c5113512cdc477c2f9508b27dfaff84529d841))
|
|
233
|
+
* update order of trustPayload parameter ([0656ddd](https://github.com/iotaledger/twin-dataspace/commit/0656ddd328accda0370d979a6cb5f947071e700b))
|
|
206
234
|
|
|
207
235
|
|
|
208
236
|
### Dependencies
|
|
@@ -211,7 +239,7 @@
|
|
|
211
239
|
* dependencies
|
|
212
240
|
* @twin.org/dataspace-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
213
241
|
|
|
214
|
-
## [0.0.3-next.8](https://github.com/
|
|
242
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.7...dataspace-socket-client-v0.0.3-next.8) (2026-01-16)
|
|
215
243
|
|
|
216
244
|
|
|
217
245
|
### Miscellaneous Chores
|
|
@@ -225,12 +253,12 @@
|
|
|
225
253
|
* dependencies
|
|
226
254
|
* @twin.org/dataspace-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
227
255
|
|
|
228
|
-
## [0.0.3-next.7](https://github.com/
|
|
256
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.6...dataspace-socket-client-v0.0.3-next.7) (2026-01-16)
|
|
229
257
|
|
|
230
258
|
|
|
231
259
|
### Features
|
|
232
260
|
|
|
233
|
-
* implement Link headers for pagination ([#43](https://github.com/
|
|
261
|
+
* implement Link headers for pagination ([#43](https://github.com/iotaledger/twin-dataspace/issues/43)) ([ce2a31f](https://github.com/iotaledger/twin-dataspace/commit/ce2a31fab1b5a1338d34b8514e96a203705c68d1))
|
|
234
262
|
|
|
235
263
|
|
|
236
264
|
### Dependencies
|
|
@@ -239,7 +267,7 @@
|
|
|
239
267
|
* dependencies
|
|
240
268
|
* @twin.org/dataspace-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
241
269
|
|
|
242
|
-
## [0.0.3-next.6](https://github.com/
|
|
270
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.5...dataspace-socket-client-v0.0.3-next.6) (2026-01-15)
|
|
243
271
|
|
|
244
272
|
|
|
245
273
|
### Miscellaneous Chores
|
|
@@ -253,7 +281,7 @@
|
|
|
253
281
|
* dependencies
|
|
254
282
|
* @twin.org/dataspace-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
255
283
|
|
|
256
|
-
## [0.0.3-next.5](https://github.com/
|
|
284
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.4...dataspace-socket-client-v0.0.3-next.5) (2026-01-07)
|
|
257
285
|
|
|
258
286
|
|
|
259
287
|
### Miscellaneous Chores
|
|
@@ -267,12 +295,12 @@
|
|
|
267
295
|
* dependencies
|
|
268
296
|
* @twin.org/dataspace-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
269
297
|
|
|
270
|
-
## [0.0.3-next.4](https://github.com/
|
|
298
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.3...dataspace-socket-client-v0.0.3-next.4) (2026-01-06)
|
|
271
299
|
|
|
272
300
|
|
|
273
301
|
### Features
|
|
274
302
|
|
|
275
|
-
* update standards dependencies ([8534ad7](https://github.com/
|
|
303
|
+
* update standards dependencies ([8534ad7](https://github.com/iotaledger/twin-dataspace/commit/8534ad74b996610ed5994b5213c857989c2bf57a))
|
|
276
304
|
|
|
277
305
|
|
|
278
306
|
### Dependencies
|
|
@@ -281,7 +309,7 @@
|
|
|
281
309
|
* dependencies
|
|
282
310
|
* @twin.org/dataspace-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
283
311
|
|
|
284
|
-
## [0.0.3-next.3](https://github.com/
|
|
312
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.2...dataspace-socket-client-v0.0.3-next.3) (2025-12-01)
|
|
285
313
|
|
|
286
314
|
|
|
287
315
|
### Miscellaneous Chores
|
|
@@ -295,12 +323,12 @@
|
|
|
295
323
|
* dependencies
|
|
296
324
|
* @twin.org/dataspace-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
297
325
|
|
|
298
|
-
## [0.0.3-next.2](https://github.com/
|
|
326
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.1...dataspace-socket-client-v0.0.3-next.2) (2025-11-28)
|
|
299
327
|
|
|
300
328
|
|
|
301
329
|
### Bug Fixes
|
|
302
330
|
|
|
303
|
-
* not supported error handling ([b946505](https://github.com/
|
|
331
|
+
* not supported error handling ([b946505](https://github.com/iotaledger/twin-dataspace/commit/b9465059f2b4bdce1d79fbca596b3abd7eadc918))
|
|
304
332
|
|
|
305
333
|
|
|
306
334
|
### Dependencies
|
|
@@ -309,19 +337,19 @@
|
|
|
309
337
|
* dependencies
|
|
310
338
|
* @twin.org/dataspace-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
311
339
|
|
|
312
|
-
## [0.0.3-next.1](https://github.com/
|
|
340
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.3-next.0...dataspace-socket-client-v0.0.3-next.1) (2025-11-12)
|
|
313
341
|
|
|
314
342
|
|
|
315
343
|
### Features
|
|
316
344
|
|
|
317
|
-
* add context id features ([#26](https://github.com/
|
|
318
|
-
* add rest and socket clients ([950bf70](https://github.com/
|
|
319
|
-
* add validate-locales ([c0b08a7](https://github.com/
|
|
320
|
-
* eslint migration to flat config ([b84e875](https://github.com/
|
|
321
|
-
* expose client methods ([3de1ecb](https://github.com/
|
|
322
|
-
* query interface data space connector ([#18](https://github.com/
|
|
323
|
-
* update framework components ([4d9ca95](https://github.com/
|
|
324
|
-
* use new engine extensions config ([80bdb5b](https://github.com/
|
|
345
|
+
* add context id features ([#26](https://github.com/iotaledger/twin-dataspace/issues/26)) ([6429a16](https://github.com/iotaledger/twin-dataspace/commit/6429a160dac9499304fdfb93a9dbdce37277ca7d))
|
|
346
|
+
* add rest and socket clients ([950bf70](https://github.com/iotaledger/twin-dataspace/commit/950bf705e6df4e709bbbe58e93968510067b9ddc))
|
|
347
|
+
* add validate-locales ([c0b08a7](https://github.com/iotaledger/twin-dataspace/commit/c0b08a73268f9fd3eb6ac3079b49d1ab0c01f118))
|
|
348
|
+
* eslint migration to flat config ([b84e875](https://github.com/iotaledger/twin-dataspace/commit/b84e87530aa249891618096ab6e072b21ff9f63a))
|
|
349
|
+
* expose client methods ([3de1ecb](https://github.com/iotaledger/twin-dataspace/commit/3de1ecbd345d36cef352e9d4dce26353f21b3f99))
|
|
350
|
+
* query interface data space connector ([#18](https://github.com/iotaledger/twin-dataspace/issues/18)) ([b12eca1](https://github.com/iotaledger/twin-dataspace/commit/b12eca124a8f46d290c168e364b7ed4bf72001d8))
|
|
351
|
+
* update framework components ([4d9ca95](https://github.com/iotaledger/twin-dataspace/commit/4d9ca95879bd6cae9d031595292b6a872bf5b5fd))
|
|
352
|
+
* use new engine extensions config ([80bdb5b](https://github.com/iotaledger/twin-dataspace/commit/80bdb5b298b65b5b22fa9927a0ad031cb9a3534d))
|
|
325
353
|
|
|
326
354
|
|
|
327
355
|
### Dependencies
|
|
@@ -330,12 +358,12 @@
|
|
|
330
358
|
* dependencies
|
|
331
359
|
* @twin.org/dataspace-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
332
360
|
|
|
333
|
-
## [0.0.1-next.8](https://github.com/
|
|
361
|
+
## [0.0.1-next.8](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.7...dataspace-socket-client-v0.0.1-next.8) (2025-10-09)
|
|
334
362
|
|
|
335
363
|
|
|
336
364
|
### Features
|
|
337
365
|
|
|
338
|
-
* add validate-locales ([c0b08a7](https://github.com/
|
|
366
|
+
* add validate-locales ([c0b08a7](https://github.com/iotaledger/twin-dataspace/commit/c0b08a73268f9fd3eb6ac3079b49d1ab0c01f118))
|
|
339
367
|
|
|
340
368
|
|
|
341
369
|
### Dependencies
|
|
@@ -344,12 +372,12 @@
|
|
|
344
372
|
* dependencies
|
|
345
373
|
* @twin.org/dataspace-models bumped from 0.0.1-next.7 to 0.0.1-next.8
|
|
346
374
|
|
|
347
|
-
## [0.0.1-next.7](https://github.com/
|
|
375
|
+
## [0.0.1-next.7](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.6...dataspace-socket-client-v0.0.1-next.7) (2025-10-02)
|
|
348
376
|
|
|
349
377
|
|
|
350
378
|
### Features
|
|
351
379
|
|
|
352
|
-
* use new engine extensions config ([80bdb5b](https://github.com/
|
|
380
|
+
* use new engine extensions config ([80bdb5b](https://github.com/iotaledger/twin-dataspace/commit/80bdb5b298b65b5b22fa9927a0ad031cb9a3534d))
|
|
353
381
|
|
|
354
382
|
|
|
355
383
|
### Dependencies
|
|
@@ -358,7 +386,7 @@
|
|
|
358
386
|
* dependencies
|
|
359
387
|
* @twin.org/dataspace-models bumped from 0.0.1-next.6 to 0.0.1-next.7
|
|
360
388
|
|
|
361
|
-
## [0.0.1-next.6](https://github.com/
|
|
389
|
+
## [0.0.1-next.6](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.5...dataspace-socket-client-v0.0.1-next.6) (2025-09-29)
|
|
362
390
|
|
|
363
391
|
|
|
364
392
|
### Miscellaneous Chores
|
|
@@ -372,12 +400,12 @@
|
|
|
372
400
|
* dependencies
|
|
373
401
|
* @twin.org/dataspace-models bumped from 0.0.1-next.5 to 0.0.1-next.6
|
|
374
402
|
|
|
375
|
-
## [0.0.1-next.5](https://github.com/
|
|
403
|
+
## [0.0.1-next.5](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.4...dataspace-socket-client-v0.0.1-next.5) (2025-09-29)
|
|
376
404
|
|
|
377
405
|
|
|
378
406
|
### Features
|
|
379
407
|
|
|
380
|
-
* update framework components ([4d9ca95](https://github.com/
|
|
408
|
+
* update framework components ([4d9ca95](https://github.com/iotaledger/twin-dataspace/commit/4d9ca95879bd6cae9d031595292b6a872bf5b5fd))
|
|
381
409
|
|
|
382
410
|
|
|
383
411
|
### Dependencies
|
|
@@ -386,12 +414,12 @@
|
|
|
386
414
|
* dependencies
|
|
387
415
|
* @twin.org/dataspace-models bumped from 0.0.1-next.4 to 0.0.1-next.5
|
|
388
416
|
|
|
389
|
-
## [0.0.1-next.4](https://github.com/
|
|
417
|
+
## [0.0.1-next.4](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.3...dataspace-socket-client-v0.0.1-next.4) (2025-08-29)
|
|
390
418
|
|
|
391
419
|
|
|
392
420
|
### Features
|
|
393
421
|
|
|
394
|
-
* eslint migration to flat config ([b84e875](https://github.com/
|
|
422
|
+
* eslint migration to flat config ([b84e875](https://github.com/iotaledger/twin-dataspace/commit/b84e87530aa249891618096ab6e072b21ff9f63a))
|
|
395
423
|
|
|
396
424
|
|
|
397
425
|
### Dependencies
|
|
@@ -400,7 +428,7 @@
|
|
|
400
428
|
* dependencies
|
|
401
429
|
* @twin.org/dataspace-models bumped from 0.0.1-next.3 to 0.0.1-next.4
|
|
402
430
|
|
|
403
|
-
## [0.0.1-next.3](https://github.com/
|
|
431
|
+
## [0.0.1-next.3](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.2...dataspace-socket-client-v0.0.1-next.3) (2025-08-25)
|
|
404
432
|
|
|
405
433
|
|
|
406
434
|
### Miscellaneous Chores
|
|
@@ -414,13 +442,13 @@
|
|
|
414
442
|
* dependencies
|
|
415
443
|
* @twin.org/dataspace-models bumped from 0.0.1-next.2 to 0.0.1-next.3
|
|
416
444
|
|
|
417
|
-
## [0.0.1-next.2](https://github.com/
|
|
445
|
+
## [0.0.1-next.2](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.1...dataspace-socket-client-v0.0.1-next.2) (2025-08-25)
|
|
418
446
|
|
|
419
447
|
|
|
420
448
|
### Features
|
|
421
449
|
|
|
422
|
-
* add rest and socket clients ([950bf70](https://github.com/
|
|
423
|
-
* expose client methods ([3de1ecb](https://github.com/
|
|
450
|
+
* add rest and socket clients ([950bf70](https://github.com/iotaledger/twin-dataspace/commit/950bf705e6df4e709bbbe58e93968510067b9ddc))
|
|
451
|
+
* expose client methods ([3de1ecb](https://github.com/iotaledger/twin-dataspace/commit/3de1ecbd345d36cef352e9d4dce26353f21b3f99))
|
|
424
452
|
|
|
425
453
|
|
|
426
454
|
### Dependencies
|
|
@@ -429,12 +457,12 @@
|
|
|
429
457
|
* dependencies
|
|
430
458
|
* @twin.org/dataspace-models bumped from 0.0.1-next.1 to 0.0.1-next.2
|
|
431
459
|
|
|
432
|
-
## [0.0.1-next.1](https://github.com/
|
|
460
|
+
## [0.0.1-next.1](https://github.com/iotaledger/twin-dataspace/compare/dataspace-socket-client-v0.0.1-next.0...dataspace-socket-client-v0.0.1-next.1) (2025-08-25)
|
|
433
461
|
|
|
434
462
|
|
|
435
463
|
### Features
|
|
436
464
|
|
|
437
|
-
* add rest and socket clients ([950bf70](https://github.com/
|
|
465
|
+
* add rest and socket clients ([950bf70](https://github.com/iotaledger/twin-dataspace/commit/950bf705e6df4e709bbbe58e93968510067b9ddc))
|
|
438
466
|
|
|
439
467
|
|
|
440
468
|
### Dependencies
|
|
@@ -64,7 +64,7 @@ The class name of the component.
|
|
|
64
64
|
|
|
65
65
|
### notifyActivity() {#notifyactivity}
|
|
66
66
|
|
|
67
|
-
> **notifyActivity**(`activity`): `Promise`\<`string`\>
|
|
67
|
+
> **notifyActivity**(`activity`): `Promise`\<`string` \| `IActivityLogEntry`\>
|
|
68
68
|
|
|
69
69
|
Notify an Activity to the Dataspace Activity Stream - implemented in REST Client.
|
|
70
70
|
|
|
@@ -78,9 +78,9 @@ The Activity notified.
|
|
|
78
78
|
|
|
79
79
|
#### Returns
|
|
80
80
|
|
|
81
|
-
`Promise`\<`string`\>
|
|
81
|
+
`Promise`\<`string` \| `IActivityLogEntry`\>
|
|
82
82
|
|
|
83
|
-
The
|
|
83
|
+
The activity's id or entry.
|
|
84
84
|
|
|
85
85
|
#### Implementation of
|
|
86
86
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-data-plane-socket-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.27",
|
|
4
4
|
"description": "Provides a WebSocket client for subscribing to activity log status notifications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/dataspace.git",
|
|
8
8
|
"directory": "packages/dataspace-data-plane-socket-client"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/api-models": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
|
-
"@twin.org/dataspace-models": "0.0.3-next.
|
|
21
|
+
"@twin.org/dataspace-models": "0.0.3-next.27",
|
|
22
22
|
"@twin.org/logging-models": "next",
|
|
23
23
|
"@twin.org/nameof": "next"
|
|
24
24
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"integration"
|
|
50
50
|
],
|
|
51
51
|
"bugs": {
|
|
52
|
-
"url": "git+https://github.com/
|
|
52
|
+
"url": "git+https://github.com/iotaledger/dataspace/issues"
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://twindev.org"
|
|
55
55
|
}
|