@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
@@ -757,8 +757,10 @@ export default class SlackAlertActions {
757
757
  }
758
758
 
759
759
  if (actionType === SlackActionType.ViewAlert) {
760
- // do nothing. This is just a view alert action.
761
- // clear response.
760
+ /*
761
+ * do nothing. This is just a view alert action.
762
+ * clear response.
763
+ */
762
764
  return Response.sendJsonObjectResponse(data.req, data.res, {
763
765
  response_action: "clear",
764
766
  });
@@ -42,8 +42,10 @@ export interface SlackRequest {
42
42
 
43
43
  const slackActionTypesThatDoNotRequireUserSlackAccountToBeConnectedToOneUptime: Array<SlackActionType> =
44
44
  [
45
- // anyone in the company can create incident.
46
- // regardless of whether they are connected to OneUptime or not.
45
+ /*
46
+ * anyone in the company can create incident.
47
+ * regardless of whether they are connected to OneUptime or not.
48
+ */
47
49
  SlackActionType.NewIncident,
48
50
  SlackActionType.SubmitNewIncident,
49
51
  SlackActionType.ViewIncident,
@@ -258,14 +258,16 @@ export default class SlackIncidentActions {
258
258
  // send response to clear the action.
259
259
  Response.sendTextResponse(data.req, data.res, "");
260
260
 
261
- // show new incident modal.
262
- // new incident modal is :
263
- // Incident Title (this can be prefilled with actionValue)
264
- // Incident Description
265
- // Incident Severity (dropdown) (single select)
266
- // Monitors (dropdown) (miltiselect)
267
- // Change Monitor Status to (dropdown) (single select)
268
- // Labels (dropdown) (multiselect)
261
+ /*
262
+ * show new incident modal.
263
+ * new incident modal is :
264
+ * Incident Title (this can be prefilled with actionValue)
265
+ * Incident Description
266
+ * Incident Severity (dropdown) (single select)
267
+ * Monitors (dropdown) (miltiselect)
268
+ * Change Monitor Status to (dropdown) (single select)
269
+ * Labels (dropdown) (multiselect)
270
+ */
269
271
 
270
272
  const incidentTitle: WorkspaceTextBoxBlock = {
271
273
  _type: "WorkspaceTextBoxBlock",
@@ -1267,8 +1269,10 @@ export default class SlackIncidentActions {
1267
1269
  }
1268
1270
 
1269
1271
  if (actionType === SlackActionType.ViewIncident) {
1270
- // do nothing. This is just a view incident action.
1271
- // clear response.
1272
+ /*
1273
+ * do nothing. This is just a view incident action.
1274
+ * clear response.
1275
+ */
1272
1276
  return Response.sendJsonObjectResponse(data.req, data.res, {
1273
1277
  response_action: "clear",
1274
1278
  });
@@ -31,8 +31,10 @@ export default class SlackMonitorActions {
31
31
  const actionType: SlackActionType | undefined = data.action.actionType;
32
32
 
33
33
  if (actionType === SlackActionType.ViewMonitor) {
34
- // do nothing. This is just a view Monitor action.
35
- // clear response.
34
+ /*
35
+ * do nothing. This is just a view Monitor action.
36
+ * clear response.
37
+ */
36
38
  return Response.sendJsonObjectResponse(data.req, data.res, {
37
39
  response_action: "clear",
38
40
  });
@@ -31,8 +31,10 @@ export default class SlackOnCallDutyActions {
31
31
  const actionType: SlackActionType | undefined = data.action.actionType;
32
32
 
33
33
  if (actionType === SlackActionType.ViewOnCallPolicy) {
34
- // do nothing. This is just a view alert action.
35
- // clear response.
34
+ /*
35
+ * do nothing. This is just a view alert action.
36
+ * clear response.
37
+ */
36
38
  return Response.sendJsonObjectResponse(data.req, data.res, {
37
39
  response_action: "clear",
38
40
  });
@@ -313,14 +313,16 @@ export default class SlackScheduledMaintenanceActions {
313
313
  // send response to clear the action.
314
314
  Response.sendTextResponse(data.req, data.res, "");
315
315
 
316
- // show new scheduledMaintenance modal.
317
- // new scheduledMaintenance modal is :
318
- // ScheduledMaintenance Title (this can be prefilled with actionValue)
319
- // ScheduledMaintenance Description
320
- // Start Date and Time (date picker)
321
- // End Date and Time (date picker)
322
- // Monitors (dropdown) (miltiselect)
323
- // Change Monitor Status to (dropdown) (single select)
316
+ /*
317
+ * show new scheduledMaintenance modal.
318
+ * new scheduledMaintenance modal is :
319
+ * ScheduledMaintenance Title (this can be prefilled with actionValue)
320
+ * ScheduledMaintenance Description
321
+ * Start Date and Time (date picker)
322
+ * End Date and Time (date picker)
323
+ * Monitors (dropdown) (miltiselect)
324
+ * Change Monitor Status to (dropdown) (single select)
325
+ */
324
326
 
325
327
  // Labels (dropdown) (multiselect)
326
328
 
@@ -1092,8 +1094,10 @@ export default class SlackScheduledMaintenanceActions {
1092
1094
  }
1093
1095
 
1094
1096
  if (actionType === SlackActionType.ViewScheduledMaintenance) {
1095
- // do nothing. This is just a view scheduledMaintenance action.
1096
- // clear response.
1097
+ /*
1098
+ * do nothing. This is just a view scheduledMaintenance action.
1099
+ * clear response.
1100
+ */
1097
1101
  return Response.sendJsonObjectResponse(data.req, data.res, {
1098
1102
  response_action: "clear",
1099
1103
  });
@@ -32,13 +32,15 @@ export default class SlackAlertMessages {
32
32
 
33
33
  blockSlack.push(dividerBlock);
34
34
 
35
- // now add buttons.
36
- // View data.
37
- // Execute On Call
38
- // Acknowledge alert
39
- // Resolve data.
40
- // Change Alert State.
41
- // Add Note.
35
+ /*
36
+ * now add buttons.
37
+ * View data.
38
+ * Execute On Call
39
+ * Acknowledge alert
40
+ * Resolve data.
41
+ * Change Alert State.
42
+ * Add Note.
43
+ */
42
44
 
43
45
  const buttons: Array<WorkspaceMessagePayloadButton> = [];
44
46
 
@@ -32,13 +32,15 @@ export default class SlackIncidentMessages {
32
32
 
33
33
  blockSlack.push(dividerBlock);
34
34
 
35
- // now add buttons.
36
- // View data.
37
- // Execute On Call
38
- // Acknowledge incident
39
- // Resolve data.
40
- // Change Incident State.
41
- // Add Note.
35
+ /*
36
+ * now add buttons.
37
+ * View data.
38
+ * Execute On Call
39
+ * Acknowledge incident
40
+ * Resolve data.
41
+ * Change Incident State.
42
+ * Add Note.
43
+ */
42
44
 
43
45
  const buttons: Array<WorkspaceMessagePayloadButton> = [];
44
46
 
@@ -31,13 +31,15 @@ export default class SlackMonitorMessages {
31
31
 
32
32
  blockSlack.push(dividerBlock);
33
33
 
34
- // now add buttons.
35
- // View data.
36
- // Execute On Call
37
- // Acknowledge Monitor
38
- // Resolve data.
39
- // Change Monitor State.
40
- // Add Note.
34
+ /*
35
+ * now add buttons.
36
+ * View data.
37
+ * Execute On Call
38
+ * Acknowledge Monitor
39
+ * Resolve data.
40
+ * Change Monitor State.
41
+ * Add Note.
42
+ */
41
43
 
42
44
  const buttons: Array<WorkspaceMessagePayloadButton> = [];
43
45
 
@@ -32,13 +32,15 @@ export default class SlackScheduledMaintenanceMessages {
32
32
 
33
33
  blockSlack.push(dividerBlock);
34
34
 
35
- // now add buttons.
36
- // View data.
37
- // Execute On Call
38
- // Acknowledge scheduledMaintenance
39
- // Resolve data.
40
- // Change ScheduledMaintenance State.
41
- // Add Note.
35
+ /*
36
+ * now add buttons.
37
+ * View data.
38
+ * Execute On Call
39
+ * Acknowledge scheduledMaintenance
40
+ * Resolve data.
41
+ * Change ScheduledMaintenance State.
42
+ * Add Note.
43
+ */
42
44
 
43
45
  const buttons: Array<WorkspaceMessagePayloadButton> = [];
44
46
 
@@ -48,6 +48,7 @@ export default class SlackUtil extends WorkspaceBase {
48
48
  public static override async getUsernameFromUserId(data: {
49
49
  authToken: string;
50
50
  userId: string;
51
+ projectId: ObjectID;
51
52
  }): Promise<string | null> {
52
53
  logger.debug("Getting username from user ID with data:");
53
54
  logger.debug(data);
@@ -1055,6 +1056,7 @@ export default class SlackUtil extends WorkspaceBase {
1055
1056
  const workspaspaceMessageResponse: WorkspaceSendMessageResponse = {
1056
1057
  threads: [],
1057
1058
  workspaceType: WorkspaceType.Slack,
1059
+ errors: [],
1058
1060
  };
1059
1061
 
1060
1062
  for (const channel of workspaceChannelsToPostTo) {
@@ -1088,6 +1090,10 @@ export default class SlackUtil extends WorkspaceBase {
1088
1090
  } catch (e) {
1089
1091
  logger.error(`Error sending message to channel ID ${channel.id}:`);
1090
1092
  logger.error(e);
1093
+ workspaspaceMessageResponse.errors!.push({
1094
+ channel: channel,
1095
+ error: e instanceof Error ? e.message : String(e),
1096
+ });
1091
1097
  }
1092
1098
  }
1093
1099
 
@@ -1,7 +1,7 @@
1
1
  import WorkspaceType from "../../../Types/Workspace/WorkspaceType";
2
2
  import WorkspaceBase, { WorkspaceSendMessageResponse } from "./WorkspaceBase";
3
3
  import SlackWorkspace from "./Slack/Slack";
4
- import MicrosoftTeamsWorkspace from "./MicrosoftTeams/MicrosoftTeams";
4
+ import MicrosoftTeamsUtil from "./MicrosoftTeams/MicrosoftTeams";
5
5
  import BadDataException from "../../../Types/Exception/BadDataException";
6
6
  import ObjectID from "../../../Types/ObjectID";
7
7
  import WorkspaceMessagePayload, {
@@ -57,6 +57,7 @@ export default class WorkspaceUtil {
57
57
  userId: workspaceUserToken.workspaceUserId,
58
58
  workspaceType: workspaceType,
59
59
  authToken: projectAuthToken.authToken,
60
+ projectId: data.projectId,
60
61
  });
61
62
 
62
63
  if (!workspaceUsername) {
@@ -115,7 +116,7 @@ export default class WorkspaceUtil {
115
116
  }
116
117
 
117
118
  if (workspaceType === WorkspaceType.MicrosoftTeams) {
118
- return MicrosoftTeamsWorkspace;
119
+ return MicrosoftTeamsUtil;
119
120
  }
120
121
 
121
122
  throw new BadDataException(
@@ -128,12 +129,14 @@ export default class WorkspaceUtil {
128
129
  userId: string;
129
130
  workspaceType: WorkspaceType;
130
131
  authToken: string;
132
+ projectId: ObjectID;
131
133
  }): Promise<string | null> {
132
134
  const userName: string | null = await WorkspaceUtil.getWorkspaceTypeUtil(
133
135
  data.workspaceType,
134
136
  ).getUsernameFromUserId({
135
137
  userId: data.userId,
136
138
  authToken: data.authToken,
139
+ projectId: data.projectId,
137
140
  });
138
141
 
139
142
  return userName;
@@ -172,14 +175,14 @@ export default class WorkspaceUtil {
172
175
 
173
176
  if (workspaceType === WorkspaceType.Slack) {
174
177
  botUserId = (projectAuthToken.miscData as SlackMiscData).botUserId;
175
- }
176
178
 
177
- if (!botUserId) {
178
- responses.push({
179
- workspaceType: workspaceType,
180
- threads: [],
181
- });
182
- continue;
179
+ if (!botUserId) {
180
+ responses.push({
181
+ workspaceType: workspaceType,
182
+ threads: [],
183
+ });
184
+ continue;
185
+ }
183
186
  }
184
187
 
185
188
  if (!projectAuthToken.authToken) {
@@ -192,7 +195,7 @@ export default class WorkspaceUtil {
192
195
 
193
196
  const result: WorkspaceSendMessageResponse =
194
197
  await WorkspaceUtil.getWorkspaceTypeUtil(workspaceType).sendMessage({
195
- userId: botUserId,
198
+ userId: botUserId || "",
196
199
  authToken: projectAuthToken.authToken,
197
200
  projectId: data.projectId,
198
201
  workspaceMessagePayload: messagePayloadByWorkspace,
@@ -32,12 +32,17 @@ export interface WorkspaceThread {
32
32
  export interface WorkspaceSendMessageResponse {
33
33
  threads: Array<WorkspaceThread>;
34
34
  workspaceType: WorkspaceType;
35
+ errors?: Array<{
36
+ channel: WorkspaceChannel;
37
+ error: string;
38
+ }>;
35
39
  }
36
40
 
37
41
  export interface WorkspaceChannel {
38
42
  id: string;
39
43
  name: string;
40
44
  workspaceType: WorkspaceType;
45
+ teamId?: string; // Required for Microsoft Teams
41
46
  }
42
47
 
43
48
  export default class WorkspaceBase {
@@ -55,6 +60,7 @@ export default class WorkspaceBase {
55
60
  authToken: string;
56
61
  channelName: string;
57
62
  projectId: ObjectID;
63
+ teamId?: string;
58
64
  }): Promise<boolean> {
59
65
  throw new NotImplementedException();
60
66
  }
@@ -74,6 +80,7 @@ export default class WorkspaceBase {
74
80
  public static async getUsernameFromUserId(_data: {
75
81
  authToken: string;
76
82
  userId: string;
83
+ projectId: ObjectID;
77
84
  }): Promise<string | null> {
78
85
  throw new NotImplementedException();
79
86
  }
@@ -192,6 +199,7 @@ export default class WorkspaceBase {
192
199
  public static async getWorkspaceChannelFromChannelId(_data: {
193
200
  authToken: string;
194
201
  channelId: string;
202
+ teamId?: string;
195
203
  }): Promise<WorkspaceChannel> {
196
204
  throw new NotImplementedException();
197
205
  }
@@ -202,6 +210,7 @@ export default class WorkspaceBase {
202
210
  authToken: string; // which auth token should we use to send.
203
211
  userId: string;
204
212
  projectId: ObjectID;
213
+ teamId?: string;
205
214
  }): Promise<WorkspaceSendMessageResponse> {
206
215
  throw new NotImplementedException();
207
216
  }
@@ -740,58 +740,70 @@ describe("BaseAPI", () => {
740
740
  });
741
741
  });
742
742
 
743
- // describe('createItem', () => {
744
- // let createRequest: OneUptimeRequest;
745
- // let createResponse: ExpressResponse;
746
- // let savedItem: BaseModel;
747
-
748
- // beforeEach(() => {
749
- // createRequest = {
750
- // body: {
751
- // data: { version: '1' },
752
- // miscDataProps: { additional: 'info' },
753
- // },
754
- // headers: {},
755
- // } as unknown as OneUptimeRequest;
756
-
757
- // createResponse = {
758
- // status: jest.fn().mockReturnThis(),
759
- // json: jest.fn().mockReturnThis(),
760
- // send: jest.fn().mockReturnThis(),
761
- // } as unknown as ExpressResponse;
762
-
763
- // savedItem = new BaseModel();
764
- // });
765
-
766
- // it('should call onBeforeCreate lifecycle method', async () => {
767
- // const onBeforeCreateSpy: jest.SpyInstance = jest.spyOn(
768
- // baseApiInstance as any,
769
- // 'onBeforeCreate'
770
- // );
771
- // await baseApiInstance.createItem(createRequest, createResponse);
772
- // expect(onBeforeCreateSpy).toHaveBeenCalledWith(
773
- // createRequest,
774
- // createResponse
775
- // );
776
- // });
777
-
778
- // it('should return EntityResponse with the saved item', async () => {
779
- // jest.spyOn(baseApiInstance.service, 'create').mockResolvedValue(
780
- // savedItem
781
- // );
782
- // await baseApiInstance.createItem(createRequest, createResponse);
783
- // const sendEntityResponseSpy: jest.SpyInstance = jest.spyOn(
784
- // Response as any,
785
- // 'sendEntityResponse'
786
- // );
787
- // expect(sendEntityResponseSpy).toHaveBeenCalledWith(
788
- // createRequest,
789
- // createResponse,
790
- // savedItem,
791
- // BaseModel
792
- // );
793
- // });
794
- // });
743
+ /*
744
+ * describe('createItem', () => {
745
+ * let createRequest: OneUptimeRequest;
746
+ * let createResponse: ExpressResponse;
747
+ * let savedItem: BaseModel;
748
+ */
749
+
750
+ /*
751
+ * beforeEach(() => {
752
+ * createRequest = {
753
+ * body: {
754
+ * data: { version: '1' },
755
+ * miscDataProps: { additional: 'info' },
756
+ * },
757
+ * headers: {},
758
+ * } as unknown as OneUptimeRequest;
759
+ */
760
+
761
+ /*
762
+ * createResponse = {
763
+ * status: jest.fn().mockReturnThis(),
764
+ * json: jest.fn().mockReturnThis(),
765
+ * send: jest.fn().mockReturnThis(),
766
+ * } as unknown as ExpressResponse;
767
+ */
768
+
769
+ /*
770
+ * savedItem = new BaseModel();
771
+ * });
772
+ */
773
+
774
+ /*
775
+ * it('should call onBeforeCreate lifecycle method', async () => {
776
+ * const onBeforeCreateSpy: jest.SpyInstance = jest.spyOn(
777
+ * baseApiInstance as any,
778
+ * 'onBeforeCreate'
779
+ * );
780
+ * await baseApiInstance.createItem(createRequest, createResponse);
781
+ * expect(onBeforeCreateSpy).toHaveBeenCalledWith(
782
+ * createRequest,
783
+ * createResponse
784
+ * );
785
+ * });
786
+ */
787
+
788
+ /*
789
+ * it('should return EntityResponse with the saved item', async () => {
790
+ * jest.spyOn(baseApiInstance.service, 'create').mockResolvedValue(
791
+ * savedItem
792
+ * );
793
+ * await baseApiInstance.createItem(createRequest, createResponse);
794
+ * const sendEntityResponseSpy: jest.SpyInstance = jest.spyOn(
795
+ * Response as any,
796
+ * 'sendEntityResponse'
797
+ * );
798
+ * expect(sendEntityResponseSpy).toHaveBeenCalledWith(
799
+ * createRequest,
800
+ * createResponse,
801
+ * savedItem,
802
+ * BaseModel
803
+ * );
804
+ * });
805
+ * });
806
+ */
795
807
 
796
808
  describe("getRouter", () => {
797
809
  it("should return an ExpressRouter instance", () => {
@@ -856,9 +856,9 @@ describe("BillingService", () => {
856
856
 
857
857
  it("should successfully retrieve subscription items for a given subscription", async () => {
858
858
  mockSubscription.items.data = [
859
- // @ts-ignore
859
+ // @ts-expect-error - Simplified mock object for testing without all required Stripe SubscriptionItem properties
860
860
  { id: "item_1", price: { id: "price_123" } },
861
- // @ts-ignore
861
+ // @ts-expect-error - Simplified mock object for testing without all required Stripe SubscriptionItem properties
862
862
  { id: "item_2", price: { id: "price_456" } },
863
863
  ];
864
864
  mockStripe.subscriptions.retrieve =
@@ -1025,14 +1025,14 @@ describe("BillingService", () => {
1025
1025
  {
1026
1026
  id: "pm_123",
1027
1027
  type: "card",
1028
- // @ts-ignore
1028
+ // @ts-expect-error - Simplified mock card object for testing without all required Stripe card properties
1029
1029
  card: { last4: "4242", brand: "mastercard" },
1030
1030
  isDefault: true,
1031
1031
  },
1032
1032
  {
1033
1033
  id: "pm_456",
1034
1034
  type: "card",
1035
- // @ts-ignore
1035
+ // @ts-expect-error - Simplified mock card object for testing without all required Stripe card properties
1036
1036
  card: { last4: "4343", brand: "mastercard" },
1037
1037
  isDefault: true,
1038
1038
  },
@@ -343,10 +343,12 @@ describe("TeamMemberService", () => {
343
343
  "refreshTokens",
344
344
  );
345
345
 
346
- // const updateSeatsSpy: jest.SpyInstance = jest.spyOn(
347
- // TeamMemberService,
348
- // "updateSubscriptionSeatsByUniqueTeamMembersInProject",
349
- // );
346
+ /*
347
+ * const updateSeatsSpy: jest.SpyInstance = jest.spyOn(
348
+ * TeamMemberService,
349
+ * "updateSubscriptionSeatsByUniqueTeamMembersInProject",
350
+ * );
351
+ */
350
352
 
351
353
  const user: User = await UserService.create({
352
354
  data: UserServiceHelper.generateRandomUser(),
@@ -741,8 +743,10 @@ describe("TeamMemberService", () => {
741
743
 
742
744
  describe("getUniqueTeamMemberCountInProject", () => {
743
745
  it("should return the count of unique team members in a project", async () => {
744
- // make findBy to return 4 team members: 1 normal, 2 with the same id and 1 without a user ID
745
- // total should be 2 unique team members
746
+ /*
747
+ * make findBy to return 4 team members: 1 normal, 2 with the same id and 1 without a user ID
748
+ * total should be 2 unique team members
749
+ */
746
750
 
747
751
  const user: User = await UserServiceHelper.genrateAndSaveRandomUser(
748
752
  null,
@@ -839,9 +843,11 @@ describe("TeamMemberService", () => {
839
843
 
840
844
  describe("getUsersInTeam(s)", () => {
841
845
  it("should return users in specified team", async () => {
842
- // team A members: user1 & user2
843
- // team B members: user2 & user3
844
- // team C members: user 3
846
+ /*
847
+ * team A members: user1 & user2
848
+ * team B members: user2 & user3
849
+ * team C members: user 3
850
+ */
845
851
 
846
852
  const user: User = await UserServiceHelper.genrateAndSaveRandomUser(
847
853
  null,
@@ -966,9 +972,11 @@ describe("TeamMemberService", () => {
966
972
  });
967
973
 
968
974
  it("should return users in multiple teams", async () => {
969
- // team A members: user1 & user2
970
- // team B members: user2 & user3
971
- // team C members: user 3
975
+ /*
976
+ * team A members: user1 & user2
977
+ * team B members: user2 & user3
978
+ * team C members: user 3
979
+ */
972
980
 
973
981
  const user: User = await UserServiceHelper.genrateAndSaveRandomUser(
974
982
  null,
@@ -68,7 +68,7 @@ const getStripeSubscription: GetStripeSubscriptionFunction =
68
68
  data: [
69
69
  {
70
70
  id: Faker.generateRandomObjectID().toString(),
71
- // @ts-ignore
71
+ // @ts-expect-error - Simplified mock price object for testing without all required Stripe Price properties
72
72
  price: {
73
73
  id: new BillingService().getMeteredPlanPriceId(
74
74
  ProductType.ActiveMonitoring,
@@ -100,7 +100,7 @@ const getSubscriptionPlanData: GetSubscriptionPlanDataFunction =
100
100
  type GetStripeInvoiceFunction = () => Stripe.Invoice;
101
101
 
102
102
  const getStripeInvoice: GetStripeInvoiceFunction = (): Stripe.Invoice => {
103
- // @ts-ignore
103
+ // @ts-expect-error - Simplified mock invoice object for testing without all required Stripe Invoice properties
104
104
  return {
105
105
  id: Faker.generateRandomObjectID().toString(),
106
106
  amount_due: Faker.getNumberBetweenMinAndMax({ min: 1, max: 100 }),
@@ -220,8 +220,10 @@ describe("LayerUtil getEvents - Daily Restrictions", () => {
220
220
  calendarEndDate: calendarEnd,
221
221
  });
222
222
 
223
- // Expect two events: 23:00 -> 23:59:59 (approx) and 00:00 -> 11:00 next day (depending on trimming logic)
224
- // We simplify by checking presence of one starting at 23:00 and one ending at 11:00.
223
+ /*
224
+ * Expect two events: 23:00 -> 23:59:59 (approx) and 00:00 -> 11:00 next day (depending on trimming logic)
225
+ * We simplify by checking presence of one starting at 23:00 and one ending at 11:00.
226
+ */
225
227
  expect(events.length).toBeGreaterThanOrEqual(2); // Expect at least two distinct segments across midnight.
226
228
  const has23Window: boolean = events.some((e: CalendarEvent) => {
227
229
  return OneUptimeDate.getLocalHourAndMinuteFromDate(e.start) === "23:00";
@@ -436,8 +438,10 @@ describe("LayerUtil getEvents - Rotation Handoff", () => {
436
438
  return e.title;
437
439
  });
438
440
 
439
- // Titles are user ids (strings we passed) according to implementation.
440
- // Check that at least first three rotate u1 -> u2 -> u3
441
+ /*
442
+ * Titles are user ids (strings we passed) according to implementation.
443
+ * Check that at least first three rotate u1 -> u2 -> u3
444
+ */
441
445
  expect(userSequence.slice(0, 3)).toEqual(["u1", "u2", "u3"]);
442
446
  });
443
447
  });
@@ -1,5 +1,7 @@
1
- // Libraries
2
- // Custom components
1
+ /*
2
+ * Libraries
3
+ * Custom components
4
+ */
3
5
  import DictionaryOfStrings, {
4
6
  ComponentProps,
5
7
  } from "../../../UI/Components/Dictionary/DictionaryOfStrings";