@typicalday/firegraph 0.14.0 → 0.14.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/dist/backend.cjs +2 -3
- package/dist/backend.cjs.map +1 -1
- package/dist/backend.js +1 -1
- package/dist/{chunk-WRTFC5NG.js → chunk-3AHHXMWX.js} +2 -2
- package/dist/{chunk-PAD7WFFU.js → chunk-DJI3VXXA.js} +36 -10
- package/dist/chunk-DJI3VXXA.js.map +1 -0
- package/dist/{chunk-4MMQ5W74.js → chunk-NNBSUOOF.js} +7 -6
- package/dist/chunk-NNBSUOOF.js.map +1 -0
- package/dist/{chunk-TK64DNVK.js → chunk-SIHE4UY4.js} +3 -4
- package/dist/chunk-SIHE4UY4.js.map +1 -0
- package/dist/cloudflare/index.cjs +7 -7
- package/dist/cloudflare/index.cjs.map +1 -1
- package/dist/cloudflare/index.js +3 -3
- package/dist/firestore-enterprise/index.cjs +42 -40
- package/dist/firestore-enterprise/index.cjs.map +1 -1
- package/dist/firestore-enterprise/index.js +16 -34
- package/dist/firestore-enterprise/index.js.map +1 -1
- package/dist/firestore-standard/index.cjs +34 -37
- package/dist/firestore-standard/index.cjs.map +1 -1
- package/dist/firestore-standard/index.js +9 -34
- package/dist/firestore-standard/index.js.map +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/sqlite/index.cjs +7 -7
- package/dist/sqlite/index.cjs.map +1 -1
- package/dist/sqlite/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-4MMQ5W74.js.map +0 -1
- package/dist/chunk-PAD7WFFU.js.map +0 -1
- package/dist/chunk-TK64DNVK.js.map +0 -1
- /package/dist/{chunk-WRTFC5NG.js.map → chunk-3AHHXMWX.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
migrateRecords,
|
|
55
55
|
precompileSource,
|
|
56
56
|
validateMigrationChain
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-3AHHXMWX.js";
|
|
58
58
|
import {
|
|
59
59
|
CapabilityNotSupportedError,
|
|
60
60
|
CrossBackendTransactionError,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
TraversalError,
|
|
71
71
|
ValidationError,
|
|
72
72
|
deleteField
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-SIHE4UY4.js";
|
|
74
74
|
import {
|
|
75
75
|
SERIALIZATION_TAG,
|
|
76
76
|
isTaggedValue
|
package/dist/sqlite/index.cjs
CHANGED
|
@@ -235,7 +235,6 @@ function isTerminalValue(value) {
|
|
|
235
235
|
if (ctor && typeof ctor.name === "string" && FIRESTORE_TERMINAL_CTOR.has(ctor.name)) return true;
|
|
236
236
|
return true;
|
|
237
237
|
}
|
|
238
|
-
var SAFE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
239
238
|
function assertUpdatePayloadExclusive(update) {
|
|
240
239
|
if (update.replaceData !== void 0 && update.dataOps !== void 0) {
|
|
241
240
|
throw new Error(
|
|
@@ -274,9 +273,9 @@ function walkForDeleteSentinels(node, path, parent, visit) {
|
|
|
274
273
|
}
|
|
275
274
|
function assertSafePath(path) {
|
|
276
275
|
for (const seg of path) {
|
|
277
|
-
if (
|
|
276
|
+
if (seg === "") {
|
|
278
277
|
throw new Error(
|
|
279
|
-
`firegraph:
|
|
278
|
+
`firegraph: empty object key at path ${path.map((p) => JSON.stringify(p)).join(" > ")}. Object keys in update payloads must be non-empty.`
|
|
280
279
|
);
|
|
281
280
|
}
|
|
282
281
|
}
|
|
@@ -2337,6 +2336,9 @@ function validateJsonPathKey(key, backendLabel) {
|
|
|
2337
2336
|
);
|
|
2338
2337
|
}
|
|
2339
2338
|
}
|
|
2339
|
+
function buildJsonPath(segments) {
|
|
2340
|
+
return "$" + segments.map((seg) => "." + JSON.stringify(seg)).join("");
|
|
2341
|
+
}
|
|
2340
2342
|
function jsonBind(value, backendLabel) {
|
|
2341
2343
|
if (value === void 0) return "null";
|
|
2342
2344
|
if (value !== null && typeof value === "object") {
|
|
@@ -2360,16 +2362,14 @@ function compileDataOpsExpr(ops, base, params, backendLabel) {
|
|
|
2360
2362
|
const placeholders = deletes.map(() => "?").join(", ");
|
|
2361
2363
|
expr = `json_remove(${expr}, ${placeholders})`;
|
|
2362
2364
|
for (const op of deletes) {
|
|
2363
|
-
|
|
2364
|
-
params.push(`$.${op.path.join(".")}`);
|
|
2365
|
+
params.push(buildJsonPath(op.path));
|
|
2365
2366
|
}
|
|
2366
2367
|
}
|
|
2367
2368
|
if (sets.length > 0) {
|
|
2368
2369
|
const pieces = sets.map(() => "?, json(?)").join(", ");
|
|
2369
2370
|
expr = `json_set(${expr}, ${pieces})`;
|
|
2370
2371
|
for (const op of sets) {
|
|
2371
|
-
|
|
2372
|
-
params.push(`$.${op.path.join(".")}`);
|
|
2372
|
+
params.push(buildJsonPath(op.path));
|
|
2373
2373
|
params.push(jsonBind(op.value, backendLabel));
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|