@lark-sh/client 0.1.23 → 0.1.25
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/README.md +1 -1
- package/dist/{chunk-3MBKCYWV.mjs → chunk-LCCMBY4S.mjs} +13 -11
- package/dist/{chunk-3MBKCYWV.mjs.map → chunk-LCCMBY4S.mjs.map} +1 -1
- package/dist/fb-v8/index.js +12 -10
- package/dist/fb-v8/index.js.map +1 -1
- package/dist/fb-v8/index.mjs +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/fb-v8/index.js
CHANGED
|
@@ -4844,16 +4844,18 @@ var _LarkDatabase = class _LarkDatabase {
|
|
|
4844
4844
|
return { o: "u", p: path, v: op.value };
|
|
4845
4845
|
case "delete":
|
|
4846
4846
|
return { o: "d", p: path };
|
|
4847
|
-
case "condition":
|
|
4848
|
-
|
|
4849
|
-
|
|
4847
|
+
case "condition": {
|
|
4848
|
+
const conditionValue = op.value instanceof DataSnapshot ? op.value.exportVal() : op.value;
|
|
4849
|
+
if (conditionValue !== void 0 && conditionValue !== null) {
|
|
4850
|
+
validateWriteData(conditionValue, "transaction condition");
|
|
4850
4851
|
}
|
|
4851
|
-
if (isPrimitive(
|
|
4852
|
-
return { o: "c", p: path, v:
|
|
4852
|
+
if (isPrimitive(conditionValue)) {
|
|
4853
|
+
return { o: "c", p: path, v: conditionValue };
|
|
4853
4854
|
} else {
|
|
4854
|
-
const hash = await hashValue(
|
|
4855
|
+
const hash = await hashValue(conditionValue);
|
|
4855
4856
|
return { o: "c", p: path, h: hash };
|
|
4856
4857
|
}
|
|
4858
|
+
}
|
|
4857
4859
|
default:
|
|
4858
4860
|
throw new Error(`Unknown transaction operation: ${op.op}`);
|
|
4859
4861
|
}
|
|
@@ -5008,7 +5010,7 @@ var _LarkDatabase = class _LarkDatabase {
|
|
|
5008
5010
|
console.error("Failed to parse message:", data);
|
|
5009
5011
|
return;
|
|
5010
5012
|
}
|
|
5011
|
-
if (process.env
|
|
5013
|
+
if (typeof process !== "undefined" && process.env?.LARK_DEBUG) {
|
|
5012
5014
|
console.log("[LARK] <<< SERVER:", JSON.stringify(message, null, 2));
|
|
5013
5015
|
}
|
|
5014
5016
|
if (isAckMessage(message)) {
|
|
@@ -5074,7 +5076,7 @@ var _LarkDatabase = class _LarkDatabase {
|
|
|
5074
5076
|
if (!this.transport || !this.transport.connected) {
|
|
5075
5077
|
throw new LarkError("not_connected", "Not connected to database");
|
|
5076
5078
|
}
|
|
5077
|
-
if (process.env
|
|
5079
|
+
if (typeof process !== "undefined" && process.env?.LARK_DEBUG) {
|
|
5078
5080
|
console.log("[LARK] >>> CLIENT:", JSON.stringify(message, null, 2));
|
|
5079
5081
|
}
|
|
5080
5082
|
this.transport.send(JSON.stringify(message));
|
|
@@ -5366,8 +5368,8 @@ var _LarkDatabase = class _LarkDatabase {
|
|
|
5366
5368
|
*/
|
|
5367
5369
|
_LarkDatabase.ServerValue = ServerValue;
|
|
5368
5370
|
// Use real timers for ping so fake timers in tests don't cause infinite loops
|
|
5369
|
-
_LarkDatabase._realSetInterval = globalThis.setInterval;
|
|
5370
|
-
_LarkDatabase._realClearInterval = globalThis.clearInterval;
|
|
5371
|
+
_LarkDatabase._realSetInterval = globalThis.setInterval.bind(globalThis);
|
|
5372
|
+
_LarkDatabase._realClearInterval = globalThis.clearInterval.bind(globalThis);
|
|
5371
5373
|
var LarkDatabase = _LarkDatabase;
|
|
5372
5374
|
|
|
5373
5375
|
// src/fb-v8/index.ts
|