@twin.org/entity-storage-connector-cosmosdb 0.0.2-next.7 → 0.0.2-next.9

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/README.md CHANGED
@@ -15,7 +15,7 @@ The tests developed are functional tests and need an instance of CosmosDB up and
15
15
  To run a Docker image of Azure CosmosDB:
16
16
 
17
17
  ```sh
18
- docker run -d --platform=linux/amd64 -p 8081:8081 -p 10250:10250 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 -m 3g --name twin-entity-storage-cosmos -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE='127.0.0.1' mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
18
+ docker run -d --platform=linux/amd64 -p 8081:8081 -m 3g --name twin-entity-storage-cosmos -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE='127.0.0.1' mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
19
19
  ```
20
20
 
21
21
  Or
@@ -230,7 +230,9 @@ class CosmosDbEntityStorageConnector {
230
230
  if (core.Is.arrayValue(conditions)) {
231
231
  for (const c of conditions) {
232
232
  const schemaProp = this._entitySchema.properties?.find(p => p.property === c.property);
233
- whereQuery.push(`c.${String(c.property)} = ${this.propertyToDbValue(c.value, schemaProp?.type)}`);
233
+ whereQuery.push(
234
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
235
+ `c.${String(c.property)} = ${this.propertyToDbValue(c.value, schemaProp?.type)}`);
234
236
  }
235
237
  }
236
238
  const query = {
@@ -282,10 +284,13 @@ class CosmosDbEntityStorageConnector {
282
284
  });
283
285
  }
284
286
  catch (err) {
285
- if (core.BaseError.isErrorCode(err, "ResourceNotFoundException")) {
286
- throw new core.GeneralError(this.CLASS_NAME, "containerDoesNotExist", {
287
- containerId: this._config.containerId
288
- }, err);
287
+ if (core.BaseError.isAggregateError(err)) {
288
+ const errors = core.BaseError.fromAggregate(err);
289
+ if (core.BaseError.someErrorCode(errors, "ResourceNotFoundException")) {
290
+ throw new core.GeneralError(this.CLASS_NAME, "containerDoesNotExist", {
291
+ containerId: this._config.containerId
292
+ }, err);
293
+ }
289
294
  }
290
295
  throw new core.GeneralError(this.CLASS_NAME, "setFailed", {
291
296
  id
@@ -228,7 +228,9 @@ class CosmosDbEntityStorageConnector {
228
228
  if (Is.arrayValue(conditions)) {
229
229
  for (const c of conditions) {
230
230
  const schemaProp = this._entitySchema.properties?.find(p => p.property === c.property);
231
- whereQuery.push(`c.${String(c.property)} = ${this.propertyToDbValue(c.value, schemaProp?.type)}`);
231
+ whereQuery.push(
232
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
233
+ `c.${String(c.property)} = ${this.propertyToDbValue(c.value, schemaProp?.type)}`);
232
234
  }
233
235
  }
234
236
  const query = {
@@ -280,10 +282,13 @@ class CosmosDbEntityStorageConnector {
280
282
  });
281
283
  }
282
284
  catch (err) {
283
- if (BaseError.isErrorCode(err, "ResourceNotFoundException")) {
284
- throw new GeneralError(this.CLASS_NAME, "containerDoesNotExist", {
285
- containerId: this._config.containerId
286
- }, err);
285
+ if (BaseError.isAggregateError(err)) {
286
+ const errors = BaseError.fromAggregate(err);
287
+ if (BaseError.someErrorCode(errors, "ResourceNotFoundException")) {
288
+ throw new GeneralError(this.CLASS_NAME, "containerDoesNotExist", {
289
+ containerId: this._config.containerId
290
+ }, err);
291
+ }
287
292
  }
288
293
  throw new GeneralError(this.CLASS_NAME, "setFailed", {
289
294
  id
package/docs/changelog.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @twin.org/entity-storage-connector-cosmosdb - Changelog
2
2
 
3
+ ## [0.0.2-next.9](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-cosmosdb-v0.0.2-next.8...entity-storage-connector-cosmosdb-v0.0.2-next.9) (2025-10-02)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **entity-storage-connector-cosmosdb:** Synchronize repo versions
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.8 to 0.0.2-next.9
16
+ * devDependencies
17
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.8 to 0.0.2-next.9
18
+
19
+ ## [0.0.2-next.8](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-cosmosdb-v0.0.2-next.7...entity-storage-connector-cosmosdb-v0.0.2-next.8) (2025-08-29)
20
+
21
+
22
+ ### Features
23
+
24
+ * eslint migration to flat config ([f033b64](https://github.com/twinfoundation/entity-storage/commit/f033b64984c0e6a8129d929c9dd816dcc1b8dab0))
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @twin.org/entity-storage-models bumped from 0.0.2-next.7 to 0.0.2-next.8
32
+ * devDependencies
33
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.7 to 0.0.2-next.8
34
+
3
35
  ## [0.0.2-next.7](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-cosmosdb-v0.0.2-next.6...entity-storage-connector-cosmosdb-v0.0.2-next.7) (2025-08-20)
4
36
 
5
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-cosmosdb",
3
- "version": "0.0.2-next.7",
3
+ "version": "0.0.2-next.9",
4
4
  "description": "Entity Storage connector implementation using CosmosDB storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,11 +14,11 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@azure/cosmos": "4.5.0",
18
- "@azure/identity": "4.11.1",
17
+ "@azure/cosmos": "4.5.1",
18
+ "@azure/identity": "4.12.0",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/entity": "next",
21
- "@twin.org/entity-storage-models": "0.0.2-next.7",
21
+ "@twin.org/entity-storage-models": "0.0.2-next.9",
22
22
  "@twin.org/logging-models": "next",
23
23
  "@twin.org/nameof": "next"
24
24
  },
@@ -39,5 +39,20 @@
39
39
  "dist/types",
40
40
  "locales",
41
41
  "docs"
42
+ ],
43
+ "keywords": [
44
+ "twin",
45
+ "trade",
46
+ "iota",
47
+ "framework",
48
+ "blockchain",
49
+ "entity-storage",
50
+ "entity",
51
+ "storage",
52
+ "persistence",
53
+ "database",
54
+ "connector",
55
+ "adapter",
56
+ "integration"
42
57
  ]
43
58
  }