@twin.org/dataspace-models 0.9.2-next.2 → 0.9.2-next.3

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.
@@ -7,14 +7,15 @@ import { entity, property, SortDirection } from "@twin.org/entity";
7
7
  */
8
8
  let TransferProcess = class TransferProcess {
9
9
  /**
10
- * The consumer PID is the primary key.
11
- * Used for direct lookup by consumerPid.
10
+ * Internal id, the primary key. Both role records of a self transfer share consumerPid and
11
+ * providerPid, so only the internal id is collision-free within one partition.
12
12
  */
13
- consumerPid;
13
+ id;
14
14
  /**
15
- * Internal UUID for storage (secondary key for providerPid lookup).
15
+ * Consumer Process ID from the DSP protocol.
16
+ * Indexed for lookup by consumerPid.
16
17
  */
17
- id;
18
+ consumerPid;
18
19
  /**
19
20
  * Provider Process ID from the DSP protocol.
20
21
  * Indexed for lookup by providerPid.
@@ -47,8 +48,8 @@ let TransferProcess = class TransferProcess {
47
48
  providerIdentity;
48
49
  /**
49
50
  * This node's role in the transfer, captured at write time so state transitions and async delivery
50
- * can tell which party we are without inferring it from the matched PID (consumerPid is the primary
51
- * key on both nodes). Optional for back-compat with records written before this field existed.
51
+ * can tell which party we are without inferring it from the matched PID (a self transfer stores two
52
+ * records sharing both pids). Optional for back-compat with records written before this field existed.
52
53
  */
53
54
  localRole;
54
55
  /**
@@ -84,11 +85,11 @@ let TransferProcess = class TransferProcess {
84
85
  __decorate([
85
86
  property({ type: "string", isPrimary: true }),
86
87
  __metadata("design:type", String)
87
- ], TransferProcess.prototype, "consumerPid", void 0);
88
+ ], TransferProcess.prototype, "id", void 0);
88
89
  __decorate([
89
- property({ type: "string" }),
90
+ property({ type: "string", isSecondary: true }),
90
91
  __metadata("design:type", String)
91
- ], TransferProcess.prototype, "id", void 0);
92
+ ], TransferProcess.prototype, "consumerPid", void 0);
92
93
  __decorate([
93
94
  property({ type: "string", isSecondary: true }),
94
95
  __metadata("design:type", String)
@@ -150,7 +151,7 @@ __decorate([
150
151
  __metadata("design:type", Object)
151
152
  ], TransferProcess.prototype, "dataAddress", void 0);
152
153
  TransferProcess = __decorate([
153
- entity()
154
+ entity({ version: 1 })
154
155
  ], TransferProcess);
155
156
  export { TransferProcess };
156
157
  //# sourceMappingURL=transferProcess.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transferProcess.js","sourceRoot":"","sources":["../../../src/entities/transferProcess.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQnE;;;GAGG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IAC3B;;;OAGG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,EAAE,CAAU;IAEnB;;;OAGG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,WAAW,CAAU;IAE5B;;;OAGG;IAEI,KAAK,CAA6C;IAEzD;;OAEG;IAEI,SAAS,CAAU;IAE1B;;OAEG;IAEI,OAAO,CAAU;IAExB;;OAEG;IAEI,gBAAgB,CAAU;IAEjC;;OAEG;IAEI,gBAAgB,CAAU;IAEjC;;;;OAIG;IAEI,SAAS,CAAuB;IAEvC;;OAEG;IAEI,MAAM,CAAU;IAEvB;;OAEG;IAEI,eAAe,CAAU;IAEhC;;OAEG;IAEI,oBAAoB,CAAU;IAErC;;OAEG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,YAAY,CAAU;IAE7B;;OAEG;IAEI,QAAQ,CAA6B;IAE5C;;;OAGG;IAEI,WAAW,CAAiC;CACnD,CAAA;AAtGO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;oDAClB;AAMrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;2CACV;AAOZ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAA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,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACV;AA3GvC,eAAe;IAD3B,MAAM,EAAE;GACI,eAAe,CA4G3B","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\nimport type { IRightsManagementPolicy } from \"@twin.org/rights-management-models\";\nimport type {\n\tDataspaceProtocolTransferProcessStateType,\n\tIDataspaceProtocolDataAddress\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { TransferProcessRole } from \"../models/controlPlane/transferProcessRole.js\";\n\n/**\n * Transfer Process for shared storage between Control Plane and Data Plane.\n * This entity is the persistent representation of ITransferProcess.\n */\n@entity()\nexport class TransferProcess {\n\t/**\n\t * The consumer PID is the primary key.\n\t * Used for direct lookup by consumerPid.\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic consumerPid!: string;\n\n\t/**\n\t * Internal UUID for storage (secondary key for providerPid lookup).\n\t */\n\t@property({ type: \"string\" })\n\tpublic id!: string;\n\n\t/**\n\t * Provider Process ID from the DSP protocol.\n\t * Indexed for lookup by providerPid.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic providerPid!: string;\n\n\t/**\n\t * Agreement ID linking to the rights-management Agreement.\n\t */\n\t@property({ type: \"string\" })\n\tpublic agreementId!: string;\n\n\t/**\n\t * Transfer Process state from the DSP protocol.\n\t * One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.\n\t */\n\t@property({ type: \"string\" })\n\tpublic state!: DataspaceProtocolTransferProcessStateType;\n\n\t/**\n\t * Dataset ID for DSC resolution.\n\t */\n\t@property({ type: \"string\" })\n\tpublic datasetId!: string;\n\n\t/**\n\t * Offer ID from the original Catalog offer.\n\t */\n\t@property({ type: \"string\" })\n\tpublic offerId!: string;\n\n\t/**\n\t * Consumer identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic consumerIdentity?: string;\n\n\t/**\n\t * Provider identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic providerIdentity?: string;\n\n\t/**\n\t * This node's role in the transfer, captured at write time so state transitions and async delivery\n\t * can tell which party we are without inferring it from the matched PID (consumerPid is the primary\n\t * key on both nodes). Optional for back-compat with records written before this field existed.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic localRole?: TransferProcessRole;\n\n\t/**\n\t * Data format from the Dataset Distribution.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic format?: string;\n\n\t/**\n\t * Callback address for Consumer notifications.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic callbackAddress?: string;\n\n\t/**\n\t * The organization that owns this transfer process, captured from the request context at write time.\n\t */\n\t@property({ type: \"string\" })\n\tpublic organizationIdentity!: string;\n\n\t/**\n\t * Creation timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * Last update timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n\n\t/**\n\t * Policies from the Agreement (stored as JSON).\n\t */\n\t@property({ type: \"array\", format: \"json\", optional: true })\n\tpublic policies?: IRightsManagementPolicy[];\n\n\t/**\n\t * Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the\n\t * provider-built address persisted at start for PULL/POST; may expire while STARTED.\n\t */\n\t@property({ type: \"object\", format: \"json\", optional: true })\n\tpublic dataAddress?: IDataspaceProtocolDataAddress;\n}\n"]}
1
+ {"version":3,"file":"transferProcess.js","sourceRoot":"","sources":["../../../src/entities/transferProcess.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQnE;;;GAGG;AAEI,IAAM,eAAe,G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EAAE,IAAI,EAAE,CAAC;;yDACZ;AAM1B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACZ;AAQ1B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAMhC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACtB;AAMhB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACb;AAMzB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;6DACQ;AAM9B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC;;oDAC/D;AAMrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;;qDACrB;AAMtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAChB;AAOrC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACV;AA5GvC,eAAe;IAD3B,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,eAAe,CA6G3B","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\nimport type { IRightsManagementPolicy } from \"@twin.org/rights-management-models\";\nimport type {\n\tDataspaceProtocolTransferProcessStateType,\n\tIDataspaceProtocolDataAddress\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { TransferProcessRole } from \"../models/controlPlane/transferProcessRole.js\";\n\n/**\n * Transfer Process for shared storage between Control Plane and Data Plane.\n * This entity is the persistent representation of ITransferProcess.\n */\n@entity({ version: 1 })\nexport class TransferProcess {\n\t/**\n\t * Internal id, the primary key. Both role records of a self transfer share consumerPid and\n\t * providerPid, so only the internal id is collision-free within one partition.\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic id!: string;\n\n\t/**\n\t * Consumer Process ID from the DSP protocol.\n\t * Indexed for lookup by consumerPid.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic consumerPid!: string;\n\n\t/**\n\t * Provider Process ID from the DSP protocol.\n\t * Indexed for lookup by providerPid.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic providerPid!: string;\n\n\t/**\n\t * Agreement ID linking to the rights-management Agreement.\n\t */\n\t@property({ type: \"string\" })\n\tpublic agreementId!: string;\n\n\t/**\n\t * Transfer Process state from the DSP protocol.\n\t * One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.\n\t */\n\t@property({ type: \"string\" })\n\tpublic state!: DataspaceProtocolTransferProcessStateType;\n\n\t/**\n\t * Dataset ID for DSC resolution.\n\t */\n\t@property({ type: \"string\" })\n\tpublic datasetId!: string;\n\n\t/**\n\t * Offer ID from the original Catalog offer.\n\t */\n\t@property({ type: \"string\" })\n\tpublic offerId!: string;\n\n\t/**\n\t * Consumer identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic consumerIdentity?: string;\n\n\t/**\n\t * Provider identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic providerIdentity?: string;\n\n\t/**\n\t * This node's role in the transfer, captured at write time so state transitions and async delivery\n\t * can tell which party we are without inferring it from the matched PID (a self transfer stores two\n\t * records sharing both pids). Optional for back-compat with records written before this field existed.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic localRole?: TransferProcessRole;\n\n\t/**\n\t * Data format from the Dataset Distribution.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic format?: string;\n\n\t/**\n\t * Callback address for Consumer notifications.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic callbackAddress?: string;\n\n\t/**\n\t * The organization that owns this transfer process, captured from the request context at write time.\n\t */\n\t@property({ type: \"string\" })\n\tpublic organizationIdentity!: string;\n\n\t/**\n\t * Creation timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * Last update timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n\n\t/**\n\t * Policies from the Agreement (stored as JSON).\n\t */\n\t@property({ type: \"array\", format: \"json\", optional: true })\n\tpublic policies?: IRightsManagementPolicy[];\n\n\t/**\n\t * Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the\n\t * provider-built address persisted at start for PULL/POST; may expire while STARTED.\n\t */\n\t@property({ type: \"object\", format: \"json\", optional: true })\n\tpublic dataAddress?: IDataspaceProtocolDataAddress;\n}\n"]}
@@ -0,0 +1,156 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { entity, property, SortDirection } from "@twin.org/entity";
4
+ /**
5
+ * Transfer Process for shared storage between Control Plane and Data Plane, version 0.
6
+ * Keyed on consumerPid; superseded by the version keyed on the internal id.
7
+ */
8
+ let TransferProcessV0 = class TransferProcessV0 {
9
+ /**
10
+ * The consumer PID is the primary key.
11
+ * Used for direct lookup by consumerPid.
12
+ */
13
+ consumerPid;
14
+ /**
15
+ * Internal UUID for storage (secondary key for providerPid lookup).
16
+ */
17
+ id;
18
+ /**
19
+ * Provider Process ID from the DSP protocol.
20
+ * Indexed for lookup by providerPid.
21
+ */
22
+ providerPid;
23
+ /**
24
+ * Agreement ID linking to the rights-management Agreement.
25
+ */
26
+ agreementId;
27
+ /**
28
+ * Transfer Process state from the DSP protocol.
29
+ * One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.
30
+ */
31
+ state;
32
+ /**
33
+ * Dataset ID for DSC resolution.
34
+ */
35
+ datasetId;
36
+ /**
37
+ * Offer ID from the original Catalog offer.
38
+ */
39
+ offerId;
40
+ /**
41
+ * Consumer identity (DID or URI).
42
+ */
43
+ consumerIdentity;
44
+ /**
45
+ * Provider identity (DID or URI).
46
+ */
47
+ providerIdentity;
48
+ /**
49
+ * This node's role in the transfer, captured at write time so state transitions and async delivery
50
+ * can tell which party we are without inferring it from the matched PID (consumerPid is the primary
51
+ * key on both nodes). Optional for back-compat with records written before this field existed.
52
+ */
53
+ localRole;
54
+ /**
55
+ * Data format from the Dataset Distribution.
56
+ */
57
+ format;
58
+ /**
59
+ * Callback address for Consumer notifications.
60
+ */
61
+ callbackAddress;
62
+ /**
63
+ * The organization that owns this transfer process, captured from the request context at write time.
64
+ */
65
+ organizationIdentity;
66
+ /**
67
+ * Creation timestamp (ISO string format).
68
+ */
69
+ dateCreated;
70
+ /**
71
+ * Last update timestamp (ISO string format).
72
+ */
73
+ dateModified;
74
+ /**
75
+ * Policies from the Agreement (stored as JSON).
76
+ */
77
+ policies;
78
+ /**
79
+ * Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the
80
+ * provider-built address persisted at start for PULL/POST; may expire while STARTED.
81
+ */
82
+ dataAddress;
83
+ };
84
+ __decorate([
85
+ property({ type: "string", isPrimary: true }),
86
+ __metadata("design:type", String)
87
+ ], TransferProcessV0.prototype, "consumerPid", void 0);
88
+ __decorate([
89
+ property({ type: "string" }),
90
+ __metadata("design:type", String)
91
+ ], TransferProcessV0.prototype, "id", void 0);
92
+ __decorate([
93
+ property({ type: "string", isSecondary: true }),
94
+ __metadata("design:type", String)
95
+ ], TransferProcessV0.prototype, "providerPid", void 0);
96
+ __decorate([
97
+ property({ type: "string" }),
98
+ __metadata("design:type", String)
99
+ ], TransferProcessV0.prototype, "agreementId", void 0);
100
+ __decorate([
101
+ property({ type: "string" }),
102
+ __metadata("design:type", String)
103
+ ], TransferProcessV0.prototype, "state", void 0);
104
+ __decorate([
105
+ property({ type: "string" }),
106
+ __metadata("design:type", String)
107
+ ], TransferProcessV0.prototype, "datasetId", void 0);
108
+ __decorate([
109
+ property({ type: "string" }),
110
+ __metadata("design:type", String)
111
+ ], TransferProcessV0.prototype, "offerId", void 0);
112
+ __decorate([
113
+ property({ type: "string", optional: true }),
114
+ __metadata("design:type", String)
115
+ ], TransferProcessV0.prototype, "consumerIdentity", void 0);
116
+ __decorate([
117
+ property({ type: "string", optional: true }),
118
+ __metadata("design:type", String)
119
+ ], TransferProcessV0.prototype, "providerIdentity", void 0);
120
+ __decorate([
121
+ property({ type: "string", optional: true }),
122
+ __metadata("design:type", String)
123
+ ], TransferProcessV0.prototype, "localRole", void 0);
124
+ __decorate([
125
+ property({ type: "string", optional: true }),
126
+ __metadata("design:type", String)
127
+ ], TransferProcessV0.prototype, "format", void 0);
128
+ __decorate([
129
+ property({ type: "string", optional: true }),
130
+ __metadata("design:type", String)
131
+ ], TransferProcessV0.prototype, "callbackAddress", void 0);
132
+ __decorate([
133
+ property({ type: "string" }),
134
+ __metadata("design:type", String)
135
+ ], TransferProcessV0.prototype, "organizationIdentity", void 0);
136
+ __decorate([
137
+ property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
138
+ __metadata("design:type", String)
139
+ ], TransferProcessV0.prototype, "dateCreated", void 0);
140
+ __decorate([
141
+ property({ type: "string", format: "date-time" }),
142
+ __metadata("design:type", String)
143
+ ], TransferProcessV0.prototype, "dateModified", void 0);
144
+ __decorate([
145
+ property({ type: "array", format: "json", optional: true }),
146
+ __metadata("design:type", Array)
147
+ ], TransferProcessV0.prototype, "policies", void 0);
148
+ __decorate([
149
+ property({ type: "object", format: "json", optional: true }),
150
+ __metadata("design:type", Object)
151
+ ], TransferProcessV0.prototype, "dataAddress", void 0);
152
+ TransferProcessV0 = __decorate([
153
+ entity({ version: 0 })
154
+ ], TransferProcessV0);
155
+ export { TransferProcessV0 };
156
+ //# sourceMappingURL=transferProcessV0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transferProcessV0.js","sourceRoot":"","sources":["../../../src/entities/transferProcessV0.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQnE;;;GAGG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B;;;OAGG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,EAAE,CAAU;IAEnB;;;OAGG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,WAAW,CAAU;IAE5B;;;OAGG;IAEI,KAAK,CAA6C;IAEzD;;OAEG;IAEI,SAAS,CAAU;IAE1B;;OAEG;IAEI,OAAO,CAAU;IAExB;;OAEG;IAEI,gBAAgB,CAAU;IAEjC;;OAEG;IAEI,gBAAgB,CAAU;IAEjC;;;;OAIG;IAEI,SAAS,CAAuB;IAEvC;;OAEG;IAEI,MAAM,CAAU;IAEvB;;OAEG;IAEI,eAAe,CAAU;IAEhC;;OAEG;IAEI,oBAAoB,CAAU;IAErC;;OAEG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAEI,YAAY,CAAU;IAE7B;;OAEG;IAEI,QAAQ,CAA6B;IAE5C;;;OAGG;IAEI,WAAW,CAAiC;CACnD,CAAA;AAtGO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;sDAClB;AAMrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;6CACV;AAOZ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;;sDACpB;AAMrB;IADN,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AE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACV;AA3GvC,iBAAiB;IAD7B,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,iBAAiB,CA4G7B","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\nimport type { IRightsManagementPolicy } from \"@twin.org/rights-management-models\";\nimport type {\n\tDataspaceProtocolTransferProcessStateType,\n\tIDataspaceProtocolDataAddress\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { TransferProcessRole } from \"../models/controlPlane/transferProcessRole.js\";\n\n/**\n * Transfer Process for shared storage between Control Plane and Data Plane, version 0.\n * Keyed on consumerPid; superseded by the version keyed on the internal id.\n */\n@entity({ version: 0 })\nexport class TransferProcessV0 {\n\t/**\n\t * The consumer PID is the primary key.\n\t * Used for direct lookup by consumerPid.\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic consumerPid!: string;\n\n\t/**\n\t * Internal UUID for storage (secondary key for providerPid lookup).\n\t */\n\t@property({ type: \"string\" })\n\tpublic id!: string;\n\n\t/**\n\t * Provider Process ID from the DSP protocol.\n\t * Indexed for lookup by providerPid.\n\t */\n\t@property({ type: \"string\", isSecondary: true })\n\tpublic providerPid!: string;\n\n\t/**\n\t * Agreement ID linking to the rights-management Agreement.\n\t */\n\t@property({ type: \"string\" })\n\tpublic agreementId!: string;\n\n\t/**\n\t * Transfer Process state from the DSP protocol.\n\t * One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.\n\t */\n\t@property({ type: \"string\" })\n\tpublic state!: DataspaceProtocolTransferProcessStateType;\n\n\t/**\n\t * Dataset ID for DSC resolution.\n\t */\n\t@property({ type: \"string\" })\n\tpublic datasetId!: string;\n\n\t/**\n\t * Offer ID from the original Catalog offer.\n\t */\n\t@property({ type: \"string\" })\n\tpublic offerId!: string;\n\n\t/**\n\t * Consumer identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic consumerIdentity?: string;\n\n\t/**\n\t * Provider identity (DID or URI).\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic providerIdentity?: string;\n\n\t/**\n\t * This node's role in the transfer, captured at write time so state transitions and async delivery\n\t * can tell which party we are without inferring it from the matched PID (consumerPid is the primary\n\t * key on both nodes). Optional for back-compat with records written before this field existed.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic localRole?: TransferProcessRole;\n\n\t/**\n\t * Data format from the Dataset Distribution.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic format?: string;\n\n\t/**\n\t * Callback address for Consumer notifications.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic callbackAddress?: string;\n\n\t/**\n\t * The organization that owns this transfer process, captured from the request context at write time.\n\t */\n\t@property({ type: \"string\" })\n\tpublic organizationIdentity!: string;\n\n\t/**\n\t * Creation timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * Last update timestamp (ISO string format).\n\t */\n\t@property({ type: \"string\", format: \"date-time\" })\n\tpublic dateModified!: string;\n\n\t/**\n\t * Policies from the Agreement (stored as JSON).\n\t */\n\t@property({ type: \"array\", format: \"json\", optional: true })\n\tpublic policies?: IRightsManagementPolicy[];\n\n\t/**\n\t * Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the\n\t * provider-built address persisted at start for PULL/POST; may expire while STARTED.\n\t */\n\t@property({ type: \"object\", format: \"json\", optional: true })\n\tpublic dataAddress?: IDataspaceProtocolDataAddress;\n}\n"]}
package/dist/es/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
  export * from "./entities/dataspaceAppDataset.js";
5
5
  export * from "./entities/dataspaceAppDatasetV0.js";
6
6
  export * from "./entities/transferProcess.js";
7
+ export * from "./entities/transferProcessV0.js";
7
8
  export * from "./entities/transferRetrieval.js";
8
9
  // Control Plane exports
9
10
  export * from "./models/controlPlane/api/ITransferContextResponse.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,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAEhD,wBAAwB;AACxB,cAAc,uDAAuD,CAAC;AACtE,cAAc,yDAAyD,CAAC;AACxE,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,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AAEjE,qBAAqB;AACrB,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,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,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC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-Identifier: Apache-2.0.\n\n// Entity exports\nexport * from \"./entities/dataspaceAppDataset.js\";\nexport * from \"./entities/dataspaceAppDatasetV0.js\";\nexport * from \"./entities/transferProcess.js\";\nexport * from \"./entities/transferRetrieval.js\";\n\n// Control Plane exports\nexport * from \"./models/controlPlane/api/ITransferContextResponse.js\";\nexport * from \"./models/controlPlane/dataspaceControlPlaneMetricIds.js\";\nexport * from \"./models/controlPlane/dataspaceControlPlaneMetrics.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/ITransferQueryResult.js\";\nexport * from \"./models/controlPlane/transferProcessRole.js\";\nexport * from \"./models/controlPlane/transferTerminationCode.js\";\n\n// Data Plane exports\nexport * from \"./models/dataPlane/dataspaceDataPlaneMetricIds.js\";\nexport * from \"./models/dataPlane/dataspaceDataPlaneMetrics.js\";\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/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/IGetProtocolVersionsResponse.js\";\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,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAEhD,wBAAwB;AACxB,cAAc,uDAAuD,CAAC;AACtE,cAAc,yDAAyD,CAAC;AACxE,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,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AAEjE,qBAAqB;AACrB,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,oDAAoD,CAAC;AAEnE,cAAc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,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/dataspaceAppDatasetV0.js\";\nexport * from \"./entities/transferProcess.js\";\nexport * from \"./entities/transferProcessV0.js\";\nexport * from \"./entities/transferRetrieval.js\";\n\n// Control Plane exports\nexport * from \"./models/controlPlane/api/ITransferContextResponse.js\";\nexport * from \"./models/controlPlane/dataspaceControlPlaneMetricIds.js\";\nexport * from \"./models/controlPlane/dataspaceControlPlaneMetrics.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/ITransferQueryResult.js\";\nexport * from \"./models/controlPlane/transferProcessRole.js\";\nexport * from \"./models/controlPlane/transferTerminationCode.js\";\n\n// Data Plane exports\nexport * from \"./models/dataPlane/dataspaceDataPlaneMetricIds.js\";\nexport * from \"./models/dataPlane/dataspaceDataPlaneMetrics.js\";\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/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/IGetProtocolVersionsResponse.js\";\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"]}
@@ -7,14 +7,15 @@ import type { TransferProcessRole } from "../models/controlPlane/transferProcess
7
7
  */
8
8
  export declare class TransferProcess {
9
9
  /**
10
- * The consumer PID is the primary key.
11
- * Used for direct lookup by consumerPid.
10
+ * Internal id, the primary key. Both role records of a self transfer share consumerPid and
11
+ * providerPid, so only the internal id is collision-free within one partition.
12
12
  */
13
- consumerPid: string;
13
+ id: string;
14
14
  /**
15
- * Internal UUID for storage (secondary key for providerPid lookup).
15
+ * Consumer Process ID from the DSP protocol.
16
+ * Indexed for lookup by consumerPid.
16
17
  */
17
- id: string;
18
+ consumerPid: string;
18
19
  /**
19
20
  * Provider Process ID from the DSP protocol.
20
21
  * Indexed for lookup by providerPid.
@@ -47,8 +48,8 @@ export declare class TransferProcess {
47
48
  providerIdentity?: string;
48
49
  /**
49
50
  * This node's role in the transfer, captured at write time so state transitions and async delivery
50
- * can tell which party we are without inferring it from the matched PID (consumerPid is the primary
51
- * key on both nodes). Optional for back-compat with records written before this field existed.
51
+ * can tell which party we are without inferring it from the matched PID (a self transfer stores two
52
+ * records sharing both pids). Optional for back-compat with records written before this field existed.
52
53
  */
53
54
  localRole?: TransferProcessRole;
54
55
  /**
@@ -0,0 +1,83 @@
1
+ import type { IRightsManagementPolicy } from "@twin.org/rights-management-models";
2
+ import type { DataspaceProtocolTransferProcessStateType, IDataspaceProtocolDataAddress } from "@twin.org/standards-dataspace-protocol";
3
+ import type { TransferProcessRole } from "../models/controlPlane/transferProcessRole.js";
4
+ /**
5
+ * Transfer Process for shared storage between Control Plane and Data Plane, version 0.
6
+ * Keyed on consumerPid; superseded by the version keyed on the internal id.
7
+ */
8
+ export declare class TransferProcessV0 {
9
+ /**
10
+ * The consumer PID is the primary key.
11
+ * Used for direct lookup by consumerPid.
12
+ */
13
+ consumerPid: string;
14
+ /**
15
+ * Internal UUID for storage (secondary key for providerPid lookup).
16
+ */
17
+ id: string;
18
+ /**
19
+ * Provider Process ID from the DSP protocol.
20
+ * Indexed for lookup by providerPid.
21
+ */
22
+ providerPid: string;
23
+ /**
24
+ * Agreement ID linking to the rights-management Agreement.
25
+ */
26
+ agreementId: string;
27
+ /**
28
+ * Transfer Process state from the DSP protocol.
29
+ * One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.
30
+ */
31
+ state: DataspaceProtocolTransferProcessStateType;
32
+ /**
33
+ * Dataset ID for DSC resolution.
34
+ */
35
+ datasetId: string;
36
+ /**
37
+ * Offer ID from the original Catalog offer.
38
+ */
39
+ offerId: string;
40
+ /**
41
+ * Consumer identity (DID or URI).
42
+ */
43
+ consumerIdentity?: string;
44
+ /**
45
+ * Provider identity (DID or URI).
46
+ */
47
+ providerIdentity?: string;
48
+ /**
49
+ * This node's role in the transfer, captured at write time so state transitions and async delivery
50
+ * can tell which party we are without inferring it from the matched PID (consumerPid is the primary
51
+ * key on both nodes). Optional for back-compat with records written before this field existed.
52
+ */
53
+ localRole?: TransferProcessRole;
54
+ /**
55
+ * Data format from the Dataset Distribution.
56
+ */
57
+ format?: string;
58
+ /**
59
+ * Callback address for Consumer notifications.
60
+ */
61
+ callbackAddress?: string;
62
+ /**
63
+ * The organization that owns this transfer process, captured from the request context at write time.
64
+ */
65
+ organizationIdentity: string;
66
+ /**
67
+ * Creation timestamp (ISO string format).
68
+ */
69
+ dateCreated: string;
70
+ /**
71
+ * Last update timestamp (ISO string format).
72
+ */
73
+ dateModified: string;
74
+ /**
75
+ * Policies from the Agreement (stored as JSON).
76
+ */
77
+ policies?: IRightsManagementPolicy[];
78
+ /**
79
+ * Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the
80
+ * provider-built address persisted at start for PULL/POST; may expire while STARTED.
81
+ */
82
+ dataAddress?: IDataspaceProtocolDataAddress;
83
+ }
@@ -1,6 +1,7 @@
1
1
  export * from "./entities/dataspaceAppDataset.js";
2
2
  export * from "./entities/dataspaceAppDatasetV0.js";
3
3
  export * from "./entities/transferProcess.js";
4
+ export * from "./entities/transferProcessV0.js";
4
5
  export * from "./entities/transferRetrieval.js";
5
6
  export * from "./models/controlPlane/api/ITransferContextResponse.js";
6
7
  export * from "./models/controlPlane/dataspaceControlPlaneMetricIds.js";
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.2-next.3](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.9.2-next.2...dataspace-models-v0.9.2-next.3) (2026-07-31)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * keep one TransferProcess record per role in self transfers ([#321](https://github.com/iotaledger/twin-dataspace/issues/321)) ([91ccc87](https://github.com/iotaledger/twin-dataspace/commit/91ccc87e47d94c6a015e3f974f0dd4cf680c4603))
9
+
3
10
  ## [0.9.2-next.2](https://github.com/iotaledger/twin-dataspace/compare/dataspace-models-v0.9.2-next.1...dataspace-models-v0.9.2-next.2) (2026-07-30)
4
11
 
5
12
 
@@ -15,20 +15,21 @@ This entity is the persistent representation of ITransferProcess.
15
15
 
16
16
  ## Properties
17
17
 
18
- ### consumerPid {#consumerpid}
18
+ ### id {#id}
19
19
 
20
- > **consumerPid**: `string`
20
+ > **id**: `string`
21
21
 
22
- The consumer PID is the primary key.
23
- Used for direct lookup by consumerPid.
22
+ Internal id, the primary key. Both role records of a self transfer share consumerPid and
23
+ providerPid, so only the internal id is collision-free within one partition.
24
24
 
25
25
  ***
26
26
 
27
- ### id {#id}
27
+ ### consumerPid {#consumerpid}
28
28
 
29
- > **id**: `string`
29
+ > **consumerPid**: `string`
30
30
 
31
- Internal UUID for storage (secondary key for providerPid lookup).
31
+ Consumer Process ID from the DSP protocol.
32
+ Indexed for lookup by consumerPid.
32
33
 
33
34
  ***
34
35
 
@@ -95,8 +96,8 @@ Provider identity (DID or URI).
95
96
  > `optional` **localRole?**: [`TransferProcessRole`](../type-aliases/TransferProcessRole.md)
96
97
 
97
98
  This node's role in the transfer, captured at write time so state transitions and async delivery
98
- can tell which party we are without inferring it from the matched PID (consumerPid is the primary
99
- key on both nodes). Optional for back-compat with records written before this field existed.
99
+ can tell which party we are without inferring it from the matched PID (a self transfer stores two
100
+ records sharing both pids). Optional for back-compat with records written before this field existed.
100
101
 
101
102
  ***
102
103
 
@@ -0,0 +1,156 @@
1
+ # Class: TransferProcessV0
2
+
3
+ Transfer Process for shared storage between Control Plane and Data Plane, version 0.
4
+ Keyed on consumerPid; superseded by the version keyed on the internal id.
5
+
6
+ ## Constructors
7
+
8
+ ### Constructor
9
+
10
+ > **new TransferProcessV0**(): `TransferProcessV0`
11
+
12
+ #### Returns
13
+
14
+ `TransferProcessV0`
15
+
16
+ ## Properties
17
+
18
+ ### consumerPid {#consumerpid}
19
+
20
+ > **consumerPid**: `string`
21
+
22
+ The consumer PID is the primary key.
23
+ Used for direct lookup by consumerPid.
24
+
25
+ ***
26
+
27
+ ### id {#id}
28
+
29
+ > **id**: `string`
30
+
31
+ Internal UUID for storage (secondary key for providerPid lookup).
32
+
33
+ ***
34
+
35
+ ### providerPid {#providerpid}
36
+
37
+ > **providerPid**: `string`
38
+
39
+ Provider Process ID from the DSP protocol.
40
+ Indexed for lookup by providerPid.
41
+
42
+ ***
43
+
44
+ ### agreementId {#agreementid}
45
+
46
+ > **agreementId**: `string`
47
+
48
+ Agreement ID linking to the rights-management Agreement.
49
+
50
+ ***
51
+
52
+ ### state {#state}
53
+
54
+ > **state**: `DataspaceProtocolTransferProcessStateType`
55
+
56
+ Transfer Process state from the DSP protocol.
57
+ One of: REQUESTED, STARTED, COMPLETED, SUSPENDED, TERMINATED.
58
+
59
+ ***
60
+
61
+ ### datasetId {#datasetid}
62
+
63
+ > **datasetId**: `string`
64
+
65
+ Dataset ID for DSC resolution.
66
+
67
+ ***
68
+
69
+ ### offerId {#offerid}
70
+
71
+ > **offerId**: `string`
72
+
73
+ Offer ID from the original Catalog offer.
74
+
75
+ ***
76
+
77
+ ### consumerIdentity? {#consumeridentity}
78
+
79
+ > `optional` **consumerIdentity?**: `string`
80
+
81
+ Consumer identity (DID or URI).
82
+
83
+ ***
84
+
85
+ ### providerIdentity? {#provideridentity}
86
+
87
+ > `optional` **providerIdentity?**: `string`
88
+
89
+ Provider identity (DID or URI).
90
+
91
+ ***
92
+
93
+ ### localRole? {#localrole}
94
+
95
+ > `optional` **localRole?**: [`TransferProcessRole`](../type-aliases/TransferProcessRole.md)
96
+
97
+ This node's role in the transfer, captured at write time so state transitions and async delivery
98
+ can tell which party we are without inferring it from the matched PID (consumerPid is the primary
99
+ key on both nodes). Optional for back-compat with records written before this field existed.
100
+
101
+ ***
102
+
103
+ ### format? {#format}
104
+
105
+ > `optional` **format?**: `string`
106
+
107
+ Data format from the Dataset Distribution.
108
+
109
+ ***
110
+
111
+ ### callbackAddress? {#callbackaddress}
112
+
113
+ > `optional` **callbackAddress?**: `string`
114
+
115
+ Callback address for Consumer notifications.
116
+
117
+ ***
118
+
119
+ ### organizationIdentity {#organizationidentity}
120
+
121
+ > **organizationIdentity**: `string`
122
+
123
+ The organization that owns this transfer process, captured from the request context at write time.
124
+
125
+ ***
126
+
127
+ ### dateCreated {#datecreated}
128
+
129
+ > **dateCreated**: `string`
130
+
131
+ Creation timestamp (ISO string format).
132
+
133
+ ***
134
+
135
+ ### dateModified {#datemodified}
136
+
137
+ > **dateModified**: `string`
138
+
139
+ Last update timestamp (ISO string format).
140
+
141
+ ***
142
+
143
+ ### policies? {#policies}
144
+
145
+ > `optional` **policies?**: `IRightsManagementPolicy`[]
146
+
147
+ Policies from the Agreement (stored as JSON).
148
+
149
+ ***
150
+
151
+ ### dataAddress? {#dataaddress}
152
+
153
+ > `optional` **dataAddress?**: `IDataspaceProtocolDataAddress`
154
+
155
+ Data address for the transfer (stored as JSON): the consumer's inbox for PUSH, or the
156
+ provider-built address persisted at start for PULL/POST; may expire while STARTED.
@@ -6,6 +6,7 @@
6
6
  - [DataspaceAppDataset](classes/DataspaceAppDataset.md)
7
7
  - [DataspaceAppDatasetV0](classes/DataspaceAppDatasetV0.md)
8
8
  - [TransferProcess](classes/TransferProcess.md)
9
+ - [TransferProcessV0](classes/TransferProcessV0.md)
9
10
  - [TransferRetrieval](classes/TransferRetrieval.md)
10
11
 
11
12
  ## Interfaces
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/dataspace-models",
3
- "version": "0.9.2-next.2",
3
+ "version": "0.9.2-next.3",
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",