@typicalday/firegraph 0.5.0 → 0.7.0

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/index.cjs CHANGED
@@ -793,10 +793,13 @@ var GraphTransactionImpl = class {
793
793
  }
794
794
  async updateNode(uid, data) {
795
795
  const docId = computeNodeDocId(uid);
796
- this.adapter.updateDoc(docId, {
797
- ...data,
796
+ const update = {
798
797
  updatedAt: import_firestore3.FieldValue.serverTimestamp()
799
- });
798
+ };
799
+ for (const [k, v] of Object.entries(data)) {
800
+ update[`data.${k}`] = v;
801
+ }
802
+ this.adapter.updateDoc(docId, update);
800
803
  }
801
804
  async removeNode(uid) {
802
805
  const docId = computeNodeDocId(uid);
@@ -846,10 +849,13 @@ var GraphBatchImpl = class {
846
849
  }
847
850
  async updateNode(uid, data) {
848
851
  const docId = computeNodeDocId(uid);
849
- this.adapter.updateDoc(docId, {
850
- ...data,
852
+ const update = {
851
853
  updatedAt: import_firestore4.FieldValue.serverTimestamp()
852
- });
854
+ };
855
+ for (const [k, v] of Object.entries(data)) {
856
+ update[`data.${k}`] = v;
857
+ }
858
+ this.adapter.updateDoc(docId, update);
853
859
  }
854
860
  async removeNode(uid) {
855
861
  const docId = computeNodeDocId(uid);
@@ -1011,7 +1017,9 @@ var import_node_crypto3 = require("crypto");
1011
1017
 
1012
1018
  // src/json-schema.ts
1013
1019
  var import_ajv = __toESM(require("ajv"), 1);
1020
+ var import_ajv_formats = __toESM(require("ajv-formats"), 1);
1014
1021
  var ajv = new import_ajv.default({ allErrors: true, strict: false });
1022
+ (0, import_ajv_formats.default)(ajv);
1015
1023
  function compileSchema(schema, label) {
1016
1024
  const validate = ajv.compile(schema);
1017
1025
  return (data) => {
@@ -1973,10 +1981,13 @@ var GraphClientImpl = class _GraphClientImpl {
1973
1981
  }
1974
1982
  async updateNode(uid, data) {
1975
1983
  const docId = computeNodeDocId(uid);
1976
- await this.adapter.updateDoc(docId, {
1977
- ...data,
1984
+ const update = {
1978
1985
  updatedAt: import_firestore5.FieldValue.serverTimestamp()
1979
- });
1986
+ };
1987
+ for (const [k, v] of Object.entries(data)) {
1988
+ update[`data.${k}`] = v;
1989
+ }
1990
+ await this.adapter.updateDoc(docId, update);
1980
1991
  }
1981
1992
  async removeNode(uid) {
1982
1993
  const docId = computeNodeDocId(uid);