@exabugs/dynamodb-client 0.9.0 → 0.9.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.2] - 2024-12-31
11
+
12
+ ### Fixed
13
+
14
+ - **Parameter Converter**: Improved code formatting and maintainability
15
+ - Refactored multi-line ternary operators to single-line format for better readability
16
+ - Enhanced `convertUpdateOneParams` and `convertUpdateManyParams` to properly pass through `options` parameter
17
+ - Ensures upsert options are correctly propagated from MongoDB-style API to internal operations
18
+ - No functional changes - purely code quality improvements
19
+
20
+ ## [0.9.1] - 2024-12-30
21
+
22
+ ### Fixed
23
+
24
+ - **Filter Operator Support**: Added support for `in`, `nin`, `contains`, and `exists` operators
25
+ - Updated `FilterOperator` type to include all supported operators
26
+ - Enhanced `parseFilters` function to support nested object filter syntax: `{ id: { in: [...] } }`
27
+ - Added `contains` and `exists` operator handling in `matchesAllFilters` function
28
+ - Fixed react-admin integration: `getMany` operation now works correctly with `in` operator
29
+ - Backward compatible: Both filter syntaxes are supported (`"id:in"` and `{ id: { in: [...] } }`)
30
+
10
31
  ## [0.9.0] - 2024-12-29
11
32
 
12
33
  ### Added
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v0.9.0
2
- // Built: 2025-12-29T14:15:35.409Z
1
+ // @exabugs/dynamodb-client v0.9.2
2
+ // Built: 2025-12-30T15:30:51.446Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -29707,7 +29707,20 @@ function parseFilterField(fieldKey) {
29707
29707
  }
29708
29708
  __name(parseFilterField, "parseFilterField");
29709
29709
  function isValidOperator(operator) {
29710
- return ["eq", "lt", "lte", "gt", "gte", "starts", "ends"].includes(operator);
29710
+ return [
29711
+ "eq",
29712
+ "ne",
29713
+ "lt",
29714
+ "lte",
29715
+ "gt",
29716
+ "gte",
29717
+ "in",
29718
+ "nin",
29719
+ "starts",
29720
+ "ends",
29721
+ "contains",
29722
+ "exists"
29723
+ ].includes(operator);
29711
29724
  }
29712
29725
  __name(isValidOperator, "isValidOperator");
29713
29726
  function isValidType(type) {
@@ -29742,8 +29755,15 @@ function parseFilters(filter) {
29742
29755
  }
29743
29756
  for (const [fieldKey, value] of Object.entries(filter)) {
29744
29757
  try {
29745
- const parsed = parseFilterField(fieldKey);
29746
- parsedFilters.push({ parsed, value });
29758
+ if (value && typeof value === "object" && !Array.isArray(value)) {
29759
+ for (const [operator, operatorValue] of Object.entries(value)) {
29760
+ const parsed = parseFilterField(`${fieldKey}:${operator}`);
29761
+ parsedFilters.push({ parsed, value: operatorValue });
29762
+ }
29763
+ } else {
29764
+ const parsed = parseFilterField(fieldKey);
29765
+ parsedFilters.push({ parsed, value });
29766
+ }
29747
29767
  } catch (error2) {
29748
29768
  logger7.error("Invalid filter field syntax", {
29749
29769
  fieldKey,
@@ -29759,9 +29779,7 @@ function parseFilters(filter) {
29759
29779
  }
29760
29780
  __name(parseFilters, "parseFilters");
29761
29781
  function findOptimizableFilter(sortField, parsedFilters) {
29762
- return parsedFilters.find(
29763
- (filter) => filter.parsed.field === sortField
29764
- );
29782
+ return parsedFilters.find((filter) => filter.parsed.field === sortField);
29765
29783
  }
29766
29784
  __name(findOptimizableFilter, "findOptimizableFilter");
29767
29785
  function matchesAllFilters(record, parsedFilters) {
@@ -29788,6 +29806,12 @@ function matchesAllFilters(record, parsedFilters) {
29788
29806
  return Array.isArray(filterValue) && !filterValue.includes(recordValue);
29789
29807
  case "starts":
29790
29808
  return typeof recordValue === "string" && typeof filterValue === "string" && recordValue.startsWith(filterValue);
29809
+ case "ends":
29810
+ return typeof recordValue === "string" && typeof filterValue === "string" && recordValue.endsWith(filterValue);
29811
+ case "contains":
29812
+ return typeof recordValue === "string" && typeof filterValue === "string" && recordValue.includes(filterValue);
29813
+ case "exists":
29814
+ return filterValue ? recordValue !== void 0 && recordValue !== null : recordValue === void 0 || recordValue === null;
29791
29815
  default:
29792
29816
  return true;
29793
29817
  }
@@ -31264,7 +31288,8 @@ function convertUpdateOneParams(mongoParams) {
31264
31288
  const updateData = mongoParams.update && typeof mongoParams.update === "object" ? "set" in mongoParams.update ? mongoParams.update.set || {} : mongoParams.update : {};
31265
31289
  return {
31266
31290
  id,
31267
- data: updateData
31291
+ data: updateData,
31292
+ options: mongoParams.options
31268
31293
  };
31269
31294
  }
31270
31295
  __name(convertUpdateOneParams, "convertUpdateOneParams");
@@ -31274,7 +31299,8 @@ function convertUpdateManyParams(mongoParams) {
31274
31299
  const updateData = mongoParams.update && typeof mongoParams.update === "object" ? "set" in mongoParams.update ? mongoParams.update.set || {} : mongoParams.update : {};
31275
31300
  return {
31276
31301
  ids,
31277
- data: updateData
31302
+ data: updateData,
31303
+ options: mongoParams.options
31278
31304
  };
31279
31305
  }
31280
31306
  __name(convertUpdateManyParams, "convertUpdateManyParams");