wirejs-deploy-amplify-basic 0.0.64-table-resource → 0.0.66-table-resource
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.
|
@@ -82,6 +82,7 @@ for (const resource of generated) {
|
|
|
82
82
|
removalPolicy: RemovalPolicy.RETAIN,
|
|
83
83
|
tableName: `${TABLE_NAME_PREFIX}${sanitizedId}`,
|
|
84
84
|
billingMode: BillingMode.PAY_PER_REQUEST,
|
|
85
|
+
pointInTimeRecovery: true,
|
|
85
86
|
});
|
|
86
87
|
table.grantReadWriteData(backend.api.resources.lambda);
|
|
87
88
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
|
-
import { DynamoDBClient,
|
|
3
|
-
import { PutCommand, GetCommand, QueryCommand, ScanCommand, } from '@aws-sdk/lib-dynamodb';
|
|
2
|
+
import { DynamoDBClient, } from '@aws-sdk/client-dynamodb';
|
|
3
|
+
import { PutCommand, GetCommand, QueryCommand, ScanCommand, DeleteCommand, } from '@aws-sdk/lib-dynamodb';
|
|
4
4
|
import { Resource, } from 'wirejs-resources';
|
|
5
5
|
import { addResource } from '../resource-collector.js';
|
|
6
6
|
function isFieldComparison(filter) {
|
|
@@ -113,11 +113,11 @@ export class DistributedTable extends Resource {
|
|
|
113
113
|
}
|
|
114
114
|
#getDDBKey(key) {
|
|
115
115
|
const ddbKey = {
|
|
116
|
-
[this.partitionKey]:
|
|
116
|
+
[this.partitionKey]: key[this.partitionKey]
|
|
117
117
|
};
|
|
118
118
|
if (this.sort) {
|
|
119
119
|
for (const sk of this.sort) {
|
|
120
|
-
ddbKey[sk] =
|
|
120
|
+
ddbKey[sk] = key[sk];
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return ddbKey;
|
|
@@ -141,7 +141,7 @@ export class DistributedTable extends Resource {
|
|
|
141
141
|
async delete(item) {
|
|
142
142
|
const key = this.#getDDBKey(item);
|
|
143
143
|
console.log('Deleting item from DynamoDB:', key);
|
|
144
|
-
await this.ddbClient.send(new
|
|
144
|
+
await this.ddbClient.send(new DeleteCommand({
|
|
145
145
|
TableName: this.table,
|
|
146
146
|
Key: key,
|
|
147
147
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirejs-deploy-amplify-basic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.66-table-resource",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"recursive-copy": "^2.0.14",
|
|
33
33
|
"rimraf": "^6.0.1",
|
|
34
34
|
"wirejs-dom": "^1.0.38",
|
|
35
|
-
"wirejs-resources": "^0.1.
|
|
35
|
+
"wirejs-resources": "^0.1.34-table-resource"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@aws-amplify/backend": "^1.14.0",
|