mocody 0.8.0 → 0.8.2

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
@@ -5959,8 +5959,11 @@ var MongoDataOperation = class extends RepoModel {
5959
5959
 
5960
5960
  // src/pouch/pouch-initializer.ts
5961
5961
  var import_throat4 = __toESM(require("throat"), 1);
5962
- var import_pouchdb = __toESM(require("pouchdb"), 1);
5962
+ var import_pouchdb_core = __toESM(require("pouchdb-core"), 1);
5963
5963
  var import_pouchdb_find = __toESM(require("pouchdb-find"), 1);
5964
+ var import_pouchdb_adapter_http = __toESM(require("pouchdb-adapter-http"), 1);
5965
+ var import_pouchdb_mapreduce = __toESM(require("pouchdb-mapreduce"), 1);
5966
+ var import_pouchdb_replication = __toESM(require("pouchdb-replication"), 1);
5964
5967
  var concurrency4 = (0, import_throat4.default)(1);
5965
5968
  var MocodyInitializerPouch = class {
5966
5969
  _pouchInstance;
@@ -6094,6 +6097,9 @@ var MocodyInitializerPouch = class {
6094
6097
  async pouch_getDbInstance() {
6095
6098
  return await concurrency4(() => this.pouch_getDbInstanceBase());
6096
6099
  }
6100
+ getPouchWithPlugins() {
6101
+ return import_pouchdb_core.default.plugin(import_pouchdb_adapter_http.default).plugin(import_pouchdb_mapreduce.default).plugin(import_pouchdb_replication.default).plugin(import_pouchdb_find.default);
6102
+ }
6097
6103
  async pouch_getDbInstanceBase() {
6098
6104
  if (this._pouchInstance) return this._pouchInstance;
6099
6105
  const {
@@ -6110,14 +6116,14 @@ var MocodyInitializerPouch = class {
6110
6116
  if (!localSqliteDbFilePath) {
6111
6117
  throw new MocodyGenericError("localSqliteDbFilePath not defined");
6112
6118
  }
6113
- import_pouchdb.default.plugin(import_pouchdb_find.default);
6114
- this._pouchInstance = new import_pouchdb.default(localSqliteDbFilePath, { adapter: "nodesqlite" });
6119
+ const PouchDB = this.getPouchWithPlugins();
6120
+ this._pouchInstance = new PouchDB(localSqliteDbFilePath, { adapter: "nodesqlite" });
6115
6121
  } else {
6116
6122
  if (!remoteConnectionUrl) {
6117
6123
  throw new MocodyGenericError("couchRemoteConnectionUrl not defined");
6118
6124
  }
6119
- import_pouchdb.default.plugin(import_pouchdb_find.default);
6120
- this._pouchInstance = new import_pouchdb.default(remoteConnectionUrl);
6125
+ const PouchDB = this.getPouchWithPlugins();
6126
+ this._pouchInstance = new PouchDB(remoteConnectionUrl);
6121
6127
  }
6122
6128
  try {
6123
6129
  if (indexes?.length) {
package/dist/index.d.cts CHANGED
@@ -795,6 +795,7 @@ declare class MocodyInitializerPouch<T extends IMocodyCoreEntityModel> {
795
795
  nativeId: string;
796
796
  }): Promise<PouchDB.Core.Response>;
797
797
  pouch_getDbInstance(): Promise<PouchDB.Database<T>>;
798
+ private getPouchWithPlugins;
798
799
  private pouch_getDbInstanceBase;
799
800
  private toBasicDoc_RemovePouchMeta;
800
801
  private docMetaFieldsObject;
package/dist/index.d.ts CHANGED
@@ -795,6 +795,7 @@ declare class MocodyInitializerPouch<T extends IMocodyCoreEntityModel> {
795
795
  nativeId: string;
796
796
  }): Promise<PouchDB.Core.Response>;
797
797
  pouch_getDbInstance(): Promise<PouchDB.Database<T>>;
798
+ private getPouchWithPlugins;
798
799
  private pouch_getDbInstanceBase;
799
800
  private toBasicDoc_RemovePouchMeta;
800
801
  private docMetaFieldsObject;
package/dist/index.js CHANGED
@@ -5929,8 +5929,11 @@ var MongoDataOperation = class extends RepoModel {
5929
5929
 
5930
5930
  // src/pouch/pouch-initializer.ts
5931
5931
  import throat4 from "throat";
5932
- import PouchDB from "pouchdb";
5932
+ import PouchDB00 from "pouchdb-core";
5933
5933
  import pouchdbFind from "pouchdb-find";
5934
+ import pouchdbhttp from "pouchdb-adapter-http";
5935
+ import pouchdbmapreduce from "pouchdb-mapreduce";
5936
+ import pouchdbreplication from "pouchdb-replication";
5934
5937
  var concurrency4 = throat4(1);
5935
5938
  var MocodyInitializerPouch = class {
5936
5939
  _pouchInstance;
@@ -6064,6 +6067,9 @@ var MocodyInitializerPouch = class {
6064
6067
  async pouch_getDbInstance() {
6065
6068
  return await concurrency4(() => this.pouch_getDbInstanceBase());
6066
6069
  }
6070
+ getPouchWithPlugins() {
6071
+ return PouchDB00.plugin(pouchdbhttp).plugin(pouchdbmapreduce).plugin(pouchdbreplication).plugin(pouchdbFind);
6072
+ }
6067
6073
  async pouch_getDbInstanceBase() {
6068
6074
  if (this._pouchInstance) return this._pouchInstance;
6069
6075
  const {
@@ -6080,13 +6086,13 @@ var MocodyInitializerPouch = class {
6080
6086
  if (!localSqliteDbFilePath) {
6081
6087
  throw new MocodyGenericError("localSqliteDbFilePath not defined");
6082
6088
  }
6083
- PouchDB.plugin(pouchdbFind);
6089
+ const PouchDB = this.getPouchWithPlugins();
6084
6090
  this._pouchInstance = new PouchDB(localSqliteDbFilePath, { adapter: "nodesqlite" });
6085
6091
  } else {
6086
6092
  if (!remoteConnectionUrl) {
6087
6093
  throw new MocodyGenericError("couchRemoteConnectionUrl not defined");
6088
6094
  }
6089
- PouchDB.plugin(pouchdbFind);
6095
+ const PouchDB = this.getPouchWithPlugins();
6090
6096
  this._pouchInstance = new PouchDB(remoteConnectionUrl);
6091
6097
  }
6092
6098
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocody",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Implementation of single table design, and unified query access for MongoDB, CouchDB, and dynamoDB",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -71,22 +71,28 @@
71
71
  "outDir": "dist"
72
72
  },
73
73
  "dependencies": {
74
- "@aws-sdk/client-dynamodb": "^3.1149.0",
75
- "@aws-sdk/lib-dynamodb": "^3.1149.0",
76
- "@aws-sdk/util-dynamodb": "^3.996.9",
77
- "joi": "^18.2.9",
78
- "mongodb": "^7.7.0",
79
- "nano": "^11.0.7",
80
- "nanoid": "^6.0.2",
81
- "pouchdb": "^9.0.0",
82
- "pouchdb-find": "^9.0.0",
83
- "throat": "^6.0.2"
74
+ "@aws-sdk/client-dynamodb": "3.1149.0",
75
+ "@aws-sdk/lib-dynamodb": "3.1149.0",
76
+ "@aws-sdk/util-dynamodb": "3.996.9",
77
+ "joi": "18.2.9",
78
+ "mongodb": "7.7.0",
79
+ "nano": "11.0.7",
80
+ "nanoid": "6.0.2",
81
+ "pouchdb-adapter-http": "^9.0.0",
82
+ "pouchdb-core": "^9.0.0",
83
+ "pouchdb-find": "9.0.0",
84
+ "pouchdb-mapreduce": "^9.0.0",
85
+ "pouchdb-replication": "^9.0.0",
86
+ "throat": "6.0.2"
84
87
  },
85
88
  "devDependencies": {
86
89
  "@eslint/js": "^10.0.1",
87
90
  "@types/node": "^26",
88
- "@types/pouchdb": "^6.4.2",
91
+ "@types/pouchdb-adapter-http": "^6.1.6",
92
+ "@types/pouchdb-core": "^7.0.15",
89
93
  "@types/pouchdb-find": "^7.3.3",
94
+ "@types/pouchdb-mapreduce": "^6.1.10",
95
+ "@types/pouchdb-replication": "^6.4.7",
90
96
  "@typescript-eslint/eslint-plugin": "^8.71.1",
91
97
  "@typescript-eslint/parser": "^8.71.1",
92
98
  "eslint": "^10.12.0",