@twin.org/dataspace-control-plane-service 0.0.3-next.29 → 0.0.3-next.30
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/dataspaceControlPlaneService.js +436 -125
- package/dist/es/dataspaceControlPlaneService.js.map +1 -1
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IDataspaceControlPlaneServiceConstructorOptions.js.map +1 -1
- package/dist/es/models/endpointProperties.js +18 -0
- package/dist/es/models/endpointProperties.js.map +1 -0
- package/dist/es/utils/transferErrorUtils.js +1 -1
- package/dist/es/utils/transferErrorUtils.js.map +1 -1
- package/dist/types/dataspaceControlPlaneService.d.ts +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IDataspaceControlPlaneServiceConstructorOptions.d.ts +6 -1
- package/dist/types/models/endpointProperties.d.ts +18 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IDataspaceControlPlaneServiceConstructorOptions.md +15 -1
- package/docs/reference/type-aliases/EndpointProperties.md +5 -0
- package/docs/reference/variables/EndpointProperties.md +20 -0
- package/locales/en.json +10 -5
- package/package.json +3 -2
- package/dist/es/utils/dataHelpers.js +0 -22
- package/dist/es/utils/dataHelpers.js.map +0 -1
- package/dist/types/utils/dataHelpers.d.ts +0 -1
package/dist/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export * from "./dataspaceControlPlanePolicyRequester.js";
|
|
4
4
|
export * from "./dataspaceControlPlaneRoutes.js";
|
|
5
5
|
export * from "./dataspaceControlPlaneService.js";
|
|
6
|
+
export * from "./models/endpointProperties.js";
|
|
6
7
|
export * from "./models/IDataspaceControlPlaneServiceConfig.js";
|
|
7
8
|
export * from "./models/IDataspaceControlPlaneServiceConstructorOptions.js";
|
|
8
9
|
export * from "./models/INegotiationState.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataspaceControlPlanePolicyRequester.js\";\nexport * from \"./dataspaceControlPlaneRoutes.js\";\nexport * from \"./dataspaceControlPlaneService.js\";\nexport * from \"./models/IDataspaceControlPlaneServiceConfig.js\";\nexport * from \"./models/IDataspaceControlPlaneServiceConstructorOptions.js\";\nexport * from \"./models/INegotiationState.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iDAAiD,CAAC;AAChE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataspaceControlPlanePolicyRequester.js\";\nexport * from \"./dataspaceControlPlaneRoutes.js\";\nexport * from \"./dataspaceControlPlaneService.js\";\nexport * from \"./models/endpointProperties.js\";\nexport * from \"./models/IDataspaceControlPlaneServiceConfig.js\";\nexport * from \"./models/IDataspaceControlPlaneServiceConstructorOptions.js\";\nexport * from \"./models/INegotiationState.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDataspaceControlPlaneServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IDataspaceControlPlaneServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDataspaceControlPlaneServiceConfig } from \"./IDataspaceControlPlaneServiceConfig.js\";\n\n/**\n * Dataspace Control Plane service constructor options.\n */\nexport interface IDataspaceControlPlaneServiceConstructorOptions {\n\t/**\n\t * Policy Administration Point component type.\n\t * Used for Agreement lookup and validation during Transfer Process initiation.\n\t * @default policy-administration-point\n\t */\n\tpolicyAdministrationPointComponentType?: string;\n\n\t/**\n\t * Policy Negotiation Point component type.\n\t * Used for contract negotiation to create agreements before transfer processes.\n\t * @default policy-negotiation-point\n\t */\n\tpolicyNegotiationPointComponentType?: string;\n\n\t/**\n\t * Policy Negotiation Admin Point component type.\n\t * Used for querying negotiation history.\n\t * Optional - if not provided, negotiation history will not be available.\n\t * @default policy-negotiation-admin-point\n\t */\n\tpolicyNegotiationAdminPointComponentType?: string;\n\n\t/**\n\t * Federated Catalogue component type.\n\t * Used for dataset validation during Transfer Process initiation.\n\t * Validates that Agreements reference valid catalog datasets.\n\t * @default federated-catalogue\n\t */\n\tfederatedCatalogueComponentType?: string;\n\n\t/**\n\t * Logging component type.\n\t * @default logging\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Identity component type (for token signing/verification).\n\t * @default identity\n\t */\n\tidentityComponentType?: string;\n\n\t/**\n\t * Identity Authentication component type (for token validation).\n\t * @default identity-authentication\n\t */\n\tidentityAuthenticationComponentType?: string;\n\n\t/**\n\t * Trust component type for trust verification.\n\t * Used to verify JWT/VC tokens and extract identity information.\n\t * @default trust\n\t */\n\ttrustComponentType?: string;\n\n\t/**\n\t * Entity storage type for Transfer Process entities.\n\t * Used to persist transfer state for the consumerPid flow.\n\t * Must match the Data Plane's transferProcessEntityStorageType for shared storage.\n\t * @default transfer-process\n\t */\n\ttransferProcessEntityStorageType?: string;\n\n\t/**\n\t * Entity storage type for Dataspace App Dataset entities.\n\t * @default dataspace-app-dataset\n\t */\n\tdataspaceAppDatasetEntityStorageType?: string;\n\n\t/**\n\t * Task scheduler component type for periodic cleanup of stalled negotiations.\n\t * @default task-scheduler\n\t */\n\ttaskSchedulerComponentType?: string;\n\n\t/**\n\t * URL Transformer component type used to encrypt the tenant token into the data-plane
|
|
1
|
+
{"version":3,"file":"IDataspaceControlPlaneServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IDataspaceControlPlaneServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDataspaceControlPlaneServiceConfig } from \"./IDataspaceControlPlaneServiceConfig.js\";\n\n/**\n * Dataspace Control Plane service constructor options.\n */\nexport interface IDataspaceControlPlaneServiceConstructorOptions {\n\t/**\n\t * Policy Administration Point component type.\n\t * Used for Agreement lookup and validation during Transfer Process initiation.\n\t * @default policy-administration-point\n\t */\n\tpolicyAdministrationPointComponentType?: string;\n\n\t/**\n\t * Policy Negotiation Point component type.\n\t * Used for contract negotiation to create agreements before transfer processes.\n\t * @default policy-negotiation-point\n\t */\n\tpolicyNegotiationPointComponentType?: string;\n\n\t/**\n\t * Policy Negotiation Admin Point component type.\n\t * Used for querying negotiation history.\n\t * Optional - if not provided, negotiation history will not be available.\n\t * @default policy-negotiation-admin-point\n\t */\n\tpolicyNegotiationAdminPointComponentType?: string;\n\n\t/**\n\t * Federated Catalogue component type.\n\t * Used for dataset validation during Transfer Process initiation.\n\t * Validates that Agreements reference valid catalog datasets.\n\t * @default federated-catalogue\n\t */\n\tfederatedCatalogueComponentType?: string;\n\n\t/**\n\t * Logging component type.\n\t * @default logging\n\t */\n\tloggingComponentType?: string;\n\n\t/**\n\t * Identity component type (for token signing/verification).\n\t * @default identity\n\t */\n\tidentityComponentType?: string;\n\n\t/**\n\t * Identity Authentication component type (for token validation).\n\t * @default identity-authentication\n\t */\n\tidentityAuthenticationComponentType?: string;\n\n\t/**\n\t * Trust component type for trust verification.\n\t * Used to verify JWT/VC tokens and extract identity information.\n\t * @default trust\n\t */\n\ttrustComponentType?: string;\n\n\t/**\n\t * Entity storage type for Transfer Process entities.\n\t * Used to persist transfer state for the consumerPid flow.\n\t * Must match the Data Plane's transferProcessEntityStorageType for shared storage.\n\t * @default transfer-process\n\t */\n\ttransferProcessEntityStorageType?: string;\n\n\t/**\n\t * Entity storage type for Dataspace App Dataset entities.\n\t * @default dataspace-app-dataset\n\t */\n\tdataspaceAppDatasetEntityStorageType?: string;\n\n\t/**\n\t * Task scheduler component type for periodic cleanup of stalled negotiations.\n\t * @default task-scheduler\n\t */\n\ttaskSchedulerComponentType?: string;\n\n\t/**\n\t * Data Plane component type, used to invoke push subscription lifecycle methods.\n\t * @default dataspace-data-plane\n\t */\n\tdataPlaneComponentType?: string;\n\n\t/**\n\t * URL Transformer component type used to encrypt the tenant token into the data-plane.\n\t * @default url-transformer\n\t */\n\turlTransformerComponentType?: string;\n\n\t/**\n\t * The configuration of the Dataspace Control Plane Service.\n\t */\n\tconfig?: IDataspaceControlPlaneServiceConfig;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The properties of an endpoint in a Transfer Process.
|
|
5
|
+
* Determines the configuration and authorization details for the endpoint.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const EndpointProperties = {
|
|
9
|
+
/**
|
|
10
|
+
* Authorization property - the authorization token for the endpoint.
|
|
11
|
+
*/
|
|
12
|
+
Authorization: "authorization",
|
|
13
|
+
/**
|
|
14
|
+
* Authorization type - the type of authorization used for the endpoint.
|
|
15
|
+
*/
|
|
16
|
+
AuthType: "authType"
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=endpointProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpointProperties.js","sourceRoot":"","sources":["../../../src/models/endpointProperties.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;GAGG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,QAAQ,EAAE,UAAU;CACX,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The properties of an endpoint in a Transfer Process.\n * Determines the configuration and authorization details for the endpoint.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EndpointProperties = {\n\t/**\n\t * Authorization property - the authorization token for the endpoint.\n\t */\n\tAuthorization: \"authorization\",\n\n\t/**\n\t * Authorization type - the type of authorization used for the endpoint.\n\t */\n\tAuthType: \"authType\"\n} as const;\n\n/**\n * Type for EndpointProperties values.\n */\nexport type EndpointProperties = (typeof EndpointProperties)[keyof typeof EndpointProperties];\n"]}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { HttpErrorHelper } from "@twin.org/api-models";
|
|
4
4
|
import { BaseError, Is } from "@twin.org/core";
|
|
5
|
+
import { getJsonLdType } from "@twin.org/dataspace-models";
|
|
5
6
|
import { DataspaceProtocolCatalogTypes, DataspaceProtocolContexts, DataspaceProtocolTransferProcessTypes } from "@twin.org/standards-dataspace-protocol";
|
|
6
7
|
import { HttpStatusCode } from "@twin.org/web";
|
|
7
|
-
import { getJsonLdType } from "./dataHelpers.js";
|
|
8
8
|
/**
|
|
9
9
|
* Fallback value used when PIDs cannot be extracted from a malformed message.
|
|
10
10
|
* DSP protocol requires consumerPid and providerPid in TransferError responses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferErrorUtils.js","sourceRoot":"","sources":["../../../src/utils/transferErrorUtils.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAe,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EACzB,qCAAqC,EAGrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"transferErrorUtils.js","sourceRoot":"","sources":["../../../src/utils/transferErrorUtils.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAe,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EACzB,qCAAqC,EAGrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CACvC,KAAc,EACd,IAAqD;IAErD,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,OAAO;QACN,UAAU,EAAE,CAAC,yBAAyB,CAAC,OAAO,CAAC;QAC/C,OAAO,EAAE,qCAAqC,CAAC,aAAa;QAC5D,WAAW,EAAE,IAAI,EAAE,WAAW,IAAI,WAAW;QAC7C,WAAW,EAAE,IAAI,EAAE,WAAW,IAAI,WAAW;QAC7C,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;QACpD,MAAM,EAAE,SAAS;KACjB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAe;IACzD,4BAA4B;IAC5B,IACC,EAAE,CAAC,MAAM,CAAkC,MAAM,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,KAAK,qCAAqC,CAAC,aAAa,EACtE,CAAC;QACF,gDAAgD;QAChD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3C,OAAO,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;QAC9E,CAAC;QACD,OAAO,cAAc,CAAC,UAAU,CAAC;IAClC,CAAC;IAED,gBAAgB;IAChB,IAAI,EAAE,CAAC,MAAM,CAAS,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,OAAO,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CACjC,KAAqC,EACrC,SAAiB;IAEjB,OAAO,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC5C,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,6BAA6B,CAAC,YAAY,CAAC;AAC5E,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { HttpErrorHelper } from \"@twin.org/api-models\";\nimport { BaseError, type IError, Is } from \"@twin.org/core\";\nimport { getJsonLdType } from \"@twin.org/dataspace-models\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\tDataspaceProtocolTransferProcessTypes,\n\ttype IDataspaceProtocolCatalogError,\n\ttype IDataspaceProtocolTransferError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport { HttpStatusCode } from \"@twin.org/web\";\n\n/**\n * Fallback value used when PIDs cannot be extracted from a malformed message.\n * DSP protocol requires consumerPid and providerPid in TransferError responses,\n * so we must provide a value even when the request is completely malformed.\n */\nconst UNKNOWN_PID = \"urn:dsp:unknown\";\n\n/**\n * Transform an error to DS Protocol TransferError format.\n * Used by both service and route layers to ensure consistent error responses.\n * Following the same pattern as Federated Catalogue's catalogErrorUtils.ts.\n * The code property uses semantic format \"ErrorName:message\".\n * The reason property contains the full flattened error chain for debugging.\n * @param error The error to transform.\n * @param pids Optional object containing consumerPid and/or providerPid.\n * @param pids.consumerPid Optional consumer process ID.\n * @param pids.providerPid Optional provider process ID.\n * @returns The TransferError.\n */\nexport function transformToTransferError(\n\terror: unknown,\n\tpids?: { consumerPid?: string; providerPid?: string }\n): IDataspaceProtocolTransferError {\n\tconst flattened = BaseError.flatten(error);\n\n\treturn {\n\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\"@type\": DataspaceProtocolTransferProcessTypes.TransferError,\n\t\tconsumerPid: pids?.consumerPid ?? UNKNOWN_PID,\n\t\tproviderPid: pids?.providerPid ?? UNKNOWN_PID,\n\t\tcode: `${flattened[0].name}:${flattened[0].message}`,\n\t\treason: flattened\n\t};\n}\n\n/**\n * Transform the DS Protocol result to an HTTP status code.\n * Used by the routes layer to derive HTTP status from TransferError.\n *\n * @param result The result to transform.\n * @returns The transformed status code or undefined if no transformation was found or not an error.\n */\nexport function transformErrorToStatusCode(result: unknown): HttpStatusCode | undefined {\n\t// Is this a transfer error?\n\tif (\n\t\tIs.object<IDataspaceProtocolTransferError>(result) &&\n\t\tresult[\"@type\"] === DataspaceProtocolTransferProcessTypes.TransferError\n\t) {\n\t\t// Extract the error name to map to status codes\n\t\tif (result.code) {\n\t\t\tconst codePart = result.code.split(\":\")[0];\n\t\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[codePart] ?? HttpStatusCode.badRequest;\n\t\t}\n\t\treturn HttpStatusCode.badRequest;\n\t}\n\n\t// Regular error\n\tif (Is.object<IError>(result) && !BaseError.isEmpty(result)) {\n\t\treturn HttpErrorHelper.ERROR_TYPE_MAP[result.name] ?? HttpStatusCode.badRequest;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Check if a CatalogError contains a specific error name in its code.\n * @param error The CatalogError to check.\n * @param errorName The error name to check for (e.g., NotFoundError.CLASS_NAME).\n * @returns True if the error code contains the specified error name.\n */\nexport function isCatalogErrorName(\n\terror: IDataspaceProtocolCatalogError,\n\terrorName: string\n): boolean {\n\treturn error.code?.includes(errorName) ?? false;\n}\n\n/**\n * Check if a CatalogError contains a specific error name in its code.\n * @param error The CatalogError to check.\n * @returns True if the error code contains the specified error name.\n */\nexport function isCatalogError(error: unknown): error is IDataspaceProtocolCatalogError {\n\treturn getJsonLdType(error) === DataspaceProtocolCatalogTypes.CatalogError;\n}\n"]}
|
|
@@ -190,4 +190,16 @@ export declare class DataspaceControlPlaneService implements IDataspaceControlPl
|
|
|
190
190
|
* @param id The stored app dataset id.
|
|
191
191
|
*/
|
|
192
192
|
deleteAppDataset(id: string): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Extract the dataset ID from an ODRL agreement's target.
|
|
195
|
+
* @param agreement The ODRL agreement containing the target.
|
|
196
|
+
* @returns The dataset ID extracted from the target URN.
|
|
197
|
+
* @throws GeneralError if the agreement target is missing, has no UID, or has multiple targets.
|
|
198
|
+
*/
|
|
199
|
+
private extractDatasetId;
|
|
200
|
+
/**
|
|
201
|
+
* Creates the internal INegotiationCallback that fans out to all registered callbacks.
|
|
202
|
+
* @returns The internal negotiation callback.
|
|
203
|
+
*/
|
|
204
|
+
private createInternalCallback;
|
|
193
205
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./dataspaceControlPlanePolicyRequester.js";
|
|
2
2
|
export * from "./dataspaceControlPlaneRoutes.js";
|
|
3
3
|
export * from "./dataspaceControlPlaneService.js";
|
|
4
|
+
export * from "./models/endpointProperties.js";
|
|
4
5
|
export * from "./models/IDataspaceControlPlaneServiceConfig.js";
|
|
5
6
|
export * from "./models/IDataspaceControlPlaneServiceConstructorOptions.js";
|
|
6
7
|
export * from "./models/INegotiationState.js";
|
|
@@ -68,7 +68,12 @@ export interface IDataspaceControlPlaneServiceConstructorOptions {
|
|
|
68
68
|
*/
|
|
69
69
|
taskSchedulerComponentType?: string;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Data Plane component type, used to invoke push subscription lifecycle methods.
|
|
72
|
+
* @default dataspace-data-plane
|
|
73
|
+
*/
|
|
74
|
+
dataPlaneComponentType?: string;
|
|
75
|
+
/**
|
|
76
|
+
* URL Transformer component type used to encrypt the tenant token into the data-plane.
|
|
72
77
|
* @default url-transformer
|
|
73
78
|
*/
|
|
74
79
|
urlTransformerComponentType?: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The properties of an endpoint in a Transfer Process.
|
|
3
|
+
* Determines the configuration and authorization details for the endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EndpointProperties: {
|
|
6
|
+
/**
|
|
7
|
+
* Authorization property - the authorization token for the endpoint.
|
|
8
|
+
*/
|
|
9
|
+
readonly Authorization: "authorization";
|
|
10
|
+
/**
|
|
11
|
+
* Authorization type - the type of authorization used for the endpoint.
|
|
12
|
+
*/
|
|
13
|
+
readonly AuthType: "authType";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Type for EndpointProperties values.
|
|
17
|
+
*/
|
|
18
|
+
export type EndpointProperties = (typeof EndpointProperties)[keyof typeof EndpointProperties];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.30](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.29...dataspace-control-plane-service-v0.0.3-next.30) (2026-05-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* implement DSP push transfer mode ([#109](https://github.com/iotaledger/twin-dataspace/issues/109)) ([71f5fee](https://github.com/iotaledger/twin-dataspace/commit/71f5feec1d92dfec8ed6899c951809818e1bf2a3))
|
|
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.29 to 0.0.3-next.30
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.29](https://github.com/iotaledger/twin-dataspace/compare/dataspace-control-plane-service-v0.0.3-next.28...dataspace-control-plane-service-v0.0.3-next.29) (2026-05-20)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
- [IDataspaceControlPlaneServiceConstructorOptions](interfaces/IDataspaceControlPlaneServiceConstructorOptions.md)
|
|
12
12
|
- [INegotiationState](interfaces/INegotiationState.md)
|
|
13
13
|
|
|
14
|
+
## Type Aliases
|
|
15
|
+
|
|
16
|
+
- [EndpointProperties](type-aliases/EndpointProperties.md)
|
|
17
|
+
|
|
14
18
|
## Variables
|
|
15
19
|
|
|
16
20
|
- [tagsDataspaceControlPlane](variables/tagsDataspaceControlPlane.md)
|
|
21
|
+
- [EndpointProperties](variables/EndpointProperties.md)
|
|
17
22
|
- [restEntryPoints](variables/restEntryPoints.md)
|
|
18
23
|
|
|
19
24
|
## Functions
|
|
@@ -167,11 +167,25 @@ task-scheduler
|
|
|
167
167
|
|
|
168
168
|
***
|
|
169
169
|
|
|
170
|
+
### dataPlaneComponentType? {#dataplanecomponenttype}
|
|
171
|
+
|
|
172
|
+
> `optional` **dataPlaneComponentType?**: `string`
|
|
173
|
+
|
|
174
|
+
Data Plane component type, used to invoke push subscription lifecycle methods.
|
|
175
|
+
|
|
176
|
+
#### Default
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
dataspace-data-plane
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
***
|
|
183
|
+
|
|
170
184
|
### urlTransformerComponentType? {#urltransformercomponenttype}
|
|
171
185
|
|
|
172
186
|
> `optional` **urlTransformerComponentType?**: `string`
|
|
173
187
|
|
|
174
|
-
URL Transformer component type used to encrypt the tenant token into the data-plane
|
|
188
|
+
URL Transformer component type used to encrypt the tenant token into the data-plane.
|
|
175
189
|
|
|
176
190
|
#### Default
|
|
177
191
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Variable: EndpointProperties
|
|
2
|
+
|
|
3
|
+
> `const` **EndpointProperties**: `object`
|
|
4
|
+
|
|
5
|
+
The properties of an endpoint in a Transfer Process.
|
|
6
|
+
Determines the configuration and authorization details for the endpoint.
|
|
7
|
+
|
|
8
|
+
## Type Declaration
|
|
9
|
+
|
|
10
|
+
### Authorization {#authorization}
|
|
11
|
+
|
|
12
|
+
> `readonly` **Authorization**: `"authorization"` = `"authorization"`
|
|
13
|
+
|
|
14
|
+
Authorization property - the authorization token for the endpoint.
|
|
15
|
+
|
|
16
|
+
### AuthType {#authtype}
|
|
17
|
+
|
|
18
|
+
> `readonly` **AuthType**: `"authType"` = `"authType"`
|
|
19
|
+
|
|
20
|
+
Authorization type - the type of authorization used for the endpoint.
|
package/locales/en.json
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"negotiationStateRetrieved": "Negotiation state retrieved successfully",
|
|
22
22
|
"getNegotiationHistory": "Retrieving negotiation history",
|
|
23
23
|
"negotiationHistoryRetrieved": "Negotiation history retrieved successfully",
|
|
24
|
-
"stalledNegotiationsCleanupComplete": "Stalled negotiations cleanup completed (cleanedUp: {cleanedUp})"
|
|
24
|
+
"stalledNegotiationsCleanupComplete": "Stalled negotiations cleanup completed (cleanedUp: {cleanedUp})",
|
|
25
|
+
"pushTransferStarted": "PUSH transfer started (consumerPid: {consumerPid}, providerPid: {providerPid}, endpoint: {endpoint})"
|
|
25
26
|
},
|
|
26
27
|
"dataspaceControlPlanePolicyRequester": {
|
|
27
28
|
"offerReceived": "Offer received from provider (negotiationId: {negotiationId}, offerId: {offerId})",
|
|
@@ -40,7 +41,6 @@
|
|
|
40
41
|
"warn": {
|
|
41
42
|
"dataspaceControlPlaneService": {
|
|
42
43
|
"catalogDatasetHasNoOffers": "Dataset has no Offers (odrl:hasPolicy) in Federated Catalogue",
|
|
43
|
-
"pushTransferModeNotImplemented": "PUSH transfer mode requested but not implemented. Consumer provided dataAddress endpoint but data push is not yet supported.",
|
|
44
44
|
"stalledNegotiationCleanedUp": "Stalled negotiation cleaned up (negotiationId: {negotiationId})"
|
|
45
45
|
},
|
|
46
46
|
"dataspaceControlPlanePolicyRequester": {
|
|
@@ -73,8 +73,9 @@
|
|
|
73
73
|
"agreementNotMatchingOffer": "Agreement \"{agreementId}\" does not match any Catalog Offer for dataset {datasetId}. Available Offers: {availableOffers}",
|
|
74
74
|
"organizationContextMissing": "Organization context is missing. Cannot verify Agreement authorization for consumerPid: {consumerPid}",
|
|
75
75
|
"organizationContextMissingProvider": "Organization context is missing. Cannot verify Agreement authorization for providerPid: {providerPid}",
|
|
76
|
-
"agreementAssignerMismatch": "Agreement assigner does not match current
|
|
77
|
-
"agreementAssignerMismatchProvider": "Agreement assigner does not match current
|
|
76
|
+
"agreementAssignerMismatch": "Agreement assigner does not match current caller identity. Agreement: {agreementId}, consumerPid: {consumerPid}, expected: {expectedComposite}, actual: {actualAssigner}",
|
|
77
|
+
"agreementAssignerMismatchProvider": "Agreement assigner does not match current caller identity. Agreement: {agreementId}, providerPid: {providerPid}, expected: {expectedComposite}, actual: {actualAssigner}",
|
|
78
|
+
"invalidCompositeIdentifier": "Composite tenant identifier is not in a recognised shape (expected `nodeDid` or `nodeDid:tenantIdHash`, where `nodeDid` starts with `did:`). Got: \"{composite}\"",
|
|
78
79
|
"agreementAssigneeMismatch": "Agreement assignee does not match expected consumer identity. Agreement: {agreementId}, providerPid: {providerPid}, expected: {expectedConsumerIdentity}, actual: {actualAssignee}",
|
|
79
80
|
"negotiationInitiationFailed": "Failed to initiate contract negotiation",
|
|
80
81
|
"datasetNotFoundInCatalog": "Dataset/Offer \"{offerId}\" not found in Federated Catalogue. Cannot initiate negotiation for non-existent offer.",
|
|
@@ -91,11 +92,15 @@
|
|
|
91
92
|
"callerNotAuthorizedAsProvider": "The caller's verified identity does not match the provider for this transfer process",
|
|
92
93
|
"callerNotAuthorizedForTransfer": "The caller's verified identity does not match the consumer or provider for this transfer process",
|
|
93
94
|
"multipleAssignersNotSupported": "Multiple assigners found in agreement, which is not supported. Only single assigner agreements are supported.",
|
|
95
|
+
"invalidPushDataAddress": "PUSH transfer cannot start: consumer dataAddress is missing endpoint or endpointType (consumerPid: {consumerPid})",
|
|
96
|
+
"pushTransferDataPathNotConfigured": "PUSH transfer cannot start: dataPlanePath is not configured (consumerPid: {consumerPid})",
|
|
97
|
+
"dataPlaneNotRegistered": "Push-mode transfer requires the data plane component to be registered (factory key: \"dataspace-data-plane\"). This deployment was configured without a data plane — register one to enable push, or use pull-mode transfers only.",
|
|
94
98
|
"datasetPublishFailed": "Failed to publish dataset {datasetRecordId} for app {appId} (tenant: {tenantId})",
|
|
95
99
|
"datasetNodeContextRequired": "A node context is required to register a dataset.",
|
|
96
100
|
"datasetAlreadyExists": "A dataset with id \"{id}\" already exists.",
|
|
97
101
|
"datasetNotFound": "Dataset not found",
|
|
98
|
-
"datasetWrongTenant": "The calling tenant does not own this dataset."
|
|
102
|
+
"datasetWrongTenant": "The calling tenant does not own this dataset.",
|
|
103
|
+
"transferWrongTenant": "The calling tenant does not own this transfer."
|
|
99
104
|
},
|
|
100
105
|
"dataspaceControlPlanePolicyRequester": {}
|
|
101
106
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dataspace-control-plane-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.30",
|
|
4
4
|
"description": "Implements agreement negotiation and transfer process lifecycle management for control plane operations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"@twin.org/api-tenant-processor": "next",
|
|
19
19
|
"@twin.org/context": "next",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
|
-
"@twin.org/
|
|
21
|
+
"@twin.org/crypto": "next",
|
|
22
|
+
"@twin.org/dataspace-models": "0.0.3-next.30",
|
|
22
23
|
"@twin.org/entity": "next",
|
|
23
24
|
"@twin.org/entity-storage-models": "next",
|
|
24
25
|
"@twin.org/federated-catalogue-models": "next",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 IOTA Stiftung.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { ObjectHelper } from "@twin.org/core";
|
|
4
|
-
/**
|
|
5
|
-
* Get a JSON-LD id.
|
|
6
|
-
* @param object The object to get the id from.
|
|
7
|
-
* @returns The JSON-LD id.
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export function getJsonLdId(object) {
|
|
11
|
-
return ObjectHelper.extractProperty(object, ["@id", "id"], false);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get a JSON-LD type.
|
|
15
|
-
* @param object The object to get the type from.
|
|
16
|
-
* @returns The JSON-LD type.
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export function getJsonLdType(object) {
|
|
20
|
-
return ObjectHelper.extractProperty(object, ["@type", "type"], false);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=dataHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataHelpers.js","sourceRoot":"","sources":["../../../src/utils/dataHelpers.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe;IAC1C,OAAO,YAAY,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAe;IAC5C,OAAO,YAAY,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AACvE,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\nimport { ObjectHelper } from \"@twin.org/core\";\n\n/**\n * Get a JSON-LD id.\n * @param object The object to get the id from.\n * @returns The JSON-LD id.\n * @internal\n */\nexport function getJsonLdId(object: unknown): string | undefined {\n\treturn ObjectHelper.extractProperty(object, [\"@id\", \"id\"], false);\n}\n\n/**\n * Get a JSON-LD type.\n * @param object The object to get the type from.\n * @returns The JSON-LD type.\n * @internal\n */\nexport function getJsonLdType(object: unknown): string | undefined {\n\treturn ObjectHelper.extractProperty(object, [\"@type\", \"type\"], false);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|