@resolveio/server-lib 8.0.16 → 8.0.18

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 (90) hide show
  1. package/collections/app-status.collection.d.ts +2 -2
  2. package/collections/app-status.collection.js +24 -12
  3. package/collections/app-status.collection.js.map +1 -1
  4. package/collections/app-version.collection.d.ts +2 -2
  5. package/collections/app-version.collection.js +26 -14
  6. package/collections/app-version.collection.js.map +1 -1
  7. package/collections/counter.collection.d.ts +2 -2
  8. package/collections/counter.collection.js +26 -14
  9. package/collections/counter.collection.js.map +1 -1
  10. package/collections/cron-job-history.collection.d.ts +2 -2
  11. package/collections/cron-job-history.collection.js +25 -13
  12. package/collections/cron-job-history.collection.js.map +1 -1
  13. package/collections/cron-job.collection.d.ts +2 -2
  14. package/collections/cron-job.collection.js +25 -13
  15. package/collections/cron-job.collection.js.map +1 -1
  16. package/collections/email-history.collection.d.ts +2 -2
  17. package/collections/email-history.collection.js +24 -12
  18. package/collections/email-history.collection.js.map +1 -1
  19. package/collections/email-verified.collection.d.ts +2 -2
  20. package/collections/email-verified.collection.js +24 -12
  21. package/collections/email-verified.collection.js.map +1 -1
  22. package/collections/file.collection.d.ts +2 -2
  23. package/collections/file.collection.js +28 -16
  24. package/collections/file.collection.js.map +1 -1
  25. package/collections/flag.collection.d.ts +2 -2
  26. package/collections/flag.collection.js +24 -12
  27. package/collections/flag.collection.js.map +1 -1
  28. package/collections/log-method-latency.collection.d.ts +2 -2
  29. package/collections/log-method-latency.collection.js +23 -11
  30. package/collections/log-method-latency.collection.js.map +1 -1
  31. package/collections/log-subscription.collection.d.ts +2 -2
  32. package/collections/log-subscription.collection.js +23 -11
  33. package/collections/log-subscription.collection.js.map +1 -1
  34. package/collections/log.collection.d.ts +2 -2
  35. package/collections/log.collection.js +23 -11
  36. package/collections/log.collection.js.map +1 -1
  37. package/collections/logged-in-users.collection.d.ts +2 -2
  38. package/collections/logged-in-users.collection.js +24 -12
  39. package/collections/logged-in-users.collection.js.map +1 -1
  40. package/collections/method-call.collection.d.ts +1 -1
  41. package/collections/method-call.collection.js +13 -2
  42. package/collections/method-call.collection.js.map +1 -1
  43. package/collections/method-response.collection.d.ts +1 -1
  44. package/collections/method-response.collection.js +13 -2
  45. package/collections/method-response.collection.js.map +1 -1
  46. package/collections/monitor-cpu.collection.d.ts +2 -2
  47. package/collections/monitor-cpu.collection.js +24 -12
  48. package/collections/monitor-cpu.collection.js.map +1 -1
  49. package/collections/monitor-https-inbound.collection.d.ts +2 -2
  50. package/collections/monitor-https-inbound.collection.js +24 -12
  51. package/collections/monitor-https-inbound.collection.js.map +1 -1
  52. package/collections/monitor-https-outbound.collection.d.ts +2 -2
  53. package/collections/monitor-https-outbound.collection.js +24 -12
  54. package/collections/monitor-https-outbound.collection.js.map +1 -1
  55. package/collections/monitor-memory.collection.d.ts +2 -2
  56. package/collections/monitor-memory.collection.js +24 -12
  57. package/collections/monitor-memory.collection.js.map +1 -1
  58. package/collections/monitor-mongo.collection.d.ts +2 -2
  59. package/collections/monitor-mongo.collection.js +24 -12
  60. package/collections/monitor-mongo.collection.js.map +1 -1
  61. package/collections/notification.collection.d.ts +2 -2
  62. package/collections/notification.collection.js +24 -12
  63. package/collections/notification.collection.js.map +1 -1
  64. package/collections/queue-flag.collection.d.ts +2 -2
  65. package/collections/queue-flag.collection.js +24 -12
  66. package/collections/queue-flag.collection.js.map +1 -1
  67. package/collections/queue-method.collection.d.ts +2 -2
  68. package/collections/queue-method.collection.js +65 -53
  69. package/collections/queue-method.collection.js.map +1 -1
  70. package/collections/queue-response.collection.d.ts +2 -2
  71. package/collections/queue-response.collection.js +25 -13
  72. package/collections/queue-response.collection.js.map +1 -1
  73. package/collections/report-builder-library.collection.d.ts +2 -2
  74. package/collections/report-builder-library.collection.js +25 -13
  75. package/collections/report-builder-library.collection.js.map +1 -1
  76. package/collections/report-builder-report.collection.d.ts +2 -2
  77. package/collections/report-builder-report.collection.js +25 -13
  78. package/collections/report-builder-report.collection.js.map +1 -1
  79. package/collections/user-group.collection.d.ts +2 -2
  80. package/collections/user-group.collection.js +30 -18
  81. package/collections/user-group.collection.js.map +1 -1
  82. package/collections/user-guide.collection.d.ts +2 -2
  83. package/collections/user-guide.collection.js +28 -16
  84. package/collections/user-guide.collection.js.map +1 -1
  85. package/collections/user.collection.d.ts +3 -3
  86. package/collections/user.collection.js +29 -17
  87. package/collections/user.collection.js.map +1 -1
  88. package/http/auth.js.map +1 -1
  89. package/package.json +1 -1
  90. package/server-app.js.map +1 -1
@@ -2,6 +2,6 @@ import { Model, Document } from 'mongoose';
2
2
  import { ReportBuilderLibraryModel } from '../models/report-builder-library.model';
3
3
  interface ResolveIOModel extends ReportBuilderLibraryModel, Document {
4
4
  }
5
- export declare const ReportBuilderLibraries: Model<ResolveIOModel>;
6
- export declare const ReportBuilderLibraryVersions: Model<ResolveIOModel>;
5
+ export declare let ReportBuilderLibraries: Model<ResolveIOModel>;
6
+ export declare let ReportBuilderLibraryVersions: Model<ResolveIOModel>;
7
7
  export {};
@@ -76,18 +76,30 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
76
76
  DefaultSchema.index({ name: 1 });
77
77
  DefaultSchema.index({ id_user_create: 1 });
78
78
  DefaultSchema.index({ 'user_groups.id_user_group': 1 });
79
- exports.ReportBuilderLibraries = index_1.ResolveIOServer.getMainDB().model('report-builder-libraries', DefaultSchema);
80
- var vSchema = __assign({}, schema);
81
- vSchema._id = {
82
- type: mongoose_1.Schema.Types.Mixed
83
- };
84
- var VersionSchema = new mongoose_1.Schema(vSchema, {
85
- skipVersioning: true,
86
- versionKey: false,
87
- timestamps: true
88
- });
89
- exports.ReportBuilderLibraries['versionCollection'] = 'report-builder-libraries.versions';
90
- exports.ReportBuilderLibraryVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderLibraries['versionCollection'], VersionSchema);
91
- exports.ReportBuilderLibraries['simplschema'] = new simpl_schema_1.default(schema);
79
+ exports.ReportBuilderLibraries = null;
80
+ exports.ReportBuilderLibraryVersions = null;
81
+ initializeCollection();
82
+ function initializeCollection() {
83
+ if (index_1.ResolveIOServer.getMainDB()) {
84
+ exports.ReportBuilderLibraries = index_1.ResolveIOServer.getMainDB().model('report-builder-libraries', DefaultSchema);
85
+ var vSchema = __assign({}, schema);
86
+ vSchema._id = {
87
+ type: mongoose_1.Schema.Types.Mixed
88
+ };
89
+ var VersionSchema = new mongoose_1.Schema(vSchema, {
90
+ skipVersioning: true,
91
+ versionKey: false,
92
+ timestamps: true
93
+ });
94
+ exports.ReportBuilderLibraries['versionCollection'] = 'report-builder-libraries.versions';
95
+ exports.ReportBuilderLibraryVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderLibraries['versionCollection'], VersionSchema);
96
+ exports.ReportBuilderLibraries['simplschema'] = new simpl_schema_1.default(schema);
97
+ }
98
+ else {
99
+ setTimeout(function () {
100
+ initializeCollection();
101
+ }, 0);
102
+ }
103
+ }
92
104
 
93
105
  //# sourceMappingURL=report-builder-library.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/report-builder-library.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,cAAc,EAAE;QACf,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;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AErE,QAAA,4BAA4B,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,8BAAsB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AAEjK,8BAAsB,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,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 {}\nexport const ReportBuilderLibraries: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('report-builder-libraries', DefaultSchema);\n\nlet vSchema = { ...schema };\nvSchema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(vSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nReportBuilderLibraries['versionCollection'] = 'report-builder-libraries.versions';\n\nexport const ReportBuilderLibraryVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(ReportBuilderLibraries['versionCollection'], VersionSchema);\n\nReportBuilderLibraries['simplschema'] = new SimpleSchema(schema);"]}
1
+ {"version":3,"sources":["../../src/collections/report-builder-library.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,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,0BAA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ACJ,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}"]}
@@ -2,6 +2,6 @@ import { Model, Document } from 'mongoose';
2
2
  import { ReportBuilderReportModel } from '../models/report-builder-report.model';
3
3
  interface ResolveIOModel extends ReportBuilderReportModel, Document {
4
4
  }
5
- export declare const ReportBuilderReports: Model<ResolveIOModel>;
6
- export declare const ReportBuilderReportVersions: Model<ResolveIOModel>;
5
+ export declare let ReportBuilderReports: Model<ResolveIOModel>;
6
+ export declare let ReportBuilderReportVersions: Model<ResolveIOModel>;
7
7
  export {};
@@ -136,18 +136,30 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
136
136
  DefaultSchema.index({ id_user: 1 });
137
137
  DefaultSchema.index({ shared_users: 1 });
138
138
  DefaultSchema.index({ report_name: 1, collection_root: 1 });
139
- exports.ReportBuilderReports = index_1.ResolveIOServer.getMainDB().model('report-builder-reports', DefaultSchema);
140
- var vSchema = __assign({}, schema);
141
- vSchema._id = {
142
- type: mongoose_1.Schema.Types.Mixed
143
- };
144
- var VersionSchema = new mongoose_1.Schema(vSchema, {
145
- skipVersioning: true,
146
- versionKey: false,
147
- timestamps: true
148
- });
149
- exports.ReportBuilderReports['versionCollection'] = 'report-builder-reports.versions';
150
- exports.ReportBuilderReportVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderReports['versionCollection'], VersionSchema);
151
- exports.ReportBuilderReports['simplschema'] = new simpl_schema_1.default(schema);
139
+ exports.ReportBuilderReports = null;
140
+ exports.ReportBuilderReportVersions = null;
141
+ initializeCollection();
142
+ function initializeCollection() {
143
+ if (index_1.ResolveIOServer.getMainDB()) {
144
+ exports.ReportBuilderReports = index_1.ResolveIOServer.getMainDB().model('report-builder-reports', DefaultSchema);
145
+ var vSchema = __assign({}, schema);
146
+ vSchema._id = {
147
+ type: mongoose_1.Schema.Types.Mixed
148
+ };
149
+ var VersionSchema = new mongoose_1.Schema(vSchema, {
150
+ skipVersioning: true,
151
+ versionKey: false,
152
+ timestamps: true
153
+ });
154
+ exports.ReportBuilderReports['versionCollection'] = 'report-builder-reports.versions';
155
+ exports.ReportBuilderReportVersions = index_1.ResolveIOServer.getMainDB().model(exports.ReportBuilderReports['versionCollection'], VersionSchema);
156
+ exports.ReportBuilderReports['simplschema'] = new simpl_schema_1.default(schema);
157
+ }
158
+ else {
159
+ setTimeout(function () {
160
+ initializeCollection();
161
+ }, 0);
162
+ }
163
+ }
152
164
 
153
165
  //# sourceMappingURL=report-builder-report.collection.js.map
@@ -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,EAAE;QAChB,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,MAAM;KACZ;IACD,WAAW,EAAE;QACZ,IAAI,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AAC,MAAM,CAAC,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 {}\nexport const ReportBuilderReports: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('report-builder-reports', DefaultSchema);\n\nlet vSchema = { ...schema };\nvSchema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(vSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nReportBuilderReports['versionCollection'] = 'report-builder-reports.versions';\n\nexport const ReportBuilderReportVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(ReportBuilderReports['versionCollection'], VersionSchema);\n\nReportBuilderReports['simplschema'] = new SimpleSchema(schema);"]}
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,EAAE;QAChB,IAAI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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}"]}
@@ -2,6 +2,6 @@ import { Model, Document } from 'mongoose';
2
2
  import { UserGroupModel } from '../models/user-group.model';
3
3
  interface ResolveIOModel extends UserGroupModel, Document {
4
4
  }
5
- export declare const UserGroups: Model<ResolveIOModel>;
6
- export declare const UserGroupVersions: Model<ResolveIOModel>;
5
+ export declare let UserGroups: Model<ResolveIOModel>;
6
+ export declare let UserGroupVersions: Model<ResolveIOModel>;
7
7
  export {};
@@ -78,23 +78,35 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
78
78
  timestamps: true
79
79
  });
80
80
  DefaultSchema.index({ name: 1 });
81
- exports.UserGroups = index_1.ResolveIOServer.getMainDB().model('user-groups', DefaultSchema);
82
- var vSchema = __assign({}, schema);
83
- vSchema._id = {
84
- type: mongoose_1.Schema.Types.Mixed
85
- };
86
- var VersionSchema = new mongoose_1.Schema(vSchema, {
87
- skipVersioning: true,
88
- versionKey: false,
89
- timestamps: true
90
- });
91
- VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
92
- exports.UserGroups['versionCollection'] = 'user-groups.versions';
93
- exports.UserGroupVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGroups['versionCollection'], VersionSchema);
94
- exports.UserGroups['simplschema'] = new simpl_schema_1.default(schema);
95
- //------------- Report Builder Schema
96
- var rbLookups = [];
97
- var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
98
- exports.UserGroups['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
81
+ exports.UserGroups = null;
82
+ exports.UserGroupVersions = null;
83
+ initializeCollection();
84
+ function initializeCollection() {
85
+ if (index_1.ResolveIOServer.getMainDB()) {
86
+ exports.UserGroups = index_1.ResolveIOServer.getMainDB().model('user-groups', DefaultSchema);
87
+ var vSchema = __assign({}, schema);
88
+ vSchema._id = {
89
+ type: mongoose_1.Schema.Types.Mixed
90
+ };
91
+ var VersionSchema = new mongoose_1.Schema(vSchema, {
92
+ skipVersioning: true,
93
+ versionKey: false,
94
+ timestamps: true
95
+ });
96
+ VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
97
+ exports.UserGroups['versionCollection'] = 'user-groups.versions';
98
+ exports.UserGroupVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGroups['versionCollection'], VersionSchema);
99
+ exports.UserGroups['simplschema'] = new simpl_schema_1.default(schema);
100
+ //------------- Report Builder Schema
101
+ var rbLookups = [];
102
+ var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
103
+ exports.UserGroups['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
104
+ }
105
+ else {
106
+ setTimeout(function () {
107
+ initializeCollection();
108
+ }, 0);
109
+ }
110
+ }
99
111
 
100
112
  //# sourceMappingURL=user-group.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,uEAA8E;AAG9E,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,oBAAo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AC;AAE5C,QAAA,iBAAiB,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,kBAAU,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AAE1I,kBAAU,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;AAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sCAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;AACnF,kBAAU,CAAC,UAAU,CAAC,GAAG,qCAAa,CAAC,QAAQ,CAAC,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 { buildRbLookups, buildRbSchema } from '../util/schema-report-builder';\nimport { Users } from './user.collection';\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 {}\nexport const UserGroups: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('user-groups', DefaultSchema);\n\nlet vSchema = { ...schema };\nvSchema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(vSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\nUserGroups['versionCollection'] = 'user-groups.versions';\n\nexport const UserGroupVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(UserGroups['versionCollection'], VersionSchema);\n\nUserGroups['simplschema'] = new SimpleSchema(schema);\n\n//------------- Report Builder Schema\nlet rbLookups: LookupTables[] = [];\n\nlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\nUserGroups['rbSchema'] = buildRbSchema(rbSchema);"]}
1
+ {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,uEAA8E;AAG9E,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,E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CAAC,OAAO,EAAE;YACvC,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;QAElD,kBAAU,CAAC,mBAAmB,CAAC,GAAG,sBAAsB,CAAC;QAEzD,yBAAiB,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,kBAAU,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAEtG,kBAAU,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;QAErD,qCAAqC;QACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;QAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sCAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;QACnF,kBAAU,CAAC,UAAU,CAAC,GAAG,qCAAa,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 { buildRbLookups, buildRbSchema } from '../util/schema-report-builder';\nimport { Users } from './user.collection';\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}"]}
@@ -2,6 +2,6 @@ import { Model, Document } from 'mongoose';
2
2
  import { UserGuideModel } from '../models/user-guide.model';
3
3
  interface ResolveIOModel extends UserGuideModel, Document {
4
4
  }
5
- export declare const UserGuides: Model<ResolveIOModel>;
6
- export declare const UserGuideVersions: Model<ResolveIOModel>;
5
+ export declare let UserGuides: Model<ResolveIOModel>;
6
+ export declare let UserGuideVersions: Model<ResolveIOModel>;
7
7
  export {};
@@ -36,21 +36,33 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
36
36
  versionKey: false,
37
37
  timestamps: true
38
38
  });
39
- exports.UserGuides = index_1.ResolveIOServer.getMainDB().model('user-guides', DefaultSchema);
40
- exports.UserGuides['simplschema'] = new simpl_schema_1.default(schema);
41
- schema._id = {
42
- type: mongoose_1.Schema.Types.Mixed
43
- };
44
- var VersionSchema = new mongoose_1.Schema(schema, {
45
- skipVersioning: true,
46
- versionKey: false,
47
- timestamps: true
48
- });
49
- exports.UserGuides['versionCollection'] = 'user-guides.versions';
50
- exports.UserGuideVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGuides['versionCollection'], VersionSchema);
51
- //------------- Report Builder Schema
52
- var rbLookups = [];
53
- var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
54
- exports.UserGuides['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
39
+ exports.UserGuides = null;
40
+ exports.UserGuideVersions = null;
41
+ initializeCollection();
42
+ function initializeCollection() {
43
+ if (index_1.ResolveIOServer.getMainDB()) {
44
+ exports.UserGuides = index_1.ResolveIOServer.getMainDB().model('user-guides', DefaultSchema);
45
+ exports.UserGuides['simplschema'] = new simpl_schema_1.default(schema);
46
+ schema._id = {
47
+ type: mongoose_1.Schema.Types.Mixed
48
+ };
49
+ var VersionSchema = new mongoose_1.Schema(schema, {
50
+ skipVersioning: true,
51
+ versionKey: false,
52
+ timestamps: true
53
+ });
54
+ exports.UserGuides['versionCollection'] = 'user-guides.versions';
55
+ exports.UserGuideVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGuides['versionCollection'], VersionSchema);
56
+ //------------- Report Builder Schema
57
+ var rbLookups = [];
58
+ var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
59
+ exports.UserGuides['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
60
+ }
61
+ else {
62
+ setTimeout(function () {
63
+ initializeCollection();
64
+ }, 0);
65
+ }
66
+ }
55
67
 
56
68
  //# sourceMappingURL=user-guide.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAE3C,uEAA8E;AAG9E,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAGU,QAAA,UAAU,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAEjH,kBAAU,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,CAAC,GAAG,GAAG;IACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;CACxB,CAAC;AAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACtC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,kBAAU,CAAC,mBAAmB,CAAC,GAAG,sBAAsB,CAAC;AAE5C,QAAA,iBAAiB,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,kBAAU,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AAE1I,qCAAqC;AACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;AAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sCAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;AACnF,kBAAU,CAAC,UAAU,CAAC,GAAG,qCAAa,CAAC,QAAQ,CAAC,CAAC","file":"user-guide.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/schema-report-builder';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends UserGuideModel, Document {}\nexport const UserGuides: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('user-guides', DefaultSchema);\n\nUserGuides['simplschema'] = new SimpleSchema(schema);\n\nschema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nUserGuides['versionCollection'] = 'user-guides.versions';\n\nexport const UserGuideVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(UserGuides['versionCollection'], VersionSchema);\n\n//------------- Report Builder Schema\nlet rbLookups: LookupTables[] = [];\n\nlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\nUserGuides['rbSchema'] = buildRbSchema(rbSchema);"]}
1
+ {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAE3C,uEAA8E;AAG9E,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACx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ongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/schema-report-builder';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends UserGuideModel, Document {}\n\nexport let UserGuides: Model<ResolveIOModel> = null;\nexport let UserGuideVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUserGuides = ResolveIOServer.getMainDB().model('user-guides', DefaultSchema);\n\n\t\tUserGuides['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\tUserGuides['versionCollection'] = 'user-guides.versions';\n\n\t\tUserGuideVersions = ResolveIOServer.getMainDB().model(UserGuides['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tUserGuides['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
@@ -1,8 +1,8 @@
1
1
  /// <reference types="passport-local-mongoose" />
2
- import { Model, PassportLocalDocument, PassportLocalModel } from 'mongoose';
2
+ import { Model, PassportLocalDocument } from 'mongoose';
3
3
  import { UserModel } from '../models/user.model';
4
4
  interface ResolveIOModel extends UserModel, PassportLocalDocument {
5
5
  }
6
- export declare const Users: PassportLocalModel<ResolveIOModel>;
7
- export declare const UserVersions: Model<ResolveIOModel>;
6
+ export declare let Users: Model<ResolveIOModel>;
7
+ export declare let UserVersions: Model<ResolveIOModel>;
8
8
  export {};
@@ -233,22 +233,34 @@ DefaultSchema.plugin(passportLocalMongoose, {
233
233
  });
234
234
  DefaultSchema.index({ fullname: 1 });
235
235
  DefaultSchema.index({ active: 1 });
236
- exports.Users = index_1.ResolveIOServer.getMainDB().model('users', DefaultSchema);
237
- exports.Users['simplschema'] = new simpl_schema_1.default(schema);
238
- schema._id = {
239
- type: mongoose_1.Schema.Types.Mixed
240
- };
241
- var VersionSchema = new mongoose_1.Schema(schema, {
242
- skipVersioning: true,
243
- versionKey: false,
244
- timestamps: true
245
- });
246
- VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
247
- exports.Users['versionCollection'] = 'users.versions';
248
- exports.UserVersions = index_1.ResolveIOServer.getMainDB().model(exports.Users['versionCollection'], VersionSchema);
249
- //------------- Report Builder Schema
250
- var rbLookups = [];
251
- var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
252
- exports.Users['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
236
+ exports.Users = null;
237
+ exports.UserVersions = null;
238
+ initializeCollection();
239
+ function initializeCollection() {
240
+ if (index_1.ResolveIOServer.getMainDB()) {
241
+ exports.Users = index_1.ResolveIOServer.getMainDB().model('users', DefaultSchema);
242
+ exports.Users['simplschema'] = new simpl_schema_1.default(schema);
243
+ schema._id = {
244
+ type: mongoose_1.Schema.Types.Mixed
245
+ };
246
+ var VersionSchema = new mongoose_1.Schema(schema, {
247
+ skipVersioning: true,
248
+ versionKey: false,
249
+ timestamps: true
250
+ });
251
+ VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
252
+ exports.Users['versionCollection'] = 'users.versions';
253
+ exports.UserVersions = index_1.ResolveIOServer.getMainDB().model(exports.Users['versionCollection'], VersionSchema);
254
+ //------------- Report Builder Schema
255
+ var rbLookups = [];
256
+ var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
257
+ exports.Users['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
258
+ }
259
+ else {
260
+ setTimeout(function () {
261
+ initializeCollection();
262
+ }, 0);
263
+ }
264
+ }
253
265
 
254
266
  //# sourceMappingURL=user.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;AAAA,qCAAwG;AACxG,+DAAiE;AACjE,6CAAwC;AACxC,kCAA2C;AAG3C,uEAA8E;AAE9E,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B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,CAAC;AAEhD,MAAM,CAAC,GAAG,GAAG;IACZ,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;CACxB,CAAC;AAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACtC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;AAElD,aAAK,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;AAEjC,QAAA,YAAY,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AAEhI,qCAAqC;AACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;AAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sCAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;AACnF,aAAK,CAAC,UAAU,CAAC,GAAG,qCAAa,CAAC,QAAQ,CAAC,CAAC","file":"user.collection.js","sourcesContent":["import { Schema, Model, PassportLocalDocument, PassportLocalModel, PassportLocalSchema} from 'mongoose';\nimport * as passportLocalMongoose from 'passport-local-mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserModel } from '../models/user.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/schema-report-builder';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n};\n\nconst DefaultSchema = <PassportLocalSchema>new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.plugin(passportLocalMongoose, {\n\tusernameUnique: true,\n\tlimitAttempts: true,\n\tmaxAttempts: 5,\n\tfindByUsername: (mongooseModel, queryParameters) => {\n\t\t// Add additional query parameter - AND condition - active: true\n\t\tqueryParameters.active = true;\n\t\treturn mongooseModel.findOne(queryParameters);\n\t}\n});\n\nDefaultSchema.index({fullname: 1});\nDefaultSchema.index({active: 1});\n\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\nexport const Users: PassportLocalModel<ResolveIOModel> = (<any>ResolveIOServer.getMainDB()).model('users', DefaultSchema);\n\nUsers['simplschema'] = new SimpleSchema(schema);\n\nschema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\nUsers['versionCollection'] = 'users.versions';\n\nexport const UserVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(Users['versionCollection'], VersionSchema);\n\n//------------- Report Builder Schema\nlet rbLookups: LookupTables[] = [];\n\nlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\nUsers['rbSchema'] = buildRbSchema(rbSchema);"]}
1
+ {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;AAAA,qCAAwG;AACxG,+DAAiE;AACjE,6CAAwC;AACxC,kCAA2C;AAG3C,uEAA8E;AAE9E,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QACl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sourcesContent":["import { Schema, Model, PassportLocalDocument, PassportLocalModel, PassportLocalSchema} from 'mongoose';\nimport * as passportLocalMongoose from 'passport-local-mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserModel } from '../models/user.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/schema-report-builder';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n};\n\nconst DefaultSchema = <PassportLocalSchema>new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.plugin(passportLocalMongoose, {\n\tusernameUnique: true,\n\tlimitAttempts: true,\n\tmaxAttempts: 5,\n\tfindByUsername: (mongooseModel, queryParameters) => {\n\t\t// Add additional query parameter - AND condition - active: true\n\t\tqueryParameters.active = true;\n\t\treturn mongooseModel.findOne(queryParameters);\n\t}\n});\n\nDefaultSchema.index({fullname: 1});\nDefaultSchema.index({active: 1});\n\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\n\nexport let Users: Model<ResolveIOModel> = null;\nexport let UserVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUsers = ResolveIOServer.getMainDB().model('users', DefaultSchema);\n\n\t\tUsers['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\tVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\n\t\tUsers['versionCollection'] = 'users.versions';\n\n\t\tUserVersions = ResolveIOServer.getMainDB().model(Users['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tUsers['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}