@infrab4a/connect 4.4.0-beta.5 → 4.4.0-beta.7

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/index.cjs.js CHANGED
@@ -3639,6 +3639,7 @@ class ConnectDocumentService {
3639
3639
  return this.reference.id;
3640
3640
  }
3641
3641
  async save(data) {
3642
+ console.log('save ConnectDocumentService', data);
3642
3643
  const doc = await firestore.getDoc(this.reference);
3643
3644
  if (doc.exists())
3644
3645
  await firestore.updateDoc(this.reference, data);
@@ -3650,7 +3651,7 @@ class ConnectDocumentService {
3650
3651
  await firestore.deleteDoc(this.reference);
3651
3652
  }
3652
3653
  withConverter(params) {
3653
- this.reference.withConverter(params);
3654
+ this.reference = this.reference.withConverter(params);
3654
3655
  return this;
3655
3656
  }
3656
3657
  }
@@ -3683,7 +3684,7 @@ class ConnectCollectionService {
3683
3684
  return firestore.getDocs(firestore.query(this.reference, ...constraints));
3684
3685
  }
3685
3686
  getDoc(id) {
3686
- return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore);
3687
+ return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.reference.converter);
3687
3688
  }
3688
3689
  where(attribute, operator, value) {
3689
3690
  this.wheres.push(firestore.where(attribute, operator, value));
@@ -3710,10 +3711,11 @@ class ConnectCollectionService {
3710
3711
  return this;
3711
3712
  }
3712
3713
  withConverter(params) {
3713
- this.reference.withConverter(params);
3714
+ this.reference = this.reference.withConverter(params);
3714
3715
  return this;
3715
3716
  }
3716
3717
  async save(data, id) {
3718
+ console.log('save ConnectCollectionService', data, id);
3717
3719
  if (lodash.isEmpty(id))
3718
3720
  return firestore.addDoc(this.reference, data);
3719
3721
  const docRef = firestore.doc(this.reference, id);
package/index.esm.js CHANGED
@@ -3615,6 +3615,7 @@ class ConnectDocumentService {
3615
3615
  return this.reference.id;
3616
3616
  }
3617
3617
  async save(data) {
3618
+ console.log('save ConnectDocumentService', data);
3618
3619
  const doc = await getDoc(this.reference);
3619
3620
  if (doc.exists())
3620
3621
  await updateDoc(this.reference, data);
@@ -3626,7 +3627,7 @@ class ConnectDocumentService {
3626
3627
  await deleteDoc(this.reference);
3627
3628
  }
3628
3629
  withConverter(params) {
3629
- this.reference.withConverter(params);
3630
+ this.reference = this.reference.withConverter(params);
3630
3631
  return this;
3631
3632
  }
3632
3633
  }
@@ -3659,7 +3660,7 @@ class ConnectCollectionService {
3659
3660
  return getDocs(query(this.reference, ...constraints));
3660
3661
  }
3661
3662
  getDoc(id) {
3662
- return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore);
3663
+ return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.reference.converter);
3663
3664
  }
3664
3665
  where(attribute, operator, value) {
3665
3666
  this.wheres.push(where(attribute, operator, value));
@@ -3686,10 +3687,11 @@ class ConnectCollectionService {
3686
3687
  return this;
3687
3688
  }
3688
3689
  withConverter(params) {
3689
- this.reference.withConverter(params);
3690
+ this.reference = this.reference.withConverter(params);
3690
3691
  return this;
3691
3692
  }
3692
3693
  async save(data, id) {
3694
+ console.log('save ConnectCollectionService', data, id);
3693
3695
  if (isEmpty(id))
3694
3696
  return addDoc(this.reference, data);
3695
3697
  const docRef = doc(this.reference, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.4.0-beta.5",
3
+ "version": "4.4.0-beta.7",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },