@resolveio/server-lib 20.7.119 → 20.7.121

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 (216) hide show
  1. package/client-server-app.js +51 -1
  2. package/client-server-app.js.map +1 -1
  3. package/collections/app-status.collection.js +51 -1
  4. package/collections/app-status.collection.js.map +1 -1
  5. package/collections/counter.collection.js +55 -1
  6. package/collections/counter.collection.js.map +1 -1
  7. package/collections/cron-job-history.collection.js +136 -1
  8. package/collections/cron-job-history.collection.js.map +1 -1
  9. package/collections/cron-job.collection.js +87 -1
  10. package/collections/cron-job.collection.js.map +1 -1
  11. package/collections/email-history.collection.js +98 -1
  12. package/collections/email-history.collection.js.map +1 -1
  13. package/collections/email-verified.collection.js +60 -1
  14. package/collections/email-verified.collection.js.map +1 -1
  15. package/collections/file.collection.js +73 -1
  16. package/collections/file.collection.js.map +1 -1
  17. package/collections/flag-update.collection.js +56 -1
  18. package/collections/flag-update.collection.js.map +1 -1
  19. package/collections/flag.collection.js +56 -1
  20. package/collections/flag.collection.js.map +1 -1
  21. package/collections/log-method-latency.collection.js +72 -1
  22. package/collections/log-method-latency.collection.js.map +1 -1
  23. package/collections/log-subscription.collection.js +75 -1
  24. package/collections/log-subscription.collection.js.map +1 -1
  25. package/collections/log.collection.js +87 -1
  26. package/collections/log.collection.js.map +1 -1
  27. package/collections/logged-in-users.collection.js +66 -1
  28. package/collections/logged-in-users.collection.js.map +1 -1
  29. package/collections/monitor-cpu.collection.js +64 -1
  30. package/collections/monitor-cpu.collection.js.map +1 -1
  31. package/collections/monitor-function.collection.js +73 -1
  32. package/collections/monitor-function.collection.js.map +1 -1
  33. package/collections/monitor-memory.collection.js +76 -1
  34. package/collections/monitor-memory.collection.js.map +1 -1
  35. package/collections/monitor-mongo.collection.js +70 -1
  36. package/collections/monitor-mongo.collection.js.map +1 -1
  37. package/collections/notification.collection.js +56 -1
  38. package/collections/notification.collection.js.map +1 -1
  39. package/collections/report-builder-dashboard-builder.collection.js +108 -1
  40. package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
  41. package/collections/report-builder-library.collection.js +86 -1
  42. package/collections/report-builder-library.collection.js.map +1 -1
  43. package/collections/report-builder-report.collection.js +148 -1
  44. package/collections/report-builder-report.collection.js.map +1 -1
  45. package/collections/user-group.collection.js +88 -1
  46. package/collections/user-group.collection.js.map +1 -1
  47. package/collections/user-guide.collection.js +56 -1
  48. package/collections/user-guide.collection.js.map +1 -1
  49. package/collections/user.collection.js +265 -1
  50. package/collections/user.collection.js.map +1 -1
  51. package/cron/cron.js +97 -1
  52. package/cron/cron.js.map +1 -1
  53. package/fixtures/cron-jobs.js +95 -1
  54. package/fixtures/cron-jobs.js.map +1 -1
  55. package/fixtures/init.js +78 -1
  56. package/fixtures/init.js.map +1 -1
  57. package/http/auth.js +869 -1
  58. package/http/auth.js.map +1 -1
  59. package/http/health.js +11 -1
  60. package/http/health.js.map +1 -1
  61. package/http/home.js +114 -1
  62. package/http/home.js.map +1 -1
  63. package/index.js +18 -1
  64. package/index.js.map +1 -1
  65. package/managers/cron.manager.js +461 -1
  66. package/managers/cron.manager.js.map +1 -1
  67. package/managers/local-log.manager.js +79 -1
  68. package/managers/local-log.manager.js.map +1 -1
  69. package/managers/method.manager.js +1023 -1
  70. package/managers/method.manager.js.map +1 -1
  71. package/managers/mongo.manager.js +4223 -1
  72. package/managers/mongo.manager.js.map +1 -1
  73. package/managers/monitor.manager.js +534 -1
  74. package/managers/monitor.manager.js.map +1 -1
  75. package/managers/subscription.manager.js +1292 -1
  76. package/managers/subscription.manager.js.map +1 -1
  77. package/managers/websocket.manager.js +165 -1
  78. package/managers/websocket.manager.js.map +1 -1
  79. package/managers/worker-dispatcher.manager.js +335 -1
  80. package/managers/worker-dispatcher.manager.js.map +1 -1
  81. package/managers/worker-server.manager.js +292 -1
  82. package/managers/worker-server.manager.js.map +1 -1
  83. package/methods/accounts.js +302 -1
  84. package/methods/accounts.js.map +1 -1
  85. package/methods/aws.js +748 -1
  86. package/methods/aws.js.map +1 -1
  87. package/methods/collections.js +542 -1
  88. package/methods/collections.js.map +1 -1
  89. package/methods/counters.js +111 -1
  90. package/methods/counters.js.map +1 -1
  91. package/methods/cron-jobs.js +1476 -1
  92. package/methods/cron-jobs.js.map +1 -1
  93. package/methods/flag-updates.js +8 -1
  94. package/methods/flag-updates.js.map +1 -1
  95. package/methods/flags.js +8 -1
  96. package/methods/flags.js.map +1 -1
  97. package/methods/logs.js +417 -1
  98. package/methods/logs.js.map +1 -1
  99. package/methods/monitor.js +543 -1
  100. package/methods/monitor.js.map +1 -1
  101. package/methods/pdf.js +742 -1
  102. package/methods/pdf.js.map +1 -1
  103. package/methods/report-builder.js +840 -1
  104. package/methods/report-builder.js.map +1 -1
  105. package/methods/support.js +232 -1
  106. package/methods/support.js.map +1 -1
  107. package/models/app-status.model.js +3 -1
  108. package/models/app-status.model.js.map +1 -1
  109. package/models/billing-logged-in-users.model.js +3 -1
  110. package/models/billing-logged-in-users.model.js.map +1 -1
  111. package/models/collection-document.model.js +3 -1
  112. package/models/collection-document.model.js.map +1 -1
  113. package/models/counter.model.js +3 -1
  114. package/models/counter.model.js.map +1 -1
  115. package/models/cron-job-history.model.js +3 -1
  116. package/models/cron-job-history.model.js.map +1 -1
  117. package/models/cron-job.model.js +3 -1
  118. package/models/cron-job.model.js.map +1 -1
  119. package/models/dialog.model.js +3 -1
  120. package/models/dialog.model.js.map +1 -1
  121. package/models/email-history.model.js +15 -1
  122. package/models/email-history.model.js.map +1 -1
  123. package/models/email-verified.model.js +3 -1
  124. package/models/email-verified.model.js.map +1 -1
  125. package/models/file.model.js +3 -1
  126. package/models/file.model.js.map +1 -1
  127. package/models/flag-update.model.js +3 -1
  128. package/models/flag-update.model.js.map +1 -1
  129. package/models/flag.model.js +3 -1
  130. package/models/flag.model.js.map +1 -1
  131. package/models/log-method-latency.model.js +3 -1
  132. package/models/log-method-latency.model.js.map +1 -1
  133. package/models/log-subscription.model.js +3 -1
  134. package/models/log-subscription.model.js.map +1 -1
  135. package/models/log.model.js +3 -1
  136. package/models/log.model.js.map +1 -1
  137. package/models/logged-in-users.model.js +3 -1
  138. package/models/logged-in-users.model.js.map +1 -1
  139. package/models/method-response.model.js +3 -1
  140. package/models/method-response.model.js.map +1 -1
  141. package/models/method.model.d.ts +0 -1
  142. package/models/method.model.js +3 -1
  143. package/models/method.model.js.map +1 -1
  144. package/models/monitor-cpu.model.js +3 -1
  145. package/models/monitor-cpu.model.js.map +1 -1
  146. package/models/monitor-function.model.js +3 -1
  147. package/models/monitor-function.model.js.map +1 -1
  148. package/models/monitor-memory.model.js +3 -1
  149. package/models/monitor-memory.model.js.map +1 -1
  150. package/models/monitor-mongo.model.js +3 -1
  151. package/models/monitor-mongo.model.js.map +1 -1
  152. package/models/notification.model.js +3 -1
  153. package/models/notification.model.js.map +1 -1
  154. package/models/pagination.model.js +23 -1
  155. package/models/pagination.model.js.map +1 -1
  156. package/models/permission.model.js +3 -1
  157. package/models/permission.model.js.map +1 -1
  158. package/models/report-builder-dashboard-builder.model.js +3 -1
  159. package/models/report-builder-dashboard-builder.model.js.map +1 -1
  160. package/models/report-builder-library.model.js +3 -1
  161. package/models/report-builder-library.model.js.map +1 -1
  162. package/models/report-builder-report.model.js +3 -1
  163. package/models/report-builder-report.model.js.map +1 -1
  164. package/models/report-builder.model.js +3 -1
  165. package/models/report-builder.model.js.map +1 -1
  166. package/models/select-data-label.model.js +3 -1
  167. package/models/select-data-label.model.js.map +1 -1
  168. package/models/server-message.model.js +3 -1
  169. package/models/server-message.model.js.map +1 -1
  170. package/models/subscription.model.js +3 -1
  171. package/models/subscription.model.js.map +1 -1
  172. package/models/support-ticket.model.js +3 -1
  173. package/models/support-ticket.model.js.map +1 -1
  174. package/models/user-group.model.js +3 -1
  175. package/models/user-group.model.js.map +1 -1
  176. package/models/user-guide.model.js +3 -1
  177. package/models/user-guide.model.js.map +1 -1
  178. package/models/user.model.js +3 -1
  179. package/models/user.model.js.map +1 -1
  180. package/package.json +1 -1
  181. package/public_api.js +77 -1
  182. package/public_api.js.map +1 -1
  183. package/publications/app-status.js +16 -1
  184. package/publications/app-status.js.map +1 -1
  185. package/publications/cron-jobs.js +32 -1
  186. package/publications/cron-jobs.js.map +1 -1
  187. package/publications/files.js +36 -1
  188. package/publications/files.js.map +1 -1
  189. package/publications/flags-update.js +22 -1
  190. package/publications/flags-update.js.map +1 -1
  191. package/publications/flags.js +22 -1
  192. package/publications/flags.js.map +1 -1
  193. package/publications/logs.js +164 -1
  194. package/publications/logs.js.map +1 -1
  195. package/publications/notifications.js +16 -1
  196. package/publications/notifications.js.map +1 -1
  197. package/publications/report-builder-dashboard-builders.js +42 -1
  198. package/publications/report-builder-dashboard-builders.js.map +1 -1
  199. package/publications/report-builder-libraries.js +90 -1
  200. package/publications/report-builder-libraries.js.map +1 -1
  201. package/publications/report-builder-reports.js +50 -1
  202. package/publications/report-builder-reports.js.map +1 -1
  203. package/publications/super-admin.js +16 -1
  204. package/publications/super-admin.js.map +1 -1
  205. package/publications/user-groups.js +16 -1
  206. package/publications/user-groups.js.map +1 -1
  207. package/publications/user-guides.js +16 -1
  208. package/publications/user-guides.js.map +1 -1
  209. package/resolveio-server-app.js +176 -1
  210. package/resolveio-server-app.js.map +1 -1
  211. package/server-app.js +1159 -1
  212. package/server-app.js.map +1 -1
  213. package/util/common.js +632 -1
  214. package/util/common.js.map +1 -1
  215. package/util/schema-report-builder.js +454 -1
  216. package/util/schema-report-builder.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":["mongo_manager_1","require","resolveio_server_app_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","name","landing_page","permissions","Array","permissions.$","Object","permissions.$.name","permissions.$.selected","Boolean","permissions.$.views","permissions.$.views.$","permissions.$.views.$.link","permissions.$.views.$.selected","notifications","notifications.$","blackbox","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","create","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","UserGroups","collection_main","createIndex","UserGroupVersions","collection_version","setImmediate"],"mappings":"wHAAA,IAAAA,gBAAAC,QAAA,2BAAA,EAEAC,uBAAAD,QAAA,yBAAA,EAEIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,aAAc,CACbT,KAAMC,OACNC,SAAU,CAAA,C,EAEXQ,YAAa,CACZV,KAAMW,K,EAEPC,gBAAiB,CAChBZ,KAAOa,M,EAERC,qBAAsB,CACrBd,KAAMC,M,EAEPc,yBAA0B,CACzBf,KAAMgB,O,EAEPC,sBAAuB,CACtBjB,KAAMW,K,EAEPO,wBAAyB,CACxBlB,KAAMa,M,EAEPM,6BAA8B,CAC7BnB,KAAMC,M,EAEPmB,iCAAkC,CACjCpB,KAAMgB,O,EAEPK,cAAe,CACdrB,KAAMW,K,EAEPW,kBAAmB,CAClBtB,KAAOa,OACPU,SAAU,CAAA,C,GASZ,SAASC,uBACR,IACOC,EADH5B,uBAAA6B,iBAAmB7B,uBAAA6B,gBAAgBC,UAAS,GAAMhC,gBAAAiC,mBAC/CH,EAAQ9B,gBAAAiC,kBAAkBC,OAAuB,CACtDC,eAAgB,cAChBhC,OAAQA,OACRiC,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,WAAad,EAAMe,gBACnBF,QAAAC,WAAWE,YAAY,CAACjC,KAAM,CAAC,CAAC,EAChC8B,QAAAI,kBAAoBjB,EAAMkB,oBAG1BC,aAAa,WACZpB,qBAAoB,CACrB,CAAC,CAEH,CA3BWc,QAAAC,WAAqD,KACrDD,QAAAI,kBAA4D,KAEvElB,qBAAoB","file":"user-group.collection.js","sourcesContent":["import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\tlanding_page: {\n\t\ttype: String,\n\t\toptional: true\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\tblackbox: true\n\t},\n};\n\nexport let UserGroups: MongoManagerCollection<UserGroupModel> = null;\nexport let UserGroupVersions: MongoManagerCollection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGroupModel>({\n\t\t\tcollectionName: 'user-groups',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;AAAA,2DAAsF;AAEtF,gEAA0D;AAE1D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAG,MAAM;KACb;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,OAAO;KACb;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,KAAK;KACX;IACD,uBAAuB,EAAE;QACxB,IAAI,EAAE,MAAM;KACZ;IACD,4BAA4B,EAAE;QAC7B,IAAI,EAAE,MAAM;KACZ;IACD,gCAAgC,EAAE;QACjC,IAAI,EAAE,OAAO;KACb;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAG,MAAM;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,UAAU,GAA2C,IAAI,CAAC;AAC1D,QAAA,iBAAiB,GAA2C,IAAI,CAAC;AAE5E,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,sCAAe,IAAI,sCAAe,CAAC,SAAS,EAAE,IAAI,iCAAiB,EAAE;QACxE,IAAM,KAAK,GAAG,iCAAiB,CAAC,MAAM,CAAiB;YACtD,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,IAAI;YACtB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,kBAAU,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAClC,yBAAiB,GAAG,KAAK,CAAC,kBAAkB,CAAC;KAC7C;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\tlanding_page: {\n\t\ttype: String,\n\t\toptional: true\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\tblackbox: true\n\t},\n};\n\nexport let UserGroups: MongoManagerCollection<UserGroupModel> = null;\nexport let UserGroupVersions: MongoManagerCollection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGroupModel>({\n\t\t\tcollectionName: 'user-groups',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
@@ -1,2 +1,57 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserGuides=void 0;var mongo_manager_1=require("../managers/mongo.manager"),resolveio_server_app_1=require("../resolveio-server-app"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},link:{type:String},label:{type:String},message:{type:String}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()&&mongo_manager_1.MongoManagerModel?(e=mongo_manager_1.MongoManagerModel.create({collectionName:"user-guides",schema:schema,useVersionCollection:!1,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!1,checkSchema:!0,collectionOptions:null}),exports.UserGuides=e.collection_main):setImmediate(function(){initializeCollection()})}exports.UserGuides=null,initializeCollection();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserGuides = void 0;
4
+ var mongo_manager_1 = require("../managers/mongo.manager");
5
+ var resolveio_server_app_1 = require("../resolveio-server-app");
6
+ var schema = {
7
+ _id: {
8
+ type: String,
9
+ optional: true
10
+ },
11
+ __v: {
12
+ type: Number,
13
+ optional: true
14
+ },
15
+ updatedAt: {
16
+ type: Date,
17
+ optional: true
18
+ },
19
+ createdAt: {
20
+ type: Date,
21
+ optional: true
22
+ },
23
+ link: {
24
+ type: String
25
+ },
26
+ label: {
27
+ type: String
28
+ },
29
+ message: {
30
+ type: String
31
+ },
32
+ };
33
+ exports.UserGuides = null;
34
+ initializeCollection();
35
+ function initializeCollection() {
36
+ if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
37
+ var model = mongo_manager_1.MongoManagerModel.create({
38
+ collectionName: 'user-guides',
39
+ schema: schema,
40
+ useVersionCollection: false,
41
+ useReportBuilder: false,
42
+ reportBuilderLookupTables: [],
43
+ timestamps: true,
44
+ createLogs: false,
45
+ checkSchema: true,
46
+ collectionOptions: null
47
+ });
48
+ exports.UserGuides = model.collection_main;
49
+ }
50
+ else {
51
+ setImmediate(function () {
52
+ initializeCollection();
53
+ });
54
+ }
55
+ }
56
+
2
57
  //# sourceMappingURL=user-guide.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":["mongo_manager_1","require","resolveio_server_app_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","link","label","message","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","create","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","UserGuides","collection_main","setImmediate"],"mappings":"8FAAC,IAAAA,gBAAAC,QAAA,2BAAA,EAEDC,uBAAAD,QAAA,yBAAA,EAEIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,MAAO,CACNT,KAAMC,M,EAEPS,QAAS,CACRV,KAAMC,M,GAQR,SAASU,uBACR,IACOC,EADHf,uBAAAgB,iBAAmBhB,uBAAAgB,gBAAgBC,UAAS,GAAMnB,gBAAAoB,mBAC/CH,EAAQjB,gBAAAoB,kBAAkBC,OAAuB,CACtDC,eAAgB,cAChBnB,OAAQA,OACRoB,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,WAAad,EAAMe,iBAGnBC,aAAa,WACZjB,qBAAoB,CACrB,CAAC,CAEH,CAxBWc,QAAAC,WAAqD,KAEhEf,qBAAoB","file":"user-guide.collection.js","sourcesContent":[" import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\nexport let UserGuides: MongoManagerCollection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGuideModel>({\n\t\t\tcollectionName: 'user-guides',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAC,2DAAsF;AAEvF,gEAA0D;AAE1D,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;AAES,QAAA,UAAU,GAA2C,IAAI,CAAC;AAErE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,sCAAe,IAAI,sCAAe,CAAC,SAAS,EAAE,IAAI,iCAAiB,EAAE;QACxE,IAAM,KAAK,GAAG,iCAAiB,CAAC,MAAM,CAAiB;YACtD,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,KAAK;YAC3B,gBAAgB,EAAE,KAAK;YACvB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;KACnC;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user-guide.collection.js","sourcesContent":[" import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\nexport let UserGuides: MongoManagerCollection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGuideModel>({\n\t\t\tcollectionName: 'user-guides',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
@@ -1,2 +1,266 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserVersions=exports.Users=void 0;var mongo_manager_1=require("../managers/mongo.manager"),resolveio_server_app_1=require("../resolveio-server-app"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},roles:{type:Object},"roles.super_admin":{type:Boolean},"roles.approvals":{type:Array},"roles.approvals.$":{type:Object},"roles.approvals.$.type":{type:String},"roles.approvals.$.key_1":{type:String,optional:!0},"roles.approvals.$.key_2":{type:String,optional:!0},"roles.approvals.$.key_3":{type:String,optional:!0},"roles.approvals.$.name":{type:String},"roles.groups":{type:Array},"roles.groups.$":{type:Object},"roles.groups.$.name":{type:String},"roles.groups.$.views":{type:Array},"roles.groups.$.views.$":{type:String},"roles.groups.$.yards":{type:Array,optional:!0},"roles.groups.$.yards.$":{type:String},"roles.notifications":{type:Array},"roles.notifications.$":{type:String},"roles.miscs":{type:Array},"roles.miscs.$":{type:String},username:{type:String,optional:!0},email:{type:String,optional:!0},fullname:{type:String},active:{type:Boolean},phonenumber:{type:String,optional:!0},readonly:{type:Boolean,optional:!0},other:{type:Object,blackbox:!0},settings:{type:Object,optional:!0},"settings.table_color":{type:String},"settings.table_font_color":{type:String},"settings.secondary_table_color":{type:String},"settings.secondary_table_font_color":{type:String},"settings.tertiary_table_color":{type:String},"settings.tertiary_table_font_color":{type:String},"settings.font_size":{type:Number},"settings.collapsable_menu":{type:Boolean},"settings.entries_per_page":{type:String},"settings.warning_color":{type:String},"settings.warning_font_color":{type:String},"settings.warning_hover_color":{type:String},"settings.success_color":{type:String},"settings.success_font_color":{type:String},"settings.success_hover_color":{type:String},"settings.danger_color":{type:String},"settings.danger_font_color":{type:String},"settings.danger_hover_color":{type:String},"settings.info_color":{type:String},"settings.info_font_color":{type:String},"settings.info_hover_color":{type:String},"settings.primary_color":{type:String},"settings.primary_font_color":{type:String},"settings.primary_hover_color":{type:String},"settings.secondary_color":{type:String},"settings.secondary_font_color":{type:String},"settings.secondary_hover_color":{type:String},"settings.routing_preference":{type:String},"settings.opening_route":{type:String},salt:{type:String},hash:{type:String},attempts:{type:Number},last:{type:Date,optional:!0},services:{type:Object,optional:!0},"services.enrollment":{type:String,optional:!0},"services.forgot_password":{type:String,optional:!0},"services.reset_password":{type:String,optional:!0},is_customer:{type:Boolean,optional:!0}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()&&mongo_manager_1.MongoManagerModel?(e=mongo_manager_1.MongoManagerModel.create({collectionName:"users",schema:schema,useVersionCollection:!0,useReportBuilder:!0,reportBuilderLookupTables:[],timestamps:!0,createLogs:!0,checkSchema:!0,collectionOptions:null}),exports.Users=e.collection_main,exports.Users.createIndex({fullname:1}),exports.Users.createIndex({active:1}),exports.UserVersions=e.collection_version):setImmediate(function(){initializeCollection()})}exports.Users=null,exports.UserVersions=null,initializeCollection();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserVersions = exports.Users = void 0;
4
+ var mongo_manager_1 = require("../managers/mongo.manager");
5
+ var resolveio_server_app_1 = require("../resolveio-server-app");
6
+ var schema = {
7
+ _id: {
8
+ type: String,
9
+ optional: true
10
+ },
11
+ __v: {
12
+ type: Number,
13
+ optional: true
14
+ },
15
+ updatedAt: {
16
+ type: Date,
17
+ optional: true
18
+ },
19
+ createdAt: {
20
+ type: Date,
21
+ optional: true
22
+ },
23
+ roles: {
24
+ type: Object
25
+ },
26
+ 'roles.super_admin': {
27
+ type: Boolean
28
+ },
29
+ 'roles.approvals': {
30
+ type: Array
31
+ },
32
+ 'roles.approvals.$': {
33
+ type: Object
34
+ },
35
+ 'roles.approvals.$.type': {
36
+ type: String
37
+ },
38
+ 'roles.approvals.$.key_1': {
39
+ type: String,
40
+ optional: true
41
+ },
42
+ 'roles.approvals.$.key_2': {
43
+ type: String,
44
+ optional: true
45
+ },
46
+ 'roles.approvals.$.key_3': {
47
+ type: String,
48
+ optional: true
49
+ },
50
+ 'roles.approvals.$.name': {
51
+ type: String
52
+ },
53
+ 'roles.groups': {
54
+ type: Array
55
+ },
56
+ 'roles.groups.$': {
57
+ type: Object
58
+ },
59
+ 'roles.groups.$.name': {
60
+ type: String
61
+ },
62
+ 'roles.groups.$.views': {
63
+ type: Array
64
+ },
65
+ 'roles.groups.$.views.$': {
66
+ type: String
67
+ },
68
+ 'roles.groups.$.yards': {
69
+ type: Array,
70
+ optional: true
71
+ },
72
+ 'roles.groups.$.yards.$': {
73
+ type: String
74
+ },
75
+ 'roles.notifications': {
76
+ type: Array
77
+ },
78
+ 'roles.notifications.$': {
79
+ type: String
80
+ },
81
+ 'roles.miscs': {
82
+ type: Array
83
+ },
84
+ 'roles.miscs.$': {
85
+ type: String
86
+ },
87
+ username: {
88
+ type: String,
89
+ optional: true
90
+ },
91
+ email: {
92
+ type: String,
93
+ optional: true
94
+ },
95
+ fullname: {
96
+ type: String
97
+ },
98
+ active: {
99
+ type: Boolean
100
+ },
101
+ phonenumber: {
102
+ type: String,
103
+ optional: true
104
+ },
105
+ readonly: {
106
+ type: Boolean,
107
+ optional: true
108
+ },
109
+ other: {
110
+ type: Object,
111
+ blackbox: true
112
+ },
113
+ settings: {
114
+ type: Object,
115
+ optional: true
116
+ },
117
+ 'settings.table_color': {
118
+ type: String
119
+ },
120
+ 'settings.table_font_color': {
121
+ type: String
122
+ },
123
+ 'settings.secondary_table_color': {
124
+ type: String
125
+ },
126
+ 'settings.secondary_table_font_color': {
127
+ type: String
128
+ },
129
+ 'settings.tertiary_table_color': {
130
+ type: String
131
+ },
132
+ 'settings.tertiary_table_font_color': {
133
+ type: String
134
+ },
135
+ 'settings.font_size': {
136
+ type: Number
137
+ },
138
+ 'settings.collapsable_menu': {
139
+ type: Boolean
140
+ },
141
+ 'settings.entries_per_page': {
142
+ type: String
143
+ },
144
+ 'settings.warning_color': {
145
+ type: String
146
+ },
147
+ 'settings.warning_font_color': {
148
+ type: String
149
+ },
150
+ 'settings.warning_hover_color': {
151
+ type: String
152
+ },
153
+ 'settings.success_color': {
154
+ type: String
155
+ },
156
+ 'settings.success_font_color': {
157
+ type: String
158
+ },
159
+ 'settings.success_hover_color': {
160
+ type: String
161
+ },
162
+ 'settings.danger_color': {
163
+ type: String
164
+ },
165
+ 'settings.danger_font_color': {
166
+ type: String
167
+ },
168
+ 'settings.danger_hover_color': {
169
+ type: String
170
+ },
171
+ 'settings.info_color': {
172
+ type: String
173
+ },
174
+ 'settings.info_font_color': {
175
+ type: String
176
+ },
177
+ 'settings.info_hover_color': {
178
+ type: String
179
+ },
180
+ 'settings.primary_color': {
181
+ type: String
182
+ },
183
+ 'settings.primary_font_color': {
184
+ type: String
185
+ },
186
+ 'settings.primary_hover_color': {
187
+ type: String
188
+ },
189
+ 'settings.secondary_color': {
190
+ type: String
191
+ },
192
+ 'settings.secondary_font_color': {
193
+ type: String
194
+ },
195
+ 'settings.secondary_hover_color': {
196
+ type: String
197
+ },
198
+ 'settings.routing_preference': {
199
+ type: String
200
+ },
201
+ 'settings.opening_route': {
202
+ type: String
203
+ },
204
+ salt: {
205
+ type: String
206
+ },
207
+ hash: {
208
+ type: String
209
+ },
210
+ attempts: {
211
+ type: Number
212
+ },
213
+ last: {
214
+ type: Date,
215
+ optional: true
216
+ },
217
+ services: {
218
+ type: Object,
219
+ optional: true
220
+ },
221
+ 'services.enrollment': {
222
+ type: String,
223
+ optional: true
224
+ },
225
+ 'services.forgot_password': {
226
+ type: String,
227
+ optional: true
228
+ },
229
+ 'services.reset_password': {
230
+ type: String,
231
+ optional: true
232
+ },
233
+ is_customer: {
234
+ type: Boolean,
235
+ optional: true
236
+ }
237
+ };
238
+ exports.Users = null;
239
+ exports.UserVersions = null;
240
+ initializeCollection();
241
+ function initializeCollection() {
242
+ if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
243
+ var model = mongo_manager_1.MongoManagerModel.create({
244
+ collectionName: 'users',
245
+ schema: schema,
246
+ useVersionCollection: true,
247
+ useReportBuilder: true,
248
+ reportBuilderLookupTables: [],
249
+ timestamps: true,
250
+ createLogs: true,
251
+ checkSchema: true,
252
+ collectionOptions: null
253
+ });
254
+ exports.Users = model.collection_main;
255
+ exports.Users.createIndex({ fullname: 1 });
256
+ exports.Users.createIndex({ active: 1 });
257
+ exports.UserVersions = model.collection_version;
258
+ }
259
+ else {
260
+ setImmediate(function () {
261
+ initializeCollection();
262
+ });
263
+ }
264
+ }
265
+
2
266
  //# sourceMappingURL=user.collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":["mongo_manager_1","require","resolveio_server_app_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","roles","Object","roles.super_admin","Boolean","roles.approvals","Array","roles.approvals.$","roles.approvals.$.type","roles.approvals.$.key_1","roles.approvals.$.key_2","roles.approvals.$.key_3","roles.approvals.$.name","roles.groups","roles.groups.$","roles.groups.$.name","roles.groups.$.views","roles.groups.$.views.$","roles.groups.$.yards","roles.groups.$.yards.$","roles.notifications","roles.notifications.$","roles.miscs","roles.miscs.$","username","email","fullname","active","phonenumber","readonly","other","blackbox","settings","settings.table_color","settings.table_font_color","settings.secondary_table_color","settings.secondary_table_font_color","settings.tertiary_table_color","settings.tertiary_table_font_color","settings.font_size","settings.collapsable_menu","settings.entries_per_page","settings.warning_color","settings.warning_font_color","settings.warning_hover_color","settings.success_color","settings.success_font_color","settings.success_hover_color","settings.danger_color","settings.danger_font_color","settings.danger_hover_color","settings.info_color","settings.info_font_color","settings.info_hover_color","settings.primary_color","settings.primary_font_color","settings.primary_hover_color","settings.secondary_color","settings.secondary_font_color","settings.secondary_hover_color","settings.routing_preference","settings.opening_route","salt","hash","attempts","last","services","services.enrollment","services.forgot_password","services.reset_password","is_customer","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","create","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","Users","collection_main","createIndex","UserVersions","collection_version","setImmediate"],"mappings":"8GAAA,IAAAA,gBAAAC,QAAA,2BAAA,EAEAC,uBAAAD,QAAA,yBAAA,EAEIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,MAAO,CACNR,KAAMS,M,EAEPC,oBAAqB,CACpBV,KAAMW,O,EAEPC,kBAAmB,CAClBZ,KAAMa,K,EAEPC,oBAAqB,CACpBd,KAAMS,M,EAEPM,yBAA0B,CACzBf,KAAMC,M,EAEPe,0BAA2B,CAC1BhB,KAAMC,OACNC,SAAU,CAAA,C,EAEXe,0BAA2B,CAC1BjB,KAAMC,OACNC,SAAU,CAAA,C,EAEXgB,0BAA2B,CAC1BlB,KAAMC,OACNC,SAAU,CAAA,C,EAEXiB,yBAA0B,CACzBnB,KAAMC,M,EAEPmB,eAAgB,CACfpB,KAAMa,K,EAEPQ,iBAAkB,CACjBrB,KAAMS,M,EAEPa,sBAAuB,CACtBtB,KAAMC,M,EAEPsB,uBAAwB,CACvBvB,KAAMa,K,EAEPW,yBAA0B,CACzBxB,KAAMC,M,EAEPwB,uBAAwB,CACvBzB,KAAMa,MACNX,SAAU,CAAA,C,EAEXwB,yBAA0B,CACzB1B,KAAMC,M,EAEP0B,sBAAuB,CACtB3B,KAAMa,K,EAEPe,wBAAyB,CACxB5B,KAAMC,M,EAEP4B,cAAe,CACd7B,KAAMa,K,EAEPiB,gBAAiB,CAChB9B,KAAMC,M,EAEP8B,SAAU,CACT/B,KAAMC,OACNC,SAAU,CAAA,C,EAEX8B,MAAO,CACNhC,KAAMC,OACNC,SAAU,CAAA,C,EAEX+B,SAAU,CACTjC,KAA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EPmE,yBAA0B,CACzBpE,KAAMC,M,EAEPoE,KAAM,CACLrE,KAAMC,M,EAEPqE,KAAM,CACLtE,KAAMC,M,EAEPsE,SAAU,CACTvE,KAAMI,M,EAEPoE,KAAM,CACLxE,KAAMM,KACNJ,SAAU,CAAA,C,EAEXuE,SAAU,CACTzE,KAAMS,OACNP,SAAU,CAAA,C,EAEXwE,sBAAuB,CACtB1E,KAAMC,OACNC,SAAU,CAAA,C,EAEXyE,2BAA4B,CAC3B3E,KAAMC,OACNC,SAAU,CAAA,C,EAEX0E,0BAA2B,CAC1B5E,KAAMC,OACNC,SAAU,CAAA,C,EAEX2E,YAAa,CACZ7E,KAAMW,QACNT,SAAU,CAAA,C,GASZ,SAAS4E,uBACR,IACOC,EADHlF,uBAAAmF,iBAAmBnF,uBAAAmF,gBAAgBC,UAAS,GAAMtF,gBAAAuF,mBAC/CH,EAAQpF,gBAAAuF,kBAAkBC,OAAkB,CACjDC,eAAgB,QAChBtF,OAAQA,OACRuF,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EAEDC,QAAAC,MAA+Cd,EAAMe,gBACrDF,QAAAC,MAAME,YAAY,CAAC9D,SAAU,CAAC,CAAC,EAC/B2D,QAAAC,MAAME,YAAY,CAAC7D,OAAQ,CAAC,CAAC,EAC7B0D,QAAAI,aAAsDjB,EAAMkB,oBAG5DC,aAAa,WACZpB,qBAAoB,CACrB,CAAC,CAEH,CA7BWc,QAAAC,MAA+C,KAC/CD,QAAAI,aAAsD,KAEjElB,qBAAoB","file":"user.collection.js","sourcesContent":["import { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\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\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\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\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\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,2DAA0F;AAE1F,gEAA0D;AAE1D,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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;IAC5B,IAAI,sCAAe,IAAI,sCAAe,CAAC,SAAS,EAAE,IAAI,iCAAiB,EAAE;QACxE,IAAM,KAAK,GAAG,iCAAiB,CAAC,MAAM,CAAY;YACjD,cAAc,EAAE,OAAO;YACvB,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,IAAI;YACtB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QAEH,aAAK,GAA0C,KAAK,CAAC,eAAe,CAAC;QACrE,aAAK,CAAC,WAAW,CAAC,EAAC,QAAQ,EAAE,CAAC,EAAC,CAAC,CAAC;QACjC,aAAK,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;QAC/B,oBAAY,GAA0C,KAAK,CAAC,kBAAkB,CAAC;KAC/E;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\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\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\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\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\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
package/cron/cron.js CHANGED
@@ -1,2 +1,98 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CronJobManager=void 0;var cron_1=require("cron"),CronJobManager=function(){function CronJobManager(o,t,n,r,e,s,a,c){this.jobs={},o&&t&&n&&this.add(o,t,n,r,e,s,a,c)}return CronJobManager.prototype.getJob=function(o){return this.jobs[o]},CronJobManager.prototype.getJobs=function(){return Object.keys(this.jobs)},CronJobManager.prototype.add=function(t,n,o,r,e,s,a,c){if(("string"==typeof n||n instanceof Date)&&"string"==typeof t&&o instanceof Function)try{this.jobs[t]&&(this.delete(t),console.warn("".concat(t," already existed and was deleted from the manager..."))),this.jobs[t]=new cron_1.CronJob(n,o,r,e,s,a,c)}catch(o){console.error("crontab: ".concat(n," possibly not valid, job ").concat(t," not started...").concat(o.message))}else console.warn("couldn't add: ".concat(t," improper arguments"))},CronJobManager.prototype.update=function(o,t,n,r,e,s,a,c){var i;this.jobs[o]?(i=this.jobs[o].running,this.jobs[o].stop(),t=new cron_1.CronJob(t,n,r,e||i,s,a,c),delete this.jobs[o],this.jobs[o]=t):console.warn("Job with key ".concat(o," does not exist."))},CronJobManager.prototype.delete=function(t){try{this.jobs[t].stop(),delete this.jobs[t]}catch(o){console.error(new Date,"Error in CronJobManager (delete): Trying to stop job: ".concat(t,": ").concat(o))}},CronJobManager.prototype.start=function(t){try{this.jobs[t].running?console.warn("".concat(t," job already running")):this.jobs[t].start()}catch(o){console.error("couldn't start job: ".concat(t,": ").concat(o))}},CronJobManager.prototype.stop=function(t){try{this.jobs[t].running?this.jobs[t].stop():console.warn("".concat(t," job already stopped"))}catch(o){console.error("couldn't stop job: ".concat(t,": ").concat(o))}},CronJobManager.prototype.stopAll=function(){for(var o in this.jobs)this.jobs[o].stop()},CronJobManager.prototype.exists=function(o){return!!this.jobs[o]},CronJobManager}();exports.CronJobManager=CronJobManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CronJobManager = void 0;
4
+ var cron_1 = require("cron");
5
+ var CronJobManager = /** @class */ (function () {
6
+ function CronJobManager(key, tab, task, onComplete, start, timeZone, context, runOnInit) {
7
+ this.jobs = {};
8
+ if (key && tab && task) {
9
+ this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);
10
+ }
11
+ }
12
+ CronJobManager.prototype.getJob = function (key) {
13
+ return this.jobs[key];
14
+ };
15
+ CronJobManager.prototype.getJobs = function () {
16
+ return Object.keys(this.jobs);
17
+ };
18
+ CronJobManager.prototype.add = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
19
+ if ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {
20
+ try {
21
+ if (this.jobs[key]) {
22
+ this.delete(key);
23
+ console.warn("".concat(key, " already existed and was deleted from the manager..."));
24
+ }
25
+ this.jobs[key] = new cron_1.CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);
26
+ }
27
+ catch (fooBaredByUser) {
28
+ console.error("crontab: ".concat(tab, " possibly not valid, job ").concat(key, " not started...").concat(fooBaredByUser.message));
29
+ }
30
+ }
31
+ else {
32
+ console.warn("couldn't add: ".concat(key, " improper arguments"));
33
+ }
34
+ };
35
+ CronJobManager.prototype.update = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
36
+ // Check if the job exists
37
+ if (!this.jobs[key]) {
38
+ console.warn("Job with key ".concat(key, " does not exist."));
39
+ return;
40
+ }
41
+ // Store the running state
42
+ var wasRunning = this.jobs[key].running;
43
+ // Stop the existing job
44
+ this.jobs[key].stop();
45
+ // Create a new job instance with the updated properties
46
+ var newJob = new cron_1.CronJob(tab, task, onComplete, start || wasRunning, timeZone, context, runOnInit);
47
+ delete this.jobs[key];
48
+ // Replace the old job with the new one
49
+ this.jobs[key] = newJob;
50
+ };
51
+ CronJobManager.prototype.delete = function (key) {
52
+ try {
53
+ this.jobs[key].stop();
54
+ delete this.jobs[key];
55
+ }
56
+ catch (err) {
57
+ console.error(new Date(), "Error in CronJobManager (delete): Trying to stop job: ".concat(key, ": ").concat(err));
58
+ }
59
+ };
60
+ CronJobManager.prototype.start = function (key) {
61
+ try {
62
+ if (this.jobs[key].running) {
63
+ console.warn("".concat(key, " job already running"));
64
+ }
65
+ else {
66
+ this.jobs[key].start();
67
+ }
68
+ }
69
+ catch (err) {
70
+ console.error("couldn't start job: ".concat(key, ": ").concat(err));
71
+ }
72
+ };
73
+ CronJobManager.prototype.stop = function (key) {
74
+ try {
75
+ if (!this.jobs[key].running) {
76
+ console.warn("".concat(key, " job already stopped"));
77
+ }
78
+ else {
79
+ this.jobs[key].stop();
80
+ }
81
+ }
82
+ catch (err) {
83
+ console.error("couldn't stop job: ".concat(key, ": ").concat(err));
84
+ }
85
+ };
86
+ CronJobManager.prototype.stopAll = function () {
87
+ for (var jobKey in this.jobs) {
88
+ this.jobs[jobKey].stop();
89
+ }
90
+ };
91
+ CronJobManager.prototype.exists = function (key) {
92
+ return !!this.jobs[key];
93
+ };
94
+ return CronJobManager;
95
+ }());
96
+ exports.CronJobManager = CronJobManager;
97
+
2
98
  //# sourceMappingURL=cron.js.map
package/cron/cron.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cron/cron.ts"],"names":["cron_1","require","CronJobManager","key","tab","task","onComplete","start","timeZone","context","runOnInit","this","jobs","add","prototype","getJob","getJobs","Object","keys","Date","Function","delete","console","warn","concat","CronJob","fooBaredByUser","error","message","update","wasRunning","running","stop","newJob","err","stopAll","jobKey","exists","exports"],"mappings":"kGAAA,IAAAA,OAAAC,QAAA,MAAA,EAEAC,eAAA,WAGI,SAAAA,eAAYC,EAAcC,EAAqBC,EAAkCC,EAAoCC,EAAiBC,EAAmBC,EAAyBC,GAC9KC,KAAKC,KAAO,GACRT,GAAOC,GAAOC,GACdM,KAAKE,IAAIV,EAAKC,EAAKC,EAAMC,EAAYC,EAAOC,EAAUC,EAASC,CAAS,CAEhF,CAwGJ,OAtGIR,eAAAY,UAAAC,OAAA,SAAOZ,GACH,OAAOQ,KAAKC,KAAKT,EACrB,EAEAD,eAAAY,UAAAE,QAAA,WACI,OAAOC,OAAOC,KAAKP,KAAKC,IAAI,CAChC,EAEAV,eAAAY,UAAAD,IAAA,SAAIV,EAAaC,EAAoBC,EAAiCC,EAAoCC,EAAiBC,EAAmBC,EAAyBC,GACzK,IAAoB,UAAf,OAAON,GAAoBA,aAAee,OAAwB,UAAf,OAAOhB,GAAoBE,aAAgBe,SAClG,IACKT,KAAKC,KAAKT,KACbQ,KAAKU,OAAOlB,CAAG,EACfmB,QAAQC,KAAK,GAAAC,OAAGrB,EAAG,sDAAA,CAAsD,GAE1EQ,KAAKC,KAAKT,GAAO,IAAIH,OAAAyB,QAAQrB,EAAKC,EAAMC,EAAYC,EAAOC,EAAUC,EAASC,CAAS,C,CACtF,MAAOgB,GACRJ,QAAQK,MAAM,YAAAH,OAAYpB,EAAG,2BAAA,EAAAoB,OAA4BrB,EAAG,iBAAA,EAAAqB,OAAkBE,EAAeE,OAAO,CAAE,C,MAGvGN,QAAQC,KAAK,iBAAAC,OAAiBrB,EAAG,qBAAA,CAAqB,CAExD,EAEAD,eAAAY,UAAAe,OAAA,SAAO1B,EAAaC,EAAoBC,EAAiCC,EAAyBC,EA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B,EAEA9B,eAAAY,UAAAuB,OAAA,SAAOlC,GACN,MAAO,CAAC,CAACQ,KAAKC,KAAKT,EACpB,EACDD,cAAA,EAAC,EAhHYoC,QAAApC,eAAAA","file":"cron.js","sourcesContent":["import { CronCommand, CronJob, CronJobParams, CronOnCompleteCommand } from 'cron';\n\nexport class CronJobManager {\n\tprivate jobs: { [key: string]: CronJob };\n\n constructor(key?: string, tab?: string | Date, task?: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean) {\n this.jobs = {};\n if (key && tab && task) {\n this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);\n }\n }\n\n getJob(key: string): CronJob {\n return this.jobs[key];\n }\n\n getJobs(): string[] {\n return Object.keys(this.jobs);\n }\n\n add(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean): void {\n\t\tif ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {\n\t\t\ttry {\n\t\t\t\tif (this.jobs[key]) {\n\t\t\t\t\tthis.delete(key);\n\t\t\t\t\tconsole.warn(`${key} already existed and was deleted from the manager...`);\n\t\t\t\t}\n\t\t\t\tthis.jobs[key] = new CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);\n\t\t\t} catch (fooBaredByUser) {\n\t\t\t\tconsole.error(`crontab: ${tab} possibly not valid, job ${key} not started...${fooBaredByUser.message}`);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`couldn't add: ${key} improper arguments`);\n\t\t}\n\t}\n\n\tupdate(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): void {\n\t\t// Check if the job exists\n\t\tif (!this.jobs[key]) {\n\t\t\tconsole.warn(`Job with key ${key} does not exist.`);\n\t\t\treturn;\n\t\t}\n\n\t\t// Store the running state\n\t\tconst wasRunning = this.jobs[key].running;\n\t\n\t\t// Stop the existing job\n\t\tthis.jobs[key].stop();\n\t\n\t\t// Create a new job instance with the updated properties\n\t\tconst newJob = new CronJob(\n\t\t\ttab,\n\t\t\ttask,\n\t\t\tonComplete,\n\t\t\tstart || wasRunning,\n\t\t\ttimeZone,\n\t\t\tcontext,\n\t\t\trunOnInit\n\t\t);\n\n\t\tdelete this.jobs[key];\n\t\n\t\t// Replace the old job with the new one\n\t\tthis.jobs[key] = newJob;\n\t}\n\t\n\t\n\tdelete(key: string) {\n\t\ttry {\n\t\t\tthis.jobs[key].stop();\n\t\t\tdelete this.jobs[key];\n\t\t}\n\t\tcatch (err) { \n\t\t\tconsole.error(new Date(), `Error in CronJobManager (delete): Trying to stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstart(key: string) {\n\t\ttry {\n\t\t\tif (this.jobs[key].running) {\n\t\t\t\tconsole.warn(`${key} job already running`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].start();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't start job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstop(key: string) {\n\t\ttry {\n\t\t\tif (!this.jobs[key].running ) {\n\t\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].stop();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstopAll() {\n\t\tfor (let jobKey in this.jobs) {\n\t\t\tthis.jobs[jobKey].stop();\n\t\t}\n\t}\n\n\texists(key: string) {\n\t\treturn !!this.jobs[key];\n\t}\n}"]}
1
+ {"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":";;;AAAA,6BAAkF;AAElF;IAGI,wBAAY,GAAY,EAAE,GAAmB,EAAE,IAAgC,EAAE,UAAkC,EAAE,KAAe,EAAE,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gBAC3B,OAAO,CAAC,IAAI,CAAC,UAAG,GAAG,yBAAsB,CAAC,CAAC;aAC3C;iBACI;gBACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;aACvB;SACD;QACD,OAAO,GAAG,EAAE;YACX,OAAO,CAAC,KAAK,CAAC,8BAAuB,GAAG,eAAK,GAAG,CAAE,CAAC,CAAC;SACpD;IACF,CAAC;IAED,6BAAI,GAAJ,UAAK,GAAW;QACf,IAAI;YACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAG;gBAC7B,OAAO,CAAC,IAAI,CAAC,UAAG,GAAG,yBAAsB,CAAC,CAAC;aAC3C;iBACI;gBACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;aACtB;SACD;QACD,OAAO,GAAG,EAAE;YACX,OAAO,CAAC,KAAK,CAAC,6BAAsB,GAAG,eAAK,GAAG,CAAE,CAAC,CAAC;SACnD;IACF,CAAC;IAED,gCAAO,GAAP;QACC,KAAK,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;SACzB;IACF,CAAC;IAED,+BAAM,GAAN,UAAO,GAAW;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IACF,qBAAC;AAAD,CAhHA,AAgHC,IAAA;AAhHY,wCAAc","file":"cron.js","sourcesContent":["import { CronCommand, CronJob, CronJobParams, CronOnCompleteCommand } from 'cron';\n\nexport class CronJobManager {\n\tprivate jobs: { [key: string]: CronJob };\n\n constructor(key?: string, tab?: string | Date, task?: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean) {\n this.jobs = {};\n if (key && tab && task) {\n this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);\n }\n }\n\n getJob(key: string): CronJob {\n return this.jobs[key];\n }\n\n getJobs(): string[] {\n return Object.keys(this.jobs);\n }\n\n add(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean): void {\n\t\tif ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {\n\t\t\ttry {\n\t\t\t\tif (this.jobs[key]) {\n\t\t\t\t\tthis.delete(key);\n\t\t\t\t\tconsole.warn(`${key} already existed and was deleted from the manager...`);\n\t\t\t\t}\n\t\t\t\tthis.jobs[key] = new CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);\n\t\t\t} catch (fooBaredByUser) {\n\t\t\t\tconsole.error(`crontab: ${tab} possibly not valid, job ${key} not started...${fooBaredByUser.message}`);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`couldn't add: ${key} improper arguments`);\n\t\t}\n\t}\n\n\tupdate(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): void {\n\t\t// Check if the job exists\n\t\tif (!this.jobs[key]) {\n\t\t\tconsole.warn(`Job with key ${key} does not exist.`);\n\t\t\treturn;\n\t\t}\n\n\t\t// Store the running state\n\t\tconst wasRunning = this.jobs[key].running;\n\t\n\t\t// Stop the existing job\n\t\tthis.jobs[key].stop();\n\t\n\t\t// Create a new job instance with the updated properties\n\t\tconst newJob = new CronJob(\n\t\t\ttab,\n\t\t\ttask,\n\t\t\tonComplete,\n\t\t\tstart || wasRunning,\n\t\t\ttimeZone,\n\t\t\tcontext,\n\t\t\trunOnInit\n\t\t);\n\n\t\tdelete this.jobs[key];\n\t\n\t\t// Replace the old job with the new one\n\t\tthis.jobs[key] = newJob;\n\t}\n\t\n\t\n\tdelete(key: string) {\n\t\ttry {\n\t\t\tthis.jobs[key].stop();\n\t\t\tdelete this.jobs[key];\n\t\t}\n\t\tcatch (err) { \n\t\t\tconsole.error(new Date(), `Error in CronJobManager (delete): Trying to stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstart(key: string) {\n\t\ttry {\n\t\t\tif (this.jobs[key].running) {\n\t\t\t\tconsole.warn(`${key} job already running`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].start();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't start job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstop(key: string) {\n\t\ttry {\n\t\t\tif (!this.jobs[key].running ) {\n\t\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].stop();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstopAll() {\n\t\tfor (let jobKey in this.jobs) {\n\t\t\tthis.jobs[jobKey].stop();\n\t\t}\n\t}\n\n\texists(key: string) {\n\t\treturn !!this.jobs[key];\n\t}\n}"]}