@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,7 +1,3 @@
1
- import { Model, Document } from 'mongoose';
1
+ import { Collection } from '../managers/mongo.manager';
2
2
  import { AppStatusModel } from '../models/app-status.model';
3
- interface ResolveIOModel extends AppStatusModel, Document {
4
- }
5
- export declare let AppStatus: Model<ResolveIOModel>;
6
- export declare let AppStatusVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let AppStatus: Collection<AppStatusModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppStatusVersions = exports.AppStatus = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.AppStatus = 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,
@@ -25,28 +24,12 @@ var schema = {
25
24
  type: String
26
25
  }
27
26
  };
28
- var DefaultSchema = new mongoose_1.Schema(schema, {
29
- skipVersioning: true,
30
- versionKey: false,
31
- timestamps: true
32
- });
33
27
  exports.AppStatus = null;
34
- exports.AppStatusVersions = null;
35
28
  initializeCollection();
36
29
  function initializeCollection() {
37
30
  if (index_1.ResolveIOServer.getMainDB()) {
38
- exports.AppStatus = index_1.ResolveIOServer.getMainDB().model('app-statuses', DefaultSchema);
39
- exports.AppStatus['simplschema'] = new simpl_schema_1.default(schema);
40
- schema._id = {
41
- type: mongoose_1.Schema.Types.Mixed
42
- };
43
- var VersionSchema = new mongoose_1.Schema(schema, {
44
- skipVersioning: true,
45
- versionKey: false,
46
- timestamps: true
47
- });
48
- exports.AppStatus['versionCollection'] = 'app-statuses.versions';
49
- index_1.ResolveIOServer.getMainDB().model(exports.AppStatus['versionCollection'], VersionSchema);
31
+ var model = new mongo_manager_1.Model('app-statuses', schema, false, false);
32
+ exports.AppStatus = model.collection_main;
50
33
  }
51
34
  else {
52
35
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/app-status.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;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,SAAS,GAA0B,IAAI,CAAC;AACxC,QAAA,iBAAiB,GAA0B,IAAI,CAAC;AAE3D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,iBAAS,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;QAE7E,iBAAS,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAEpD,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,iBAAS,CAAC,mBAAmB,CAAC,GAAG,uBAAuB,CAAC;QAEzD,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,iBAAS,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KACjF;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"app-status.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { AppStatusModel } from '../models/app-status.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\tmessage: {\n\t\ttype: String\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends AppStatusModel, Document {}\n\nexport let AppStatus: Model<ResolveIOModel> = null;\nexport let AppStatusVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tAppStatus = ResolveIOServer.getMainDB().model('app-statuses', DefaultSchema);\n\n\t\tAppStatus['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\tAppStatus['versionCollection'] = 'app-statuses.versions';\n\n\t\tResolveIOServer.getMainDB().model(AppStatus['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/app-status.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;CACD,CAAC;AAES,QAAA,SAAS,GAA+B,IAAI,CAAC;AAExD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9E,iBAAS,GAAG,KAAK,CAAC,eAAe,CAAC;KAClC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"app-status.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { AppStatusModel } from '../models/app-status.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\tmessage: {\n\t\ttype: String\n\t}\n};\n\nexport let AppStatus: Collection<AppStatusModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<AppStatusModel>('app-statuses', schema, false, false);\n\t\tAppStatus = 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 { AppVersionModel } from '../models/app-version.model';
3
- interface ResolveIOModel extends AppVersionModel, Document {
4
- }
5
- export declare let AppVersions: Model<ResolveIOModel>;
6
- export declare let AppVersionVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let AppVersions: Collection<AppVersionModel>;
@@ -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.AppVersionVersions = exports.AppVersions = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.AppVersions = 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,
@@ -36,30 +24,12 @@ var schema = {
36
24
  type: Number
37
25
  }
38
26
  };
39
- var DefaultSchema = new mongoose_1.Schema(schema, {
40
- skipVersioning: true,
41
- versionKey: false,
42
- timestamps: true
43
- });
44
27
  exports.AppVersions = null;
45
- exports.AppVersionVersions = null;
46
28
  initializeCollection();
47
29
  function initializeCollection() {
48
30
  if (index_1.ResolveIOServer.getMainDB()) {
49
- exports.AppVersions = index_1.ResolveIOServer.getMainDB().model('app-versions', DefaultSchema);
50
- var checkSchema = __assign({}, schema);
51
- checkSchema._id = {
52
- type: mongoose_1.Schema.Types.Mixed
53
- };
54
- var VersionSchema = new mongoose_1.Schema(checkSchema, {
55
- skipVersioning: true,
56
- versionKey: false,
57
- timestamps: true
58
- });
59
- exports.AppVersions['versionCollection'] = 'app-versions.versions';
60
- exports.AppVersionVersions = index_1.ResolveIOServer.getMainDB().model(exports.AppVersions['versionCollection'], VersionSchema);
61
- schema.version.type = simpl_schema_1.default.Integer;
62
- exports.AppVersions['simplschema'] = new simpl_schema_1.default(schema);
31
+ var model = new mongo_manager_1.Model('app-versions', schema, false, false);
32
+ exports.AppVersions = model.collection_main;
63
33
  }
64
34
  else {
65
35
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/app-version.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;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;AAGQ,QAAA,WAAW,GAA0B,IAAI,CAAC;AAC1C,QAAA,kBAAkB,GAA0B,IAAI,CAAC;AAE5D,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,IAAI,WAAW,gBAAQ,MAAM,CAAE,CAAC;QAEhC,WAAW,CAAC,GAAG,GAAG;YACjB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,WAAW,EAAE;YAC3C,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,mBAAW,CAAC,mBAAmB,CAAC,GAAG,uBAAuB,CAAC;QAE3D,0BAAkB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,mBAAW,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAExG,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,sBAAY,CAAC,OAAO,CAAC;QAE3C,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":"app-version.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { AppVersionModel } from '../models/app-version.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\tversion: {\n\t\ttype: Number\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends AppVersionModel, Document {}\nexport let AppVersions: Model<ResolveIOModel> = null;\nexport let AppVersionVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tAppVersions = ResolveIOServer.getMainDB().model('app-versions', DefaultSchema);\n\n\t\tlet checkSchema = { ...schema };\n\n\t\tcheckSchema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(checkSchema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tAppVersions['versionCollection'] = 'app-versions.versions';\n\n\t\tAppVersionVersions = ResolveIOServer.getMainDB().model(AppVersions['versionCollection'], VersionSchema);\n\n\t\tschema.version.type = SimpleSchema.Integer;\n\n\t\tAppVersions['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/app-version.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;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;KACpC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"app-version.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { AppVersionModel } from '../models/app-version.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\tversion: {\n\t\ttype: Number\n\t}\n};\n\nexport let AppVersions: Collection<AppVersionModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<AppVersionModel>('app-versions', schema, false, false);\n\t\tAppVersions = 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 { CounterModel } from '../models/counter.model';
3
- interface ResolveIOModel extends CounterModel, Document {
4
- }
5
- export declare let Counters: Model<ResolveIOModel>;
6
- export declare let CounterVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let Counters: Collection<CounterModel>;
@@ -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.CounterVersions = exports.Counters = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.Counters = 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,
@@ -39,30 +27,12 @@ var schema = {
39
27
  type: Number
40
28
  }
41
29
  };
42
- var DefaultSchema = new mongoose_1.Schema(schema, {
43
- skipVersioning: true,
44
- versionKey: false,
45
- timestamps: true
46
- });
47
30
  exports.Counters = null;
48
- exports.CounterVersions = null;
49
31
  initializeCollection();
50
32
  function initializeCollection() {
51
33
  if (index_1.ResolveIOServer.getMainDB()) {
52
- exports.Counters = index_1.ResolveIOServer.getMainDB().model('counters', DefaultSchema);
53
- var checkSchema = __assign({}, schema);
54
- checkSchema._id = {
55
- type: mongoose_1.Schema.Types.Mixed
56
- };
57
- var VersionSchema = new mongoose_1.Schema(checkSchema, {
58
- skipVersioning: true,
59
- versionKey: false,
60
- timestamps: true
61
- });
62
- exports.Counters['versionCollection'] = 'counters.versions';
63
- exports.CounterVersions = index_1.ResolveIOServer.getMainDB().model(exports.Counters['versionCollection'], VersionSchema);
64
- schema.count.type = simpl_schema_1.default.Integer;
65
- exports.Counters['simplschema'] = new simpl_schema_1.default(schema);
34
+ var model = new mongo_manager_1.Model('counters', schema, false, false);
35
+ exports.Counters = model.collection_main;
66
36
  }
67
37
  else {
68
38
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/counter.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,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;AAIQ,QAAA,QAAQ,GAA0B,IAAI,CAAC;AACvC,QAAA,eAAe,GAA0B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,gBAAQ,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAExE,IAAI,WAAW,gBAAQ,MAAM,CAAE,CAAC;QAEhC,WAAW,CAAC,GAAG,GAAG;YACjB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,WAAW,EAAE;YAC3C,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,gBAAQ,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;QAEpD,uBAAe,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAQ,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAElG,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,sBAAY,CAAC,OAAO,CAAC;QACzC,gBAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACnD;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"counter.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { CounterModel } from '../models/counter.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\tcount: {\n\t\ttype: Number\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends CounterModel, Document {}\n\nexport let Counters: Model<ResolveIOModel> = null;\nexport let CounterVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tCounters = ResolveIOServer.getMainDB().model('counters', DefaultSchema);\n\n\t\tlet checkSchema = { ...schema };\n\n\t\tcheckSchema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(checkSchema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tCounters['versionCollection'] = 'counters.versions';\n\n\t\tCounterVersions = ResolveIOServer.getMainDB().model(Counters['versionCollection'], VersionSchema);\n\n\t\tschema.count.type = SimpleSchema.Integer;\n\t\tCounters['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/counter.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,QAAQ,GAA6B,IAAI,CAAC;AAErD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAe,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACxE,gBAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;KACjC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"counter.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { CounterModel } from '../models/counter.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\tcount: {\n\t\ttype: Number\n\t}\n};\n\nexport let Counters: Collection<CounterModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<CounterModel>('counters', schema, false, false);\n\t\tCounters = 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';
2
- import { CronJobModel } from '../models/cron-job.model';
3
- interface ResolveIOModel extends CronJobModel, Document {
4
- }
5
- export declare let CronJobHistory: Model<ResolveIOModel>;
6
- export declare let CronJobHistoryVersions: Model<ResolveIOModel>;
7
- export {};
1
+ import { Collection } from '../managers/mongo.manager';
2
+ import { CronJobHistoryModel } from '../models/cron-job-history.model';
3
+ export declare let CronJobHistory: Collection<CronJobHistoryModel>;
@@ -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.CronJobHistoryVersions = exports.CronJobHistory = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.CronJobHistory = 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,
@@ -66,30 +54,13 @@ var schema = {
66
54
  type: Date
67
55
  }
68
56
  };
69
- var DefaultSchema = new mongoose_1.Schema(schema, {
70
- skipVersioning: true,
71
- versionKey: false,
72
- timestamps: true
73
- });
74
- DefaultSchema.index({ createdAt: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 7 });
75
57
  exports.CronJobHistory = null;
76
- exports.CronJobHistoryVersions = null;
77
58
  initializeCollection();
78
59
  function initializeCollection() {
79
60
  if (index_1.ResolveIOServer.getMainDB()) {
80
- exports.CronJobHistory = index_1.ResolveIOServer.getMainDB().model('cron-job-histories', DefaultSchema);
81
- var vSchema = __assign({}, schema);
82
- vSchema._id = {
83
- type: mongoose_1.Schema.Types.Mixed
84
- };
85
- var VersionSchema = new mongoose_1.Schema(vSchema, {
86
- skipVersioning: true,
87
- versionKey: false,
88
- timestamps: true
89
- });
90
- exports.CronJobHistory['versionCollection'] = 'cron-job-histories.versions';
91
- exports.CronJobHistoryVersions = index_1.ResolveIOServer.getMainDB().model(exports.CronJobHistory['versionCollection'], VersionSchema);
92
- exports.CronJobHistory['simplschema'] = new simpl_schema_1.default(schema);
61
+ var model = new mongo_manager_1.Model('cron-job-histories', schema, false, false);
62
+ exports.CronJobHistory = model.collection_main;
63
+ exports.CronJobHistory.createIndex({ createdAt: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 7 });
93
64
  }
94
65
  else {
95
66
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/cron-job-history.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,UAAU,EAAE;QACX,IAAI,EAAE,OAAO;KACb;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;KACV;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,OAAO;KACb;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,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,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC,CAAC;AAIjE,QAAA,cAAc,GAA0B,IAAI,CAAC;AAC7C,QAAA,sBAAsB,GAA0B,IAAI,CAAC;AAEhE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,sBAAc,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;QAExF,IAAI,OAAO,gBAAQ,MAAM,CAAE,CAAC;QAE5B,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,sBAAc,CAAC,mBAAmB,CAAC,GAAG,6BAA6B,CAAC;QAEpE,8BAAsB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,sBAAc,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE/G,sBAAc,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACzD;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"cron-job-history.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { CronJobModel } from '../models/cron-job.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\treoccuring: {\n\t\ttype: Boolean\n\t},\n\ttime_to_run: {\n\t\ttype: String\n\t},\n\tmethod_name: {\n\t\ttype: String\n\t},\n\tlast_run: {\n\t\ttype: Date\n\t},\n\tnext_run: {\n\t\ttype: Date\n\t},\n\tid_cronjob: {\n\t\ttype: String\n\t},\n\tpassed: {\n\t\ttype: Boolean\n\t},\n\terror: {\n\t\ttype: String\n\t},\n\tstart_time: {\n\t\ttype: Date\n\t},\n\tend_time: {\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({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 7});\n\ninterface ResolveIOModel extends CronJobModel, Document {}\n\nexport let CronJobHistory: Model<ResolveIOModel> = null;\nexport let CronJobHistoryVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tCronJobHistory = ResolveIOServer.getMainDB().model('cron-job-histories', DefaultSchema);\n\n\t\tlet vSchema = { ...schema };\n\t\t\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\tCronJobHistory['versionCollection'] = 'cron-job-histories.versions';\n\n\t\tCronJobHistoryVersions = ResolveIOServer.getMainDB().model(CronJobHistory['versionCollection'], VersionSchema);\n\n\t\tCronJobHistory['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/cron-job-history.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,UAAU,EAAE;QACX,IAAI,EAAE,OAAO;KACb;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;KACV;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,OAAO;KACb;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,IAAI;KACV;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;KACV;CACD,CAAC;AAES,QAAA,cAAc,GAAoC,IAAI,CAAC;AAElE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAsB,oBAAoB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACzF,sBAAc,GAAG,KAAK,CAAC,eAAe,CAAC;QACvC,sBAAc,CAAC,WAAW,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,EAAE,EAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC,CAAC;KACnF;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"cron-job-history.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { CronJobHistoryModel } from '../models/cron-job-history.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\treoccuring: {\n\t\ttype: Boolean\n\t},\n\ttime_to_run: {\n\t\ttype: String\n\t},\n\tmethod_name: {\n\t\ttype: String\n\t},\n\tlast_run: {\n\t\ttype: Date\n\t},\n\tnext_run: {\n\t\ttype: Date\n\t},\n\tid_cronjob: {\n\t\ttype: String\n\t},\n\tpassed: {\n\t\ttype: Boolean\n\t},\n\terror: {\n\t\ttype: String\n\t},\n\tstart_time: {\n\t\ttype: Date\n\t},\n\tend_time: {\n\t\ttype: Date\n\t}\n};\n\nexport let CronJobHistory: Collection<CronJobHistoryModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<CronJobHistoryModel>('cron-job-histories', schema, false, false);\n\t\tCronJobHistory = model.collection_main;\n\t\tCronJobHistory.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 7});\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 { CronJobModel } from '../models/cron-job.model';
3
- interface ResolveIOModel extends CronJobModel, Document {
4
- }
5
- export declare let CronJobs: Model<ResolveIOModel>;
6
- export declare let CronJobVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let CronJobs: Collection<CronJobModel>;
@@ -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.CronJobVersions = exports.CronJobs = void 0;
15
- var mongoose_1 = require("mongoose");
16
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.CronJobs = 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,
@@ -70,29 +58,12 @@ var schema = {
70
58
  optional: true
71
59
  }
72
60
  };
73
- var DefaultSchema = new mongoose_1.Schema(schema, {
74
- skipVersioning: true,
75
- versionKey: false,
76
- timestamps: true
77
- });
78
61
  exports.CronJobs = null;
79
- exports.CronJobVersions = null;
80
62
  initializeCollection();
81
63
  function initializeCollection() {
82
64
  if (index_1.ResolveIOServer.getMainDB()) {
83
- exports.CronJobs = index_1.ResolveIOServer.getMainDB().model('cron-jobs', DefaultSchema);
84
- var vSchema = __assign({}, schema);
85
- vSchema._id = {
86
- type: mongoose_1.Schema.Types.Mixed
87
- };
88
- var VersionSchema = new mongoose_1.Schema(vSchema, {
89
- skipVersioning: true,
90
- versionKey: false,
91
- timestamps: true
92
- });
93
- exports.CronJobs['versionCollection'] = 'cron-jobs.versions';
94
- exports.CronJobVersions = index_1.ResolveIOServer.getMainDB().model(exports.CronJobs['versionCollection'], VersionSchema);
95
- exports.CronJobs['simplschema'] = new simpl_schema_1.default(schema);
65
+ var model = new mongo_manager_1.Model('cron-jobs', schema, false, false);
66
+ exports.CronJobs = model.collection_main;
96
67
  }
97
68
  else {
98
69
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/cron-job.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,MAAM,EAAE;QACP,IAAI,EAAE,OAAO;KACb;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACd;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;KACb;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;QACV,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,QAAQ,GAA0B,IAAI,CAAC;AACvC,QAAA,eAAe,GAA0B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,gBAAQ,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAEzE,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,gBAAQ,CAAC,mBAAmB,CAAC,GAAG,oBAAoB,CAAC;QAErD,uBAAe,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAQ,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAElG,gBAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;KACnD;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"cron-job.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { CronJobModel } from '../models/cron-job.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\trepeat: {\n\t\ttype: Boolean\n\t},\n\ttime_to_run: {\n\t\ttype: String\n\t},\n\tmethod_run: {\n\t\ttype: String\n\t},\n\tmethod_run_data: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t},\n\tmethod_complete: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tmethod_complete_data: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t},\n\trunning: {\n\t\ttype: Boolean\n\t},\n\ttimezone: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tnext_run: {\n\t\ttype: Date,\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 CronJobModel, Document {}\n\nexport let CronJobs: Model<ResolveIOModel> = null;\nexport let CronJobVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tCronJobs = ResolveIOServer.getMainDB().model('cron-jobs', 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\tCronJobs['versionCollection'] = 'cron-jobs.versions';\n\n\t\tCronJobVersions = ResolveIOServer.getMainDB().model(CronJobs['versionCollection'], VersionSchema);\n\n\t\tCronJobs['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/cron-job.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,MAAM,EAAE;QACP,IAAI,EAAE,OAAO;KACb;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,UAAU,EAAE;QACX,IAAI,EAAE,MAAM;KACZ;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACd;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;KACb;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,QAAQ,GAA6B,IAAI,CAAC;AAErD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAe,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACzE,gBAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;KACjC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"cron-job.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { CronJobModel } from '../models/cron-job.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\trepeat: {\n\t\ttype: Boolean\n\t},\n\ttime_to_run: {\n\t\ttype: String\n\t},\n\tmethod_run: {\n\t\ttype: String\n\t},\n\tmethod_run_data: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t},\n\tmethod_complete: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tmethod_complete_data: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t},\n\trunning: {\n\t\ttype: Boolean\n\t},\n\ttimezone: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tnext_run: {\n\t\ttype: Date,\n\t\toptional: true\n\t}\n};\n\nexport let CronJobs: Collection<CronJobModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<CronJobModel>('cron-jobs', schema, false, false);\n\t\tCronJobs = 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 { EmailHistoryModel } from '../models/email-history.model';
3
- interface ResolveIOModel extends EmailHistoryModel, Document {
4
- }
5
- export declare let EmailHistories: Model<ResolveIOModel>;
6
- export declare let EmailHistoryVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let EmailHistories: Collection<EmailHistoryModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmailHistoryVersions = exports.EmailHistories = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.EmailHistories = 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,
@@ -40,28 +39,12 @@ var schema = {
40
39
  type: Boolean
41
40
  }
42
41
  };
43
- var DefaultSchema = new mongoose_1.Schema(schema, {
44
- skipVersioning: true,
45
- versionKey: false,
46
- timestamps: true
47
- });
48
42
  exports.EmailHistories = null;
49
- exports.EmailHistoryVersions = null;
50
43
  initializeCollection();
51
44
  function initializeCollection() {
52
45
  if (index_1.ResolveIOServer.getMainDB()) {
53
- exports.EmailHistories = index_1.ResolveIOServer.getMainDB().model('email-histories', DefaultSchema);
54
- exports.EmailHistories['simplschema'] = new simpl_schema_1.default(schema);
55
- schema._id = {
56
- type: mongoose_1.Schema.Types.Mixed
57
- };
58
- var VersionSchema = new mongoose_1.Schema(schema, {
59
- skipVersioning: true,
60
- versionKey: false,
61
- timestamps: true
62
- });
63
- exports.EmailHistories['versionCollection'] = 'email-histories.versions';
64
- exports.EmailHistoryVersions = index_1.ResolveIOServer.getMainDB().model(exports.EmailHistories['versionCollection'], VersionSchema);
46
+ var model = new mongo_manager_1.Model('email-histories', schema, false, false);
47
+ exports.EmailHistories = model.collection_main;
65
48
  }
66
49
  else {
67
50
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/email-history.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,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,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;KACb;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,OAAO;KACb;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,cAAc,GAA0B,IAAI,CAAC;AAC7C,QAAA,oBAAoB,GAA0B,IAAI,CAAC;AAE9D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,sBAAc,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAErF,sBAAc,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAEzD,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,sBAAc,CAAC,mBAAmB,CAAC,GAAG,0BAA0B,CAAC;QAEjE,4BAAoB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,sBAAc,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAC7G;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"email-history.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { EmailHistoryModel } from '../models/email-history.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\temail: {\n\t\ttype: String\n\t},\n\tsuccess: {\n\t\ttype: Boolean\n\t},\n\tverified: {\n\t\ttype: Boolean\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends EmailHistoryModel, Document {}\n\nexport let EmailHistories: Model<ResolveIOModel> = null;\nexport let EmailHistoryVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tEmailHistories = ResolveIOServer.getMainDB().model('email-histories', DefaultSchema);\n\n\t\tEmailHistories['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\tEmailHistories['versionCollection'] = 'email-histories.versions';\n\n\t\tEmailHistoryVersions = ResolveIOServer.getMainDB().model(EmailHistories['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/email-history.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,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;KACb;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,OAAO;KACb;CACD,CAAC;AAES,QAAA,cAAc,GAAkC,IAAI,CAAC;AAEhE,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,sBAAc,GAAG,KAAK,CAAC,eAAe,CAAC;KACvC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"email-history.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { EmailHistoryModel } from '../models/email-history.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\temail: {\n\t\ttype: String\n\t},\n\tsuccess: {\n\t\ttype: Boolean\n\t},\n\tverified: {\n\t\ttype: Boolean\n\t}\n};\n\nexport let EmailHistories: Collection<EmailHistoryModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<EmailHistoryModel>('email-histories', schema, false, false);\n\t\tEmailHistories = 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 { EmailVerifiedModel } from '../models/email-verified.model';
3
- interface ResolveIOModel extends EmailVerifiedModel, Document {
4
- }
5
- export declare let EmailVerifies: Model<ResolveIOModel>;
6
- export declare let EmailVerifyVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let EmailVerifies: Collection<EmailVerifiedModel>;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmailVerifyVersions = exports.EmailVerifies = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.EmailVerifies = 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,
@@ -34,29 +33,13 @@ var schema = {
34
33
  type: String
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({ email: 1 });
43
36
  exports.EmailVerifies = null;
44
- exports.EmailVerifyVersions = null;
45
37
  initializeCollection();
46
38
  function initializeCollection() {
47
39
  if (index_1.ResolveIOServer.getMainDB()) {
48
- exports.EmailVerifies = index_1.ResolveIOServer.getMainDB().model('email-verifies', DefaultSchema);
49
- exports.EmailVerifies['simplschema'] = new simpl_schema_1.default(schema);
50
- schema._id = {
51
- type: mongoose_1.Schema.Types.Mixed
52
- };
53
- var VersionSchema = new mongoose_1.Schema(schema, {
54
- skipVersioning: true,
55
- versionKey: false,
56
- timestamps: true
57
- });
58
- exports.EmailVerifies['versionCollection'] = 'email-verifies.versions';
59
- exports.EmailVerifyVersions = index_1.ResolveIOServer.getMainDB().model(exports.EmailVerifies['versionCollection'], VersionSchema);
40
+ var model = new mongo_manager_1.Model('email-verifies', schema, false, false);
41
+ exports.EmailVerifies = model.collection_main;
42
+ exports.EmailVerifies.createIndex({ email: 1 });
60
43
  }
61
44
  else {
62
45
  setTimeout(function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/email-verified.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,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;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,mBAAmB,GAA0B,IAAI,CAAC;AAE7D,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,qBAAa,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QAEnF,qBAAa,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAExD,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,qBAAa,CAAC,mBAAmB,CAAC,GAAG,yBAAyB,CAAC;QAE/D,2BAAmB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,qBAAa,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;KAC3G;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"email-verified.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { EmailVerifiedModel } from '../models/email-verified.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\temail: {\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({email: 1});\n\ninterface ResolveIOModel extends EmailVerifiedModel, Document {}\n\nexport let EmailVerifies: Model<ResolveIOModel> = null;\nexport let EmailVerifyVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tEmailVerifies = ResolveIOServer.getMainDB().model('email-verifies', DefaultSchema);\n\n\t\tEmailVerifies['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\tEmailVerifies['versionCollection'] = 'email-verifies.versions';\n\n\t\tEmailVerifyVersions = ResolveIOServer.getMainDB().model(EmailVerifies['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/email-verified.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;CACD,CAAC;AAES,QAAA,aAAa,GAAmC,IAAI,CAAC;AAEhE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAqB,gBAAgB,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":"email-verified.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { EmailVerifiedModel } from '../models/email-verified.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\temail: {\n\t\ttype: String\n\t}\n};\n\nexport let EmailVerifies: Collection<EmailVerifiedModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<EmailVerifiedModel>('email-verifies', schema, false, false);\n\t\tEmailVerifies = model.collection_main;\n\t\tEmailVerifies.createIndex({email: 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 { FileModel } from '../models/file.model';
3
- interface ResolveIOModel extends FileModel, Document {
4
- }
5
- export declare let Files: Model<ResolveIOModel>;
6
- export declare let FileVersions: Model<ResolveIOModel>;
7
- export {};
3
+ export declare let Files: Collection<FileModel>;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileVersions = exports.Files = void 0;
4
- var mongoose_1 = require("mongoose");
5
- var simpl_schema_1 = require("simpl-schema");
3
+ exports.Files = void 0;
6
4
  var index_1 = require("../index");
7
- var common_1 = require("../util/common");
5
+ var mongo_manager_1 = require("../managers/mongo.manager");
8
6
  var schema = {
9
7
  _id: {
10
8
  type: String,
@@ -46,32 +44,12 @@ var schema = {
46
44
  optional: true
47
45
  }
48
46
  };
49
- var DefaultSchema = new mongoose_1.Schema(schema, {
50
- skipVersioning: true,
51
- versionKey: false,
52
- timestamps: true
53
- });
54
47
  exports.Files = null;
55
- exports.FileVersions = null;
56
48
  initializeCollection();
57
49
  function initializeCollection() {
58
50
  if (index_1.ResolveIOServer.getMainDB()) {
59
- exports.Files = index_1.ResolveIOServer.getMainDB().model('files', DefaultSchema);
60
- exports.Files['simplschema'] = new simpl_schema_1.default(schema);
61
- schema._id = {
62
- type: mongoose_1.Schema.Types.Mixed
63
- };
64
- var VersionSchema = new mongoose_1.Schema(schema, {
65
- skipVersioning: true,
66
- versionKey: false,
67
- timestamps: true
68
- });
69
- exports.Files['versionCollection'] = 'files.versions';
70
- exports.FileVersions = index_1.ResolveIOServer.getMainDB().model(exports.Files['versionCollection'], VersionSchema);
71
- //------------- Report Builder Schema
72
- var rbLookups = [];
73
- var rbSchema = Object.assign(schema, common_1.buildRbLookups(rbLookups, DefaultSchema, []));
74
- exports.Files['rbSchema'] = common_1.buildRbSchema(rbSchema);
51
+ var model = new mongo_manager_1.Model('files', schema, false, true, []);
52
+ exports.Files = model.collection_main;
75
53
  }
76
54
  else {
77
55
  setTimeout(function () {