@prmichaelsen/firebase-admin-sdk-v8 2.5.1 → 2.5.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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(./agent/scripts/acp.version-check-for-updates.sh:*)",
5
+ "Bash(test:*)",
6
+ "Bash(ls:*)",
7
+ "Bash(git add:*)"
8
+ ]
9
+ }
10
+ }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.5.2] - 2026-03-03
9
+
10
+ ### Fixed
11
+ - **Firestore Query**: Fixed null/undefined and NaN value queries in Firestore
12
+ - Added support for `where('field', '==', null)` queries using `unaryFilter` with `IS_NULL` operator
13
+ - Added support for `where('field', '==', NaN)` queries using `unaryFilter` with `IS_NAN` operator
14
+ - Previously, null/NaN queries would fail because they incorrectly used `fieldFilter` instead of `unaryFilter`
15
+ - Firestore REST API requires `unaryFilter` for these special value comparisons
16
+ - All 463 tests passing with fix
17
+
8
18
  ## [2.5.1] - 2026-02-24
9
19
 
10
20
  ### Fixed
package/dist/index.js CHANGED
@@ -1100,13 +1100,31 @@ function buildStructuredQuery(collectionPath, options) {
1100
1100
  from: [fromClause]
1101
1101
  };
1102
1102
  if (options?.where && options.where.length > 0) {
1103
- const filters = options.where.map((filter) => ({
1104
- fieldFilter: {
1105
- field: { fieldPath: filter.field },
1106
- op: mapWhereOp(filter.op),
1107
- value: toFirestoreValue(filter.value)
1103
+ const filters = options.where.map((filter) => {
1104
+ if ((filter.value === null || filter.value === void 0) && filter.op === "==") {
1105
+ return {
1106
+ unaryFilter: {
1107
+ field: { fieldPath: filter.field },
1108
+ op: "IS_NULL"
1109
+ }
1110
+ };
1108
1111
  }
1109
- }));
1112
+ if (filter.value !== filter.value && filter.op === "==") {
1113
+ return {
1114
+ unaryFilter: {
1115
+ field: { fieldPath: filter.field },
1116
+ op: "IS_NAN"
1117
+ }
1118
+ };
1119
+ }
1120
+ return {
1121
+ fieldFilter: {
1122
+ field: { fieldPath: filter.field },
1123
+ op: mapWhereOp(filter.op),
1124
+ value: toFirestoreValue(filter.value)
1125
+ }
1126
+ };
1127
+ });
1110
1128
  if (filters.length === 1) {
1111
1129
  query.where = filters[0];
1112
1130
  } else {
package/dist/index.mjs CHANGED
@@ -859,13 +859,31 @@ function buildStructuredQuery(collectionPath, options) {
859
859
  from: [fromClause]
860
860
  };
861
861
  if (options?.where && options.where.length > 0) {
862
- const filters = options.where.map((filter) => ({
863
- fieldFilter: {
864
- field: { fieldPath: filter.field },
865
- op: mapWhereOp(filter.op),
866
- value: toFirestoreValue(filter.value)
862
+ const filters = options.where.map((filter) => {
863
+ if ((filter.value === null || filter.value === void 0) && filter.op === "==") {
864
+ return {
865
+ unaryFilter: {
866
+ field: { fieldPath: filter.field },
867
+ op: "IS_NULL"
868
+ }
869
+ };
867
870
  }
868
- }));
871
+ if (filter.value !== filter.value && filter.op === "==") {
872
+ return {
873
+ unaryFilter: {
874
+ field: { fieldPath: filter.field },
875
+ op: "IS_NAN"
876
+ }
877
+ };
878
+ }
879
+ return {
880
+ fieldFilter: {
881
+ field: { fieldPath: filter.field },
882
+ op: mapWhereOp(filter.op),
883
+ value: toFirestoreValue(filter.value)
884
+ }
885
+ };
886
+ });
869
887
  if (filters.length === 1) {
870
888
  query.where = filters[0];
871
889
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prmichaelsen/firebase-admin-sdk-v8",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "Firebase Admin SDK for Cloudflare Workers and edge runtimes using REST APIs",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",