@cocreate/crud-server 1.15.1 → 1.15.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.15.2](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.1...v1.15.2) (2022-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * console.log to trace error in deployment ([cd77e4b](https://github.com/CoCreate-app/CoCreate-crud-server/commit/cd77e4b4dee62511d7bba16fef5ba42f89421af7))
7
+
1
8
  ## [1.15.1](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.0...v1.15.1) (2022-12-02)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crud-server",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
4
4
  "description": "CoCreate-crud-server",
5
5
  "keywords": [
6
6
  "cocreate-crud",
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {searchData, sortData} = require("@cocreate/utils");
3
+ const {ObjectId, searchData, sortData} = require("@cocreate/utils");
4
4
  const mongodb = require('./mongodb/mongodb');
5
5
 
6
6
  class CoCreateCrudServer {
@@ -8,6 +8,7 @@ class CoCreateCrudServer {
8
8
  this.wsManager = wsManager
9
9
  this.dbs = ['mongodb']
10
10
  this.mongodb = mongodb
11
+ this.ObjectId = ObjectId
11
12
  this.init();
12
13
  }
13
14
 
@@ -97,6 +98,8 @@ class CoCreateCrudServer {
97
98
  data['organization_id'] = process.env.organization_id
98
99
  }
99
100
 
101
+ console.log('crud-server-----', data['organization_id'], data.collection, data.database)
102
+
100
103
  if (!data.db || !data.db.length)
101
104
  data.db = this.dbs
102
105
  let dbsLength = data.db.length
@@ -139,10 +142,6 @@ class CoCreateCrudServer {
139
142
  });
140
143
  }
141
144
 
142
- ObjectId = (rnd = r16 => Math.floor(r16).toString(16)) =>
143
- rnd(Date.now()/1000) + ' '.repeat(16).replace(/./g, () => rnd(Math.random()*16))
144
-
145
-
146
145
  errorHandler(data, error, database, collection){
147
146
  if (typeof error == 'object')
148
147
  error['db'] = 'mongodb'