@twin.org/entity-storage-connector-dynamodb 0.0.2-next.9 → 0.0.3-next.2

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.
@@ -1,6 +1,6 @@
1
1
  import { type EntityCondition, type IEntitySchema, SortDirection } from "@twin.org/entity";
2
2
  import type { IEntityStorageConnector } from "@twin.org/entity-storage-models";
3
- import type { IDynamoDbEntityStorageConnectorConstructorOptions } from "./models/IDynamoDbEntityStorageConnectorConstructorOptions";
3
+ import type { IDynamoDbEntityStorageConnectorConstructorOptions } from "./models/IDynamoDbEntityStorageConnectorConstructorOptions.js";
4
4
  /**
5
5
  * Class for performing entity storage operations using Dynamo DB.
6
6
  */
@@ -8,23 +8,28 @@ export declare class DynamoDbEntityStorageConnector<T = unknown> implements IEnt
8
8
  /**
9
9
  * Runtime name for the class.
10
10
  */
11
- readonly CLASS_NAME: string;
11
+ static readonly CLASS_NAME: string;
12
12
  /**
13
13
  * Create a new instance of DynamoDbEntityStorageConnector.
14
14
  * @param options The options for the connector.
15
15
  */
16
16
  constructor(options: IDynamoDbEntityStorageConnectorConstructorOptions);
17
17
  /**
18
- * Bootstrap the component by creating and initializing any resources it needs.
19
- * @param nodeLoggingComponentType The node logging component type.
20
- * @returns True if the bootstrapping process was successful.
18
+ * Returns the class name of the component.
19
+ * @returns The class name of the component.
21
20
  */
22
- bootstrap(nodeLoggingComponentType?: string): Promise<boolean>;
21
+ className(): string;
23
22
  /**
24
23
  * Get the schema for the entities.
25
24
  * @returns The schema for the entities.
26
25
  */
27
26
  getSchema(): IEntitySchema;
27
+ /**
28
+ * Bootstrap the component by creating and initializing any resources it needs.
29
+ * @param nodeLoggingComponentType The node logging component type.
30
+ * @returns True if the bootstrapping process was successful.
31
+ */
32
+ bootstrap(nodeLoggingComponentType?: string): Promise<boolean>;
28
33
  /**
29
34
  * Get an entity.
30
35
  * @param id The id of the entity to get, or the index value if secondaryIndex is set.
@@ -61,15 +66,15 @@ export declare class DynamoDbEntityStorageConnector<T = unknown> implements IEnt
61
66
  * @param conditions The conditions to match for the entities.
62
67
  * @param sortProperties The optional sort order.
63
68
  * @param properties The optional properties to return, defaults to all.
64
- * @param cursor The cursor to request the next page of entities.
65
- * @param pageSize The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
69
+ * @param cursor The cursor to request the next chunk of entities.
70
+ * @param limit The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
66
71
  * @returns All the entities for the storage matching the conditions,
67
72
  * and a cursor which can be used to request more entities.
68
73
  */
69
74
  query(conditions?: EntityCondition<T>, sortProperties?: {
70
75
  property: keyof T;
71
76
  sortDirection: SortDirection;
72
- }[], properties?: (keyof T)[], cursor?: string, pageSize?: number): Promise<{
77
+ }[], properties?: (keyof T)[], cursor?: string, limit?: number): Promise<{
73
78
  /**
74
79
  * The entities, which can be partial if a limited keys list was provided.
75
80
  */
@@ -1,3 +1,3 @@
1
- export * from "./dynamoDbEntityStorageConnector";
2
- export * from "./models/IDynamoDbEntityStorageConnectorConfig";
3
- export * from "./models/IDynamoDbEntityStorageConnectorConstructorOptions";
1
+ export * from "./dynamoDbEntityStorageConnector.js";
2
+ export * from "./models/IDynamoDbEntityStorageConnectorConfig.js";
3
+ export * from "./models/IDynamoDbEntityStorageConnectorConstructorOptions.js";
@@ -26,7 +26,7 @@ export interface IDynamoDbEntityStorageConnectorConfig {
26
26
  */
27
27
  tableName: string;
28
28
  /**
29
- * AWS endpoint, not usually required but could be used for local DynamoDB instance e.g. http://localhost:8500.
29
+ * AWS endpoint, not usually required but could be used for local DynamoDB instance e.g. http://localhost:10000.
30
30
  */
31
31
  endpoint?: string;
32
32
  }
@@ -1,4 +1,4 @@
1
- import type { IDynamoDbEntityStorageConnectorConfig } from "./IDynamoDbEntityStorageConnectorConfig";
1
+ import type { IDynamoDbEntityStorageConnectorConfig } from "./IDynamoDbEntityStorageConnectorConfig.js";
2
2
  /**
3
3
  * Options for the Dynamo DB Entity Storage Connector constructor.
4
4
  */
@@ -7,6 +7,10 @@ export interface IDynamoDbEntityStorageConnectorConstructorOptions {
7
7
  * The schema for the entity
8
8
  */
9
9
  entitySchema: string;
10
+ /**
11
+ * The keys to use from the context ids to create partitions.
12
+ */
13
+ partitionContextIds?: string[];
10
14
  /**
11
15
  * The type of logging component to use, defaults to no logging.
12
16
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # @twin.org/entity-storage-connector-dynamodb - Changelog
2
2
 
3
+ ## [0.0.3-next.2](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.3-next.1...entity-storage-connector-dynamodb-v0.0.3-next.2) (2025-11-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add missing dependency ([3282535](https://github.com/twinfoundation/entity-storage/commit/328253516e0d13b276406fb4de97dab8ee5e8ba7))
9
+ * add missing dependency ([2b848f3](https://github.com/twinfoundation/entity-storage/commit/2b848f3a345522c869b798d7a1cb64112dd8e3e3))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @twin.org/entity-storage-models bumped from 0.0.3-next.1 to 0.0.3-next.2
17
+ * devDependencies
18
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.3-next.1 to 0.0.3-next.2
19
+
20
+ ## [0.0.3-next.1](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.3-next.0...entity-storage-connector-dynamodb-v0.0.3-next.1) (2025-11-10)
21
+
22
+
23
+ ### Features
24
+
25
+ * add AWS pod authentication mode ([caaae36](https://github.com/twinfoundation/entity-storage/commit/caaae368ca104cd9994e1af7b6c4c20e603c2021))
26
+ * add context id features ([#55](https://github.com/twinfoundation/entity-storage/issues/55)) ([99c15a2](https://github.com/twinfoundation/entity-storage/commit/99c15a257539b61d9da63649ce573ebf47699fc9))
27
+ * add production release automation ([1eb4c8e](https://github.com/twinfoundation/entity-storage/commit/1eb4c8ee3eb099defdfc2d063ae44935276dcae8))
28
+ * add synchronised to release configs ([e1e749c](https://github.com/twinfoundation/entity-storage/commit/e1e749cf261b58c8c36729686861e29c7d5e068e))
29
+ * add validate-locales ([e66ef0d](https://github.com/twinfoundation/entity-storage/commit/e66ef0de26ca2f82b3fe89bb5c7a15a0978a9644))
30
+ * eslint migration to flat config ([f033b64](https://github.com/twinfoundation/entity-storage/commit/f033b64984c0e6a8129d929c9dd816dcc1b8dab0))
31
+ * logging naming consistency ([f99d12d](https://github.com/twinfoundation/entity-storage/commit/f99d12dea04b6d4f2b5632ff5473e9ec7d5f9055))
32
+ * synchronised storage ([#44](https://github.com/twinfoundation/entity-storage/issues/44)) ([94e10e2](https://github.com/twinfoundation/entity-storage/commit/94e10e26d1feec801449dc04af7a9757ac7495ff))
33
+ * update dependencies ([7ccc0c4](https://github.com/twinfoundation/entity-storage/commit/7ccc0c429125d073dc60b3de6cf101abc8cc6cba))
34
+ * update docs ([5203e62](https://github.com/twinfoundation/entity-storage/commit/5203e621c3ae368f6fefb29ea5146f024f4a1b0d))
35
+ * update framework core ([b59a380](https://github.com/twinfoundation/entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
36
+ * use shared store mechanism ([#34](https://github.com/twinfoundation/entity-storage/issues/34)) ([68b6b71](https://github.com/twinfoundation/entity-storage/commit/68b6b71e7a96d7d016cd57bfff36775b56bf3f93))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * query params force coercion ([dd6aa87](https://github.com/twinfoundation/entity-storage/commit/dd6aa87efdfb60bab7d6756a86888863c45c51a7))
42
+
43
+
44
+ ### Dependencies
45
+
46
+ * The following workspace dependencies were updated
47
+ * dependencies
48
+ * @twin.org/entity-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
49
+ * devDependencies
50
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.3-next.0 to 0.0.3-next.1
51
+
52
+ ## [0.0.2-next.10](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.9...entity-storage-connector-dynamodb-v0.0.2-next.10) (2025-10-09)
53
+
54
+
55
+ ### Features
56
+
57
+ * add validate-locales ([e66ef0d](https://github.com/twinfoundation/entity-storage/commit/e66ef0de26ca2f82b3fe89bb5c7a15a0978a9644))
58
+
59
+
60
+ ### Dependencies
61
+
62
+ * The following workspace dependencies were updated
63
+ * dependencies
64
+ * @twin.org/entity-storage-models bumped from 0.0.2-next.9 to 0.0.2-next.10
65
+ * devDependencies
66
+ * @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.9 to 0.0.2-next.10
67
+
3
68
  ## [0.0.2-next.9](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.2-next.8...entity-storage-connector-dynamodb-v0.0.2-next.9) (2025-10-02)
4
69
 
5
70
 
@@ -36,39 +36,27 @@ The options for the connector.
36
36
 
37
37
  ### CLASS\_NAME
38
38
 
39
- > `readonly` **CLASS\_NAME**: `string`
39
+ > `readonly` `static` **CLASS\_NAME**: `string`
40
40
 
41
41
  Runtime name for the class.
42
42
 
43
- #### Implementation of
44
-
45
- `IEntityStorageConnector.CLASS_NAME`
46
-
47
43
  ## Methods
48
44
 
49
- ### bootstrap()
50
-
51
- > **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
52
-
53
- Bootstrap the component by creating and initializing any resources it needs.
54
-
55
- #### Parameters
56
-
57
- ##### nodeLoggingComponentType?
45
+ ### className()
58
46
 
59
- `string`
47
+ > **className**(): `string`
60
48
 
61
- The node logging component type.
49
+ Returns the class name of the component.
62
50
 
63
51
  #### Returns
64
52
 
65
- `Promise`\<`boolean`\>
53
+ `string`
66
54
 
67
- True if the bootstrapping process was successful.
55
+ The class name of the component.
68
56
 
69
57
  #### Implementation of
70
58
 
71
- `IEntityStorageConnector.bootstrap`
59
+ `IEntityStorageConnector.className`
72
60
 
73
61
  ***
74
62
 
@@ -90,9 +78,35 @@ The schema for the entities.
90
78
 
91
79
  ***
92
80
 
81
+ ### bootstrap()
82
+
83
+ > **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
84
+
85
+ Bootstrap the component by creating and initializing any resources it needs.
86
+
87
+ #### Parameters
88
+
89
+ ##### nodeLoggingComponentType?
90
+
91
+ `string`
92
+
93
+ The node logging component type.
94
+
95
+ #### Returns
96
+
97
+ `Promise`\<`boolean`\>
98
+
99
+ True if the bootstrapping process was successful.
100
+
101
+ #### Implementation of
102
+
103
+ `IEntityStorageConnector.bootstrap`
104
+
105
+ ***
106
+
93
107
  ### get()
94
108
 
95
- > **get**(`id`, `secondaryIndex?`, `conditions?`): `Promise`\<`undefined` \| `T`\>
109
+ > **get**(`id`, `secondaryIndex?`, `conditions?`): `Promise`\<`T` \| `undefined`\>
96
110
 
97
111
  Get an entity.
98
112
 
@@ -118,7 +132,7 @@ The optional conditions to match for the entities.
118
132
 
119
133
  #### Returns
120
134
 
121
- `Promise`\<`undefined` \| `T`\>
135
+ `Promise`\<`T` \| `undefined`\>
122
136
 
123
137
  The object if it can be found or undefined.
124
138
 
@@ -194,7 +208,7 @@ Nothing.
194
208
 
195
209
  ### query()
196
210
 
197
- > **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `pageSize?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
211
+ > **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
198
212
 
199
213
  Find all the entities which match the conditions.
200
214
 
@@ -222,9 +236,9 @@ The optional properties to return, defaults to all.
222
236
 
223
237
  `string`
224
238
 
225
- The cursor to request the next page of entities.
239
+ The cursor to request the next chunk of entities.
226
240
 
227
- ##### pageSize?
241
+ ##### limit?
228
242
 
229
243
  `number`
230
244
 
@@ -56,4 +56,4 @@ The name of the table for the storage.
56
56
 
57
57
  > `optional` **endpoint**: `string`
58
58
 
59
- AWS endpoint, not usually required but could be used for local DynamoDB instance e.g. http://localhost:8500.
59
+ AWS endpoint, not usually required but could be used for local DynamoDB instance e.g. http://localhost:10000.
@@ -12,6 +12,14 @@ The schema for the entity
12
12
 
13
13
  ***
14
14
 
15
+ ### partitionContextIds?
16
+
17
+ > `optional` **partitionContextIds**: `string`[]
18
+
19
+ The keys to use from the context ids to create partitions.
20
+
21
+ ***
22
+
15
23
  ### loggingComponentType?
16
24
 
17
25
  > `optional` **loggingComponentType**: `string`
package/locales/en.json CHANGED
@@ -17,7 +17,8 @@
17
17
  "comparisonNotSupported": "Comparison operator \"{comparison}\" is not supported",
18
18
  "conditionalNotSupported": "Conditional operator \"{operator}\" is not supported",
19
19
  "sortSingle": "You can only sort by a single property",
20
- "sortNotIndexed": "The property \"{property}\" is not indexed and cannot be used for sorting"
20
+ "sortNotIndexed": "The property \"{property}\" is not indexed and cannot be used for sorting",
21
+ "propertyNotFound": "The property \"{property}\" was not found on the entity schema"
21
22
  }
22
23
  }
23
24
  }
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.9",
3
+ "version": "0.0.3-next.2",
4
4
  "description": "Entity Storage connector implementation using DynamoDb storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,29 +14,28 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@aws-sdk/client-dynamodb": "3.896",
18
- "@aws-sdk/lib-dynamodb": "3.896",
19
- "@aws-sdk/util-dynamodb": "3.896",
17
+ "@aws-sdk/client-dynamodb": "3.927",
18
+ "@aws-sdk/lib-dynamodb": "3.927",
19
+ "@aws-sdk/util-dynamodb": "3.927",
20
+ "@twin.org/context": "next",
20
21
  "@twin.org/core": "next",
21
22
  "@twin.org/entity": "next",
22
- "@twin.org/entity-storage-models": "0.0.2-next.9",
23
+ "@twin.org/entity-storage-models": "0.0.3-next.2",
23
24
  "@twin.org/logging-models": "next",
24
25
  "@twin.org/nameof": "next"
25
26
  },
26
- "main": "./dist/cjs/index.cjs",
27
- "module": "./dist/esm/index.mjs",
27
+ "main": "./dist/es/index.js",
28
28
  "types": "./dist/types/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
31
  "types": "./dist/types/index.d.ts",
32
- "require": "./dist/cjs/index.cjs",
33
- "import": "./dist/esm/index.mjs"
32
+ "import": "./dist/es/index.js",
33
+ "default": "./dist/es/index.js"
34
34
  },
35
35
  "./locales/*.json": "./locales/*.json"
36
36
  },
37
37
  "files": [
38
- "dist/cjs",
39
- "dist/esm",
38
+ "dist/es",
40
39
  "dist/types",
41
40
  "locales",
42
41
  "docs"
@@ -55,5 +54,9 @@
55
54
  "connector",
56
55
  "adapter",
57
56
  "integration"
58
- ]
57
+ ],
58
+ "bugs": {
59
+ "url": "git+https://github.com/twinfoundation/entity-storage/issues"
60
+ },
61
+ "homepage": "https://twindev.org"
59
62
  }