@twin.org/entity-storage-connector-dynamodb 0.0.2-next.5 → 0.0.2-next.7

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.
@@ -5,7 +5,6 @@ var libDynamodb = require('@aws-sdk/lib-dynamodb');
5
5
  var utilDynamodb = require('@aws-sdk/util-dynamodb');
6
6
  var core = require('@twin.org/core');
7
7
  var entity = require('@twin.org/entity');
8
- var loggingModels = require('@twin.org/logging-models');
9
8
 
10
9
  // Copyright 2024 IOTA Stiftung.
11
10
  // SPDX-License-Identifier: Apache-2.0.
@@ -68,11 +67,11 @@ class DynamoDbEntityStorageConnector {
68
67
  }
69
68
  /**
70
69
  * Bootstrap the component by creating and initializing any resources it needs.
71
- * @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
70
+ * @param nodeLoggingComponentType The node logging component type.
72
71
  * @returns True if the bootstrapping process was successful.
73
72
  */
74
- async bootstrap(nodeLoggingConnectorType) {
75
- const nodeLogging = loggingModels.LoggingConnectorFactory.getIfExists(nodeLoggingConnectorType ?? "node-logging");
73
+ async bootstrap(nodeLoggingComponentType) {
74
+ const nodeLogging = core.ComponentFactory.getIfExists(nodeLoggingComponentType);
76
75
  if (!(await this.tableExists(this._config.tableName))) {
77
76
  await nodeLogging?.log({
78
77
  level: "info",
@@ -181,19 +180,16 @@ class DynamoDbEntityStorageConnector {
181
180
  });
182
181
  }
183
182
  else {
184
- const errors = err instanceof AggregateError ? err.errors : [err];
185
- for (const error of errors) {
186
- await nodeLogging?.log({
187
- level: "error",
188
- source: this.CLASS_NAME,
189
- ts: Date.now(),
190
- message: "tableCreateFailed",
191
- error: core.BaseError.fromError(error),
192
- data: {
193
- tableName: this._config.tableName
194
- }
195
- });
196
- }
183
+ await nodeLogging?.log({
184
+ level: "error",
185
+ source: this.CLASS_NAME,
186
+ ts: Date.now(),
187
+ message: "tableCreateFailed",
188
+ error: core.BaseError.fromError(err),
189
+ data: {
190
+ tableName: this._config.tableName
191
+ }
192
+ });
197
193
  }
198
194
  return false;
199
195
  }
@@ -1,9 +1,8 @@
1
1
  import { waitUntilTableExists, DynamoDB, QueryCommand } from '@aws-sdk/client-dynamodb';
2
2
  import { GetCommand, PutCommand, DeleteCommand, DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
3
3
  import { unmarshall } from '@aws-sdk/util-dynamodb';
4
- import { Guards, Is, BaseError, GeneralError, Coerce, ObjectHelper, Converter } from '@twin.org/core';
4
+ import { Guards, Is, ComponentFactory, BaseError, GeneralError, Coerce, ObjectHelper, Converter } from '@twin.org/core';
5
5
  import { EntitySchemaFactory, EntitySchemaHelper, ComparisonOperator, LogicalOperator, SortDirection } from '@twin.org/entity';
6
- import { LoggingConnectorFactory } from '@twin.org/logging-models';
7
6
 
8
7
  // Copyright 2024 IOTA Stiftung.
9
8
  // SPDX-License-Identifier: Apache-2.0.
@@ -66,11 +65,11 @@ class DynamoDbEntityStorageConnector {
66
65
  }
67
66
  /**
68
67
  * Bootstrap the component by creating and initializing any resources it needs.
69
- * @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
68
+ * @param nodeLoggingComponentType The node logging component type.
70
69
  * @returns True if the bootstrapping process was successful.
71
70
  */
72
- async bootstrap(nodeLoggingConnectorType) {
73
- const nodeLogging = LoggingConnectorFactory.getIfExists(nodeLoggingConnectorType ?? "node-logging");
71
+ async bootstrap(nodeLoggingComponentType) {
72
+ const nodeLogging = ComponentFactory.getIfExists(nodeLoggingComponentType);
74
73
  if (!(await this.tableExists(this._config.tableName))) {
75
74
  await nodeLogging?.log({
76
75
  level: "info",
@@ -179,19 +178,16 @@ class DynamoDbEntityStorageConnector {
179
178
  });
180
179
  }
181
180
  else {
182
- const errors = err instanceof AggregateError ? err.errors : [err];
183
- for (const error of errors) {
184
- await nodeLogging?.log({
185
- level: "error",
186
- source: this.CLASS_NAME,
187
- ts: Date.now(),
188
- message: "tableCreateFailed",
189
- error: BaseError.fromError(error),
190
- data: {
191
- tableName: this._config.tableName
192
- }
193
- });
194
- }
181
+ await nodeLogging?.log({
182
+ level: "error",
183
+ source: this.CLASS_NAME,
184
+ ts: Date.now(),
185
+ message: "tableCreateFailed",
186
+ error: BaseError.fromError(err),
187
+ data: {
188
+ tableName: this._config.tableName
189
+ }
190
+ });
195
191
  }
196
192
  return false;
197
193
  }
@@ -16,10 +16,10 @@ export declare class DynamoDbEntityStorageConnector<T = unknown> implements IEnt
16
16
  constructor(options: IDynamoDbEntityStorageConnectorConstructorOptions);
17
17
  /**
18
18
  * Bootstrap the component by creating and initializing any resources it needs.
19
- * @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
19
+ * @param nodeLoggingComponentType The node logging component type.
20
20
  * @returns True if the bootstrapping process was successful.
21
21
  */
22
- bootstrap(nodeLoggingConnectorType?: string): Promise<boolean>;
22
+ bootstrap(nodeLoggingComponentType?: string): Promise<boolean>;
23
23
  /**
24
24
  * Get the schema for the entities.
25
25
  * @returns The schema for the entities.
@@ -8,9 +8,9 @@ export interface IDynamoDbEntityStorageConnectorConstructorOptions {
8
8
  */
9
9
  entitySchema: string;
10
10
  /**
11
- * The type of logging connector to use, defaults to no logging.
11
+ * The type of logging component to use, defaults to no logging.
12
12
  */
13
- loggingConnectorType?: string;
13
+ loggingComponentType?: string;
14
14
  /**
15
15
  * The configuration for the connector.
16
16
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @twin.org/entity-storage-connector-dynamodb - Changelog
2
2
 
3
+ ## [0.0.2-next.7](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.6...entity-storage-connector-dynamodb-v0.0.2-next.7) (2025-08-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * logging naming consistency ([f99d12d](https://github.com/twinfoundation/entity-storage/commit/f99d12dea04b6d4f2b5632ff5473e9ec7d5f9055))
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.6 to 0.0.2-next.7
16
+ * devDependencies
17
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.6 to 0.0.2-next.7
18
+
19
+ ## [0.0.2-next.6](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.5...entity-storage-connector-dynamodb-v0.0.2-next.6) (2025-08-19)
20
+
21
+
22
+ ### Features
23
+
24
+ * update framework core ([b59a380](https://github.com/twinfoundation/entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
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.5 to 0.0.2-next.6
32
+ * devDependencies
33
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.5 to 0.0.2-next.6
34
+
3
35
  ## [0.0.2-next.5](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.4...entity-storage-connector-dynamodb-v0.0.2-next.5) (2025-08-11)
4
36
 
5
37
 
@@ -48,17 +48,17 @@ Runtime name for the class.
48
48
 
49
49
  ### bootstrap()
50
50
 
51
- > **bootstrap**(`nodeLoggingConnectorType?`): `Promise`\<`boolean`\>
51
+ > **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
52
52
 
53
53
  Bootstrap the component by creating and initializing any resources it needs.
54
54
 
55
55
  #### Parameters
56
56
 
57
- ##### nodeLoggingConnectorType?
57
+ ##### nodeLoggingComponentType?
58
58
 
59
59
  `string`
60
60
 
61
- The node logging connector type, defaults to "node-logging".
61
+ The node logging component type.
62
62
 
63
63
  #### Returns
64
64
 
@@ -12,11 +12,11 @@ The schema for the entity
12
12
 
13
13
  ***
14
14
 
15
- ### loggingConnectorType?
15
+ ### loggingComponentType?
16
16
 
17
- > `optional` **loggingConnectorType**: `string`
17
+ > `optional` **loggingComponentType**: `string`
18
18
 
19
- The type of logging connector to use, defaults to no logging.
19
+ The type of logging component to use, defaults to no logging.
20
20
 
21
21
  ***
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-dynamodb",
3
- "version": "0.0.2-next.5",
3
+ "version": "0.0.2-next.7",
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.848",
18
- "@aws-sdk/lib-dynamodb": "3.850",
19
- "@aws-sdk/util-dynamodb": "3.848",
17
+ "@aws-sdk/client-dynamodb": "3.868",
18
+ "@aws-sdk/lib-dynamodb": "3.868",
19
+ "@aws-sdk/util-dynamodb": "3.868",
20
20
  "@twin.org/core": "next",
21
21
  "@twin.org/entity": "next",
22
- "@twin.org/entity-storage-models": "0.0.2-next.5",
22
+ "@twin.org/entity-storage-models": "0.0.2-next.7",
23
23
  "@twin.org/logging-models": "next",
24
24
  "@twin.org/nameof": "next"
25
25
  },