@resolveio/server-lib 6.4.23-newrole → 7.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 (73) hide show
  1. package/collections/counter.collection.d.ts +0 -2
  2. package/collections/counter.collection.js +0 -14
  3. package/collections/counter.collection.js.map +1 -1
  4. package/collections/file.collection.d.ts +0 -2
  5. package/collections/file.collection.js +0 -14
  6. package/collections/file.collection.js.map +1 -1
  7. package/collections/user.collection.d.ts +0 -1
  8. package/collections/user.collection.js +32 -43
  9. package/collections/user.collection.js.map +1 -1
  10. package/fixtures/cron-jobs.js +0 -17
  11. package/fixtures/cron-jobs.js.map +1 -1
  12. package/http/auth.js +173 -20
  13. package/http/auth.js.map +1 -1
  14. package/http/home.js +37 -0
  15. package/http/home.js.map +1 -1
  16. package/index.d.ts +1 -4
  17. package/index.js +22 -71
  18. package/index.js.map +1 -1
  19. package/managers/method.manager.d.ts +0 -1
  20. package/managers/method.manager.js +2 -28
  21. package/managers/method.manager.js.map +1 -1
  22. package/managers/subscription.manager.d.ts +0 -3
  23. package/managers/subscription.manager.js +19 -142
  24. package/managers/subscription.manager.js.map +1 -1
  25. package/methods/accounts.js.map +1 -1
  26. package/methods/cron-jobs.js +0 -68
  27. package/methods/cron-jobs.js.map +1 -1
  28. package/methods/support.d.ts +2 -0
  29. package/methods/support.js +439 -0
  30. package/methods/support.js.map +1 -0
  31. package/models/user.model.d.ts +14 -25
  32. package/models/user.model.js.map +1 -1
  33. package/package.json +1 -1
  34. package/publications/files.js +0 -31
  35. package/publications/files.js.map +1 -1
  36. package/publications/report-builder-libraries.js +3 -2
  37. package/publications/report-builder-libraries.js.map +1 -1
  38. package/server-app.d.ts +0 -4
  39. package/server-app.js +11 -71
  40. package/server-app.js.map +1 -1
  41. package/client-server-app.d.ts +0 -1
  42. package/client-server-app.js +0 -48
  43. package/client-server-app.js.map +0 -1
  44. package/collections/billing-logged-in-users.collection.d.ts +0 -7
  45. package/collections/billing-logged-in-users.collection.js +0 -75
  46. package/collections/billing-logged-in-users.collection.js.map +0 -1
  47. package/collections/support-ticket.collection.d.ts +0 -7
  48. package/collections/support-ticket.collection.js +0 -226
  49. package/collections/support-ticket.collection.js.map +0 -1
  50. package/managers/support.manager.d.ts +0 -22
  51. package/managers/support.manager.js +0 -329
  52. package/managers/support.manager.js.map +0 -1
  53. package/models/support-method.model.d.ts +0 -9
  54. package/models/support-method.model.js +0 -4
  55. package/models/support-method.model.js.map +0 -1
  56. package/publications/billing-logged-in-users.d.ts +0 -1
  57. package/publications/billing-logged-in-users.js +0 -65
  58. package/publications/billing-logged-in-users.js.map +0 -1
  59. package/publications/support-tickets.d.ts +0 -1
  60. package/publications/support-tickets.js +0 -203
  61. package/publications/support-tickets.js.map +0 -1
  62. package/support-methods/aws.d.ts +0 -2
  63. package/support-methods/aws.js +0 -279
  64. package/support-methods/aws.js.map +0 -1
  65. package/support-methods/collections.d.ts +0 -2
  66. package/support-methods/collections.js +0 -475
  67. package/support-methods/collections.js.map +0 -1
  68. package/support-methods/counters.d.ts +0 -2
  69. package/support-methods/counters.js +0 -192
  70. package/support-methods/counters.js.map +0 -1
  71. package/support-methods/support.d.ts +0 -2
  72. package/support-methods/support.js +0 -282
  73. package/support-methods/support.js.map +0 -1
@@ -3,7 +3,5 @@ import { CounterModel } from '../models/counter.model';
3
3
  interface ResolveIOModel extends CounterModel, Document {
4
4
  }
5
5
  export declare const Counters: Model<ResolveIOModel>;
6
- export declare let SupportCounters: Model<ResolveIOModel>;
7
6
  export declare const CounterVersions: Model<ResolveIOModel>;
8
- export declare let SupportCounterVersions: Model<ResolveIOModel>;
9
7
  export {};
@@ -44,10 +44,6 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
44
44
  timestamps: true
45
45
  });
46
46
  exports.Counters = index_1.ResolveIOServer.getMainDB().model('counters', DefaultSchema);
47
- exports.SupportCounters = null;
48
- if (index_1.ResolveIOServer.getSupportDB()) {
49
- exports.SupportCounters = index_1.ResolveIOServer.getSupportDB().model('counters', DefaultSchema);
50
- }
51
47
  var checkSchema = __assign({}, schema);
52
48
  checkSchema._id = {
53
49
  type: mongoose_1.Schema.Types.Mixed
@@ -58,18 +54,8 @@ var VersionSchema = new mongoose_1.Schema(checkSchema, {
58
54
  timestamps: true
59
55
  });
60
56
  exports.Counters['versionCollection'] = 'counters.versions';
61
- if (index_1.ResolveIOServer.getSupportDB()) {
62
- exports.SupportCounters['versionCollection'] = 'counters.versions';
63
- }
64
57
  exports.CounterVersions = index_1.ResolveIOServer.getMainDB().model(exports.Counters['versionCollection'], VersionSchema);
65
- exports.SupportCounterVersions = null;
66
- if (index_1.ResolveIOServer.getSupportDB()) {
67
- exports.SupportCounterVersions = index_1.ResolveIOServer.getSupportDB().model(exports.SupportCounters['versionCollection'], VersionSchema);
68
- }
69
58
  schema.count.type = simpl_schema_1.default.Integer;
70
59
  exports.Counters['simplschema'] = new simpl_schema_1.default(schema);
71
- if (index_1.ResolveIOServer.getSupportDB()) {
72
- exports.SupportCounters['simplschema'] = new simpl_schema_1.default(schema);
73
- }
74
60
 
75
61
  //# sourceMappingURL=counter.collection.js.map
@@ -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;CAC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AC,IAAI,GAAG,sBAAY,CAAC,OAAO,CAAC;AACzC,gBAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;AAEnD,IAAI,uBAAe,CAAC,YAAY,EAAE,EAAE;IACnC,uBAAe,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;CAC1D","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 {}\nexport const Counters: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('counters', DefaultSchema);\nexport let SupportCounters: Model<ResolveIOModel> = null;\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportCounters = ResolveIOServer.getSupportDB().model('counters', DefaultSchema);\n}\n\nlet checkSchema = { ...schema };\n\ncheckSchema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(checkSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nCounters['versionCollection'] = 'counters.versions';\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportCounters['versionCollection'] = 'counters.versions';\n}\n\nexport const CounterVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(Counters['versionCollection'], VersionSchema);\nexport let SupportCounterVersions: Model<ResolveIOModel> = null;\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportCounterVersions = ResolveIOServer.getSupportDB().model(SupportCounters['versionCollection'], VersionSchema);\n}\n\nschema.count.type = SimpleSchema.Integer;\nCounters['simplschema'] = new SimpleSchema(schema);\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportCounters['simplschema'] = new SimpleSchema(schema);\n}"]}
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;AAGU,QAAA,QAAQ,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAE5G,IAAI,WAAW,gBAAQ,MAAM,CAAE,CAAC;AAEhC,WAAW,CAAC,GAAG,GAAG;IACjB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,KAAK;CACxB,CAAC;AAEF,IAAI,aAAa,GAAG,IAAI,iBAAM,CAAC,WAAW,EAAE;IAC3C,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,gBAAQ,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;AAEvC,QAAA,eAAe,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,gBAAQ,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AAEtI,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,sBAAY,CAAC,OAAO,CAAC;AACzC,gBAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,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 {}\nexport const Counters: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('counters', DefaultSchema);\n\nlet checkSchema = { ...schema };\n\ncheckSchema._id = {\n\ttype: Schema.Types.Mixed\n};\n\nlet VersionSchema = new Schema(checkSchema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nCounters['versionCollection'] = 'counters.versions';\n\nexport const CounterVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(Counters['versionCollection'], VersionSchema);\n\nschema.count.type = SimpleSchema.Integer;\nCounters['simplschema'] = new SimpleSchema(schema);"]}
@@ -3,7 +3,5 @@ import { FileModel } from '../models/file.model';
3
3
  interface ResolveIOModel extends FileModel, Document {
4
4
  }
5
5
  export declare const Files: Model<ResolveIOModel>;
6
- export declare let SupportFiles: Model<ResolveIOModel>;
7
6
  export declare const FileVersions: Model<ResolveIOModel>;
8
- export declare let SupportFileVersions: Model<ResolveIOModel>;
9
7
  export {};
@@ -51,14 +51,7 @@ var DefaultSchema = new mongoose_1.Schema(schema, {
51
51
  timestamps: true
52
52
  });
53
53
  exports.Files = index_1.ResolveIOServer.getMainDB().model('files', DefaultSchema);
54
- exports.SupportFiles = null;
55
- if (index_1.ResolveIOServer.getSupportDB()) {
56
- exports.SupportFiles = index_1.ResolveIOServer.getSupportDB().model('files', DefaultSchema);
57
- }
58
54
  exports.Files['simplschema'] = new simpl_schema_1.default(schema);
59
- if (index_1.ResolveIOServer.getSupportDB()) {
60
- exports.SupportFiles['simplschema'] = new simpl_schema_1.default(schema);
61
- }
62
55
  schema._id = {
63
56
  type: mongoose_1.Schema.Types.Mixed
64
57
  };
@@ -68,14 +61,7 @@ var VersionSchema = new mongoose_1.Schema(schema, {
68
61
  timestamps: true
69
62
  });
70
63
  exports.Files['versionCollection'] = 'files.versions';
71
- if (index_1.ResolveIOServer.getSupportDB()) {
72
- exports.SupportFiles['versionCollection'] = 'files.versions';
73
- }
74
64
  exports.FileVersions = index_1.ResolveIOServer.getMainDB().model(exports.Files['versionCollection'], VersionSchema);
75
- exports.SupportFileVersions = null;
76
- if (index_1.ResolveIOServer.getSupportDB()) {
77
- exports.SupportFileVersions = index_1.ResolveIOServer.getSupportDB().model(exports.Files['versionCollection'], VersionSchema);
78
- }
79
65
  //------------- Report Builder Schema
80
66
  var rbLookups = [];
81
67
  var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/file.collection.ts"],"names":[],"mappings":";;AAAA,qCAAmD;AACnD,6CAAwC;AACxC,kCAA2C;AAG3C,uEA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E;IACnC,oBAAY,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,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,aAAK,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;AAE9C,IAAI,uBAAe,CAAC,YAAY,EAAE,EAAE;IACnC,oBAAY,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;CACrD;AAEY,QAAA,YAAY,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;AACrH,QAAA,mBAAmB,GAA0B,IAAI,CAAC;AAE7D,IAAI,uBAAe,CAAC,YAAY,EAAE,EAAE;IACnC,2BAAmB,GAAG,uBAAe,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;CACtG;AAED,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":"file.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { FileModel } from '../models/file.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/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\tname: {\n\t\ttype: String\n\t},\n\tsize: {\n\t\ttype: Number\n\t},\n\tkey: {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\torder: {\n\t\ttype: Number\n\t},\n\tstatus: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdefault: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends FileModel, Document {}\nexport const Files: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('files', DefaultSchema);\nexport let SupportFiles: Model<ResolveIOModel> = null;\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportFiles = ResolveIOServer.getSupportDB().model('files', DefaultSchema);\n}\n\nFiles['simplschema'] = new SimpleSchema(schema);\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportFiles['simplschema'] = new SimpleSchema(schema);\n}\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\nFiles['versionCollection'] = 'files.versions';\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportFiles['versionCollection'] = 'files.versions';\n}\n\nexport const FileVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(Files['versionCollection'], VersionSchema);\nexport let SupportFileVersions: Model<ResolveIOModel> = null;\n\nif (ResolveIOServer.getSupportDB()) {\n\tSupportFileVersions = ResolveIOServer.getSupportDB().model(Files['versionCollection'], VersionSchema);\n}\n\n//------------- Report Builder Schema\nlet rbLookups: LookupTables[] = [];\n\nlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\nFiles['rbSchema'] = buildRbSchema(rbSchema);"]}
1
+ {"version":3,"sources":["../../src/collections/file.collection.ts"],"names":[],"mappings":";;AAAA,qCAAmD;AACnD,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,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;KACZ;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEF,IAAM,aAAa,GAAG,IAAI,iBAAM,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;CAChB,CAAC,CAAC;AAGU,QAAA,KAAK,GAA0B,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAEtG,aAAK,CAAC,aAAa,CAAC,GAAG,IAAI,sBAAY,CAAC,MAAM,CAAC,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,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":"file.collection.js","sourcesContent":["import { Schema, Model, Document } from 'mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { FileModel } from '../models/file.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/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\tname: {\n\t\ttype: String\n\t},\n\tsize: {\n\t\ttype: Number\n\t},\n\tkey: {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\torder: {\n\t\ttype: Number\n\t},\n\tstatus: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdefault: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nconst DefaultSchema = new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\ninterface ResolveIOModel extends FileModel, Document {}\nexport const Files: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model('files', DefaultSchema);\n\nFiles['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\nFiles['versionCollection'] = 'files.versions';\n\nexport const FileVersions: Model<ResolveIOModel> = ResolveIOServer.getMainDB().model(Files['versionCollection'], VersionSchema);\n\n//------------- Report Builder Schema\nlet rbLookups: LookupTables[] = [];\n\nlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\nFiles['rbSchema'] = buildRbSchema(rbSchema);"]}
@@ -4,6 +4,5 @@ import { UserModel } from '../models/user.model';
4
4
  interface ResolveIOModel extends UserModel, PassportLocalDocument {
5
5
  }
6
6
  export declare const Users: PassportLocalModel<ResolveIOModel>;
7
- export declare let ClientUsers: PassportLocalModel<ResolveIOModel>;
8
7
  export declare const UserVersions: Model<ResolveIOModel>;
9
8
  export {};
@@ -22,6 +22,13 @@ var schema = {
22
22
  type: Date,
23
23
  optional: true
24
24
  },
25
+ readonly: {
26
+ type: Boolean,
27
+ optional: true
28
+ },
29
+ active: {
30
+ type: Boolean
31
+ },
25
32
  attempts: {
26
33
  type: Number,
27
34
  optional: true
@@ -58,67 +65,53 @@ var schema = {
58
65
  type: String
59
66
  },
60
67
  roles: {
61
- type: Object
62
- },
63
- 'roles.super_admin': {
64
- type: Boolean
65
- },
66
- 'roles.approvals': {
67
68
  type: Array
68
69
  },
69
- 'roles.approvals.$': {
70
- type: Object
71
- },
72
- 'roles.approvals.$.name': {
70
+ 'roles.$': {
73
71
  type: String
74
72
  },
75
- 'roles.approvals.$.type': {
76
- type: String
73
+ phonenumber: {
74
+ type: String,
75
+ optional: true
77
76
  },
78
- 'roles.approvals.$.accounting_code': {
79
- type: String
77
+ other: {
78
+ type: Object,
79
+ blackbox: true,
80
+ optional: true
80
81
  },
81
- 'roles.groups': {
82
- type: Array
82
+ assets: {
83
+ type: Array,
84
+ optional: true
83
85
  },
84
- 'roles.groups.$': {
86
+ 'assets.$': {
85
87
  type: Object
86
88
  },
87
- 'roles.groups.$.name': {
89
+ 'assets.$.type': {
88
90
  type: String
89
91
  },
90
- 'roles.groups.$.views': {
91
- type: Array
92
- },
93
- 'roles.groups.$.views.$': {
92
+ 'assets.$.id_asset': {
94
93
  type: String
95
94
  },
96
- 'roles.groups.$.yard': {
97
- type: String,
98
- optional: true
95
+ 'assets.$.asset_number': {
96
+ type: String
99
97
  },
100
- 'roles.notifications': {
101
- type: Array
98
+ 'assets.$.ownership': {
99
+ type: String
102
100
  },
103
- 'roles.notifications.$': {
101
+ 'assets.$.ownership_driver': {
104
102
  type: String
105
103
  },
106
- 'roles.miscs': {
107
- type: Array
104
+ 'assets.$.date_start': {
105
+ type: Date
108
106
  },
109
- 'roles.miscs.$': {
110
- type: String
107
+ 'assets.$.date_end': {
108
+ type: Date,
109
+ optional: true
111
110
  },
112
- active: Boolean,
113
- phonenumber: {
111
+ id_function: {
114
112
  type: String,
115
113
  optional: true
116
114
  },
117
- other: {
118
- type: Object,
119
- optional: true,
120
- blackbox: true
121
- },
122
115
  customers: {
123
116
  type: Array,
124
117
  optional: true,
@@ -174,10 +167,6 @@ DefaultSchema.plugin(passportLocalMongoose, {
174
167
  }
175
168
  });
176
169
  exports.Users = index_1.ResolveIOServer.getMainDB().model('users', DefaultSchema);
177
- exports.ClientUsers = null;
178
- if (index_1.ResolveIOServer.getSupportDB()) {
179
- exports.ClientUsers = index_1.ResolveIOServer.getSupportDB().model('client-users', DefaultSchema);
180
- }
181
170
  exports.Users['simplschema'] = new simpl_schema_1.default(schema);
182
171
  schema._id = {
183
172
  type: mongoose_1.Schema.Types.Mixed
@@ -1 +1 @@
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,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\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\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.$.name': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.accounting_code': {\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\tactive: Boolean,\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\toptional: true,\n\t\tblackbox: true\n\t},\n\tcustomers: {\n\t\ttype: Array,\n\t\toptional: true,\n\t},\n\t'customers.$': {\n\t\ttype: Object\n\t},\n\t'customers.$.id_customer': {\n\t\ttype: String\n\t},\n\t'customers.$.customer': {\n\t\ttype: String\n\t},\n\tid_customer: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcustomer: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcustomer_type: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdepartments: {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'departments.$': {\n\t\ttype: Object\n\t},\n\t'departments.$.id_department': {\n\t\ttype: String\n\t},\n\t'departments.$.department': {\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\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\nexport const Users: PassportLocalModel<ResolveIOModel> = (<any>ResolveIOServer.getMainDB()).model('users', DefaultSchema);\n\nexport let ClientUsers: PassportLocalModel<ResolveIOModel> = null;\n\nif (ResolveIOServer.getSupportDB()) {\n\tClientUsers = (<any>ResolveIOServer.getSupportDB()).model('client-users', DefaultSchema);\n}\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,GAA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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\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tactive: {\n\t\ttype: Boolean\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\troles: {\n\t\ttype: Array\n\t},\n\t'roles.$': {\n\t\ttype: String\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t},\n\tassets: {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'assets.$': {\n\t\ttype: Object\n\t},\n\t'assets.$.type': {\n\t\ttype: String\n\t},\n\t'assets.$.id_asset': {\n\t\ttype: String\n\t},\n\t'assets.$.asset_number': {\n\t\ttype: String\n\t},\n\t'assets.$.ownership': {\n\t\ttype: String\n\t},\n\t'assets.$.ownership_driver': {\n\t\ttype: String\n\t},\n\t'assets.$.date_start': {\n\t\ttype: Date\n\t},\n\t'assets.$.date_end': {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tid_function: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcustomers: {\n\t\ttype: Array,\n\t\toptional: true,\n\t},\n\t'customers.$': {\n\t\ttype: Object\n\t},\n\t'customers.$.id_customer': {\n\t\ttype: String\n\t},\n\t'customers.$.customer': {\n\t\ttype: String\n\t},\n\tid_customer: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcustomer: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tcustomer_type: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdepartments: {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'departments.$': {\n\t\ttype: Object\n\t},\n\t'departments.$.id_department': {\n\t\ttype: String\n\t},\n\t'departments.$.department': {\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\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);"]}
@@ -63,23 +63,6 @@ function loadServerCronJobs() {
63
63
  _a.sent();
64
64
  _a.label = 3;
65
65
  case 3:
66
- if (!!cronJobs.filter(function (a) { return a.name === 'Update Client Users'; }).length) return [3 /*break*/, 5];
67
- return [4 /*yield*/, cron_job_collection_1.CronJobs.create({
68
- _id: mongoose_1.Types.ObjectId().toHexString(),
69
- __v: 0,
70
- name: 'Update Client Users',
71
- "repeat": true,
72
- reoccuring: true,
73
- "time_to_run": "0 */1 * * *",
74
- "method_run": "updateClientUsers",
75
- "method_run_data": null,
76
- "next_run": new Date(),
77
- "running": false
78
- })];
79
- case 4:
80
- _a.sent();
81
- _a.label = 5;
82
- case 5:
83
66
  cronJobs.filter(function (a) { return a.running && a.next_run && a.next_run.getTime() < (new Date()).getTime(); }).forEach(function (cronJob) {
84
67
  cron_job_collection_1.CronJobs.updateOne({ _id: cronJob._id }, { $set: { running: false } }).exec();
85
68
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA8D;AAC9D,qCAAiC;AAEjC,SAAsB,kBAAkB;;;;;wBAExB,qBAAM,8BAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,EAAA;;oBAAzC,QAAQ,GAA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AAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAxE,CAAwE,CAAC,CAAC,OAAO,CAAC,UAAA,OAAO;wBAC7G,8BAAQ,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzE,CAAC,CAAC,CAAC;;;;;CACH;AAzCD,gDAyCC","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { Types } from 'mongoose';\n\nexport async function loadServerCronJobs() {\n\n\tlet cronJobs = await CronJobs.find({}).exec();\n\n\tif (!cronJobs.filter(a => a.name === 'Method Queue').length) {\n\t\tawait CronJobs.create(\n\t\t\t{\n\t\t\t\t_id: Types.ObjectId().toHexString(),\n\t\t\t\t__v: 0,\n\t\t\t\tname: 'Method Queue',\n\t\t\t\t\"repeat\" : true, \n\t\t\t\treoccuring: true,\n\t\t\t\t\"time_to_run\" : \"*/5 * * * * *\", \n\t\t\t\t\"method_run\" : \"methodQueue\", \n\t\t\t\t\"method_run_data\" : null, \n\t\t\t\t\"next_run\" : new Date(), \n\t\t\t\t\"running\" : false\n\t\t\t}\n\t\t);\n\t}\n\n\tif (!cronJobs.filter(a => a.name === 'Update Client Users').length) {\n\t\tawait CronJobs.create(\n\t\t\t{\n\t\t\t\t_id: Types.ObjectId().toHexString(),\n\t\t\t\t__v: 0,\n\t\t\t\tname: 'Update Client Users',\n\t\t\t\t\"repeat\" : true, \n\t\t\t\treoccuring: true,\n\t\t\t\t\"time_to_run\" : \"0 */1 * * *\", \n\t\t\t\t\"method_run\" : \"updateClientUsers\", \n\t\t\t\t\"method_run_data\" : null, \n\t\t\t\t\"next_run\" : new Date(), \n\t\t\t\t\"running\" : false\n\t\t\t}\n\t\t);\n\t}\n\n\tcronJobs.filter(a => a.running && a.next_run && a.next_run.getTime() < (new Date()).getTime()).forE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AAE,KAAK,EAAC,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzE,CAAC,CAAC,CAAC;;;;;CACH;AAxBD,gDAwBC","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { Types } from 'mongoose';\n\nexport async function loadServerCronJobs() {\n\n\tlet cronJobs = await CronJobs.find({}).exec();\n\n\tif (!cronJobs.filter(a => a.name === 'Method Queue').length) {\n\t\tawait CronJobs.create(\n\t\t\t{\n\t\t\t\t_id: Types.ObjectId().toHexString(),\n\t\t\t\t__v: 0,\n\t\t\t\tname: 'Method Queue',\n\t\t\t\t\"repeat\" : true, \n\t\t\t\treoccuring: true,\n\t\t\t\t\"time_to_run\" : \"*/5 * * * * *\", \n\t\t\t\t\"method_run\" : \"methodQueue\", \n\t\t\t\t\"method_run_data\" : null, \n\t\t\t\t\"next_run\" : new Date(), \n\t\t\t\t\"running\" : false\n\t\t\t}\n\t\t);\n\t}\n\n\tcronJobs.filter(a => a.running && a.next_run && a.next_run.getTime() < (new Date()).getTime()).forEach(cronJob => {\n\t\tCronJobs.updateOne({_id: cronJob._id}, {$set: {running: false}}).exec();\n\t});\n} "]}