@twin.org/entity-storage-connector-dynamodb 0.0.2-next.5 → 0.0.2-next.6
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 +13 -17
- package/dist/esm/index.mjs +14 -18
- package/dist/types/dynamoDbEntityStorageConnector.d.ts +2 -2
- package/dist/types/models/IDynamoDbEntityStorageConnectorConstructorOptions.d.ts +2 -2
- package/docs/changelog.md +16 -0
- package/docs/reference/classes/DynamoDbEntityStorageConnector.md +3 -3
- package/docs/reference/interfaces/IDynamoDbEntityStorageConnectorConstructorOptions.md +3 -3
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
|
70
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
72
71
|
* @returns True if the bootstrapping process was successful.
|
|
73
72
|
*/
|
|
74
|
-
async bootstrap(
|
|
75
|
-
const nodeLogging =
|
|
73
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
74
|
+
const nodeLogging = core.ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -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
|
|
68
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
70
69
|
* @returns True if the bootstrapping process was successful.
|
|
71
70
|
*/
|
|
72
|
-
async bootstrap(
|
|
73
|
-
const nodeLogging =
|
|
71
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
72
|
+
const nodeLogging = ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
|
19
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
20
20
|
* @returns True if the bootstrapping process was successful.
|
|
21
21
|
*/
|
|
22
|
-
bootstrap(
|
|
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
|
|
11
|
+
* The type of logging component to use, defaults to no logging.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
loggingComponentType?: string;
|
|
14
14
|
/**
|
|
15
15
|
* The configuration for the connector.
|
|
16
16
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @twin.org/entity-storage-connector-dynamodb - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update framework core ([b59a380](https://github.com/twinfoundation/entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
|
|
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.5 to 0.0.2-next.6
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
18
|
+
|
|
3
19
|
## [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
20
|
|
|
5
21
|
|
|
@@ -48,17 +48,17 @@ Runtime name for the class.
|
|
|
48
48
|
|
|
49
49
|
### bootstrap()
|
|
50
50
|
|
|
51
|
-
> **bootstrap**(`
|
|
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
|
-
#####
|
|
57
|
+
##### nodeLoggingComponentType?
|
|
58
58
|
|
|
59
59
|
`string`
|
|
60
60
|
|
|
61
|
-
The 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
|
-
###
|
|
15
|
+
### loggingComponentType?
|
|
16
16
|
|
|
17
|
-
> `optional` **
|
|
17
|
+
> `optional` **loggingComponentType**: `string`
|
|
18
18
|
|
|
19
|
-
The type of 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.
|
|
3
|
+
"version": "0.0.2-next.6",
|
|
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.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.
|
|
22
|
+
"@twin.org/entity-storage-models": "0.0.2-next.6",
|
|
23
23
|
"@twin.org/logging-models": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|