@xapp/stentor-service-dynamo 1.86.9 → 1.86.10
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 +22 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
## @xapp/stentor-service-dynamo
|
|
2
|
+
|
|
3
|
+
The base DynamoDB service used by the other `@xapp/stentor-service-*` packages. It exports an abstract `DynamoService` class that wraps the AWS SDK v3 `DynamoDBDocumentClient` (via `@aws-sdk/lib-dynamodb`) with retry/backoff logic for creates, batch writes, gets, queries, scans, updates and deletes. It also exports the `scan()` and `withCondition()` query builders for composing `FilterExpression`/`ConditionExpression` objects, and a `StubDocumentClient` that replaces the write client when `preventWrites: true` is set.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { DynamoService, DynamoServiceProps } from "@xapp/stentor-service-dynamo";
|
|
9
|
+
|
|
10
|
+
class MyService extends DynamoService {
|
|
11
|
+
constructor(props: DynamoServiceProps) {
|
|
12
|
+
super(props); // props.tableName is required
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Consumers only need to supply a `tableName` (and optionally `readDb`/`writeDb` clients, `retryAttempts`, `waitMs`, or `preventWrites`); the read/write `DynamoDBDocumentClient` instances are otherwise created automatically using the AWS SDK's default credential chain.
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
- [AWS DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)
|
|
22
|
+
- [AWS SDK for JavaScript v3 - Lib Dynamodb](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-lib-dynamodb/)
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.86.
|
|
7
|
+
"version": "1.86.10",
|
|
8
8
|
"description": "PLACEHOLDER DESCRIPTION OF PACKAGE",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"node": "^10 || ^12 || ^14 || ^16 || ^18 || ^20 || ^22 || ^24"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
19
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
18
|
+
"@aws-sdk/client-dynamodb": "3.1133.0",
|
|
19
|
+
"@aws-sdk/lib-dynamodb": "3.1133.0",
|
|
20
20
|
"@types/chai": "5.2.3",
|
|
21
21
|
"@types/lodash": "4.17.25",
|
|
22
22
|
"@types/sinon": "4.3.3",
|