@oneuptime/common 12.0.2 → 12.0.3

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 (228) hide show
  1. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +14 -0
  2. package/Models/DatabaseModels/Index.ts +2 -0
  3. package/Models/DatabaseModels/LogDropFilter.ts +9 -20
  4. package/Models/DatabaseModels/StatusPageMonitorRule.ts +911 -0
  5. package/Models/DatabaseModels/StatusPageResource.ts +73 -0
  6. package/Models/DatabaseModels/TraceDropFilter.ts +9 -20
  7. package/Server/API/BaseAPI.ts +13 -2
  8. package/Server/API/DashboardAPI.ts +39 -0
  9. package/Server/EnvironmentConfig.ts +31 -1
  10. package/Server/Infrastructure/GlobalCache.ts +115 -0
  11. package/Server/Infrastructure/Postgres/DataSourceOptions.ts +16 -0
  12. package/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.ts +123 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
  14. package/Server/Services/AlertStateTimelineService.ts +20 -0
  15. package/Server/Services/CephClusterService.ts +26 -86
  16. package/Server/Services/CloudResourceService.ts +23 -83
  17. package/Server/Services/DatabaseService.ts +111 -0
  18. package/Server/Services/DockerHostService.ts +19 -79
  19. package/Server/Services/DockerSwarmClusterService.ts +27 -88
  20. package/Server/Services/HostService.ts +46 -99
  21. package/Server/Services/IncidentStateTimelineService.ts +20 -0
  22. package/Server/Services/Index.ts +2 -0
  23. package/Server/Services/IoTFleetService.ts +19 -79
  24. package/Server/Services/KubernetesClusterService.ts +17 -78
  25. package/Server/Services/LabelService.ts +57 -10
  26. package/Server/Services/MetricTypeService.ts +84 -0
  27. package/Server/Services/MonitorService.ts +89 -14
  28. package/Server/Services/MonitorStatusTimelineService.ts +29 -0
  29. package/Server/Services/MonitorTemplateService.ts +65 -0
  30. package/Server/Services/PodmanHostService.ts +19 -79
  31. package/Server/Services/ProxmoxClusterService.ts +23 -83
  32. package/Server/Services/RumApplicationService.ts +19 -80
  33. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +21 -0
  34. package/Server/Services/ServerlessFunctionService.ts +24 -85
  35. package/Server/Services/ServiceService.ts +299 -73
  36. package/Server/Services/StatusPageMonitorRuleEngineService.ts +752 -0
  37. package/Server/Services/StatusPageMonitorRuleService.ts +471 -0
  38. package/Server/Services/TelemetryEntityRelationshipService.ts +1 -0
  39. package/Server/Services/TelemetryEntityService.ts +1 -0
  40. package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +170 -39
  41. package/Server/Utils/Monitor/MonitorResource.ts +63 -36
  42. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +36 -0
  43. package/Server/Utils/Monitor/MonitorStepsProjectValidator.ts +148 -127
  44. package/Server/Utils/Monitor/MonitorStepsReferenceExtractor.ts +434 -0
  45. package/Server/Utils/SingleFlight.ts +83 -0
  46. package/Server/Utils/StatusPage/MonitorRulePatternValidator.ts +46 -0
  47. package/Server/Utils/Telemetry/EntityRegistry.ts +107 -26
  48. package/Server/Utils/Telemetry/ResourceHeartbeat.ts +314 -0
  49. package/Server/Utils/Telemetry/Telemetry.ts +351 -122
  50. package/Tests/App/Dashboard/WidgetCatalog.test.ts +2 -0
  51. package/Tests/Models/DatabaseModels/ColumnTransformerInvariants.test.ts +306 -0
  52. package/Tests/Models/DatabaseModels/NumberColumnDeserialization.test.ts +333 -0
  53. package/Tests/Models/DatabaseModels/StatusPageMonitorRuleModel.test.ts +190 -0
  54. package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +26 -0
  55. package/Tests/Server/Infrastructure/GlobalCache.test.ts +226 -0
  56. package/Tests/Server/Infrastructure/PostgresLockTimeoutOptions.test.ts +181 -0
  57. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlocked.test.ts +342 -0
  58. package/Tests/Server/Services/DropFilterSaveValidation.test.ts +245 -0
  59. package/Tests/Server/Services/HostServiceUpdateLastSeen.test.ts +163 -15
  60. package/Tests/Server/Services/MetricTypeAttachServices.test.ts +222 -0
  61. package/Tests/Server/Services/MissingReferenceWriteGuard.test.ts +614 -0
  62. package/Tests/Server/Services/MonitorStatusTimelineFastPath.test.ts +23 -0
  63. package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +305 -56
  64. package/Tests/Server/Services/ServiceUpdateLastSeenSplitGates.test.ts +705 -0
  65. package/Tests/Server/Services/StatusPageMonitorRuleEngineService.test.ts +1719 -0
  66. package/Tests/Server/Services/StatusPageMonitorRuleHooks.test.ts +1212 -0
  67. package/Tests/Server/Services/StatusPageMonitorRuleMonitorCreateHook.test.ts +228 -0
  68. package/Tests/Server/Utils/APIKey/AccessPermission.test.ts +267 -0
  69. package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +260 -13
  70. package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +302 -0
  71. package/Tests/Server/Utils/MetricTypeIndexConvergence.test.ts +598 -0
  72. package/Tests/Server/Utils/Monitor/MonitorStatusTimelineUnusableStatus.test.ts +154 -0
  73. package/Tests/Server/Utils/Monitor/MonitorStepsProjectValidator.test.ts +638 -92
  74. package/Tests/Server/Utils/Monitor/MonitorStepsReferenceExtractor.test.ts +724 -0
  75. package/Tests/Server/Utils/SingleFlight.test.ts +221 -0
  76. package/Tests/Types/Dashboard/NetworkDashboardTemplate.test.ts +793 -0
  77. package/Tests/Types/Database/BigIntColumnTransformer.test.ts +147 -0
  78. package/Tests/Types/Database/DatabasePropertyTransformer.test.ts +140 -0
  79. package/Tests/Types/Database/NumericColumnValue.test.ts +127 -0
  80. package/Tests/Types/Decimal.test.ts +37 -0
  81. package/Tests/Types/Monitor/SnmpVersionParsing.test.ts +152 -0
  82. package/Tests/Types/Port.test.ts +38 -0
  83. package/Tests/UI/Components/LogsHistogram.test.tsx +276 -0
  84. package/Tests/UI/Components/UseLiveLogsRefresh.test.tsx +489 -0
  85. package/Tests/UI/Components/UseLogsHistogram.test.tsx +500 -0
  86. package/Tests/Utils/Dashboard/Components/DashboardComponentsUtil.test.ts +120 -0
  87. package/Tests/Utils/Dashboard/DashboardNetworkMapComponent.test.ts +327 -0
  88. package/Types/Dashboard/DashboardComponentType.ts +1 -0
  89. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
  90. package/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.ts +40 -0
  91. package/Types/Dashboard/DashboardTemplates.ts +397 -0
  92. package/Types/Database/BigIntColumnTransformer.ts +74 -0
  93. package/Types/Database/DatabaseProperty.ts +26 -0
  94. package/Types/Database/NumericColumnValue.ts +128 -0
  95. package/Types/Decimal.ts +16 -4
  96. package/Types/Permission.ts +48 -0
  97. package/Types/Port.ts +16 -4
  98. package/UI/Components/LogsViewer/useLiveLogsRefresh.ts +86 -0
  99. package/UI/Components/LogsViewer/useLogsHistogram.ts +113 -0
  100. package/Utils/Dashboard/Components/DashboardNetworkMapComponent.ts +136 -0
  101. package/Utils/Dashboard/Components/Index.ts +7 -0
  102. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +12 -0
  103. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
  104. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  105. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  106. package/build/dist/Models/DatabaseModels/LogDropFilter.js +9 -20
  107. package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
  108. package/build/dist/Models/DatabaseModels/StatusPageMonitorRule.js +925 -0
  109. package/build/dist/Models/DatabaseModels/StatusPageMonitorRule.js.map +1 -0
  110. package/build/dist/Models/DatabaseModels/StatusPageResource.js +72 -0
  111. package/build/dist/Models/DatabaseModels/StatusPageResource.js.map +1 -1
  112. package/build/dist/Models/DatabaseModels/TraceDropFilter.js +9 -20
  113. package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
  114. package/build/dist/Server/API/BaseAPI.js +11 -1
  115. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  116. package/build/dist/Server/API/DashboardAPI.js +39 -0
  117. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  118. package/build/dist/Server/EnvironmentConfig.js +27 -1
  119. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  120. package/build/dist/Server/Infrastructure/GlobalCache.js +91 -0
  121. package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
  122. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +5 -3
  123. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
  124. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.js +48 -0
  125. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.js.map +1 -0
  126. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
  127. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  128. package/build/dist/Server/Services/AlertStateTimelineService.js +19 -0
  129. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  130. package/build/dist/Server/Services/CephClusterService.js +26 -76
  131. package/build/dist/Server/Services/CephClusterService.js.map +1 -1
  132. package/build/dist/Server/Services/CloudResourceService.js +23 -73
  133. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  134. package/build/dist/Server/Services/DatabaseService.js +86 -0
  135. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  136. package/build/dist/Server/Services/DockerHostService.js +19 -69
  137. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  138. package/build/dist/Server/Services/DockerSwarmClusterService.js +27 -78
  139. package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
  140. package/build/dist/Server/Services/HostService.js +58 -102
  141. package/build/dist/Server/Services/HostService.js.map +1 -1
  142. package/build/dist/Server/Services/IncidentStateTimelineService.js +19 -0
  143. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  144. package/build/dist/Server/Services/Index.js +2 -0
  145. package/build/dist/Server/Services/Index.js.map +1 -1
  146. package/build/dist/Server/Services/IoTFleetService.js +19 -69
  147. package/build/dist/Server/Services/IoTFleetService.js.map +1 -1
  148. package/build/dist/Server/Services/KubernetesClusterService.js +17 -68
  149. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  150. package/build/dist/Server/Services/LabelService.js +42 -7
  151. package/build/dist/Server/Services/LabelService.js.map +1 -1
  152. package/build/dist/Server/Services/MetricTypeService.js +74 -0
  153. package/build/dist/Server/Services/MetricTypeService.js.map +1 -1
  154. package/build/dist/Server/Services/MonitorService.js +81 -9
  155. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  156. package/build/dist/Server/Services/MonitorStatusTimelineService.js +28 -0
  157. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  158. package/build/dist/Server/Services/MonitorTemplateService.js +60 -0
  159. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  160. package/build/dist/Server/Services/PodmanHostService.js +19 -69
  161. package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
  162. package/build/dist/Server/Services/ProxmoxClusterService.js +23 -73
  163. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
  164. package/build/dist/Server/Services/RumApplicationService.js +19 -70
  165. package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
  166. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +20 -0
  167. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  168. package/build/dist/Server/Services/ServerlessFunctionService.js +24 -75
  169. package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
  170. package/build/dist/Server/Services/ServiceService.js +236 -61
  171. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  172. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js +603 -0
  173. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js.map +1 -0
  174. package/build/dist/Server/Services/StatusPageMonitorRuleService.js +401 -0
  175. package/build/dist/Server/Services/StatusPageMonitorRuleService.js.map +1 -0
  176. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +1 -0
  177. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
  178. package/build/dist/Server/Services/TelemetryEntityService.js +1 -0
  179. package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
  180. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +105 -29
  181. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -1
  182. package/build/dist/Server/Utils/Monitor/MonitorResource.js +56 -32
  183. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  184. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +30 -3
  185. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  186. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js +110 -98
  187. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js.map +1 -1
  188. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js +312 -0
  189. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js.map +1 -0
  190. package/build/dist/Server/Utils/SingleFlight.js +76 -0
  191. package/build/dist/Server/Utils/SingleFlight.js.map +1 -0
  192. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js +29 -0
  193. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js.map +1 -0
  194. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +78 -19
  195. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  196. package/build/dist/Server/Utils/Telemetry/ResourceHeartbeat.js +160 -0
  197. package/build/dist/Server/Utils/Telemetry/ResourceHeartbeat.js.map +1 -0
  198. package/build/dist/Server/Utils/Telemetry/Telemetry.js +279 -104
  199. package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
  200. package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
  201. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  202. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
  203. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  204. package/build/dist/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.js +2 -0
  205. package/build/dist/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.js.map +1 -0
  206. package/build/dist/Types/Dashboard/DashboardTemplates.js +368 -0
  207. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  208. package/build/dist/Types/Database/BigIntColumnTransformer.js +66 -0
  209. package/build/dist/Types/Database/BigIntColumnTransformer.js.map +1 -0
  210. package/build/dist/Types/Database/DatabaseProperty.js +25 -0
  211. package/build/dist/Types/Database/DatabaseProperty.js.map +1 -1
  212. package/build/dist/Types/Database/NumericColumnValue.js +97 -0
  213. package/build/dist/Types/Database/NumericColumnValue.js.map +1 -0
  214. package/build/dist/Types/Decimal.js +14 -3
  215. package/build/dist/Types/Decimal.js.map +1 -1
  216. package/build/dist/Types/Permission.js +42 -0
  217. package/build/dist/Types/Permission.js.map +1 -1
  218. package/build/dist/Types/Port.js +15 -5
  219. package/build/dist/Types/Port.js.map +1 -1
  220. package/build/dist/UI/Components/LogsViewer/useLiveLogsRefresh.js +44 -0
  221. package/build/dist/UI/Components/LogsViewer/useLiveLogsRefresh.js.map +1 -0
  222. package/build/dist/UI/Components/LogsViewer/useLogsHistogram.js +75 -0
  223. package/build/dist/UI/Components/LogsViewer/useLogsHistogram.js.map +1 -0
  224. package/build/dist/Utils/Dashboard/Components/DashboardNetworkMapComponent.js +114 -0
  225. package/build/dist/Utils/Dashboard/Components/DashboardNetworkMapComponent.js.map +1 -0
  226. package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
  227. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  228. package/package.json +1 -1
@@ -0,0 +1,603 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import StatusPageResource from "../../Models/DatabaseModels/StatusPageResource";
11
+ import { LIMIT_PER_PROJECT } from "../../Types/Database/LimitMax";
12
+ import ObjectID from "../../Types/ObjectID";
13
+ import RulePatternMatchUtil from "../../Utils/Rules/RulePatternMatchUtil";
14
+ import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
15
+ import logger from "../Utils/Logger";
16
+ import MonitorService from "./MonitorService";
17
+ import StatusPageMonitorRuleService from "./StatusPageMonitorRuleService";
18
+ import StatusPageResourceService from "./StatusPageResourceService";
19
+ function emptyResult() {
20
+ return {
21
+ monitorIdsAdded: [],
22
+ statusPageResourceIdsRemoved: [],
23
+ statusPageResourceIdsUpdated: [],
24
+ monitorIdsReleased: [],
25
+ };
26
+ }
27
+ function toIdSet(items) {
28
+ var _a;
29
+ const ids = new Set();
30
+ for (const item of items || []) {
31
+ const id = ((_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.toString()) || "";
32
+ if (id) {
33
+ ids.add(id);
34
+ }
35
+ }
36
+ return ids;
37
+ }
38
+ /**
39
+ * Everything the engine needs to know about one rule to decide membership.
40
+ * `findBy` hands back partial models, so this is the shape actually selected
41
+ * rather than the full entity.
42
+ */
43
+ const RULE_SELECT = {
44
+ _id: true,
45
+ projectId: true,
46
+ statusPageId: true,
47
+ statusPageGroupId: true,
48
+ isEnabled: true,
49
+ monitorLabels: { _id: true },
50
+ monitorNamePattern: true,
51
+ monitorDescriptionPattern: true,
52
+ showCurrentStatus: true,
53
+ showUptimePercent: true,
54
+ uptimePercentPrecision: true,
55
+ showStatusHistoryChart: true,
56
+ };
57
+ /**
58
+ * Keeps a status page's resources in step with its monitor rules.
59
+ *
60
+ * A status page can say "show every monitor labelled Production in the Core
61
+ * Platform group" instead of adding monitors one at a time and typing a
62
+ * display name for each. That promise has two halves, and both have to hold:
63
+ *
64
+ * - a monitor that starts matching gets added to the group the rule names,
65
+ * and a monitor that stops matching gets removed again;
66
+ *
67
+ * - a resource a human added by hand is never touched — not adopted into a
68
+ * rule when it happens to match, and never removed when it stops matching
69
+ * or when the rule is deleted.
70
+ *
71
+ * StatusPageResource.statusPageMonitorRuleId is what makes the second half
72
+ * possible: it records which rule owns a resource, and only owned resources
73
+ * are ever removed.
74
+ *
75
+ * Membership can be invalidated from either side, so there are two entry
76
+ * points:
77
+ *
78
+ * - the rule side (the rule was created or edited) -> syncResourcesForRule
79
+ * - the monitor side (its labels or name changed) -> syncRulesForMonitor
80
+ */
81
+ export class StatusPageMonitorRuleEngineServiceClass {
82
+ /**
83
+ * Re-evaluates one rule against every monitor in its project. Use when the
84
+ * rule itself changed — it is the authoritative, self-healing path and
85
+ * repairs any drift it finds.
86
+ */
87
+ async syncResourcesForRule(data) {
88
+ const rule = await StatusPageMonitorRuleService.findOneById({
89
+ id: data.statusPageMonitorRuleId,
90
+ select: RULE_SELECT,
91
+ props: {
92
+ isRoot: true,
93
+ },
94
+ });
95
+ if (!rule || !rule.id || !rule.projectId || !rule.statusPageId) {
96
+ return emptyResult();
97
+ }
98
+ /*
99
+ * A disabled rule matches nothing, which detaches everything it had added.
100
+ * Toggling a rule off therefore undoes it rather than leaving its monitors
101
+ * stranded on a page nobody remembers configuring.
102
+ */
103
+ const matchedMonitors = rule.isEnabled
104
+ ? await this.findMatchingMonitors({ rule: rule })
105
+ : [];
106
+ const result = await this.writeMembership({
107
+ rule: rule,
108
+ matchedMonitors: matchedMonitors,
109
+ /*
110
+ * This entry point runs because the rule itself changed, so it is the
111
+ * one that re-homes and re-styles the resources the rule already owns.
112
+ * The monitor-side path deliberately does not: nothing about the rule
113
+ * moved there, and reconciling on an unrelated monitor edit would
114
+ * silently revert per-resource tweaks at a surprising moment.
115
+ */
116
+ reconcileOwnedResources: true,
117
+ });
118
+ /*
119
+ * A monitor this rule just released may still be claimed by another rule
120
+ * on the same page — narrowing this rule does not mean the monitor should
121
+ * vanish from the page. Re-running the monitor-side sync for each released
122
+ * monitor lets whichever other rule still wants it pick it up.
123
+ *
124
+ * Bounded: syncRulesForMonitor only calls writeMembership, never back into
125
+ * this method, so there is no cycle.
126
+ */
127
+ for (const monitorId of result.monitorIdsReleased) {
128
+ try {
129
+ await this.syncRulesForMonitor({
130
+ monitorId: new ObjectID(monitorId),
131
+ projectId: rule.projectId,
132
+ });
133
+ }
134
+ catch (error) {
135
+ logger.error(`Error re-homing monitor ${monitorId} after status page monitor rule ${rule.id.toString()} released it: ${error}`, { projectId: rule.projectId.toString() });
136
+ }
137
+ }
138
+ return result;
139
+ }
140
+ /**
141
+ * Re-evaluates every rule in the project against a single monitor. Use when
142
+ * the monitor changed: it costs one query per project regardless of how many
143
+ * monitors the rules match.
144
+ */
145
+ async syncRulesForMonitor(data) {
146
+ const monitor = await MonitorService.findOneById({
147
+ id: data.monitorId,
148
+ select: {
149
+ _id: true,
150
+ projectId: true,
151
+ name: true,
152
+ description: true,
153
+ labels: {
154
+ _id: true,
155
+ },
156
+ },
157
+ props: {
158
+ isRoot: true,
159
+ },
160
+ });
161
+ if (!monitor || !monitor.id) {
162
+ return [];
163
+ }
164
+ const projectId = monitor.projectId || data.projectId || undefined;
165
+ if (!projectId) {
166
+ return [];
167
+ }
168
+ const rules = await StatusPageMonitorRuleService.findBy({
169
+ query: {
170
+ projectId: projectId,
171
+ isEnabled: true,
172
+ },
173
+ select: RULE_SELECT,
174
+ limit: LIMIT_PER_PROJECT,
175
+ skip: 0,
176
+ props: {
177
+ isRoot: true,
178
+ },
179
+ });
180
+ const results = [];
181
+ /*
182
+ * Two passes, removals before additions, and the order matters.
183
+ *
184
+ * Two rules on the same page can match the same monitor; only the first
185
+ * one to see it creates the resource, and the page shows it once. If the
186
+ * monitor then stops matching the OWNING rule but still matches the other,
187
+ * a single interleaved pass gives an order-dependent answer: evaluate the
188
+ * still-matching rule first and it skips the add (the monitor is still on
189
+ * the page), then the owning rule deletes — and the monitor silently
190
+ * disappears from a public page even though a rule still claims it.
191
+ *
192
+ * Draining the removals first means the addition pass sees the page as it
193
+ * will actually be, so whichever rule still claims the monitor picks it up.
194
+ */
195
+ for (const skipAdds of [true, false]) {
196
+ for (const rule of rules) {
197
+ if (!rule.id || !rule.statusPageId) {
198
+ continue;
199
+ }
200
+ const doesMatch = this.doesMonitorMatchRule({
201
+ monitor: monitor,
202
+ rule: rule,
203
+ });
204
+ try {
205
+ const result = await this.writeMembership({
206
+ rule: rule,
207
+ matchedMonitors: doesMatch ? [monitor] : [],
208
+ /*
209
+ * Only this monitor's membership is in question. Every other
210
+ * resource the rule owns is left exactly where it is.
211
+ */
212
+ restrictToMonitorId: monitor.id,
213
+ skipAdds: skipAdds,
214
+ skipRemoves: !skipAdds,
215
+ });
216
+ if (result.monitorIdsAdded.length > 0 ||
217
+ result.statusPageResourceIdsRemoved.length > 0) {
218
+ results.push(result);
219
+ }
220
+ }
221
+ catch (error) {
222
+ /*
223
+ * One rule failing must not stop the others: the monitor has already
224
+ * changed, and half a sync is better than none.
225
+ */
226
+ logger.error(`Error syncing status page monitor rule ${rule.id.toString()} for monitor ${monitor.id.toString()}: ${error}`, {
227
+ projectId: projectId.toString(),
228
+ monitorId: monitor.id.toString(),
229
+ });
230
+ }
231
+ }
232
+ }
233
+ return results;
234
+ }
235
+ /**
236
+ * Removes every resource a rule added, without touching anything else on the
237
+ * page. Called before the rule row goes away so deleting a rule undoes it.
238
+ */
239
+ async removeResourcesAddedByRule(data) {
240
+ const ownedResources = await StatusPageResourceService.findBy({
241
+ query: {
242
+ statusPageMonitorRuleId: data.statusPageMonitorRuleId,
243
+ },
244
+ select: {
245
+ _id: true,
246
+ },
247
+ limit: LIMIT_PER_PROJECT,
248
+ skip: 0,
249
+ props: {
250
+ isRoot: true,
251
+ },
252
+ });
253
+ const removedIds = [];
254
+ for (const resource of ownedResources) {
255
+ if (!resource.id) {
256
+ continue;
257
+ }
258
+ await StatusPageResourceService.deleteOneById({
259
+ id: resource.id,
260
+ props: {
261
+ isRoot: true,
262
+ },
263
+ });
264
+ removedIds.push(resource.id.toString());
265
+ }
266
+ return removedIds;
267
+ }
268
+ /**
269
+ * Does this monitor satisfy every criterion the rule specifies?
270
+ *
271
+ * Criteria are ANDed and empty ones are skipped, which mirrors how every
272
+ * other rule in the product reads. A rule with no criteria at all matches
273
+ * nothing — silently putting the entire project on a public status page is
274
+ * not a reasonable reading of an empty form. Users who genuinely want that
275
+ * write `.*` as the name pattern.
276
+ *
277
+ * Pattern matching goes through RulePatternMatchUtil, the same matcher the
278
+ * network device rules use, so a pattern means the same thing everywhere in
279
+ * the product: a case-insensitive regex, or a `*` wildcard glob. Rolling a
280
+ * private regex test here would have reintroduced #2940 — a user typing
281
+ * `*api*` (a glob, not a regex) gets a rule that silently matches nothing.
282
+ */
283
+ doesMonitorMatchRule(data) {
284
+ const { monitor, rule } = data;
285
+ const hasLabelCriteria = Boolean(rule.monitorLabels && rule.monitorLabels.length > 0);
286
+ const hasNameCriteria = Boolean(rule.monitorNamePattern);
287
+ const hasDescriptionCriteria = Boolean(rule.monitorDescriptionPattern);
288
+ if (!hasLabelCriteria && !hasNameCriteria && !hasDescriptionCriteria) {
289
+ return false;
290
+ }
291
+ if (hasLabelCriteria) {
292
+ const ruleLabelIds = toIdSet(rule.monitorLabels);
293
+ const monitorLabelIds = toIdSet(monitor.labels);
294
+ let hasAnyLabel = false;
295
+ for (const labelId of monitorLabelIds) {
296
+ if (ruleLabelIds.has(labelId)) {
297
+ hasAnyLabel = true;
298
+ break;
299
+ }
300
+ }
301
+ if (!hasAnyLabel) {
302
+ return false;
303
+ }
304
+ }
305
+ if (hasNameCriteria) {
306
+ if (!RulePatternMatchUtil.matches(monitor.name, rule.monitorNamePattern)) {
307
+ return false;
308
+ }
309
+ }
310
+ if (hasDescriptionCriteria) {
311
+ if (!RulePatternMatchUtil.matches(monitor.description, rule.monitorDescriptionPattern)) {
312
+ return false;
313
+ }
314
+ }
315
+ return true;
316
+ }
317
+ /**
318
+ * Every monitor in the rule's project that the rule matches.
319
+ *
320
+ * The label filter is pushed into the query when there is one, because it is
321
+ * the criterion that usually narrows the project the most. The regexes are
322
+ * then applied in memory — Postgres regex semantics and JavaScript's are not
323
+ * the same dialect, and the pattern a user typed has to mean one thing.
324
+ */
325
+ async findMatchingMonitors(data) {
326
+ const { rule } = data;
327
+ if (!rule.projectId) {
328
+ return [];
329
+ }
330
+ const hasLabelCriteria = Boolean(rule.monitorLabels && rule.monitorLabels.length > 0);
331
+ const hasNameCriteria = Boolean(rule.monitorNamePattern);
332
+ const hasDescriptionCriteria = Boolean(rule.monitorDescriptionPattern);
333
+ if (!hasLabelCriteria && !hasNameCriteria && !hasDescriptionCriteria) {
334
+ return [];
335
+ }
336
+ const query = {
337
+ projectId: rule.projectId,
338
+ };
339
+ if (hasLabelCriteria) {
340
+ query.labels = (rule.monitorLabels || [])
341
+ .filter((label) => {
342
+ return Boolean(label.id);
343
+ })
344
+ .map((label) => {
345
+ return label.id;
346
+ });
347
+ }
348
+ const monitors = await MonitorService.findBy({
349
+ query: query,
350
+ select: {
351
+ _id: true,
352
+ name: true,
353
+ description: true,
354
+ labels: {
355
+ _id: true,
356
+ },
357
+ },
358
+ limit: LIMIT_PER_PROJECT,
359
+ skip: 0,
360
+ props: {
361
+ isRoot: true,
362
+ },
363
+ });
364
+ return monitors.filter((monitor) => {
365
+ return this.doesMonitorMatchRule({ monitor: monitor, rule: rule });
366
+ });
367
+ }
368
+ /**
369
+ * Applies a computed match set to one rule and persists the difference.
370
+ *
371
+ * `matchedMonitors` is what the rule claims. A claimed monitor that has no
372
+ * resource on the page yet gets one; a resource the rule owns whose monitor
373
+ * it no longer claims is deleted. Resources that are not rule-owned are
374
+ * invisible to both halves, which is what keeps manual resources safe — and
375
+ * a monitor a human already added is not added a second time, so the page
376
+ * never shows a duplicate.
377
+ *
378
+ * `restrictToMonitorId` narrows both halves to a single monitor, for the
379
+ * monitor-side entry point where every other monitor's membership is
380
+ * unchanged and re-deriving it would be wasted work.
381
+ *
382
+ * `reconcileOwnedResources` additionally drags resources the rule already
383
+ * owns back into line with the rule — see reconcileResource. Only the
384
+ * rule-side entry point asks for it.
385
+ */
386
+ async writeMembership(data) {
387
+ var _a, _b, _c;
388
+ const { rule, matchedMonitors, restrictToMonitorId } = data;
389
+ if (!rule.id || !rule.statusPageId || !rule.projectId) {
390
+ return emptyResult();
391
+ }
392
+ const existingResources = await StatusPageResourceService.findBy({
393
+ query: {
394
+ statusPageId: rule.statusPageId,
395
+ },
396
+ select: {
397
+ _id: true,
398
+ monitorId: true,
399
+ statusPageMonitorRuleId: true,
400
+ statusPageGroupId: true,
401
+ showCurrentStatus: true,
402
+ showUptimePercent: true,
403
+ uptimePercentPrecision: true,
404
+ showStatusHistoryChart: true,
405
+ },
406
+ limit: LIMIT_PER_PROJECT,
407
+ skip: 0,
408
+ props: {
409
+ isRoot: true,
410
+ },
411
+ });
412
+ const monitorIdsOnPage = new Set();
413
+ const ownedResourcesByMonitorId = new Map();
414
+ for (const resource of existingResources) {
415
+ const monitorId = ((_a = resource.monitorId) === null || _a === void 0 ? void 0 : _a.toString()) || "";
416
+ if (!monitorId) {
417
+ continue;
418
+ }
419
+ monitorIdsOnPage.add(monitorId);
420
+ if (((_b = resource.statusPageMonitorRuleId) === null || _b === void 0 ? void 0 : _b.toString()) === rule.id.toString()) {
421
+ ownedResourcesByMonitorId.set(monitorId, resource);
422
+ }
423
+ }
424
+ const matchedMonitorIds = toIdSet(matchedMonitors);
425
+ const monitorIdsAdded = [];
426
+ const statusPageResourceIdsRemoved = [];
427
+ const statusPageResourceIdsUpdated = [];
428
+ const monitorIdsReleased = [];
429
+ // Remove: resources this rule owns whose monitor it no longer claims.
430
+ if (!data.skipRemoves) {
431
+ for (const [monitorId, resource] of ownedResourcesByMonitorId) {
432
+ if (matchedMonitorIds.has(monitorId)) {
433
+ continue;
434
+ }
435
+ if (restrictToMonitorId &&
436
+ restrictToMonitorId.toString() !== monitorId) {
437
+ continue;
438
+ }
439
+ if (!resource.id) {
440
+ continue;
441
+ }
442
+ await StatusPageResourceService.deleteOneById({
443
+ id: resource.id,
444
+ props: {
445
+ isRoot: true,
446
+ },
447
+ });
448
+ statusPageResourceIdsRemoved.push(resource.id.toString());
449
+ monitorIdsReleased.push(monitorId);
450
+ monitorIdsOnPage.delete(monitorId);
451
+ }
452
+ }
453
+ /*
454
+ * Add: matched monitors that are not on the page at all yet.
455
+ *
456
+ * "Not on the page" and not merely "not owned by this rule" — a monitor a
457
+ * human already added, or that another rule added, must not get a second
458
+ * resource, because the public page would then list it twice.
459
+ */
460
+ if (!data.skipAdds) {
461
+ for (const monitor of matchedMonitors) {
462
+ const monitorId = ((_c = monitor.id) === null || _c === void 0 ? void 0 : _c.toString()) || "";
463
+ if (!monitorId || monitorIdsOnPage.has(monitorId)) {
464
+ continue;
465
+ }
466
+ await this.createResource({ rule: rule, monitor: monitor });
467
+ monitorIdsAdded.push(monitorId);
468
+ }
469
+ }
470
+ /*
471
+ * Reconcile: resources the rule still owns and still claims are dragged
472
+ * back into line with the rule. Without this, editing "Add Monitors To
473
+ * Group" (or any display option) silently does nothing to the monitors the
474
+ * rule already added - it would only apply to ones it adds in future,
475
+ * which is not what changing a rule looks like it should do.
476
+ */
477
+ if (data.reconcileOwnedResources) {
478
+ for (const [monitorId, resource] of ownedResourcesByMonitorId) {
479
+ if (!matchedMonitorIds.has(monitorId) || !resource.id) {
480
+ continue;
481
+ }
482
+ if (await this.reconcileResource({ rule: rule, resource: resource })) {
483
+ statusPageResourceIdsUpdated.push(resource.id.toString());
484
+ }
485
+ }
486
+ }
487
+ if (monitorIdsAdded.length > 0 ||
488
+ statusPageResourceIdsRemoved.length > 0 ||
489
+ statusPageResourceIdsUpdated.length > 0) {
490
+ logger.debug(`Status page monitor rule ${rule.id.toString()} synced status page ${rule.statusPageId.toString()}: +${monitorIdsAdded.length} / -${statusPageResourceIdsRemoved.length} / ~${statusPageResourceIdsUpdated.length} resources`, { projectId: rule.projectId.toString() });
491
+ }
492
+ return {
493
+ monitorIdsAdded: monitorIdsAdded,
494
+ statusPageResourceIdsRemoved: statusPageResourceIdsRemoved,
495
+ statusPageResourceIdsUpdated: statusPageResourceIdsUpdated,
496
+ monitorIdsReleased: monitorIdsReleased,
497
+ };
498
+ }
499
+ /**
500
+ * Brings one rule-owned resource back into line with its rule, and reports
501
+ * whether anything actually changed.
502
+ *
503
+ * Only the fields the rule owns are considered — the group it places
504
+ * monitors in and the display options it sets. displayName is deliberately
505
+ * not among them: it is seeded from the monitor at creation time and then
506
+ * belongs to the status page, so renaming a monitor does not rewrite a
507
+ * display name someone may have polished for customers.
508
+ *
509
+ * Writes nothing when the resource already agrees, so re-running a rule that
510
+ * did not change costs a read and no writes.
511
+ */
512
+ async reconcileResource(data) {
513
+ var _a, _b, _c, _d, _e, _f, _g, _h;
514
+ const { rule, resource } = data;
515
+ if (!resource.id) {
516
+ return false;
517
+ }
518
+ const desiredGroupId = ((_a = rule.statusPageGroupId) === null || _a === void 0 ? void 0 : _a.toString()) || "";
519
+ const currentGroupId = ((_b = resource.statusPageGroupId) === null || _b === void 0 ? void 0 : _b.toString()) || "";
520
+ const desired = {
521
+ statusPageGroupId: rule.statusPageGroupId || null,
522
+ showCurrentStatus: (_c = rule.showCurrentStatus) !== null && _c !== void 0 ? _c : true,
523
+ showUptimePercent: (_d = rule.showUptimePercent) !== null && _d !== void 0 ? _d : true,
524
+ showStatusHistoryChart: (_e = rule.showStatusHistoryChart) !== null && _e !== void 0 ? _e : true,
525
+ uptimePercentPrecision: rule.uptimePercentPrecision || null,
526
+ };
527
+ const isSame = desiredGroupId === currentGroupId &&
528
+ desired.showCurrentStatus === ((_f = resource.showCurrentStatus) !== null && _f !== void 0 ? _f : true) &&
529
+ desired.showUptimePercent === ((_g = resource.showUptimePercent) !== null && _g !== void 0 ? _g : true) &&
530
+ desired.showStatusHistoryChart ===
531
+ ((_h = resource.showStatusHistoryChart) !== null && _h !== void 0 ? _h : true) &&
532
+ desired.uptimePercentPrecision ===
533
+ (resource.uptimePercentPrecision || null);
534
+ if (isSame) {
535
+ return false;
536
+ }
537
+ await StatusPageResourceService.updateOneById({
538
+ id: resource.id,
539
+ data: desired,
540
+ props: {
541
+ isRoot: true,
542
+ },
543
+ });
544
+ return true;
545
+ }
546
+ async createResource(data) {
547
+ var _a, _b, _c;
548
+ const { rule, monitor } = data;
549
+ const resource = new StatusPageResource();
550
+ resource.projectId = rule.projectId;
551
+ resource.statusPageId = rule.statusPageId;
552
+ resource.monitorId = monitor.id;
553
+ resource.statusPageMonitorRuleId = rule.id;
554
+ if (rule.statusPageGroupId) {
555
+ resource.statusPageGroupId = rule.statusPageGroupId;
556
+ }
557
+ /*
558
+ * displayName is required on the resource and the whole point of the rule
559
+ * is not having to type one, so it mirrors the monitor. Renaming the
560
+ * monitor later does not rewrite it — the display name belongs to the
561
+ * status page from the moment the resource exists.
562
+ */
563
+ resource.displayName = monitor.name || "";
564
+ resource.showCurrentStatus = (_a = rule.showCurrentStatus) !== null && _a !== void 0 ? _a : true;
565
+ resource.showUptimePercent = (_b = rule.showUptimePercent) !== null && _b !== void 0 ? _b : true;
566
+ resource.showStatusHistoryChart = (_c = rule.showStatusHistoryChart) !== null && _c !== void 0 ? _c : true;
567
+ if (rule.uptimePercentPrecision) {
568
+ resource.uptimePercentPrecision = rule.uptimePercentPrecision;
569
+ }
570
+ await StatusPageResourceService.create({
571
+ data: resource,
572
+ props: {
573
+ isRoot: true,
574
+ },
575
+ });
576
+ }
577
+ }
578
+ __decorate([
579
+ CaptureSpan(),
580
+ __metadata("design:type", Function),
581
+ __metadata("design:paramtypes", [Object]),
582
+ __metadata("design:returntype", Promise)
583
+ ], StatusPageMonitorRuleEngineServiceClass.prototype, "syncResourcesForRule", null);
584
+ __decorate([
585
+ CaptureSpan(),
586
+ __metadata("design:type", Function),
587
+ __metadata("design:paramtypes", [Object]),
588
+ __metadata("design:returntype", Promise)
589
+ ], StatusPageMonitorRuleEngineServiceClass.prototype, "syncRulesForMonitor", null);
590
+ __decorate([
591
+ CaptureSpan(),
592
+ __metadata("design:type", Function),
593
+ __metadata("design:paramtypes", [Object]),
594
+ __metadata("design:returntype", Promise)
595
+ ], StatusPageMonitorRuleEngineServiceClass.prototype, "removeResourcesAddedByRule", null);
596
+ __decorate([
597
+ CaptureSpan(),
598
+ __metadata("design:type", Function),
599
+ __metadata("design:paramtypes", [Object]),
600
+ __metadata("design:returntype", Promise)
601
+ ], StatusPageMonitorRuleEngineServiceClass.prototype, "findMatchingMonitors", null);
602
+ export default new StatusPageMonitorRuleEngineServiceClass();
603
+ //# sourceMappingURL=StatusPageMonitorRuleEngineService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusPageMonitorRuleEngineService.js","sourceRoot":"","sources":["../../../../Server/Services/StatusPageMonitorRuleEngineService.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,kBAAkB,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAE5C,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,MAAyB,MAAM,iBAAiB,CAAC;AACxD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAA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