@openinc/parse-server-opendash 2.3.13 → 2.3.14

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 (366) hide show
  1. package/dist/config.d.ts +2 -2
  2. package/dist/config.js +455 -455
  3. package/dist/featuremap.json +75 -75
  4. package/dist/functions/_init.d.ts +1 -1
  5. package/dist/functions/_init.js +20 -20
  6. package/dist/functions/getAdminConfig.d.ts +1 -1
  7. package/dist/functions/getAdminConfig.js +63 -63
  8. package/dist/functions/getSchemaForAdmin.d.ts +1 -1
  9. package/dist/functions/getSchemaForAdmin.js +14 -14
  10. package/dist/functions/opendash-geo-features.d.ts +1 -1
  11. package/dist/functions/opendash-geo-features.js +19 -19
  12. package/dist/functions/openinc-auth-change-password.d.ts +1 -1
  13. package/dist/functions/openinc-auth-change-password.js +30 -30
  14. package/dist/functions/openinc-auth-confirm-email.d.ts +1 -1
  15. package/dist/functions/openinc-auth-confirm-email.js +18 -18
  16. package/dist/functions/openinc-auth-email-confirmation-request.d.ts +1 -1
  17. package/dist/functions/openinc-auth-email-confirmation-request.js +42 -42
  18. package/dist/functions/openinc-auth-email-confirmation.d.ts +1 -1
  19. package/dist/functions/openinc-auth-email-confirmation.js +23 -23
  20. package/dist/functions/openinc-auth-login-admin.d.ts +1 -1
  21. package/dist/functions/openinc-auth-login-admin.js +69 -69
  22. package/dist/functions/openinc-auth-login-passwordless.d.ts +1 -1
  23. package/dist/functions/openinc-auth-login-passwordless.js +50 -50
  24. package/dist/functions/openinc-auth-login.d.ts +1 -1
  25. package/dist/functions/openinc-auth-login.js +45 -45
  26. package/dist/functions/openinc-auth-password-reset-request.d.ts +1 -1
  27. package/dist/functions/openinc-auth-password-reset-request.js +42 -42
  28. package/dist/functions/openinc-auth-password-reset.d.ts +1 -1
  29. package/dist/functions/openinc-auth-password-reset.js +28 -28
  30. package/dist/functions/openinc-auth-signup.d.ts +1 -1
  31. package/dist/functions/openinc-auth-signup.js +88 -88
  32. package/dist/functions/openinc-auth-validate-token.d.ts +1 -1
  33. package/dist/functions/openinc-auth-validate-token.js +37 -37
  34. package/dist/functions/openinc-auth.common.d.ts +15 -15
  35. package/dist/functions/openinc-auth.common.js +67 -67
  36. package/dist/functions/openinc-config.d.ts +1 -1
  37. package/dist/functions/openinc-config.js +92 -92
  38. package/dist/functions/openinc-geo-google-autocomplete.d.ts +1 -1
  39. package/dist/functions/openinc-geo-google-autocomplete.js +58 -58
  40. package/dist/functions/openinc-geo-google.common.d.ts +2 -2
  41. package/dist/functions/openinc-geo-google.common.js +34 -34
  42. package/dist/functions/openinc-geo-graphhopper-geocode-reverse-raw.d.ts +1 -1
  43. package/dist/functions/openinc-geo-graphhopper-geocode-reverse-raw.js +24 -24
  44. package/dist/functions/openinc-geo-graphhopper-geocode-reverse.d.ts +1 -1
  45. package/dist/functions/openinc-geo-graphhopper-geocode-reverse.js +24 -24
  46. package/dist/functions/openinc-geo-graphhopper-geocode.d.ts +1 -1
  47. package/dist/functions/openinc-geo-graphhopper-geocode.js +24 -24
  48. package/dist/functions/openinc-geo-graphhopper-route-simple.d.ts +1 -1
  49. package/dist/functions/openinc-geo-graphhopper-route-simple.js +33 -33
  50. package/dist/functions/openinc-geo-graphhopper.common.d.ts +2 -2
  51. package/dist/functions/openinc-geo-graphhopper.common.js +60 -60
  52. package/dist/helper/Config.d.ts +33 -33
  53. package/dist/helper/Config.js +156 -156
  54. package/dist/helper/pdf2img.d.ts +12 -12
  55. package/dist/helper/pdf2img.js +111 -111
  56. package/dist/hooks/Alarm.d.ts +1 -1
  57. package/dist/hooks/Alarm.js +40 -40
  58. package/dist/hooks/AlarmAction.d.ts +1 -1
  59. package/dist/hooks/AlarmAction.js +15 -15
  60. package/dist/hooks/AlarmWebhook.d.ts +1 -1
  61. package/dist/hooks/AlarmWebhook.js +16 -16
  62. package/dist/hooks/Attachment.d.ts +1 -1
  63. package/dist/hooks/Attachment.js +18 -18
  64. package/dist/hooks/BDE_Form.d.ts +1 -1
  65. package/dist/hooks/BDE_Form.js +53 -53
  66. package/dist/hooks/BDE_List.d.ts +1 -1
  67. package/dist/hooks/BDE_List.js +17 -17
  68. package/dist/hooks/BDE_ListEntry.d.ts +1 -1
  69. package/dist/hooks/BDE_ListEntry.js +17 -17
  70. package/dist/hooks/BDE_Page.d.ts +1 -1
  71. package/dist/hooks/BDE_Page.js +44 -44
  72. package/dist/hooks/BDE_Result.d.ts +1 -1
  73. package/dist/hooks/BDE_Result.js +128 -128
  74. package/dist/hooks/BDE_Unit.d.ts +1 -1
  75. package/dist/hooks/BDE_Unit.js +17 -17
  76. package/dist/hooks/Config.d.ts +1 -1
  77. package/dist/hooks/Config.js +16 -16
  78. package/dist/hooks/Core_Email.d.ts +11 -11
  79. package/dist/hooks/Core_Email.js +111 -111
  80. package/dist/hooks/Core_Token.d.ts +1 -1
  81. package/dist/hooks/Core_Token.js +11 -11
  82. package/dist/hooks/Dashboard.d.ts +1 -1
  83. package/dist/hooks/Dashboard.js +33 -33
  84. package/dist/hooks/GTFS_Agency.d.ts +1 -1
  85. package/dist/hooks/GTFS_Agency.js +18 -18
  86. package/dist/hooks/GTFS_Bikes_Allowed.d.ts +1 -1
  87. package/dist/hooks/GTFS_Bikes_Allowed.js +18 -18
  88. package/dist/hooks/GTFS_Calendar.d.ts +1 -1
  89. package/dist/hooks/GTFS_Calendar.js +18 -18
  90. package/dist/hooks/GTFS_Direction.d.ts +1 -1
  91. package/dist/hooks/GTFS_Direction.js +18 -18
  92. package/dist/hooks/GTFS_Level.d.ts +1 -1
  93. package/dist/hooks/GTFS_Level.js +18 -18
  94. package/dist/hooks/GTFS_Location_Type.d.ts +1 -1
  95. package/dist/hooks/GTFS_Location_Type.js +18 -18
  96. package/dist/hooks/GTFS_Route.d.ts +1 -1
  97. package/dist/hooks/GTFS_Route.js +18 -18
  98. package/dist/hooks/GTFS_Route_Type.d.ts +1 -1
  99. package/dist/hooks/GTFS_Route_Type.js +18 -18
  100. package/dist/hooks/GTFS_Stop.d.ts +1 -1
  101. package/dist/hooks/GTFS_Stop.js +18 -18
  102. package/dist/hooks/GTFS_Stop_Times.d.ts +1 -1
  103. package/dist/hooks/GTFS_Stop_Times.js +18 -18
  104. package/dist/hooks/GTFS_Trip.d.ts +1 -1
  105. package/dist/hooks/GTFS_Trip.js +18 -18
  106. package/dist/hooks/GTFS_Wheelchair_Accessible.d.ts +1 -1
  107. package/dist/hooks/GTFS_Wheelchair_Accessible.js +18 -18
  108. package/dist/hooks/GTFS_Wheelchair_Boarding.d.ts +1 -1
  109. package/dist/hooks/GTFS_Wheelchair_Boarding.js +18 -18
  110. package/dist/hooks/Group.d.ts +1 -1
  111. package/dist/hooks/Group.js +56 -56
  112. package/dist/hooks/Knowledge_Article.d.ts +1 -1
  113. package/dist/hooks/Knowledge_Article.js +18 -18
  114. package/dist/hooks/Knowledge_Category.d.ts +1 -1
  115. package/dist/hooks/Knowledge_Category.js +18 -18
  116. package/dist/hooks/Knowledge_Document.d.ts +1 -1
  117. package/dist/hooks/Knowledge_Document.js +60 -60
  118. package/dist/hooks/Knowledge_DocumentPage.d.ts +1 -1
  119. package/dist/hooks/Knowledge_DocumentPage.js +22 -22
  120. package/dist/hooks/Knowledge_Video.d.ts +1 -1
  121. package/dist/hooks/Knowledge_Video.js +18 -18
  122. package/dist/hooks/Language.d.ts +1 -1
  123. package/dist/hooks/Language.js +18 -18
  124. package/dist/hooks/Log.d.ts +1 -1
  125. package/dist/hooks/Log.js +18 -18
  126. package/dist/hooks/MIAAS_MDSEndpoint.d.ts +1 -1
  127. package/dist/hooks/MIAAS_MDSEndpoint.js +18 -18
  128. package/dist/hooks/Maintenance_Article.d.ts +1 -1
  129. package/dist/hooks/Maintenance_Article.js +18 -18
  130. package/dist/hooks/Maintenance_Downtime.d.ts +1 -1
  131. package/dist/hooks/Maintenance_Downtime.js +18 -18
  132. package/dist/hooks/Maintenance_Duedate.d.ts +1 -1
  133. package/dist/hooks/Maintenance_Duedate.js +18 -18
  134. package/dist/hooks/Maintenance_Frequency.d.ts +1 -1
  135. package/dist/hooks/Maintenance_Frequency.js +18 -18
  136. package/dist/hooks/Maintenance_Issuecategory.d.ts +1 -1
  137. package/dist/hooks/Maintenance_Issuecategory.js +21 -21
  138. package/dist/hooks/Maintenance_Item.d.ts +1 -1
  139. package/dist/hooks/Maintenance_Item.js +18 -18
  140. package/dist/hooks/Maintenance_Kanban_State.d.ts +1 -1
  141. package/dist/hooks/Maintenance_Kanban_State.js +18 -18
  142. package/dist/hooks/Maintenance_Media.d.ts +1 -1
  143. package/dist/hooks/Maintenance_Media.js +18 -18
  144. package/dist/hooks/Maintenance_Message.d.ts +1 -1
  145. package/dist/hooks/Maintenance_Message.js +18 -18
  146. package/dist/hooks/Maintenance_Message_Body.d.ts +1 -1
  147. package/dist/hooks/Maintenance_Message_Body.js +18 -18
  148. package/dist/hooks/Maintenance_Order.d.ts +1 -1
  149. package/dist/hooks/Maintenance_Order.js +18 -18
  150. package/dist/hooks/Maintenance_Priority.d.ts +1 -1
  151. package/dist/hooks/Maintenance_Priority.js +18 -18
  152. package/dist/hooks/Maintenance_Restriction.d.ts +1 -1
  153. package/dist/hooks/Maintenance_Restriction.js +18 -18
  154. package/dist/hooks/Maintenance_Schedule.d.ts +1 -1
  155. package/dist/hooks/Maintenance_Schedule.js +18 -18
  156. package/dist/hooks/Maintenance_Schedule_Execution.d.ts +1 -1
  157. package/dist/hooks/Maintenance_Schedule_Execution.js +18 -18
  158. package/dist/hooks/Maintenance_Schedule_Execution_Step.d.ts +1 -1
  159. package/dist/hooks/Maintenance_Schedule_Execution_Step.js +18 -18
  160. package/dist/hooks/Maintenance_Schedule_Step.d.ts +1 -1
  161. package/dist/hooks/Maintenance_Schedule_Step.js +18 -18
  162. package/dist/hooks/Maintenance_SourceMeta.d.ts +1 -1
  163. package/dist/hooks/Maintenance_SourceMeta.js +18 -18
  164. package/dist/hooks/Maintenance_Ticket.d.ts +1 -1
  165. package/dist/hooks/Maintenance_Ticket.js +18 -18
  166. package/dist/hooks/Maintenance_Ticket_Issuecategory.d.ts +1 -1
  167. package/dist/hooks/Maintenance_Ticket_Issuecategory.js +18 -18
  168. package/dist/hooks/Maintenance_Ticket_Kanban_State.d.ts +1 -1
  169. package/dist/hooks/Maintenance_Ticket_Kanban_State.js +23 -23
  170. package/dist/hooks/Maintenance_Ticket_Source.d.ts +1 -1
  171. package/dist/hooks/Maintenance_Ticket_Source.js +18 -18
  172. package/dist/hooks/Monitoring_Slideshow.d.ts +1 -1
  173. package/dist/hooks/Monitoring_Slideshow.js +17 -17
  174. package/dist/hooks/NavigationGroup.d.ts +1 -1
  175. package/dist/hooks/NavigationGroup.js +15 -15
  176. package/dist/hooks/NavigationItem.d.ts +1 -1
  177. package/dist/hooks/NavigationItem.js +16 -16
  178. package/dist/hooks/Notification.d.ts +1 -1
  179. package/dist/hooks/Notification.js +73 -73
  180. package/dist/hooks/Permission.d.ts +1 -1
  181. package/dist/hooks/Permission.js +19 -19
  182. package/dist/hooks/Push.d.ts +1 -1
  183. package/dist/hooks/Push.js +30 -30
  184. package/dist/hooks/Report.d.ts +1 -1
  185. package/dist/hooks/Report.js +16 -16
  186. package/dist/hooks/Share.d.ts +1 -1
  187. package/dist/hooks/Share.js +16 -16
  188. package/dist/hooks/Source.d.ts +1 -1
  189. package/dist/hooks/Source.js +91 -91
  190. package/dist/hooks/Tenant.d.ts +1 -1
  191. package/dist/hooks/Tenant.js +75 -75
  192. package/dist/hooks/TenantTrustedDomain.d.ts +1 -1
  193. package/dist/hooks/TenantTrustedDomain.js +12 -12
  194. package/dist/hooks/UserData.d.ts +1 -1
  195. package/dist/hooks/UserData.js +16 -16
  196. package/dist/hooks/VirtualKPI.d.ts +1 -1
  197. package/dist/hooks/VirtualKPI.js +18 -18
  198. package/dist/hooks/Widget.d.ts +1 -1
  199. package/dist/hooks/Widget.js +16 -16
  200. package/dist/hooks/WidgetPreset.d.ts +1 -1
  201. package/dist/hooks/WidgetPreset.js +18 -18
  202. package/dist/hooks/_User.d.ts +1 -1
  203. package/dist/hooks/_User.js +108 -108
  204. package/dist/hooks/_beforeLogin.d.ts +1 -1
  205. package/dist/hooks/_beforeLogin.js +22 -22
  206. package/dist/hooks/_init.d.ts +1 -1
  207. package/dist/hooks/_init.js +23 -23
  208. package/dist/index.d.ts +65 -65
  209. package/dist/index.js +399 -399
  210. package/dist/ow.d.ts +20 -20
  211. package/dist/ow.js +88 -91
  212. package/dist/types/Alarm.d.ts +36 -36
  213. package/dist/types/Alarm.js +59 -59
  214. package/dist/types/AlarmAction.d.ts +42 -42
  215. package/dist/types/AlarmAction.js +71 -71
  216. package/dist/types/AlarmWebhook.d.ts +40 -40
  217. package/dist/types/AlarmWebhook.js +65 -65
  218. package/dist/types/Attachment.d.ts +21 -21
  219. package/dist/types/Attachment.js +29 -29
  220. package/dist/types/BDE_Form.d.ts +26 -26
  221. package/dist/types/BDE_Form.js +41 -41
  222. package/dist/types/BDE_List.d.ts +14 -14
  223. package/dist/types/BDE_List.js +17 -17
  224. package/dist/types/BDE_ListEntry.d.ts +21 -21
  225. package/dist/types/BDE_ListEntry.js +29 -29
  226. package/dist/types/BDE_Page.d.ts +17 -17
  227. package/dist/types/BDE_Page.js +23 -23
  228. package/dist/types/BDE_Result.d.ts +20 -20
  229. package/dist/types/BDE_Result.js +29 -29
  230. package/dist/types/BDE_Unit.d.ts +23 -23
  231. package/dist/types/BDE_Unit.js +32 -32
  232. package/dist/types/Config.d.ts +24 -24
  233. package/dist/types/Config.js +35 -35
  234. package/dist/types/Core_Email.d.ts +26 -26
  235. package/dist/types/Core_Email.js +41 -41
  236. package/dist/types/Core_Token.d.ts +23 -23
  237. package/dist/types/Core_Token.js +35 -35
  238. package/dist/types/Dashboard.d.ts +34 -34
  239. package/dist/types/Dashboard.js +53 -53
  240. package/dist/types/GTFS_Agency.d.ts +39 -39
  241. package/dist/types/GTFS_Agency.js +65 -65
  242. package/dist/types/GTFS_Bikes_Allowed.d.ts +21 -21
  243. package/dist/types/GTFS_Bikes_Allowed.js +29 -29
  244. package/dist/types/GTFS_Calendar.d.ts +42 -42
  245. package/dist/types/GTFS_Calendar.js +71 -71
  246. package/dist/types/GTFS_Direction.d.ts +21 -21
  247. package/dist/types/GTFS_Direction.js +29 -29
  248. package/dist/types/GTFS_Level.d.ts +21 -21
  249. package/dist/types/GTFS_Level.js +29 -29
  250. package/dist/types/GTFS_Location_Type.d.ts +24 -24
  251. package/dist/types/GTFS_Location_Type.js +35 -35
  252. package/dist/types/GTFS_Route.d.ts +46 -46
  253. package/dist/types/GTFS_Route.js +77 -77
  254. package/dist/types/GTFS_Route_Type.d.ts +24 -24
  255. package/dist/types/GTFS_Route_Type.js +35 -35
  256. package/dist/types/GTFS_Stop.d.ts +60 -60
  257. package/dist/types/GTFS_Stop.js +101 -101
  258. package/dist/types/GTFS_Stop_Times.d.ts +32 -32
  259. package/dist/types/GTFS_Stop_Times.js +47 -47
  260. package/dist/types/GTFS_Trip.d.ts +41 -41
  261. package/dist/types/GTFS_Trip.js +59 -59
  262. package/dist/types/GTFS_Wheelchair_Accessible.d.ts +21 -21
  263. package/dist/types/GTFS_Wheelchair_Accessible.js +29 -29
  264. package/dist/types/GTFS_Wheelchair_Boarding.d.ts +24 -24
  265. package/dist/types/GTFS_Wheelchair_Boarding.js +35 -35
  266. package/dist/types/Group.d.ts +32 -32
  267. package/dist/types/Group.js +47 -47
  268. package/dist/types/Knowledge_Article.d.ts +29 -29
  269. package/dist/types/Knowledge_Article.js +41 -41
  270. package/dist/types/Knowledge_Category.d.ts +25 -25
  271. package/dist/types/Knowledge_Category.js +35 -35
  272. package/dist/types/Knowledge_Document.d.ts +29 -29
  273. package/dist/types/Knowledge_Document.js +41 -41
  274. package/dist/types/Knowledge_DocumentPage.d.ts +31 -31
  275. package/dist/types/Knowledge_DocumentPage.js +47 -47
  276. package/dist/types/Knowledge_Video.d.ts +35 -35
  277. package/dist/types/Knowledge_Video.js +53 -53
  278. package/dist/types/Language.d.ts +14 -14
  279. package/dist/types/Language.js +17 -17
  280. package/dist/types/Log.d.ts +17 -17
  281. package/dist/types/Log.js +23 -23
  282. package/dist/types/MIAAS_MDSEndpoint.d.ts +29 -29
  283. package/dist/types/MIAAS_MDSEndpoint.js +47 -47
  284. package/dist/types/Maintenance_Article.d.ts +32 -32
  285. package/dist/types/Maintenance_Article.js +44 -44
  286. package/dist/types/Maintenance_Downtime.d.ts +26 -26
  287. package/dist/types/Maintenance_Downtime.js +35 -35
  288. package/dist/types/Maintenance_Duedate.d.ts +35 -35
  289. package/dist/types/Maintenance_Duedate.js +53 -53
  290. package/dist/types/Maintenance_Frequency.d.ts +26 -26
  291. package/dist/types/Maintenance_Frequency.js +35 -35
  292. package/dist/types/Maintenance_Issuecategory.d.ts +36 -36
  293. package/dist/types/Maintenance_Issuecategory.js +56 -56
  294. package/dist/types/Maintenance_Item.d.ts +21 -21
  295. package/dist/types/Maintenance_Item.js +29 -29
  296. package/dist/types/Maintenance_Kanban_State.d.ts +33 -33
  297. package/dist/types/Maintenance_Kanban_State.js +53 -53
  298. package/dist/types/Maintenance_Media.d.ts +21 -21
  299. package/dist/types/Maintenance_Media.js +29 -29
  300. package/dist/types/Maintenance_Message.d.ts +27 -27
  301. package/dist/types/Maintenance_Message.js +41 -41
  302. package/dist/types/Maintenance_Message_Body.d.ts +22 -22
  303. package/dist/types/Maintenance_Message_Body.js +29 -29
  304. package/dist/types/Maintenance_Order.d.ts +24 -24
  305. package/dist/types/Maintenance_Order.js +32 -32
  306. package/dist/types/Maintenance_Priority.d.ts +26 -26
  307. package/dist/types/Maintenance_Priority.js +35 -35
  308. package/dist/types/Maintenance_Restriction.d.ts +26 -26
  309. package/dist/types/Maintenance_Restriction.js +35 -35
  310. package/dist/types/Maintenance_Schedule.d.ts +37 -37
  311. package/dist/types/Maintenance_Schedule.js +56 -56
  312. package/dist/types/Maintenance_Schedule_Execution.d.ts +39 -39
  313. package/dist/types/Maintenance_Schedule_Execution.js +56 -56
  314. package/dist/types/Maintenance_Schedule_Execution_Step.d.ts +44 -44
  315. package/dist/types/Maintenance_Schedule_Execution_Step.js +71 -71
  316. package/dist/types/Maintenance_Schedule_Step.d.ts +38 -38
  317. package/dist/types/Maintenance_Schedule_Step.js +59 -59
  318. package/dist/types/Maintenance_SourceMeta.d.ts +23 -23
  319. package/dist/types/Maintenance_SourceMeta.js +29 -29
  320. package/dist/types/Maintenance_Ticket.d.ts +30 -30
  321. package/dist/types/Maintenance_Ticket.js +41 -41
  322. package/dist/types/Maintenance_Ticket_Issuecategory.d.ts +27 -27
  323. package/dist/types/Maintenance_Ticket_Issuecategory.js +35 -35
  324. package/dist/types/Maintenance_Ticket_Kanban_State.d.ts +27 -27
  325. package/dist/types/Maintenance_Ticket_Kanban_State.js +35 -35
  326. package/dist/types/Maintenance_Ticket_Source.d.ts +27 -27
  327. package/dist/types/Maintenance_Ticket_Source.js +35 -35
  328. package/dist/types/Monitoring_Slideshow.d.ts +20 -20
  329. package/dist/types/Monitoring_Slideshow.js +26 -26
  330. package/dist/types/NavigationGroup.d.ts +24 -24
  331. package/dist/types/NavigationGroup.js +35 -35
  332. package/dist/types/NavigationItem.d.ts +48 -48
  333. package/dist/types/NavigationItem.js +83 -83
  334. package/dist/types/Notification.d.ts +30 -30
  335. package/dist/types/Notification.js +47 -47
  336. package/dist/types/Permission.d.ts +18 -18
  337. package/dist/types/Permission.js +23 -23
  338. package/dist/types/Push.d.ts +27 -27
  339. package/dist/types/Push.js +41 -41
  340. package/dist/types/Report.d.ts +39 -39
  341. package/dist/types/Report.js +65 -65
  342. package/dist/types/Share.d.ts +34 -34
  343. package/dist/types/Share.js +53 -53
  344. package/dist/types/Source.d.ts +26 -26
  345. package/dist/types/Source.js +38 -38
  346. package/dist/types/Tenant.d.ts +45 -45
  347. package/dist/types/Tenant.js +77 -77
  348. package/dist/types/TenantTrustedDomain.d.ts +18 -18
  349. package/dist/types/TenantTrustedDomain.js +23 -23
  350. package/dist/types/UserData.d.ts +21 -21
  351. package/dist/types/UserData.js +29 -29
  352. package/dist/types/VirtualKPI.d.ts +21 -21
  353. package/dist/types/VirtualKPI.js +29 -29
  354. package/dist/types/Widget.d.ts +24 -24
  355. package/dist/types/Widget.js +35 -35
  356. package/dist/types/WidgetPreset.d.ts +40 -40
  357. package/dist/types/WidgetPreset.js +65 -65
  358. package/dist/types/_Role.d.ts +13 -13
  359. package/dist/types/_Role.js +2 -2
  360. package/dist/types/_Session.d.ts +15 -15
  361. package/dist/types/_Session.js +2 -2
  362. package/dist/types/_User.d.ts +28 -28
  363. package/dist/types/_User.js +2 -2
  364. package/dist/types/index.d.ts +152 -152
  365. package/dist/types/index.js +150 -150
  366. package/package.json +1 -1
@@ -1,156 +1,156 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Config = void 0;
4
- class Config {
5
- constructor(configs) {
6
- this.values = {};
7
- this.configs = configs;
8
- }
9
- async init(log) {
10
- for (const [key, c] of Object.entries(this.configs)) {
11
- if (c.type === "string") {
12
- this.values[key] = getEnv(c.env, c.default);
13
- }
14
- if (c.type === "int") {
15
- this.values[key] = getEnvInt(c.env, c.default);
16
- }
17
- if (c.type === "float") {
18
- this.values[key] = getEnvFloat(c.env, c.default);
19
- }
20
- if (c.type === "boolean") {
21
- this.values[key] = getEnvBoolean(c.env, c.default);
22
- }
23
- }
24
- if (log)
25
- this.log();
26
- // validation:
27
- for (const [key, c] of Object.entries(this.configs)) {
28
- if (c.required === true) {
29
- this.validateKey(key);
30
- }
31
- if ("dependencies" in c &&
32
- Array.isArray(c.dependencies) &&
33
- this.getBoolean(key)) {
34
- for (const dependency of c.dependencies) {
35
- this.validateKey(dependency);
36
- }
37
- }
38
- }
39
- }
40
- get(key) {
41
- this.validateKeyType(key, "string");
42
- return this.values[key];
43
- }
44
- getBoolean(key) {
45
- this.validateKeyType(key, "boolean");
46
- return this.values[key];
47
- }
48
- getNumber(key) {
49
- this.validateKeyType(key, "int", "float");
50
- return this.values[key];
51
- }
52
- export() {
53
- const result = {};
54
- for (const [key, c] of Object.entries(this.configs)) {
55
- if (c.secret)
56
- continue;
57
- if (!c.public)
58
- continue;
59
- if (c.type === "string") {
60
- result[key] = this.get(key);
61
- }
62
- if (c.type === "int") {
63
- result[key] = this.getNumber(key);
64
- }
65
- if (c.type === "float") {
66
- result[key] = this.getNumber(key);
67
- }
68
- if (c.type === "boolean") {
69
- result[key] = this.getBoolean(key);
70
- }
71
- }
72
- return result;
73
- }
74
- validateKey(key) {
75
- if (!(key in this.values) || this.values[key] === undefined) {
76
- throw new Error(`Invalid config, '${key}' is required.`);
77
- }
78
- }
79
- validateKeyType(key, ...types) {
80
- const t = this.configs[key]?.type;
81
- if (!types.includes(t)) {
82
- console.error(new Error(`Invalid getter for config key '${key}' is of type ${t} but was called as ${types.join("|")}.`));
83
- process.exit(1);
84
- }
85
- }
86
- log() {
87
- const table = [];
88
- const colWidth = {};
89
- for (const [key, c] of Object.entries(this.configs)) {
90
- const value = this.values[key]?.toString() || "undefined";
91
- table.push({
92
- key,
93
- env: c.env,
94
- type: c.type,
95
- value: this.configs[key]?.secret && value !== "undefined" ? "****" : value,
96
- });
97
- }
98
- for (const x of table) {
99
- for (const [key, value] of Object.entries(x)) {
100
- const length = value.length;
101
- if ((colWidth[key] && colWidth[key] < length) || !colWidth[key]) {
102
- colWidth[key] = length;
103
- }
104
- }
105
- }
106
- for (const x of table) {
107
- for (const [key, value] of Object.entries(x)) {
108
- x[key] = value.padEnd(colWidth[key], " ");
109
- }
110
- }
111
- let result = "";
112
- result += "┌─";
113
- result += Object.keys(colWidth)
114
- .map((key) => "─".repeat(colWidth[key]))
115
- .join("─┬─");
116
- result += "─┐\n";
117
- result += "│ ";
118
- result += Object.keys(colWidth)
119
- .map((key) => key.padEnd(colWidth[key], " "))
120
- .join(" │ ");
121
- result += " │\n";
122
- result += "├─";
123
- result += Object.keys(colWidth)
124
- .map((key) => "─".repeat(colWidth[key]))
125
- .join("─┼─");
126
- result += "─┤\n";
127
- for (const row of table) {
128
- result += "│ ";
129
- result += Object.values(row).join(" │ ");
130
- result += " │\n";
131
- }
132
- result += "└─";
133
- result += Object.keys(colWidth)
134
- .map((key) => "─".repeat(colWidth[key]))
135
- .join("─┴─");
136
- result += "─┘\n";
137
- console.log(result);
138
- }
139
- }
140
- exports.Config = Config;
141
- function getEnv(key, fallback) {
142
- return process.env[key] || fallback;
143
- }
144
- function getEnvInt(key, fallback = "") {
145
- return parseInt(getEnv(key, fallback));
146
- }
147
- function getEnvFloat(key, fallback = "") {
148
- return parseFloat(getEnv(key, fallback));
149
- }
150
- function getEnvBoolean(key, fallback = "false") {
151
- const value = getEnv(key, fallback);
152
- if (!value || value.toLowerCase() === "false" || value === "0") {
153
- return false;
154
- }
155
- return true;
156
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = void 0;
4
+ class Config {
5
+ constructor(configs) {
6
+ this.values = {};
7
+ this.configs = configs;
8
+ }
9
+ async init(log) {
10
+ for (const [key, c] of Object.entries(this.configs)) {
11
+ if (c.type === "string") {
12
+ this.values[key] = getEnv(c.env, c.default);
13
+ }
14
+ if (c.type === "int") {
15
+ this.values[key] = getEnvInt(c.env, c.default);
16
+ }
17
+ if (c.type === "float") {
18
+ this.values[key] = getEnvFloat(c.env, c.default);
19
+ }
20
+ if (c.type === "boolean") {
21
+ this.values[key] = getEnvBoolean(c.env, c.default);
22
+ }
23
+ }
24
+ if (log)
25
+ this.log();
26
+ // validation:
27
+ for (const [key, c] of Object.entries(this.configs)) {
28
+ if (c.required === true) {
29
+ this.validateKey(key);
30
+ }
31
+ if ("dependencies" in c &&
32
+ Array.isArray(c.dependencies) &&
33
+ this.getBoolean(key)) {
34
+ for (const dependency of c.dependencies) {
35
+ this.validateKey(dependency);
36
+ }
37
+ }
38
+ }
39
+ }
40
+ get(key) {
41
+ this.validateKeyType(key, "string");
42
+ return this.values[key];
43
+ }
44
+ getBoolean(key) {
45
+ this.validateKeyType(key, "boolean");
46
+ return this.values[key];
47
+ }
48
+ getNumber(key) {
49
+ this.validateKeyType(key, "int", "float");
50
+ return this.values[key];
51
+ }
52
+ export() {
53
+ const result = {};
54
+ for (const [key, c] of Object.entries(this.configs)) {
55
+ if (c.secret)
56
+ continue;
57
+ if (!c.public)
58
+ continue;
59
+ if (c.type === "string") {
60
+ result[key] = this.get(key);
61
+ }
62
+ if (c.type === "int") {
63
+ result[key] = this.getNumber(key);
64
+ }
65
+ if (c.type === "float") {
66
+ result[key] = this.getNumber(key);
67
+ }
68
+ if (c.type === "boolean") {
69
+ result[key] = this.getBoolean(key);
70
+ }
71
+ }
72
+ return result;
73
+ }
74
+ validateKey(key) {
75
+ if (!(key in this.values) || this.values[key] === undefined) {
76
+ throw new Error(`Invalid config, '${key}' is required.`);
77
+ }
78
+ }
79
+ validateKeyType(key, ...types) {
80
+ const t = this.configs[key]?.type;
81
+ if (!types.includes(t)) {
82
+ console.error(new Error(`Invalid getter for config key '${key}' is of type ${t} but was called as ${types.join("|")}.`));
83
+ process.exit(1);
84
+ }
85
+ }
86
+ log() {
87
+ const table = [];
88
+ const colWidth = {};
89
+ for (const [key, c] of Object.entries(this.configs)) {
90
+ const value = this.values[key]?.toString() || "undefined";
91
+ table.push({
92
+ key,
93
+ env: c.env,
94
+ type: c.type,
95
+ value: this.configs[key]?.secret && value !== "undefined" ? "****" : value,
96
+ });
97
+ }
98
+ for (const x of table) {
99
+ for (const [key, value] of Object.entries(x)) {
100
+ const length = value.length;
101
+ if ((colWidth[key] && colWidth[key] < length) || !colWidth[key]) {
102
+ colWidth[key] = length;
103
+ }
104
+ }
105
+ }
106
+ for (const x of table) {
107
+ for (const [key, value] of Object.entries(x)) {
108
+ x[key] = value.padEnd(colWidth[key], " ");
109
+ }
110
+ }
111
+ let result = "";
112
+ result += "┌─";
113
+ result += Object.keys(colWidth)
114
+ .map((key) => "─".repeat(colWidth[key]))
115
+ .join("─┬─");
116
+ result += "─┐\n";
117
+ result += "│ ";
118
+ result += Object.keys(colWidth)
119
+ .map((key) => key.padEnd(colWidth[key], " "))
120
+ .join(" │ ");
121
+ result += " │\n";
122
+ result += "├─";
123
+ result += Object.keys(colWidth)
124
+ .map((key) => "─".repeat(colWidth[key]))
125
+ .join("─┼─");
126
+ result += "─┤\n";
127
+ for (const row of table) {
128
+ result += "│ ";
129
+ result += Object.values(row).join(" │ ");
130
+ result += " │\n";
131
+ }
132
+ result += "└─";
133
+ result += Object.keys(colWidth)
134
+ .map((key) => "─".repeat(colWidth[key]))
135
+ .join("─┴─");
136
+ result += "─┘\n";
137
+ console.log(result);
138
+ }
139
+ }
140
+ exports.Config = Config;
141
+ function getEnv(key, fallback) {
142
+ return process.env[key] || fallback;
143
+ }
144
+ function getEnvInt(key, fallback = "") {
145
+ return parseInt(getEnv(key, fallback));
146
+ }
147
+ function getEnvFloat(key, fallback = "") {
148
+ return parseFloat(getEnv(key, fallback));
149
+ }
150
+ function getEnvBoolean(key, fallback = "false") {
151
+ const value = getEnv(key, fallback);
152
+ if (!value || value.toLowerCase() === "false" || value === "0") {
153
+ return false;
154
+ }
155
+ return true;
156
+ }
@@ -1,12 +1,12 @@
1
- interface Options {
2
- /** Number in px */
3
- width?: number;
4
- /** Number in px */
5
- height?: number;
6
- /** A list of pages to render instead of all of them */
7
- page_numbers?: number[];
8
- /** Output as base64 */
9
- base64?: boolean;
10
- }
11
- export declare function convert(pdf: string, conversion_config?: Options): Promise<any[]>;
12
- export {};
1
+ interface Options {
2
+ /** Number in px */
3
+ width?: number;
4
+ /** Number in px */
5
+ height?: number;
6
+ /** A list of pages to render instead of all of them */
7
+ page_numbers?: number[];
8
+ /** Output as base64 */
9
+ base64?: boolean;
10
+ }
11
+ export declare function convert(pdf: string, conversion_config?: Options): Promise<any[]>;
12
+ export {};
@@ -1,111 +1,111 @@
1
- "use strict";
2
- // @ts-nocheck
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.convert = void 0;
8
- // Fork of: https://www.npmjs.com/package/pdf-img-convert
9
- // node_modules/pdf-img-convert/pdf-img-convert.js
10
- const node_fetch_1 = __importDefault(require("node-fetch"));
11
- const strict_1 = __importDefault(require("assert/strict"));
12
- // import pdfjs from "pdfjs-dist/legacy/build/pdf.js";
13
- // import Canvas from "canvas";
14
- // Somehow the import does not work
15
- const pdfjs = require("pdfjs-dist/legacy/build/pdf.js");
16
- const Canvas = require("canvas");
17
- function NodeCanvasFactory() { }
18
- NodeCanvasFactory.prototype = {
19
- create: function NodeCanvasFactory_create(width, height) {
20
- (0, strict_1.default)(width > 0 && height > 0, "Invalid canvas size");
21
- var canvas = Canvas.createCanvas(width, height);
22
- var context = canvas.getContext("2d");
23
- return {
24
- canvas: canvas,
25
- context: context,
26
- };
27
- },
28
- reset: function NodeCanvasFactory_reset(canvasAndContext, width, height) {
29
- (0, strict_1.default)(canvasAndContext.canvas, "Canvas is not specified");
30
- (0, strict_1.default)(width > 0 && height > 0, "Invalid canvas size");
31
- canvasAndContext.canvas.width = width;
32
- canvasAndContext.canvas.height = height;
33
- },
34
- destroy: function NodeCanvasFactory_destroy(canvasAndContext) {
35
- (0, strict_1.default)(canvasAndContext.canvas, "Canvas is not specified");
36
- // Zeroing the width and height cause Firefox to release graphics
37
- // resources immediately, which can greatly reduce memory consumption.
38
- canvasAndContext.canvas.width = 0;
39
- canvasAndContext.canvas.height = 0;
40
- canvasAndContext.canvas = null;
41
- canvasAndContext.context = null;
42
- },
43
- };
44
- async function convert(pdf, conversion_config = {}) {
45
- // Get the PDF in Uint8Array form
46
- const resp = await (0, node_fetch_1.default)(pdf);
47
- const pdfData = new Uint8Array(await resp.arrayBuffer());
48
- var outputPages = [];
49
- var loadingTask = pdfjs.getDocument({ data: pdfData, verbosity: 0 });
50
- var pdfDocument = await loadingTask.promise;
51
- var canvasFactory = new NodeCanvasFactory();
52
- if (conversion_config.height <= 0 || conversion_config.width <= 0)
53
- console.error("Negative viewport dimension given. Defaulting to 100% scale.");
54
- // If there are page numbers supplied in the conversion config
55
- if (conversion_config.page_numbers)
56
- for (let i = 0; i < conversion_config.page_numbers.length; i++) {
57
- // This just pushes a render of the page to the array
58
- let currentPage = await doc_render(pdfDocument, conversion_config.page_numbers[i], canvasFactory, conversion_config);
59
- if (currentPage != null) {
60
- // This allows for base64 conversion of output images
61
- if (conversion_config.base64)
62
- outputPages.push(currentPage.toString("base64"));
63
- else
64
- outputPages.push(new Uint8Array(currentPage));
65
- }
66
- }
67
- // Otherwise just loop the whole doc
68
- else
69
- for (let i = 1; i <= pdfDocument.numPages; i++) {
70
- let currentPage = await doc_render(pdfDocument, i, canvasFactory, conversion_config);
71
- if (currentPage != null) {
72
- // This allows for base64 conversion of output images
73
- if (conversion_config.base64)
74
- outputPages.push(currentPage.toString("base64"));
75
- else
76
- outputPages.push(new Uint8Array(currentPage));
77
- }
78
- }
79
- return outputPages;
80
- } // convert method
81
- exports.convert = convert;
82
- async function doc_render(pdfDocument, pageNo, canvasFactory, conversion_config) {
83
- // Page number sanity check
84
- if (pageNo < 1 || pageNo > pdfDocument.numPages) {
85
- console.error("Invalid page number " + pageNo);
86
- return;
87
- }
88
- // Get the page
89
- let page = await pdfDocument.getPage(pageNo);
90
- // Create a viewport at 100% scale
91
- let outputScale = 1.0;
92
- let viewport = page.getViewport({ scale: outputScale });
93
- // Scale it up / down dependent on the sizes given in the config (if there
94
- // are any)
95
- if (conversion_config.width)
96
- outputScale = conversion_config.width / viewport.width;
97
- else if (conversion_config.height)
98
- outputScale = conversion_config.height / viewport.height;
99
- if (outputScale != 1 && outputScale > 0)
100
- viewport = page.getViewport({ scale: outputScale });
101
- let canvasAndContext = canvasFactory.create(viewport.width, viewport.height);
102
- let renderContext = {
103
- canvasContext: canvasAndContext.context,
104
- viewport: viewport,
105
- canvasFactory: canvasFactory,
106
- };
107
- let renderTask = await page.render(renderContext).promise;
108
- // Convert the canvas to an image buffer.
109
- let image = canvasAndContext.canvas.toBuffer();
110
- return image;
111
- } // doc_render
1
+ "use strict";
2
+ // @ts-nocheck
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.convert = void 0;
8
+ // Fork of: https://www.npmjs.com/package/pdf-img-convert
9
+ // node_modules/pdf-img-convert/pdf-img-convert.js
10
+ const node_fetch_1 = __importDefault(require("node-fetch"));
11
+ const strict_1 = __importDefault(require("assert/strict"));
12
+ // import pdfjs from "pdfjs-dist/legacy/build/pdf.js";
13
+ // import Canvas from "canvas";
14
+ // Somehow the import does not work
15
+ const pdfjs = require("pdfjs-dist/legacy/build/pdf.js");
16
+ const Canvas = require("canvas");
17
+ function NodeCanvasFactory() { }
18
+ NodeCanvasFactory.prototype = {
19
+ create: function NodeCanvasFactory_create(width, height) {
20
+ (0, strict_1.default)(width > 0 && height > 0, "Invalid canvas size");
21
+ var canvas = Canvas.createCanvas(width, height);
22
+ var context = canvas.getContext("2d");
23
+ return {
24
+ canvas: canvas,
25
+ context: context,
26
+ };
27
+ },
28
+ reset: function NodeCanvasFactory_reset(canvasAndContext, width, height) {
29
+ (0, strict_1.default)(canvasAndContext.canvas, "Canvas is not specified");
30
+ (0, strict_1.default)(width > 0 && height > 0, "Invalid canvas size");
31
+ canvasAndContext.canvas.width = width;
32
+ canvasAndContext.canvas.height = height;
33
+ },
34
+ destroy: function NodeCanvasFactory_destroy(canvasAndContext) {
35
+ (0, strict_1.default)(canvasAndContext.canvas, "Canvas is not specified");
36
+ // Zeroing the width and height cause Firefox to release graphics
37
+ // resources immediately, which can greatly reduce memory consumption.
38
+ canvasAndContext.canvas.width = 0;
39
+ canvasAndContext.canvas.height = 0;
40
+ canvasAndContext.canvas = null;
41
+ canvasAndContext.context = null;
42
+ },
43
+ };
44
+ async function convert(pdf, conversion_config = {}) {
45
+ // Get the PDF in Uint8Array form
46
+ const resp = await (0, node_fetch_1.default)(pdf);
47
+ const pdfData = new Uint8Array(await resp.arrayBuffer());
48
+ var outputPages = [];
49
+ var loadingTask = pdfjs.getDocument({ data: pdfData, verbosity: 0 });
50
+ var pdfDocument = await loadingTask.promise;
51
+ var canvasFactory = new NodeCanvasFactory();
52
+ if (conversion_config.height <= 0 || conversion_config.width <= 0)
53
+ console.error("Negative viewport dimension given. Defaulting to 100% scale.");
54
+ // If there are page numbers supplied in the conversion config
55
+ if (conversion_config.page_numbers)
56
+ for (let i = 0; i < conversion_config.page_numbers.length; i++) {
57
+ // This just pushes a render of the page to the array
58
+ let currentPage = await doc_render(pdfDocument, conversion_config.page_numbers[i], canvasFactory, conversion_config);
59
+ if (currentPage != null) {
60
+ // This allows for base64 conversion of output images
61
+ if (conversion_config.base64)
62
+ outputPages.push(currentPage.toString("base64"));
63
+ else
64
+ outputPages.push(new Uint8Array(currentPage));
65
+ }
66
+ }
67
+ // Otherwise just loop the whole doc
68
+ else
69
+ for (let i = 1; i <= pdfDocument.numPages; i++) {
70
+ let currentPage = await doc_render(pdfDocument, i, canvasFactory, conversion_config);
71
+ if (currentPage != null) {
72
+ // This allows for base64 conversion of output images
73
+ if (conversion_config.base64)
74
+ outputPages.push(currentPage.toString("base64"));
75
+ else
76
+ outputPages.push(new Uint8Array(currentPage));
77
+ }
78
+ }
79
+ return outputPages;
80
+ } // convert method
81
+ exports.convert = convert;
82
+ async function doc_render(pdfDocument, pageNo, canvasFactory, conversion_config) {
83
+ // Page number sanity check
84
+ if (pageNo < 1 || pageNo > pdfDocument.numPages) {
85
+ console.error("Invalid page number " + pageNo);
86
+ return;
87
+ }
88
+ // Get the page
89
+ let page = await pdfDocument.getPage(pageNo);
90
+ // Create a viewport at 100% scale
91
+ let outputScale = 1.0;
92
+ let viewport = page.getViewport({ scale: outputScale });
93
+ // Scale it up / down dependent on the sizes given in the config (if there
94
+ // are any)
95
+ if (conversion_config.width)
96
+ outputScale = conversion_config.width / viewport.width;
97
+ else if (conversion_config.height)
98
+ outputScale = conversion_config.height / viewport.height;
99
+ if (outputScale != 1 && outputScale > 0)
100
+ viewport = page.getViewport({ scale: outputScale });
101
+ let canvasAndContext = canvasFactory.create(viewport.width, viewport.height);
102
+ let renderContext = {
103
+ canvasContext: canvasAndContext.context,
104
+ viewport: viewport,
105
+ canvasFactory: canvasFactory,
106
+ };
107
+ let renderTask = await page.render(renderContext).promise;
108
+ // Convert the canvas to an image buffer.
109
+ let image = canvasAndContext.canvas.toBuffer();
110
+ return image;
111
+ } // doc_render
@@ -1 +1 @@
1
- export declare function init(): Promise<void>;
1
+ export declare function init(): Promise<void>;
@@ -1,40 +1,40 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.init = void 0;
7
- const node_fetch_1 = __importDefault(require("node-fetch"));
8
- const __1 = require("..");
9
- const config_1 = require("../config");
10
- const types_1 = require("../types");
11
- async function init() {
12
- (0, __1.beforeSaveHook)(types_1.Alarm, async (request) => {
13
- const { object, original, user } = request;
14
- await (0, __1.defaultHandler)(request);
15
- // TODO
16
- });
17
- (0, __1.afterSaveHook)(types_1.Alarm, async ({ object, original, user }) => {
18
- if (config_1.config.getBoolean("OPENWARE")) {
19
- const username = user?.get("username");
20
- const baseurl = config_1.config.get("OPENWARE_BASEURL");
21
- const headers = {
22
- "content-type": "application/json",
23
- "od-session": user?.getSessionToken() || "",
24
- };
25
- const body = JSON.stringify({
26
- ...object.toJSON(),
27
- owner: object.get("user"),
28
- createdAt: undefined,
29
- updatedAt: undefined,
30
- ACL: undefined,
31
- });
32
- await (0, node_fetch_1.default)(`${baseurl}/api/alarmsV2/${username}`, {
33
- method: "POST",
34
- headers,
35
- body,
36
- });
37
- }
38
- });
39
- }
40
- exports.init = init;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.init = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const __1 = require("..");
9
+ const config_1 = require("../config");
10
+ const types_1 = require("../types");
11
+ async function init() {
12
+ (0, __1.beforeSaveHook)(types_1.Alarm, async (request) => {
13
+ const { object, original, user } = request;
14
+ await (0, __1.defaultHandler)(request);
15
+ // TODO
16
+ });
17
+ (0, __1.afterSaveHook)(types_1.Alarm, async ({ object, original, user }) => {
18
+ if (config_1.config.getBoolean("OPENWARE")) {
19
+ const username = user?.get("username");
20
+ const baseurl = config_1.config.get("OPENWARE_BASEURL");
21
+ const headers = {
22
+ "content-type": "application/json",
23
+ "od-session": user?.getSessionToken() || "",
24
+ };
25
+ const body = JSON.stringify({
26
+ ...object.toJSON(),
27
+ owner: object.get("user"),
28
+ createdAt: undefined,
29
+ updatedAt: undefined,
30
+ ACL: undefined,
31
+ });
32
+ await (0, node_fetch_1.default)(`${baseurl}/api/alarmsV2/${username}`, {
33
+ method: "POST",
34
+ headers,
35
+ body,
36
+ });
37
+ }
38
+ });
39
+ }
40
+ exports.init = init;
@@ -1 +1 @@
1
- export declare function init(): Promise<void>;
1
+ export declare function init(): Promise<void>;