@twin.org/entity-storage-connector-dynamodb 0.0.1-next.13 → 0.0.1-next.15
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 +0 -3
- package/dist/esm/index.mjs +0 -3
- package/dist/types/dynamoDbEntityStorageConnector.d.ts +2 -9
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IDynamoDbEntityStorageConnectorConstructorOptions.d.ts +18 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/DynamoDbEntityStorageConnector.md +46 -42
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IDynamoDbEntityStorageConnectorConstructorOptions.md +27 -0
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -50,9 +50,6 @@ class DynamoDbEntityStorageConnector {
|
|
|
50
50
|
/**
|
|
51
51
|
* Create a new instance of DynamoDbEntityStorageConnector.
|
|
52
52
|
* @param options The options for the connector.
|
|
53
|
-
* @param options.entitySchema The schema for the entity.
|
|
54
|
-
* @param options.loggingConnectorType The type of logging connector to use, defaults to no logging.
|
|
55
|
-
* @param options.config The configuration for the connector.
|
|
56
53
|
*/
|
|
57
54
|
constructor(options) {
|
|
58
55
|
core.Guards.object(this.CLASS_NAME, "options", options);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -48,9 +48,6 @@ class DynamoDbEntityStorageConnector {
|
|
|
48
48
|
/**
|
|
49
49
|
* Create a new instance of DynamoDbEntityStorageConnector.
|
|
50
50
|
* @param options The options for the connector.
|
|
51
|
-
* @param options.entitySchema The schema for the entity.
|
|
52
|
-
* @param options.loggingConnectorType The type of logging connector to use, defaults to no logging.
|
|
53
|
-
* @param options.config The configuration for the connector.
|
|
54
51
|
*/
|
|
55
52
|
constructor(options) {
|
|
56
53
|
Guards.object(this.CLASS_NAME, "options", options);
|
|
@@ -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 {
|
|
3
|
+
import type { IDynamoDbEntityStorageConnectorConstructorOptions } from "./models/IDynamoDbEntityStorageConnectorConstructorOptions";
|
|
4
4
|
/**
|
|
5
5
|
* Class for performing entity storage operations using Dynamo DB.
|
|
6
6
|
*/
|
|
@@ -12,15 +12,8 @@ export declare class DynamoDbEntityStorageConnector<T = unknown> implements IEnt
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new instance of DynamoDbEntityStorageConnector.
|
|
14
14
|
* @param options The options for the connector.
|
|
15
|
-
* @param options.entitySchema The schema for the entity.
|
|
16
|
-
* @param options.loggingConnectorType The type of logging connector to use, defaults to no logging.
|
|
17
|
-
* @param options.config The configuration for the connector.
|
|
18
15
|
*/
|
|
19
|
-
constructor(options:
|
|
20
|
-
entitySchema: string;
|
|
21
|
-
loggingConnectorType?: string;
|
|
22
|
-
config: IDynamoDbEntityStorageConnectorConfig;
|
|
23
|
-
});
|
|
16
|
+
constructor(options: IDynamoDbEntityStorageConnectorConstructorOptions);
|
|
24
17
|
/**
|
|
25
18
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
26
19
|
* @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IDynamoDbEntityStorageConnectorConfig } from "./IDynamoDbEntityStorageConnectorConfig";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the Dynamo DB Entity Storage Connector constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDynamoDbEntityStorageConnectorConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The schema for the entity
|
|
8
|
+
*/
|
|
9
|
+
entitySchema: string;
|
|
10
|
+
/**
|
|
11
|
+
* The type of logging connector to use, defaults to no logging.
|
|
12
|
+
*/
|
|
13
|
+
loggingConnectorType?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The configuration for the connector.
|
|
16
|
+
*/
|
|
17
|
+
config: IDynamoDbEntityStorageConnectorConfig;
|
|
18
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -20,21 +20,11 @@ Create a new instance of DynamoDbEntityStorageConnector.
|
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
##### options
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
• **options.entitySchema**: `string`
|
|
28
|
-
|
|
29
|
-
The schema for the entity.
|
|
30
|
-
|
|
31
|
-
• **options.loggingConnectorType?**: `string`
|
|
25
|
+
[`IDynamoDbEntityStorageConnectorConstructorOptions`](../interfaces/IDynamoDbEntityStorageConnectorConstructorOptions.md)
|
|
32
26
|
|
|
33
|
-
The
|
|
34
|
-
|
|
35
|
-
• **options.config**: [`IDynamoDbEntityStorageConnectorConfig`](../interfaces/IDynamoDbEntityStorageConnectorConfig.md)
|
|
36
|
-
|
|
37
|
-
The configuration for the connector.
|
|
27
|
+
The options for the connector.
|
|
38
28
|
|
|
39
29
|
#### Returns
|
|
40
30
|
|
|
@@ -62,7 +52,9 @@ Bootstrap the component by creating and initializing any resources it needs.
|
|
|
62
52
|
|
|
63
53
|
#### Parameters
|
|
64
54
|
|
|
65
|
-
|
|
55
|
+
##### nodeLoggingConnectorType?
|
|
56
|
+
|
|
57
|
+
`string`
|
|
66
58
|
|
|
67
59
|
The node logging connector type, defaults to "node-logging".
|
|
68
60
|
|
|
@@ -80,13 +72,13 @@ True if the bootstrapping process was successful.
|
|
|
80
72
|
|
|
81
73
|
### getSchema()
|
|
82
74
|
|
|
83
|
-
> **getSchema**(): `IEntitySchema
|
|
75
|
+
> **getSchema**(): `IEntitySchema`
|
|
84
76
|
|
|
85
77
|
Get the schema for the entities.
|
|
86
78
|
|
|
87
79
|
#### Returns
|
|
88
80
|
|
|
89
|
-
`IEntitySchema
|
|
81
|
+
`IEntitySchema`
|
|
90
82
|
|
|
91
83
|
The schema for the entities.
|
|
92
84
|
|
|
@@ -104,15 +96,21 @@ Get an entity.
|
|
|
104
96
|
|
|
105
97
|
#### Parameters
|
|
106
98
|
|
|
107
|
-
|
|
99
|
+
##### id
|
|
100
|
+
|
|
101
|
+
`string`
|
|
108
102
|
|
|
109
103
|
The id of the entity to get, or the index value if secondaryIndex is set.
|
|
110
104
|
|
|
111
|
-
|
|
105
|
+
##### secondaryIndex?
|
|
106
|
+
|
|
107
|
+
keyof `T`
|
|
112
108
|
|
|
113
109
|
Get the item using a secondary index.
|
|
114
110
|
|
|
115
|
-
|
|
111
|
+
##### conditions?
|
|
112
|
+
|
|
113
|
+
`object`[]
|
|
116
114
|
|
|
117
115
|
The optional conditions to match for the entities.
|
|
118
116
|
|
|
@@ -136,11 +134,15 @@ Set an entity.
|
|
|
136
134
|
|
|
137
135
|
#### Parameters
|
|
138
136
|
|
|
139
|
-
|
|
137
|
+
##### entity
|
|
138
|
+
|
|
139
|
+
`T`
|
|
140
140
|
|
|
141
141
|
The entity to set.
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
##### conditions?
|
|
144
|
+
|
|
145
|
+
`object`[]
|
|
144
146
|
|
|
145
147
|
The optional conditions to match for the entities.
|
|
146
148
|
|
|
@@ -164,11 +166,15 @@ Remove the entity.
|
|
|
164
166
|
|
|
165
167
|
#### Parameters
|
|
166
168
|
|
|
167
|
-
|
|
169
|
+
##### id
|
|
170
|
+
|
|
171
|
+
`string`
|
|
168
172
|
|
|
169
173
|
The id of the entity to remove.
|
|
170
174
|
|
|
171
|
-
|
|
175
|
+
##### conditions?
|
|
176
|
+
|
|
177
|
+
`object`[]
|
|
172
178
|
|
|
173
179
|
The optional conditions to match for the entities.
|
|
174
180
|
|
|
@@ -186,51 +192,49 @@ Nothing.
|
|
|
186
192
|
|
|
187
193
|
### query()
|
|
188
194
|
|
|
189
|
-
> **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`
|
|
195
|
+
> **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
|
|
190
196
|
|
|
191
197
|
Find all the entities which match the conditions.
|
|
192
198
|
|
|
193
199
|
#### Parameters
|
|
194
200
|
|
|
195
|
-
|
|
201
|
+
##### conditions?
|
|
202
|
+
|
|
203
|
+
`EntityCondition`\<`T`\>
|
|
196
204
|
|
|
197
205
|
The conditions to match for the entities.
|
|
198
206
|
|
|
199
|
-
|
|
207
|
+
##### sortProperties?
|
|
208
|
+
|
|
209
|
+
`object`[]
|
|
200
210
|
|
|
201
211
|
The optional sort order.
|
|
202
212
|
|
|
203
|
-
|
|
213
|
+
##### properties?
|
|
214
|
+
|
|
215
|
+
keyof `T`[]
|
|
204
216
|
|
|
205
217
|
The optional properties to return, defaults to all.
|
|
206
218
|
|
|
207
|
-
|
|
219
|
+
##### cursor?
|
|
220
|
+
|
|
221
|
+
`string`
|
|
208
222
|
|
|
209
223
|
The cursor to request the next page of entities.
|
|
210
224
|
|
|
211
|
-
|
|
225
|
+
##### pageSize?
|
|
226
|
+
|
|
227
|
+
`number`
|
|
212
228
|
|
|
213
229
|
The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
|
|
214
230
|
|
|
215
231
|
#### Returns
|
|
216
232
|
|
|
217
|
-
`Promise`\<`
|
|
233
|
+
`Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
|
|
218
234
|
|
|
219
235
|
All the entities for the storage matching the conditions,
|
|
220
236
|
and a cursor which can be used to request more entities.
|
|
221
237
|
|
|
222
|
-
##### entities
|
|
223
|
-
|
|
224
|
-
> **entities**: `Partial`\<`T`\>[]
|
|
225
|
-
|
|
226
|
-
The entities, which can be partial if a limited keys list was provided.
|
|
227
|
-
|
|
228
|
-
##### cursor?
|
|
229
|
-
|
|
230
|
-
> `optional` **cursor**: `string`
|
|
231
|
-
|
|
232
|
-
An optional cursor, when defined can be used to call find to get more entities.
|
|
233
|
-
|
|
234
238
|
#### Implementation of
|
|
235
239
|
|
|
236
240
|
`IEntityStorageConnector.query`
|
package/docs/reference/index.md
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IDynamoDbEntityStorageConnectorConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the Dynamo DB Entity Storage Connector constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### entitySchema
|
|
8
|
+
|
|
9
|
+
> **entitySchema**: `string`
|
|
10
|
+
|
|
11
|
+
The schema for the entity
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### loggingConnectorType?
|
|
16
|
+
|
|
17
|
+
> `optional` **loggingConnectorType**: `string`
|
|
18
|
+
|
|
19
|
+
The type of logging connector to use, defaults to no logging.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### config
|
|
24
|
+
|
|
25
|
+
> **config**: [`IDynamoDbEntityStorageConnectorConfig`](IDynamoDbEntityStorageConnectorConfig.md)
|
|
26
|
+
|
|
27
|
+
The configuration for the connector.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-dynamodb",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.15",
|
|
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.
|
|
18
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
19
|
-
"@aws-sdk/util-dynamodb": "3.
|
|
17
|
+
"@aws-sdk/client-dynamodb": "3.723",
|
|
18
|
+
"@aws-sdk/lib-dynamodb": "3.723",
|
|
19
|
+
"@aws-sdk/util-dynamodb": "3.723",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/entity-storage-models": "0.0.1-next.
|
|
22
|
+
"@twin.org/entity-storage-models": "0.0.1-next.15",
|
|
23
23
|
"@twin.org/logging-models": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"import": "./dist/esm/index.mjs",
|
|
33
33
|
"types": "./dist/types/index.d.ts"
|
|
34
34
|
},
|
|
35
|
-
"./locales": "./locales"
|
|
35
|
+
"./locales/*.json": "./locales/*.json"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist/cjs",
|