wirejs-deploy-amplify-basic 0.0.75-table-resource → 0.0.77-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.43-table-resource"
6
+ "wirejs-resources": "^0.1.45-table-resource"
7
7
  }
8
8
  }
@@ -73,23 +73,23 @@ function buildExpressionAttributeValues(filter) {
73
73
  const [field] = Object.keys(filter);
74
74
  const condition = filter[field];
75
75
  if ('eq' in condition)
76
- values[`:${field}`] = { S: condition.eq };
76
+ values[`:${field}`] = condition.eq;
77
77
  if ('ne' in condition)
78
- values[`:${field}`] = { S: condition.ne };
78
+ values[`:${field}`] = condition.ne;
79
79
  if ('gt' in condition)
80
- values[`:${field}`] = { S: condition.gt };
80
+ values[`:${field}`] = condition.gt;
81
81
  if ('ge' in condition)
82
- values[`:${field}`] = { S: condition.ge };
82
+ values[`:${field}`] = condition.ge;
83
83
  if ('lt' in condition)
84
- values[`:${field}`] = { S: condition.lt };
84
+ values[`:${field}`] = condition.lt;
85
85
  if ('le' in condition)
86
- values[`:${field}`] = { S: condition.le };
86
+ values[`:${field}`] = condition.le;
87
87
  if ('between' in condition) {
88
- values[`:${field}Low`] = { S: condition.between[0] };
89
- values[`:${field}High`] = { S: condition.between[1] };
88
+ values[`:${field}Low`] = condition.between[0];
89
+ values[`:${field}High`] = condition.between[1];
90
90
  }
91
91
  if ('beginsWith' in condition)
92
- values[`:${field}`] = { S: condition.beginsWith };
92
+ values[`:${field}`] = condition.beginsWith;
93
93
  }
94
94
  else {
95
95
  throw new Error(`Unsupported filter: ${JSON.stringify(filter)}`);
@@ -249,17 +249,9 @@ export class DistributedTable extends Resource {
249
249
  partition: this.key.partition,
250
250
  sort: this.key.sort
251
251
  });
252
- console.log('DynamoDB query params', {
253
- TableName: this.table,
254
- IndexName: isIndexNameTheDefault ? undefined : options.by,
255
- KeyConditionExpression: keyConditionExpression,
256
- FilterExpression: filterExpression,
257
- ExpressionAttributeValues: expressionAttributeValues,
258
- ExpressionAttributeNames: expressionAttributeNames,
259
- });
260
252
  let lastEvaluatedKey = undefined;
261
253
  do {
262
- const result = await this.ddbClient.send(new QueryCommand({
254
+ const command = new QueryCommand({
263
255
  TableName: this.table,
264
256
  IndexName: isIndexNameTheDefault ? undefined : options.by,
265
257
  KeyConditionExpression: keyConditionExpression,
@@ -267,16 +259,23 @@ export class DistributedTable extends Resource {
267
259
  ExpressionAttributeValues: expressionAttributeValues,
268
260
  ExpressionAttributeNames: expressionAttributeNames,
269
261
  ExclusiveStartKey: lastEvaluatedKey,
270
- Select: 'ALL_ATTRIBUTES',
271
- }));
272
- console.log('DDB Query result:', result);
273
- for (const item of result.Items || []) {
274
- if (!item)
275
- continue;
276
- const record = this.parse(item);
277
- yield record;
262
+ });
263
+ console.log('DynamoDB query command:', JSON.stringify(command, null, 2));
264
+ try {
265
+ const result = await this.ddbClient.send(command);
266
+ console.log('DDB Query result:', result);
267
+ for (const item of result.Items || []) {
268
+ if (!item)
269
+ continue;
270
+ const record = this.parse(item);
271
+ yield record;
272
+ }
273
+ lastEvaluatedKey = result.LastEvaluatedKey;
274
+ }
275
+ catch (error) {
276
+ console.error('Error executing query:', error);
277
+ throw error;
278
278
  }
279
- lastEvaluatedKey = result.LastEvaluatedKey;
280
279
  } while (lastEvaluatedKey);
281
280
  }
282
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.75-table-resource",
3
+ "version": "0.0.77-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.43-table-resource"
35
+ "wirejs-resources": "^0.1.45-table-resource"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@aws-amplify/backend": "^1.14.0",