@cocreate/crud-server 1.15.1 → 1.15.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.15.3](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.2...v1.15.3) (2022-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * readDocument doc._id.toString() ([ab22fea](https://github.com/CoCreate-app/CoCreate-crud-server/commit/ab22fea26e94282190800f1c0484faadef9ffdb9))
7
+
8
+ ## [1.15.2](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.1...v1.15.2) (2022-12-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * console.log to trace error in deployment ([cd77e4b](https://github.com/CoCreate-app/CoCreate-crud-server/commit/cd77e4b4dee62511d7bba16fef5ba42f89421af7))
14
+
1
15
  ## [1.15.1](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.0...v1.15.1) (2022-12-02)
2
16
 
3
17
 
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.3",
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
 
@@ -139,10 +140,6 @@ class CoCreateCrudServer {
139
140
  });
140
141
  }
141
142
 
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
143
  errorHandler(data, error, database, collection){
147
144
  if (typeof error == 'object')
148
145
  error['db'] = 'mongodb'
@@ -405,6 +405,7 @@ function document(action, data){
405
405
  doc.db = 'mongodb'
406
406
  doc.database = database
407
407
  doc.collection = collection
408
+ doc._id = doc._id.toString()
408
409
  documents.push(doc)
409
410
  }
410
411
  }