@typicalday/firegraph 0.6.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.js CHANGED
@@ -706,10 +706,13 @@ var GraphTransactionImpl = class {
706
706
  }
707
707
  async updateNode(uid, data) {
708
708
  const docId = computeNodeDocId(uid);
709
- this.adapter.updateDoc(docId, {
710
- ...data,
709
+ const update = {
711
710
  updatedAt: FieldValue3.serverTimestamp()
712
- });
711
+ };
712
+ for (const [k, v] of Object.entries(data)) {
713
+ update[`data.${k}`] = v;
714
+ }
715
+ this.adapter.updateDoc(docId, update);
713
716
  }
714
717
  async removeNode(uid) {
715
718
  const docId = computeNodeDocId(uid);
@@ -759,10 +762,13 @@ var GraphBatchImpl = class {
759
762
  }
760
763
  async updateNode(uid, data) {
761
764
  const docId = computeNodeDocId(uid);
762
- this.adapter.updateDoc(docId, {
763
- ...data,
765
+ const update = {
764
766
  updatedAt: FieldValue4.serverTimestamp()
765
- });
767
+ };
768
+ for (const [k, v] of Object.entries(data)) {
769
+ update[`data.${k}`] = v;
770
+ }
771
+ this.adapter.updateDoc(docId, update);
766
772
  }
767
773
  async removeNode(uid) {
768
774
  const docId = computeNodeDocId(uid);
@@ -924,7 +930,9 @@ import { createHash as createHash3 } from "crypto";
924
930
 
925
931
  // src/json-schema.ts
926
932
  import Ajv from "ajv";
933
+ import addFormats from "ajv-formats";
927
934
  var ajv = new Ajv({ allErrors: true, strict: false });
935
+ addFormats(ajv);
928
936
  function compileSchema(schema, label) {
929
937
  const validate = ajv.compile(schema);
930
938
  return (data) => {
@@ -1885,10 +1893,13 @@ var GraphClientImpl = class _GraphClientImpl {
1885
1893
  }
1886
1894
  async updateNode(uid, data) {
1887
1895
  const docId = computeNodeDocId(uid);
1888
- await this.adapter.updateDoc(docId, {
1889
- ...data,
1896
+ const update = {
1890
1897
  updatedAt: FieldValue5.serverTimestamp()
1891
- });
1898
+ };
1899
+ for (const [k, v] of Object.entries(data)) {
1900
+ update[`data.${k}`] = v;
1901
+ }
1902
+ await this.adapter.updateDoc(docId, update);
1892
1903
  }
1893
1904
  async removeNode(uid) {
1894
1905
  const docId = computeNodeDocId(uid);