@resolveio/server-lib 9.0.15 → 9.0.17

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.
Files changed (58) hide show
  1. package/collections/app-status.collection.js +1 -1
  2. package/collections/app-status.collection.js.map +1 -1
  3. package/collections/app-version.collection.js +1 -1
  4. package/collections/app-version.collection.js.map +1 -1
  5. package/collections/counter.collection.js +1 -1
  6. package/collections/counter.collection.js.map +1 -1
  7. package/collections/cron-job-history.collection.js +1 -1
  8. package/collections/cron-job-history.collection.js.map +1 -1
  9. package/collections/cron-job.collection.js +1 -1
  10. package/collections/cron-job.collection.js.map +1 -1
  11. package/collections/email-history.collection.js +1 -1
  12. package/collections/email-history.collection.js.map +1 -1
  13. package/collections/email-verified.collection.js +1 -1
  14. package/collections/email-verified.collection.js.map +1 -1
  15. package/collections/file.collection.js +1 -1
  16. package/collections/file.collection.js.map +1 -1
  17. package/collections/flag.collection.js +1 -1
  18. package/collections/flag.collection.js.map +1 -1
  19. package/collections/log-method-latency.collection.js +1 -1
  20. package/collections/log-method-latency.collection.js.map +1 -1
  21. package/collections/log-subscription.collection.js +1 -1
  22. package/collections/log-subscription.collection.js.map +1 -1
  23. package/collections/log.collection.js +1 -1
  24. package/collections/log.collection.js.map +1 -1
  25. package/collections/logged-in-users.collection.js +1 -1
  26. package/collections/logged-in-users.collection.js.map +1 -1
  27. package/collections/method-call.collection.js +1 -1
  28. package/collections/method-call.collection.js.map +1 -1
  29. package/collections/method-response.collection.js +1 -1
  30. package/collections/method-response.collection.js.map +1 -1
  31. package/collections/monitor-cpu.collection.js +1 -1
  32. package/collections/monitor-cpu.collection.js.map +1 -1
  33. package/collections/monitor-https-inbound.collection.js +1 -1
  34. package/collections/monitor-https-inbound.collection.js.map +1 -1
  35. package/collections/monitor-https-outbound.collection.js +1 -1
  36. package/collections/monitor-https-outbound.collection.js.map +1 -1
  37. package/collections/monitor-memory.collection.js +1 -1
  38. package/collections/monitor-memory.collection.js.map +1 -1
  39. package/collections/monitor-mongo.collection.js +1 -1
  40. package/collections/monitor-mongo.collection.js.map +1 -1
  41. package/collections/notification.collection.js +1 -1
  42. package/collections/notification.collection.js.map +1 -1
  43. package/collections/queue-flag.collection.js +1 -1
  44. package/collections/queue-flag.collection.js.map +1 -1
  45. package/collections/queue-method.collection.js +1 -1
  46. package/collections/queue-method.collection.js.map +1 -1
  47. package/collections/queue-response.collection.js +1 -1
  48. package/collections/queue-response.collection.js.map +1 -1
  49. package/collections/user-group.collection.js +1 -1
  50. package/collections/user-group.collection.js.map +1 -1
  51. package/collections/user-guide.collection.js +1 -1
  52. package/collections/user-guide.collection.js.map +1 -1
  53. package/collections/user.collection.js +1 -1
  54. package/collections/user.collection.js.map +1 -1
  55. package/managers/mongo.manager.d.ts +3 -2
  56. package/managers/mongo.manager.js +132 -98
  57. package/managers/mongo.manager.js.map +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/queue-method.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,kBAAkB,EAAE;QACnB,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;IACD,gBAAgB,EAAE;QACjB,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,YAAY,GAAiC,IAAI,CAAC;AAE7D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAmB,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACjF,oBAAY,GAAG,KAAK,CAAC,eAAe,CAAC;QACrC,oBAAY,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,EAAC,CAAC,CAAC;KAC9D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-method.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { QueueMethodModel } from '../models/queue-method.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true \n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tmethod_data: {\n\t\ttype: Array\n\t},\n\t'method_data.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tmethod_data_string: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: Number\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t},\n\tid_methodLatency: {\n\t\ttype: String\n\t}\n};\n\nexport let QueueMethods: Collection<QueueMethodModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<QueueMethodModel>('queue-methods', schema, false, false);\n\t\tQueueMethods = model.collection_main;\n\t\tQueueMethods.createIndex({date: 1}, {expireAfterSeconds: 60});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/queue-method.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,kBAAkB,EAAE;QACnB,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;IACD,gBAAgB,EAAE;QACjB,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,YAAY,GAAiC,IAAI,CAAC;AAE7D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAmB,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAClG,oBAAY,GAAG,KAAK,CAAC,eAAe,CAAC;QACrC,oBAAY,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,EAAC,CAAC,CAAC;KAC9D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-method.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { QueueMethodModel } from '../models/queue-method.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true \n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tmethod_data: {\n\t\ttype: Array\n\t},\n\t'method_data.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tmethod_data_string: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: Number\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t},\n\tid_methodLatency: {\n\t\ttype: String\n\t}\n};\n\nexport let QueueMethods: Collection<QueueMethodModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<QueueMethodModel>('queue-methods', schema, false, false, [], true, false);\n\t\tQueueMethods = model.collection_main;\n\t\tQueueMethods.createIndex({date: 1}, {expireAfterSeconds: 60});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -47,7 +47,7 @@ exports.QueueResponses = null;
47
47
  initializeCollection();
48
48
  function initializeCollection() {
49
49
  if (index_1.ResolveIOServer.getMainDB()) {
50
- var model = new mongo_manager_1.Model('queue-responses', schema, false, false);
50
+ var model = new mongo_manager_1.Model('queue-responses', schema, false, false, [], true, false);
51
51
  exports.QueueResponses = model.collection_main;
52
52
  exports.QueueResponses.createIndex({ date: 1 }, { expireAfterSeconds: 60 });
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/queue-response.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;CACD,CAAC;AAES,QAAA,cAAc,GAAmC,IAAI,CAAC;AAEjE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAqB,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACrF,sBAAc,GAAG,KAAK,CAAC,eAAe,CAAC;QACvC,sBAAc,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,EAAC,CAAC,CAAC;KAChE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-response.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { QueueResponseModel } from '../models/queue-response.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true \n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: Number\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tresponse: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tdate: {\n\t\ttype: Date\n\t}\n};\n\nexport let QueueResponses: Collection<QueueResponseModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<QueueResponseModel>('queue-responses', schema, false, false);\n\t\tQueueResponses = model.collection_main;\n\t\tQueueResponses.createIndex({date: 1}, {expireAfterSeconds: 60});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/queue-response.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;CACD,CAAC;AAES,QAAA,cAAc,GAAmC,IAAI,CAAC;AAEjE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAqB,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACtG,sBAAc,GAAG,KAAK,CAAC,eAAe,CAAC;QACvC,sBAAc,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,EAAC,CAAC,CAAC;KAChE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-response.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { QueueResponseModel } from '../models/queue-response.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true \n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: Number\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tresponse: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tdate: {\n\t\ttype: Date\n\t}\n};\n\nexport let QueueResponses: Collection<QueueResponseModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<QueueResponseModel>('queue-responses', schema, false, false, [], true, false);\n\t\tQueueResponses = model.collection_main;\n\t\tQueueResponses.createIndex({date: 1}, {expireAfterSeconds: 60});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -65,7 +65,7 @@ exports.UserGroupVersions = null;
65
65
  initializeCollection();
66
66
  function initializeCollection() {
67
67
  if (index_1.ResolveIOServer.getMainDB()) {
68
- var model = new mongo_manager_1.Model('user-groups', schema, true, true, []);
68
+ var model = new mongo_manager_1.Model('user-groups', schema, true, true, [], true, false);
69
69
  exports.UserGroups = model.collection_main;
70
70
  exports.UserGroups.createIndex({ name: 1 });
71
71
  exports.UserGroupVersions = model.collection_version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAG,MAAM;KACb;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,OAAO;KACb;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,KAAK;KACX;IACD,uBAAuB,EAAE;QACxB,IAAI,EAAE,MAAM;KACZ;IACD,4BAA4B,EAAE;QAC7B,IAAI,EAAE,MAAM;KACZ;IACD,gCAAgC,EAAE;QACjC,IAAI,EAAE,OAAO;KACb;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAG,MAAM;KACb;IACD,sBAAsB,EAAE;QACvB,IAAI,EAAE,MAAM;KACZ;IACD,0BAA0B,EAAE;QAC3B,IAAI,EAAE,OAAO;KACb;CACD,CAAC;AAES,QAAA,UAAU,GAA+B,IAAI,CAAC;AAC9C,QAAA,iBAAiB,GAA+B,IAAI,CAAC;AAEhE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/E,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,kBAAU,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAClC,yBAAiB,GAAG,KAAK,CAAC,kBAAkB,CAAC;KAC7C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tpermissions: {\n\t\ttype: Array\n\t},\n\t'permissions.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.name': {\n\t\ttype: String\n\t},\n\t'permissions.$.selected': {\n\t\ttype: Boolean\n\t},\n\t'permissions.$.views': {\n\t\ttype: Array\n\t},\n\t'permissions.$.views.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.views.$.link': {\n\t\ttype: String\n\t},\n\t'permissions.$.views.$.selected': {\n\t\ttype: Boolean\n\t},\n\tnotifications: {\n\t\ttype: Array\n\t},\n\t'notifications.$': {\n\t\ttype: Object\n\t},\n\t'notifications.$.name': {\n\t\ttype: String\n\t},\n\t'notifications.$.selected': {\n\t\ttype: Boolean\n\t}\n};\n\nexport let UserGroups: Collection<UserGroupModel> = null;\nexport let UserGroupVersions: Collection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserGroupModel>('user-groups', schema, true, true, []);\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAG,MAAM;KACb;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,OAAO;KACb;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,KAAK;KACX;IACD,uBAAuB,EAAE;QACxB,IAAI,EAAE,MAAM;KACZ;IACD,4BAA4B,EAAE;QAC7B,IAAI,EAAE,MAAM;KACZ;IACD,gCAAgC,EAAE;QACjC,IAAI,EAAE,OAAO;KACb;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAG,MAAM;KACb;IACD,sBAAsB,EAAE;QACvB,IAAI,EAAE,MAAM;KACZ;IACD,0BAA0B,EAAE;QAC3B,IAAI,EAAE,OAAO;KACb;CACD,CAAC;AAES,QAAA,UAAU,GAA+B,IAAI,CAAC;AAC9C,QAAA,iBAAiB,GAA+B,IAAI,CAAC;AAEhE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5F,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,kBAAU,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAClC,yBAAiB,GAAG,KAAK,CAAC,kBAAkB,CAAC;KAC7C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tpermissions: {\n\t\ttype: Array\n\t},\n\t'permissions.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.name': {\n\t\ttype: String\n\t},\n\t'permissions.$.selected': {\n\t\ttype: Boolean\n\t},\n\t'permissions.$.views': {\n\t\ttype: Array\n\t},\n\t'permissions.$.views.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.views.$.link': {\n\t\ttype: String\n\t},\n\t'permissions.$.views.$.selected': {\n\t\ttype: Boolean\n\t},\n\tnotifications: {\n\t\ttype: Array\n\t},\n\t'notifications.$': {\n\t\ttype: Object\n\t},\n\t'notifications.$.name': {\n\t\ttype: String\n\t},\n\t'notifications.$.selected': {\n\t\ttype: Boolean\n\t}\n};\n\nexport let UserGroups: Collection<UserGroupModel> = null;\nexport let UserGroupVersions: Collection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserGroupModel>('user-groups', schema, true, true, [], true, false);\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -34,7 +34,7 @@ exports.UserGuides = null;
34
34
  initializeCollection();
35
35
  function initializeCollection() {
36
36
  if (index_1.ResolveIOServer.getMainDB()) {
37
- var model = new mongo_manager_1.Model('user-guides', schema, false, false);
37
+ var model = new mongo_manager_1.Model('user-guides', schema, false, false, [], true, false);
38
38
  exports.UserGuides = model.collection_main;
39
39
  }
40
40
  else {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,UAAU,GAA+B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7E,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;KACnC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-guide.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nexport let UserGuides: Collection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserGuideModel>('user-guides', schema, false, false);\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,UAAU,GAA+B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC9F,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;KACnC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-guide.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nexport let UserGuides: Collection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserGuideModel>('user-guides', schema, false, false, [], true, false);\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -230,7 +230,7 @@ exports.UserVersions = null;
230
230
  initializeCollection();
231
231
  function initializeCollection() {
232
232
  if (index_1.ResolveIOServer.getMainDB()) {
233
- var model = new mongo_manager_1.Model('users', schema, true, true, []);
233
+ var model = new mongo_manager_1.Model('users', schema, true, true, [], true, false);
234
234
  exports.Users = model.collection_main;
235
235
  exports.Users.createIndex({ fullname: 1 });
236
236
  exports.Users.createIndex({ active: 1 });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAAkE;AAGlE,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ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"user.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Model, UserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n};\n\nexport let Users: UserCollection<UserModel> = null;\nexport let UserVersions: UserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserModel>('users', schema, true, true, []);\n\t\tUsers = <UserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <UserCollection<UserModel>>model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAAkE;AAGlE,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM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AAK,CAAC,eAAe,CAAC;KAChE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Model, UserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n};\n\nexport let Users: UserCollection<UserModel> = null;\nexport let UserVersions: UserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserModel>('users', schema, true, true, [], true, false);\n\t\tUsers = <UserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <UserCollection<UserModel>>model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -12,7 +12,7 @@ export declare class MongoManager {
12
12
  export declare class Model<T> {
13
13
  collection_main: Collection<T> | UserCollection<T>;
14
14
  collection_version: Collection<T> | UserCollection<T>;
15
- constructor(collectionName: string, schema: object, useVersionCollection?: boolean, useReportBuilder?: boolean, reportBuilderLookupTables?: LookupTables[], timestamps?: boolean);
15
+ constructor(collectionName: string, schema: object, useVersionCollection?: boolean, useReportBuilder?: boolean, reportBuilderLookupTables?: LookupTables[], timestamps?: boolean, createLogs?: boolean);
16
16
  }
17
17
  export declare class Collection<T> {
18
18
  collectionName: string;
@@ -21,7 +21,8 @@ export declare class Collection<T> {
21
21
  timestamps: boolean;
22
22
  versionKey: string;
23
23
  versionCollection: string;
24
- constructor(collectionName: string, schema: object, useReportBuilder?: boolean, reportBuilderLookupTables?: LookupTables[], timestamps?: boolean);
24
+ createLogs: boolean;
25
+ constructor(collectionName: string, schema: object, useReportBuilder: any, reportBuilderLookupTables: LookupTables[], timestamps: any, createLogs: any);
25
26
  aggregate(pipeline: object[], options?: CollectionAggregationOptions): Promise<any[]>;
26
27
  aggregateCount(pipeline: object[], options?: CollectionAggregationOptions): Promise<number>;
27
28
  aggregateCursor(pipeline: object[], options?: CollectionAggregationOptions): import("mongodb").AggregationCursor<any>;
@@ -76,28 +76,29 @@ var MongoManager = /** @class */ (function () {
76
76
  }());
77
77
  exports.MongoManager = MongoManager;
78
78
  var Model = /** @class */ (function () {
79
- function Model(collectionName, schema, useVersionCollection, useReportBuilder, reportBuilderLookupTables, timestamps) {
79
+ function Model(collectionName, schema, useVersionCollection, useReportBuilder, reportBuilderLookupTables, timestamps, createLogs) {
80
80
  if (useVersionCollection === void 0) { useVersionCollection = false; }
81
81
  if (useReportBuilder === void 0) { useReportBuilder = true; }
82
82
  if (reportBuilderLookupTables === void 0) { reportBuilderLookupTables = []; }
83
83
  if (timestamps === void 0) { timestamps = true; }
84
+ if (createLogs === void 0) { createLogs = true; }
84
85
  this.collection_main = null;
85
86
  this.collection_version = null;
86
87
  if (collectionName === 'users') {
87
- this.collection_main = new UserCollection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps);
88
+ this.collection_main = new UserCollection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps, createLogs);
88
89
  }
89
90
  else {
90
- this.collection_main = new Collection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps);
91
+ this.collection_main = new Collection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps, createLogs);
91
92
  }
92
93
  if (useVersionCollection) {
93
94
  var versionSchema = common_1.deepCopy(schema);
94
95
  versionSchema['_id'].type = 'Object';
95
96
  versionSchema['_id'].blackbox = true;
96
97
  if (collectionName === 'users') {
97
- this.collection_version = new UserCollection(collectionName + '.versions', versionSchema, false);
98
+ this.collection_version = new UserCollection(collectionName + '.versions', versionSchema, false, [], true, false);
98
99
  }
99
100
  else {
100
- this.collection_version = new Collection(collectionName + '.versions', versionSchema, false);
101
+ this.collection_version = new Collection(collectionName + '.versions', versionSchema, false, [], true, false);
101
102
  }
102
103
  this.collection_version.createIndex({ '_id.__v': 1, '_id._id': 1 });
103
104
  this.collection_main.versionCollection = collectionName + '.versions';
@@ -107,20 +108,19 @@ var Model = /** @class */ (function () {
107
108
  }());
108
109
  exports.Model = Model;
109
110
  var Collection = /** @class */ (function () {
110
- function Collection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps) {
111
+ function Collection(collectionName, schema, useReportBuilder, reportBuilderLookupTables, timestamps, createLogs) {
111
112
  var _this = this;
112
- if (useReportBuilder === void 0) { useReportBuilder = true; }
113
- if (reportBuilderLookupTables === void 0) { reportBuilderLookupTables = []; }
114
- if (timestamps === void 0) { timestamps = true; }
115
113
  this.collectionName = '';
116
114
  this.simplschema = null;
117
115
  this.rbSchema = null;
118
116
  this.timestamps = false;
119
117
  this.versionKey = '';
120
118
  this.versionCollection = '';
119
+ this.createLogs = true;
121
120
  this.collectionName = collectionName;
122
121
  this.simplschema = new simpl_schema_1.default(schema);
123
122
  this.timestamps = timestamps;
123
+ this.createLogs = createLogs;
124
124
  if (useReportBuilder) {
125
125
  var schemaCopy = common_1.deepCopy(schema);
126
126
  var rbSchema = common_1.buildRbLookups(reportBuilderLookupTables, schemaCopy, []);
@@ -169,7 +169,9 @@ var Collection = /** @class */ (function () {
169
169
  var _this = this;
170
170
  return __generator(this, function (_a) {
171
171
  switch (_a.label) {
172
- case 0: return [4 /*yield*/, this.find(filter)];
172
+ case 0:
173
+ if (!this.createLogs) return [3 /*break*/, 2];
174
+ return [4 /*yield*/, this.find(filter)];
173
175
  case 1:
174
176
  docs = _a.sent();
175
177
  docs.forEach(function (doc) {
@@ -186,7 +188,8 @@ var Collection = /** @class */ (function () {
186
188
  route: ''
187
189
  });
188
190
  });
189
- return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).deleteMany(filter, options)];
191
+ _a.label = 2;
192
+ case 2: return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).deleteMany(filter, options)];
190
193
  }
191
194
  });
192
195
  });
@@ -197,7 +200,9 @@ var Collection = /** @class */ (function () {
197
200
  var doc;
198
201
  return __generator(this, function (_a) {
199
202
  switch (_a.label) {
200
- case 0: return [4 /*yield*/, this.findOne(filter)];
203
+ case 0:
204
+ if (!this.createLogs) return [3 /*break*/, 2];
205
+ return [4 /*yield*/, this.findOne(filter)];
201
206
  case 1:
202
207
  doc = _a.sent();
203
208
  if (doc) {
@@ -214,7 +219,8 @@ var Collection = /** @class */ (function () {
214
219
  route: ''
215
220
  });
216
221
  }
217
- return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).deleteOne(filter, options)];
222
+ _a.label = 2;
223
+ case 2: return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).deleteOne(filter, options)];
218
224
  }
219
225
  });
220
226
  });
@@ -233,49 +239,55 @@ var Collection = /** @class */ (function () {
233
239
  };
234
240
  Collection.prototype.find = function (filter, options) {
235
241
  if (filter === void 0) { filter = {}; }
236
- log_collection_1.Logs.create({
237
- _id: objectIdHexString(),
238
- type: 'query',
239
- collection: this.collectionName,
240
- id_document: '',
241
- payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
242
- method: 'find',
243
- id_user: '',
244
- user: '',
245
- messageId: '',
246
- route: ''
247
- });
242
+ if (this.createLogs) {
243
+ log_collection_1.Logs.create({
244
+ _id: objectIdHexString(),
245
+ type: 'query',
246
+ collection: this.collectionName,
247
+ id_document: '',
248
+ payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
249
+ method: 'find',
250
+ id_user: '',
251
+ user: '',
252
+ messageId: '',
253
+ route: ''
254
+ });
255
+ }
248
256
  return index_1.ResolveIOServer.getMainDB().collection(this.collectionName).find(filter, options).toArray();
249
257
  };
250
258
  Collection.prototype.findById = function (id, options) {
251
- log_collection_1.Logs.create({
252
- _id: objectIdHexString(),
253
- type: 'query',
254
- collection: this.collectionName,
255
- id_document: id,
256
- payload: common_1.getBinarySize(JSON.stringify([id, options])) < 200000 ? JSON.stringify([id, options], null, 2) : 'Too Big',
257
- method: 'findById',
258
- id_user: '',
259
- user: '',
260
- messageId: '',
261
- route: ''
262
- });
259
+ if (this.createLogs) {
260
+ log_collection_1.Logs.create({
261
+ _id: objectIdHexString(),
262
+ type: 'query',
263
+ collection: this.collectionName,
264
+ id_document: id,
265
+ payload: common_1.getBinarySize(JSON.stringify([id, options])) < 200000 ? JSON.stringify([id, options], null, 2) : 'Too Big',
266
+ method: 'findById',
267
+ id_user: '',
268
+ user: '',
269
+ messageId: '',
270
+ route: ''
271
+ });
272
+ }
263
273
  return index_1.ResolveIOServer.getMainDB().collection(this.collectionName).findOne({ _id: id }, options);
264
274
  };
265
275
  Collection.prototype.findCount = function (filter, options) {
266
276
  if (filter === void 0) { filter = {}; }
267
- log_collection_1.Logs.create({
268
- _id: objectIdHexString(),
269
- type: 'query',
270
- collection: this.collectionName,
271
- id_document: '',
272
- payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
273
- method: 'findCount',
274
- id_user: '',
275
- user: '',
276
- messageId: '',
277
- route: ''
278
- });
277
+ if (this.createLogs) {
278
+ log_collection_1.Logs.create({
279
+ _id: objectIdHexString(),
280
+ type: 'query',
281
+ collection: this.collectionName,
282
+ id_document: '',
283
+ payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
284
+ method: 'findCount',
285
+ id_user: '',
286
+ user: '',
287
+ messageId: '',
288
+ route: ''
289
+ });
290
+ }
279
291
  return index_1.ResolveIOServer.getMainDB().collection(this.collectionName).find(filter, options).count();
280
292
  };
281
293
  Collection.prototype.findCursor = function (filter, options) {
@@ -288,18 +300,20 @@ var Collection = /** @class */ (function () {
288
300
  };
289
301
  Collection.prototype.findOne = function (filter, options) {
290
302
  if (filter === void 0) { filter = {}; }
291
- log_collection_1.Logs.create({
292
- _id: objectIdHexString(),
293
- type: 'query',
294
- collection: this.collectionName,
295
- id_document: '',
296
- payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
297
- method: 'findOne',
298
- id_user: '',
299
- user: '',
300
- messageId: '',
301
- route: ''
302
- });
303
+ if (this.createLogs) {
304
+ log_collection_1.Logs.create({
305
+ _id: objectIdHexString(),
306
+ type: 'query',
307
+ collection: this.collectionName,
308
+ id_document: '',
309
+ payload: common_1.getBinarySize(JSON.stringify([filter, options])) < 200000 ? JSON.stringify([filter, options], null, 2) : 'Too Big',
310
+ method: 'findOne',
311
+ id_user: '',
312
+ user: '',
313
+ messageId: '',
314
+ route: ''
315
+ });
316
+ }
303
317
  return index_1.ResolveIOServer.getMainDB().collection(this.collectionName).findOne(filter, options);
304
318
  };
305
319
  Collection.prototype.findOneAndDelete = function (filter, options) {
@@ -309,7 +323,9 @@ var Collection = /** @class */ (function () {
309
323
  var _this = this;
310
324
  return __generator(this, function (_a) {
311
325
  switch (_a.label) {
312
- case 0: return [4 /*yield*/, this.findOne(filter)];
326
+ case 0:
327
+ if (!this.createLogs) return [3 /*break*/, 2];
328
+ return [4 /*yield*/, this.findOne(filter)];
313
329
  case 1:
314
330
  doc = _a.sent();
315
331
  if (doc) {
@@ -326,13 +342,14 @@ var Collection = /** @class */ (function () {
326
342
  route: ''
327
343
  });
328
344
  }
329
- return [2 /*return*/, new Promise(function (resolve, reject) {
330
- index_1.ResolveIOServer.getMainDB().collection(_this.collectionName).findOneAndDelete(filter, options).then(function (res) {
331
- resolve(res.value);
332
- }, function (err) {
333
- reject(err);
334
- });
335
- })];
345
+ _a.label = 2;
346
+ case 2: return [2 /*return*/, new Promise(function (resolve, reject) {
347
+ index_1.ResolveIOServer.getMainDB().collection(_this.collectionName).findOneAndDelete(filter, options).then(function (res) {
348
+ resolve(res.value);
349
+ }, function (err) {
350
+ reject(err);
351
+ });
352
+ })];
336
353
  }
337
354
  });
338
355
  });
@@ -346,6 +363,7 @@ var Collection = /** @class */ (function () {
346
363
  switch (_a.label) {
347
364
  case 0:
348
365
  replacement['updatedAt'] = new Date();
366
+ if (!this.createLogs) return [3 /*break*/, 2];
349
367
  return [4 /*yield*/, this.findOne(filter)];
350
368
  case 1:
351
369
  doc = _a.sent();
@@ -363,6 +381,8 @@ var Collection = /** @class */ (function () {
363
381
  route: ''
364
382
  });
365
383
  }
384
+ _a.label = 2;
385
+ case 2:
366
386
  index_1.ResolveIOServer.getMainDB().collection(this.collectionName).findOneAndReplace(filter, replacement, options).then(function (res) {
367
387
  resolve(res.value);
368
388
  }, function (err) {
@@ -387,6 +407,7 @@ var Collection = /** @class */ (function () {
387
407
  else {
388
408
  update['$set']['updatedAt'] = new Date();
389
409
  }
410
+ if (!this.createLogs) return [3 /*break*/, 2];
390
411
  return [4 /*yield*/, this.findOne(filter)];
391
412
  case 1:
392
413
  doc = _a.sent();
@@ -404,6 +425,8 @@ var Collection = /** @class */ (function () {
404
425
  route: ''
405
426
  });
406
427
  }
428
+ _a.label = 2;
429
+ case 2:
407
430
  index_1.ResolveIOServer.getMainDB().collection(this.collectionName).findOneAndUpdate(filter, update, options).then(function (res) {
408
431
  resolve(res.value);
409
432
  }, function (err) {
@@ -429,20 +452,22 @@ var Collection = /** @class */ (function () {
429
452
  doc['updatedAt'] = new Date();
430
453
  });
431
454
  }
432
- docs.forEach(function (doc) {
433
- log_collection_1.Logs.create({
434
- _id: objectIdHexString(),
435
- type: 'document',
436
- collection: _this.collectionName,
437
- id_document: doc['_id'],
438
- payload: common_1.getBinarySize(JSON.stringify([doc, options])) < 200000 ? JSON.stringify([doc, options], null, 2) : 'Too Big',
439
- method: 'insertMany',
440
- id_user: '',
441
- user: '',
442
- messageId: '',
443
- route: ''
455
+ if (_this.createLogs) {
456
+ docs.forEach(function (doc) {
457
+ log_collection_1.Logs.create({
458
+ _id: objectIdHexString(),
459
+ type: 'document',
460
+ collection: _this.collectionName,
461
+ id_document: doc['_id'],
462
+ payload: common_1.getBinarySize(JSON.stringify([doc, options])) < 200000 ? JSON.stringify([doc, options], null, 2) : 'Too Big',
463
+ method: 'insertMany',
464
+ id_user: '',
465
+ user: '',
466
+ messageId: '',
467
+ route: ''
468
+ });
444
469
  });
445
- });
470
+ }
446
471
  index_1.ResolveIOServer.getMainDB().collection(_this.collectionName).insertMany(docs, options).then(function (res) {
447
472
  if (res.result.ok) {
448
473
  resolve(docs);
@@ -462,18 +487,20 @@ var Collection = /** @class */ (function () {
462
487
  doc['createdAt'] = new Date();
463
488
  doc['updatedAt'] = new Date();
464
489
  }
465
- log_collection_1.Logs.create({
466
- _id: objectIdHexString(),
467
- type: 'document',
468
- collection: _this.collectionName,
469
- id_document: doc['_id'],
470
- payload: common_1.getBinarySize(JSON.stringify([doc, options])) < 200000 ? JSON.stringify([doc, options], null, 2) : 'Too Big',
471
- method: 'insertOne',
472
- id_user: '',
473
- user: '',
474
- messageId: '',
475
- route: ''
476
- });
490
+ if (_this.createLogs) {
491
+ log_collection_1.Logs.create({
492
+ _id: objectIdHexString(),
493
+ type: 'document',
494
+ collection: _this.collectionName,
495
+ id_document: doc['_id'],
496
+ payload: common_1.getBinarySize(JSON.stringify([doc, options])) < 200000 ? JSON.stringify([doc, options], null, 2) : 'Too Big',
497
+ method: 'insertOne',
498
+ id_user: '',
499
+ user: '',
500
+ messageId: '',
501
+ route: ''
502
+ });
503
+ }
477
504
  index_1.ResolveIOServer.getMainDB().collection(_this.collectionName).insertOne(doc, options).then(function (res) {
478
505
  if (res.result.ok) {
479
506
  resolve(doc);
@@ -500,7 +527,9 @@ var Collection = /** @class */ (function () {
500
527
  var doc;
501
528
  return __generator(this, function (_a) {
502
529
  switch (_a.label) {
503
- case 0: return [4 /*yield*/, this.findOne(filter)];
530
+ case 0:
531
+ if (!this.createLogs) return [3 /*break*/, 2];
532
+ return [4 /*yield*/, this.findOne(filter)];
504
533
  case 1:
505
534
  doc = _a.sent();
506
535
  if (doc) {
@@ -517,7 +546,8 @@ var Collection = /** @class */ (function () {
517
546
  route: ''
518
547
  });
519
548
  }
520
- return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).replaceOne(filter, replacement, options)];
549
+ _a.label = 2;
550
+ case 2: return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).replaceOne(filter, replacement, options)];
521
551
  }
522
552
  });
523
553
  });
@@ -538,6 +568,7 @@ var Collection = /** @class */ (function () {
538
568
  else {
539
569
  update['$set']['updatedAt'] = new Date();
540
570
  }
571
+ if (!this.createLogs) return [3 /*break*/, 2];
541
572
  return [4 /*yield*/, this.find(filter)];
542
573
  case 1:
543
574
  docs = _a.sent();
@@ -555,7 +586,8 @@ var Collection = /** @class */ (function () {
555
586
  route: ''
556
587
  });
557
588
  });
558
- return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).updateMany(filter, update, options)];
589
+ _a.label = 2;
590
+ case 2: return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).updateMany(filter, update, options)];
559
591
  }
560
592
  });
561
593
  });
@@ -572,6 +604,7 @@ var Collection = /** @class */ (function () {
572
604
  else {
573
605
  update['$set']['updatedAt'] = new Date();
574
606
  }
607
+ if (!this.createLogs) return [3 /*break*/, 2];
575
608
  return [4 /*yield*/, this.findOne(filter)];
576
609
  case 1:
577
610
  doc = _a.sent();
@@ -589,7 +622,8 @@ var Collection = /** @class */ (function () {
589
622
  route: ''
590
623
  });
591
624
  }
592
- return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).updateOne(filter, update, options)];
625
+ _a.label = 2;
626
+ case 2: return [2 /*return*/, index_1.ResolveIOServer.getMainDB().collection(this.collectionName).updateOne(filter, update, options)];
593
627
  }
594
628
  });
595
629
  });