@bluecopa/core 0.1.61 → 0.1.62

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.es.js CHANGED
@@ -12465,7 +12465,9 @@ class DocRefImpl {
12465
12465
  return doc ? doc.toJSON() : null;
12466
12466
  }
12467
12467
  async update(data) {
12468
+ console.log("doxxxxx 12344");
12468
12469
  const doc = await this.collection.findOne(this.id).exec();
12470
+ console.log("doxxxxx", doc);
12469
12471
  if (!doc) {
12470
12472
  throw new InputTableError(`Document "${this.id}" not found`, 404);
12471
12473
  }
@@ -12473,6 +12475,7 @@ class DocRefImpl {
12473
12475
  delete patch[this.primaryKeyField];
12474
12476
  delete patch[CHECKPOINT_FIELD];
12475
12477
  await doc.patch(patch);
12478
+ await doc.upsert(patch);
12476
12479
  }
12477
12480
  async delete() {
12478
12481
  await apiClient.request({
@@ -12905,9 +12908,11 @@ function createReplication(collection, solutionId, tableName, primaryKeyField) {
12905
12908
  async handler(changeRows) {
12906
12909
  var _a, _b, _c, _d, _e, _f, _g;
12907
12910
  const conflicts = [];
12911
+ console.log(changeRows, "chnageRows");
12908
12912
  for (const row of changeRows) {
12909
12913
  const doc = row.newDocumentState;
12910
12914
  try {
12915
+ debugger;
12911
12916
  let serverResponse;
12912
12917
  if (row.assumedMasterState == null) {
12913
12918
  const insertData = { ...doc };
@@ -13061,7 +13066,10 @@ async function createCollectionInternal(key, solutionId, tableDef, workspaceId,
13061
13066
  const collectionConfig = {
13062
13067
  schema,
13063
13068
  conflictHandler: {
13064
- isEqual: (a, b) => a[CHECKPOINT_FIELD] === b[CHECKPOINT_FIELD],
13069
+ isEqual: (a, b) => {
13070
+ console.log("kywfvyiubwe", { CHECKPOINT_FIELD, a, b });
13071
+ return a[CHECKPOINT_FIELD] === b[CHECKPOINT_FIELD];
13072
+ },
13065
13073
  resolve: (i) => i.realMasterState
13066
13074
  // server wins
13067
13075
  }