@oneuptime/common 14.0.93 → 14.0.94

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 (191) hide show
  1. package/Models/DatabaseModels/Alert.d.mts +2 -0
  2. package/Models/DatabaseModels/Alert.d.ts +2 -0
  3. package/Models/DatabaseModels/Alert.js +54 -0
  4. package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
  5. package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
  6. package/Models/DatabaseModels/CloudAccount.js +546 -0
  7. package/Models/DatabaseModels/CloudAccount.mjs +2 -0
  8. package/Models/DatabaseModels/CloudResource.d.mts +8 -0
  9. package/Models/DatabaseModels/CloudResource.d.ts +8 -0
  10. package/Models/DatabaseModels/CloudResource.js +169 -0
  11. package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
  12. package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
  13. package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
  14. package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
  15. package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
  16. package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
  17. package/Models/DatabaseModels/Incident.d.mts +2 -0
  18. package/Models/DatabaseModels/Incident.d.ts +2 -0
  19. package/Models/DatabaseModels/Incident.js +54 -0
  20. package/Models/DatabaseModels/Index.js +2 -0
  21. package/Models/DatabaseModels/Monitor.d.mts +2 -0
  22. package/Models/DatabaseModels/Monitor.d.ts +2 -0
  23. package/Models/DatabaseModels/Monitor.js +54 -0
  24. package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
  25. package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
  26. package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
  27. package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
  28. package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
  29. package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
  30. package/Types/AI/AiAffectedResources.d.mts +40 -0
  31. package/Types/AI/AiAffectedResources.d.ts +40 -0
  32. package/Types/AI/AiAffectedResources.js +292 -0
  33. package/Types/AI/AiAffectedResources.mjs +10 -0
  34. package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
  35. package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
  36. package/Types/Cloud/CloudAccountSummary.js +114 -0
  37. package/Types/Cloud/CloudAccountSummary.mjs +5 -0
  38. package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
  39. package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
  40. package/Types/Cloud/CloudEndpointMatch.js +134 -0
  41. package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
  42. package/Types/Cloud/CloudInventory.d.mts +34 -0
  43. package/Types/Cloud/CloudInventory.d.ts +34 -0
  44. package/Types/Cloud/CloudInventory.js +362 -0
  45. package/Types/Cloud/CloudInventory.mjs +22 -0
  46. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  47. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  48. package/Types/Cloud/CloudResourceCatalog.js +29 -1
  49. package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
  50. package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
  51. package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
  52. package/Types/Cloud/CloudResourceIndex.js +191 -0
  53. package/Types/Cloud/CloudResourceIndex.mjs +4 -0
  54. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
  55. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
  56. package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
  57. package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
  58. package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
  59. package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
  60. package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
  61. package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
  62. package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
  63. package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
  64. package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
  65. package/Types/CloudConnection/CloudConnectionTest.js +1 -0
  66. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
  67. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
  68. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
  69. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
  70. package/Types/Date.d.mts +1 -0
  71. package/Types/Date.d.ts +1 -0
  72. package/Types/Date.js +32 -6
  73. package/Types/DateLanguage.d.mts +2 -0
  74. package/Types/DateLanguage.d.ts +2 -0
  75. package/Types/DateLanguage.js +67 -12
  76. package/Types/DateLanguage.mjs +2 -0
  77. package/Types/Domain.d.mts +2 -0
  78. package/Types/Domain.d.ts +2 -0
  79. package/Types/Domain.js +27 -0
  80. package/Types/Email/EmailTemplateType.d.mts +1 -0
  81. package/Types/Email/EmailTemplateType.d.ts +1 -0
  82. package/Types/Email/EmailTemplateType.js +1 -0
  83. package/Types/Email.d.mts +1 -0
  84. package/Types/Email.d.ts +1 -0
  85. package/Types/Email.js +16 -0
  86. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
  87. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
  88. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
  89. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
  90. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
  91. package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
  92. package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
  93. package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
  94. package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
  95. package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
  96. package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
  97. package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
  98. package/Types/Monitor/UptimeHistoryLabels.js +5 -0
  99. package/Types/ReadingDirection.d.mts +10 -0
  100. package/Types/ReadingDirection.d.ts +10 -0
  101. package/Types/ReadingDirection.js +171 -0
  102. package/Types/ReadingDirection.mjs +10 -0
  103. package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
  104. package/Types/Runbook/HttpStepVariables.d.mts +8 -0
  105. package/Types/Runbook/HttpStepVariables.d.ts +8 -0
  106. package/Types/Runbook/HttpStepVariables.js +109 -0
  107. package/Types/Runbook/HttpStepVariables.mjs +5 -0
  108. package/Types/Runbook/RunbookStep.d.mts +1 -0
  109. package/Types/Runbook/RunbookStep.d.ts +1 -0
  110. package/Types/Runbook/RunnerFeatures.d.mts +1 -0
  111. package/Types/Runbook/RunnerFeatures.d.ts +1 -0
  112. package/Types/Runbook/RunnerFeatures.js +15 -3
  113. package/Types/Runbook/RunnerFeatures.mjs +1 -0
  114. package/Types/Runbook/SshHostKey.d.mts +22 -0
  115. package/Types/Runbook/SshHostKey.d.ts +22 -0
  116. package/Types/Runbook/SshHostKey.js +201 -0
  117. package/Types/Runbook/SshHostKey.mjs +10 -0
  118. package/Types/Runner/CodeRepositoryRunner.js +2 -3
  119. package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
  120. package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
  121. package/Types/Runner/GlobalAIAgentsGone.js +19 -0
  122. package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
  123. package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
  124. package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
  125. package/Types/Runner/GlobalRunnerWork.js +21 -1
  126. package/Types/Runner/GlobalRunnerWork.mjs +1 -0
  127. package/Types/SSO/SignInMethods.d.mts +31 -0
  128. package/Types/SSO/SignInMethods.d.ts +31 -0
  129. package/Types/SSO/SignInMethods.js +160 -0
  130. package/Types/SSO/SignInMethods.mjs +8 -0
  131. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
  132. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
  133. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
  134. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
  135. package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
  136. package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
  137. package/Types/StatusPage/StatusPageLanguage.js +17 -1
  138. package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
  139. package/Types/Workflow/WorkflowPlan.d.mts +7 -0
  140. package/Types/Workflow/WorkflowPlan.d.ts +7 -0
  141. package/Types/Workflow/WorkflowPlan.js +39 -0
  142. package/Types/Workflow/WorkflowPlan.mjs +3 -0
  143. package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
  144. package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
  145. package/Utils/Dashboard/TableThresholds.d.mts +44 -0
  146. package/Utils/Dashboard/TableThresholds.d.ts +44 -0
  147. package/Utils/Dashboard/TableThresholds.js +288 -0
  148. package/Utils/Dashboard/TableThresholds.mjs +17 -0
  149. package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
  150. package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
  151. package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
  152. package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
  153. package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
  154. package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
  155. package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
  156. package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
  157. package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
  158. package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
  159. package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
  160. package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
  161. package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
  162. package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
  163. package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
  164. package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
  165. package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
  166. package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
  167. package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
  168. package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
  169. package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
  170. package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
  171. package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
  172. package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
  173. package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
  174. package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
  175. package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
  176. package/Utils/ScheduledMaintenanceStart.js +15 -0
  177. package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
  178. package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
  179. package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
  180. package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
  181. package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
  182. package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
  183. package/Utils/Telemetry/ChangeEventFields.js +52 -1
  184. package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
  185. package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
  186. package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
  187. package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
  188. package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
  189. package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
  190. package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
  191. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import commonJsModule from "./ExternalStatusPageScope.js";
2
+ export default commonJsModule.default;
3
+ export const EXTERNAL_STATUS_PAGE_MAX_REPORTED_INCIDENT_NAMES = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_REPORTED_INCIDENT_NAMES;
4
+ export const EXTERNAL_STATUS_PAGE_MAX_REPORTED_INCIDENT_NAME_LENGTH = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_REPORTED_INCIDENT_NAME_LENGTH;
@@ -0,0 +1,8 @@
1
+ export interface SshPinnedHostKey {
2
+ fingerprint: string;
3
+ keyType?: string | undefined;
4
+ }
5
+ export declare function getSshHostKeyFingerprint(blob: Uint8Array): string;
6
+ export declare function describeSshHostKey(blob: Uint8Array): SshPinnedHostKey;
7
+ export declare function getPinnedSshHostKeys(text: string | undefined): Array<SshPinnedHostKey>;
8
+ export declare function getSshHostKeyAlgorithms(keys: Array<SshPinnedHostKey>): Array<string> | null;
@@ -0,0 +1,8 @@
1
+ export interface SshPinnedHostKey {
2
+ fingerprint: string;
3
+ keyType?: string | undefined;
4
+ }
5
+ export declare function getSshHostKeyFingerprint(blob: Uint8Array): string;
6
+ export declare function describeSshHostKey(blob: Uint8Array): SshPinnedHostKey;
7
+ export declare function getPinnedSshHostKeys(text: string | undefined): Array<SshPinnedHostKey>;
8
+ export declare function getSshHostKeyAlgorithms(keys: Array<SshPinnedHostKey>): Array<string> | null;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSshHostKeyFingerprint = getSshHostKeyFingerprint;
4
+ exports.describeSshHostKey = describeSshHostKey;
5
+ exports.getPinnedSshHostKeys = getPinnedSshHostKeys;
6
+ exports.getSshHostKeyAlgorithms = getSshHostKeyAlgorithms;
7
+ const crypto_1 = require("crypto");
8
+ const SshHostKey_1 = require("../../Types/Runbook/SshHostKey");
9
+ // The fingerprint of a public key in its SSH wire format.
10
+ function getSshHostKeyFingerprint(blob) {
11
+ const digest = (0, crypto_1.createHash)("sha256").update(blob).digest("base64");
12
+ let end = digest.length;
13
+ while (end > 0 && digest[end - 1] === "=") {
14
+ end--;
15
+ }
16
+ return `${SshHostKey_1.SSH_FINGERPRINT_PREFIX}${digest.slice(0, end)}`;
17
+ }
18
+ // The key a machine presented: its fingerprint, and its type.
19
+ function describeSshHostKey(blob) {
20
+ const keyType = (0, SshHostKey_1.readSshKeyBlobType)(blob);
21
+ return Object.assign({ fingerprint: getSshHostKeyFingerprint(blob) }, (keyType ? { keyType } : {}));
22
+ }
23
+ /*
24
+ * The host keys a step's Host key field names, each as a fingerprint (and
25
+ * its type, when the line had the key), each once. Lines that are not a
26
+ * key are left out: the caller refuses the step first
27
+ * (getSshHostKeyProblem).
28
+ */
29
+ function getPinnedSshHostKeys(text) {
30
+ const parsed = (0, SshHostKey_1.parseSshHostKeys)(text);
31
+ const keys = [];
32
+ for (const entry of parsed.entries) {
33
+ const key = toPinnedKey(entry);
34
+ if (key &&
35
+ !keys.some((known) => {
36
+ return known.fingerprint === key.fingerprint;
37
+ })) {
38
+ keys.push(key);
39
+ }
40
+ }
41
+ return keys;
42
+ }
43
+ function toPinnedKey(entry) {
44
+ if (entry.kind === "fingerprint") {
45
+ return { fingerprint: entry.fingerprint };
46
+ }
47
+ const blob = (0, SshHostKey_1.decodeSshBase64)(entry.keyBase64);
48
+ if (!blob) {
49
+ return null;
50
+ }
51
+ return {
52
+ fingerprint: getSshHostKeyFingerprint(blob),
53
+ keyType: entry.keyType,
54
+ };
55
+ }
56
+ /*
57
+ * The algorithms to ask the machine for, so it presents a key the step
58
+ * names: when every key named has its type, only those; otherwise null,
59
+ * and the machine presents the one it prefers. A machine has a key of
60
+ * each type, and one named by its RSA key alone must not be asked for its
61
+ * Ed25519 one.
62
+ */
63
+ function getSshHostKeyAlgorithms(keys) {
64
+ if (keys.length === 0 ||
65
+ keys.some((key) => {
66
+ return !key.keyType;
67
+ })) {
68
+ return null;
69
+ }
70
+ const algorithms = [];
71
+ for (const key of keys) {
72
+ // An RSA key signs with SHA-2 first; ssh-rsa (SHA-1) last, for old machines.
73
+ const names = key.keyType === "ssh-rsa"
74
+ ? ["rsa-sha2-512", "rsa-sha2-256", "ssh-rsa"]
75
+ : [key.keyType];
76
+ for (const name of names) {
77
+ if (!algorithms.includes(name)) {
78
+ algorithms.push(name);
79
+ }
80
+ }
81
+ }
82
+ return algorithms;
83
+ }
@@ -0,0 +1,5 @@
1
+ import commonJsModule from "./SshHostKeyFingerprint.js";
2
+ export const describeSshHostKey = commonJsModule.describeSshHostKey;
3
+ export const getPinnedSshHostKeys = commonJsModule.getPinnedSshHostKeys;
4
+ export const getSshHostKeyAlgorithms = commonJsModule.getSshHostKeyAlgorithms;
5
+ export const getSshHostKeyFingerprint = commonJsModule.getSshHostKeyFingerprint;
@@ -35,6 +35,12 @@ export default class ScheduledMaintenanceStartUtil {
35
35
  static getInProgressStateIds(data: {
36
36
  states: Array<unknown>;
37
37
  }): Array<ObjectID>;
38
+ static getStartedStates<T>(data: {
39
+ states: Array<T>;
40
+ }): Array<T>;
41
+ static getStartedStateIds(data: {
42
+ states: Array<unknown>;
43
+ }): Array<ObjectID>;
38
44
  static isWaitingToStartByFlags(state: unknown): boolean | null;
39
45
  static isWaitingToStart(data: {
40
46
  states: Array<unknown>;
@@ -35,6 +35,12 @@ export default class ScheduledMaintenanceStartUtil {
35
35
  static getInProgressStateIds(data: {
36
36
  states: Array<unknown>;
37
37
  }): Array<ObjectID>;
38
+ static getStartedStates<T>(data: {
39
+ states: Array<T>;
40
+ }): Array<T>;
41
+ static getStartedStateIds(data: {
42
+ states: Array<unknown>;
43
+ }): Array<ObjectID>;
38
44
  static isWaitingToStartByFlags(state: unknown): boolean | null;
39
45
  static isWaitingToStart(data: {
40
46
  states: Array<unknown>;
@@ -188,6 +188,21 @@ class ScheduledMaintenanceStartUtil {
188
188
  static getInProgressStateIds(data) {
189
189
  return this.toStateIds(this.getInProgressStates(data));
190
190
  }
191
+ /*
192
+ * The project's states an event has started in (hasStarted): in progress
193
+ * or over, in the order given. What a status page's uptime history asks
194
+ * for - an event still waiting for its Starts At is no part of any day's
195
+ * history yet.
196
+ */
197
+ static getStartedStates(data) {
198
+ return data.states.filter((state) => {
199
+ return this.hasStarted({ states: data.states, state: state });
200
+ });
201
+ }
202
+ // The ids of getStartedStates, as ObjectIDs, for a query by state.
203
+ static getStartedStateIds(data) {
204
+ return this.toStateIds(this.getStartedStates(data));
205
+ }
191
206
  /*
192
207
  * Whether an event in `state` is waiting for its Starts At, from the state
193
208
  * alone: true for a state flagged scheduled, false for one flagged
@@ -11,6 +11,8 @@ export declare const RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES: ReadonlyArray<Hi
11
11
  export declare const ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY: string;
12
12
  export declare const NO_DATA_BAR_COLOR: Color;
13
13
  export declare const NO_DATA_BAR_CLASS_NAME: string;
14
+ export declare const MAINTENANCE_MARK_COLOR: Color;
15
+ export declare const MAINTENANCE_BAR_CLASS_NAME: string;
14
16
  export declare function getRuleUptimePercent(rule: HistoryChartBarColorRuleInput): number | null;
15
17
  export declare function getRuleBarColor(rule: HistoryChartBarColorRuleInput): Color | null;
16
18
  /**
@@ -11,6 +11,8 @@ export declare const RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES: ReadonlyArray<Hi
11
11
  export declare const ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY: string;
12
12
  export declare const NO_DATA_BAR_COLOR: Color;
13
13
  export declare const NO_DATA_BAR_CLASS_NAME: string;
14
+ export declare const MAINTENANCE_MARK_COLOR: Color;
15
+ export declare const MAINTENANCE_BAR_CLASS_NAME: string;
14
16
  export declare function getRuleUptimePercent(rule: HistoryChartBarColorRuleInput): number | null;
15
17
  export declare function getRuleBarColor(rule: HistoryChartBarColorRuleInput): Color | null;
16
18
  /**
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NO_DATA_BAR_CLASS_NAME = exports.NO_DATA_BAR_COLOR = exports.ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY = exports.RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES = void 0;
6
+ exports.MAINTENANCE_BAR_CLASS_NAME = exports.MAINTENANCE_MARK_COLOR = exports.NO_DATA_BAR_CLASS_NAME = exports.NO_DATA_BAR_COLOR = exports.ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY = exports.RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES = void 0;
7
7
  exports.getRuleUptimePercent = getRuleUptimePercent;
8
8
  exports.getRuleBarColor = getRuleBarColor;
9
9
  exports.getMatchingRuleIndex = getMatchingRuleIndex;
@@ -42,6 +42,17 @@ exports.ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY = "addRecommendedBarColorR
42
42
  exports.NO_DATA_BAR_COLOR = new Color_1.default("#9CA3AF");
43
43
  // The hatch, drawn over that grey by DayUptimeGraph.css.
44
44
  exports.NO_DATA_BAR_CLASS_NAME = "uptime-bar-no-data";
45
+ /*
46
+ * A day with scheduled maintenance: a blue band across the top of its bar
47
+ * (DayUptimeGraph.css), whatever colour the day itself is drawn in. Blue is
48
+ * what status pages use for planned work, and it is a colour none of the
49
+ * recommended rules or monitor statuses start with, so a day of planned work
50
+ * reads apart from an outage at a glance - in greyscale too, by where the
51
+ * band sits. The colour is here so a legend can draw the same swatch.
52
+ */
53
+ exports.MAINTENANCE_MARK_COLOR = new Color_1.default("#3B82F6");
54
+ // The band, drawn over the bar's own colour by DayUptimeGraph.css.
55
+ exports.MAINTENANCE_BAR_CLASS_NAME = "uptime-bar-maintenance";
45
56
  /*
46
57
  * A rule's percentage as a number, or null when it has none. Read the way
47
58
  * the strip has always compared it - `uptime >= threshold` - so a percentage
@@ -1,5 +1,7 @@
1
1
  import commonJsModule from "./HistoryChartBarColors.js";
2
2
  export const ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY = commonJsModule.ADD_RECOMMENDED_BAR_COLOR_RULES_MISC_DATA_KEY;
3
+ export const MAINTENANCE_BAR_CLASS_NAME = commonJsModule.MAINTENANCE_BAR_CLASS_NAME;
4
+ export const MAINTENANCE_MARK_COLOR = commonJsModule.MAINTENANCE_MARK_COLOR;
3
5
  export const NO_DATA_BAR_CLASS_NAME = commonJsModule.NO_DATA_BAR_CLASS_NAME;
4
6
  export const NO_DATA_BAR_COLOR = commonJsModule.NO_DATA_BAR_COLOR;
5
7
  export const RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES = commonJsModule.RECOMMENDED_HISTORY_CHART_BAR_COLOR_RULES;
@@ -7,6 +7,7 @@ export declare enum ChangeEventType {
7
7
  FeatureFlag = "feature-flag",
8
8
  Remediation = "remediation",
9
9
  Runbook = "runbook",
10
+ ProviderEvent = "provider-event",
10
11
  Custom = "custom"
11
12
  }
12
13
  export declare enum ChangeEventSource {
@@ -14,7 +15,9 @@ export declare enum ChangeEventSource {
14
15
  ServiceVersion = "service-version",
15
16
  Kubernetes = "kubernetes",
16
17
  OneUptimeAi = "oneuptime-ai",
17
- Runbook = "runbook"
18
+ Runbook = "runbook",
19
+ Cloud = "cloud",
20
+ CloudHealth = "cloud-health"
18
21
  }
19
22
  export declare const ChangeEventAttribute: {
20
23
  readonly Source: string;
@@ -40,6 +43,14 @@ export declare const ChangeEventAttribute: {
40
43
  readonly AlertId: string;
41
44
  readonly RunbookId: string;
42
45
  readonly RunbookExecutionId: string;
46
+ readonly CloudProvider: string;
47
+ readonly CloudAccountId: string;
48
+ readonly CloudRegion: string;
49
+ readonly CloudResourceId: string;
50
+ readonly CloudOperation: string;
51
+ readonly CloudActor: string;
52
+ readonly CloudEventId: string;
53
+ readonly CloudAccountRecordId: string;
43
54
  };
44
55
  export declare const RESERVED_CHANGE_ATTRIBUTE_PREFIX: string;
45
56
  export declare enum ChangeEventStatus {
@@ -80,6 +91,13 @@ export interface ChangeEventFields {
80
91
  alertId?: string | undefined;
81
92
  runbookId?: string | undefined;
82
93
  runbookExecutionId?: string | undefined;
94
+ cloudProvider?: string | undefined;
95
+ cloudAccountId?: string | undefined;
96
+ cloudRegion?: string | undefined;
97
+ cloudResourceId?: string | undefined;
98
+ cloudOperation?: string | undefined;
99
+ cloudActor?: string | undefined;
100
+ cloudAccountRecordId?: string | undefined;
83
101
  }
84
102
  export declare function readChangeEventFields(attributes: Dictionary<unknown> | null | undefined): ChangeEventFields;
85
103
  export declare function shortCommitSha(sha: string): string;
@@ -7,6 +7,7 @@ export declare enum ChangeEventType {
7
7
  FeatureFlag = "feature-flag",
8
8
  Remediation = "remediation",
9
9
  Runbook = "runbook",
10
+ ProviderEvent = "provider-event",
10
11
  Custom = "custom"
11
12
  }
12
13
  export declare enum ChangeEventSource {
@@ -14,7 +15,9 @@ export declare enum ChangeEventSource {
14
15
  ServiceVersion = "service-version",
15
16
  Kubernetes = "kubernetes",
16
17
  OneUptimeAi = "oneuptime-ai",
17
- Runbook = "runbook"
18
+ Runbook = "runbook",
19
+ Cloud = "cloud",
20
+ CloudHealth = "cloud-health"
18
21
  }
19
22
  export declare const ChangeEventAttribute: {
20
23
  readonly Source: string;
@@ -40,6 +43,14 @@ export declare const ChangeEventAttribute: {
40
43
  readonly AlertId: string;
41
44
  readonly RunbookId: string;
42
45
  readonly RunbookExecutionId: string;
46
+ readonly CloudProvider: string;
47
+ readonly CloudAccountId: string;
48
+ readonly CloudRegion: string;
49
+ readonly CloudResourceId: string;
50
+ readonly CloudOperation: string;
51
+ readonly CloudActor: string;
52
+ readonly CloudEventId: string;
53
+ readonly CloudAccountRecordId: string;
43
54
  };
44
55
  export declare const RESERVED_CHANGE_ATTRIBUTE_PREFIX: string;
45
56
  export declare enum ChangeEventStatus {
@@ -80,6 +91,13 @@ export interface ChangeEventFields {
80
91
  alertId?: string | undefined;
81
92
  runbookId?: string | undefined;
82
93
  runbookExecutionId?: string | undefined;
94
+ cloudProvider?: string | undefined;
95
+ cloudAccountId?: string | undefined;
96
+ cloudRegion?: string | undefined;
97
+ cloudResourceId?: string | undefined;
98
+ cloudOperation?: string | undefined;
99
+ cloudActor?: string | undefined;
100
+ cloudAccountRecordId?: string | undefined;
83
101
  }
84
102
  export declare function readChangeEventFields(attributes: Dictionary<unknown> | null | undefined): ChangeEventFields;
85
103
  export declare function shortCommitSha(sha: string): string;
@@ -12,7 +12,9 @@ exports.describeChangeEventSource = describeChangeEventSource;
12
12
  * places: CI/CD pipelines and the CLI post them to the ingest API, and
13
13
  * OneUptime records others itself - a service that starts reporting a new
14
14
  * service.version, a Kubernetes Deployment that starts a new ReplicaSet, a
15
- * fix command OneUptime AI ran, a runbook that ran. They all keep what
15
+ * fix command OneUptime AI ran, a runbook that ran, a change a cloud
16
+ * account's activity log recorded, a health event its provider published.
17
+ * They all keep what
16
18
  * they know in the row's attributes map, under OpenTelemetry's semantic
17
19
  * convention names where one exists (service.version,
18
20
  * deployment.environment.name, vcs.*, k8s.*) and under oneuptime.* where
@@ -32,6 +34,13 @@ var ChangeEventType;
32
34
  ChangeEventType["Remediation"] = "remediation";
33
35
  // A runbook OneUptime ran.
34
36
  ChangeEventType["Runbook"] = "runbook";
37
+ /*
38
+ * The cloud provider's own event about the account: an AWS Health event,
39
+ * an Azure Service Health or Resource Health event, a Google Cloud
40
+ * Service Health event - an outage, degradation or scheduled change on
41
+ * the provider's side.
42
+ */
43
+ ChangeEventType["ProviderEvent"] = "provider-event";
35
44
  ChangeEventType["Custom"] = "custom";
36
45
  })(ChangeEventType || (exports.ChangeEventType = ChangeEventType = {}));
37
46
  // Where a change event came from: its oneuptime.change.source attribute.
@@ -47,6 +56,13 @@ var ChangeEventSource;
47
56
  ChangeEventSource["OneUptimeAi"] = "oneuptime-ai";
48
57
  // A runbook OneUptime ran.
49
58
  ChangeEventSource["Runbook"] = "runbook";
59
+ /*
60
+ * A change a cloud account's activity log recorded: AWS CloudTrail, the
61
+ * Azure Activity Log, Google Cloud's Admin Activity audit log.
62
+ */
63
+ ChangeEventSource["Cloud"] = "cloud";
64
+ // A health event the cloud provider published about the account.
65
+ ChangeEventSource["CloudHealth"] = "cloud-health";
50
66
  })(ChangeEventSource || (exports.ChangeEventSource = ChangeEventSource = {}));
51
67
  // The attribute keys OneUptime writes on the change events it records.
52
68
  exports.ChangeEventAttribute = {
@@ -73,6 +89,17 @@ exports.ChangeEventAttribute = {
73
89
  AlertId: "oneuptime.alert.id",
74
90
  RunbookId: "oneuptime.runbook.id",
75
91
  RunbookExecutionId: "oneuptime.runbook_execution.id",
92
+ // OpenTelemetry's cloud.* names, for the account and the resource.
93
+ CloudProvider: "cloud.provider",
94
+ CloudAccountId: "cloud.account.id",
95
+ CloudRegion: "cloud.region",
96
+ CloudResourceId: "cloud.resource_id",
97
+ // What the activity log recorded, and who did it.
98
+ CloudOperation: "oneuptime.cloud.operation",
99
+ CloudActor: "oneuptime.cloud.actor",
100
+ CloudEventId: "oneuptime.cloud.event_id",
101
+ // The CloudAccount row the change belongs to.
102
+ CloudAccountRecordId: "oneuptime.cloud_account.id",
76
103
  };
77
104
  /*
78
105
  * Attribute keys under this prefix are OneUptime's own. The ingest API
@@ -183,6 +210,13 @@ function readChangeEventFields(attributes) {
183
210
  alertId: read(exports.ChangeEventAttribute.AlertId),
184
211
  runbookId: read(exports.ChangeEventAttribute.RunbookId),
185
212
  runbookExecutionId: read(exports.ChangeEventAttribute.RunbookExecutionId),
213
+ cloudProvider: read(exports.ChangeEventAttribute.CloudProvider),
214
+ cloudAccountId: read(exports.ChangeEventAttribute.CloudAccountId),
215
+ cloudRegion: read(exports.ChangeEventAttribute.CloudRegion),
216
+ cloudResourceId: read(exports.ChangeEventAttribute.CloudResourceId),
217
+ cloudOperation: read(exports.ChangeEventAttribute.CloudOperation),
218
+ cloudActor: read(exports.ChangeEventAttribute.CloudActor),
219
+ cloudAccountRecordId: read(exports.ChangeEventAttribute.CloudAccountRecordId),
186
220
  };
187
221
  for (const key of Object.keys(fields)) {
188
222
  if (fields[key] === undefined) {
@@ -241,6 +275,19 @@ function describeChangeEventFields(fields) {
241
275
  if (fields.command) {
242
276
  parts.push(`command: ${fields.command}`);
243
277
  }
278
+ if (fields.cloudOperation) {
279
+ parts.push(fields.cloudActor
280
+ ? `${fields.cloudOperation} by ${fields.cloudActor}`
281
+ : fields.cloudOperation);
282
+ }
283
+ if (fields.cloudResourceId) {
284
+ parts.push(`on ${fields.cloudResourceId}`);
285
+ }
286
+ if (fields.cloudAccountId) {
287
+ parts.push(fields.cloudRegion
288
+ ? `account ${fields.cloudAccountId}, ${fields.cloudRegion}`
289
+ : `account ${fields.cloudAccountId}`);
290
+ }
244
291
  if (fields.status) {
245
292
  parts.push(fields.status);
246
293
  }
@@ -262,6 +309,10 @@ function describeChangeEventSource(source) {
262
309
  return "a fix OneUptime AI ran";
263
310
  case ChangeEventSource.Runbook:
264
311
  return "a runbook OneUptime ran";
312
+ case ChangeEventSource.Cloud:
313
+ return "the cloud account's activity log";
314
+ case ChangeEventSource.CloudHealth:
315
+ return "the cloud provider's health events";
265
316
  default:
266
317
  return source;
267
318
  }
@@ -25,8 +25,14 @@ export default class DayUptimeGraphUtil {
25
25
  hasEvents: boolean;
26
26
  uptimePercent: number;
27
27
  incidentCount: number;
28
+ maintenanceCount?: number | undefined;
28
29
  labels?: UptimeHistoryLabels | undefined;
29
30
  }): string;
31
+ static getMaintenanceCountLabel(data: {
32
+ count: number;
33
+ labels?: UptimeHistoryLabels | undefined;
34
+ }): string;
35
+ static fillLabel(template: string, values: Record<string, string>): string;
30
36
  static getGraphAriaLabel(data: {
31
37
  dayCount: number;
32
38
  labels?: UptimeHistoryLabels | undefined;
@@ -25,8 +25,14 @@ export default class DayUptimeGraphUtil {
25
25
  hasEvents: boolean;
26
26
  uptimePercent: number;
27
27
  incidentCount: number;
28
+ maintenanceCount?: number | undefined;
28
29
  labels?: UptimeHistoryLabels | undefined;
29
30
  }): string;
31
+ static getMaintenanceCountLabel(data: {
32
+ count: number;
33
+ labels?: UptimeHistoryLabels | undefined;
34
+ }): string;
35
+ static fillLabel(template: string, values: Record<string, string>): string;
30
36
  static getGraphAriaLabel(data: {
31
37
  dayCount: number;
32
38
  labels?: UptimeHistoryLabels | undefined;
@@ -113,20 +113,51 @@ class DayUptimeGraphUtil {
113
113
  const labels = data.labels || UptimeHistoryLabels_1.DefaultUptimeHistoryLabels;
114
114
  const incidentCount = Math.max(data.incidentCount, 0);
115
115
  const hasIncidents = incidentCount > 0;
116
- if (!data.hasEvents) {
117
- return this.interpolate(hasIncidents
116
+ const label = !data.hasEvents
117
+ ? this.interpolate(hasIncidents
118
118
  ? labels.dayLabelNoDataWithIncidents
119
119
  : labels.dayLabelNoData, {
120
120
  date: data.dateLabel,
121
121
  total: String(incidentCount),
122
+ })
123
+ : this.interpolate(hasIncidents ? labels.dayLabelWithIncidents : labels.dayLabel, {
124
+ date: data.dateLabel,
125
+ uptime: this.formatUptimePercentForLabel(data.uptimePercent),
126
+ total: String(incidentCount),
122
127
  });
128
+ const maintenanceCount = Math.max(data.maintenanceCount || 0, 0);
129
+ if (maintenanceCount === 0) {
130
+ return label;
131
+ }
132
+ return this.interpolate(labels.dayLabelWithMaintenance, {
133
+ label: label,
134
+ maintenance: this.getMaintenanceCountLabel({
135
+ count: maintenanceCount,
136
+ labels: labels,
137
+ }),
138
+ });
139
+ }
140
+ /*
141
+ * "1 scheduled maintenance event", "3 scheduled maintenance events": the
142
+ * count a day's accessible name and its dialog read out.
143
+ */
144
+ static getMaintenanceCountLabel(data) {
145
+ const labels = data.labels || UptimeHistoryLabels_1.DefaultUptimeHistoryLabels;
146
+ const count = Math.max(Math.floor(data.count), 0);
147
+ if (count === 1) {
148
+ return labels.oneMaintenanceEvent;
123
149
  }
124
- return this.interpolate(hasIncidents ? labels.dayLabelWithIncidents : labels.dayLabel, {
125
- date: data.dateLabel,
126
- uptime: this.formatUptimePercentForLabel(data.uptimePercent),
127
- total: String(incidentCount),
150
+ return this.interpolate(labels.maintenanceEvents, {
151
+ total: String(count),
128
152
  });
129
153
  }
154
+ /*
155
+ * A label of the history filled in: {{name}} with its value, as i18next
156
+ * does. For the strings the history speaks beyond the bars' names.
157
+ */
158
+ static fillLabel(template, values) {
159
+ return this.interpolate(template, values);
160
+ }
130
161
  static getGraphAriaLabel(data) {
131
162
  const labels = data.labels || UptimeHistoryLabels_1.DefaultUptimeHistoryLabels;
132
163
  return this.interpolate(labels.graphLabel, {
@@ -0,0 +1,60 @@
1
+ import ScheduledMaintenance from "../../Models/DatabaseModels/ScheduledMaintenance.mjs";
2
+ import ScheduledMaintenanceState from "../../Models/DatabaseModels/ScheduledMaintenanceState.mjs";
3
+ import Color from "../../Types/Color.mjs";
4
+ import UptimeBarTooltipMaintenance from "../../Types/Monitor/UptimeBarTooltipMaintenance.mjs";
5
+ import ObjectID from "../../Types/ObjectID.mjs";
6
+ export interface MaintenanceSpan {
7
+ start: Date;
8
+ end: Date;
9
+ }
10
+ export declare const MAINTENANCE_WINDOW_SEPARATOR: string;
11
+ export interface MaintenanceWindowText {
12
+ start: string;
13
+ end: string;
14
+ }
15
+ type TranslateStateName = (name: string) => string;
16
+ export default class UptimeMaintenanceUtil {
17
+ static getSpan(data: {
18
+ event: UptimeBarTooltipMaintenance;
19
+ now: Date;
20
+ }): MaintenanceSpan | null;
21
+ static isOnDay(data: {
22
+ event: UptimeBarTooltipMaintenance;
23
+ dayStart: Date;
24
+ dayEnd: Date;
25
+ now: Date;
26
+ }): boolean;
27
+ static getEventsForDay(data: {
28
+ events: Array<UptimeBarTooltipMaintenance>;
29
+ dayStart: Date;
30
+ dayEnd: Date;
31
+ now: Date;
32
+ }): Array<UptimeBarTooltipMaintenance>;
33
+ static getEventsForMonitors(data: {
34
+ events: Array<UptimeBarTooltipMaintenance>;
35
+ monitorIds: Array<ObjectID | string>;
36
+ }): Array<UptimeBarTooltipMaintenance>;
37
+ static getEventsInProgress(events: Array<UptimeBarTooltipMaintenance>): Array<UptimeBarTooltipMaintenance>;
38
+ static formatWindow(data: {
39
+ startsAt: Date;
40
+ endsAt: Date;
41
+ }): string;
42
+ static getWindowText(data: {
43
+ startsAt: Date;
44
+ endsAt: Date;
45
+ }): MaintenanceWindowText | null;
46
+ static fromScheduledMaintenance(data: {
47
+ event: ScheduledMaintenance;
48
+ states: Array<ScheduledMaintenanceState>;
49
+ translateStateName?: TranslateStateName | undefined;
50
+ fallbackStateColor?: Color | undefined;
51
+ }): UptimeBarTooltipMaintenance | null;
52
+ static fromScheduledMaintenances(data: {
53
+ events: Array<ScheduledMaintenance>;
54
+ states: Array<ScheduledMaintenanceState>;
55
+ translateStateName?: TranslateStateName | undefined;
56
+ }): Array<UptimeBarTooltipMaintenance>;
57
+ private static getTimeOfDayText;
58
+ private static toDate;
59
+ }
60
+ export {};
@@ -0,0 +1,60 @@
1
+ import ScheduledMaintenance from "../../Models/DatabaseModels/ScheduledMaintenance";
2
+ import ScheduledMaintenanceState from "../../Models/DatabaseModels/ScheduledMaintenanceState";
3
+ import Color from "../../Types/Color";
4
+ import UptimeBarTooltipMaintenance from "../../Types/Monitor/UptimeBarTooltipMaintenance";
5
+ import ObjectID from "../../Types/ObjectID";
6
+ export interface MaintenanceSpan {
7
+ start: Date;
8
+ end: Date;
9
+ }
10
+ export declare const MAINTENANCE_WINDOW_SEPARATOR: string;
11
+ export interface MaintenanceWindowText {
12
+ start: string;
13
+ end: string;
14
+ }
15
+ type TranslateStateName = (name: string) => string;
16
+ export default class UptimeMaintenanceUtil {
17
+ static getSpan(data: {
18
+ event: UptimeBarTooltipMaintenance;
19
+ now: Date;
20
+ }): MaintenanceSpan | null;
21
+ static isOnDay(data: {
22
+ event: UptimeBarTooltipMaintenance;
23
+ dayStart: Date;
24
+ dayEnd: Date;
25
+ now: Date;
26
+ }): boolean;
27
+ static getEventsForDay(data: {
28
+ events: Array<UptimeBarTooltipMaintenance>;
29
+ dayStart: Date;
30
+ dayEnd: Date;
31
+ now: Date;
32
+ }): Array<UptimeBarTooltipMaintenance>;
33
+ static getEventsForMonitors(data: {
34
+ events: Array<UptimeBarTooltipMaintenance>;
35
+ monitorIds: Array<ObjectID | string>;
36
+ }): Array<UptimeBarTooltipMaintenance>;
37
+ static getEventsInProgress(events: Array<UptimeBarTooltipMaintenance>): Array<UptimeBarTooltipMaintenance>;
38
+ static formatWindow(data: {
39
+ startsAt: Date;
40
+ endsAt: Date;
41
+ }): string;
42
+ static getWindowText(data: {
43
+ startsAt: Date;
44
+ endsAt: Date;
45
+ }): MaintenanceWindowText | null;
46
+ static fromScheduledMaintenance(data: {
47
+ event: ScheduledMaintenance;
48
+ states: Array<ScheduledMaintenanceState>;
49
+ translateStateName?: TranslateStateName | undefined;
50
+ fallbackStateColor?: Color | undefined;
51
+ }): UptimeBarTooltipMaintenance | null;
52
+ static fromScheduledMaintenances(data: {
53
+ events: Array<ScheduledMaintenance>;
54
+ states: Array<ScheduledMaintenanceState>;
55
+ translateStateName?: TranslateStateName | undefined;
56
+ }): Array<UptimeBarTooltipMaintenance>;
57
+ private static getTimeOfDayText;
58
+ private static toDate;
59
+ }
60
+ export {};