@twin.org/entity-storage-connector-synchronised 0.0.2-next.3 → 0.0.2-next.4
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/cjs/index.cjs +8 -3
- package/dist/esm/index.mjs +8 -3
- package/docs/changelog.md +16 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -51,13 +51,19 @@ class SynchronisedEntityStorageConnector {
|
|
|
51
51
|
this._entitySchema = entity.EntitySchemaFactory.get(options.entitySchema);
|
|
52
52
|
this._storageKey = options?.config?.storageKey ?? core.StringHelper.kebabCase(options.entitySchema);
|
|
53
53
|
this._primaryKey = entity.EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
54
|
-
const requiredProperties = [
|
|
54
|
+
const requiredProperties = [
|
|
55
|
+
"id",
|
|
56
|
+
"nodeIdentity",
|
|
57
|
+
"dateModified"
|
|
58
|
+
];
|
|
55
59
|
for (const requiredProperty of requiredProperties) {
|
|
56
60
|
const foundProperty = this._entitySchema.properties?.find(prop => prop.property === requiredProperty);
|
|
57
61
|
if (core.Is.empty(foundProperty)) {
|
|
58
62
|
throw new core.GeneralError(this.CLASS_NAME, "missingRequiredProperty", { requiredProperty });
|
|
59
63
|
}
|
|
60
|
-
else if (core.Is.empty(foundProperty.
|
|
64
|
+
else if (core.Is.empty(foundProperty.isPrimary) &&
|
|
65
|
+
core.Is.empty(foundProperty.isSecondary) &&
|
|
66
|
+
core.Is.empty(foundProperty.sortDirection)) {
|
|
61
67
|
throw new core.GeneralError(this.CLASS_NAME, "missingRequiredPropertySort", {
|
|
62
68
|
requiredProperty
|
|
63
69
|
});
|
|
@@ -178,7 +184,6 @@ class SynchronisedEntityStorageConnector {
|
|
|
178
184
|
// Publish the batch response with the entities
|
|
179
185
|
this._eventBusComponent.publish(synchronisedStorageModels.SynchronisedStorageTopics.BatchResponse, {
|
|
180
186
|
storageKey: this._storageKey,
|
|
181
|
-
primaryKey: this._primaryKey.property,
|
|
182
187
|
entities: result.entities,
|
|
183
188
|
lastEntry: !core.Is.stringValue(cursor)
|
|
184
189
|
});
|
package/dist/esm/index.mjs
CHANGED
|
@@ -49,13 +49,19 @@ class SynchronisedEntityStorageConnector {
|
|
|
49
49
|
this._entitySchema = EntitySchemaFactory.get(options.entitySchema);
|
|
50
50
|
this._storageKey = options?.config?.storageKey ?? StringHelper.kebabCase(options.entitySchema);
|
|
51
51
|
this._primaryKey = EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
52
|
-
const requiredProperties = [
|
|
52
|
+
const requiredProperties = [
|
|
53
|
+
"id",
|
|
54
|
+
"nodeIdentity",
|
|
55
|
+
"dateModified"
|
|
56
|
+
];
|
|
53
57
|
for (const requiredProperty of requiredProperties) {
|
|
54
58
|
const foundProperty = this._entitySchema.properties?.find(prop => prop.property === requiredProperty);
|
|
55
59
|
if (Is.empty(foundProperty)) {
|
|
56
60
|
throw new GeneralError(this.CLASS_NAME, "missingRequiredProperty", { requiredProperty });
|
|
57
61
|
}
|
|
58
|
-
else if (Is.empty(foundProperty.
|
|
62
|
+
else if (Is.empty(foundProperty.isPrimary) &&
|
|
63
|
+
Is.empty(foundProperty.isSecondary) &&
|
|
64
|
+
Is.empty(foundProperty.sortDirection)) {
|
|
59
65
|
throw new GeneralError(this.CLASS_NAME, "missingRequiredPropertySort", {
|
|
60
66
|
requiredProperty
|
|
61
67
|
});
|
|
@@ -176,7 +182,6 @@ class SynchronisedEntityStorageConnector {
|
|
|
176
182
|
// Publish the batch response with the entities
|
|
177
183
|
this._eventBusComponent.publish(SynchronisedStorageTopics.BatchResponse, {
|
|
178
184
|
storageKey: this._storageKey,
|
|
179
|
-
primaryKey: this._primaryKey.property,
|
|
180
185
|
entities: result.entities,
|
|
181
186
|
lastEntry: !Is.stringValue(cursor)
|
|
182
187
|
});
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-synchronised-v0.0.2-next.3...entity-storage-connector-synchronised-v0.0.2-next.4) (2025-08-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* support new synchronised storage features ([a43ee88](https://github.com/twinfoundation/entity-storage/commit/a43ee88431ee3eb8e59e4aeb176009d63ea09d05))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
18
|
+
|
|
3
19
|
## [0.0.2-next.3](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-synchronised-v0.0.2-next.2...entity-storage-connector-synchronised-v0.0.2-next.3) (2025-07-25)
|
|
4
20
|
|
|
5
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-synchronised",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.4",
|
|
4
4
|
"description": "Entity Storage connector implementation using synchronised storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
18
|
"@twin.org/entity": "next",
|
|
19
|
-
"@twin.org/entity-storage-models": "0.0.2-next.
|
|
19
|
+
"@twin.org/entity-storage-models": "0.0.2-next.4",
|
|
20
20
|
"@twin.org/event-bus-models": "next",
|
|
21
21
|
"@twin.org/logging-models": "next",
|
|
22
22
|
"@twin.org/nameof": "next",
|