wirejs-deploy-amplify-basic 0.0.76-table-resource → 0.0.78-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.
|
@@ -13,23 +13,10 @@ function isFieldComparison(filter) {
|
|
|
13
13
|
function buildFilterExpression(filter) {
|
|
14
14
|
console.log('Building filter expression for filter:', filter);
|
|
15
15
|
if (filter.and) {
|
|
16
|
-
|
|
17
|
-
let pr = ')';
|
|
18
|
-
if (filter.and.length === 1) {
|
|
19
|
-
pl = '';
|
|
20
|
-
pr = '';
|
|
21
|
-
}
|
|
22
|
-
return `${pl}${filter.and.map(buildFilterExpression).join(' AND ')}${pr}`;
|
|
16
|
+
return `(${filter.and.map(buildFilterExpression).join(' AND ')})`;
|
|
23
17
|
}
|
|
24
18
|
if (filter.or) {
|
|
25
|
-
|
|
26
|
-
;
|
|
27
|
-
let pr = ')';
|
|
28
|
-
if (filter.or.length === 1) {
|
|
29
|
-
pl = '';
|
|
30
|
-
pr = '';
|
|
31
|
-
}
|
|
32
|
-
return `${pl}${filter.or.map(buildFilterExpression).join(' OR ')}${pr}`;
|
|
19
|
+
return `(${filter.or.map(buildFilterExpression).join(' OR ')})`;
|
|
33
20
|
}
|
|
34
21
|
if (filter.not) {
|
|
35
22
|
return `NOT ${buildFilterExpression(filter.not)}`;
|
|
@@ -73,23 +60,23 @@ function buildExpressionAttributeValues(filter) {
|
|
|
73
60
|
const [field] = Object.keys(filter);
|
|
74
61
|
const condition = filter[field];
|
|
75
62
|
if ('eq' in condition)
|
|
76
|
-
values[`:${field}`] =
|
|
63
|
+
values[`:${field}`] = condition.eq;
|
|
77
64
|
if ('ne' in condition)
|
|
78
|
-
values[`:${field}`] =
|
|
65
|
+
values[`:${field}`] = condition.ne;
|
|
79
66
|
if ('gt' in condition)
|
|
80
|
-
values[`:${field}`] =
|
|
67
|
+
values[`:${field}`] = condition.gt;
|
|
81
68
|
if ('ge' in condition)
|
|
82
|
-
values[`:${field}`] =
|
|
69
|
+
values[`:${field}`] = condition.ge;
|
|
83
70
|
if ('lt' in condition)
|
|
84
|
-
values[`:${field}`] =
|
|
71
|
+
values[`:${field}`] = condition.lt;
|
|
85
72
|
if ('le' in condition)
|
|
86
|
-
values[`:${field}`] =
|
|
73
|
+
values[`:${field}`] = condition.le;
|
|
87
74
|
if ('between' in condition) {
|
|
88
|
-
values[`:${field}Low`] =
|
|
89
|
-
values[`:${field}High`] =
|
|
75
|
+
values[`:${field}Low`] = condition.between[0];
|
|
76
|
+
values[`:${field}High`] = condition.between[1];
|
|
90
77
|
}
|
|
91
78
|
if ('beginsWith' in condition)
|
|
92
|
-
values[`:${field}`] =
|
|
79
|
+
values[`:${field}`] = condition.beginsWith;
|
|
93
80
|
}
|
|
94
81
|
else {
|
|
95
82
|
throw new Error(`Unsupported filter: ${JSON.stringify(filter)}`);
|
|
@@ -260,10 +247,10 @@ export class DistributedTable extends Resource {
|
|
|
260
247
|
ExpressionAttributeNames: expressionAttributeNames,
|
|
261
248
|
ExclusiveStartKey: lastEvaluatedKey,
|
|
262
249
|
});
|
|
263
|
-
console.log('DynamoDB query command:', JSON.stringify(command, null, 2));
|
|
250
|
+
// console.log('DynamoDB query command:', JSON.stringify(command, null, 2));
|
|
264
251
|
try {
|
|
265
252
|
const result = await this.ddbClient.send(command);
|
|
266
|
-
console.log('DDB Query result:', result);
|
|
253
|
+
// console.log('DDB Query result:', result);
|
|
267
254
|
for (const item of result.Items || []) {
|
|
268
255
|
if (!item)
|
|
269
256
|
continue;
|
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.78-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.46-table-resource"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@aws-amplify/backend": "^1.14.0",
|