@resolveio/server-lib 8.1.35 → 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 +56 -9
  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,21 +1,9 @@
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.QueueMethodVersions = exports.QueueMethods = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.QueueMethods = void 0;
17
4
  var index_1 = require("../index");
18
- var mongooseSchema = {
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
6
+ var schema = {
19
7
  _id: {
20
8
  type: String,
21
9
  optional: true
@@ -61,72 +49,13 @@ var mongooseSchema = {
61
49
  type: String
62
50
  }
63
51
  };
64
- var DefaultSchema = new mongoose_1.Schema(mongooseSchema, {
65
- skipVersioning: true,
66
- versionKey: false,
67
- timestamps: true,
68
- minimize: false
69
- });
70
- DefaultSchema.index({ date: 1 }, { expireAfterSeconds: 60 });
71
52
  exports.QueueMethods = null;
72
- exports.QueueMethodVersions = null;
73
53
  initializeCollection();
74
54
  function initializeCollection() {
75
55
  if (index_1.ResolveIOServer.getMainDB()) {
76
- exports.QueueMethods = index_1.ResolveIOServer.getMainDB().model('queue-methods', DefaultSchema);
77
- var vSchema = __assign({}, mongooseSchema);
78
- vSchema._id = {
79
- type: mongoose_1.Schema.Types.Mixed
80
- };
81
- var VersionSchema = new mongoose_1.Schema(vSchema, {
82
- skipVersioning: true,
83
- versionKey: false,
84
- timestamps: true,
85
- minimize: false
86
- });
87
- exports.QueueMethods['versionCollection'] = 'queue-methods.versions';
88
- exports.QueueMethodVersions = index_1.ResolveIOServer.getMainDB().model(exports.QueueMethods['versionCollection'], VersionSchema);
89
- var simplSchema = {
90
- _id: {
91
- type: String,
92
- optional: true
93
- },
94
- __v: {
95
- type: Number,
96
- optional: true
97
- },
98
- updatedAt: {
99
- type: Date,
100
- optional: true
101
- },
102
- createdAt: {
103
- type: Date,
104
- optional: true
105
- },
106
- method: {
107
- type: String
108
- },
109
- method_data: {
110
- type: Array
111
- },
112
- 'method_data.$': {
113
- type: Object,
114
- blackbox: true
115
- },
116
- id_ws: {
117
- type: String
118
- },
119
- messageId: {
120
- type: Number
121
- },
122
- id_user: {
123
- type: String
124
- },
125
- user: {
126
- type: String
127
- }
128
- };
129
- exports.QueueMethods['simplschema'] = new simpl_schema_1.default(simplSchema);
56
+ var model = new mongo_manager_1.Model('queue-methods', schema, false, false);
57
+ exports.QueueMethods = model.collection_main;
58
+ exports.QueueMethods.createIndex({ date: 1 }, { expireAfterSeconds: 60 });
130
59
  }
131
60
  else {
132
61
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/queue-method.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,IAAI,cAAc,GAAQ;IACzB,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,KAAK,EAAE;QACN,IA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C,oBAAY,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE1G,IAAI,WAAW,GAAG;YACjB,GAAG,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,GAAG,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,SAAS,EAAE;gBACV,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,IAAI;aACd;YACD,SAAS,EAAE;gBACV,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,IAAI;aACd;YACD,MAAM,EAAE;gBACP,IAAI,EAAE,MAAM;aACZ;YACD,WAAW,EAAE;gBACZ,IAAI,EAAE,KAAK;aACX;YACD,eAAe,EAAE;gBAChB,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,KAAK,EAAE;gBACN,IAAI,EAAE,MAAM;aACZ;YACD,SAAS,EAAE;gBACV,IAAI,EAAE,MAAM;aACZ;YACD,OAAO,EAAE;gBACR,IAAI,EAAE,MAAM;aACZ;YACD,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;SACD,CAAC;QAEF,oBAAY,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,WAAW,CAAC,CAAC;KAC5D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-method.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { QueueMethodModel } from '../models/queue-method.model';\n\nlet mongooseSchema: 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\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\nconst DefaultSchema = new Schema(mongooseSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true,\n\tminimize: false\n});\n\nDefaultSchema.index({date: 1}, {expireAfterSeconds: 60});\n\ninterface ResolveIOModel extends QueueMethodModel, Document {}\n\nexport let QueueMethods: Model<ResolveIOModel> = null;\nexport let QueueMethodVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tQueueMethods = ResolveIOServer.getMainDB().model('queue-methods', DefaultSchema); \n\n\t\tlet vSchema = { ...mongooseSchema };\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\tminimize: false\n\t\t});\n\n\t\tQueueMethods['versionCollection'] = 'queue-methods.versions';\n\n\t\tQueueMethodVersions = ResolveIOServer.getMainDB().model(QueueMethods['versionCollection'], VersionSchema);\n\n\t\tlet simplSchema = {\n\t\t\t_id: {\n\t\t\t\ttype: String,\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\t__v: {\n\t\t\t\ttype: Number,\n\t\t\t\toptional: true \n\t\t\t},\n\t\t\tupdatedAt: {\n\t\t\t\ttype: Date,\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\tcreatedAt: {\n\t\t\t\ttype: Date,\n\t\t\t\toptional: true\n\t\t\t},\n\t\t\tmethod: {\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tmethod_data: {\n\t\t\t\ttype: Array\n\t\t\t},\n\t\t\t'method_data.$': {\n\t\t\t\ttype: Object,\n\t\t\t\tblackbox: true\n\t\t\t},\n\t\t\tid_ws: {\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tmessageId: {\n\t\t\t\ttype: Number\n\t\t\t},\n\t\t\tid_user: {\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: String\n\t\t\t}\n\t\t};\n\n\t\tQueueMethods['simplschema'] = new SimpleSchema(simplSchema);\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,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\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,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { QueueResponseModel } from '../models/queue-response.model';
3
- interface ResolveIOModel extends QueueResponseModel, Document {
4
- }
5
- export declare let QueueResponses: Model<ResolveIOModel>;
6
- export declare let QueueResponseVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let QueueResponses: Collection<QueueResponseModel>;
@@ -1,20 +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.QueueResponseVersions = exports.QueueResponses = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.QueueResponses = void 0;
17
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
18
6
  var schema = {
19
7
  _id: {
20
8
  type: String,
@@ -55,30 +43,13 @@ var schema = {
55
43
  type: Date
56
44
  }
57
45
  };
58
- var DefaultSchema = new mongoose_1.Schema(schema, {
59
- skipVersioning: true,
60
- versionKey: false,
61
- timestamps: true
62
- });
63
- DefaultSchema.index({ date: 1 }, { expireAfterSeconds: 60 });
64
46
  exports.QueueResponses = null;
65
- exports.QueueResponseVersions = null;
66
47
  initializeCollection();
67
48
  function initializeCollection() {
68
49
  if (index_1.ResolveIOServer.getMainDB()) {
69
- exports.QueueResponses = index_1.ResolveIOServer.getMainDB().model('queue-responses', DefaultSchema);
70
- var vSchema = __assign({}, schema);
71
- vSchema._id = {
72
- type: mongoose_1.Schema.Types.Mixed
73
- };
74
- var VersionSchema = new mongoose_1.Schema(vSchema, {
75
- skipVersioning: true,
76
- versionKey: false,
77
- timestamps: true
78
- });
79
- exports.QueueResponses['versionCollection'] = 'queue-responses.versions';
80
- exports.QueueResponseVersions = index_1.ResolveIOServer.getMainDB().model(exports.QueueResponses['versionCollection'], VersionSchema);
81
- exports.QueueResponses['simplschema'] = new simpl_schema_1.default(schema);
50
+ var model = new mongo_manager_1.Model('queue-responses', schema, false, false);
51
+ exports.QueueResponses = model.collection_main;
52
+ exports.QueueResponses.createIndex({ date: 1 }, { expireAfterSeconds: 60 });
82
53
  }
83
54
  else {
84
55
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/queue-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,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,E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EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"queue-response.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\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\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({date: 1}, {expireAfterSeconds: 60});\n\ninterface ResolveIOModel extends QueueResponseModel, Document {}\n\nexport let QueueResponses: Model<ResolveIOModel> = null;\nexport let QueueResponseVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tQueueResponses = ResolveIOServer.getMainDB().model('queue-responses', 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\tQueueResponses['versionCollection'] = 'queue-responses.versions';\n\n\t\tQueueResponseVersions = ResolveIOServer.getMainDB().model(QueueResponses['versionCollection'], VersionSchema);\n\n\t\tQueueResponses['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/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,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { ReportBuilderDashboardBuilderModel } from '../models/report-builder-dashboard-builder.model';
3
- interface ResolveIOModel extends ReportBuilderDashboardBuilderModel, Document {
4
- }
5
- export declare let ReportBuilderDashboardBuilders: Model<ResolveIOModel>;
6
- export declare let ReportBuilderDashboardBuilderVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let ReportBuilderDashboardBuilders: Collection<ReportBuilderDashboardBuilderModel>;
@@ -1,20 +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.ReportBuilderDashboardBuilderVersions = exports.ReportBuilderDashboardBuilders = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.ReportBuilderDashboardBuilders = void 0;
17
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
18
6
  var schema = {
19
7
  _id: {
20
8
  type: String,
@@ -87,31 +75,14 @@ var schema = {
87
75
  type: String
88
76
  },
89
77
  };
90
- var DefaultSchema = new mongoose_1.Schema(schema, {
91
- skipVersioning: true,
92
- versionKey: false,
93
- timestamps: true
94
- });
95
- DefaultSchema.index({ name: 1 });
96
- DefaultSchema.index({ date_created: 1 });
97
78
  exports.ReportBuilderDashboardBuilders = null;
98
- exports.ReportBuilderDashboardBuilderVersions = null;
99
79
  initializeCollection();
100
80
  function initializeCollection() {
101
81
  if (index_1.ResolveIOServer.getMainDB()) {
102
- exports.ReportBuilderDashboardBuilders = index_1.ResolveIOServer.getMainDB().model('report-builder-dashboard-builders', DefaultSchema);
103
- var vSchema = __assign({}, schema);
104
- vSchema._id = {
105
- type: mongoose_1.Schema.Types.Mixed
106
- };
107
- var VersionSchema = new mongoose_1.Schema(vSchema, {
108
- skipVersioning: true,
109
- versionKey: false,
110
- timestamps: true
111
- });
112
- exports.ReportBuilderDashboardBuilders['versionCollection'] = 'report-builder-dashboard-builders.versions';
113
- exports.ReportBuilderDashboardBuilderVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderDashboardBuilders['versionCollection'], VersionSchema);
114
- exports.ReportBuilderDashboardBuilders['simplschema'] = new simpl_schema_1.default(schema);
82
+ var model = new mongo_manager_1.Model('report-builder-dashboard-builders', schema, false, false);
83
+ exports.ReportBuilderDashboardBuilders = model.collection_main;
84
+ exports.ReportBuilderDashboardBuilders.createIndex({ name: 1 });
85
+ exports.ReportBuilderDashboardBuilders.createIndex({ date_created: 1 });
115
86
  }
116
87
  else {
117
88
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/report-builder-dashboard-builder.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,YAAY,EAAE;QACb,IAAI,EAAE,IAAI;KACV;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;KACZ;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,8BAA8B,EAAE;QAC/B,IAAI,EAAE,KAAK;KACX;IACD,gCAAgC,EAAE;QACjC,IAAI,EAAE,MAAM;KACZ;IACD,0CAA0C,EAAE;QAC3C,IAAI,EAAE,MAAM;KAC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BAAmB,CAAC,GAAG,4CAA4C,CAAC;QAEnG,6CAAqC,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,sCAA8B,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE9I,sCAA8B,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACzE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-dashboard-builder.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { ReportBuilderDashboardBuilderModel } from '../models/report-builder-dashboard-builder.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\tdate_created: {\n\t\ttype: Date\n\t},\n\tid_user_created: {\n\t\ttype: String\n\t},\n\tuser_created: {\n\t\ttype: String\n\t},\n\tnum_rows: {\n\t\ttype: Number\n\t},\n\tnum_columns: {\n\t\ttype: Number\n\t},\n\treport_rows: {\n\t\ttype: Array\n\t},\n\t'report_rows.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns.$.id_report': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_name': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_values': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$.display_values.$': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_text': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_value': {\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({name: 1});\nDefaultSchema.index({date_created: 1});\n\ninterface ResolveIOModel extends ReportBuilderDashboardBuilderModel, Document {}\n\nexport let ReportBuilderDashboardBuilders: Model<ResolveIOModel> = null;\nexport let ReportBuilderDashboardBuilderVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tReportBuilderDashboardBuilders = ResolveIOServer.getMainDB().model('report-builder-dashboard-builders', 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\tReportBuilderDashboardBuilders['versionCollection'] = 'report-builder-dashboard-builders.versions';\n\n\t\tReportBuilderDashboardBuilderVersions = ResolveIOServer.getMainDB().model(ReportBuilderDashboardBuilders['versionCollection'], VersionSchema);\n\n\t\tReportBuilderDashboardBuilders['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/report-builder-dashboard-builder.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,IA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CAAqC,mCAAmC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACvH,sCAA8B,GAAG,KAAK,CAAC,eAAe,CAAC;QACvD,sCAA8B,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QACtD,sCAA8B,CAAC,WAAW,CAAC,EAAC,YAAY,EAAE,CAAC,EAAC,CAAC,CAAC;KAC9D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-dashboard-builder.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { ReportBuilderDashboardBuilderModel } from '../models/report-builder-dashboard-builder.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\tdate_created: {\n\t\ttype: Date\n\t},\n\tid_user_created: {\n\t\ttype: String\n\t},\n\tuser_created: {\n\t\ttype: String\n\t},\n\tnum_rows: {\n\t\ttype: Number\n\t},\n\tnum_columns: {\n\t\ttype: Number\n\t},\n\treport_rows: {\n\t\ttype: Array\n\t},\n\t'report_rows.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns.$.id_report': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_name': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_values': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$.display_values.$': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_text': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_value': {\n\t\ttype: String\n\t},\n};\n\nexport let ReportBuilderDashboardBuilders: Collection<ReportBuilderDashboardBuilderModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<ReportBuilderDashboardBuilderModel>('report-builder-dashboard-builders', schema, false, false);\n\t\tReportBuilderDashboardBuilders = model.collection_main;\n\t\tReportBuilderDashboardBuilders.createIndex({name: 1});\n\t\tReportBuilderDashboardBuilders.createIndex({date_created: 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 { ReportBuilderLibraryModel } from '../models/report-builder-library.model';
3
- interface ResolveIOModel extends ReportBuilderLibraryModel, Document {
4
- }
5
- export declare let ReportBuilderLibraries: Model<ResolveIOModel>;
6
- export declare let ReportBuilderLibraryVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let ReportBuilderLibraries: Collection<ReportBuilderLibraryModel>;
@@ -1,20 +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.ReportBuilderLibraryVersions = exports.ReportBuilderLibraries = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.ReportBuilderLibraries = void 0;
17
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
18
6
  var schema = {
19
7
  _id: {
20
8
  type: String,
@@ -69,32 +57,15 @@ var schema = {
69
57
  type: String
70
58
  }
71
59
  };
72
- var DefaultSchema = new mongoose_1.Schema(schema, {
73
- skipVersioning: true,
74
- versionKey: false,
75
- timestamps: true
76
- });
77
- DefaultSchema.index({ name: 1 });
78
- DefaultSchema.index({ id_user_create: 1 });
79
- DefaultSchema.index({ 'user_groups.id_user_group': 1 });
80
60
  exports.ReportBuilderLibraries = null;
81
- exports.ReportBuilderLibraryVersions = null;
82
61
  initializeCollection();
83
62
  function initializeCollection() {
84
63
  if (index_1.ResolveIOServer.getMainDB()) {
85
- exports.ReportBuilderLibraries = index_1.ResolveIOServer.getMainDB().model('report-builder-libraries', DefaultSchema);
86
- var vSchema = __assign({}, schema);
87
- vSchema._id = {
88
- type: mongoose_1.Schema.Types.Mixed
89
- };
90
- var VersionSchema = new mongoose_1.Schema(vSchema, {
91
- skipVersioning: true,
92
- versionKey: false,
93
- timestamps: true
94
- });
95
- exports.ReportBuilderLibraries['versionCollection'] = 'report-builder-libraries.versions';
96
- exports.ReportBuilderLibraryVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderLibraries['versionCollection'], VersionSchema);
97
- exports.ReportBuilderLibraries['simplschema'] = new simpl_schema_1.default(schema);
64
+ var model = new mongo_manager_1.Model('report-builder-libraries', schema, false, false);
65
+ exports.ReportBuilderLibraries = model.collection_main;
66
+ exports.ReportBuilderLibraries.createIndex({ name: 1 });
67
+ exports.ReportBuilderLibraries.createIndex({ id_user_create: 1 });
68
+ exports.ReportBuilderLibraries.createIndex({ 'user_groups.id_user_group': 1 });
98
69
  }
99
70
  else {
100
71
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/report-builder-library.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAmD;AACnD,6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,2BAA2B,EAAE,CAAC,EAAC,CAAC,CAAC;AAI3C,QAAA,sBAAsB,GAA0B,IAAI,CAAC;AACrD,QAAA,4BAA4B,GAA0B,IAAI,CAAC;AAEtE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,8BAAsB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;QAEtG,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,8BAAsB,CAAC,mBAAmB,CAAC,GAAG,mCAAmC,CAAC;QAElF,oCAA4B,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,8BAAsB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE7H,8BAAsB,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACjE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-library.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { ReportBuilderLibraryModel } from '../models/report-builder-library.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\tid_user_create: {\n\t\ttype: String\n\t},\n\tuser_create: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t},\n\treports: {\n\t\ttype: Array\n\t},\n\t'reports.$': {\n\t\ttype: Object\n\t},\n\t'reports.$.id_report': {\n\t\ttype: String\n\t},\n\t'reports.$.report': {\n\t\ttype: String\n\t},\n\tuser_groups: {\n\t\ttype: Array\n\t},\n\t'user_groups.$': {\n\t\ttype: Object\n\t},\n\t'user_groups.$.id_user_group': {\n\t\ttype: String\n\t},\n\t'user_groups.$.user_group': {\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({name: 1});\nDefaultSchema.index({id_user_create: 1});\nDefaultSchema.index({'user_groups.id_user_group': 1});\n\ninterface ResolveIOModel extends ReportBuilderLibraryModel, Document {}\n\nexport let ReportBuilderLibraries: Model<ResolveIOModel> = null;\nexport let ReportBuilderLibraryVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tReportBuilderLibraries = ResolveIOServer.getMainDB().model('report-builder-libraries', 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\tReportBuilderLibraries['versionCollection'] = 'report-builder-libraries.versions';\n\n\t\tReportBuilderLibraryVersions = ResolveIOServer.getMainDB().model(ReportBuilderLibraries['versionCollection'], VersionSchema);\n\n\t\tReportBuilderLibraries['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/report-builder-library.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,cAAc,EAAE;QACf,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,IAAI;KACV;IACD,OAAO,EAAE;QACR,IAAI,EAAE,KAAK;KACX;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,MAAM;KACZ;IACD,kBAAkB,EAAE;QACnB,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,6BAA6B,EAAE;QAC9B,IAAI,EAAE,MAAM;KACZ;IACD,0BAA0B,EAAE;QAC3B,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAIS,QAAA,sBAAsB,GAA0C,IAAI,CAAC;AAEhF,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAA4B,0BAA0B,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACrG,8BAAsB,GAAG,KAAK,CAAC,eAAe,CAAC;QAC/C,8BAAsB,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAC9C,8BAAsB,CAAC,WAAW,CAAC,EAAC,cAAc,EAAE,CAAC,EAAC,CAAC,CAAC;QACxD,8BAAsB,CAAC,WAAW,CAAC,EAAC,2BAA2B,EAAE,CAAC,EAAC,CAAC,CAAC;KACrE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-library.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { ReportBuilderLibraryModel } from '../models/report-builder-library.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\tid_user_create: {\n\t\ttype: String\n\t},\n\tuser_create: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t},\n\treports: {\n\t\ttype: Array\n\t},\n\t'reports.$': {\n\t\ttype: Object\n\t},\n\t'reports.$.id_report': {\n\t\ttype: String\n\t},\n\t'reports.$.report': {\n\t\ttype: String\n\t},\n\tuser_groups: {\n\t\ttype: Array\n\t},\n\t'user_groups.$': {\n\t\ttype: Object\n\t},\n\t'user_groups.$.id_user_group': {\n\t\ttype: String\n\t},\n\t'user_groups.$.user_group': {\n\t\ttype: String\n\t}\n};\n\n\n\nexport let ReportBuilderLibraries: Collection<ReportBuilderLibraryModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<ReportBuilderLibraryModel>('report-builder-libraries', schema, false, false);\n\t\tReportBuilderLibraries = model.collection_main;\n\t\tReportBuilderLibraries.createIndex({name: 1});\n\t\tReportBuilderLibraries.createIndex({id_user_create: 1});\n\t\tReportBuilderLibraries.createIndex({'user_groups.id_user_group': 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 { ReportBuilderReportModel } from '../models/report-builder-report.model';
3
- interface ResolveIOModel extends ReportBuilderReportModel, Document {
4
- }
5
- export declare let ReportBuilderReports: Model<ResolveIOModel>;
6
- export declare let ReportBuilderReportVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let ReportBuilderReports: Collection<ReportBuilderReportModel>;
@@ -1,20 +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.ReportBuilderReportVersions = exports.ReportBuilderReports = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.ReportBuilderReports = void 0;
17
4
  var index_1 = require("../index");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
18
6
  var schema = {
19
7
  _id: {
20
8
  type: String,
@@ -129,32 +117,15 @@ var schema = {
129
117
  optional: true
130
118
  }
131
119
  };
132
- var DefaultSchema = new mongoose_1.Schema(schema, {
133
- skipVersioning: true,
134
- versionKey: false,
135
- timestamps: true
136
- });
137
- DefaultSchema.index({ id_user: 1 });
138
- DefaultSchema.index({ shared_users: 1 });
139
- DefaultSchema.index({ report_name: 1, collection_root: 1 });
140
120
  exports.ReportBuilderReports = null;
141
- exports.ReportBuilderReportVersions = null;
142
121
  initializeCollection();
143
122
  function initializeCollection() {
144
123
  if (index_1.ResolveIOServer.getMainDB()) {
145
- exports.ReportBuilderReports = index_1.ResolveIOServer.getMainDB().model('report-builder-reports', DefaultSchema);
146
- var vSchema = __assign({}, schema);
147
- vSchema._id = {
148
- type: mongoose_1.Schema.Types.Mixed
149
- };
150
- var VersionSchema = new mongoose_1.Schema(vSchema, {
151
- skipVersioning: true,
152
- versionKey: false,
153
- timestamps: true
154
- });
155
- exports.ReportBuilderReports['versionCollection'] = 'report-builder-reports.versions';
156
- exports.ReportBuilderReportVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderReports['versionCollection'], VersionSchema);
157
- exports.ReportBuilderReports['simplschema'] = new simpl_schema_1.default(schema);
124
+ var model = new mongo_manager_1.Model('report-builder-reports', schema, true, false);
125
+ exports.ReportBuilderReports = model.collection_main;
126
+ exports.ReportBuilderReports.createIndex({ id_user: 1 });
127
+ exports.ReportBuilderReports.createIndex({ shared_users: 1 });
128
+ exports.ReportBuilderReports.createIndex({ report_name: 1, collection_root: 1 });
158
129
  }
159
130
  else {
160
131
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/report-builder-report.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,eAAe,E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jB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,4BAAoB,CAAC,mBAAmB,CAAC,GAAG,iCAAiC,CAAC;QAE9E,mCAA2B,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,4BAAoB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE1H,4BAAoB,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KAC/D;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-report.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { ReportBuilderReportModel } from '../models/report-builder-report.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\tcollection_root: {\n\t\ttype: String\n\t},\n\treport_name: {\n\t\ttype: String\n\t},\n\tfields_sort: {\n\t\ttype: Array\n\t},\n\t'fields_sort.$': {\n\t\ttype: Object\n\t},\n\t'fields_sort.$.field': {\n\t\ttype: String\n\t},\n\t'fields_sort.$.order': {\n\t\ttype: String\n\t},\n\tfields_filter: {\n\t\ttype: Array\n\t},\n\t'fields_filter.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_custom: {\n\t\ttype: Array\n\t},\n\t'fields_custom.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_selected: {\n\t\ttype: Array\n\t},\n\t'fields_selected.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_total: {\n\t\ttype: Array\n\t},\n\t'fields_total.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_link: {\n\t\ttype: Array\n\t},\n\t'fields_link.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tdate_created: {\n\t\ttype: Date\n\t},\n\tshared_users: {\n\t\ttype: Array\n\t},\n\t'shared_users.$': {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\tgroups_row: {\n\t\ttype: Array\n\t},\n\t'groups_row.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroups_column: {\n\t\ttype: Array\n\t},\n\t'groups_column.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroup_type: {\n\t\ttype: String\n\t},\n\tid_date_field: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdate_interval: {\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({id_user: 1});\nDefaultSchema.index({shared_users: 1});\nDefaultSchema.index({report_name: 1, collection_root: 1});\n\ninterface ResolveIOModel extends ReportBuilderReportModel, Document {}\n\nexport let ReportBuilderReports: Model<ResolveIOModel> = null;\nexport let ReportBuilderReportVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tReportBuilderReports = ResolveIOServer.getMainDB().model('report-builder-reports', 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\tReportBuilderReports['versionCollection'] = 'report-builder-reports.versions';\n\n\t\tReportBuilderReportVersions = ResolveIOServer.getMainDB().model(ReportBuilderReports['versionCollection'], VersionSchema);\n\n\t\tReportBuilderReports['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/report-builder-report.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,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,MAAM;KACZ;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,MAAM;KACZ;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,YAAY,EAAE;QACb,IAAI,EAAE,KA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CAAC,EAAC,CAAC,CAAC;QAC/C,4BAAoB,CAAC,WAAW,CAAC,EAAC,YAAY,EAAE,CAAC,EAAC,CAAC,CAAC;QACpD,4BAAoB,CAAC,WAAW,CAAC,EAAC,WAAW,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAC,CAAC,CAAC;KACvE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"report-builder-report.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { ReportBuilderReportModel } from '../models/report-builder-report.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\tcollection_root: {\n\t\ttype: String\n\t},\n\treport_name: {\n\t\ttype: String\n\t},\n\tfields_sort: {\n\t\ttype: Array\n\t},\n\t'fields_sort.$': {\n\t\ttype: Object\n\t},\n\t'fields_sort.$.field': {\n\t\ttype: String\n\t},\n\t'fields_sort.$.order': {\n\t\ttype: String\n\t},\n\tfields_filter: {\n\t\ttype: Array\n\t},\n\t'fields_filter.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_custom: {\n\t\ttype: Array\n\t},\n\t'fields_custom.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_selected: {\n\t\ttype: Array\n\t},\n\t'fields_selected.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_total: {\n\t\ttype: Array\n\t},\n\t'fields_total.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_link: {\n\t\ttype: Array\n\t},\n\t'fields_link.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tdate_created: {\n\t\ttype: Date\n\t},\n\tshared_users: {\n\t\ttype: Array\n\t},\n\t'shared_users.$': {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\tgroups_row: {\n\t\ttype: Array\n\t},\n\t'groups_row.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroups_column: {\n\t\ttype: Array\n\t},\n\t'groups_column.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroup_type: {\n\t\ttype: String\n\t},\n\tid_date_field: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdate_interval: {\n\t\ttype: String,\n\t\toptional: true\n\t}\n};\n\nexport let ReportBuilderReports: Collection<ReportBuilderReportModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<ReportBuilderReportModel>('report-builder-reports', schema, true, false);\n\t\tReportBuilderReports = model.collection_main;\n\t\tReportBuilderReports.createIndex({id_user: 1});\n\t\tReportBuilderReports.createIndex({shared_users: 1});\n\t\tReportBuilderReports.createIndex({report_name: 1, collection_root: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,7 +1,4 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { UserGroupModel } from '../models/user-group.model';
3
- interface ResolveIOModel extends UserGroupModel, Document {
4
- }
5
- export declare let UserGroups: Model<ResolveIOModel>;
6
- export declare let UserGroupVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let UserGroups: Collection<UserGroupModel>;
4
+ export declare let UserGroupVersions: Collection<UserGroupModel>;
@@ -1,21 +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
3
  exports.UserGroupVersions = exports.UserGroups = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
17
4
  var index_1 = require("../index");
18
- var common_1 = require("../util/common");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
19
6
  var schema = {
20
7
  _id: {
21
8
  type: String,
@@ -73,35 +60,15 @@ var schema = {
73
60
  type: Boolean
74
61
  }
75
62
  };
76
- var DefaultSchema = new mongoose_1.Schema(schema, {
77
- skipVersioning: true,
78
- versionKey: false,
79
- timestamps: true
80
- });
81
- DefaultSchema.index({ name: 1 });
82
63
  exports.UserGroups = null;
83
64
  exports.UserGroupVersions = null;
84
65
  initializeCollection();
85
66
  function initializeCollection() {
86
67
  if (index_1.ResolveIOServer.getMainDB()) {
87
- exports.UserGroups = index_1.ResolveIOServer.getMainDB().model('user-groups', DefaultSchema);
88
- var vSchema = __assign({}, schema);
89
- vSchema._id = {
90
- type: mongoose_1.Schema.Types.Mixed
91
- };
92
- var VersionSchema = new mongoose_1.Schema(vSchema, {
93
- skipVersioning: true,
94
- versionKey: false,
95
- timestamps: true
96
- });
97
- VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
98
- exports.UserGroups['versionCollection'] = 'user-groups.versions';
99
- exports.UserGroupVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGroups['versionCollection'], VersionSchema);
100
- exports.UserGroups['simplschema'] = new simpl_schema_1.default(schema);
101
- //------------- Report Builder Schema
102
- var rbLookups = [];
103
- var rbSchema = Object.assign(schema, common_1.buildRbLookups(rbLookups, DefaultSchema, []));
104
- exports.UserGroups['rbSchema'] = common_1.buildRbSchema(rbSchema);
68
+ var model = new mongo_manager_1.Model('user-groups', schema, true, true, []);
69
+ exports.UserGroups = model.collection_main;
70
+ exports.UserGroups.createIndex({ name: 1 });
71
+ exports.UserGroupVersions = model.collection_version;
105
72
  }
106
73
  else {
107
74
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-group.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,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;AAEF,IAAM,aAAa,GAAG,IA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,EAAE,CAAC,CAAC,CAAC;QACnF,kBAAU,CAAC,UAAU,CAAC,GAAG,sBAAa,CAAC,QAAQ,CAAC,CAAC;KACjD;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserGroupModel } from '../models/user-group.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\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\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.index({name: 1});\n\ninterface ResolveIOModel extends UserGroupModel, Document {}\n\nexport let UserGroups: Model<ResolveIOModel> = null;\nexport let UserGroupVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUserGroups = ResolveIOServer.getMainDB().model('user-groups', 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\tVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\n\t\tUserGroups['versionCollection'] = 'user-groups.versions';\n\n\t\tUserGroupVersions = ResolveIOServer.getMainDB().model(UserGroups['versionCollection'], VersionSchema);\n\n\t\tUserGroups['simplschema'] = new SimpleSchema(schema);\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\tUserGroups['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/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,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { UserGuideModel } from '../models/user-guide.model';
3
- interface ResolveIOModel extends UserGuideModel, Document {
4
- }
5
- export declare let UserGuides: Model<ResolveIOModel>;
6
- export declare let UserGuideVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let UserGuides: Collection<UserGuideModel>;