@twin.org/entity-storage-connector-dynamodb 0.0.1-next.22 → 0.0.1-next.24

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.
@@ -280,9 +280,10 @@ class DynamoDbEntityStorageConnector {
280
280
  * @param conditions The optional conditions to match for the entities.
281
281
  * @returns The id of the entity.
282
282
  */
283
- async set(entity, conditions) {
284
- core.Guards.object(this.CLASS_NAME, "entity", entity);
285
- const id = entity[this._primaryKey.property];
283
+ async set(entity$1, conditions) {
284
+ core.Guards.object(this.CLASS_NAME, "entity", entity$1);
285
+ entity.EntitySchemaHelper.validateEntity(entity$1, this.getSchema());
286
+ const id = entity$1[this._primaryKey.property];
286
287
  try {
287
288
  const docClient = this.createDocClient();
288
289
  const { conditionExpression, attributeNames, attributeValues } = this.buildConditionExpression(conditions);
@@ -290,7 +291,7 @@ class DynamoDbEntityStorageConnector {
290
291
  TableName: this._config.tableName,
291
292
  Item: {
292
293
  [DynamoDbEntityStorageConnector._PARTITION_ID_NAME]: DynamoDbEntityStorageConnector._PARTITION_ID_VALUE,
293
- ...entity
294
+ ...entity$1
294
295
  },
295
296
  // Only set the condition expression if we have conditions to match
296
297
  // and the primary key exists, otherwise we are creating a new object
@@ -280,6 +280,7 @@ class DynamoDbEntityStorageConnector {
280
280
  */
281
281
  async set(entity, conditions) {
282
282
  Guards.object(this.CLASS_NAME, "entity", entity);
283
+ EntitySchemaHelper.validateEntity(entity, this.getSchema());
283
284
  const id = entity[this._primaryKey.property];
284
285
  try {
285
286
  const docClient = this.createDocClient();
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/entity-storage-connector-dynamodb - Changelog
2
2
 
3
- ## v0.0.1-next.22
3
+ ## v0.0.1-next.24
4
4
 
5
5
  - Initial Release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-dynamodb",
3
- "version": "0.0.1-next.22",
3
+ "version": "0.0.1-next.24",
4
4
  "description": "Entity Storage connector implementation using DynamoDb storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,12 +14,12 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@aws-sdk/client-dynamodb": "3.738",
18
- "@aws-sdk/lib-dynamodb": "3.738",
19
- "@aws-sdk/util-dynamodb": "3.738",
17
+ "@aws-sdk/client-dynamodb": "3.758",
18
+ "@aws-sdk/lib-dynamodb": "3.758",
19
+ "@aws-sdk/util-dynamodb": "3.758",
20
20
  "@twin.org/core": "next",
21
21
  "@twin.org/entity": "next",
22
- "@twin.org/entity-storage-models": "0.0.1-next.22",
22
+ "@twin.org/entity-storage-models": "0.0.1-next.24",
23
23
  "@twin.org/logging-models": "next",
24
24
  "@twin.org/nameof": "next"
25
25
  },