@twin.org/dataspace-models 0.0.3-next.32 → 0.0.3-next.34

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/index.js CHANGED
@@ -9,6 +9,7 @@ export * from "./models/controlPlane/IDataspaceAppDataset.js";
9
9
  export * from "./models/controlPlane/IDataspaceControlPlaneComponent.js";
10
10
  export * from "./models/controlPlane/IDataspaceControlPlaneResolverComponent.js";
11
11
  export * from "./models/controlPlane/INegotiationCallback.js";
12
+ export * from "./models/controlPlane/ITransferCallback.js";
12
13
  export * from "./models/controlPlane/ITransferContext.js";
13
14
  export * from "./models/controlPlane/ITransferProcess.js";
14
15
  export * from "./models/controlPlane/transferProcessRole.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC,iBAAiB;AACjB,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAE9C,wBAAwB;AACxB,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,kEAAkE,CAAC;AACjF,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAE7D,qBAAqB;AACrB,cAAc,oDAAoD,CAAC;AAEnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,mCAAmC,CAAC;AAElD,cAAc;AACd,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AAExD,gBAAgB;AAChB,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AAEvD,wDAAwD;AACxD,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AAExE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AAEjD,kBAAkB;AAClB,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n// Entity exports\nexport * from \"./entities/dataspaceAppDataset.js\";\nexport * from \"./entities/transferProcess.js\";\n\n// Control Plane exports\nexport * from \"./models/controlPlane/api/ITransferContextResponse.js\";\nexport * from \"./models/controlPlane/IDataspaceAppDataset.js\";\nexport * from \"./models/controlPlane/IDataspaceControlPlaneComponent.js\";\nexport * from \"./models/controlPlane/IDataspaceControlPlaneResolverComponent.js\";\nexport * from \"./models/controlPlane/INegotiationCallback.js\";\nexport * from \"./models/controlPlane/ITransferContext.js\";\nexport * from \"./models/controlPlane/ITransferProcess.js\";\nexport * from \"./models/controlPlane/transferProcessRole.js\";\n\n// Data Plane exports\nexport * from \"./models/dataPlane/IDataspaceDataPlaneComponent.js\";\n\nexport * from \"./models/dataspaceContexts.js\";\nexport * from \"./models/dataspaceTransferFormat.js\";\nexport * from \"./models/dataspaceTypes.js\";\nexport * from \"./models/IDataspaceActivity.js\";\n\nexport * from \"./dataTypes/dataspaceDataTypes.js\";\n\n// App exports\nexport * from \"./factories/dataspaceAppFactory.js\";\nexport * from \"./models/app/IDataspaceApp.js\";\nexport * from \"./models/app/IFollowActivity.js\";\nexport * from \"./models/app/IUndoActivity.js\";\nexport * from \"./models/app/IProcessingGroupOptions.js\";\n\n// Other exports\nexport * from \"./models/activityProcessingStatus.js\";\nexport * from \"./models/api/IActivityLogEntryGetRequest.js\";\nexport * from \"./models/api/IActivityLogEntryGetResponse.js\";\nexport * from \"./models/api/IActivityLogStatusNotificationPayload.js\";\nexport * from \"./models/api/IActivityLogStatusRequest.js\";\nexport * from \"./models/api/IActivityLogEntryWithError.js\";\nexport * from \"./models/api/IActivityStreamNotifyRequest.js\";\nexport * from \"./models/api/IActivityStreamNotifyResponse.js\";\nexport * from \"./models/api/IDataAssetEntitiesResponse.js\";\nexport * from \"./models/api/IDataAssetGetEntitiesRequest.js\";\nexport * from \"./models/api/IDataAssetQueryRequest.js\";\n\n// Control Plane API exports - Transfer Process Protocol\nexport * from \"./models/api/controlPlane/IAppDatasetCreateRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetCreateResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetDeleteRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetGetRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetGetResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetListRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetListResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetUpdateRequest.js\";\nexport * from \"./models/api/controlPlane/ICompleteTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ICompleteTransferResponse.js\";\nexport * from \"./models/api/controlPlane/IGetTransferProcessRequest.js\";\nexport * from \"./models/api/controlPlane/IGetTransferProcessResponse.js\";\nexport * from \"./models/api/controlPlane/IRequestTransferRequest.js\";\nexport * from \"./models/api/controlPlane/IRequestTransferResponse.js\";\nexport * from \"./models/api/controlPlane/IStartTransferRequest.js\";\nexport * from \"./models/api/controlPlane/IStartTransferResponse.js\";\nexport * from \"./models/api/controlPlane/ISuspendTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ISuspendTransferResponse.js\";\nexport * from \"./models/api/controlPlane/ITerminateTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ITerminateTransferResponse.js\";\n\nexport * from \"./models/activityTaskStatus.js\";\nexport * from \"./models/app/dataRequestType.js\";\nexport * from \"./models/app/IActivityQuery.js\";\nexport * from \"./models/app/IDataAssetEntitiesRequest.js\";\nexport * from \"./models/app/IDataAssetQuery.js\";\nexport * from \"./models/app/IDataRequest.js\";\nexport * from \"./models/app/IQueryDataAssetRequest.js\";\nexport * from \"./models/IActivityLogDetails.js\";\nexport * from \"./models/IActivityLogEntry.js\";\nexport * from \"./models/IActivityLogStatusNotification.js\";\nexport * from \"./models/IActivityTask.js\";\nexport * from \"./models/IActivityTaskEntry.js\";\nexport * from \"./models/IDataAssetItemList.js\";\nexport * from \"./models/IDataAssetItemListResult.js\";\nexport * from \"./models/IEntitySet.js\";\nexport * from \"./models/IExecutionPayload.js\";\nexport * from \"./models/IFilteringQuery.js\";\nexport * from \"./models/IPushDeliveryPayload.js\";\n\n// Utility exports\nexport * from \"./utils/jsonLdUtils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC,iBAAiB;AACjB,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAE9C,wBAAwB;AACxB,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,kEAAkE,CAAC;AACjF,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAE7D,qBAAqB;AACrB,cAAc,oDAAoD,CAAC;AAEnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,mCAAmC,CAAC;AAElD,cAAc;AACd,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AAExD,gBAAgB;AAChB,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AAEvD,wDAAwD;AACxD,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AAExE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AAEjD,kBAAkB;AAClB,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n// Entity exports\nexport * from \"./entities/dataspaceAppDataset.js\";\nexport * from \"./entities/transferProcess.js\";\n\n// Control Plane exports\nexport * from \"./models/controlPlane/api/ITransferContextResponse.js\";\nexport * from \"./models/controlPlane/IDataspaceAppDataset.js\";\nexport * from \"./models/controlPlane/IDataspaceControlPlaneComponent.js\";\nexport * from \"./models/controlPlane/IDataspaceControlPlaneResolverComponent.js\";\nexport * from \"./models/controlPlane/INegotiationCallback.js\";\nexport * from \"./models/controlPlane/ITransferCallback.js\";\nexport * from \"./models/controlPlane/ITransferContext.js\";\nexport * from \"./models/controlPlane/ITransferProcess.js\";\nexport * from \"./models/controlPlane/transferProcessRole.js\";\n\n// Data Plane exports\nexport * from \"./models/dataPlane/IDataspaceDataPlaneComponent.js\";\n\nexport * from \"./models/dataspaceContexts.js\";\nexport * from \"./models/dataspaceTransferFormat.js\";\nexport * from \"./models/dataspaceTypes.js\";\nexport * from \"./models/IDataspaceActivity.js\";\n\nexport * from \"./dataTypes/dataspaceDataTypes.js\";\n\n// App exports\nexport * from \"./factories/dataspaceAppFactory.js\";\nexport * from \"./models/app/IDataspaceApp.js\";\nexport * from \"./models/app/IFollowActivity.js\";\nexport * from \"./models/app/IUndoActivity.js\";\nexport * from \"./models/app/IProcessingGroupOptions.js\";\n\n// Other exports\nexport * from \"./models/activityProcessingStatus.js\";\nexport * from \"./models/api/IActivityLogEntryGetRequest.js\";\nexport * from \"./models/api/IActivityLogEntryGetResponse.js\";\nexport * from \"./models/api/IActivityLogStatusNotificationPayload.js\";\nexport * from \"./models/api/IActivityLogStatusRequest.js\";\nexport * from \"./models/api/IActivityLogEntryWithError.js\";\nexport * from \"./models/api/IActivityStreamNotifyRequest.js\";\nexport * from \"./models/api/IActivityStreamNotifyResponse.js\";\nexport * from \"./models/api/IDataAssetEntitiesResponse.js\";\nexport * from \"./models/api/IDataAssetGetEntitiesRequest.js\";\nexport * from \"./models/api/IDataAssetQueryRequest.js\";\n\n// Control Plane API exports - Transfer Process Protocol\nexport * from \"./models/api/controlPlane/IAppDatasetCreateRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetCreateResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetDeleteRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetGetRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetGetResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetListRequest.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetListResponse.js\";\nexport * from \"./models/api/controlPlane/IAppDatasetUpdateRequest.js\";\nexport * from \"./models/api/controlPlane/ICompleteTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ICompleteTransferResponse.js\";\nexport * from \"./models/api/controlPlane/IGetTransferProcessRequest.js\";\nexport * from \"./models/api/controlPlane/IGetTransferProcessResponse.js\";\nexport * from \"./models/api/controlPlane/IRequestTransferRequest.js\";\nexport * from \"./models/api/controlPlane/IRequestTransferResponse.js\";\nexport * from \"./models/api/controlPlane/IStartTransferRequest.js\";\nexport * from \"./models/api/controlPlane/IStartTransferResponse.js\";\nexport * from \"./models/api/controlPlane/ISuspendTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ISuspendTransferResponse.js\";\nexport * from \"./models/api/controlPlane/ITerminateTransferRequest.js\";\nexport * from \"./models/api/controlPlane/ITerminateTransferResponse.js\";\n\nexport * from \"./models/activityTaskStatus.js\";\nexport * from \"./models/app/dataRequestType.js\";\nexport * from \"./models/app/IActivityQuery.js\";\nexport * from \"./models/app/IDataAssetEntitiesRequest.js\";\nexport * from \"./models/app/IDataAssetQuery.js\";\nexport * from \"./models/app/IDataRequest.js\";\nexport * from \"./models/app/IQueryDataAssetRequest.js\";\nexport * from \"./models/IActivityLogDetails.js\";\nexport * from \"./models/IActivityLogEntry.js\";\nexport * from \"./models/IActivityLogStatusNotification.js\";\nexport * from \"./models/IActivityTask.js\";\nexport * from \"./models/IActivityTaskEntry.js\";\nexport * from \"./models/IDataAssetItemList.js\";\nexport * from \"./models/IDataAssetItemListResult.js\";\nexport * from \"./models/IEntitySet.js\";\nexport * from \"./models/IExecutionPayload.js\";\nexport * from \"./models/IFilteringQuery.js\";\nexport * from \"./models/IPushDeliveryPayload.js\";\n\n// Utility exports\nexport * from \"./utils/jsonLdUtils.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IDataspaceControlPlaneComponent.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/IDataspaceControlPlaneComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tIDataspaceProtocolContractNegotiation,\n\tIDataspaceProtocolContractNegotiationError,\n\tIDataspaceProtocolDataset,\n\tIDataspaceProtocolTransferCompletionMessage,\n\tIDataspaceProtocolTransferError,\n\tIDataspaceProtocolTransferProcess,\n\tIDataspaceProtocolTransferRequestMessage,\n\tIDataspaceProtocolTransferStartMessage,\n\tIDataspaceProtocolTransferSuspensionMessage,\n\tIDataspaceProtocolTransferTerminationMessage\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDataspaceAppDataset } from \"./IDataspaceAppDataset.js\";\nimport type { INegotiationCallback } from \"./INegotiationCallback.js\";\n\n/**\n * Dataspace Control Plane Component interface.\n * Implements Eclipse Dataspace Protocol (DSP) specifications:\n * - Contract Negotiation Protocol\n * - Transfer Process Protocol\n *\n * This component acts as the Control Plane for contract negotiation and\n * data transfers between nodes in a dataspace.\n *\n * DSP 2025-1 Specification: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/\n */\nexport interface IDataspaceControlPlaneComponent extends IComponent {\n\t// ============================================================================\n\t// CONTRACT NEGOTIATION PROTOCOL (DSP)\n\t// Methods for negotiating agreements before transfers\n\t// ============================================================================\n\n\t/**\n\t * Register a callback to receive negotiation state change notifications.\n\t * Upstream modules (e.g. supply-chain) register their callback here\n\t * to be notified when negotiations complete, fail, or change state.\n\t * @param key A unique key identifying this callback registration.\n\t * @param callback The callback interface to register.\n\t */\n\tregisterNegotiationCallback(key: string, callback: INegotiationCallback): void;\n\n\t/**\n\t * Unregister a previously registered negotiation callback.\n\t * @param key The key used when registering the callback.\n\t */\n\tunregisterNegotiationCallback(key: string): void;\n\n\t/**\n\t * Negotiate a contract agreement with a provider.\n\t * Implements DSP Contract Negotiation Protocol.\n\t *\n\t * Returns immediately with a negotiationId. The caller is notified\n\t * via the registered INegotiationCallback when the negotiation completes.\n\t * The negotiation follows DSP state machine: REQUESTED → OFFERED → AGREED → VERIFIED → FINALIZED.\n\t *\n\t * This method has NO REST client implementation — it is only accessible via ComponentFactory.get().\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol\n\t *\n\t * @param datasetId The dataset ID from the provider's catalog.\n\t * @param offerId The offer ID from the provider's catalog.\n\t * @param providerEndpoint The provider's contract negotiation endpoint URL.\n\t * @param publicOrigin The public origin URL of this control plane (for callbacks).\n\t * @param trustPayload Trust payload for authentication (JWT or Verifiable Credential).\n\t * @returns The negotiation ID for tracking. Use registered callback for completion.\n\t */\n\tnegotiateAgreement(\n\t\tdatasetId: string,\n\t\tofferId: string,\n\t\tproviderEndpoint: string,\n\t\tpublicOrigin: string,\n\t\ttrustPayload: unknown\n\t): Promise<{ negotiationId: string }>;\n\n\t/**\n\t * Get the current state of a contract negotiation.\n\t * Implements DSP Contract Negotiation Protocol.\n\t *\n\t * Queries the current state of an ongoing or completed negotiation.\n\t * Use this to monitor negotiation progress.\n\t * Returns the DSP-compliant negotiation state or error.\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol\n\t *\n\t * @param negotiationId The unique identifier of the negotiation.\n\t * @param trustPayload Trust payload for authentication.\n\t * @returns DSP ContractNegotiation with current state, or error.\n\t */\n\tgetNegotiation(\n\t\tnegotiationId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolContractNegotiation | IDataspaceProtocolContractNegotiationError>;\n\n\t/**\n\t * Get negotiation history.\n\t * Queries past contract negotiations for audit trails and debugging.\n\t *\n\t * Returns a list of past negotiations with their states and metadata.\n\t * Supports optional filtering by state and pagination via cursor.\n\t *\n\t * @param state Optional filter by negotiation state (e.g., \"FINALIZED\", \"TERMINATED\").\n\t * @param cursor Optional pagination cursor for fetching next page.\n\t * @param trustPayload Trust payload for authentication.\n\t * @returns List of negotiation history entries with pagination cursor.\n\t */\n\tgetNegotiationHistory(\n\t\tstate: string | undefined,\n\t\tcursor: string | undefined,\n\t\ttrustPayload: unknown\n\t): Promise<{\n\t\tnegotiations: {\n\t\t\tnegotiation:\n\t\t\t\t| IDataspaceProtocolContractNegotiation\n\t\t\t\t| IDataspaceProtocolContractNegotiationError;\n\t\t\tcreatedAt: string;\n\t\t\tofferId?: string;\n\t\t\tagreementId?: string;\n\t\t}[];\n\t\tcursor?: string;\n\t\tcount: number;\n\t}>;\n\n\t// ============================================================================\n\t// TRANSFER PROCESS PROTOCOL (DSP)\n\t// Methods for managing data transfers after agreements are established\n\t// ============================================================================\n\n\t// ----------------------------------------------------------------------------\n\t// CONSUMER SIDE OPERATIONS\n\t// Methods called by the Data Consumer to initiate transfers\n\t// ----------------------------------------------------------------------------\n\n\t/**\n\t * Request a Transfer Process.\n\t * Creates a new Transfer Process in REQUESTED state.\n\t *\n\t * Role Performed: Provider\n\t * Called by: Consumer when it wants to request a new Transfer Process\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-request-message\n\t *\n\t * @param request Transfer request message (DSP compliant) containing agreementId,\n\t * consumerPid, callbackAddress, and format.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * The consumer must prove their identity by providing a valid trust payload.\n\t * @returns Transfer Process (DSP compliant) with state REQUESTED, including\n\t * both consumerPid and providerPid, or TransferError if the operation fails.\n\t */\n\trequestTransfer(\n\t\trequest: IDataspaceProtocolTransferRequestMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// PROVIDER SIDE OPERATIONS\n\t// Methods called by the Data Provider to respond to transfer requests\n\t// ============================================================================\n\n\t/**\n\t * Start a Transfer Process.\n\t * Transitions Transfer Process from REQUESTED to STARTED state, or resumes from SUSPENDED state.\n\t *\n\t * Role Performed: Provider / Consumer\n\t * Called by: Provider when a Transfer Process starts, or Consumer to attempt to start a Transfer Process after it has been suspended\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-start-message\n\t *\n\t * @param message Transfer start message (DSP compliant).\n\t * @param publicOrigin The public origin URL of this service (used to construct data plane endpoint for PULL transfers).\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.\n\t */\n\tstartTransfer(\n\t\tmessage: IDataspaceProtocolTransferStartMessage,\n\t\tpublicOrigin: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferStartMessage | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// SHARED STATE MANAGEMENT OPERATIONS\n\t// Methods that can be called by either Consumer or Provider\n\t// ============================================================================\n\n\t/**\n\t * Complete a Transfer Process.\n\t * Transitions Transfer Process to COMPLETED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process is completed on their side\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-completion-message\n\t *\n\t * @param message Transfer completion message (DSP compliant).\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state COMPLETED, or TransferError if the operation fails.\n\t */\n\tcompleteTransfer(\n\t\tmessage: IDataspaceProtocolTransferCompletionMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Suspend a Transfer Process.\n\t * Transitions Transfer Process to SUSPENDED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process needs to be temporarily suspended on their side\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-suspension-message\n\t *\n\t * @param message Transfer suspension message (DSP compliant) with optional reason.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state SUSPENDED, or TransferError if the operation fails.\n\t */\n\tsuspendTransfer(\n\t\tmessage: IDataspaceProtocolTransferSuspensionMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Terminate a Transfer Process.\n\t * Transitions Transfer Process to TERMINATED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process needs to be terminated on their side (e.g., due to error)\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-termination-message\n\t *\n\t * @param message Transfer termination message (DSP compliant) with optional reason.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state TERMINATED, or TransferError if the operation fails.\n\t */\n\tterminateTransfer(\n\t\tmessage: IDataspaceProtocolTransferTerminationMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Get Transfer Process State.\n\t * Query the current state of a Transfer Process.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when they need to check the status of a Transfer process on their side\n\t *\n\t * Supports role-agnostic lookup using either consumerPid or providerPid.\n\t * The service will automatically detect which role the caller is acting as\n\t * (Consumer or Provider) based on the PID provided.\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#ack-transfer-process\n\t *\n\t * @param pid The Process ID (consumerPid or providerPid) used to identify the transfer.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with current state, or TransferError if the operation fails.\n\t */\n\tgetTransferProcess(\n\t\tpid: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// DATASET MANAGEMENT\n\t// CRUD over the tenant-scoped dataset records the Control Plane reads at\n\t// start time to populate the federated catalogue.\n\t// ============================================================================\n\n\t/**\n\t * Register an app dataset for a dataspace app, owned by the calling tenant.\n\t * @param id Optional explicit id. If omitted, derived from `dataset[\"@id\"]`\n\t * or generated.\n\t * @param appId The dataspace app this dataset belongs to (matches\n\t * `DataspaceAppFactory` registration name).\n\t * @param dataset The dataset payload (may omit system-stamped fields).\n\t * @returns The resolved dataset id.\n\t */\n\tcreateAppDataset(\n\t\tid: string | undefined,\n\t\tappId: string,\n\t\tdataset: IDataspaceProtocolDataset\n\t): Promise<string>;\n\n\t/**\n\t * Get an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @returns The stored app dataset record.\n\t */\n\tgetAppDataset(id: string): Promise<IDataspaceAppDataset>;\n\n\t/**\n\t * List the app datasets owned by the calling tenant.\n\t * @param cursor Optional pagination cursor.\n\t * @param limit Optional maximum number of entries to return.\n\t * @returns The stored app datasets and the next-page cursor if more exist.\n\t */\n\tlistAppDatasets(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentities: IDataspaceAppDataset[];\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Update an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @param appId The dataspace app this dataset belongs to.\n\t * @param dataset The dataset payload.\n\t * @returns Nothing.\n\t */\n\tupdateAppDataset(id: string, appId: string, dataset: IDataspaceProtocolDataset): Promise<void>;\n\n\t/**\n\t * Delete an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @returns Nothing.\n\t */\n\tdeleteAppDataset(id: string): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"IDataspaceControlPlaneComponent.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/IDataspaceControlPlaneComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {\n\tIDataspaceProtocolContractNegotiation,\n\tIDataspaceProtocolContractNegotiationError,\n\tIDataspaceProtocolDataset,\n\tIDataspaceProtocolTransferCompletionMessage,\n\tIDataspaceProtocolTransferError,\n\tIDataspaceProtocolTransferProcess,\n\tIDataspaceProtocolTransferRequestMessage,\n\tIDataspaceProtocolTransferStartMessage,\n\tIDataspaceProtocolTransferSuspensionMessage,\n\tIDataspaceProtocolTransferTerminationMessage\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDataspaceAppDataset } from \"./IDataspaceAppDataset.js\";\nimport type { INegotiationCallback } from \"./INegotiationCallback.js\";\nimport type { ITransferCallback } from \"./ITransferCallback.js\";\n\n/**\n * Dataspace Control Plane Component interface.\n * Implements Eclipse Dataspace Protocol (DSP) specifications:\n * - Contract Negotiation Protocol\n * - Transfer Process Protocol\n *\n * This component acts as the Control Plane for contract negotiation and\n * data transfers between nodes in a dataspace.\n *\n * DSP 2025-1 Specification: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/\n */\nexport interface IDataspaceControlPlaneComponent extends IComponent {\n\t// ============================================================================\n\t// CONTRACT NEGOTIATION PROTOCOL (DSP)\n\t// Methods for negotiating agreements before transfers\n\t// ============================================================================\n\n\t/**\n\t * Register a callback to receive negotiation state change notifications.\n\t * Upstream modules (e.g. supply-chain) register their callback here\n\t * to be notified when negotiations complete, fail, or change state.\n\t * @param key A unique key identifying this callback registration.\n\t * @param callback The callback interface to register.\n\t */\n\tregisterNegotiationCallback(key: string, callback: INegotiationCallback): void;\n\n\t/**\n\t * Unregister a previously registered negotiation callback.\n\t * @param key The key used when registering the callback.\n\t */\n\tunregisterNegotiationCallback(key: string): void;\n\n\t/**\n\t * Negotiate a contract agreement with a provider.\n\t * Implements DSP Contract Negotiation Protocol.\n\t *\n\t * Returns immediately with a negotiationId. The caller is notified\n\t * via the registered INegotiationCallback when the negotiation completes.\n\t * The negotiation follows DSP state machine: REQUESTED → OFFERED → AGREED → VERIFIED → FINALIZED.\n\t *\n\t * This method has NO REST client implementation — it is only accessible via ComponentFactory.get().\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol\n\t *\n\t * @param datasetId The dataset ID from the provider's catalog.\n\t * @param offerId The offer ID from the provider's catalog.\n\t * @param providerEndpoint The provider's contract negotiation endpoint URL.\n\t * @param publicOrigin The public origin URL of this control plane (for callbacks).\n\t * @param trustPayload Trust payload for authentication (JWT or Verifiable Credential).\n\t * @returns The negotiation ID for tracking. Use registered callback for completion.\n\t */\n\tnegotiateAgreement(\n\t\tdatasetId: string,\n\t\tofferId: string,\n\t\tproviderEndpoint: string,\n\t\tpublicOrigin: string,\n\t\ttrustPayload: unknown\n\t): Promise<{ negotiationId: string }>;\n\n\t/**\n\t * Get the current state of a contract negotiation.\n\t * Implements DSP Contract Negotiation Protocol.\n\t *\n\t * Queries the current state of an ongoing or completed negotiation.\n\t * Use this to monitor negotiation progress.\n\t * Returns the DSP-compliant negotiation state or error.\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/2025-1/#negotiation-protocol\n\t *\n\t * @param negotiationId The unique identifier of the negotiation.\n\t * @param trustPayload Trust payload for authentication.\n\t * @returns DSP ContractNegotiation with current state, or error.\n\t */\n\tgetNegotiation(\n\t\tnegotiationId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolContractNegotiation | IDataspaceProtocolContractNegotiationError>;\n\n\t/**\n\t * Get negotiation history.\n\t * Queries past contract negotiations for audit trails and debugging.\n\t *\n\t * Returns a list of past negotiations with their states and metadata.\n\t * Supports optional filtering by state and pagination via cursor.\n\t *\n\t * @param state Optional filter by negotiation state (e.g., \"FINALIZED\", \"TERMINATED\").\n\t * @param cursor Optional pagination cursor for fetching next page.\n\t * @param trustPayload Trust payload for authentication.\n\t * @returns List of negotiation history entries with pagination cursor.\n\t */\n\tgetNegotiationHistory(\n\t\tstate: string | undefined,\n\t\tcursor: string | undefined,\n\t\ttrustPayload: unknown\n\t): Promise<{\n\t\tnegotiations: {\n\t\t\tnegotiation:\n\t\t\t\t| IDataspaceProtocolContractNegotiation\n\t\t\t\t| IDataspaceProtocolContractNegotiationError;\n\t\t\tcreatedAt: string;\n\t\t\tofferId?: string;\n\t\t\tagreementId?: string;\n\t\t}[];\n\t\tcursor?: string;\n\t\tcount: number;\n\t}>;\n\n\t// ============================================================================\n\t// TRANSFER PROCESS PROTOCOL (DSP)\n\t// Methods for managing data transfers after agreements are established\n\t// ============================================================================\n\n\t// ----------------------------------------------------------------------------\n\t// CONSUMER SIDE OPERATIONS\n\t// Methods called by the Data Consumer to initiate transfers\n\t// ----------------------------------------------------------------------------\n\n\t/**\n\t * Register a callback to receive transfer process state change notifications.\n\t * Upstream modules register their callback here to be notified when a\n\t * consumer-initiated transfer changes state (STARTED, COMPLETED, SUSPENDED,\n\t * TERMINATED).\n\t *\n\t * This method has NO REST client implementation — in-process only.\n\t * @param key A unique key identifying this callback registration.\n\t * @param callback The callback interface to register.\n\t */\n\tregisterTransferCallback(key: string, callback: ITransferCallback): void;\n\n\t/**\n\t * Unregister a previously registered transfer callback.\n\t * @param key The key used when registering the callback.\n\t */\n\tunregisterTransferCallback(key: string): void;\n\n\t/**\n\t * Start a data transfer as a Consumer.\n\t * High-level convenience wrapper around the DSP Transfer Request protocol.\n\t *\n\t * This method:\n\t * 1. Generates a consumerPid.\n\t * 2. POSTs a TransferRequestMessage to the provider's DSP endpoint.\n\t * 3. Persists a local TransferProcess in REQUESTED state (only if provider accepts).\n\t * 4. Returns the consumerPid immediately.\n\t *\n\t * The caller is notified of subsequent state changes (STARTED, COMPLETED, etc.)\n\t * via the registered ITransferCallback. The transfer moves to STARTED when the\n\t * provider POSTs a TransferStartMessage back to this node's callback address.\n\t *\n\t * This method has NO REST client implementation — in-process only.\n\t *\n\t * @param agreementId The finalized agreement ID (from contract negotiation).\n\t * @param providerEndpoint The provider's DSP control plane base URL.\n\t * @param publicOrigin The public origin URL of this control plane (used as callbackAddress).\n\t * @param format The transfer format (e.g. \"HttpProxy-PULL\", \"HttpProxy-PUSH\").\n\t * @param trustPayload Trust payload for authentication.\n\t * @returns The consumerPid of the newly created TransferProcess.\n\t */\n\tstartDataTransfer(\n\t\tagreementId: string,\n\t\tproviderEndpoint: string,\n\t\tpublicOrigin: string,\n\t\tformat: string,\n\t\ttrustPayload: unknown\n\t): Promise<{ consumerPid: string }>;\n\n\t/**\n\t * Request a Transfer Process.\n\t * Creates a new Transfer Process in REQUESTED state.\n\t *\n\t * Role Performed: Provider\n\t * Called by: Consumer when it wants to request a new Transfer Process\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-request-message\n\t *\n\t * @param request Transfer request message (DSP compliant) containing agreementId,\n\t * consumerPid, callbackAddress, and format.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * The consumer must prove their identity by providing a valid trust payload.\n\t * @returns Transfer Process (DSP compliant) with state REQUESTED, including\n\t * both consumerPid and providerPid, or TransferError if the operation fails.\n\t */\n\trequestTransfer(\n\t\trequest: IDataspaceProtocolTransferRequestMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// PROVIDER SIDE OPERATIONS\n\t// Methods called by the Data Provider to respond to transfer requests\n\t// ============================================================================\n\n\t/**\n\t * Start a Transfer Process.\n\t * Transitions Transfer Process from REQUESTED to STARTED state, or resumes from SUSPENDED state.\n\t *\n\t * Role Performed: Provider / Consumer\n\t * Called by: Provider when a Transfer Process starts, or Consumer to attempt to start a Transfer Process after it has been suspended\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-start-message\n\t *\n\t * @param message Transfer start message (DSP compliant).\n\t * @param publicOrigin The public origin URL of this service (used to construct data plane endpoint for PULL transfers).\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.\n\t */\n\tstartTransfer(\n\t\tmessage: IDataspaceProtocolTransferStartMessage,\n\t\tpublicOrigin: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferStartMessage | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// SHARED STATE MANAGEMENT OPERATIONS\n\t// Methods that can be called by either Consumer or Provider\n\t// ============================================================================\n\n\t/**\n\t * Complete a Transfer Process.\n\t * Transitions Transfer Process to COMPLETED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process is completed on their side\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-completion-message\n\t *\n\t * @param message Transfer completion message (DSP compliant).\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state COMPLETED, or TransferError if the operation fails.\n\t */\n\tcompleteTransfer(\n\t\tmessage: IDataspaceProtocolTransferCompletionMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Suspend a Transfer Process.\n\t * Transitions Transfer Process to SUSPENDED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process needs to be temporarily suspended on their side\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-suspension-message\n\t *\n\t * @param message Transfer suspension message (DSP compliant) with optional reason.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state SUSPENDED, or TransferError if the operation fails.\n\t */\n\tsuspendTransfer(\n\t\tmessage: IDataspaceProtocolTransferSuspensionMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Terminate a Transfer Process.\n\t * Transitions Transfer Process to TERMINATED state.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when a Transfer process needs to be terminated on their side (e.g., due to error)\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#transfer-termination-message\n\t *\n\t * @param message Transfer termination message (DSP compliant) with optional reason.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with state TERMINATED, or TransferError if the operation fails.\n\t */\n\tterminateTransfer(\n\t\tmessage: IDataspaceProtocolTransferTerminationMessage,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t/**\n\t * Get Transfer Process State.\n\t * Query the current state of a Transfer Process.\n\t *\n\t * Role Performed: Consumer / Provider\n\t * Called by: Provider or Consumer when they need to check the status of a Transfer process on their side\n\t *\n\t * Supports role-agnostic lookup using either consumerPid or providerPid.\n\t * The service will automatically detect which role the caller is acting as\n\t * (Consumer or Provider) based on the PID provided.\n\t *\n\t * DSP Spec: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#ack-transfer-process\n\t *\n\t * @param pid The Process ID (consumerPid or providerPid) used to identify the transfer.\n\t * @param trustPayload Trust payload containing authorization information (JWT, VC, etc.).\n\t * @returns Transfer Process (DSP compliant) with current state, or TransferError if the operation fails.\n\t */\n\tgetTransferProcess(\n\t\tpid: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolTransferProcess | IDataspaceProtocolTransferError>;\n\n\t// ============================================================================\n\t// DATASET MANAGEMENT\n\t// CRUD over the tenant-scoped dataset records the Control Plane reads at\n\t// start time to populate the federated catalogue.\n\t// ============================================================================\n\n\t/**\n\t * Register an app dataset for a dataspace app, owned by the calling tenant.\n\t * @param id Optional explicit id. If omitted, derived from `dataset[\"@id\"]`\n\t * or generated.\n\t * @param appId The dataspace app this dataset belongs to (matches\n\t * `DataspaceAppFactory` registration name).\n\t * @param dataset The dataset payload (may omit system-stamped fields).\n\t * @returns The resolved dataset id.\n\t */\n\tcreateAppDataset(\n\t\tid: string | undefined,\n\t\tappId: string,\n\t\tdataset: IDataspaceProtocolDataset\n\t): Promise<string>;\n\n\t/**\n\t * Get an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @returns The stored app dataset record.\n\t */\n\tgetAppDataset(id: string): Promise<IDataspaceAppDataset>;\n\n\t/**\n\t * List the app datasets owned by the calling tenant.\n\t * @param cursor Optional pagination cursor.\n\t * @param limit Optional maximum number of entries to return.\n\t * @returns The stored app datasets and the next-page cursor if more exist.\n\t */\n\tlistAppDatasets(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentities: IDataspaceAppDataset[];\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Update an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @param appId The dataspace app this dataset belongs to.\n\t * @param dataset The dataset payload.\n\t * @returns Nothing.\n\t */\n\tupdateAppDataset(id: string, appId: string, dataset: IDataspaceProtocolDataset): Promise<void>;\n\n\t/**\n\t * Delete an app dataset record owned by the calling tenant.\n\t * @param id The stored app dataset id.\n\t * @returns Nothing.\n\t */\n\tdeleteAppDataset(id: string): Promise<void>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"INegotiationCallback.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/INegotiationCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tDataspaceProtocolContractNegotiationStateType,\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer\n} from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * Callback interface for negotiation state change notifications.\n * Upstream modules register an implementation of this interface\n * via IDataspaceControlPlaneComponent.registerNegotiationCallback()\n * to be notified when PNP callbacks fire.\n */\nexport interface INegotiationCallback {\n\t/**\n\t * Called when the negotiation state changes (offer received, agreement received).\n\t * @param negotiationId The negotiation ID.\n\t * @param state The new state.\n\t * @param data Optional data associated with the state change.\n\t * @param data.offer The offer received from the provider.\n\t * @param data.agreement The agreement received from the provider.\n\t * @returns Nothing.\n\t */\n\tonStateChanged(\n\t\tnegotiationId: string,\n\t\tstate: DataspaceProtocolContractNegotiationStateType,\n\t\tdata?: { offer?: IDataspaceProtocolOffer; agreement?: IDataspaceProtocolAgreement }\n\t): Promise<void>;\n\n\t/**\n\t * Called when the negotiation completes successfully (finalized).\n\t * @param negotiationId The negotiation ID.\n\t * @param agreementId The agreement ID (from agreement.uid).\n\t * @returns Nothing.\n\t */\n\tonCompleted(negotiationId: string, agreementId: string): Promise<void>;\n\n\t/**\n\t * Called when the negotiation fails (terminated or stalled).\n\t * @param negotiationId The negotiation ID.\n\t * @param reason The failure reason.\n\t * @returns Nothing.\n\t */\n\tonFailed(negotiationId: string, reason: string): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"INegotiationCallback.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/INegotiationCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tDataspaceProtocolContractNegotiationStateType,\n\tIDataspaceProtocolAgreement,\n\tIDataspaceProtocolOffer\n} from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * Callback interface for negotiation state change notifications.\n * Upstream modules register an implementation of this interface\n * via IDataspaceControlPlaneComponent.registerNegotiationCallback()\n * to be notified when PNP callbacks fire.\n */\nexport interface INegotiationCallback {\n\t/**\n\t * Called when the negotiation state changes (offer received, agreement received).\n\t * @param negotiationId The negotiation ID.\n\t * @param state The new state.\n\t * @param data Optional data associated with the state change.\n\t * @param data.offer The offer received from the provider.\n\t * @param data.agreement The agreement received from the provider.\n\t * @returns Nothing.\n\t */\n\tonStateChanged(\n\t\tnegotiationId: string,\n\t\tstate: DataspaceProtocolContractNegotiationStateType,\n\t\tdata?: { offer?: IDataspaceProtocolOffer; agreement?: IDataspaceProtocolAgreement }\n\t): Promise<void>;\n\n\t/**\n\t * Called when the negotiation finalizes.\n\t * @param negotiationId The negotiation ID.\n\t * @param agreementId The agreement ID (from agreement.uid).\n\t * @returns Nothing.\n\t */\n\tonFinalized(negotiationId: string, agreementId: string): Promise<void>;\n\n\t/**\n\t * Called when the negotiation fails (terminated or stalled).\n\t * @param negotiationId The negotiation ID.\n\t * @param reason The failure reason.\n\t * @returns Nothing.\n\t */\n\tonFailed(negotiationId: string, reason: string): Promise<void>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITransferCallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITransferCallback.js","sourceRoot":"","sources":["../../../../src/models/controlPlane/ITransferCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tDataspaceProtocolTransferProcessStateType,\n\tIDataspaceProtocolTransferStartMessage\n} from \"@twin.org/standards-dataspace-protocol\";\n\n/**\n * Callback interface for transfer process state change notifications.\n * Upstream modules register an implementation via\n * IDataspaceControlPlaneComponent.registerTransferCallback() to be\n * notified when a consumer-initiated transfer changes state.\n */\nexport interface ITransferCallback {\n\t/**\n\t * Called on every DSP-level state transition for the transfer process.\n\t * @param consumerPid The consumer-side process ID.\n\t * @param state The new DSP state.\n\t * @returns Nothing.\n\t */\n\tonStateChanged(\n\t\tconsumerPid: string,\n\t\tstate: DataspaceProtocolTransferProcessStateType\n\t): Promise<void>;\n\n\t/**\n\t * Called when the provider sends a TransferStartMessage to the consumer.\n\t * The transfer is now STARTED and data can be accessed.\n\t * @param consumerPid The consumer-side process ID.\n\t * @param message The full DSP TransferStartMessage (contains dataAddress for PULL transfers).\n\t * @returns Nothing.\n\t */\n\tonStarted(consumerPid: string, message: IDataspaceProtocolTransferStartMessage): Promise<void>;\n\n\t/**\n\t * Called when the transfer reaches COMPLETED state.\n\t * @param consumerPid The consumer-side process ID.\n\t * @returns Nothing.\n\t */\n\tonCompleted(consumerPid: string): Promise<void>;\n\n\t/**\n\t * Called when the transfer is SUSPENDED.\n\t * @param consumerPid The consumer-side process ID.\n\t * @param reason Optional suspension reason from the DSP message.\n\t * @returns Nothing.\n\t */\n\tonSuspended(consumerPid: string, reason?: string): Promise<void>;\n\n\t/**\n\t * Called when the transfer is TERMINATED.\n\t * @param consumerPid The consumer-side process ID.\n\t * @param reason Optional termination reason from the DSP message.\n\t * @returns Nothing.\n\t */\n\tonTerminated(consumerPid: string, reason?: string): Promise<void>;\n}\n"]}
@@ -5,6 +5,7 @@ export * from "./models/controlPlane/IDataspaceAppDataset.js";
5
5
  export * from "./models/controlPlane/IDataspaceControlPlaneComponent.js";
6
6
  export * from "./models/controlPlane/IDataspaceControlPlaneResolverComponent.js";
7
7
  export * from "./models/controlPlane/INegotiationCallback.js";
8
+ export * from "./models/controlPlane/ITransferCallback.js";
8
9
  export * from "./models/controlPlane/ITransferContext.js";
9
10
  export * from "./models/controlPlane/ITransferProcess.js";
10
11
  export * from "./models/controlPlane/transferProcessRole.js";
@@ -2,6 +2,7 @@ import type { IComponent } from "@twin.org/core";
2
2
  import type { IDataspaceProtocolContractNegotiation, IDataspaceProtocolContractNegotiationError, IDataspaceProtocolDataset, IDataspaceProtocolTransferCompletionMessage, IDataspaceProtocolTransferError, IDataspaceProtocolTransferProcess, IDataspaceProtocolTransferRequestMessage, IDataspaceProtocolTransferStartMessage, IDataspaceProtocolTransferSuspensionMessage, IDataspaceProtocolTransferTerminationMessage } from "@twin.org/standards-dataspace-protocol";
3
3
  import type { IDataspaceAppDataset } from "./IDataspaceAppDataset.js";
4
4
  import type { INegotiationCallback } from "./INegotiationCallback.js";
5
+ import type { ITransferCallback } from "./ITransferCallback.js";
5
6
  /**
6
7
  * Dataspace Control Plane Component interface.
7
8
  * Implements Eclipse Dataspace Protocol (DSP) specifications:
@@ -86,6 +87,48 @@ export interface IDataspaceControlPlaneComponent extends IComponent {
86
87
  cursor?: string;
87
88
  count: number;
88
89
  }>;
90
+ /**
91
+ * Register a callback to receive transfer process state change notifications.
92
+ * Upstream modules register their callback here to be notified when a
93
+ * consumer-initiated transfer changes state (STARTED, COMPLETED, SUSPENDED,
94
+ * TERMINATED).
95
+ *
96
+ * This method has NO REST client implementation — in-process only.
97
+ * @param key A unique key identifying this callback registration.
98
+ * @param callback The callback interface to register.
99
+ */
100
+ registerTransferCallback(key: string, callback: ITransferCallback): void;
101
+ /**
102
+ * Unregister a previously registered transfer callback.
103
+ * @param key The key used when registering the callback.
104
+ */
105
+ unregisterTransferCallback(key: string): void;
106
+ /**
107
+ * Start a data transfer as a Consumer.
108
+ * High-level convenience wrapper around the DSP Transfer Request protocol.
109
+ *
110
+ * This method:
111
+ * 1. Generates a consumerPid.
112
+ * 2. POSTs a TransferRequestMessage to the provider's DSP endpoint.
113
+ * 3. Persists a local TransferProcess in REQUESTED state (only if provider accepts).
114
+ * 4. Returns the consumerPid immediately.
115
+ *
116
+ * The caller is notified of subsequent state changes (STARTED, COMPLETED, etc.)
117
+ * via the registered ITransferCallback. The transfer moves to STARTED when the
118
+ * provider POSTs a TransferStartMessage back to this node's callback address.
119
+ *
120
+ * This method has NO REST client implementation — in-process only.
121
+ *
122
+ * @param agreementId The finalized agreement ID (from contract negotiation).
123
+ * @param providerEndpoint The provider's DSP control plane base URL.
124
+ * @param publicOrigin The public origin URL of this control plane (used as callbackAddress).
125
+ * @param format The transfer format (e.g. "HttpProxy-PULL", "HttpProxy-PUSH").
126
+ * @param trustPayload Trust payload for authentication.
127
+ * @returns The consumerPid of the newly created TransferProcess.
128
+ */
129
+ startDataTransfer(agreementId: string, providerEndpoint: string, publicOrigin: string, format: string, trustPayload: unknown): Promise<{
130
+ consumerPid: string;
131
+ }>;
89
132
  /**
90
133
  * Request a Transfer Process.
91
134
  * Creates a new Transfer Process in REQUESTED state.
@@ -20,12 +20,12 @@ export interface INegotiationCallback {
20
20
  agreement?: IDataspaceProtocolAgreement;
21
21
  }): Promise<void>;
22
22
  /**
23
- * Called when the negotiation completes successfully (finalized).
23
+ * Called when the negotiation finalizes.
24
24
  * @param negotiationId The negotiation ID.
25
25
  * @param agreementId The agreement ID (from agreement.uid).
26
26
  * @returns Nothing.
27
27
  */
28
- onCompleted(negotiationId: string, agreementId: string): Promise<void>;
28
+ onFinalized(negotiationId: string, agreementId: string): Promise<void>;
29
29
  /**
30
30
  * Called when the negotiation fails (terminated or stalled).
31
31
  * @param negotiationId The negotiation ID.
@@ -0,0 +1,44 @@
1
+ import type { DataspaceProtocolTransferProcessStateType, IDataspaceProtocolTransferStartMessage } from "@twin.org/standards-dataspace-protocol";
2
+ /**
3
+ * Callback interface for transfer process state change notifications.
4
+ * Upstream modules register an implementation via
5
+ * IDataspaceControlPlaneComponent.registerTransferCallback() to be
6
+ * notified when a consumer-initiated transfer changes state.
7
+ */
8
+ export interface ITransferCallback {
9
+ /**
10
+ * Called on every DSP-level state transition for the transfer process.
11
+ * @param consumerPid The consumer-side process ID.
12
+ * @param state The new DSP state.
13
+ * @returns Nothing.
14
+ */
15
+ onStateChanged(consumerPid: string, state: DataspaceProtocolTransferProcessStateType): Promise<void>;
16
+ /**
17
+ * Called when the provider sends a TransferStartMessage to the consumer.
18
+ * The transfer is now STARTED and data can be accessed.
19
+ * @param consumerPid The consumer-side process ID.
20
+ * @param message The full DSP TransferStartMessage (contains dataAddress for PULL transfers).
21
+ * @returns Nothing.
22
+ */
23
+ onStarted(consumerPid: string, message: IDataspaceProtocolTransferStartMessage): Promise<void>;
24
+ /**
25
+ * Called when the transfer reaches COMPLETED state.
26
+ * @param consumerPid The consumer-side process ID.
27
+ * @returns Nothing.
28
+ */
29
+ onCompleted(consumerPid: string): Promise<void>;
30
+ /**
31
+ * Called when the transfer is SUSPENDED.
32
+ * @param consumerPid The consumer-side process ID.
33
+ * @param reason Optional suspension reason from the DSP message.
34
+ * @returns Nothing.
35
+ */
36
+ onSuspended(consumerPid: string, reason?: string): Promise<void>;
37
+ /**
38
+ * Called when the transfer is TERMINATED.
39
+ * @param consumerPid The consumer-side process ID.
40
+ * @param reason Optional termination reason from the DSP message.
41
+ * @returns Nothing.
42
+ */
43
+ onTerminated(consumerPid: string, reason?: string): Promise<void>;
44
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.34](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.0.3-next.33...dataspace-models-v0.0.3-next.34) (2026-06-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * add consumer transfer callbacks and startDataTransfer convenience method ([#151](https://github.com/iotaledger/twin-dataspace/issues/151)) ([0ab66c3](https://github.com/iotaledger/twin-dataspace/commit/0ab66c3636fd1f98f89baca1e99764d77c6f91d9))
9
+
10
+ ## [0.0.3-next.33](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.0.3-next.32...dataspace-models-v0.0.3-next.33) (2026-06-01)
11
+
12
+
13
+ ### Features
14
+
15
+ * rename completed callback ([#147](https://github.com/iotaledger/twin-dataspace/issues/147)) ([f62baad](https://github.com/iotaledger/twin-dataspace/commit/f62baad0ff444e2913439b12dcd06d20c9a4f6a4))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * implement missing trust check on negotiateAgreement ([#136](https://github.com/iotaledger/twin-dataspace/issues/136)) ([a3589c2](https://github.com/iotaledger/twin-dataspace/commit/a3589c279476d5450b68ea7c2790be7e3125bfe2))
21
+
3
22
  ## [0.0.3-next.32](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.0.3-next.31...dataspace-models-v0.0.3-next.32) (2026-05-29)
4
23
 
5
24
 
@@ -62,6 +62,7 @@
62
62
  - [IDataspaceControlPlaneComponent](interfaces/IDataspaceControlPlaneComponent.md)
63
63
  - [IDataspaceControlPlaneResolverComponent](interfaces/IDataspaceControlPlaneResolverComponent.md)
64
64
  - [INegotiationCallback](interfaces/INegotiationCallback.md)
65
+ - [ITransferCallback](interfaces/ITransferCallback.md)
65
66
  - [ITransferContext](interfaces/ITransferContext.md)
66
67
  - [ITransferProcess](interfaces/ITransferProcess.md)
67
68
  - [ITransferContextResponse](interfaces/ITransferContextResponse.md)
@@ -192,6 +192,116 @@ List of negotiation history entries with pagination cursor.
192
192
 
193
193
  ***
194
194
 
195
+ ### registerTransferCallback() {#registertransfercallback}
196
+
197
+ > **registerTransferCallback**(`key`, `callback`): `void`
198
+
199
+ Register a callback to receive transfer process state change notifications.
200
+ Upstream modules register their callback here to be notified when a
201
+ consumer-initiated transfer changes state (STARTED, COMPLETED, SUSPENDED,
202
+ TERMINATED).
203
+
204
+ This method has NO REST client implementation — in-process only.
205
+
206
+ #### Parameters
207
+
208
+ ##### key
209
+
210
+ `string`
211
+
212
+ A unique key identifying this callback registration.
213
+
214
+ ##### callback
215
+
216
+ [`ITransferCallback`](ITransferCallback.md)
217
+
218
+ The callback interface to register.
219
+
220
+ #### Returns
221
+
222
+ `void`
223
+
224
+ ***
225
+
226
+ ### unregisterTransferCallback() {#unregistertransfercallback}
227
+
228
+ > **unregisterTransferCallback**(`key`): `void`
229
+
230
+ Unregister a previously registered transfer callback.
231
+
232
+ #### Parameters
233
+
234
+ ##### key
235
+
236
+ `string`
237
+
238
+ The key used when registering the callback.
239
+
240
+ #### Returns
241
+
242
+ `void`
243
+
244
+ ***
245
+
246
+ ### startDataTransfer() {#startdatatransfer}
247
+
248
+ > **startDataTransfer**(`agreementId`, `providerEndpoint`, `publicOrigin`, `format`, `trustPayload`): `Promise`\<\{ `consumerPid`: `string`; \}\>
249
+
250
+ Start a data transfer as a Consumer.
251
+ High-level convenience wrapper around the DSP Transfer Request protocol.
252
+
253
+ This method:
254
+ 1. Generates a consumerPid.
255
+ 2. POSTs a TransferRequestMessage to the provider's DSP endpoint.
256
+ 3. Persists a local TransferProcess in REQUESTED state (only if provider accepts).
257
+ 4. Returns the consumerPid immediately.
258
+
259
+ The caller is notified of subsequent state changes (STARTED, COMPLETED, etc.)
260
+ via the registered ITransferCallback. The transfer moves to STARTED when the
261
+ provider POSTs a TransferStartMessage back to this node's callback address.
262
+
263
+ This method has NO REST client implementation — in-process only.
264
+
265
+ #### Parameters
266
+
267
+ ##### agreementId
268
+
269
+ `string`
270
+
271
+ The finalized agreement ID (from contract negotiation).
272
+
273
+ ##### providerEndpoint
274
+
275
+ `string`
276
+
277
+ The provider's DSP control plane base URL.
278
+
279
+ ##### publicOrigin
280
+
281
+ `string`
282
+
283
+ The public origin URL of this control plane (used as callbackAddress).
284
+
285
+ ##### format
286
+
287
+ `string`
288
+
289
+ The transfer format (e.g. "HttpProxy-PULL", "HttpProxy-PUSH").
290
+
291
+ ##### trustPayload
292
+
293
+ `unknown`
294
+
295
+ Trust payload for authentication.
296
+
297
+ #### Returns
298
+
299
+ `Promise`\<\{ `consumerPid`: `string`; \}\>
300
+
301
+ The consumerPid of the newly created TransferProcess.
302
+
303
+ ***
304
+
195
305
  ### requestTransfer() {#requesttransfer}
196
306
 
197
307
  > **requestTransfer**(`request`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferProcess` \| `IDataspaceProtocolTransferError`\>
@@ -231,7 +341,7 @@ both consumerPid and providerPid, or TransferError if the operation fails.
231
341
 
232
342
  ### startTransfer() {#starttransfer}
233
343
 
234
- > **startTransfer**(`message`, `publicOrigin`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferStartMessage`\>
344
+ > **startTransfer**(`message`, `publicOrigin`, `trustPayload`): `Promise`\<`IDataspaceProtocolTransferStartMessage` \| `IDataspaceProtocolTransferError`\>
235
345
 
236
346
  Start a Transfer Process.
237
347
  Transitions Transfer Process from REQUESTED to STARTED state, or resumes from SUSPENDED state.
@@ -263,7 +373,7 @@ Trust payload containing authorization information (JWT, VC, etc.).
263
373
 
264
374
  #### Returns
265
375
 
266
- `Promise`\<`IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferStartMessage`\>
376
+ `Promise`\<`IDataspaceProtocolTransferStartMessage` \| `IDataspaceProtocolTransferError`\>
267
377
 
268
378
  Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or TransferError if the operation fails.
269
379
 
@@ -51,11 +51,11 @@ Nothing.
51
51
 
52
52
  ***
53
53
 
54
- ### onCompleted() {#oncompleted}
54
+ ### onFinalized() {#onfinalized}
55
55
 
56
- > **onCompleted**(`negotiationId`, `agreementId`): `Promise`\<`void`\>
56
+ > **onFinalized**(`negotiationId`, `agreementId`): `Promise`\<`void`\>
57
57
 
58
- Called when the negotiation completes successfully (finalized).
58
+ Called when the negotiation finalizes.
59
59
 
60
60
  #### Parameters
61
61
 
@@ -6,7 +6,7 @@ API response for starting a transfer process.
6
6
 
7
7
  ### body {#body}
8
8
 
9
- > **body**: `IDataspaceProtocolTransferError` \| `IDataspaceProtocolTransferStartMessage`
9
+ > **body**: `IDataspaceProtocolTransferStartMessage` \| `IDataspaceProtocolTransferError`
10
10
 
11
11
  Transfer Start Message (DSP compliant) with dataAddress for PULL transfers, or error.
12
12
 
@@ -0,0 +1,141 @@
1
+ # Interface: ITransferCallback
2
+
3
+ Callback interface for transfer process state change notifications.
4
+ Upstream modules register an implementation via
5
+ IDataspaceControlPlaneComponent.registerTransferCallback() to be
6
+ notified when a consumer-initiated transfer changes state.
7
+
8
+ ## Methods
9
+
10
+ ### onStateChanged() {#onstatechanged}
11
+
12
+ > **onStateChanged**(`consumerPid`, `state`): `Promise`\<`void`\>
13
+
14
+ Called on every DSP-level state transition for the transfer process.
15
+
16
+ #### Parameters
17
+
18
+ ##### consumerPid
19
+
20
+ `string`
21
+
22
+ The consumer-side process ID.
23
+
24
+ ##### state
25
+
26
+ `DataspaceProtocolTransferProcessStateType`
27
+
28
+ The new DSP state.
29
+
30
+ #### Returns
31
+
32
+ `Promise`\<`void`\>
33
+
34
+ Nothing.
35
+
36
+ ***
37
+
38
+ ### onStarted() {#onstarted}
39
+
40
+ > **onStarted**(`consumerPid`, `message`): `Promise`\<`void`\>
41
+
42
+ Called when the provider sends a TransferStartMessage to the consumer.
43
+ The transfer is now STARTED and data can be accessed.
44
+
45
+ #### Parameters
46
+
47
+ ##### consumerPid
48
+
49
+ `string`
50
+
51
+ The consumer-side process ID.
52
+
53
+ ##### message
54
+
55
+ `IDataspaceProtocolTransferStartMessage`
56
+
57
+ The full DSP TransferStartMessage (contains dataAddress for PULL transfers).
58
+
59
+ #### Returns
60
+
61
+ `Promise`\<`void`\>
62
+
63
+ Nothing.
64
+
65
+ ***
66
+
67
+ ### onCompleted() {#oncompleted}
68
+
69
+ > **onCompleted**(`consumerPid`): `Promise`\<`void`\>
70
+
71
+ Called when the transfer reaches COMPLETED state.
72
+
73
+ #### Parameters
74
+
75
+ ##### consumerPid
76
+
77
+ `string`
78
+
79
+ The consumer-side process ID.
80
+
81
+ #### Returns
82
+
83
+ `Promise`\<`void`\>
84
+
85
+ Nothing.
86
+
87
+ ***
88
+
89
+ ### onSuspended() {#onsuspended}
90
+
91
+ > **onSuspended**(`consumerPid`, `reason?`): `Promise`\<`void`\>
92
+
93
+ Called when the transfer is SUSPENDED.
94
+
95
+ #### Parameters
96
+
97
+ ##### consumerPid
98
+
99
+ `string`
100
+
101
+ The consumer-side process ID.
102
+
103
+ ##### reason?
104
+
105
+ `string`
106
+
107
+ Optional suspension reason from the DSP message.
108
+
109
+ #### Returns
110
+
111
+ `Promise`\<`void`\>
112
+
113
+ Nothing.
114
+
115
+ ***
116
+
117
+ ### onTerminated() {#onterminated}
118
+
119
+ > **onTerminated**(`consumerPid`, `reason?`): `Promise`\<`void`\>
120
+
121
+ Called when the transfer is TERMINATED.
122
+
123
+ #### Parameters
124
+
125
+ ##### consumerPid
126
+
127
+ `string`
128
+
129
+ The consumer-side process ID.
130
+
131
+ ##### reason?
132
+
133
+ `string`
134
+
135
+ Optional termination reason from the DSP message.
136
+
137
+ #### Returns
138
+
139
+ `Promise`\<`void`\>
140
+
141
+ Nothing.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/dataspace-models",
3
- "version": "0.0.3-next.32",
3
+ "version": "0.0.3-next.34",
4
4
  "description": "Defines shared entities, interfaces, and data types used by control plane and data plane components.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/iotaledger/dataspace.git",
7
+ "url": "git+https://github.com/iotaledger/twin-dataspace.git",
8
8
  "directory": "packages/dataspace-models"
9
9
  },
10
10
  "author": "jose.cantera@iota.org",
@@ -56,7 +56,7 @@
56
56
  "schemas"
57
57
  ],
58
58
  "bugs": {
59
- "url": "git+https://github.com/iotaledger/dataspace/issues"
59
+ "url": "git+https://github.com/iotaledger/twin-dataspace/issues"
60
60
  },
61
61
  "homepage": "https://twindev.org"
62
62
  }