@oneuptime/common 14.0.91 → 14.0.93

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 (174) hide show
  1. package/Models/DatabaseModels/Alert.js +8 -1
  2. package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
  3. package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
  4. package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
  5. package/Models/DatabaseModels/AutoRemediationRule.js +1 -1
  6. package/Models/DatabaseModels/CodeRepository.d.mts +1 -0
  7. package/Models/DatabaseModels/CodeRepository.d.ts +1 -0
  8. package/Models/DatabaseModels/CodeRepository.js +69 -6
  9. package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
  10. package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
  11. package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
  12. package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
  13. package/Models/DatabaseModels/LlmProvider.js +1 -1
  14. package/Models/DatabaseModels/MonitorTemplate.js +10 -4
  15. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
  16. package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
  17. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
  18. package/Models/DatabaseModels/StatusPage.d.mts +2 -0
  19. package/Models/DatabaseModels/StatusPage.d.ts +2 -0
  20. package/Models/DatabaseModels/StatusPage.js +100 -0
  21. package/Types/AI/CodeTask.d.mts +1 -0
  22. package/Types/AI/CodeTask.d.ts +1 -0
  23. package/Types/AI/TelemetryAiActivity.d.mts +1 -0
  24. package/Types/AI/TelemetryAiActivity.d.ts +1 -0
  25. package/Types/AI/TelemetryAiActivity.js +4 -0
  26. package/Types/CodeRepository/CodeRepositorySetting.d.mts +15 -0
  27. package/Types/CodeRepository/CodeRepositorySetting.d.ts +15 -0
  28. package/Types/CodeRepository/CodeRepositorySetting.js +49 -0
  29. package/Types/CodeRepository/CodeRepositorySetting.mjs +3 -0
  30. package/Types/Database/BlankColumnValue.d.mts +6 -0
  31. package/Types/Database/BlankColumnValue.d.ts +6 -0
  32. package/Types/Database/BlankColumnValue.js +77 -0
  33. package/Types/Database/BlankColumnValue.mjs +4 -0
  34. package/Types/Date.d.mts +10 -0
  35. package/Types/Date.d.ts +10 -0
  36. package/Types/Date.js +385 -98
  37. package/Types/DateLanguage.d.mts +67 -0
  38. package/Types/DateLanguage.d.ts +67 -0
  39. package/Types/DateLanguage.js +478 -0
  40. package/Types/DateLanguage.mjs +21 -0
  41. package/Types/Email/EmailTemplateType.d.mts +1 -0
  42. package/Types/Email/EmailTemplateType.d.ts +1 -0
  43. package/Types/Email/EmailTemplateType.js +1 -0
  44. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
  45. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
  46. package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
  47. package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
  48. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  49. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  50. package/Types/Monitor/CriteriaFilter.js +9 -0
  51. package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
  52. package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
  53. package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
  54. package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
  55. package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
  56. package/Types/Monitor/MonitorType.js +12 -2
  57. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
  58. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
  59. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
  60. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
  61. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
  62. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
  63. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
  64. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
  65. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
  66. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
  67. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
  68. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  69. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  70. package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
  71. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
  72. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
  73. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
  74. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
  75. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
  76. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
  77. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
  78. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
  79. package/Types/Runner/CodeRepositoryRunner.d.mts +7 -0
  80. package/Types/Runner/CodeRepositoryRunner.d.ts +7 -0
  81. package/Types/Runner/CodeRepositoryRunner.js +60 -14
  82. package/Types/Runner/CodeRepositoryRunner.mjs +1 -0
  83. package/Types/SecurityEvent/OcsfProcessActivity.d.mts +25 -0
  84. package/Types/SecurityEvent/OcsfProcessActivity.d.ts +25 -0
  85. package/Types/SecurityEvent/OcsfProcessActivity.js +131 -0
  86. package/Types/SecurityEvent/OcsfProcessActivity.mjs +8 -0
  87. package/Types/Workflow/Templates.js +2 -5
  88. package/UI/Utils/TranslateTemplate.d.mts +73 -0
  89. package/UI/Utils/TranslateTemplate.d.ts +73 -0
  90. package/Utils/ColorContrast.d.mts +3 -0
  91. package/Utils/ColorContrast.d.ts +3 -0
  92. package/Utils/ColorContrast.js +41 -3
  93. package/Utils/ColorContrast.mjs +2 -0
  94. package/Utils/CronTab.d.mts +41 -3
  95. package/Utils/CronTab.d.ts +41 -3
  96. package/Utils/CronTab.js +112 -38
  97. package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
  98. package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
  99. package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
  100. package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
  101. package/Utils/Monitor/MonitorOverviewTargetUtil.d.mts +2 -0
  102. package/Utils/Monitor/MonitorOverviewTargetUtil.d.ts +2 -0
  103. package/Utils/Monitor/MonitorOverviewTargetUtil.js +13 -2
  104. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
  105. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
  106. package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
  107. package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
  108. package/Utils/Rules/RuleRunSummary.d.mts +1 -0
  109. package/Utils/Rules/RuleRunSummary.d.ts +1 -0
  110. package/Utils/Rules/RuleRunSummary.js +19 -1
  111. package/Utils/Rules/RuleRunSummary.mjs +1 -0
  112. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.mts +5 -0
  113. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.ts +5 -0
  114. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.js +219 -58
  115. package/Utils/SecurityEvent/OcsfNormalizer.js +22 -13
  116. package/Utils/Slo/SloDuration.d.mts +1 -0
  117. package/Utils/Slo/SloDuration.d.ts +1 -0
  118. package/Utils/Slo/SloDuration.js +57 -8
  119. package/Utils/Slo/SloDuration.mjs +1 -0
  120. package/Utils/Sms/Gsm7Text.js +9 -1
  121. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  122. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  123. package/Utils/Sms/OnCallPageSms.js +19 -2
  124. package/Utils/Sms/OnCallPageSms.mjs +1 -0
  125. package/Utils/Sms/SubscriberSms.d.mts +2 -0
  126. package/Utils/Sms/SubscriberSms.d.ts +2 -0
  127. package/Utils/Sms/SubscriberSms.js +35 -0
  128. package/Utils/Sms/SubscriberSms.mjs +3 -0
  129. package/Utils/Suggestions/CodeFixSuggestion.d.mts +15 -0
  130. package/Utils/Suggestions/CodeFixSuggestion.d.ts +15 -0
  131. package/Utils/Suggestions/CodeFixSuggestion.js +62 -1
  132. package/Utils/Suggestions/CodeFixSuggestion.mjs +4 -0
  133. package/Utils/Suggestions/ProfileFixSuggestion.js +4 -0
  134. package/Utils/Suggestions/SuggestionBlocker.d.mts +8 -0
  135. package/Utils/Suggestions/SuggestionBlocker.d.ts +8 -0
  136. package/Utils/Suggestions/SuggestionBlocker.js +51 -0
  137. package/Utils/Suggestions/SuggestionBlocker.mjs +4 -0
  138. package/Utils/Suggestions/SuggestionOffer.d.mts +2 -1
  139. package/Utils/Suggestions/SuggestionOffer.d.ts +2 -1
  140. package/Utils/Suggestions/SuggestionOffer.js +5 -0
  141. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -7
  142. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -7
  143. package/Utils/Suggestions/TelemetryAiFixSuggestion.js +8 -36
  144. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.mts +1 -0
  145. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.ts +1 -0
  146. package/Utils/Suggestions/TelemetryImprovementSuggestion.js +1 -0
  147. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +6 -0
  148. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +6 -0
  149. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +46 -5
  150. package/package.json +8 -1
  151. package/Utils/Monitor/MonitorCheckScheduleUtil.d.mts +0 -61
  152. package/Utils/Monitor/MonitorCheckScheduleUtil.d.ts +0 -61
  153. package/Utils/Monitor/MonitorCheckScheduleUtil.js +0 -476
  154. package/Utils/Monitor/MonitorCheckScheduleUtil.mjs +0 -3
  155. package/Utils/Monitor/MonitorOverviewFamily.d.mts +0 -39
  156. package/Utils/Monitor/MonitorOverviewFamily.d.ts +0 -39
  157. package/Utils/Monitor/MonitorOverviewFamily.js +0 -206
  158. package/Utils/Monitor/MonitorOverviewFamily.mjs +0 -4
  159. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +0 -189
  160. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +0 -189
  161. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +0 -1480
  162. package/Utils/Monitor/MonitorOverviewPresentationUtil.mjs +0 -5
  163. package/Utils/Monitor/MonitorOverviewProbeUtil.d.mts +0 -112
  164. package/Utils/Monitor/MonitorOverviewProbeUtil.d.ts +0 -112
  165. package/Utils/Monitor/MonitorOverviewProbeUtil.js +0 -640
  166. package/Utils/Monitor/MonitorOverviewProbeUtil.mjs +0 -3
  167. package/Utils/Monitor/MonitorStatusHistoryUtil.d.mts +0 -27
  168. package/Utils/Monitor/MonitorStatusHistoryUtil.d.ts +0 -27
  169. package/Utils/Monitor/MonitorStatusHistoryUtil.js +0 -132
  170. package/Utils/Monitor/MonitorStatusHistoryUtil.mjs +0 -2
  171. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.mts +0 -42
  172. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.ts +0 -42
  173. package/Utils/Monitor/MonitorUptimeSummaryUtil.js +0 -468
  174. package/Utils/Monitor/MonitorUptimeSummaryUtil.mjs +0 -2
@@ -44,6 +44,7 @@ exports.parseTracePerformanceFixSuggestion = parseTracePerformanceFixSuggestion;
44
44
  exports.tracePerformanceFixSuggestionToJSON = tracePerformanceFixSuggestionToJSON;
45
45
  const CodeFixTaskContext_1 = require("../../Types/AI/CodeFixTaskContext");
46
46
  const CodeFixSuggestion_1 = require("./CodeFixSuggestion");
47
+ const SuggestionBlocker_1 = require("./SuggestionBlocker");
47
48
  const SuggestionOffer_1 = __importStar(require("./SuggestionOffer"));
48
49
  /*
49
50
  * IS THIS TRACE WORTH "FIX PERFORMANCE WITH AI"?
@@ -122,17 +123,30 @@ function getTracePerformanceFixOffer(input) {
122
123
  isAiEnabled: input.isAiEnabled,
123
124
  applies: worthFixing.length > 0,
124
125
  hasActiveFix: input.hasActiveFix,
126
+ hasFinishedFix: Boolean(input.finishedFix),
125
127
  hasConnectedRepository: input.hasConnectedRepository,
128
+ isBlocked: Boolean(input.blocker),
126
129
  // The finding is on screen: worth a quiet "connect a repository" link.
127
130
  isBackedByEvidence: true,
128
131
  });
129
132
  if (offer === SuggestionOffer_1.default.None) {
130
- return { offer, finding: null, findingCount: 0 };
133
+ return {
134
+ offer,
135
+ finding: null,
136
+ findingCount: 0,
137
+ fixOutcome: null,
138
+ blocker: null,
139
+ };
131
140
  }
132
141
  return {
133
142
  offer,
134
143
  finding: worthFixing[0] || null,
135
144
  findingCount: worthFixing.length,
145
+ fixOutcome: offer === SuggestionOffer_1.default.Done ? input.finishedFix || null : null,
146
+ // A repository to connect comes first: Code's gate needs one to ask.
147
+ blocker: offer === SuggestionOffer_1.default.SetUp && input.hasConnectedRepository
148
+ ? input.blocker || null
149
+ : null,
136
150
  };
137
151
  }
138
152
  /*
@@ -169,6 +183,8 @@ exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION = {
169
183
  offer: SuggestionOffer_1.default.None,
170
184
  finding: null,
171
185
  findingCount: 0,
186
+ fixOutcome: null,
187
+ blocker: null,
172
188
  aiRunId: null,
173
189
  };
174
190
  function isFiniteNumber(value) {
@@ -254,8 +270,11 @@ function parsePerformanceFinding(value) {
254
270
  /*
255
271
  * Reads the suggestion route's answer. Whatever does not hold together - an
256
272
  * offer that names no finding, a finding the rule would not offer, an
257
- * in-progress offer with no run - reads as no suggestion, so the page never
258
- * draws an action the answer does not fully back.
273
+ * in-progress or done offer with no run, a done offer that does not say how
274
+ * it came out, a set-up step whose blocker this build cannot draw - reads as
275
+ * no suggestion, so the page never draws an action the answer does not
276
+ * fully back. A set-up step with no blocker at all is a repository to
277
+ * connect, as it was before blockers were sent.
259
278
  */
260
279
  function parseTracePerformanceFixSuggestion(value) {
261
280
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -273,16 +292,34 @@ function parseTracePerformanceFixSuggestion(value) {
273
292
  const aiRunId = typeof record["aiRunId"] === "string" && record["aiRunId"].length > 0
274
293
  ? record["aiRunId"]
275
294
  : null;
276
- if (offer === SuggestionOffer_1.default.InProgress && !aiRunId) {
295
+ const linksRun = offer === SuggestionOffer_1.default.InProgress || offer === SuggestionOffer_1.default.Done;
296
+ if (linksRun && !aiRunId) {
277
297
  return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
278
298
  }
299
+ const fixOutcome = offer === SuggestionOffer_1.default.Done
300
+ ? (0, CodeFixSuggestion_1.parseFinishedFixOutcome)(record["fixOutcome"])
301
+ : null;
302
+ if (offer === SuggestionOffer_1.default.Done && !fixOutcome) {
303
+ return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
304
+ }
305
+ let blocker = null;
306
+ if (offer === SuggestionOffer_1.default.SetUp &&
307
+ record["blocker"] !== undefined &&
308
+ record["blocker"] !== null) {
309
+ blocker = (0, SuggestionBlocker_1.parseSuggestionBlocker)(record["blocker"]);
310
+ if (!blocker) {
311
+ return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
312
+ }
313
+ }
279
314
  return {
280
315
  offer,
281
316
  finding,
282
317
  findingCount: isFiniteNumber(record["findingCount"])
283
318
  ? Math.max(1, Math.floor(record["findingCount"]))
284
319
  : 1,
285
- aiRunId: offer === SuggestionOffer_1.default.InProgress ? aiRunId : null,
320
+ fixOutcome,
321
+ blocker,
322
+ aiRunId: linksRun ? aiRunId : null,
286
323
  };
287
324
  }
288
325
  // The route's answer as JSON (the server's side of the parser above).
@@ -293,6 +330,10 @@ function tracePerformanceFixSuggestionToJSON(suggestion) {
293
330
  ? JSON.parse(JSON.stringify(suggestion.finding))
294
331
  : null,
295
332
  findingCount: suggestion.findingCount,
333
+ fixOutcome: suggestion.fixOutcome,
334
+ blocker: suggestion.blocker
335
+ ? (0, SuggestionBlocker_1.suggestionBlockerToJSON)(suggestion.blocker)
336
+ : null,
296
337
  aiRunId: suggestion.aiRunId,
297
338
  };
298
339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneuptime/common",
3
- "version": "14.0.91",
3
+ "version": "14.0.93",
4
4
  "description": "OneUptime's shared types, utilities and data models, for Node.js and TypeScript.",
5
5
  "homepage": "https://oneuptime.com",
6
6
  "repository": {
@@ -72,8 +72,15 @@
72
72
  "./Types/Workspace/NotificationRules/NotificationRuleCondition": null,
73
73
  "./Types/Workspace/NotificationRules/NotificationRuleUtil": null,
74
74
  "./Utils/Analytics": null,
75
+ "./Utils/CronScheduleText": null,
75
76
  "./Utils/Dashboard/Components/DashboardClockComponent": null,
76
77
  "./Utils/Dashboard/Components/Index": null,
78
+ "./Utils/Monitor/MonitorCheckScheduleUtil": null,
79
+ "./Utils/Monitor/MonitorOverviewFamily": null,
80
+ "./Utils/Monitor/MonitorOverviewPresentationUtil": null,
81
+ "./Utils/Monitor/MonitorOverviewProbeUtil": null,
82
+ "./Utils/Monitor/MonitorStatusHistoryUtil": null,
83
+ "./Utils/Monitor/MonitorUptimeSummaryUtil": null,
77
84
  "./Utils/Schema/AnalyticsModelSchema": null,
78
85
  "./Utils/Schema/BaseSchema": null,
79
86
  "./Utils/Schema/ModelSchema": null,
@@ -1,61 +0,0 @@
1
- import Monitor from "../../Models/DatabaseModels/Monitor.mjs";
2
- export declare enum MonitorCheckFreshness {
3
- Fresh = "Fresh",
4
- Stale = "Stale",
5
- AwaitingFirstResult = "AwaitingFirstResult",
6
- NotScheduled = "NotScheduled",
7
- Unknown = "Unknown"
8
- }
9
- export interface MonitorCheckFreshnessResult {
10
- freshness: MonitorCheckFreshness;
11
- overdueSeconds: number | null;
12
- resultAgeSeconds: number | null;
13
- }
14
- export interface MonitorScheduledRun {
15
- runAt: Date;
16
- spacingSeconds: number;
17
- }
18
- export interface MonitorResultLateness {
19
- lateSeconds: number;
20
- graceSeconds: number;
21
- }
22
- export default class MonitorCheckScheduleUtil {
23
- static readonly DEFAULT_CADENCE_SECONDS: number;
24
- static getCadenceSeconds(data: {
25
- monitoringInterval: string | null | undefined;
26
- from: Date;
27
- }): number | null;
28
- static resolveCadenceSeconds(data: {
29
- monitoringInterval: string | null | undefined;
30
- from: Date;
31
- }): number;
32
- static getNextRunAfter(data: {
33
- monitoringInterval: string | null | undefined;
34
- after: Date;
35
- }): MonitorScheduledRun | null;
36
- private static getNextTwoRuns;
37
- private static isScheduleWithoutRuns;
38
- static getResultLateness(data: {
39
- lastResultAt: Date;
40
- monitoringInterval?: string | null | undefined;
41
- cadenceSeconds: number;
42
- now: Date;
43
- }): MonitorResultLateness;
44
- static describeInterval(monitoringInterval: string | null | undefined): string;
45
- static getGraceSeconds(cadenceSeconds: number): number;
46
- static getCheckFreshness(data: {
47
- isScheduled: boolean;
48
- isKnown: boolean;
49
- lastResultAt: Date | undefined;
50
- nextCheckAt: Date | undefined;
51
- cadenceSeconds: number;
52
- createdAt: Date | undefined;
53
- now: Date;
54
- monitoringInterval?: string | null | undefined;
55
- }): MonitorCheckFreshnessResult;
56
- static getLatestSignalAt(data: {
57
- monitor: Monitor;
58
- probeLastResultAt: Date | undefined;
59
- }): Date | undefined;
60
- static parseDate(value: unknown): Date | undefined;
61
- }
@@ -1,61 +0,0 @@
1
- import Monitor from "../../Models/DatabaseModels/Monitor";
2
- export declare enum MonitorCheckFreshness {
3
- Fresh = "Fresh",
4
- Stale = "Stale",
5
- AwaitingFirstResult = "AwaitingFirstResult",
6
- NotScheduled = "NotScheduled",
7
- Unknown = "Unknown"
8
- }
9
- export interface MonitorCheckFreshnessResult {
10
- freshness: MonitorCheckFreshness;
11
- overdueSeconds: number | null;
12
- resultAgeSeconds: number | null;
13
- }
14
- export interface MonitorScheduledRun {
15
- runAt: Date;
16
- spacingSeconds: number;
17
- }
18
- export interface MonitorResultLateness {
19
- lateSeconds: number;
20
- graceSeconds: number;
21
- }
22
- export default class MonitorCheckScheduleUtil {
23
- static readonly DEFAULT_CADENCE_SECONDS: number;
24
- static getCadenceSeconds(data: {
25
- monitoringInterval: string | null | undefined;
26
- from: Date;
27
- }): number | null;
28
- static resolveCadenceSeconds(data: {
29
- monitoringInterval: string | null | undefined;
30
- from: Date;
31
- }): number;
32
- static getNextRunAfter(data: {
33
- monitoringInterval: string | null | undefined;
34
- after: Date;
35
- }): MonitorScheduledRun | null;
36
- private static getNextTwoRuns;
37
- private static isScheduleWithoutRuns;
38
- static getResultLateness(data: {
39
- lastResultAt: Date;
40
- monitoringInterval?: string | null | undefined;
41
- cadenceSeconds: number;
42
- now: Date;
43
- }): MonitorResultLateness;
44
- static describeInterval(monitoringInterval: string | null | undefined): string;
45
- static getGraceSeconds(cadenceSeconds: number): number;
46
- static getCheckFreshness(data: {
47
- isScheduled: boolean;
48
- isKnown: boolean;
49
- lastResultAt: Date | undefined;
50
- nextCheckAt: Date | undefined;
51
- cadenceSeconds: number;
52
- createdAt: Date | undefined;
53
- now: Date;
54
- monitoringInterval?: string | null | undefined;
55
- }): MonitorCheckFreshnessResult;
56
- static getLatestSignalAt(data: {
57
- monitor: Monitor;
58
- probeLastResultAt: Date | undefined;
59
- }): Date | undefined;
60
- static parseDate(value: unknown): Date | undefined;
61
- }