wirejs-deploy-amplify-basic 0.0.73-table-resource → 0.0.75-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.
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.38",
6
- "wirejs-resources": "^0.1.41-table-resource"
6
+ "wirejs-resources": "^0.1.43-table-resource"
7
7
  }
8
8
  }
@@ -4,7 +4,7 @@ import { PutCommand, GetCommand, QueryCommand, ScanCommand, DeleteCommand, } fro
4
4
  import { Resource, indexName } from 'wirejs-resources';
5
5
  import { addResource } from '../resource-collector.js';
6
6
  function fieldAlias(name) {
7
- return `#a_${name}`;
7
+ return `#FN${name}`;
8
8
  }
9
9
  function isFieldComparison(filter) {
10
10
  console.log('Checking if filter is a field comparison:', filter);
@@ -13,13 +13,26 @@ function isFieldComparison(filter) {
13
13
  function buildFilterExpression(filter) {
14
14
  console.log('Building filter expression for filter:', filter);
15
15
  if (filter.and) {
16
- return `(${filter.and.map(buildFilterExpression).join(' AND ')})`;
16
+ let pl = '(';
17
+ let pr = ')';
18
+ if (filter.and.length === 1) {
19
+ pl = '';
20
+ pr = '';
21
+ }
22
+ return `${pl}${filter.and.map(buildFilterExpression).join(' AND ')}${pr}`;
17
23
  }
18
24
  if (filter.or) {
19
- return `(${filter.or.map(buildFilterExpression).join(' OR ')})`;
25
+ let pl = '(';
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}`;
20
33
  }
21
34
  if (filter.not) {
22
- return `(NOT ${buildFilterExpression(filter.not)})`;
35
+ return `NOT ${buildFilterExpression(filter.not)}`;
23
36
  }
24
37
  if (!isFieldComparison(filter)) {
25
38
  throw new Error(`Unsupported filter: ${JSON.stringify(filter)}`);
@@ -254,7 +267,9 @@ export class DistributedTable extends Resource {
254
267
  ExpressionAttributeValues: expressionAttributeValues,
255
268
  ExpressionAttributeNames: expressionAttributeNames,
256
269
  ExclusiveStartKey: lastEvaluatedKey,
270
+ Select: 'ALL_ATTRIBUTES',
257
271
  }));
272
+ console.log('DDB Query result:', result);
258
273
  for (const item of result.Items || []) {
259
274
  if (!item)
260
275
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.73-table-resource",
3
+ "version": "0.0.75-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.41-table-resource"
35
+ "wirejs-resources": "^0.1.43-table-resource"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@aws-amplify/backend": "^1.14.0",