@oneuptime/common 10.0.39 → 10.0.40

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 (282) hide show
  1. package/Models/AnalyticsModels/Index.ts +4 -0
  2. package/Models/AnalyticsModels/Profile.ts +687 -0
  3. package/Models/AnalyticsModels/ProfileSample.ts +547 -0
  4. package/Models/DatabaseModels/Dashboard.ts +357 -0
  5. package/Models/DatabaseModels/DashboardDomain.ts +658 -0
  6. package/Models/DatabaseModels/Index.ts +2 -0
  7. package/Models/DatabaseModels/StatusPage.ts +41 -0
  8. package/Server/API/DashboardAPI.ts +408 -0
  9. package/Server/API/DashboardDomainAPI.ts +235 -0
  10. package/Server/API/StatusPageAPI.ts +36 -2
  11. package/Server/API/TelemetryAPI.ts +393 -0
  12. package/Server/EnvironmentConfig.ts +12 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.ts +97 -0
  14. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.ts +17 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.ts +50 -0
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.ts +59 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
  18. package/Server/Middleware/UserAuthorization.ts +96 -1
  19. package/Server/Services/DashboardDomainService.ts +647 -0
  20. package/Server/Services/DashboardService.ts +174 -3
  21. package/Server/Services/IncidentService.ts +295 -50
  22. package/Server/Services/IncidentStateTimelineService.ts +1 -0
  23. package/Server/Services/Index.ts +6 -0
  24. package/Server/Services/MonitorService.ts +5 -0
  25. package/Server/Services/ProfileAggregationService.ts +559 -0
  26. package/Server/Services/ProfileSampleService.ts +11 -0
  27. package/Server/Services/ProfileService.ts +11 -0
  28. package/Server/Services/TelemetryUsageBillingService.ts +77 -3
  29. package/Server/Services/WorkspaceNotificationSummaryService.ts +15 -1
  30. package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +9 -0
  31. package/Server/Utils/Cookie.ts +48 -0
  32. package/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.ts +34 -0
  33. package/Server/Utils/Monitor/DataToProcess.ts +3 -1
  34. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +299 -0
  35. package/Server/Utils/Profile/PprofEncoder.ts +225 -0
  36. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +53 -16
  37. package/Server/Utils/Workspace/Slack/Slack.ts +26 -6
  38. package/ServiceRoute.ts +2 -0
  39. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +2 -0
  40. package/Types/CookieName.ts +1 -0
  41. package/Types/Dashboard/Chart/ChartType.ts +5 -0
  42. package/Types/Dashboard/DashboardComponentType.ts +4 -0
  43. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +10 -0
  44. package/Types/Dashboard/DashboardComponents/DashboardChartComponent.ts +1 -2
  45. package/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.ts +17 -0
  46. package/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts +15 -0
  47. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.ts +14 -0
  48. package/Types/Dashboard/DashboardComponents/DashboardTextComponent.ts +1 -0
  49. package/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.ts +13 -0
  50. package/Types/Dashboard/DashboardComponents/DashboardValueComponent.ts +2 -0
  51. package/Types/Dashboard/DashboardTemplates.ts +964 -0
  52. package/Types/Dashboard/DashboardVariable.ts +23 -0
  53. package/Types/Dashboard/DashboardViewConfig.ts +59 -0
  54. package/Types/Dashboard/MasterPassword.ts +10 -0
  55. package/Types/Icon/IconProp.ts +1 -0
  56. package/Types/Incident/IncidentMetricType.ts +3 -0
  57. package/Types/MeteredPlan/ProductType.ts +1 -0
  58. package/Types/Metrics/MetricQueryConfigData.ts +3 -0
  59. package/Types/Monitor/CriteriaFilter.ts +3 -0
  60. package/Types/Monitor/KubernetesAlertTemplates.ts +78 -7
  61. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +20 -0
  62. package/Types/Monitor/MonitorStep.ts +25 -0
  63. package/Types/Monitor/MonitorStepProfileMonitor.ts +96 -0
  64. package/Types/Monitor/MonitorType.ts +11 -0
  65. package/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.ts +12 -0
  66. package/Types/Permission.ts +87 -0
  67. package/Types/Telemetry/TelemetryType.ts +1 -0
  68. package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.ts +1 -0
  69. package/UI/Components/Button/Button.tsx +1 -1
  70. package/UI/Components/Card/Card.tsx +8 -4
  71. package/UI/Components/Charts/Area/AreaChart.tsx +4 -0
  72. package/UI/Components/Charts/Bar/BarChart.tsx +4 -0
  73. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +26 -0
  74. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +26 -0
  75. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +26 -0
  76. package/UI/Components/Charts/Line/LineChart.tsx +4 -0
  77. package/UI/Components/Charts/Types/ReferenceLineProps.ts +6 -0
  78. package/UI/Components/Icon/Icon.tsx +33 -0
  79. package/UI/Components/ModelTable/BaseModelTable.tsx +13 -10
  80. package/UI/Components/MoreMenu/MoreMenu.tsx +15 -2
  81. package/UI/Components/MoreMenu/MoreMenuItem.tsx +4 -4
  82. package/UI/Components/Workflow/Component.tsx +450 -209
  83. package/UI/Components/Workflow/ComponentPortViewer.tsx +57 -20
  84. package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +65 -25
  85. package/UI/Components/Workflow/ComponentSettingsModal.tsx +202 -37
  86. package/UI/Components/Workflow/ComponentsModal.tsx +180 -93
  87. package/UI/Components/Workflow/Workflow.tsx +105 -9
  88. package/UI/Config.ts +9 -0
  89. package/Utils/Dashboard/Components/DashboardChartComponent.ts +53 -22
  90. package/Utils/Dashboard/Components/DashboardGaugeComponent.ts +124 -0
  91. package/Utils/Dashboard/Components/DashboardLogStreamComponent.ts +110 -0
  92. package/Utils/Dashboard/Components/DashboardTableComponent.ts +86 -0
  93. package/Utils/Dashboard/Components/DashboardTextComponent.ts +32 -7
  94. package/Utils/Dashboard/Components/DashboardTraceListComponent.ts +86 -0
  95. package/Utils/Dashboard/Components/DashboardValueComponent.ts +39 -3
  96. package/Utils/Dashboard/Components/Index.ts +28 -0
  97. package/Utils/ValueFormatter.ts +170 -0
  98. package/build/dist/Models/AnalyticsModels/Index.js +4 -0
  99. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  100. package/build/dist/Models/AnalyticsModels/Profile.js +621 -0
  101. package/build/dist/Models/AnalyticsModels/Profile.js.map +1 -0
  102. package/build/dist/Models/AnalyticsModels/ProfileSample.js +497 -0
  103. package/build/dist/Models/AnalyticsModels/ProfileSample.js.map +1 -0
  104. package/build/dist/Models/DatabaseModels/Dashboard.js +365 -0
  105. package/build/dist/Models/DatabaseModels/Dashboard.js.map +1 -1
  106. package/build/dist/Models/DatabaseModels/DashboardDomain.js +691 -0
  107. package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -0
  108. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  109. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  110. package/build/dist/Models/DatabaseModels/StatusPage.js +42 -0
  111. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  112. package/build/dist/Server/API/DashboardAPI.js +293 -0
  113. package/build/dist/Server/API/DashboardAPI.js.map +1 -0
  114. package/build/dist/Server/API/DashboardDomainAPI.js +124 -0
  115. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -0
  116. package/build/dist/Server/API/StatusPageAPI.js +26 -2
  117. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  118. package/build/dist/Server/API/TelemetryAPI.js +222 -0
  119. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  120. package/build/dist/Server/EnvironmentConfig.js +4 -0
  121. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  122. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js +40 -0
  123. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js.map +1 -0
  124. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js +12 -0
  125. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js.map +1 -0
  126. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js +23 -0
  127. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js.map +1 -0
  128. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js +26 -0
  129. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js.map +1 -0
  130. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  131. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  132. package/build/dist/Server/Middleware/UserAuthorization.js +41 -0
  133. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  134. package/build/dist/Server/Services/DashboardDomainService.js +595 -0
  135. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -0
  136. package/build/dist/Server/Services/DashboardService.js +117 -3
  137. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  138. package/build/dist/Server/Services/IncidentService.js +231 -55
  139. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  140. package/build/dist/Server/Services/IncidentStateTimelineService.js +1 -1
  141. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  142. package/build/dist/Server/Services/Index.js +6 -0
  143. package/build/dist/Server/Services/Index.js.map +1 -1
  144. package/build/dist/Server/Services/MonitorService.js +5 -2
  145. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  146. package/build/dist/Server/Services/ProfileAggregationService.js +356 -0
  147. package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -0
  148. package/build/dist/Server/Services/ProfileSampleService.js +9 -0
  149. package/build/dist/Server/Services/ProfileSampleService.js.map +1 -0
  150. package/build/dist/Server/Services/ProfileService.js +9 -0
  151. package/build/dist/Server/Services/ProfileService.js.map +1 -0
  152. package/build/dist/Server/Services/TelemetryUsageBillingService.js +61 -4
  153. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  154. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +13 -1
  155. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  156. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +8 -0
  157. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
  158. package/build/dist/Server/Utils/Cookie.js +36 -0
  159. package/build/dist/Server/Utils/Cookie.js.map +1 -1
  160. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js +34 -0
  161. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js.map +1 -0
  162. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +173 -0
  163. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  164. package/build/dist/Server/Utils/Profile/PprofEncoder.js +129 -0
  165. package/build/dist/Server/Utils/Profile/PprofEncoder.js.map +1 -0
  166. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +36 -14
  167. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  168. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +23 -6
  169. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  170. package/build/dist/ServiceRoute.js +1 -0
  171. package/build/dist/ServiceRoute.js.map +1 -1
  172. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +2 -0
  173. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  174. package/build/dist/Types/CookieName.js +1 -0
  175. package/build/dist/Types/CookieName.js.map +1 -1
  176. package/build/dist/Types/Dashboard/Chart/ChartType.js +5 -0
  177. package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
  178. package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
  179. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  180. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
  181. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  182. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js +2 -0
  183. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js.map +1 -0
  184. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js +2 -0
  185. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js.map +1 -0
  186. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +2 -0
  187. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js.map +1 -0
  188. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js +2 -0
  189. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js.map +1 -0
  190. package/build/dist/Types/Dashboard/DashboardTemplates.js +853 -0
  191. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -0
  192. package/build/dist/Types/Dashboard/DashboardVariable.js +7 -0
  193. package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -0
  194. package/build/dist/Types/Dashboard/DashboardViewConfig.js +50 -1
  195. package/build/dist/Types/Dashboard/DashboardViewConfig.js.map +1 -1
  196. package/build/dist/Types/Dashboard/MasterPassword.js +5 -0
  197. package/build/dist/Types/Dashboard/MasterPassword.js.map +1 -0
  198. package/build/dist/Types/Icon/IconProp.js +1 -0
  199. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  200. package/build/dist/Types/Incident/IncidentMetricType.js +3 -0
  201. package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
  202. package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
  203. package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
  204. package/build/dist/Types/Metrics/MetricQueryConfigData.js +1 -0
  205. package/build/dist/Types/Metrics/MetricQueryConfigData.js.map +1 -1
  206. package/build/dist/Types/Monitor/CriteriaFilter.js +2 -0
  207. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  208. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +58 -7
  209. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  210. package/build/dist/Types/Monitor/MonitorStep.js +15 -0
  211. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  212. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js +59 -0
  213. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js.map +1 -0
  214. package/build/dist/Types/Monitor/MonitorType.js +10 -0
  215. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  216. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js +2 -0
  217. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js.map +1 -0
  218. package/build/dist/Types/Permission.js +75 -0
  219. package/build/dist/Types/Permission.js.map +1 -1
  220. package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
  221. package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
  222. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js +1 -0
  223. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js.map +1 -1
  224. package/build/dist/UI/Components/Button/Button.js +1 -1
  225. package/build/dist/UI/Components/Button/Button.js.map +1 -1
  226. package/build/dist/UI/Components/Card/Card.js +4 -4
  227. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  228. package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
  229. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  230. package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
  231. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  232. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +5 -2
  233. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  234. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +5 -2
  235. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  236. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
  237. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  238. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  239. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  240. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js +2 -0
  241. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js.map +1 -0
  242. package/build/dist/UI/Components/Icon/Icon.js +11 -0
  243. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  244. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +12 -9
  245. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  246. package/build/dist/UI/Components/MoreMenu/MoreMenu.js +8 -2
  247. package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
  248. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +4 -4
  249. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
  250. package/build/dist/UI/Components/Workflow/Component.js +311 -143
  251. package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
  252. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +44 -18
  253. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
  254. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +48 -22
  255. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
  256. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +127 -21
  257. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
  258. package/build/dist/UI/Components/Workflow/ComponentsModal.js +107 -52
  259. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  260. package/build/dist/UI/Components/Workflow/Workflow.js +87 -12
  261. package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
  262. package/build/dist/UI/Config.js +3 -1
  263. package/build/dist/UI/Config.js.map +1 -1
  264. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js +50 -21
  265. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js.map +1 -1
  266. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js +104 -0
  267. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js.map +1 -0
  268. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js +91 -0
  269. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js.map +1 -0
  270. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js +70 -0
  271. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js.map +1 -0
  272. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js +28 -7
  273. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js.map +1 -1
  274. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js +70 -0
  275. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js.map +1 -0
  276. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js +34 -3
  277. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js.map +1 -1
  278. package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
  279. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  280. package/build/dist/Utils/ValueFormatter.js +132 -0
  281. package/build/dist/Utils/ValueFormatter.js.map +1 -0
  282. package/package.json +1 -1
@@ -23,6 +23,23 @@ import LogAggregationService, {
23
23
  AnalyticsTopItem,
24
24
  AnalyticsTableRow,
25
25
  } from "../Services/LogAggregationService";
26
+ import ProfileAggregationService, {
27
+ FlamegraphRequest,
28
+ FunctionListRequest,
29
+ FunctionListItem,
30
+ ProfileFlamegraphNode,
31
+ DiffFlamegraphRequest,
32
+ DiffFlamegraphNode,
33
+ } from "../Services/ProfileAggregationService";
34
+ import PprofEncoder, {
35
+ PprofProfile,
36
+ PprofSample,
37
+ } from "../Utils/Profile/PprofEncoder";
38
+ import Profile from "../../Models/AnalyticsModels/Profile";
39
+ import ProfileSample from "../../Models/AnalyticsModels/ProfileSample";
40
+ import ProfileService from "../Services/ProfileService";
41
+ import ProfileSampleService from "../Services/ProfileSampleService";
42
+ import SortOrder from "../../Types/BaseDatabase/SortOrder";
26
43
  import ObjectID from "../../Types/ObjectID";
27
44
  import OneUptimeDate from "../../Types/Date";
28
45
  import { JSONObject } from "../../Types/JSON";
@@ -710,4 +727,380 @@ function computeDefaultBucketSize(startTime: Date, endTime: Date): number {
710
727
  return 1440;
711
728
  }
712
729
 
730
+ // --- Profile Get Attributes Endpoint ---
731
+
732
+ router.post(
733
+ "/telemetry/profiles/get-attributes",
734
+ UserMiddleware.getUserMiddleware,
735
+ async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
736
+ return getAttributes(req, res, next, TelemetryType.Profile);
737
+ },
738
+ );
739
+
740
+ // --- Profile Flamegraph Endpoint ---
741
+
742
+ router.post(
743
+ "/telemetry/profiles/flamegraph",
744
+ UserMiddleware.getUserMiddleware,
745
+ async (
746
+ req: ExpressRequest,
747
+ res: ExpressResponse,
748
+ next: NextFunction,
749
+ ): Promise<void> => {
750
+ try {
751
+ const databaseProps: DatabaseCommonInteractionProps =
752
+ await CommonAPI.getDatabaseCommonInteractionProps(req);
753
+
754
+ if (!databaseProps?.tenantId) {
755
+ return Response.sendErrorResponse(
756
+ req,
757
+ res,
758
+ new BadDataException("Invalid Project ID"),
759
+ );
760
+ }
761
+
762
+ const body: JSONObject = req.body as JSONObject;
763
+
764
+ const profileId: string | undefined = body["profileId"]
765
+ ? (body["profileId"] as string)
766
+ : undefined;
767
+
768
+ const startTime: Date | undefined = body["startTime"]
769
+ ? OneUptimeDate.fromString(body["startTime"] as string)
770
+ : undefined;
771
+
772
+ const endTime: Date | undefined = body["endTime"]
773
+ ? OneUptimeDate.fromString(body["endTime"] as string)
774
+ : undefined;
775
+
776
+ const serviceIds: Array<ObjectID> | undefined = body["serviceIds"]
777
+ ? (body["serviceIds"] as Array<string>).map((id: string) => {
778
+ return new ObjectID(id);
779
+ })
780
+ : undefined;
781
+
782
+ const profileType: string | undefined = body["profileType"]
783
+ ? (body["profileType"] as string)
784
+ : undefined;
785
+
786
+ if (!profileId && !startTime) {
787
+ return Response.sendErrorResponse(
788
+ req,
789
+ res,
790
+ new BadDataException(
791
+ "Either profileId or startTime must be provided",
792
+ ),
793
+ );
794
+ }
795
+
796
+ const request: FlamegraphRequest = {
797
+ projectId: databaseProps.tenantId,
798
+ ...(profileId !== undefined && { profileId }),
799
+ ...(startTime !== undefined && { startTime }),
800
+ ...(endTime !== undefined && { endTime }),
801
+ ...(serviceIds !== undefined && { serviceIds }),
802
+ ...(profileType !== undefined && { profileType }),
803
+ };
804
+
805
+ const flamegraph: ProfileFlamegraphNode =
806
+ await ProfileAggregationService.getFlamegraph(request);
807
+
808
+ return Response.sendJsonObjectResponse(req, res, {
809
+ flamegraph: flamegraph as unknown as JSONObject,
810
+ });
811
+ } catch (err: unknown) {
812
+ next(err);
813
+ }
814
+ },
815
+ );
816
+
817
+ // --- Profile Function List Endpoint ---
818
+
819
+ router.post(
820
+ "/telemetry/profiles/function-list",
821
+ UserMiddleware.getUserMiddleware,
822
+ async (
823
+ req: ExpressRequest,
824
+ res: ExpressResponse,
825
+ next: NextFunction,
826
+ ): Promise<void> => {
827
+ try {
828
+ const databaseProps: DatabaseCommonInteractionProps =
829
+ await CommonAPI.getDatabaseCommonInteractionProps(req);
830
+
831
+ if (!databaseProps?.tenantId) {
832
+ return Response.sendErrorResponse(
833
+ req,
834
+ res,
835
+ new BadDataException("Invalid Project ID"),
836
+ );
837
+ }
838
+
839
+ const body: JSONObject = req.body as JSONObject;
840
+
841
+ const startTime: Date = body["startTime"]
842
+ ? OneUptimeDate.fromString(body["startTime"] as string)
843
+ : OneUptimeDate.addRemoveHours(OneUptimeDate.getCurrentDate(), -1);
844
+
845
+ const endTime: Date = body["endTime"]
846
+ ? OneUptimeDate.fromString(body["endTime"] as string)
847
+ : OneUptimeDate.getCurrentDate();
848
+
849
+ const serviceIds: Array<ObjectID> | undefined = body["serviceIds"]
850
+ ? (body["serviceIds"] as Array<string>).map((id: string) => {
851
+ return new ObjectID(id);
852
+ })
853
+ : undefined;
854
+
855
+ const profileType: string | undefined = body["profileType"]
856
+ ? (body["profileType"] as string)
857
+ : undefined;
858
+
859
+ const limit: number | undefined = body["limit"]
860
+ ? (body["limit"] as number)
861
+ : undefined;
862
+
863
+ const sortBy: "selfValue" | "totalValue" | "sampleCount" | undefined =
864
+ body["sortBy"]
865
+ ? (body["sortBy"] as "selfValue" | "totalValue" | "sampleCount")
866
+ : undefined;
867
+
868
+ const request: FunctionListRequest = {
869
+ projectId: databaseProps.tenantId,
870
+ startTime,
871
+ endTime,
872
+ ...(serviceIds !== undefined && { serviceIds }),
873
+ ...(profileType !== undefined && { profileType }),
874
+ ...(limit !== undefined && { limit }),
875
+ ...(sortBy !== undefined && { sortBy }),
876
+ };
877
+
878
+ const functions: Array<FunctionListItem> =
879
+ await ProfileAggregationService.getFunctionList(request);
880
+
881
+ return Response.sendJsonObjectResponse(req, res, {
882
+ functions: functions as unknown as JSONObject,
883
+ });
884
+ } catch (err: unknown) {
885
+ next(err);
886
+ }
887
+ },
888
+ );
889
+
890
+ // --- Profile pprof Export Endpoint ---
891
+
892
+ router.get(
893
+ "/telemetry/profiles/:profileId/pprof",
894
+ UserMiddleware.getUserMiddleware,
895
+ async (
896
+ req: ExpressRequest,
897
+ res: ExpressResponse,
898
+ next: NextFunction,
899
+ ): Promise<void> => {
900
+ try {
901
+ const databaseProps: DatabaseCommonInteractionProps =
902
+ await CommonAPI.getDatabaseCommonInteractionProps(req);
903
+
904
+ if (!databaseProps?.tenantId) {
905
+ return Response.sendErrorResponse(
906
+ req,
907
+ res,
908
+ new BadDataException("Invalid Project ID"),
909
+ );
910
+ }
911
+
912
+ const profileId: string | undefined = req.params["profileId"];
913
+
914
+ if (!profileId) {
915
+ return Response.sendErrorResponse(
916
+ req,
917
+ res,
918
+ new BadDataException("profileId is required"),
919
+ );
920
+ }
921
+
922
+ // Fetch profile metadata
923
+ const profiles: Array<Profile> = await ProfileService.findBy({
924
+ query: {
925
+ projectId: databaseProps.tenantId,
926
+ profileId: profileId,
927
+ },
928
+ select: {
929
+ profileId: true,
930
+ profileType: true,
931
+ unit: true,
932
+ periodType: true,
933
+ period: true,
934
+ startTime: true,
935
+ endTime: true,
936
+ durationNano: true,
937
+ },
938
+ limit: 1,
939
+ skip: 0,
940
+ props: {
941
+ isRoot: true,
942
+ },
943
+ });
944
+
945
+ if (!profiles[0]) {
946
+ return Response.sendErrorResponse(
947
+ req,
948
+ res,
949
+ new BadDataException("Profile not found"),
950
+ );
951
+ }
952
+
953
+ const profile: Profile = profiles[0];
954
+
955
+ // Fetch profile samples
956
+ const samplesResult: Array<ProfileSample> =
957
+ await ProfileSampleService.findBy({
958
+ query: {
959
+ projectId: databaseProps.tenantId,
960
+ profileId: profileId,
961
+ },
962
+ select: {
963
+ stacktrace: true,
964
+ value: true,
965
+ labels: true,
966
+ },
967
+ limit: 50000,
968
+ skip: 0,
969
+ sort: {
970
+ value: SortOrder.Descending,
971
+ },
972
+ props: {
973
+ isRoot: true,
974
+ },
975
+ });
976
+
977
+ const pprofSamples: Array<PprofSample> = samplesResult.map(
978
+ (sample: ProfileSample): PprofSample => {
979
+ return {
980
+ stacktrace: sample.stacktrace || [],
981
+ value: sample.value || 0,
982
+ labels: sample.labels as JSONObject | undefined,
983
+ };
984
+ },
985
+ );
986
+
987
+ const pprofProfile: PprofProfile = {
988
+ profileId: profile.profileId || profileId,
989
+ profileType: profile.profileType || "cpu",
990
+ unit: profile.unit || "nanoseconds",
991
+ periodType: profile.periodType || "cpu",
992
+ period: profile.period || 0,
993
+ startTimeNanos: profile.startTime
994
+ ? new Date(profile.startTime).getTime() * 1000000
995
+ : 0,
996
+ endTimeNanos: profile.endTime
997
+ ? new Date(profile.endTime).getTime() * 1000000
998
+ : 0,
999
+ durationNanos: profile.durationNano || 0,
1000
+ samples: pprofSamples,
1001
+ };
1002
+
1003
+ const compressed: Buffer =
1004
+ await PprofEncoder.encodeAndCompress(pprofProfile);
1005
+
1006
+ res.setHeader("Content-Type", "application/x-protobuf");
1007
+ res.setHeader(
1008
+ "Content-Disposition",
1009
+ `attachment; filename=profile-${profileId}.pb.gz`,
1010
+ );
1011
+ res.setHeader("Content-Length", compressed.length.toString());
1012
+ res.send(compressed);
1013
+ } catch (err: unknown) {
1014
+ next(err);
1015
+ }
1016
+ },
1017
+ );
1018
+
1019
+ // --- Profile Diff Flamegraph Endpoint ---
1020
+
1021
+ router.post(
1022
+ "/telemetry/profiles/diff-flamegraph",
1023
+ UserMiddleware.getUserMiddleware,
1024
+ async (
1025
+ req: ExpressRequest,
1026
+ res: ExpressResponse,
1027
+ next: NextFunction,
1028
+ ): Promise<void> => {
1029
+ try {
1030
+ const databaseProps: DatabaseCommonInteractionProps =
1031
+ await CommonAPI.getDatabaseCommonInteractionProps(req);
1032
+
1033
+ if (!databaseProps?.tenantId) {
1034
+ return Response.sendErrorResponse(
1035
+ req,
1036
+ res,
1037
+ new BadDataException("Invalid Project ID"),
1038
+ );
1039
+ }
1040
+
1041
+ const body: JSONObject = req.body as JSONObject;
1042
+
1043
+ const baselineStartTime: Date | undefined = body["baselineStartTime"]
1044
+ ? OneUptimeDate.fromString(body["baselineStartTime"] as string)
1045
+ : undefined;
1046
+
1047
+ const baselineEndTime: Date | undefined = body["baselineEndTime"]
1048
+ ? OneUptimeDate.fromString(body["baselineEndTime"] as string)
1049
+ : undefined;
1050
+
1051
+ const comparisonStartTime: Date | undefined = body["comparisonStartTime"]
1052
+ ? OneUptimeDate.fromString(body["comparisonStartTime"] as string)
1053
+ : undefined;
1054
+
1055
+ const comparisonEndTime: Date | undefined = body["comparisonEndTime"]
1056
+ ? OneUptimeDate.fromString(body["comparisonEndTime"] as string)
1057
+ : undefined;
1058
+
1059
+ if (
1060
+ !baselineStartTime ||
1061
+ !baselineEndTime ||
1062
+ !comparisonStartTime ||
1063
+ !comparisonEndTime
1064
+ ) {
1065
+ return Response.sendErrorResponse(
1066
+ req,
1067
+ res,
1068
+ new BadDataException(
1069
+ "baselineStartTime, baselineEndTime, comparisonStartTime, and comparisonEndTime are all required",
1070
+ ),
1071
+ );
1072
+ }
1073
+
1074
+ const serviceIds: Array<ObjectID> | undefined = body["serviceIds"]
1075
+ ? (body["serviceIds"] as Array<string>).map((id: string) => {
1076
+ return new ObjectID(id);
1077
+ })
1078
+ : undefined;
1079
+
1080
+ const profileType: string | undefined = body["profileType"]
1081
+ ? (body["profileType"] as string)
1082
+ : undefined;
1083
+
1084
+ const request: DiffFlamegraphRequest = {
1085
+ projectId: databaseProps.tenantId,
1086
+ baselineStartTime,
1087
+ baselineEndTime,
1088
+ comparisonStartTime,
1089
+ comparisonEndTime,
1090
+ ...(serviceIds !== undefined && { serviceIds }),
1091
+ ...(profileType !== undefined && { profileType }),
1092
+ };
1093
+
1094
+ const diffFlamegraph: DiffFlamegraphNode =
1095
+ await ProfileAggregationService.getDiffFlamegraph(request);
1096
+
1097
+ return Response.sendJsonObjectResponse(req, res, {
1098
+ diffFlamegraph: diffFlamegraph as unknown as JSONObject,
1099
+ });
1100
+ } catch (err: unknown) {
1101
+ next(err);
1102
+ }
1103
+ },
1104
+ );
1105
+
713
1106
  export default router;
@@ -35,6 +35,7 @@ const FRONTEND_ENV_ALLOW_LIST: Array<string> = [
35
35
  "VAPID_SUBJECT",
36
36
  "VERSION",
37
37
  "STATUS_PAGE_CNAME_RECORD",
38
+ "DASHBOARD_CNAME_RECORD",
38
39
  "ANALYTICS_KEY",
39
40
  "ANALYTICS_HOST",
40
41
  "GIT_SHA",
@@ -252,6 +253,9 @@ export const ClickhouseHost: Hostname = Hostname.fromString(
252
253
  export const StatusPageCNameRecord: string =
253
254
  process.env["STATUS_PAGE_CNAME_RECORD"] || "";
254
255
 
256
+ export const DashboardCNameRecord: string =
257
+ process.env["DASHBOARD_CNAME_RECORD"] || "";
258
+
255
259
  export const ClickhousePort: Port = new Port(
256
260
  process.env["CLICKHOUSE_PORT"] || "8123",
257
261
  );
@@ -423,6 +427,14 @@ export const AverageMetricRowSizeInBytes: number = parsePositiveNumberFromEnv(
423
427
  export const AverageExceptionRowSizeInBytes: number =
424
428
  parsePositiveNumberFromEnv("AVERAGE_EXCEPTION_ROW_SIZE_IN_BYTES", 1024);
425
429
 
430
+ export const AverageProfileRowSizeInBytes: number = parsePositiveNumberFromEnv(
431
+ "AVERAGE_PROFILE_ROW_SIZE_IN_BYTES",
432
+ 1024,
433
+ );
434
+
435
+ export const AverageProfileSampleRowSizeInBytes: number =
436
+ parsePositiveNumberFromEnv("AVERAGE_PROFILE_SAMPLE_ROW_SIZE_IN_BYTES", 512);
437
+
426
438
  export const SlackAppClientId: string | null =
427
439
  process.env["SLACK_APP_CLIENT_ID"] || null;
428
440
  export const SlackAppClientSecret: string | null =
@@ -0,0 +1,97 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1774524742177 implements MigrationInterface {
4
+ public name = "MigrationName1774524742177";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE "DashboardDomain" ("_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, "projectId" uuid NOT NULL, "domainId" uuid NOT NULL, "dashboardId" uuid NOT NULL, "subdomain" character varying(100) NOT NULL, "fullDomain" character varying(100) NOT NULL, "createdByUserId" uuid, "cnameVerificationToken" character varying(100) NOT NULL, "isCnameVerified" boolean NOT NULL DEFAULT false, "isSslOrdered" boolean NOT NULL DEFAULT false, "isSslProvisioned" boolean NOT NULL DEFAULT false, "deletedByUserId" uuid, "customCertificate" text, "customCertificateKey" text, "isCustomCertificate" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_3897ff3212d5d8ddbdeca684bf6" PRIMARY KEY ("_id"))`,
9
+ );
10
+ await queryRunner.query(
11
+ `CREATE INDEX "IDX_8c0e357d0490d45c89ee673005" ON "DashboardDomain" ("projectId") `,
12
+ );
13
+ await queryRunner.query(
14
+ `CREATE INDEX "IDX_0f58973f28172817bf9c1b34e7" ON "DashboardDomain" ("domainId") `,
15
+ );
16
+ await queryRunner.query(
17
+ `CREATE INDEX "IDX_601f68ad16b421ede8b06b3f40" ON "DashboardDomain" ("dashboardId") `,
18
+ );
19
+ await queryRunner.query(
20
+ `ALTER TABLE "Dashboard" ADD "isPublicDashboard" boolean NOT NULL DEFAULT false`,
21
+ );
22
+ await queryRunner.query(
23
+ `ALTER TABLE "Dashboard" ADD "enableMasterPassword" boolean NOT NULL DEFAULT false`,
24
+ );
25
+ await queryRunner.query(
26
+ `ALTER TABLE "Dashboard" ADD "masterPassword" character varying(64)`,
27
+ );
28
+ await queryRunner.query(`ALTER TABLE "Dashboard" ADD "ipWhitelist" text`);
29
+ await queryRunner.query(
30
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
31
+ );
32
+ await queryRunner.query(
33
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
34
+ );
35
+ await queryRunner.query(
36
+ `ALTER TABLE "DashboardDomain" ADD CONSTRAINT "FK_8c0e357d0490d45c89ee673005c" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
37
+ );
38
+ await queryRunner.query(
39
+ `ALTER TABLE "DashboardDomain" ADD CONSTRAINT "FK_0f58973f28172817bf9c1b34e73" FOREIGN KEY ("domainId") REFERENCES "Domain"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
40
+ );
41
+ await queryRunner.query(
42
+ `ALTER TABLE "DashboardDomain" ADD CONSTRAINT "FK_601f68ad16b421ede8b06b3f40c" FOREIGN KEY ("dashboardId") REFERENCES "Dashboard"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
43
+ );
44
+ await queryRunner.query(
45
+ `ALTER TABLE "DashboardDomain" ADD CONSTRAINT "FK_de80950ba9f0d034f5c47940b3c" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
46
+ );
47
+ await queryRunner.query(
48
+ `ALTER TABLE "DashboardDomain" ADD CONSTRAINT "FK_de0c87b9c94b5dfeb21f1ce106f" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
49
+ );
50
+ }
51
+
52
+ public async down(queryRunner: QueryRunner): Promise<void> {
53
+ await queryRunner.query(
54
+ `ALTER TABLE "DashboardDomain" DROP CONSTRAINT "FK_de0c87b9c94b5dfeb21f1ce106f"`,
55
+ );
56
+ await queryRunner.query(
57
+ `ALTER TABLE "DashboardDomain" DROP CONSTRAINT "FK_de80950ba9f0d034f5c47940b3c"`,
58
+ );
59
+ await queryRunner.query(
60
+ `ALTER TABLE "DashboardDomain" DROP CONSTRAINT "FK_601f68ad16b421ede8b06b3f40c"`,
61
+ );
62
+ await queryRunner.query(
63
+ `ALTER TABLE "DashboardDomain" DROP CONSTRAINT "FK_0f58973f28172817bf9c1b34e73"`,
64
+ );
65
+ await queryRunner.query(
66
+ `ALTER TABLE "DashboardDomain" DROP CONSTRAINT "FK_8c0e357d0490d45c89ee673005c"`,
67
+ );
68
+ await queryRunner.query(
69
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
70
+ );
71
+ await queryRunner.query(
72
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
73
+ );
74
+ await queryRunner.query(
75
+ `ALTER TABLE "Dashboard" DROP COLUMN "ipWhitelist"`,
76
+ );
77
+ await queryRunner.query(
78
+ `ALTER TABLE "Dashboard" DROP COLUMN "masterPassword"`,
79
+ );
80
+ await queryRunner.query(
81
+ `ALTER TABLE "Dashboard" DROP COLUMN "enableMasterPassword"`,
82
+ );
83
+ await queryRunner.query(
84
+ `ALTER TABLE "Dashboard" DROP COLUMN "isPublicDashboard"`,
85
+ );
86
+ await queryRunner.query(
87
+ `DROP INDEX "public"."IDX_601f68ad16b421ede8b06b3f40"`,
88
+ );
89
+ await queryRunner.query(
90
+ `DROP INDEX "public"."IDX_0f58973f28172817bf9c1b34e7"`,
91
+ );
92
+ await queryRunner.query(
93
+ `DROP INDEX "public"."IDX_8c0e357d0490d45c89ee673005"`,
94
+ );
95
+ await queryRunner.query(`DROP TABLE "DashboardDomain"`);
96
+ }
97
+ }
@@ -0,0 +1,17 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1774524742178 implements MigrationInterface {
4
+ public name = "MigrationName1774524742178";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE "StatusPage" ADD "showUptimeHistoryInDays" integer NOT NULL DEFAULT 90`,
9
+ );
10
+ }
11
+
12
+ public async down(queryRunner: QueryRunner): Promise<void> {
13
+ await queryRunner.query(
14
+ `ALTER TABLE "StatusPage" DROP COLUMN "showUptimeHistoryInDays"`,
15
+ );
16
+ }
17
+ }
@@ -0,0 +1,50 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1774524742179 implements MigrationInterface {
4
+ public name = "MigrationName1774524742179";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE "Dashboard" ADD "pageTitle" character varying(100)`,
9
+ );
10
+
11
+ await queryRunner.query(
12
+ `ALTER TABLE "Dashboard" ADD "pageDescription" text`,
13
+ );
14
+
15
+ await queryRunner.query(`ALTER TABLE "Dashboard" ADD "logoFileId" uuid`);
16
+
17
+ await queryRunner.query(`ALTER TABLE "Dashboard" ADD "faviconFileId" uuid`);
18
+
19
+ // Add foreign key constraints for file relations
20
+ await queryRunner.query(
21
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_Dashboard_logoFileId" FOREIGN KEY ("logoFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
22
+ );
23
+
24
+ await queryRunner.query(
25
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_Dashboard_faviconFileId" FOREIGN KEY ("faviconFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
26
+ );
27
+ }
28
+
29
+ public async down(queryRunner: QueryRunner): Promise<void> {
30
+ await queryRunner.query(
31
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_Dashboard_faviconFileId"`,
32
+ );
33
+
34
+ await queryRunner.query(
35
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_Dashboard_logoFileId"`,
36
+ );
37
+
38
+ await queryRunner.query(
39
+ `ALTER TABLE "Dashboard" DROP COLUMN "faviconFileId"`,
40
+ );
41
+
42
+ await queryRunner.query(`ALTER TABLE "Dashboard" DROP COLUMN "logoFileId"`);
43
+
44
+ await queryRunner.query(
45
+ `ALTER TABLE "Dashboard" DROP COLUMN "pageDescription"`,
46
+ );
47
+
48
+ await queryRunner.query(`ALTER TABLE "Dashboard" DROP COLUMN "pageTitle"`);
49
+ }
50
+ }
@@ -0,0 +1,59 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1774559064919 implements MigrationInterface {
4
+ public name = "MigrationName1774559064919";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_Dashboard_logoFileId"`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_Dashboard_faviconFileId"`,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
15
+ );
16
+ await queryRunner.query(
17
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
18
+ );
19
+ await queryRunner.query(
20
+ `ALTER TABLE "Dashboard" DROP COLUMN "pageDescription"`,
21
+ );
22
+ await queryRunner.query(
23
+ `ALTER TABLE "Dashboard" ADD "pageDescription" character varying(500)`,
24
+ );
25
+ await queryRunner.query(
26
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_2f81cafa1d653e4a023da14e541" FOREIGN KEY ("logoFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
27
+ );
28
+ await queryRunner.query(
29
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_83b237be936983b34fb7bcf1584" FOREIGN KEY ("faviconFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
30
+ );
31
+ }
32
+
33
+ public async down(queryRunner: QueryRunner): Promise<void> {
34
+ await queryRunner.query(
35
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_83b237be936983b34fb7bcf1584"`,
36
+ );
37
+ await queryRunner.query(
38
+ `ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_2f81cafa1d653e4a023da14e541"`,
39
+ );
40
+ await queryRunner.query(
41
+ `ALTER TABLE "Dashboard" DROP COLUMN "pageDescription"`,
42
+ );
43
+ await queryRunner.query(
44
+ `ALTER TABLE "Dashboard" ADD "pageDescription" text`,
45
+ );
46
+ await queryRunner.query(
47
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
48
+ );
49
+ await queryRunner.query(
50
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
51
+ );
52
+ await queryRunner.query(
53
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_Dashboard_faviconFileId" FOREIGN KEY ("faviconFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
54
+ );
55
+ await queryRunner.query(
56
+ `ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_Dashboard_logoFileId" FOREIGN KEY ("logoFileId") REFERENCES "File"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
57
+ );
58
+ }
59
+ }
@@ -270,6 +270,10 @@ import { MigrationName1774000000000 } from "./1774000000000-MigrationName";
270
270
  import { MigrationName1774000000001 } from "./1774000000001-MigrationName";
271
271
  import { MigrationName1774355321449 } from "./1774355321449-MigrationName";
272
272
  import { MigrationName1774357353502 } from "./1774357353502-MigrationName";
273
+ import { MigrationName1774524742177 } from "./1774524742177-MigrationName";
274
+ import { MigrationName1774524742178 } from "./1774524742178-MigrationName";
275
+ import { MigrationName1774524742179 } from "./1774524742179-MigrationName";
276
+ import { MigrationName1774559064919 } from "./1774559064919-MigrationName";
273
277
 
274
278
  export default [
275
279
  InitialMigration,
@@ -544,4 +548,8 @@ export default [
544
548
  MigrationName1774000000001,
545
549
  MigrationName1774355321449,
546
550
  MigrationName1774357353502,
551
+ MigrationName1774524742177,
552
+ MigrationName1774524742178,
553
+ MigrationName1774524742179,
554
+ MigrationName1774559064919,
547
555
  ];