@exabugs/dynamodb-client 0.9.0 → 0.9.1
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 +11 -0
- package/dist/server/handler.cjs +32 -8
- package/dist/server/handler.cjs.map +2 -2
- package/dist/server/operations/find/utils.d.ts +1 -4
- package/dist/server/operations/find/utils.d.ts.map +1 -1
- package/dist/server/operations/find/utils.js +35 -6
- package/dist/server/operations/find/utils.js.map +1 -1
- package/dist/server/utils/filter.d.ts +1 -1
- package/dist/server/utils/filter.d.ts.map +1 -1
- package/dist/server/utils/filter.js +14 -1
- package/dist/server/utils/filter.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.1] - 2024-12-30
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Filter Operator Support**: Added support for `in`, `nin`, `contains`, and `exists` operators
|
|
15
|
+
- Updated `FilterOperator` type to include all supported operators
|
|
16
|
+
- Enhanced `parseFilters` function to support nested object filter syntax: `{ id: { in: [...] } }`
|
|
17
|
+
- Added `contains` and `exists` operator handling in `matchesAllFilters` function
|
|
18
|
+
- Fixed react-admin integration: `getMany` operation now works correctly with `in` operator
|
|
19
|
+
- Backward compatible: Both filter syntaxes are supported (`"id:in"` and `{ id: { in: [...] } }`)
|
|
20
|
+
|
|
10
21
|
## [0.9.0] - 2024-12-29
|
|
11
22
|
|
|
12
23
|
### Added
|
package/dist/server/handler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v0.9.
|
|
2
|
-
// Built: 2025-12-
|
|
1
|
+
// @exabugs/dynamodb-client v0.9.1
|
|
2
|
+
// Built: 2025-12-30T00:20:04.089Z
|
|
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 [
|
|
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
|
-
|
|
29746
|
-
|
|
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
|
}
|