multi-db-orm 3.1.1 → 3.1.3

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.
@@ -22,9 +22,18 @@ function replaceUndefinedWithNull(obj) {
22
22
  class FireStoreDB extends MultiDbORM {
23
23
  admin;
24
24
  serviceAccount;
25
- constructor(serviceAccount, appname) {
25
+ constructor(serviceAccount, appname, _admin) {
26
26
  super();
27
27
 
28
+ if (_admin) {
29
+ this.admin = _admin;
30
+ const db = this.admin.firestore();
31
+ this.db = db;
32
+ console.log("Firestore Initialized with existing admin instance");
33
+ this.dbType = "firestore";
34
+ return;
35
+ }
36
+
28
37
  var admin = require("firebase-admin");
29
38
  this.serviceAccount = serviceAccount;
30
39
 
@@ -1,5 +1,6 @@
1
1
  export class Metrics {
2
2
  constructor(loglevel: number);
3
+ setLogLevel(level: number): void;
3
4
  get(modelname: string, filter: any, options: any): void;
4
5
  getOne(modelname: string, filter: any): void;
5
6
  create(modelname: string, sampleObject: any): void;
@@ -9,6 +9,8 @@ export class MultiDbORM {
9
9
 
10
10
  constructor(db: any);
11
11
 
12
+ setLogLevel(level: number): void;
13
+
12
14
  connect(): Promise<void>;
13
15
 
14
16
  setdb(db: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-db-orm",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "CRUD , Backup , Restore and Migration library for multiple databases",
5
5
  "main": "index.js",
6
6
  "dependencies": {