@resolveio/server-lib 8.1.36 → 9.0.0

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 (177) hide show
  1. package/collections/app-status.collection.d.ts +2 -6
  2. package/collections/app-status.collection.js +4 -21
  3. package/collections/app-status.collection.js.map +1 -1
  4. package/collections/app-version.collection.d.ts +2 -6
  5. package/collections/app-version.collection.js +4 -34
  6. package/collections/app-version.collection.js.map +1 -1
  7. package/collections/counter.collection.d.ts +2 -6
  8. package/collections/counter.collection.js +4 -34
  9. package/collections/counter.collection.js.map +1 -1
  10. package/collections/cron-job-history.collection.d.ts +3 -7
  11. package/collections/cron-job-history.collection.js +5 -34
  12. package/collections/cron-job-history.collection.js.map +1 -1
  13. package/collections/cron-job.collection.d.ts +2 -6
  14. package/collections/cron-job.collection.js +4 -33
  15. package/collections/cron-job.collection.js.map +1 -1
  16. package/collections/email-history.collection.d.ts +2 -6
  17. package/collections/email-history.collection.js +4 -21
  18. package/collections/email-history.collection.js.map +1 -1
  19. package/collections/email-verified.collection.d.ts +2 -6
  20. package/collections/email-verified.collection.js +5 -22
  21. package/collections/email-verified.collection.js.map +1 -1
  22. package/collections/file.collection.d.ts +2 -6
  23. package/collections/file.collection.js +4 -26
  24. package/collections/file.collection.js.map +1 -1
  25. package/collections/flag.collection.d.ts +2 -6
  26. package/collections/flag.collection.js +4 -21
  27. package/collections/flag.collection.js.map +1 -1
  28. package/collections/log-method-latency.collection.d.ts +2 -6
  29. package/collections/log-method-latency.collection.js +7 -22
  30. package/collections/log-method-latency.collection.js.map +1 -1
  31. package/collections/log-subscription.collection.d.ts +2 -6
  32. package/collections/log-subscription.collection.js +9 -24
  33. package/collections/log-subscription.collection.js.map +1 -1
  34. package/collections/log.collection.d.ts +2 -6
  35. package/collections/log.collection.js +9 -25
  36. package/collections/log.collection.js.map +1 -1
  37. package/collections/logged-in-users.collection.d.ts +2 -6
  38. package/collections/logged-in-users.collection.js +5 -32
  39. package/collections/logged-in-users.collection.js.map +1 -1
  40. package/collections/method-call.collection.d.ts +2 -5
  41. package/collections/method-call.collection.js +5 -11
  42. package/collections/method-call.collection.js.map +1 -1
  43. package/collections/method-response.collection.d.ts +2 -5
  44. package/collections/method-response.collection.js +5 -11
  45. package/collections/method-response.collection.js.map +1 -1
  46. package/collections/monitor-cpu.collection.d.ts +2 -6
  47. package/collections/monitor-cpu.collection.js +9 -26
  48. package/collections/monitor-cpu.collection.js.map +1 -1
  49. package/collections/monitor-https-inbound.collection.d.ts +2 -6
  50. package/collections/monitor-https-inbound.collection.js +9 -26
  51. package/collections/monitor-https-inbound.collection.js.map +1 -1
  52. package/collections/monitor-https-outbound.collection.d.ts +2 -6
  53. package/collections/monitor-https-outbound.collection.js +11 -28
  54. package/collections/monitor-https-outbound.collection.js.map +1 -1
  55. package/collections/monitor-memory.collection.d.ts +2 -6
  56. package/collections/monitor-memory.collection.js +8 -25
  57. package/collections/monitor-memory.collection.js.map +1 -1
  58. package/collections/monitor-mongo.collection.d.ts +2 -6
  59. package/collections/monitor-mongo.collection.js +8 -25
  60. package/collections/monitor-mongo.collection.js.map +1 -1
  61. package/collections/notification.collection.d.ts +2 -6
  62. package/collections/notification.collection.js +4 -21
  63. package/collections/notification.collection.js.map +1 -1
  64. package/collections/queue-flag.collection.d.ts +2 -6
  65. package/collections/queue-flag.collection.js +5 -22
  66. package/collections/queue-flag.collection.js.map +1 -1
  67. package/collections/queue-method.collection.d.ts +2 -6
  68. package/collections/queue-method.collection.js +6 -77
  69. package/collections/queue-method.collection.js.map +1 -1
  70. package/collections/queue-response.collection.d.ts +2 -6
  71. package/collections/queue-response.collection.js +5 -34
  72. package/collections/queue-response.collection.js.map +1 -1
  73. package/collections/report-builder-dashboard-builder.collection.d.ts +2 -6
  74. package/collections/report-builder-dashboard-builder.collection.js +6 -35
  75. package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
  76. package/collections/report-builder-library.collection.d.ts +2 -6
  77. package/collections/report-builder-library.collection.js +7 -36
  78. package/collections/report-builder-library.collection.js.map +1 -1
  79. package/collections/report-builder-report.collection.d.ts +2 -6
  80. package/collections/report-builder-report.collection.js +7 -36
  81. package/collections/report-builder-report.collection.js.map +1 -1
  82. package/collections/user-group.collection.d.ts +3 -6
  83. package/collections/user-group.collection.js +5 -38
  84. package/collections/user-group.collection.js.map +1 -1
  85. package/collections/user-guide.collection.d.ts +2 -6
  86. package/collections/user-guide.collection.js +4 -26
  87. package/collections/user-guide.collection.js.map +1 -1
  88. package/collections/user.collection.d.ts +3 -6
  89. package/collections/user.collection.js +36 -62
  90. package/collections/user.collection.js.map +1 -1
  91. package/fixtures/cron-jobs.js +5 -5
  92. package/fixtures/cron-jobs.js.map +1 -1
  93. package/fixtures/init.js +2 -2
  94. package/fixtures/init.js.map +1 -1
  95. package/http/auth.js +201 -185
  96. package/http/auth.js.map +1 -1
  97. package/index.d.ts +2 -1
  98. package/index.js +5 -6
  99. package/index.js.map +1 -1
  100. package/managers/cron.manager.js +6 -6
  101. package/managers/cron.manager.js.map +1 -1
  102. package/managers/method.manager.js +10 -10
  103. package/managers/method.manager.js.map +1 -1
  104. package/managers/mongo.manager.d.ts +102 -0
  105. package/managers/mongo.manager.js +514 -0
  106. package/managers/mongo.manager.js.map +1 -0
  107. package/managers/monitor.manager.js +6 -6
  108. package/managers/monitor.manager.js.map +1 -1
  109. package/managers/queue-method.manager.js +14 -14
  110. package/managers/queue-method.manager.js.map +1 -1
  111. package/managers/subscription.manager.js +9 -7
  112. package/managers/subscription.manager.js.map +1 -1
  113. package/methods/accounts.js +23 -21
  114. package/methods/accounts.js.map +1 -1
  115. package/methods/aws.js +7 -7
  116. package/methods/aws.js.map +1 -1
  117. package/methods/collections.js +112 -119
  118. package/methods/collections.js.map +1 -1
  119. package/methods/counters.js +5 -5
  120. package/methods/counters.js.map +1 -1
  121. package/methods/cron-jobs.js +2 -2
  122. package/methods/cron-jobs.js.map +1 -1
  123. package/methods/logs.js +8 -8
  124. package/methods/logs.js.map +1 -1
  125. package/methods/monitor.js +6 -6
  126. package/methods/monitor.js.map +1 -1
  127. package/methods/pdf.js +5 -5
  128. package/methods/pdf.js.map +1 -1
  129. package/methods/report-builder.js +2 -2
  130. package/methods/report-builder.js.map +1 -1
  131. package/models/report-builder.model.d.ts +1 -2
  132. package/models/report-builder.model.js.map +1 -1
  133. package/models/user.model.d.ts +9 -7
  134. package/models/user.model.js.map +1 -1
  135. package/package.json +26 -27
  136. package/public_api.js +1 -1
  137. package/publications/app-status.js +1 -1
  138. package/publications/app-status.js.map +1 -1
  139. package/publications/app-version.js +1 -1
  140. package/publications/app-version.js.map +1 -1
  141. package/publications/cron-jobs.js +2 -2
  142. package/publications/cron-jobs.js.map +1 -1
  143. package/publications/files.js +3 -3
  144. package/publications/files.js.map +1 -1
  145. package/publications/flags.js +1 -1
  146. package/publications/flags.js.map +1 -1
  147. package/publications/logs.js +3 -3
  148. package/publications/logs.js.map +1 -1
  149. package/publications/method-calls.js +1 -1
  150. package/publications/method-calls.js.map +1 -1
  151. package/publications/method-responses.js +1 -1
  152. package/publications/method-responses.js.map +1 -1
  153. package/publications/notifications.js +1 -1
  154. package/publications/notifications.js.map +1 -1
  155. package/publications/report-builder-dashboard-builders.js +2 -2
  156. package/publications/report-builder-dashboard-builders.js.map +1 -1
  157. package/publications/report-builder-libraries.js +3 -3
  158. package/publications/report-builder-libraries.js.map +1 -1
  159. package/publications/report-builder-reports.js +4 -4
  160. package/publications/report-builder-reports.js.map +1 -1
  161. package/publications/super-admin.js +1 -1
  162. package/publications/super-admin.js.map +1 -1
  163. package/publications/user-groups.js +1 -1
  164. package/publications/user-groups.js.map +1 -1
  165. package/publications/user-guides.js +1 -1
  166. package/publications/user-guides.js.map +1 -1
  167. package/server-app.d.ts +4 -1
  168. package/server-app.js +19 -28
  169. package/server-app.js.map +1 -1
  170. package/util/common.d.ts +2 -3
  171. package/util/common.js +16 -21
  172. package/util/common.js.map +1 -1
  173. package/util/schema-report-builder.js +5 -5
  174. package/util/schema-report-builder.js.map +1 -1
  175. package/managers/database.manager.d.ts +0 -6
  176. package/managers/database.manager.js +0 -15
  177. package/managers/database.manager.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/file.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,yCAA+D;AAE/D,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,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAIQ,QAAA,KAAK,GAA0B,IAAI,CAAC;AACpC,QAAA,YAAY,GAA0B,IAAI,CAAC;AAEtD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,aAAK,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAElE,aAAK,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAEhD,MAAM,CAAC,GAAG,GAAG;YACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,aAAK,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;QAE9C,oBAAY,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE5F,qCAAqC;QACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;QAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;QACnF,aAAK,CAAC,UAAU,CAAC,GAAG,sBAAa,CAAC,QAAQ,CAAC,CAAC;KAC5C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"file.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { FileModel } from '../models/file.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/common';\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\tsize: {\n\t\ttype: Number\n\t},\n\tkey: {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\torder: {\n\t\ttype: Number\n\t},\n\tstatus: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdefault: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends FileModel, Document {}\n\nexport let Files: Model<ResolveIOModel> = null;\nexport let FileVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tFiles = ResolveIOServer.getMainDB().model('files', DefaultSchema);\n\n\t\tFiles['simplschema'] = new SimpleSchema(schema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tFiles['versionCollection'] = 'files.versions';\n\n\t\tFileVersions = ResolveIOServer.getMainDB().model(Files['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tFiles['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/file.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAK9D,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,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,KAAK,GAA0B,IAAI,CAAC;AAE/C,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAY,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACrE,aAAK,GAAG,KAAK,CAAC,eAAe,CAAC;KAC9B;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"file.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { FileModel } from '../models/file.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/common';\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\tsize: {\n\t\ttype: Number\n\t},\n\tkey: {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\torder: {\n\t\ttype: Number\n\t},\n\tstatus: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdefault: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Files: Collection<FileModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<FileModel>('files', schema, false, true, []);\n\t\tFiles = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { FlagModel } from '../models/flag.model';
3
- interface ResolveIOModel extends FlagModel, Document {
4
- }
5
- export declare let Flags: Model<ResolveIOModel>;
6
- export declare let FlagVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let Flags: Collection<FlagModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlagVersions = exports.Flags = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.Flags = void 0;
6
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
7
6
  var schema = {
8
7
  _id: {
9
8
  type: String,
@@ -29,28 +28,12 @@ var schema = {
29
28
  optional: true
30
29
  }
31
30
  };
32
- var DefaultSchema = new mongoose_1.Schema(schema, {
33
- skipVersioning: true,
34
- versionKey: false,
35
- timestamps: true
36
- });
37
31
  exports.Flags = null;
38
- exports.FlagVersions = null;
39
32
  initializeCollection();
40
33
  function initializeCollection() {
41
34
  if (index_1.ResolveIOServer.getMainDB()) {
42
- exports.Flags = index_1.ResolveIOServer.getMainDB().model('flags', DefaultSchema);
43
- exports.Flags['simplschema'] = new simpl_schema_1.default(schema);
44
- schema._id = {
45
- type: mongoose_1.Schema.Types.Mixed
46
- };
47
- var VersionSchema = new mongoose_1.Schema(schema, {
48
- skipVersioning: true,
49
- versionKey: false,
50
- timestamps: true
51
- });
52
- exports.Flags['versionCollection'] = 'flags.versions';
53
- exports.FlagVersions = index_1.ResolveIOServer.getMainDB().model(exports.Flags['versionCollection'], VersionSchema);
35
+ var model = new mongo_manager_1.Model('flags', schema, false, false);
36
+ exports.Flags = model.collection_main;
54
37
  }
55
38
  else {
56
39
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/flag.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,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,OAAO;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAIQ,QAAA,KAAK,GAA0B,IAAI,CAAC;AACpC,QAAA,YAAY,GAA0B,IAAI,CAAC;AAEtD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,aAAK,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAElE,aAAK,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAEhD,MAAM,CAAC,GAAG,GAAG;YACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,aAAK,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;QAE9C,oBAAY,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAC5F;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"flag.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { FlagModel } from '../models/flag.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\ttype: {\n\t\ttype: String\n\t},\n\tvalue: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends FlagModel, Document {}\n\nexport let Flags: Model<ResolveIOModel> = null;\nexport let FlagVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tFlags = ResolveIOServer.getMainDB().model('flags', DefaultSchema);\n\n\t\tFlags['simplschema'] = new SimpleSchema(schema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tFlags['versionCollection'] = 'flags.versions';\n\n\t\tFlagVersions = ResolveIOServer.getMainDB().model(Flags['versionCollection'], VersionSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/flag.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,OAAO;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,KAAK,GAA0B,IAAI,CAAC;AAE/C,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAY,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClE,aAAK,GAAG,KAAK,CAAC,eAAe,CAAC;KAC9B;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"flag.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { FlagModel } from '../models/flag.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\ttype: {\n\t\ttype: String\n\t},\n\tvalue: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Flags: Collection<FlagModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<FlagModel>('flags', schema, false, false);\n\t\tFlags = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { LogMethodLatencyModel } from '../models/log-method-latency.model';
3
- interface ResolveIOModel extends LogMethodLatencyModel, Document {
4
- }
5
- export declare let LogMethodLatencies: Model<ResolveIOModel>;
6
- export declare let LogMethodLatencyVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let LogMethodLatencies: Collection<LogMethodLatencyModel>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogMethodLatencyVersions = exports.LogMethodLatencies = void 0;
4
- var mongoose_1 = require("mongoose");
3
+ exports.LogMethodLatencies = void 0;
5
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
6
6
  var schema = {
7
7
  _id: {
8
8
  type: String,
@@ -34,30 +34,15 @@ var schema = {
34
34
  type: String
35
35
  }
36
36
  };
37
- var DefaultSchema = new mongoose_1.Schema(schema, {
38
- skipVersioning: true,
39
- versionKey: false,
40
- timestamps: true
41
- });
42
- DefaultSchema.index({ createdAt: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
43
- DefaultSchema.index({ latency_ms: 1 });
44
- DefaultSchema.index({ method: 1 });
45
37
  exports.LogMethodLatencies = null;
46
- exports.LogMethodLatencyVersions = null;
47
38
  initializeCollection();
48
39
  function initializeCollection() {
49
40
  if (index_1.ResolveIOServer.getMainDB()) {
50
- exports.LogMethodLatencies = index_1.ResolveIOServer.getMainDB().model('log-method-latencies', DefaultSchema);
51
- schema._id = {
52
- type: mongoose_1.Schema.Types.Mixed
53
- };
54
- var VersionSchema = new mongoose_1.Schema(schema, {
55
- skipVersioning: true,
56
- versionKey: false,
57
- timestamps: true
58
- });
59
- exports.LogMethodLatencies['versionCollection'] = 'log-method-latencies.versions';
60
- exports.LogMethodLatencyVersions = index_1.ResolveIOServer.getMainDB().model(exports.LogMethodLatencies['versionCollection'], VersionSchema);
41
+ var model = new mongo_manager_1.Model('log-method-latencies', schema, false, false);
42
+ exports.LogMethodLatencies = model.collection_main;
43
+ exports.LogMethodLatencies.createIndex({ createdAt: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
44
+ exports.LogMethodLatencies.createIndex({ latency_ms: 1 });
45
+ exports.LogMethodLatencies.createIndex({ method: 1 });
61
46
  }
62
47
  else {
63
48
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/log-method-latency.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,kCAA2C;AAG3C,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,UAAU,EAAE;QACX,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;AAC7E,aAAa,CAAC,KAAK,CAAC,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;AACrC,aAAa,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;AAItB,QAAA,kBAAkB,GAA0B,IAAI,CAAC;AACjD,QAAA,wBAAwB,GAA0B,IAAI,CAAC;AAElE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,0BAAkB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;QAE9F,MAAM,CAAC,GAAG,GAAG;YACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,0BAAkB,CAAC,mBAAmB,CAAC,GAAG,+BAA+B,CAAC;QAE1E,gCAAwB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,0BAAkB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KACrH;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log-method-latency.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport { ResolveIOServer } from '../index';\nimport { LogMethodLatencyModel } from '../models/log-method-latency.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\tdate_start: {\n\t\ttype: Date\n\t},\n\tdate_end: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlatency_ms: {\n\t\ttype: Number\n\t},\n\tmethod: {\n\t\ttype: String\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\nDefaultSchema.index({latency_ms: 1});\nDefaultSchema.index({method: 1});\n\ninterface ResolveIOModel extends LogMethodLatencyModel, Document {}\n\nexport let LogMethodLatencies: Model<ResolveIOModel> = null;\nexport let LogMethodLatencyVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tLogMethodLatencies = ResolveIOServer.getMainDB().model('log-method-latencies', DefaultSchema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tLogMethodLatencies['versionCollection'] = 'log-method-latencies.versions';\n\n\t\tLogMethodLatencyVersions = ResolveIOServer.getMainDB().model(LogMethodLatencies['versionCollection'], VersionSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/log-method-latency.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,UAAU,EAAE;QACX,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,kBAAkB,GAAsC,IAAI,CAAC;AAExE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAwB,sBAAsB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7F,0BAAkB,GAAG,KAAK,CAAC,eAAe,CAAC;QAC3C,0BAAkB,CAAC,WAAW,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;QACxF,0BAAkB,CAAC,WAAW,CAAC,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;QAChD,0BAAkB,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;KAC5C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log-method-latency.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { LogMethodLatencyModel } from '../models/log-method-latency.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\tdate_start: {\n\t\ttype: Date\n\t},\n\tdate_end: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlatency_ms: {\n\t\ttype: Number\n\t},\n\tmethod: {\n\t\ttype: String\n\t}\n};\n\nexport let LogMethodLatencies: Collection<LogMethodLatencyModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<LogMethodLatencyModel>('log-method-latencies', schema, false, false);\n\t\tLogMethodLatencies = model.collection_main;\n\t\tLogMethodLatencies.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\n\t\tLogMethodLatencies.createIndex({latency_ms: 1});\n\t\tLogMethodLatencies.createIndex({method: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { LogSubscriptionModel } from '../models/log-subscription.model';
3
- interface ResolveIOModel extends LogSubscriptionModel, Document {
4
- }
5
- export declare let LogSubscriptions: Model<ResolveIOModel>;
6
- export declare let LogSubscriptionVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let LogSubscriptions: Collection<LogSubscriptionModel>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogSubscriptionVersions = exports.LogSubscriptions = void 0;
4
- var mongoose_1 = require("mongoose");
3
+ exports.LogSubscriptions = void 0;
5
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
6
6
  var schema = {
7
7
  _id: {
8
8
  type: String,
@@ -40,32 +40,17 @@ var schema = {
40
40
  blackbox: true
41
41
  }
42
42
  };
43
- var DefaultSchema = new mongoose_1.Schema(schema, {
44
- skipVersioning: true,
45
- versionKey: false,
46
- timestamps: true
47
- });
48
- DefaultSchema.index({ date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
49
- DefaultSchema.index({ type: 1 });
50
- DefaultSchema.index({ collection_name: 1 });
51
- DefaultSchema.index({ date: 1, type: 1 });
52
- DefaultSchema.index({ createdAt: 1 });
53
43
  exports.LogSubscriptions = null;
54
- exports.LogSubscriptionVersions = null;
55
44
  initializeCollection();
56
45
  function initializeCollection() {
57
46
  if (index_1.ResolveIOServer.getMainDB()) {
58
- exports.LogSubscriptions = index_1.ResolveIOServer.getMainDB().model('log-subscriptions', DefaultSchema);
59
- schema._id = {
60
- type: mongoose_1.Schema.Types.Mixed
61
- };
62
- var VersionSchema = new mongoose_1.Schema(schema, {
63
- skipVersioning: true,
64
- versionKey: false,
65
- timestamps: true
66
- });
67
- exports.LogSubscriptions['versionCollection'] = 'log-subscriptions.versions';
68
- exports.LogSubscriptionVersions = index_1.ResolveIOServer.getMainDB().model(exports.LogSubscriptions['versionCollection'], VersionSchema);
47
+ var model = new mongo_manager_1.Model('log-subscriptions', schema, false, false);
48
+ exports.LogSubscriptions = model.collection_main;
49
+ exports.LogSubscriptions.createIndex({ date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
50
+ exports.LogSubscriptions.createIndex({ type: 1 });
51
+ exports.LogSubscriptions.createIndex({ collection_name: 1 });
52
+ exports.LogSubscriptions.createIndex({ date: 1, type: 1 });
53
+ exports.LogSubscriptions.createIndex({ createdAt: 1 });
69
54
  }
70
55
  else {
71
56
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/log-subscription.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,kCAA2C;AAG3C,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,IAAI;KACV;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;KACZ;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,KAAK;KACX;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;AACxE,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AAC/B,aAAa,CAAC,KAAK,CAAC,EAAC,eAAe,EAAE,CAAC,EAAC,CAAC,CAAC;AAC1C,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AACxC,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;AAIzB,QAAA,gBAAgB,GAA0B,IAAI,CAAC;AAC/C,QAAA,uBAAuB,GAA0B,IAAI,CAAC;AAEjE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,wBAAgB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QAEzF,MAAM,CAAC,GAAG,GAAG;YACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,wBAAgB,CAAC,mBAAmB,CAAC,GAAG,4BAA4B,CAAC;QAErE,+BAAuB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,wBAAgB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAClH;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log-subscription.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport { ResolveIOServer } from '../index';\nimport { LogSubscriptionModel } from '../models/log-subscription.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\tdate: {\n\t\ttype: Date\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\tsubscription: {\n\t\ttype: String\n\t},\n\tcollection_name: {\n\t\ttype: String\n\t},\n\tsubData: {\n\t\ttype: Array\t\n\t},\n\t'subData.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({date: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\nDefaultSchema.index({type: 1});\nDefaultSchema.index({collection_name: 1});\nDefaultSchema.index({date: 1, type: 1});\nDefaultSchema.index({createdAt: 1});\n\ninterface ResolveIOModel extends LogSubscriptionModel, Document {}\n\nexport let LogSubscriptions: Model<ResolveIOModel> = null;\nexport let LogSubscriptionVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tLogSubscriptions = ResolveIOServer.getMainDB().model('log-subscriptions', DefaultSchema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tLogSubscriptions['versionCollection'] = 'log-subscriptions.versions';\n\n\t\tLogSubscriptionVersions = ResolveIOServer.getMainDB().model(LogSubscriptions['versionCollection'], VersionSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/log-subscription.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,IAAI;KACV;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;KACZ;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,KAAK;KACX;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,gBAAgB,GAAqC,IAAI,CAAC;AAErE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAuB,mBAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACzF,wBAAgB,GAAG,KAAK,CAAC,eAAe,CAAC;QACzC,wBAAgB,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;QACjF,wBAAgB,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QACxC,wBAAgB,CAAC,WAAW,CAAC,EAAC,eAAe,EAAE,CAAC,EAAC,CAAC,CAAC;QACnD,wBAAgB,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QACjD,wBAAgB,CAAC,WAAW,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;KAC7C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log-subscription.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { LogSubscriptionModel } from '../models/log-subscription.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\tdate: {\n\t\ttype: Date\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\tsubscription: {\n\t\ttype: String\n\t},\n\tcollection_name: {\n\t\ttype: String\n\t},\n\tsubData: {\n\t\ttype: Array\t\n\t},\n\t'subData.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t}\n};\n\nexport let LogSubscriptions: Collection<LogSubscriptionModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<LogSubscriptionModel>('log-subscriptions', schema, false, false);\n\t\tLogSubscriptions = model.collection_main;\n\t\tLogSubscriptions.createIndex({date: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\n\t\tLogSubscriptions.createIndex({type: 1});\n\t\tLogSubscriptions.createIndex({collection_name: 1});\n\t\tLogSubscriptions.createIndex({date: 1, type: 1});\n\t\tLogSubscriptions.createIndex({createdAt: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { LogModel } from '../models/log.model';
3
- interface ResolveIOModel extends LogModel, Document {
4
- }
5
- export declare let Logs: Model<ResolveIOModel>;
6
- export declare let LogVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let Logs: Collection<LogModel>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogVersions = exports.Logs = void 0;
4
- var mongoose_1 = require("mongoose");
3
+ exports.Logs = void 0;
5
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
6
6
  var schema = {
7
7
  _id: {
8
8
  type: String,
@@ -56,33 +56,17 @@ var schema = {
56
56
  optional: true
57
57
  }
58
58
  };
59
- var DefaultSchema = new mongoose_1.Schema(schema, {
60
- skipVersioning: true,
61
- versionKey: false,
62
- timestamps: true
63
- });
64
- DefaultSchema.index({ date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
65
- DefaultSchema.index({ type: 1 });
66
- DefaultSchema.index({ type: 1, date: 1 });
67
- DefaultSchema.index({ user: 1, date: 1 });
68
- DefaultSchema.index({ user: 1, type: 1, date: 1 });
69
- DefaultSchema.index({ method: 1, date: 1 });
70
59
  exports.Logs = null;
71
- exports.LogVersions = null;
72
60
  initializeCollection();
73
61
  function initializeCollection() {
74
62
  if (index_1.ResolveIOServer.getMainDB()) {
75
- exports.Logs = index_1.ResolveIOServer.getMainDB().model('logs', DefaultSchema);
76
- schema._id = {
77
- type: mongoose_1.Schema.Types.Mixed
78
- };
79
- var VersionSchema = new mongoose_1.Schema(schema, {
80
- skipVersioning: true,
81
- versionKey: false,
82
- timestamps: true
83
- });
84
- exports.Logs['versionCollection'] = 'logs.versions';
85
- exports.LogVersions = index_1.ResolveIOServer.getMainDB().model(exports.Logs['versionCollection'], VersionSchema);
63
+ var model = new mongo_manager_1.Model('logs', schema, false, false);
64
+ exports.Logs = model.collection_main;
65
+ exports.Logs.createIndex({ date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 30 });
66
+ exports.Logs.createIndex({ type: 1, date: 1 });
67
+ exports.Logs.createIndex({ user: 1, date: 1 });
68
+ exports.Logs.createIndex({ user: 1, type: 1, date: 1 });
69
+ exports.Logs.createIndex({ method: 1, date: 1 });
86
70
  }
87
71
  else {
88
72
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/log.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,kCAA2C;AAG3C,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,IAAI;KACV;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;AACxE,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AAC/B,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AACxC,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AACxC,aAAa,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AACjD,aAAa,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;AAI/B,QAAA,IAAI,GAA0B,IAAI,CAAC;AACnC,QAAA,WAAW,GAA0B,IAAI,CAAC;AAErD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,YAAI,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAEhE,MAAM,CAAC,GAAG,GAAG;YACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,YAAI,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC;QAE5C,mBAAW,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,YAAI,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAC1F;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport { ResolveIOServer } from '../index';\nimport { LogModel } from '../models/log.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\tdate: {\n\t\ttype: Date\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\ttitle: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n\tpayload: {\n\t\ttype: String\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: String\n\t},\n\troute: {\n\t\ttype: String\n\t},\n\tdata_0: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdata_1: {\n\t\ttype: String,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({date: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\nDefaultSchema.index({type: 1});\nDefaultSchema.index({type: 1, date: 1});\nDefaultSchema.index({user: 1, date: 1});\nDefaultSchema.index({user: 1, type: 1, date: 1});\nDefaultSchema.index({method: 1, date: 1});\n\ninterface ResolveIOModel extends LogModel, Document {}\n\nexport let Logs: Model<ResolveIOModel> = null;\nexport let LogVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tLogs = ResolveIOServer.getMainDB().model('logs', DefaultSchema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tLogs['versionCollection'] = 'logs.versions';\n\n\t\tLogVersions = ResolveIOServer.getMainDB().model(Logs['versionCollection'], VersionSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/log.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,IAAI;KACV;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,SAAS,EAAE;QACV,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,IAAI,GAAyB,IAAI,CAAC;AAE7C,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAChE,YAAI,GAAG,KAAK,CAAC,eAAe,CAAC;QAC7B,YAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAC,CAAC,CAAC;QACrE,YAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QACrC,YAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QACrC,YAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAC9C,YAAI,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;KACvC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"log.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { LogModel } from '../models/log.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\tdate: {\n\t\ttype: Date\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\ttitle: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n\tpayload: {\n\t\ttype: String\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tmessageId: {\n\t\ttype: String\n\t},\n\troute: {\n\t\ttype: String\n\t},\n\tdata_0: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdata_1: {\n\t\ttype: String,\n\t\toptional: true\n\t}\n};\n\nexport let Logs: Collection<LogModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<LogModel>('logs', schema, false, false);\n\t\tLogs = model.collection_main;\n\t\tLogs.createIndex({date: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});\n\t\tLogs.createIndex({type: 1, date: 1});\n\t\tLogs.createIndex({user: 1, date: 1});\n\t\tLogs.createIndex({user: 1, type: 1, date: 1});\n\t\tLogs.createIndex({method: 1, date: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { LoggedInUserModel } from '../models/logged-in-users.model';
3
- interface ResolveIOModel extends LoggedInUserModel, Document {
4
- }
5
- export declare let LoggedInUsers: Model<ResolveIOModel>;
6
- export declare let LoggedInUserVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let LoggedInUsers: Collection<LoggedInUserModel>;
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.LoggedInUserVersions = exports.LoggedInUsers = void 0;
15
- var mongoose_1 = require("mongoose");
3
+ exports.LoggedInUsers = void 0;
16
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
17
6
  var schema = {
18
7
  _id: {
19
8
  type: String,
@@ -52,29 +41,13 @@ var schema = {
52
41
  optional: true
53
42
  }
54
43
  };
55
- var DefaultSchema = new mongoose_1.Schema(schema, {
56
- skipVersioning: true,
57
- versionKey: false,
58
- timestamps: true
59
- });
60
- DefaultSchema.index({ id_ws: 1 });
61
44
  exports.LoggedInUsers = null;
62
- exports.LoggedInUserVersions = null;
63
45
  initializeCollection();
64
46
  function initializeCollection() {
65
47
  if (index_1.ResolveIOServer.getMainDB()) {
66
- exports.LoggedInUsers = index_1.ResolveIOServer.getMainDB().model('logged-in-users', DefaultSchema);
67
- var vSchema = __assign({}, schema);
68
- vSchema._id = {
69
- type: mongoose_1.Schema.Types.Mixed
70
- };
71
- var VersionSchema = new mongoose_1.Schema(vSchema, {
72
- skipVersioning: true,
73
- versionKey: false,
74
- timestamps: true
75
- });
76
- exports.LoggedInUsers['versionCollection'] = 'logged-in-users.versions';
77
- exports.LoggedInUserVersions = index_1.ResolveIOServer.getMainDB().model(exports.LoggedInUsers['versionCollection'], VersionSchema);
48
+ var model = new mongo_manager_1.Model('logged-in-users', schema, false, false);
49
+ exports.LoggedInUsers = model.collection_main;
50
+ exports.LoggedInUsers.createIndex({ id_ws: 1 });
78
51
  }
79
52
  else {
80
53
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/logged-in-users.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAmD;AACnD,kCAA2C;AAG3C,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,IAAI;KACV;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,CAAC,CAAC;AAIrB,QAAA,aAAa,GAA0B,IAAI,CAAC;AAC5C,QAAA,oBAAoB,GAA0B,IAAI,CAAC;AAE9D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,qBAAa,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAEpF,IAAI,OAAO,gBAAQ,MAAM,CAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,GAAG;YACb,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,OAAO,EAAE;YACvC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,qBAAa,CAAC,mBAAmB,CAAC,GAAG,0BAA0B,CAAC;QAEhE,4BAAoB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,qBAAa,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAC5G;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"logged-in-users.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport { ResolveIOServer } from '../index';\nimport { LoggedInUserModel } from '../models/logged-in-users.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\tdate: {\n\t\ttype: Date\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tapp_version: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tlatency: {\n\t\ttype: Number,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({id_ws: 1});\n\ninterface ResolveIOModel extends LoggedInUserModel, Document {}\n\nexport let LoggedInUsers: Model<ResolveIOModel> = null;\nexport let LoggedInUserVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tLoggedInUsers = ResolveIOServer.getMainDB().model('logged-in-users', DefaultSchema);\n\n\t\tlet vSchema = { ...schema };\n\t\tvSchema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(vSchema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tLoggedInUsers['versionCollection'] = 'logged-in-users.versions';\n\n\t\tLoggedInUserVersions = ResolveIOServer.getMainDB().model(LoggedInUsers['versionCollection'], VersionSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/logged-in-users.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,IAAI;KACV;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,aAAa,GAAkC,IAAI,CAAC;AAE/D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAoB,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpF,qBAAa,GAAG,KAAK,CAAC,eAAe,CAAC;QACtC,qBAAa,CAAC,WAAW,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,CAAC,CAAC;KACtC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"logged-in-users.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { LoggedInUserModel } from '../models/logged-in-users.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\tdate: {\n\t\ttype: Date\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t},\n\tapp_version: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tlatency: {\n\t\ttype: Number,\n\t\toptional: true\n\t}\n};\n\nexport let LoggedInUsers: Collection<LoggedInUserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<LoggedInUserModel>('logged-in-users', schema, false, false);\n\t\tLoggedInUsers = model.collection_main;\n\t\tLoggedInUsers.createIndex({id_ws: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,6 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { MethodCallModel } from '../models/method-call.model';
3
- interface ResolveIOModel extends MethodCallModel, Document {
4
- }
5
- export declare let MethodCalls: Model<ResolveIOModel>;
6
- export {};
3
+ export declare let MethodCalls: Collection<MethodCallModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodCalls = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
6
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
7
6
  var schema = {
8
7
  _id: {
9
8
  type: String,
@@ -34,19 +33,14 @@ var schema = {
34
33
  type: Date
35
34
  }
36
35
  };
37
- var DefaultSchema = new mongoose_1.Schema(schema, {
38
- skipVersioning: true,
39
- versionKey: false,
40
- timestamps: true
41
- });
42
- DefaultSchema.index({ id_user: 1, message_id: 1 });
43
- DefaultSchema.index({ createdAt: 1 }, { expireAfterSeconds: 86400 });
44
36
  exports.MethodCalls = null;
45
37
  initializeCollection();
46
38
  function initializeCollection() {
47
39
  if (index_1.ResolveIOServer.getMainDB()) {
48
- exports.MethodCalls = index_1.ResolveIOServer.getMainDB().model('method-calls', DefaultSchema);
49
- exports.MethodCalls['simplschema'] = new simpl_schema_1.default(schema);
40
+ var model = new mongo_manager_1.Model('method-calls', schema, false, false);
41
+ exports.MethodCalls = model.collection_main;
42
+ exports.MethodCalls.createIndex({ id_user: 1, message_id: 1 });
43
+ exports.MethodCalls.createIndex({ createdAt: 1 }, { expireAfterSeconds: 86400 });
50
44
  }
51
45
  else {
52
46
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/method-call.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,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,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;AACjD,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,KAAK,EAAC,CAAC,CAAC;AAItD,QAAA,WAAW,GAA0B,IAAI,CAAC;AAErD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,mBAAW,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;QAE/E,mBAAW,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACtD;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"method-call.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { MethodCallModel } from '../models/method-call.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\tid_user: {\n\t\ttype: String\n\t},\n\tmessage_id: {\n\t\ttype: String\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({id_user: 1, message_id: 1});\nDefaultSchema.index({createdAt: 1}, {expireAfterSeconds: 86400});\n\ninterface ResolveIOModel extends MethodCallModel, Document {}\n\nexport let MethodCalls: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tMethodCalls = ResolveIOServer.getMainDB().model('method-calls', DefaultSchema);\n\n\t\tMethodCalls['simplschema'] = new SimpleSchema(schema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/method-call.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,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;CACD,CAAC;AAES,QAAA,WAAW,GAAgC,IAAI,CAAC;AAE3D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAkB,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/E,mBAAW,GAAG,KAAK,CAAC,eAAe,CAAC;QACpC,mBAAW,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;QACrD,mBAAW,CAAC,WAAW,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,KAAK,EAAC,CAAC,CAAC;KACrE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"method-call.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { MethodCallModel } from '../models/method-call.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\tid_user: {\n\t\ttype: String\n\t},\n\tmessage_id: {\n\t\ttype: String\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t}\n};\n\nexport let MethodCalls: Collection<MethodCallModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<MethodCallModel>('method-calls', schema, false, false);\n\t\tMethodCalls = model.collection_main;\n\t\tMethodCalls.createIndex({id_user: 1, message_id: 1});\n\t\tMethodCalls.createIndex({createdAt: 1}, {expireAfterSeconds: 86400});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,6 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { MethodResponseModel } from '../models/method-response.model';
3
- interface ResolveIOModel extends MethodResponseModel, Document {
4
- }
5
- export declare let MethodResponses: Model<ResolveIOModel>;
6
- export {};
3
+ export declare let MethodResponses: Collection<MethodResponseModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodResponses = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
6
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
7
6
  var schema = {
8
7
  _id: {
9
8
  type: String,
@@ -38,19 +37,14 @@ var schema = {
38
37
  type: Date
39
38
  }
40
39
  };
41
- var DefaultSchema = new mongoose_1.Schema(schema, {
42
- skipVersioning: true,
43
- versionKey: false,
44
- timestamps: true
45
- });
46
- DefaultSchema.index({ id_user: 1, message_id: 1 });
47
- DefaultSchema.index({ createdAt: 1 }, { expireAfterSeconds: 86400 });
48
40
  exports.MethodResponses = null;
49
41
  initializeCollection();
50
42
  function initializeCollection() {
51
43
  if (index_1.ResolveIOServer.getMainDB()) {
52
- exports.MethodResponses = index_1.ResolveIOServer.getMainDB().model('method-responses', DefaultSchema);
53
- exports.MethodResponses['simplschema'] = new simpl_schema_1.default(schema);
44
+ var model = new mongo_manager_1.Model('method-responses', schema, false, false);
45
+ exports.MethodResponses = model.collection_main;
46
+ exports.MethodResponses.createIndex({ id_user: 1, message_id: 1 });
47
+ exports.MethodResponses.createIndex({ createdAt: 1 }, { expireAfterSeconds: 86400 });
54
48
  }
55
49
  else {
56
50
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/method-response.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,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,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,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;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;AACjD,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,KAAK,EAAC,CAAC,CAAC;AAItD,QAAA,eAAe,GAA0B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,uBAAe,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;QAEvF,uBAAe,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KAC1D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"method-response.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { MethodResponseModel } from '../models/method-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\tid_user: {\n\t\ttype: String\n\t},\n\tmessage_id: {\n\t\ttype: String\n\t},\n\tmethod: {\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\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({id_user: 1, message_id: 1});\nDefaultSchema.index({createdAt: 1}, {expireAfterSeconds: 86400});\n\ninterface ResolveIOModel extends MethodResponseModel, Document {}\n\nexport let MethodResponses: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tMethodResponses = ResolveIOServer.getMainDB().model('method-responses', DefaultSchema);\n\n\t\tMethodResponses['simplschema'] = new SimpleSchema(schema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/method-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,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,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,eAAe,GAAoC,IAAI,CAAC;AAEnE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAsB,kBAAkB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACvF,uBAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QACxC,uBAAe,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC;QACzD,uBAAe,CAAC,WAAW,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,KAAK,EAAC,CAAC,CAAC;KACzE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"method-response.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { MethodResponseModel } from '../models/method-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\tid_user: {\n\t\ttype: String\n\t},\n\tmessage_id: {\n\t\ttype: String\n\t},\n\tmethod: {\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 MethodResponses: Collection<MethodResponseModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<MethodResponseModel>('method-responses', schema, false, false);\n\t\tMethodResponses = model.collection_main;\n\t\tMethodResponses.createIndex({id_user: 1, message_id: 1});\n\t\tMethodResponses.createIndex({createdAt: 1}, {expireAfterSeconds: 86400});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { MonitorCPUModel } from '../models/monitor-cpu.model';
3
- interface ResolveIOModel extends MonitorCPUModel, Document {
4
- }
5
- export declare let MonitorCPUs: Model<ResolveIOModel>;
6
- export declare let MonitorCPUVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let MonitorCPUs: Collection<MonitorCPUModel>;