@twin.org/entity-storage-connector-cosmosdb 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.
- package/dist/cjs/index.cjs +5 -4
- package/dist/esm/index.mjs +1 -0
- package/docs/changelog.md +1 -1
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -267,9 +267,10 @@ class CosmosDbEntityStorageConnector {
|
|
|
267
267
|
* @param conditions The optional conditions to match for the entities.
|
|
268
268
|
* @returns The id of the entity.
|
|
269
269
|
*/
|
|
270
|
-
async set(entity, conditions) {
|
|
271
|
-
core.Guards.object(this.CLASS_NAME, "entity", entity);
|
|
272
|
-
|
|
270
|
+
async set(entity$1, conditions) {
|
|
271
|
+
core.Guards.object(this.CLASS_NAME, "entity", entity$1);
|
|
272
|
+
entity.EntitySchemaHelper.validateEntity(entity$1, this.getSchema());
|
|
273
|
+
const id = entity$1[this._primaryKey.property];
|
|
273
274
|
try {
|
|
274
275
|
if (core.Is.arrayValue(conditions)) {
|
|
275
276
|
const item = await this._container.item(id, CosmosDbEntityStorageConnector._PARTITION_ID_VALUE);
|
|
@@ -281,7 +282,7 @@ class CosmosDbEntityStorageConnector {
|
|
|
281
282
|
await this._container.items.upsert({
|
|
282
283
|
id,
|
|
283
284
|
[CosmosDbEntityStorageConnector._PARTITION_ID_NAME]: CosmosDbEntityStorageConnector._PARTITION_ID_VALUE,
|
|
284
|
-
...entity
|
|
285
|
+
...entity$1
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
288
|
catch (err) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -267,6 +267,7 @@ class CosmosDbEntityStorageConnector {
|
|
|
267
267
|
*/
|
|
268
268
|
async set(entity, conditions) {
|
|
269
269
|
Guards.object(this.CLASS_NAME, "entity", entity);
|
|
270
|
+
EntitySchemaHelper.validateEntity(entity, this.getSchema());
|
|
270
271
|
const id = entity[this._primaryKey.property];
|
|
271
272
|
try {
|
|
272
273
|
if (Is.arrayValue(conditions)) {
|
package/docs/changelog.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-cosmosdb",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.24",
|
|
4
4
|
"description": "Entity Storage connector implementation using CosmosDB storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@azure/cosmos": "^4.2.0",
|
|
18
|
-
"@azure/identity": "^4.
|
|
18
|
+
"@azure/identity": "^4.7.0",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/entity": "next",
|
|
21
|
-
"@twin.org/entity-storage-models": "0.0.1-next.
|
|
21
|
+
"@twin.org/entity-storage-models": "0.0.1-next.24",
|
|
22
22
|
"@twin.org/logging-models": "next",
|
|
23
23
|
"@twin.org/nameof": "next"
|
|
24
24
|
},
|