@oneuptime/common 8.0.5239 → 8.0.5285

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 (359) hide show
  1. package/Models/DatabaseModels/Index.ts +4 -2
  2. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +5 -3
  3. package/Models/DatabaseModels/Project.ts +4 -2
  4. package/Models/DatabaseModels/ProjectSmtpConfig.ts +4 -2
  5. package/Models/DatabaseModels/StatusPageDomain.ts +6 -4
  6. package/Models/DatabaseModels/User.ts +0 -46
  7. package/Models/DatabaseModels/{UserTwoFactorAuth.ts → UserTotpAuth.ts} +16 -16
  8. package/Models/DatabaseModels/UserWebAuthn.ts +244 -0
  9. package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +21 -0
  10. package/Server/API/BaseAPI.ts +4 -2
  11. package/Server/API/GlobalConfigAPI.ts +16 -12
  12. package/Server/API/MicrosoftTeamsAPI.ts +1240 -0
  13. package/Server/API/ProjectAPI.ts +4 -2
  14. package/Server/API/ResellerPlanAPI.ts +4 -2
  15. package/Server/API/SlackAPI.ts +54 -48
  16. package/Server/API/StatusPageAPI.ts +5 -3
  17. package/Server/API/UserOnCallLogTimelineAPI.ts +5 -3
  18. package/Server/API/{UserTwoFactorAuthAPI.ts → UserTotpAuthAPI.ts} +20 -20
  19. package/Server/API/UserWebAuthnAPI.ts +103 -0
  20. package/Server/EnvironmentConfig.ts +6 -0
  21. package/Server/Images/MicrosoftTeams/color.png +0 -0
  22. package/Server/Images/MicrosoftTeams/outline.png +0 -0
  23. package/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts +4 -2
  24. package/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.ts +27 -0
  25. package/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.ts +25 -0
  26. package/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.ts +15 -0
  27. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
  28. package/Server/Infrastructure/Queue.ts +4 -2
  29. package/Server/Infrastructure/SocketIO.ts +4 -2
  30. package/Server/Middleware/ProjectAuthorization.ts +5 -3
  31. package/Server/Middleware/SlackAuthorization.ts +2 -2
  32. package/Server/Middleware/TelemetryIngest.ts +12 -6
  33. package/Server/Services/AlertStateTimelineService.ts +34 -18
  34. package/Server/Services/BillingInvoiceService.ts +8 -4
  35. package/Server/Services/BillingService.ts +13 -9
  36. package/Server/Services/DatabaseService.ts +42 -30
  37. package/Server/Services/IncidentService.ts +5 -3
  38. package/Server/Services/IncidentStateTimelineService.ts +34 -18
  39. package/Server/Services/Index.ts +4 -2
  40. package/Server/Services/MonitorStatusTimelineService.ts +34 -18
  41. package/Server/Services/OnCallDutyPolicyScheduleService.ts +4 -2
  42. package/Server/Services/ProjectService.ts +6 -4
  43. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +26 -14
  44. package/Server/Services/StatusPageService.ts +4 -2
  45. package/Server/Services/UserService.ts +21 -5
  46. package/Server/Services/{UserTwoFactorAuthService.ts → UserTotpAuthService.ts} +26 -7
  47. package/Server/Services/UserWebAuthnService.ts +419 -0
  48. package/Server/Services/WorkspaceNotificationRuleService.ts +257 -77
  49. package/Server/Services/WorkspaceProjectAuthTokenService.ts +2 -2
  50. package/Server/Types/AnalyticsDatabase/ModelPermission.ts +9 -5
  51. package/Server/Types/Database/Permissions/BasePermission.ts +4 -2
  52. package/Server/Types/Database/Permissions/TenantPermission.ts +5 -3
  53. package/Server/Types/Database/QueryHelper.ts +4 -2
  54. package/Server/Types/Markdown.ts +6 -4
  55. package/Server/Types/Workflow/ComponentCode.ts +4 -2
  56. package/Server/Types/Workflow/Components/Conditions/IfElse.ts +5 -3
  57. package/Server/Types/Workflow/Components/JavaScript.ts +5 -3
  58. package/Server/Types/Workflow/TriggerCode.ts +4 -2
  59. package/Server/Utils/AnalyticsDatabase/Statement.ts +4 -2
  60. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +21 -11
  61. package/Server/Utils/Browser.ts +6 -4
  62. package/Server/Utils/CodeRepository/GitHub/GitHub.ts +4 -2
  63. package/Server/Utils/LocalFile.ts +14 -0
  64. package/Server/Utils/Monitor/MonitorResource.ts +17 -9
  65. package/Server/Utils/Realtime.ts +4 -2
  66. package/Server/Utils/StartServer.ts +1 -1
  67. package/Server/Utils/Telemetry.ts +15 -9
  68. package/Server/Utils/{TwoFactorAuth.ts → TotpAuth.ts} +2 -2
  69. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.ts +75 -16
  70. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +649 -0
  71. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +237 -0
  72. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +1321 -0
  73. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +155 -0
  74. package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +119 -0
  75. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +959 -0
  76. package/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts +16 -14
  77. package/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts +17 -14
  78. package/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts +18 -13
  79. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +2547 -14
  80. package/Server/Utils/Workspace/Slack/Actions/Alert.ts +4 -2
  81. package/Server/Utils/Workspace/Slack/Actions/Auth.ts +4 -2
  82. package/Server/Utils/Workspace/Slack/Actions/Incident.ts +14 -10
  83. package/Server/Utils/Workspace/Slack/Actions/Monitor.ts +4 -2
  84. package/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts +4 -2
  85. package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +14 -10
  86. package/Server/Utils/Workspace/Slack/Messages/Alert.ts +9 -7
  87. package/Server/Utils/Workspace/Slack/Messages/Incident.ts +9 -7
  88. package/Server/Utils/Workspace/Slack/Messages/Monitor.ts +9 -7
  89. package/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts +9 -7
  90. package/Server/Utils/Workspace/Slack/Slack.ts +6 -0
  91. package/Server/Utils/Workspace/Workspace.ts +13 -10
  92. package/Server/Utils/Workspace/WorkspaceBase.ts +9 -0
  93. package/Tests/Server/API/BaseAPI.test.ts +64 -52
  94. package/Tests/Server/Services/BillingService.test.ts +4 -4
  95. package/Tests/Server/Services/TeamMemberService.test.ts +20 -12
  96. package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +2 -2
  97. package/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts +8 -4
  98. package/Tests/UI/Components/DictionaryOfStrings.test.tsx +4 -2
  99. package/Tests/UI/Components/FilePicker.test.tsx +2 -2
  100. package/Tests/Utils/API.test.ts +9 -8
  101. package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts +5 -3
  102. package/Types/Html.ts +5 -3
  103. package/Types/JSONFunctions.ts +5 -5
  104. package/Types/Metrics/MetricsQuery.ts +6 -4
  105. package/Types/Monitor/MonitorType.ts +8 -6
  106. package/Types/OnCallDutyPolicy/Layer.ts +29 -17
  107. package/Types/Phone.ts +5 -3
  108. package/Types/Workspace/NotificationRules/BaseNotificationRule.ts +1 -0
  109. package/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts +5 -2
  110. package/Types/Workspace/WorkspaceMessagePayload.ts +1 -0
  111. package/Types/Workspace/WorkspaceType.ts +13 -0
  112. package/UI/Components/Charts/Utils/DataPoint.ts +8 -6
  113. package/UI/Components/Detail/Detail.tsx +4 -1
  114. package/UI/Components/FilePicker/FilePicker.tsx +1 -1
  115. package/UI/Components/Forms/Types/Field.ts +4 -2
  116. package/UI/Components/Image/Image.tsx +1 -1
  117. package/UI/Components/JSONTable/JSONTable.tsx +4 -2
  118. package/UI/Components/ModelTable/BaseModelTable.tsx +5 -3
  119. package/UI/Components/SideMenu/SideMenu.tsx +4 -2
  120. package/UI/Components/SideMenu/SideMenuItem.tsx +69 -45
  121. package/UI/Config.ts +3 -0
  122. package/UI/Utils/API/API.ts +5 -3
  123. package/UI/Utils/Countries.ts +5 -3
  124. package/UI/Utils/Login.ts +6 -1
  125. package/Utils/Base64.ts +13 -0
  126. package/Utils/Schema/ModelSchema.ts +4 -2
  127. package/build/dist/Models/DatabaseModels/Index.js +4 -2
  128. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  129. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +5 -3
  130. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js.map +1 -1
  131. package/build/dist/Models/DatabaseModels/Project.js +4 -2
  132. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  133. package/build/dist/Models/DatabaseModels/ProjectSmtpConfig.js +4 -2
  134. package/build/dist/Models/DatabaseModels/ProjectSmtpConfig.js.map +1 -1
  135. package/build/dist/Models/DatabaseModels/StatusPageDomain.js +6 -4
  136. package/build/dist/Models/DatabaseModels/StatusPageDomain.js.map +1 -1
  137. package/build/dist/Models/DatabaseModels/User.js +0 -49
  138. package/build/dist/Models/DatabaseModels/User.js.map +1 -1
  139. package/build/dist/Models/DatabaseModels/{UserTwoFactorAuth.js → UserTotpAuth.js} +27 -27
  140. package/build/dist/Models/DatabaseModels/UserTotpAuth.js.map +1 -0
  141. package/build/dist/Models/DatabaseModels/UserWebAuthn.js +270 -0
  142. package/build/dist/Models/DatabaseModels/UserWebAuthn.js.map +1 -0
  143. package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
  144. package/build/dist/Server/API/BaseAPI.js +4 -2
  145. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  146. package/build/dist/Server/API/GlobalConfigAPI.js +16 -12
  147. package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
  148. package/build/dist/Server/API/MicrosoftTeamsAPI.js +771 -0
  149. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -0
  150. package/build/dist/Server/API/ProjectAPI.js +4 -2
  151. package/build/dist/Server/API/ProjectAPI.js.map +1 -1
  152. package/build/dist/Server/API/ResellerPlanAPI.js +4 -2
  153. package/build/dist/Server/API/ResellerPlanAPI.js.map +1 -1
  154. package/build/dist/Server/API/SlackAPI.js +53 -47
  155. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  156. package/build/dist/Server/API/StatusPageAPI.js +5 -3
  157. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  158. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +5 -3
  159. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
  160. package/build/dist/Server/API/{UserTwoFactorAuthAPI.js → UserTotpAuthAPI.js} +16 -16
  161. package/build/dist/Server/API/UserTotpAuthAPI.js.map +1 -0
  162. package/build/dist/Server/API/UserWebAuthnAPI.js +65 -0
  163. package/build/dist/Server/API/UserWebAuthnAPI.js.map +1 -0
  164. package/build/dist/Server/EnvironmentConfig.js +3 -0
  165. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  166. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.js +4 -2
  167. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.js.map +1 -1
  168. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.js +16 -0
  169. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759175457008-MigrationName.js.map +1 -0
  170. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.js +16 -0
  171. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759232954703-MigrationName.js.map +1 -0
  172. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.js +12 -0
  173. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759234532998-MigrationName.js.map +1 -0
  174. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
  175. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  176. package/build/dist/Server/Infrastructure/Queue.js +4 -2
  177. package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
  178. package/build/dist/Server/Infrastructure/SocketIO.js +4 -2
  179. package/build/dist/Server/Infrastructure/SocketIO.js.map +1 -1
  180. package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -3
  181. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  182. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  183. package/build/dist/Server/Middleware/TelemetryIngest.js +12 -6
  184. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  185. package/build/dist/Server/Services/AlertStateTimelineService.js +34 -18
  186. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  187. package/build/dist/Server/Services/BillingInvoiceService.js +8 -4
  188. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  189. package/build/dist/Server/Services/BillingService.js +13 -9
  190. package/build/dist/Server/Services/BillingService.js.map +1 -1
  191. package/build/dist/Server/Services/DatabaseService.js +40 -28
  192. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  193. package/build/dist/Server/Services/IncidentService.js +5 -3
  194. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  195. package/build/dist/Server/Services/IncidentStateTimelineService.js +34 -18
  196. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  197. package/build/dist/Server/Services/Index.js +4 -2
  198. package/build/dist/Server/Services/Index.js.map +1 -1
  199. package/build/dist/Server/Services/MonitorStatusTimelineService.js +34 -18
  200. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  201. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +4 -2
  202. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  203. package/build/dist/Server/Services/ProjectService.js +6 -4
  204. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  205. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +26 -14
  206. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  207. package/build/dist/Server/Services/StatusPageService.js +4 -2
  208. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  209. package/build/dist/Server/Services/UserService.js +16 -3
  210. package/build/dist/Server/Services/UserService.js.map +1 -1
  211. package/build/dist/Server/Services/{UserTwoFactorAuthService.js → UserTotpAuthService.js} +22 -8
  212. package/build/dist/Server/Services/UserTotpAuthService.js.map +1 -0
  213. package/build/dist/Server/Services/UserWebAuthnService.js +365 -0
  214. package/build/dist/Server/Services/UserWebAuthnService.js.map +1 -0
  215. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +142 -51
  216. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
  217. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +9 -5
  218. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
  219. package/build/dist/Server/Types/Database/Permissions/BasePermission.js +4 -2
  220. package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
  221. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +5 -3
  222. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
  223. package/build/dist/Server/Types/Database/QueryHelper.js +4 -2
  224. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  225. package/build/dist/Server/Types/Markdown.js +6 -4
  226. package/build/dist/Server/Types/Markdown.js.map +1 -1
  227. package/build/dist/Server/Types/Workflow/ComponentCode.js +4 -2
  228. package/build/dist/Server/Types/Workflow/ComponentCode.js.map +1 -1
  229. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +5 -3
  230. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
  231. package/build/dist/Server/Types/Workflow/Components/JavaScript.js +5 -3
  232. package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
  233. package/build/dist/Server/Types/Workflow/TriggerCode.js.map +1 -1
  234. package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +4 -2
  235. package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
  236. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +21 -11
  237. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  238. package/build/dist/Server/Utils/Browser.js +6 -4
  239. package/build/dist/Server/Utils/Browser.js.map +1 -1
  240. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +4 -2
  241. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
  242. package/build/dist/Server/Utils/LocalFile.js +16 -0
  243. package/build/dist/Server/Utils/LocalFile.js.map +1 -1
  244. package/build/dist/Server/Utils/Monitor/MonitorResource.js +17 -9
  245. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  246. package/build/dist/Server/Utils/Realtime.js +4 -2
  247. package/build/dist/Server/Utils/Realtime.js.map +1 -1
  248. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  249. package/build/dist/Server/Utils/Telemetry.js +6 -4
  250. package/build/dist/Server/Utils/Telemetry.js.map +1 -1
  251. package/build/dist/Server/Utils/{TwoFactorAuth.js → TotpAuth.js} +8 -8
  252. package/build/dist/Server/Utils/TotpAuth.js.map +1 -0
  253. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js +86 -36
  254. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ActionTypes.js.map +1 -1
  255. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +531 -0
  256. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -0
  257. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +206 -0
  258. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -0
  259. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +1102 -0
  260. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -0
  261. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +136 -0
  262. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -0
  263. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +107 -0
  264. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -0
  265. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +795 -0
  266. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -0
  267. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js +16 -14
  268. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.js.map +1 -1
  269. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js +16 -14
  270. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.js.map +1 -1
  271. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js +15 -13
  272. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.js.map +1 -1
  273. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +1982 -13
  274. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  275. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +4 -2
  276. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
  277. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +4 -2
  278. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
  279. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +14 -10
  280. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
  281. package/build/dist/Server/Utils/Workspace/Slack/Actions/Monitor.js +4 -2
  282. package/build/dist/Server/Utils/Workspace/Slack/Actions/Monitor.js.map +1 -1
  283. package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js +4 -2
  284. package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js.map +1 -1
  285. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +14 -10
  286. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
  287. package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js +9 -7
  288. package/build/dist/Server/Utils/Workspace/Slack/Messages/Alert.js.map +1 -1
  289. package/build/dist/Server/Utils/Workspace/Slack/Messages/Incident.js +9 -7
  290. package/build/dist/Server/Utils/Workspace/Slack/Messages/Incident.js.map +1 -1
  291. package/build/dist/Server/Utils/Workspace/Slack/Messages/Monitor.js +9 -7
  292. package/build/dist/Server/Utils/Workspace/Slack/Messages/Monitor.js.map +1 -1
  293. package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js +9 -7
  294. package/build/dist/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.js.map +1 -1
  295. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +5 -0
  296. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  297. package/build/dist/Server/Utils/Workspace/Workspace.js +12 -10
  298. package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
  299. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
  300. package/build/dist/Tests/Server/API/BaseAPI.test.js +59 -47
  301. package/build/dist/Tests/Server/API/BaseAPI.test.js.map +1 -1
  302. package/build/dist/Tests/Server/Services/BillingService.test.js +4 -4
  303. package/build/dist/Tests/Server/Services/BillingService.test.js.map +1 -1
  304. package/build/dist/Tests/Server/Services/TeamMemberService.test.js +20 -12
  305. package/build/dist/Tests/Server/Services/TeamMemberService.test.js.map +1 -1
  306. package/build/dist/Tests/Server/TestingUtils/Services/BillingServiceHelper.js +2 -2
  307. package/build/dist/Tests/Server/TestingUtils/Services/BillingServiceHelper.js.map +1 -1
  308. package/build/dist/Tests/Types/OnCallDutyPolicy/LayerUtil.test.js +8 -4
  309. package/build/dist/Tests/Types/OnCallDutyPolicy/LayerUtil.test.js.map +1 -1
  310. package/build/dist/Tests/UI/Components/DictionaryOfStrings.test.js +4 -2
  311. package/build/dist/Tests/UI/Components/DictionaryOfStrings.test.js.map +1 -1
  312. package/build/dist/Tests/UI/Components/FilePicker.test.js +2 -2
  313. package/build/dist/Tests/UI/Components/FilePicker.test.js.map +1 -1
  314. package/build/dist/Tests/Utils/API.test.js +8 -7
  315. package/build/dist/Tests/Utils/API.test.js.map +1 -1
  316. package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +5 -3
  317. package/build/dist/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js.map +1 -1
  318. package/build/dist/Types/Html.js +5 -3
  319. package/build/dist/Types/Html.js.map +1 -1
  320. package/build/dist/Types/JSONFunctions.js +5 -5
  321. package/build/dist/Types/JSONFunctions.js.map +1 -1
  322. package/build/dist/Types/Monitor/MonitorType.js +8 -6
  323. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  324. package/build/dist/Types/OnCallDutyPolicy/Layer.js +29 -17
  325. package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
  326. package/build/dist/Types/Phone.js +5 -3
  327. package/build/dist/Types/Phone.js.map +1 -1
  328. package/build/dist/Types/Workspace/WorkspaceType.js +9 -0
  329. package/build/dist/Types/Workspace/WorkspaceType.js.map +1 -1
  330. package/build/dist/UI/Components/Charts/Utils/DataPoint.js +8 -6
  331. package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
  332. package/build/dist/UI/Components/Detail/Detail.js +4 -1
  333. package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
  334. package/build/dist/UI/Components/FilePicker/FilePicker.js +1 -1
  335. package/build/dist/UI/Components/FilePicker/FilePicker.js.map +1 -1
  336. package/build/dist/UI/Components/Image/Image.js +1 -1
  337. package/build/dist/UI/Components/Image/Image.js.map +1 -1
  338. package/build/dist/UI/Components/JSONTable/JSONTable.js.map +1 -1
  339. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  340. package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -2
  341. package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
  342. package/build/dist/UI/Components/SideMenu/SideMenuItem.js +62 -38
  343. package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
  344. package/build/dist/UI/Config.js +1 -0
  345. package/build/dist/UI/Config.js.map +1 -1
  346. package/build/dist/UI/Utils/API/API.js +5 -3
  347. package/build/dist/UI/Utils/API/API.js.map +1 -1
  348. package/build/dist/UI/Utils/Countries.js.map +1 -1
  349. package/build/dist/UI/Utils/Login.js +6 -1
  350. package/build/dist/UI/Utils/Login.js.map +1 -1
  351. package/build/dist/Utils/Base64.js +12 -0
  352. package/build/dist/Utils/Base64.js.map +1 -0
  353. package/build/dist/Utils/Schema/ModelSchema.js +4 -2
  354. package/build/dist/Utils/Schema/ModelSchema.js.map +1 -1
  355. package/package.json +5 -1
  356. package/build/dist/Models/DatabaseModels/UserTwoFactorAuth.js.map +0 -1
  357. package/build/dist/Server/API/UserTwoFactorAuthAPI.js.map +0 -1
  358. package/build/dist/Server/Services/UserTwoFactorAuthService.js.map +0 -1
  359. package/build/dist/Server/Utils/TwoFactorAuth.js.map +0 -1
@@ -25,8 +25,10 @@ export default class ProjectAPI extends BaseAPI<Project, ProjectServiceType> {
25
25
  public constructor() {
26
26
  super(Project, ProjectService);
27
27
 
28
- /// This API lists all the projects where user is its team member.
29
- /// This API is usually used to show project selector dropdown in the UI
28
+ /*
29
+ * This API lists all the projects where user is its team member.
30
+ * This API is usually used to show project selector dropdown in the UI
31
+ */
30
32
  this.router.post(
31
33
  `${new this.entityType()
32
34
  .getCrudApiPath()
@@ -30,8 +30,10 @@ export default class ResellerPlanAPI extends BaseAPI<
30
30
  public constructor() {
31
31
  super(ResellerPlan, ResellerPlanService);
32
32
 
33
- // Reseller Plan Action API
34
- // TODO: Refactor this API and make it partner specific.
33
+ /*
34
+ * Reseller Plan Action API
35
+ * TODO: Refactor this API and make it partner specific.
36
+ */
35
37
  this.router.post(
36
38
  `${new this.entityType()
37
39
  .getCrudApiPath()
@@ -181,29 +181,31 @@ export default class SlackAPI {
181
181
  let botUserId: string | undefined = undefined;
182
182
  let slackUserAccessToken: string | undefined = undefined;
183
183
 
184
- // ReponseBody is in this format.
185
- // {
186
- // "ok": true,
187
- // "access_token": "sample-token",
188
- // "token_type": "bot",
189
- // "scope": "commands,incoming-webhook",
190
- // "bot_user_id": "U0KRQLJ9H",
191
- // "app_id": "A0KRD7HC3",
192
- // "team": {
193
- // "name": "Slack Pickleball Team",
194
- // "id": "T9TK3CUKW"
195
- // },
196
- // "enterprise": {
197
- // "name": "slack-pickleball",
198
- // "id": "E12345678"
199
- // },
200
- // "authed_user": {
201
- // "id": "U1234",
202
- // "scope": "chat:write",
203
- // "access_token": "sample-token",
204
- // "token_type": "user"
205
- // }
206
- // }
184
+ /*
185
+ * ReponseBody is in this format.
186
+ * {
187
+ * "ok": true,
188
+ * "access_token": "sample-token",
189
+ * "token_type": "bot",
190
+ * "scope": "commands,incoming-webhook",
191
+ * "bot_user_id": "U0KRQLJ9H",
192
+ * "app_id": "A0KRD7HC3",
193
+ * "team": {
194
+ * "name": "Slack Pickleball Team",
195
+ * "id": "T9TK3CUKW"
196
+ * },
197
+ * "enterprise": {
198
+ * "name": "slack-pickleball",
199
+ * "id": "E12345678"
200
+ * },
201
+ * "authed_user": {
202
+ * "id": "U1234",
203
+ * "scope": "chat:write",
204
+ * "access_token": "sample-token",
205
+ * "token_type": "user"
206
+ * }
207
+ * }
208
+ */
207
209
 
208
210
  if (responseBody["ok"] !== true) {
209
211
  return Response.sendErrorResponse(
@@ -407,31 +409,35 @@ export default class SlackAPI {
407
409
  "id_token"
408
410
  ] as JSONObject;
409
411
 
410
- // Example of Response Body
411
- // {
412
- // "iss": "https://slack.com",
413
- // "sub": "U123ABC456",
414
- // "aud": "25259531569.1115258246291",
415
- // "exp": 1626874955,
416
- // "iat": 1626874655,
417
- // "auth_time": 1626874655,
418
- // "nonce": "abcd",
419
- // "at_hash": "abc...123",
420
- // "https://slack.com/team_id": "T0123ABC456",
421
- // "https://slack.com/user_id": "U123ABC456",
422
- // "email": "alice@example.com",
423
- // "email_verified": true,
424
- // "date_email_verified": 1622128723,
425
- // "locale": "en-US",
426
- // "name": "Alice",
427
- // "given_name": "",
428
- // "family_name": "",
429
- // "https://slack.com/team_image_230": "https://secure.gravatar.com/avatar/bc.png",
430
- // "https://slack.com/team_image_default": true
431
- // }
432
-
433
- // check if the team id matches the project id.
434
- // get project auth.
412
+ /*
413
+ * Example of Response Body
414
+ * {
415
+ * "iss": "https://slack.com",
416
+ * "sub": "U123ABC456",
417
+ * "aud": "25259531569.1115258246291",
418
+ * "exp": 1626874955,
419
+ * "iat": 1626874655,
420
+ * "auth_time": 1626874655,
421
+ * "nonce": "abcd",
422
+ * "at_hash": "abc...123",
423
+ * "https://slack.com/team_id": "T0123ABC456",
424
+ * "https://slack.com/user_id": "U123ABC456",
425
+ * "email": "alice@example.com",
426
+ * "email_verified": true,
427
+ * "date_email_verified": 1622128723,
428
+ * "locale": "en-US",
429
+ * "name": "Alice",
430
+ * "given_name": "",
431
+ * "family_name": "",
432
+ * "https://slack.com/team_image_230": "https://secure.gravatar.com/avatar/bc.png",
433
+ * "https://slack.com/team_image_default": true
434
+ * }
435
+ */
436
+
437
+ /*
438
+ * check if the team id matches the project id.
439
+ * get project auth.
440
+ */
435
441
 
436
442
  const projectAuth: WorkspaceProjectAuthToken | null =
437
443
  await WorkspaceProjectAuthTokenService.findOneBy({
@@ -735,9 +735,11 @@ export default class StatusPageAPI extends BaseAPI<
735
735
  req: req,
736
736
  });
737
737
 
738
- // get start and end date from request body.
739
- // if no end date is provided then it will be current date.
740
- // if no start date is provided then it will be 14 days ago from end date.
738
+ /*
739
+ * get start and end date from request body.
740
+ * if no end date is provided then it will be current date.
741
+ * if no start date is provided then it will be 14 days ago from end date.
742
+ */
741
743
 
742
744
  let startDate: Date = OneUptimeDate.getSomeDaysAgo(14);
743
745
  let endDate: Date = OneUptimeDate.getCurrentDate();
@@ -93,9 +93,11 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI<
93
93
  },
94
94
  );
95
95
 
96
- // We have this ack page to show the user a confirmation page before acknowledging the notification.
97
- // this is because email clients automatically make a get request to the url in the email and ack the notification automatically which is not what we want.
98
- // so we need to create this page for the user to confirm that they want to acknowledge the notification.
96
+ /*
97
+ * We have this ack page to show the user a confirmation page before acknowledging the notification.
98
+ * this is because email clients automatically make a get request to the url in the email and ack the notification automatically which is not what we want.
99
+ * so we need to create this page for the user to confirm that they want to acknowledge the notification.
100
+ */
99
101
  this.router.get(
100
102
  `${new this.entityType()
101
103
  .getCrudApiPath()
@@ -1,8 +1,8 @@
1
1
  import ObjectID from "../../Types/ObjectID";
2
2
  import UserMiddleware from "../Middleware/UserAuthorization";
3
- import UserTwoFactorAuthService, {
4
- Service as UserTwoFactorAuthServiceType,
5
- } from "../Services/UserTwoFactorAuthService";
3
+ import UserTotpAuthService, {
4
+ Service as UserTotpAuthServiceType,
5
+ } from "../Services/UserTotpAuthService";
6
6
  import {
7
7
  ExpressRequest,
8
8
  ExpressResponse,
@@ -10,27 +10,27 @@ import {
10
10
  OneUptimeRequest,
11
11
  } from "../Utils/Express";
12
12
  import BaseAPI from "./BaseAPI";
13
- import UserTwoFactorAuth from "../../Models/DatabaseModels/UserTwoFactorAuth";
13
+ import UserTotpAuth from "../../Models/DatabaseModels/UserTotpAuth";
14
14
  import BadDataException from "../../Types/Exception/BadDataException";
15
- import TwoFactorAuth from "../Utils/TwoFactorAuth";
15
+ import TotpAuth from "../Utils/TotpAuth";
16
16
  import Response from "../Utils/Response";
17
17
  import User from "../../Models/DatabaseModels/User";
18
18
  import UserService from "../Services/UserService";
19
19
 
20
- export default class UserTwoFactorAuthAPI extends BaseAPI<
21
- UserTwoFactorAuth,
22
- UserTwoFactorAuthServiceType
20
+ export default class UserTotpAuthAPI extends BaseAPI<
21
+ UserTotpAuth,
22
+ UserTotpAuthServiceType
23
23
  > {
24
24
  public constructor() {
25
- super(UserTwoFactorAuth, UserTwoFactorAuthService);
25
+ super(UserTotpAuth, UserTotpAuthService);
26
26
 
27
27
  this.router.post(
28
28
  `${new this.entityType().getCrudApiPath()?.toString()}/validate`,
29
29
  UserMiddleware.getUserMiddleware,
30
30
  async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
31
31
  try {
32
- const userTwoFactorAuth: UserTwoFactorAuth | null =
33
- await UserTwoFactorAuthService.findOneById({
32
+ const userTotpAuth: UserTotpAuth | null =
33
+ await UserTotpAuthService.findOneById({
34
34
  id: new ObjectID(req.body["id"]),
35
35
  select: {
36
36
  twoFactorSecret: true,
@@ -41,24 +41,24 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
41
41
  },
42
42
  });
43
43
 
44
- if (!userTwoFactorAuth) {
45
- throw new BadDataException("Two factor auth not found");
44
+ if (!userTotpAuth) {
45
+ throw new BadDataException("TOTP auth not found");
46
46
  }
47
47
 
48
48
  if (
49
- userTwoFactorAuth.userId?.toString() !==
49
+ userTotpAuth.userId?.toString() !==
50
50
  (req as OneUptimeRequest).userAuthorization?.userId.toString()
51
51
  ) {
52
52
  throw new BadDataException("Two factor auth not found");
53
53
  }
54
54
 
55
- if (!userTwoFactorAuth.userId) {
55
+ if (!userTotpAuth.userId) {
56
56
  throw new BadDataException("User not found");
57
57
  }
58
58
 
59
59
  // get user email.
60
60
  const user: User | null = await UserService.findOneById({
61
- id: userTwoFactorAuth.userId!,
61
+ id: userTotpAuth.userId!,
62
62
  select: {
63
63
  email: true,
64
64
  },
@@ -75,8 +75,8 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
75
75
  throw new BadDataException("User email not found");
76
76
  }
77
77
 
78
- const isValid: boolean = TwoFactorAuth.verifyToken({
79
- secret: userTwoFactorAuth.twoFactorSecret || "",
78
+ const isValid: boolean = TotpAuth.verifyToken({
79
+ secret: userTotpAuth.twoFactorSecret || "",
80
80
  token: req.body["code"] || "",
81
81
  email: user.email!,
82
82
  });
@@ -87,8 +87,8 @@ export default class UserTwoFactorAuthAPI extends BaseAPI<
87
87
 
88
88
  // update this 2fa code as verified
89
89
 
90
- await UserTwoFactorAuthService.updateOneById({
91
- id: userTwoFactorAuth.id!,
90
+ await UserTotpAuthService.updateOneById({
91
+ id: userTotpAuth.id!,
92
92
  data: {
93
93
  isVerified: true,
94
94
  },
@@ -0,0 +1,103 @@
1
+ import ObjectID from "../../Types/ObjectID";
2
+ import UserMiddleware from "../Middleware/UserAuthorization";
3
+ import UserWebAuthnService, {
4
+ Service as UserWebAuthnServiceType,
5
+ } from "../Services/UserWebAuthnService";
6
+ import {
7
+ ExpressRequest,
8
+ ExpressResponse,
9
+ NextFunction,
10
+ OneUptimeRequest,
11
+ } from "../Utils/Express";
12
+ import BaseAPI from "./BaseAPI";
13
+ import UserWebAuthn from "../../Models/DatabaseModels/UserWebAuthn";
14
+ import BadDataException from "../../Types/Exception/BadDataException";
15
+ import Response from "../Utils/Response";
16
+ import { JSONObject } from "../../Types/JSON";
17
+ import CommonAPI from "./CommonAPI";
18
+ import DatabaseCommonInteractionProps from "../../Types/BaseDatabase/DatabaseCommonInteractionProps";
19
+
20
+ export default class UserWebAuthnAPI extends BaseAPI<
21
+ UserWebAuthn,
22
+ UserWebAuthnServiceType
23
+ > {
24
+ public constructor() {
25
+ super(UserWebAuthn, UserWebAuthnService);
26
+
27
+ this.router.post(
28
+ `${new this.entityType().getCrudApiPath()?.toString()}/generate-registration-options`,
29
+ UserMiddleware.getUserMiddleware,
30
+ async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
31
+ try {
32
+ const userId: ObjectID = (req as OneUptimeRequest).userAuthorization!
33
+ .userId;
34
+
35
+ const result: { options: any; challenge: string } =
36
+ await UserWebAuthnService.generateRegistrationOptions({
37
+ userId: userId,
38
+ });
39
+
40
+ return Response.sendJsonObjectResponse(req, res, result);
41
+ } catch (err) {
42
+ next(err);
43
+ }
44
+ },
45
+ );
46
+
47
+ this.router.post(
48
+ `${new this.entityType().getCrudApiPath()?.toString()}/verify-registration`,
49
+ UserMiddleware.getUserMiddleware,
50
+ async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
51
+ try {
52
+ const data: JSONObject = req.body;
53
+
54
+ const databaseProps: DatabaseCommonInteractionProps =
55
+ await CommonAPI.getDatabaseCommonInteractionProps(req);
56
+
57
+ const expectedChallenge: string = data["challenge"] as string;
58
+ const credential: any = data["credential"];
59
+ const name: string = data["name"] as string;
60
+
61
+ await UserWebAuthnService.verifyRegistration({
62
+ challenge: expectedChallenge,
63
+ credential: credential,
64
+ name: name,
65
+ props: databaseProps,
66
+ });
67
+
68
+ return Response.sendEmptySuccessResponse(req, res);
69
+ } catch (err) {
70
+ next(err);
71
+ }
72
+ },
73
+ );
74
+
75
+ this.router.post(
76
+ `${new this.entityType().getCrudApiPath()?.toString()}/generate-authentication-options`,
77
+ async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
78
+ try {
79
+ const data: JSONObject = req.body["data"] as JSONObject;
80
+
81
+ if (!data) {
82
+ throw new BadDataException("Data is required");
83
+ }
84
+
85
+ const email: string | undefined = data["email"] as string | undefined;
86
+
87
+ if (!email) {
88
+ throw new BadDataException("Email is required");
89
+ }
90
+
91
+ const result: { options: any; challenge: string; userId: string } =
92
+ await UserWebAuthnService.generateAuthenticationOptions({
93
+ email: email,
94
+ });
95
+
96
+ return Response.sendJsonObjectResponse(req, res, result);
97
+ } catch (err) {
98
+ next(err);
99
+ }
100
+ },
101
+ );
102
+ }
103
+ }
@@ -340,6 +340,12 @@ export const SlackAppClientSecret: string | null =
340
340
  export const SlackAppSigningSecret: string | null =
341
341
  process.env["SLACK_APP_SIGNING_SECRET"] || null;
342
342
 
343
+ // Microsoft Teams Configuration
344
+ export const MicrosoftTeamsAppClientId: string | null =
345
+ process.env["MICROSOFT_TEAMS_APP_CLIENT_ID"] || null;
346
+ export const MicrosoftTeamsAppClientSecret: string | null =
347
+ process.env["MICROSOFT_TEAMS_APP_CLIENT_SECRET"] || null;
348
+
343
349
  // VAPID Configuration for Web Push Notifications
344
350
  export const VapidPublicKey: string | undefined =
345
351
  process.env["VAPID_PUBLIC_KEY"] || undefined;
@@ -11,8 +11,10 @@ export class AddEnableCustomSubscriberEmailNotificationFooterText1753131488925
11
11
  `ALTER TABLE "StatusPage" ADD "enableCustomSubscriberEmailNotificationFooterText" boolean NOT NULL DEFAULT false`,
12
12
  );
13
13
 
14
- // Data migration: Set existing status pages to have enableCustomSubscriberEmailNotificationFooterText = true
15
- // This ensures backward compatibility for existing status pages that already have custom footer text
14
+ /*
15
+ * Data migration: Set existing status pages to have enableCustomSubscriberEmailNotificationFooterText = true
16
+ * This ensures backward compatibility for existing status pages that already have custom footer text
17
+ */
16
18
  await queryRunner.query(
17
19
  `UPDATE "StatusPage" SET "enableCustomSubscriberEmailNotificationFooterText" = true WHERE "subscriberEmailNotificationFooterText" IS NOT NULL AND "subscriberEmailNotificationFooterText" != ''`,
18
20
  );
@@ -0,0 +1,27 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1759175457008 implements MigrationInterface {
4
+ public name = "MigrationName1759175457008";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE "UserWebAuthn" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "name" character varying(100) NOT NULL, "credentialId" text NOT NULL, "publicKey" text NOT NULL, "counter" text NOT NULL, "transports" text, "isVerified" boolean NOT NULL DEFAULT false, "deletedByUserId" uuid, "userId" uuid, CONSTRAINT "UQ_ed9d287cb27cc360b9c3a4542e9" UNIQUE ("credentialId"), CONSTRAINT "PK_76a58e093d632ac5a9036bfac57" PRIMARY KEY ("_id"))`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE "UserWebAuthn" ADD CONSTRAINT "FK_e14966d27e4991f5f53ef54cad5" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE "UserWebAuthn" ADD CONSTRAINT "FK_e7a7d2869a90899c5f76ec997c0" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
15
+ );
16
+ }
17
+
18
+ public async down(queryRunner: QueryRunner): Promise<void> {
19
+ await queryRunner.query(
20
+ `ALTER TABLE "UserWebAuthn" DROP CONSTRAINT "FK_e7a7d2869a90899c5f76ec997c0"`,
21
+ );
22
+ await queryRunner.query(
23
+ `ALTER TABLE "UserWebAuthn" DROP CONSTRAINT "FK_e14966d27e4991f5f53ef54cad5"`,
24
+ );
25
+ await queryRunner.query(`DROP TABLE "UserWebAuthn"`);
26
+ }
27
+ }
@@ -0,0 +1,25 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1759232954703 implements MigrationInterface {
4
+ public name = "MigrationName1759232954703";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE "User" DROP COLUMN "twoFactorSecretCode"`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE "User" DROP COLUMN "twoFactorAuthUrl"`,
12
+ );
13
+ await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "backupCodes"`);
14
+ }
15
+
16
+ public async down(queryRunner: QueryRunner): Promise<void> {
17
+ await queryRunner.query(`ALTER TABLE "User" ADD "backupCodes" text`);
18
+ await queryRunner.query(
19
+ `ALTER TABLE "User" ADD "twoFactorAuthUrl" character varying(100)`,
20
+ );
21
+ await queryRunner.query(
22
+ `ALTER TABLE "User" ADD "twoFactorSecretCode" character varying(100)`,
23
+ );
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class RenameUserTwoFactorAuthToUserTotpAuth1759234532998
4
+ implements MigrationInterface
5
+ {
6
+ public name = "RenameUserTwoFactorAuthToUserTotpAuth1759234532998";
7
+
8
+ public async up(queryRunner: QueryRunner): Promise<void> {
9
+ await queryRunner.renameTable("UserTwoFactorAuth", "UserTotpAuth");
10
+ }
11
+
12
+ public async down(queryRunner: QueryRunner): Promise<void> {
13
+ await queryRunner.renameTable("UserTotpAuth", "UserTwoFactorAuth");
14
+ }
15
+ }
@@ -171,6 +171,9 @@ import { MigrationName1758313975491 } from "./1758313975491-MigrationName";
171
171
  import { MigrationName1758626094132 } from "./1758626094132-MigrationName";
172
172
  import { MigrationName1758629540993 } from "./1758629540993-MigrationName";
173
173
  import { MigrationName1758798730753 } from "./1758798730753-MigrationName";
174
+ import { MigrationName1759175457008 } from "./1759175457008-MigrationName";
175
+ import { MigrationName1759232954703 } from "./1759232954703-MigrationName";
176
+ import { RenameUserTwoFactorAuthToUserTotpAuth1759234532998 } from "./1759234532998-MigrationName";
174
177
 
175
178
  export default [
176
179
  InitialMigration,
@@ -346,4 +349,7 @@ export default [
346
349
  MigrationName1758626094132,
347
350
  MigrationName1758629540993,
348
351
  MigrationName1758798730753,
352
+ MigrationName1759175457008,
353
+ MigrationName1759232954703,
354
+ RenameUserTwoFactorAuthToUserTotpAuth1759234532998,
349
355
  ];
@@ -93,8 +93,10 @@ export default class Queue {
93
93
  removeOnComplete: { count: 500 }, // keep last 1000 completed jobs
94
94
  removeOnFail: { count: 100 }, // keep last 500 failed jobs
95
95
  },
96
- // Optionally cap the event stream length (supported in BullMQ >= v5)
97
- // This helps prevent the :events stream from growing indefinitely
96
+ /*
97
+ * Optionally cap the event stream length (supported in BullMQ >= v5)
98
+ * This helps prevent the :events stream from growing indefinitely
99
+ */
98
100
  streams: {
99
101
  events: { maxLen: 1000 },
100
102
  },
@@ -26,8 +26,10 @@ export default abstract class IO {
26
26
  );
27
27
  }
28
28
 
29
- // const pubClient: ClientType = Redis.getClient()!.duplicate();
30
- // const subClient: ClientType = Redis.getClient()!.duplicate();
29
+ /*
30
+ * const pubClient: ClientType = Redis.getClient()!.duplicate();
31
+ * const subClient: ClientType = Redis.getClient()!.duplicate();
32
+ */
31
33
 
32
34
  // this.socketServer.adapter(createAdapter(pubClient, subClient));
33
35
  }
@@ -107,9 +107,11 @@ export default class ProjectMiddleware {
107
107
 
108
108
  if (apiKeyModel) {
109
109
  (req as OneUptimeRequest).userType = UserType.API;
110
- // TODO: Add API key permissions.
111
- // (req as OneUptimeRequest).permissions =
112
- // apiKeyModel.permissions || [];
110
+ /*
111
+ * TODO: Add API key permissions.
112
+ * (req as OneUptimeRequest).permissions =
113
+ * apiKeyModel.permissions || [];
114
+ */
113
115
  (req as OneUptimeRequest).userGlobalAccessPermission =
114
116
  await APIKeyAccessPermission.getDefaultApiGlobalPermission(
115
117
  tenantId,
@@ -53,8 +53,8 @@ export default class SlackAuthorization {
53
53
  // check if the signature is valid
54
54
  if (
55
55
  !crypto.timingSafeEqual(
56
- Buffer.from(signature),
57
- Buffer.from(slackSignature),
56
+ Buffer.from(signature) as Uint8Array,
57
+ Buffer.from(slackSignature) as Uint8Array,
58
58
  )
59
59
  ) {
60
60
  logger.error("Slack Signature Verification Failed.");
@@ -44,8 +44,10 @@ export default class TelemetryIngest {
44
44
  logger.error("Missing header: x-oneuptime-token");
45
45
 
46
46
  if (isOpenTelemetryAPI) {
47
- // then accept the response and return success.
48
- // do not return error because it causes Otel to retry the request.
47
+ /*
48
+ * then accept the response and return success.
49
+ * do not return error because it causes Otel to retry the request.
50
+ */
49
51
  return Response.sendEmptySuccessResponse(req, res);
50
52
  }
51
53
 
@@ -71,8 +73,10 @@ export default class TelemetryIngest {
71
73
  logger.error("Invalid service token: " + oneuptimeToken);
72
74
 
73
75
  if (isOpenTelemetryAPI) {
74
- // then accept the response and return success.
75
- // do not return error because it causes Otel to retry the request.
76
+ /*
77
+ * then accept the response and return success.
78
+ * do not return error because it causes Otel to retry the request.
79
+ */
76
80
  return Response.sendEmptySuccessResponse(req, res);
77
81
  }
78
82
 
@@ -89,8 +93,10 @@ export default class TelemetryIngest {
89
93
  );
90
94
 
91
95
  if (isOpenTelemetryAPI) {
92
- // then accept the response and return success.
93
- // do not return error because it causes Otel to retry the request.
96
+ /*
97
+ * then accept the response and return success.
98
+ * do not return error because it causes Otel to retry the request.
99
+ */
94
100
  return Response.sendEmptySuccessResponse(req, res);
95
101
  }
96
102