@twin.org/entity-storage-connector-dynamodb 0.0.1-next.27 → 0.0.1-next.29
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
CHANGED
|
@@ -445,6 +445,14 @@ class DynamoDbEntityStorageConnector {
|
|
|
445
445
|
}
|
|
446
446
|
prop += comparator.property;
|
|
447
447
|
let attributeName = this.populateAttributeNames(prop, attributeNames);
|
|
448
|
+
if (core.Is.empty(comparator.value)) {
|
|
449
|
+
if (comparator.comparison === entity.ComparisonOperator.Equals) {
|
|
450
|
+
return `attribute_not_exists(${attributeName})`;
|
|
451
|
+
}
|
|
452
|
+
else if (comparator.comparison === entity.ComparisonOperator.NotEquals) {
|
|
453
|
+
return `attribute_exists(${attributeName})`;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
448
456
|
let propName = `:${attributeName.replace(/\./g, "").replace(/#/g, "")}`;
|
|
449
457
|
if (core.Is.array(comparator.value)) {
|
|
450
458
|
const dbValues = comparator.value.map(v => this.propertyToDbValue(v, type));
|
|
@@ -568,7 +576,7 @@ class DynamoDbEntityStorageConnector {
|
|
|
568
576
|
}
|
|
569
577
|
/**
|
|
570
578
|
* Create a new DB connection.
|
|
571
|
-
* @returns The
|
|
579
|
+
* @returns The Dynamo DB connection.
|
|
572
580
|
* @internal
|
|
573
581
|
*/
|
|
574
582
|
createConnection() {
|
|
@@ -576,7 +584,7 @@ class DynamoDbEntityStorageConnector {
|
|
|
576
584
|
}
|
|
577
585
|
/**
|
|
578
586
|
* Create a new DB connection configuration.
|
|
579
|
-
* @returns The
|
|
587
|
+
* @returns The Dynamo DB connection configuration.
|
|
580
588
|
* @internal
|
|
581
589
|
*/
|
|
582
590
|
createConnectionConfig() {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -443,6 +443,14 @@ class DynamoDbEntityStorageConnector {
|
|
|
443
443
|
}
|
|
444
444
|
prop += comparator.property;
|
|
445
445
|
let attributeName = this.populateAttributeNames(prop, attributeNames);
|
|
446
|
+
if (Is.empty(comparator.value)) {
|
|
447
|
+
if (comparator.comparison === ComparisonOperator.Equals) {
|
|
448
|
+
return `attribute_not_exists(${attributeName})`;
|
|
449
|
+
}
|
|
450
|
+
else if (comparator.comparison === ComparisonOperator.NotEquals) {
|
|
451
|
+
return `attribute_exists(${attributeName})`;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
446
454
|
let propName = `:${attributeName.replace(/\./g, "").replace(/#/g, "")}`;
|
|
447
455
|
if (Is.array(comparator.value)) {
|
|
448
456
|
const dbValues = comparator.value.map(v => this.propertyToDbValue(v, type));
|
|
@@ -566,7 +574,7 @@ class DynamoDbEntityStorageConnector {
|
|
|
566
574
|
}
|
|
567
575
|
/**
|
|
568
576
|
* Create a new DB connection.
|
|
569
|
-
* @returns The
|
|
577
|
+
* @returns The Dynamo DB connection.
|
|
570
578
|
* @internal
|
|
571
579
|
*/
|
|
572
580
|
createConnection() {
|
|
@@ -574,7 +582,7 @@ class DynamoDbEntityStorageConnector {
|
|
|
574
582
|
}
|
|
575
583
|
/**
|
|
576
584
|
* Create a new DB connection configuration.
|
|
577
|
-
* @returns The
|
|
585
|
+
* @returns The Dynamo DB connection configuration.
|
|
578
586
|
* @internal
|
|
579
587
|
*/
|
|
580
588
|
createConnectionConfig() {
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @twin.org/entity-storage-connector-dynamodb - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.29](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.1-next.28...entity-storage-connector-dynamodb-v0.0.1-next.29) (2025-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use shared store mechanism ([#34](https://github.com/twinfoundation/entity-storage/issues/34)) ([68b6b71](https://github.com/twinfoundation/entity-storage/commit/68b6b71e7a96d7d016cd57bfff36775b56bf3f93))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/entity-storage-models bumped from 0.0.1-next.28 to 0.0.1-next.29
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.1-next.28 to 0.0.1-next.29
|
|
18
|
+
|
|
19
|
+
## [0.0.1-next.28](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.1-next.27...entity-storage-connector-dynamodb-v0.0.1-next.28) (2025-04-09)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* update docs ([5203e62](https://github.com/twinfoundation/entity-storage/commit/5203e621c3ae368f6fefb29ea5146f024f4a1b0d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/entity-storage-models bumped from 0.0.1-next.27 to 0.0.1-next.28
|
|
32
|
+
* devDependencies
|
|
33
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.1-next.27 to 0.0.1-next.28
|
|
34
|
+
|
|
3
35
|
## [0.0.1-next.27](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-dynamodb-v0.0.1-next.26...entity-storage-connector-dynamodb-v0.0.1-next.27) (2025-03-28)
|
|
4
36
|
|
|
5
37
|
|
|
@@ -4,7 +4,9 @@ Class for performing entity storage operations using Dynamo DB.
|
|
|
4
4
|
|
|
5
5
|
## Type Parameters
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### T
|
|
8
|
+
|
|
9
|
+
`T` = `unknown`
|
|
8
10
|
|
|
9
11
|
## Implements
|
|
10
12
|
|
|
@@ -12,9 +14,9 @@ Class for performing entity storage operations using Dynamo DB.
|
|
|
12
14
|
|
|
13
15
|
## Constructors
|
|
14
16
|
|
|
15
|
-
###
|
|
17
|
+
### Constructor
|
|
16
18
|
|
|
17
|
-
> **new DynamoDbEntityStorageConnector**\<`T`\>(`options`):
|
|
19
|
+
> **new DynamoDbEntityStorageConnector**\<`T`\>(`options`): `DynamoDbEntityStorageConnector`\<`T`\>
|
|
18
20
|
|
|
19
21
|
Create a new instance of DynamoDbEntityStorageConnector.
|
|
20
22
|
|
|
@@ -28,7 +30,7 @@ The options for the connector.
|
|
|
28
30
|
|
|
29
31
|
#### Returns
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
`DynamoDbEntityStorageConnector`\<`T`\>
|
|
32
34
|
|
|
33
35
|
## Properties
|
|
34
36
|
|
|
@@ -46,7 +48,7 @@ Runtime name for the class.
|
|
|
46
48
|
|
|
47
49
|
### bootstrap()
|
|
48
50
|
|
|
49
|
-
> **bootstrap**(`nodeLoggingConnectorType
|
|
51
|
+
> **bootstrap**(`nodeLoggingConnectorType?`): `Promise`\<`boolean`\>
|
|
50
52
|
|
|
51
53
|
Bootstrap the component by creating and initializing any resources it needs.
|
|
52
54
|
|
|
@@ -90,7 +92,7 @@ The schema for the entities.
|
|
|
90
92
|
|
|
91
93
|
### get()
|
|
92
94
|
|
|
93
|
-
> **get**(`id`, `secondaryIndex
|
|
95
|
+
> **get**(`id`, `secondaryIndex?`, `conditions?`): `Promise`\<`undefined` \| `T`\>
|
|
94
96
|
|
|
95
97
|
Get an entity.
|
|
96
98
|
|
|
@@ -128,7 +130,7 @@ The object if it can be found or undefined.
|
|
|
128
130
|
|
|
129
131
|
### set()
|
|
130
132
|
|
|
131
|
-
> **set**(`entity`, `conditions
|
|
133
|
+
> **set**(`entity`, `conditions?`): `Promise`\<`void`\>
|
|
132
134
|
|
|
133
135
|
Set an entity.
|
|
134
136
|
|
|
@@ -160,7 +162,7 @@ The id of the entity.
|
|
|
160
162
|
|
|
161
163
|
### remove()
|
|
162
164
|
|
|
163
|
-
> **remove**(`id`, `conditions
|
|
165
|
+
> **remove**(`id`, `conditions?`): `Promise`\<`void`\>
|
|
164
166
|
|
|
165
167
|
Remove the entity.
|
|
166
168
|
|
|
@@ -192,7 +194,7 @@ Nothing.
|
|
|
192
194
|
|
|
193
195
|
### query()
|
|
194
196
|
|
|
195
|
-
> **query**(`conditions
|
|
197
|
+
> **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `pageSize?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
|
|
196
198
|
|
|
197
199
|
Find all the entities which match the conditions.
|
|
198
200
|
|
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.29",
|
|
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.788",
|
|
18
|
+
"@aws-sdk/lib-dynamodb": "3.789",
|
|
19
|
+
"@aws-sdk/util-dynamodb": "3.788",
|
|
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.29",
|
|
23
23
|
"@twin.org/logging-models": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|