@twin.org/entity-storage-connector-dynamodb 0.0.3-next.6 → 0.0.3-next.8

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
@@ -1,6 +1,6 @@
1
- # TWIN Entity Storage Connector Dynamo DB
1
+ # Entity Storage Connector DynamoDB
2
2
 
3
- Entity Storage connector implementation using Dynamo DB storage.
3
+ This package provides an Amazon DynamoDB backend for managed NoSQL storage in cloud-native deployments. It is designed to work with the wider storage ecosystem so applications can keep behaviour consistent across connectors and environments.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,18 +8,13 @@ Entity Storage connector implementation using Dynamo DB storage.
8
8
  npm install @twin.org/entity-storage-connector-dynamodb
9
9
  ```
10
10
 
11
- ## Testing
11
+ ## Docker
12
12
 
13
- The tests developed are functional tests and need an instance of DynamoDB up and running. To run DynamoDB locally:
13
+ To perform testing of this component it may be necessary to launch a local instance to communicate with.
14
14
 
15
- ```sh
16
- docker run -p 10000:8000 --name twin-entity-storage-dynamodb --hostname dynamodb -d amazon/dynamodb-local
17
- ```
18
-
19
- Afterwards you can run the tests as follows:
20
-
21
- ```sh
22
- npm run test
15
+ ```shell
16
+ docker pull amazon/dynamodb-local:latest
17
+ docker run -d --name twin-entity-storage-dynamodb -p 10000:8000 amazon/dynamodb-local:latest
23
18
  ```
24
19
 
25
20
  ## Examples
package/docs/changelog.md CHANGED
@@ -1,4 +1,36 @@
1
- # @twin.org/entity-storage-connector-dynamodb - Changelog
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.8](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.3-next.7...entity-storage-connector-dynamodb-v0.0.3-next.8) (2026-03-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * tests and fixes for the comparisons for null and undefined ([#79](https://github.com/twinfoundation/entity-storage/issues/79)) ([e7ffd62](https://github.com/twinfoundation/entity-storage/commit/e7ffd62e9ec40ef31498e6e2350bb25d9c84638a))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/entity-storage-models bumped from 0.0.3-next.7 to 0.0.3-next.8
16
+ * devDependencies
17
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.3-next.7 to 0.0.3-next.8
18
+
19
+ ## [0.0.3-next.7](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.3-next.6...entity-storage-connector-dynamodb-v0.0.3-next.7) (2026-03-13)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * adding tests and fixes for dot notation ([#76](https://github.com/twinfoundation/entity-storage/issues/76)) ([3879337](https://github.com/twinfoundation/entity-storage/commit/387933797e33543e4d8b2d49b8beeb792512a4ff))
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @twin.org/entity-storage-models bumped from 0.0.3-next.6 to 0.0.3-next.7
32
+ * devDependencies
33
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.3-next.6 to 0.0.3-next.7
2
34
 
3
35
  ## [0.0.3-next.6](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.3-next.5...entity-storage-connector-dynamodb-v0.0.3-next.6) (2026-01-21)
4
36
 
package/docs/examples.md CHANGED
@@ -1 +1,96 @@
1
- # @twin.org/entity-storage-connector-dynamodb - Examples
1
+ # Entity Storage Connector DynamoDB Examples
2
+
3
+ These examples show a complete flow from connector setup through reads, writes, filtered queries, and table maintenance tasks.
4
+
5
+ ## DynamoDbEntityStorageConnector
6
+
7
+ ```typescript
8
+ import {
9
+ DynamoDbEntityStorageConnector,
10
+ type IDynamoDbEntityStorageConnectorConstructorOptions
11
+ } from '@twin.org/entity-storage-connector-dynamodb';
12
+ import {
13
+ ComparisonOperator,
14
+ LogicalOperator,
15
+ SortDirection,
16
+ type EntityCondition
17
+ } from '@twin.org/entity';
18
+
19
+ interface Profile {
20
+ id: string;
21
+ email: string;
22
+ status: 'active' | 'inactive';
23
+ createdAt: string;
24
+ }
25
+
26
+ const options: IDynamoDbEntityStorageConnectorConstructorOptions = {
27
+ entitySchema: 'Profile',
28
+ config: {
29
+ region: 'eu-west-1',
30
+ authMode: 'credentials',
31
+ accessKeyId: 'local-access-key',
32
+ secretAccessKey: 'local-secret-key',
33
+ tableName: 'profiles',
34
+ endpoint: 'http://localhost:10000'
35
+ }
36
+ };
37
+
38
+ const connector = new DynamoDbEntityStorageConnector<Profile>(options);
39
+ await connector.bootstrap();
40
+
41
+ const className = connector.className();
42
+ const schema = connector.getSchema();
43
+
44
+ await connector.set({
45
+ id: 'profile-1',
46
+ email: 'ada@example.com',
47
+ status: 'active',
48
+ createdAt: '2026-03-09T10:30:00.000Z'
49
+ });
50
+
51
+ const byPrimaryKey = await connector.get('profile-1');
52
+ const bySecondaryIndex = await connector.get('ada@example.com', 'email');
53
+
54
+ const activeCondition: EntityCondition<Profile> = {
55
+ logicalOperator: LogicalOperator.And,
56
+ conditions: [
57
+ {
58
+ property: 'status',
59
+ comparison: ComparisonOperator.Equals,
60
+ value: 'active'
61
+ }
62
+ ]
63
+ };
64
+
65
+ const result = await connector.query(
66
+ activeCondition,
67
+ [{ property: 'createdAt', sortDirection: SortDirection.Descending }],
68
+ ['id', 'email', 'status'],
69
+ undefined,
70
+ 25
71
+ );
72
+
73
+ await connector.remove('profile-1');
74
+ ```
75
+
76
+ ```typescript
77
+ import { DynamoDbEntityStorageConnector } from '@twin.org/entity-storage-connector-dynamodb';
78
+
79
+ interface Profile {
80
+ id: string;
81
+ email: string;
82
+ status: 'active' | 'inactive';
83
+ createdAt: string;
84
+ }
85
+
86
+ const connector = new DynamoDbEntityStorageConnector<Profile>({
87
+ entitySchema: 'Profile',
88
+ config: {
89
+ region: 'eu-west-1',
90
+ authMode: 'pod',
91
+ tableName: 'profiles'
92
+ }
93
+ });
94
+
95
+ await connector.bootstrap('logging');
96
+ ```
@@ -34,7 +34,7 @@ The options for the connector.
34
34
 
35
35
  ## Properties
36
36
 
37
- ### CLASS\_NAME
37
+ ### CLASS\_NAME {#class_name}
38
38
 
39
39
  > `readonly` `static` **CLASS\_NAME**: `string`
40
40
 
@@ -42,7 +42,7 @@ Runtime name for the class.
42
42
 
43
43
  ## Methods
44
44
 
45
- ### className()
45
+ ### className() {#classname}
46
46
 
47
47
  > **className**(): `string`
48
48
 
@@ -60,7 +60,7 @@ The class name of the component.
60
60
 
61
61
  ***
62
62
 
63
- ### getSchema()
63
+ ### getSchema() {#getschema}
64
64
 
65
65
  > **getSchema**(): `IEntitySchema`
66
66
 
@@ -78,7 +78,7 @@ The schema for the entities.
78
78
 
79
79
  ***
80
80
 
81
- ### bootstrap()
81
+ ### bootstrap() {#bootstrap}
82
82
 
83
83
  > **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
84
84
 
@@ -104,7 +104,7 @@ True if the bootstrapping process was successful.
104
104
 
105
105
  ***
106
106
 
107
- ### get()
107
+ ### get() {#get}
108
108
 
109
109
  > **get**(`id`, `secondaryIndex?`, `conditions?`): `Promise`\<`T` \| `undefined`\>
110
110
 
@@ -142,7 +142,7 @@ The object if it can be found or undefined.
142
142
 
143
143
  ***
144
144
 
145
- ### set()
145
+ ### set() {#set}
146
146
 
147
147
  > **set**(`entity`, `conditions?`): `Promise`\<`void`\>
148
148
 
@@ -174,7 +174,7 @@ The id of the entity.
174
174
 
175
175
  ***
176
176
 
177
- ### remove()
177
+ ### remove() {#remove}
178
178
 
179
179
  > **remove**(`id`, `conditions?`): `Promise`\<`void`\>
180
180
 
@@ -206,7 +206,7 @@ Nothing.
206
206
 
207
207
  ***
208
208
 
209
- ### query()
209
+ ### query() {#query}
210
210
 
211
211
  > **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
212
212
 
@@ -257,7 +257,7 @@ and a cursor which can be used to request more entities.
257
257
 
258
258
  ***
259
259
 
260
- ### tableDelete()
260
+ ### tableDelete() {#tabledelete}
261
261
 
262
262
  > **tableDelete**(): `Promise`\<`void`\>
263
263
 
@@ -4,7 +4,7 @@ Configuration for the Dynamo DB Entity Storage Connector.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### region
7
+ ### region {#region}
8
8
 
9
9
  > **region**: `string`
10
10
 
@@ -12,9 +12,9 @@ The region for the AWS connection.
12
12
 
13
13
  ***
14
14
 
15
- ### authMode?
15
+ ### authMode? {#authmode}
16
16
 
17
- > `optional` **authMode**: `"credentials"` \| `"pod"`
17
+ > `optional` **authMode?**: `"credentials"` \| `"pod"`
18
18
 
19
19
  The authentication mode.
20
20
  - "credentials": Use access key ID and secret access key.
@@ -28,23 +28,23 @@ credentials
28
28
 
29
29
  ***
30
30
 
31
- ### accessKeyId?
31
+ ### accessKeyId? {#accesskeyid}
32
32
 
33
- > `optional` **accessKeyId**: `string`
33
+ > `optional` **accessKeyId?**: `string`
34
34
 
35
35
  The AWS access key ID.
36
36
 
37
37
  ***
38
38
 
39
- ### secretAccessKey?
39
+ ### secretAccessKey? {#secretaccesskey}
40
40
 
41
- > `optional` **secretAccessKey**: `string`
41
+ > `optional` **secretAccessKey?**: `string`
42
42
 
43
43
  The AWS secret access key.
44
44
 
45
45
  ***
46
46
 
47
- ### tableName
47
+ ### tableName {#tablename}
48
48
 
49
49
  > **tableName**: `string`
50
50
 
@@ -52,16 +52,16 @@ The name of the table for the storage.
52
52
 
53
53
  ***
54
54
 
55
- ### endpoint?
55
+ ### endpoint? {#endpoint}
56
56
 
57
- > `optional` **endpoint**: `string`
57
+ > `optional` **endpoint?**: `string`
58
58
 
59
59
  AWS endpoint, not usually required but could be used for local DynamoDB instance e.g. http://localhost:10000.
60
60
 
61
61
  ***
62
62
 
63
- ### connectionTimeoutMs?
63
+ ### connectionTimeoutMs? {#connectiontimeoutms}
64
64
 
65
- > `optional` **connectionTimeoutMs**: `number`
65
+ > `optional` **connectionTimeoutMs?**: `number`
66
66
 
67
67
  The connection timeout in milliseconds.
@@ -4,7 +4,7 @@ Options for the Dynamo DB Entity Storage Connector constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### entitySchema
7
+ ### entitySchema {#entityschema}
8
8
 
9
9
  > **entitySchema**: `string`
10
10
 
@@ -12,23 +12,23 @@ The schema for the entity
12
12
 
13
13
  ***
14
14
 
15
- ### partitionContextIds?
15
+ ### partitionContextIds? {#partitioncontextids}
16
16
 
17
- > `optional` **partitionContextIds**: `string`[]
17
+ > `optional` **partitionContextIds?**: `string`[]
18
18
 
19
19
  The keys to use from the context ids to create partitions.
20
20
 
21
21
  ***
22
22
 
23
- ### loggingComponentType?
23
+ ### loggingComponentType? {#loggingcomponenttype}
24
24
 
25
- > `optional` **loggingComponentType**: `string`
25
+ > `optional` **loggingComponentType?**: `string`
26
26
 
27
27
  The type of logging component to use, defaults to no logging.
28
28
 
29
29
  ***
30
30
 
31
- ### config
31
+ ### config {#config}
32
32
 
33
33
  > **config**: [`IDynamoDbEntityStorageConnectorConfig`](IDynamoDbEntityStorageConnectorConfig.md)
34
34
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-dynamodb",
3
- "version": "0.0.3-next.6",
4
- "description": "Entity Storage connector implementation using DynamoDb storage",
3
+ "version": "0.0.3-next.8",
4
+ "description": "Amazon DynamoDB connector for managed NoSQL persistence.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/entity-storage.git",
@@ -14,13 +14,13 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@aws-sdk/client-dynamodb": "3.927",
18
- "@aws-sdk/lib-dynamodb": "3.927",
19
- "@aws-sdk/util-dynamodb": "3.927",
17
+ "@aws-sdk/client-dynamodb": "3.1012",
18
+ "@aws-sdk/lib-dynamodb": "3.1012",
19
+ "@aws-sdk/util-dynamodb": "3.996",
20
20
  "@twin.org/context": "next",
21
21
  "@twin.org/core": "next",
22
22
  "@twin.org/entity": "next",
23
- "@twin.org/entity-storage-models": "0.0.3-next.6",
23
+ "@twin.org/entity-storage-models": "0.0.3-next.8",
24
24
  "@twin.org/logging-models": "next",
25
25
  "@twin.org/nameof": "next"
26
26
  },