@oneuptime/common 14.0.92 → 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 (271) 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 +62 -1
  4. package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
  5. package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
  6. package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
  7. package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
  8. package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
  9. package/Models/DatabaseModels/CloudAccount.js +546 -0
  10. package/Models/DatabaseModels/CloudAccount.mjs +2 -0
  11. package/Models/DatabaseModels/CloudResource.d.mts +8 -0
  12. package/Models/DatabaseModels/CloudResource.d.ts +8 -0
  13. package/Models/DatabaseModels/CloudResource.js +169 -0
  14. package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
  15. package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
  16. package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
  17. package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
  18. package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
  19. package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
  20. package/Models/DatabaseModels/Incident.d.mts +2 -0
  21. package/Models/DatabaseModels/Incident.d.ts +2 -0
  22. package/Models/DatabaseModels/Incident.js +54 -0
  23. package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
  24. package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
  25. package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
  26. package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
  27. package/Models/DatabaseModels/Index.js +2 -0
  28. package/Models/DatabaseModels/LlmProvider.js +1 -1
  29. package/Models/DatabaseModels/Monitor.d.mts +2 -0
  30. package/Models/DatabaseModels/Monitor.d.ts +2 -0
  31. package/Models/DatabaseModels/Monitor.js +54 -0
  32. package/Models/DatabaseModels/MonitorTemplate.js +10 -4
  33. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
  34. package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
  35. package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
  36. package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
  37. package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
  38. package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
  39. package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
  40. package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
  41. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
  42. package/Models/DatabaseModels/StatusPage.d.mts +2 -0
  43. package/Models/DatabaseModels/StatusPage.d.ts +2 -0
  44. package/Models/DatabaseModels/StatusPage.js +100 -0
  45. package/Types/AI/AiAffectedResources.d.mts +40 -0
  46. package/Types/AI/AiAffectedResources.d.ts +40 -0
  47. package/Types/AI/AiAffectedResources.js +292 -0
  48. package/Types/AI/AiAffectedResources.mjs +10 -0
  49. package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
  50. package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
  51. package/Types/Cloud/CloudAccountSummary.js +114 -0
  52. package/Types/Cloud/CloudAccountSummary.mjs +5 -0
  53. package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
  54. package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
  55. package/Types/Cloud/CloudEndpointMatch.js +134 -0
  56. package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
  57. package/Types/Cloud/CloudInventory.d.mts +34 -0
  58. package/Types/Cloud/CloudInventory.d.ts +34 -0
  59. package/Types/Cloud/CloudInventory.js +362 -0
  60. package/Types/Cloud/CloudInventory.mjs +22 -0
  61. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  62. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  63. package/Types/Cloud/CloudResourceCatalog.js +29 -1
  64. package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
  65. package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
  66. package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
  67. package/Types/Cloud/CloudResourceIndex.js +191 -0
  68. package/Types/Cloud/CloudResourceIndex.mjs +4 -0
  69. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
  70. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
  71. package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
  72. package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
  73. package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
  74. package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
  75. package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
  76. package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
  77. package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
  78. package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
  79. package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
  80. package/Types/CloudConnection/CloudConnectionTest.js +1 -0
  81. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
  82. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
  83. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
  84. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
  85. package/Types/Database/BlankColumnValue.d.mts +6 -0
  86. package/Types/Database/BlankColumnValue.d.ts +6 -0
  87. package/Types/Database/BlankColumnValue.js +77 -0
  88. package/Types/Database/BlankColumnValue.mjs +4 -0
  89. package/Types/Date.d.mts +1 -0
  90. package/Types/Date.d.ts +1 -0
  91. package/Types/Date.js +32 -6
  92. package/Types/DateLanguage.d.mts +2 -0
  93. package/Types/DateLanguage.d.ts +2 -0
  94. package/Types/DateLanguage.js +67 -12
  95. package/Types/DateLanguage.mjs +2 -0
  96. package/Types/Domain.d.mts +2 -0
  97. package/Types/Domain.d.ts +2 -0
  98. package/Types/Domain.js +27 -0
  99. package/Types/Email/EmailTemplateType.d.mts +2 -0
  100. package/Types/Email/EmailTemplateType.d.ts +2 -0
  101. package/Types/Email/EmailTemplateType.js +2 -0
  102. package/Types/Email.d.mts +1 -0
  103. package/Types/Email.d.ts +1 -0
  104. package/Types/Email.js +16 -0
  105. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
  106. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
  107. package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
  108. package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
  109. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  110. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  111. package/Types/Monitor/CriteriaFilter.js +9 -0
  112. package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
  113. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
  114. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
  115. package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
  116. package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
  117. package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
  118. package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
  119. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
  120. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
  121. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
  122. package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
  123. package/Types/Monitor/MonitorType.js +12 -2
  124. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
  125. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
  126. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
  127. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
  128. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
  129. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
  130. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
  131. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
  132. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
  133. package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
  134. package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
  135. package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
  136. package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
  137. package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
  138. package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
  139. package/Types/Monitor/UptimeHistoryLabels.js +5 -0
  140. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
  141. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
  142. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  143. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  144. package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
  145. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
  146. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
  147. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
  148. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
  149. package/Types/ReadingDirection.d.mts +10 -0
  150. package/Types/ReadingDirection.d.ts +10 -0
  151. package/Types/ReadingDirection.js +171 -0
  152. package/Types/ReadingDirection.mjs +10 -0
  153. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
  154. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
  155. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
  156. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
  157. package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
  158. package/Types/Runbook/HttpStepVariables.d.mts +8 -0
  159. package/Types/Runbook/HttpStepVariables.d.ts +8 -0
  160. package/Types/Runbook/HttpStepVariables.js +109 -0
  161. package/Types/Runbook/HttpStepVariables.mjs +5 -0
  162. package/Types/Runbook/RunbookStep.d.mts +1 -0
  163. package/Types/Runbook/RunbookStep.d.ts +1 -0
  164. package/Types/Runbook/RunnerFeatures.d.mts +1 -0
  165. package/Types/Runbook/RunnerFeatures.d.ts +1 -0
  166. package/Types/Runbook/RunnerFeatures.js +15 -3
  167. package/Types/Runbook/RunnerFeatures.mjs +1 -0
  168. package/Types/Runbook/SshHostKey.d.mts +22 -0
  169. package/Types/Runbook/SshHostKey.d.ts +22 -0
  170. package/Types/Runbook/SshHostKey.js +201 -0
  171. package/Types/Runbook/SshHostKey.mjs +10 -0
  172. package/Types/Runner/CodeRepositoryRunner.js +2 -3
  173. package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
  174. package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
  175. package/Types/Runner/GlobalAIAgentsGone.js +19 -0
  176. package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
  177. package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
  178. package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
  179. package/Types/Runner/GlobalRunnerWork.js +21 -1
  180. package/Types/Runner/GlobalRunnerWork.mjs +1 -0
  181. package/Types/SSO/SignInMethods.d.mts +31 -0
  182. package/Types/SSO/SignInMethods.d.ts +31 -0
  183. package/Types/SSO/SignInMethods.js +160 -0
  184. package/Types/SSO/SignInMethods.mjs +8 -0
  185. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
  186. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
  187. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
  188. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
  189. package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
  190. package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
  191. package/Types/StatusPage/StatusPageLanguage.js +17 -1
  192. package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
  193. package/Types/Workflow/Templates.js +2 -5
  194. package/Types/Workflow/WorkflowPlan.d.mts +7 -0
  195. package/Types/Workflow/WorkflowPlan.d.ts +7 -0
  196. package/Types/Workflow/WorkflowPlan.js +39 -0
  197. package/Types/Workflow/WorkflowPlan.mjs +3 -0
  198. package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
  199. package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
  200. package/Utils/ColorContrast.d.mts +3 -0
  201. package/Utils/ColorContrast.d.ts +3 -0
  202. package/Utils/ColorContrast.js +41 -3
  203. package/Utils/ColorContrast.mjs +2 -0
  204. package/Utils/Dashboard/TableThresholds.d.mts +44 -0
  205. package/Utils/Dashboard/TableThresholds.d.ts +44 -0
  206. package/Utils/Dashboard/TableThresholds.js +288 -0
  207. package/Utils/Dashboard/TableThresholds.mjs +17 -0
  208. package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
  209. package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
  210. package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
  211. package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
  212. package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
  213. package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
  214. package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
  215. package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
  216. package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
  217. package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
  218. package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
  219. package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
  220. package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
  221. package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
  222. package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
  223. package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
  224. package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
  225. package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
  226. package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
  227. package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
  228. package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
  229. package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
  230. package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
  231. package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
  232. package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
  233. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
  234. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
  235. package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
  236. package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
  237. package/Utils/Rules/RuleRunSummary.d.mts +1 -0
  238. package/Utils/Rules/RuleRunSummary.d.ts +1 -0
  239. package/Utils/Rules/RuleRunSummary.js +19 -1
  240. package/Utils/Rules/RuleRunSummary.mjs +1 -0
  241. package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
  242. package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
  243. package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
  244. package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
  245. package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
  246. package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
  247. package/Utils/ScheduledMaintenanceStart.js +15 -0
  248. package/Utils/Sms/Gsm7Text.js +9 -1
  249. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  250. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  251. package/Utils/Sms/OnCallPageSms.js +19 -2
  252. package/Utils/Sms/OnCallPageSms.mjs +1 -0
  253. package/Utils/Sms/SubscriberSms.d.mts +2 -0
  254. package/Utils/Sms/SubscriberSms.d.ts +2 -0
  255. package/Utils/Sms/SubscriberSms.js +35 -0
  256. package/Utils/Sms/SubscriberSms.mjs +3 -0
  257. package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
  258. package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
  259. package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
  260. package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
  261. package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
  262. package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
  263. package/Utils/Telemetry/ChangeEventFields.js +52 -1
  264. package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
  265. package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
  266. package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
  267. package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
  268. package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
  269. package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
  270. package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
  271. package/package.json +1 -1
@@ -12,6 +12,7 @@ exports.getTerraformTypeName = getTerraformTypeName;
12
12
  exports.isServerManagedColumn = isServerManagedColumn;
13
13
  exports.getTerraformAttributes = getTerraformAttributes;
14
14
  exports.getTerraformAttribute = getTerraformAttribute;
15
+ exports.getColumnsRequiredOnCreate = getColumnsRequiredOnCreate;
15
16
  exports.canLookUpByName = canLookUpByName;
16
17
  exports.getNameColumn = getNameColumn;
17
18
  const CapitalRuns_1 = require("../CapitalRuns");
@@ -507,6 +508,22 @@ function getTerraformAttribute(modelType, columnName) {
507
508
  return descriptor.columnName === columnName;
508
509
  });
509
510
  }
511
+ /*
512
+ * The columns a create over the API must send: the ones the create schema
513
+ * requires, by the rules above - so not a column with a default, a slug, the
514
+ * project id (the API key's), one that takes any value, a relation object or
515
+ * one a create cannot write. None when the model cannot be created over the
516
+ * API. The API reference badges these, and only these, Required.
517
+ */
518
+ function getColumnsRequiredOnCreate(modelType) {
519
+ return getTerraformAttributes(modelType)
520
+ .filter((descriptor) => {
521
+ return descriptor.isRequired;
522
+ })
523
+ .map((descriptor) => {
524
+ return descriptor.columnName;
525
+ });
526
+ }
510
527
  /*
511
528
  * Whether the model's data source can look a record up by `name`: the
512
529
  * provider's lookup sends `{"query": {"name": ...}}`, so it works only for
@@ -4,6 +4,7 @@ export const TERRAFORM_RESOURCE_META_ARGUMENTS = commonJsModule.TERRAFORM_RESOUR
4
4
  export const TerraformSecretKind = commonJsModule.TerraformSecretKind;
5
5
  export const TerraformValueKind = commonJsModule.TerraformValueKind;
6
6
  export const canLookUpByName = commonJsModule.canLookUpByName;
7
+ export const getColumnsRequiredOnCreate = commonJsModule.getColumnsRequiredOnCreate;
7
8
  export const getNameColumn = commonJsModule.getNameColumn;
8
9
  export const getTerraformAttribute = commonJsModule.getTerraformAttribute;
9
10
  export const getTerraformAttributes = commonJsModule.getTerraformAttributes;
@@ -0,0 +1,2 @@
1
+ export declare function isWhoOpenedItRootCause(rootCause: string | null | undefined): boolean;
2
+ export default isWhoOpenedItRootCause;
@@ -0,0 +1,2 @@
1
+ export declare function isWhoOpenedItRootCause(rootCause: string | null | undefined): boolean;
2
+ export default isWhoOpenedItRootCause;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /*
3
+ * A ROOT CAUSE THAT ONLY SAYS WHO OPENED THE RECORD.
4
+ *
5
+ * OneUptime used to fill an incident's or an alert's empty root cause with
6
+ * who opened it, when a person did:
7
+ *
8
+ * Incident created by [Maya Chen](<her page>) IncidentService
9
+ * Alert created by [Maya Chen](<her page>) AlertService
10
+ * Incident created by @maya on Slack. Slack's Declare Incident
11
+ * Incident created via Microsoft Teams Teams' Declare Incident
12
+ * Incident created via the OneUptime AI copilot. the copilot's tool
13
+ *
14
+ * That says who, not why - and the record names who opened it already (its
15
+ * creator, the Declared / Created tile, the feed's first entry). Written as
16
+ * the root cause, it stood where the cause belongs: the What happened card,
17
+ * the feed's "Root Cause", the first state's timeline row, and the status
18
+ * timeline of every monitor the incident changed. New records are left with
19
+ * no root cause until somebody writes one; the ones written before read as
20
+ * none here (the Dashboard's What happened card), while the Root Cause page
21
+ * still shows them as they are stored.
22
+ *
23
+ * Read in one pass over at most one line: every pattern is anchored at both
24
+ * ends, and each repeat stops at the character that ends it.
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.isWhoOpenedItRootCause = isWhoOpenedItRootCause;
28
+ // "Incident created by [Name](<address>)", the name as mdText escaped it.
29
+ const CREATED_BY_PERSON_LINK = /^(?:Incident|Alert) created by \[(?:\\.|[^\\\]\n])*\]\([^()\s]*\)$/;
30
+ // "Incident created by @name on Slack." - a Slack name is at most 80 long.
31
+ const CREATED_ON_SLACK = /^Incident created by @[^\n]{1,200} on Slack\.$/;
32
+ // The ones written word for word: by the Teams form and the copilot.
33
+ const CREATED_VIA = [
34
+ "Incident created via Microsoft Teams",
35
+ "Incident created via the OneUptime AI copilot.",
36
+ ];
37
+ /*
38
+ * Whether a root cause is one of the lines OneUptime wrote to say who
39
+ * opened the record, and nothing else.
40
+ */
41
+ function isWhoOpenedItRootCause(rootCause) {
42
+ const text = (rootCause || "").trim();
43
+ if (!text || text.length > 1000) {
44
+ return false;
45
+ }
46
+ return (CREATED_VIA.includes(text) ||
47
+ CREATED_BY_PERSON_LINK.test(text) ||
48
+ CREATED_ON_SLACK.test(text));
49
+ }
50
+ exports.default = isWhoOpenedItRootCause;
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./WhoOpenedItRootCause.js";
2
+ export default commonJsModule.default;
3
+ export const isWhoOpenedItRootCause = commonJsModule.isWhoOpenedItRootCause;
@@ -0,0 +1,17 @@
1
+ export declare const EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD: string;
2
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES: number;
3
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH: number;
4
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH: number;
5
+ export default class ExternalStatusPageComponentNames {
6
+ static comparable(text: string): string;
7
+ static isPattern(name: string): boolean;
8
+ static normalize(value: unknown): Array<string>;
9
+ static matchesComponent(name: string, componentName: string): boolean;
10
+ static picker(names: Array<string>): (componentName: string) => boolean;
11
+ static unmatched(names: Array<string>, componentNames: Array<string>): Array<string>;
12
+ static isFoundIn(name: string, text: string): boolean;
13
+ static fromLegacyName(componentName: unknown): Array<string>;
14
+ static toLegacyName(names: Array<string>): string | undefined;
15
+ private static isOnlyWildcards;
16
+ private static wildcardMatches;
17
+ }
@@ -0,0 +1,17 @@
1
+ export declare const EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD: string;
2
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES: number;
3
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH: number;
4
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH: number;
5
+ export default class ExternalStatusPageComponentNames {
6
+ static comparable(text: string): string;
7
+ static isPattern(name: string): boolean;
8
+ static normalize(value: unknown): Array<string>;
9
+ static matchesComponent(name: string, componentName: string): boolean;
10
+ static picker(names: Array<string>): (componentName: string) => boolean;
11
+ static unmatched(names: Array<string>, componentNames: Array<string>): Array<string>;
12
+ static isFoundIn(name: string, text: string): boolean;
13
+ static fromLegacyName(componentName: unknown): Array<string>;
14
+ static toLegacyName(names: Array<string>): string | undefined;
15
+ private static isOnlyWildcards;
16
+ private static wildcardMatches;
17
+ }
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+ /*
3
+ * THE COMPONENTS AN EXTERNAL STATUS PAGE MONITOR WATCHES, BY NAME.
4
+ *
5
+ * A monitor of a status page can watch the whole page, or only some of its
6
+ * components (issue #5156: GitHub's Git Operations and Pull Requests, not
7
+ * Copilot). It keeps them as names (MonitorStepExternalStatusPageMonitor's
8
+ * componentNames), and a name picks a page's components this way:
9
+ *
10
+ * - A name watches the component of exactly that name. Case and white
11
+ * space do not count: "git operations" is "Git Operations". A picked
12
+ * component never takes another along with it - "Workers" on
13
+ * Cloudflare's page is not "Workers KV", "Copilot" on GitHub's is not
14
+ * "Copilot AI Model Providers".
15
+ * - A "*" stands for any text: "*us-east-1*" watches every component
16
+ * with us-east-1 in its name, "Workers*" every one whose name starts
17
+ * with Workers.
18
+ * - An RSS or Atom feed's items have titles, not components: there a name
19
+ * picks every item whose title holds it somewhere ("Git Operations"
20
+ * picks "Incident with Git Operations").
21
+ *
22
+ * A monitor saved before it could watch several components had one
23
+ * Component Name Filter, which matched every component whose name
24
+ * contained it. It reads as that name between two stars (fromLegacyName),
25
+ * so it watches exactly what it watched before.
26
+ *
27
+ * Names come from the person (what they picked or typed) and from the page
28
+ * (what it lists, what its incidents name): both are read in loops, never
29
+ * by a pattern, in time in line with their length.
30
+ */
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH = exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH = exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES = exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD = void 0;
33
+ exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD = "*";
34
+ // The most names a monitor keeps: more than any page's list needs.
35
+ exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES = 500;
36
+ // The longest name a monitor keeps.
37
+ exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH = 255;
38
+ /*
39
+ * How much of a name or a title a comparison reads. A page's names are
40
+ * short; one that sends a name of megabytes is read for this much of it.
41
+ */
42
+ exports.EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH = 1000;
43
+ // Whether a UTF-16 code unit is white space as a name is read.
44
+ const isWhiteSpaceCode = (code) => {
45
+ return (code === 0x20 || // space
46
+ (code >= 0x09 && code <= 0x0d) || // tab, line breaks
47
+ code === 0xa0 || // no-break space
48
+ code === 0x1680 ||
49
+ (code >= 0x2000 && code <= 0x200a) ||
50
+ code === 0x2028 ||
51
+ code === 0x2029 ||
52
+ code === 0x202f ||
53
+ code === 0x205f ||
54
+ code === 0x3000 ||
55
+ code === 0xfeff);
56
+ };
57
+ class ExternalStatusPageComponentNames {
58
+ /*
59
+ * A name as two names are compared: lower case, without white space at
60
+ * either end, each run of it inside one space, and at most
61
+ * EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH long.
62
+ */
63
+ static comparable(text) {
64
+ const limited = text.length > exports.EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH
65
+ ? text.slice(0, exports.EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH)
66
+ : text;
67
+ let result = "";
68
+ let pendingSpace = false;
69
+ for (let index = 0; index < limited.length; index++) {
70
+ const code = limited.charCodeAt(index);
71
+ if (isWhiteSpaceCode(code)) {
72
+ pendingSpace = result.length > 0;
73
+ continue;
74
+ }
75
+ if (pendingSpace) {
76
+ result += " ";
77
+ pendingSpace = false;
78
+ }
79
+ result += limited.charAt(index);
80
+ }
81
+ return result.toLowerCase();
82
+ }
83
+ // A name with a "*" in it: it stands for any text.
84
+ static isPattern(name) {
85
+ return name.includes(exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD);
86
+ }
87
+ /*
88
+ * The names a monitor keeps, from whatever was stored or typed: each
89
+ * trimmed and at most EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH
90
+ * long, none empty, each once (as names compare, the first spelling
91
+ * kept), at most EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES of them.
92
+ * Anything but a list of names is no names.
93
+ */
94
+ static normalize(value) {
95
+ if (!Array.isArray(value)) {
96
+ return [];
97
+ }
98
+ const names = [];
99
+ const seen = new Set();
100
+ for (const item of value) {
101
+ if (typeof item !== "string") {
102
+ continue;
103
+ }
104
+ const name = item
105
+ .trim()
106
+ .slice(0, exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH)
107
+ .trim();
108
+ const key = ExternalStatusPageComponentNames.comparable(name);
109
+ if (ExternalStatusPageComponentNames.isOnlyWildcards(key)) {
110
+ /*
111
+ * Nothing, or stars alone, which pick every component: that is the
112
+ * whole page, which no names at all already say.
113
+ */
114
+ continue;
115
+ }
116
+ if (seen.has(key)) {
117
+ continue;
118
+ }
119
+ seen.add(key);
120
+ names.push(name);
121
+ if (names.length >= exports.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES) {
122
+ break;
123
+ }
124
+ }
125
+ return names;
126
+ }
127
+ /*
128
+ * Whether a name the monitor keeps picks a component of this name: the
129
+ * same name, or one its stars match.
130
+ */
131
+ static matchesComponent(name, componentName) {
132
+ const pattern = ExternalStatusPageComponentNames.comparable(name);
133
+ if (!pattern) {
134
+ return false;
135
+ }
136
+ return ExternalStatusPageComponentNames.wildcardMatches(pattern, ExternalStatusPageComponentNames.comparable(componentName));
137
+ }
138
+ /*
139
+ * Whether any of the names picks a component of this name: each name read
140
+ * once for every component a page lists, each component's name once.
141
+ */
142
+ static picker(names) {
143
+ // Names without a star are looked up; only patterns are matched.
144
+ const exact = new Set();
145
+ const patterns = [];
146
+ for (const name of names) {
147
+ const pattern = ExternalStatusPageComponentNames.comparable(name);
148
+ if (!pattern) {
149
+ continue;
150
+ }
151
+ if (ExternalStatusPageComponentNames.isPattern(pattern)) {
152
+ patterns.push(pattern);
153
+ }
154
+ else {
155
+ exact.add(pattern);
156
+ }
157
+ }
158
+ return (componentName) => {
159
+ const text = ExternalStatusPageComponentNames.comparable(componentName);
160
+ return (exact.has(text) ||
161
+ patterns.some((pattern) => {
162
+ return ExternalStatusPageComponentNames.wildcardMatches(pattern, text);
163
+ }));
164
+ };
165
+ }
166
+ /*
167
+ * The names that pick none of these components: a typo, or a component
168
+ * the page renamed or removed.
169
+ */
170
+ static unmatched(names, componentNames) {
171
+ const texts = componentNames.map((componentName) => {
172
+ return ExternalStatusPageComponentNames.comparable(componentName);
173
+ });
174
+ const known = new Set(texts);
175
+ return names.filter((name) => {
176
+ const pattern = ExternalStatusPageComponentNames.comparable(name);
177
+ if (!pattern) {
178
+ return true;
179
+ }
180
+ if (!ExternalStatusPageComponentNames.isPattern(pattern)) {
181
+ return !known.has(pattern);
182
+ }
183
+ return !texts.some((text) => {
184
+ return ExternalStatusPageComponentNames.wildcardMatches(pattern, text);
185
+ });
186
+ });
187
+ }
188
+ /*
189
+ * Whether a name the monitor keeps is somewhere in a feed item's title,
190
+ * its stars matching any text.
191
+ */
192
+ static isFoundIn(name, text) {
193
+ const pattern = ExternalStatusPageComponentNames.comparable(name);
194
+ if (!pattern) {
195
+ return false;
196
+ }
197
+ return ExternalStatusPageComponentNames.wildcardMatches(`${exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD}${pattern}${exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD}`, ExternalStatusPageComponentNames.comparable(text));
198
+ }
199
+ /*
200
+ * The names of a monitor saved with one Component Name Filter, which
201
+ * matched every component whose name contained it: that name between
202
+ * stars, which matches the same components.
203
+ */
204
+ static fromLegacyName(componentName) {
205
+ if (typeof componentName !== "string" || !componentName.trim()) {
206
+ return [];
207
+ }
208
+ return ExternalStatusPageComponentNames.normalize([
209
+ `${exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD}${componentName.trim()}${exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD}`,
210
+ ]);
211
+ }
212
+ /*
213
+ * The one filter a probe that has not been upgraded understands, for these
214
+ * names: it matches every component whose name contains it. One name
215
+ * gives its longest run of text between stars - never fewer components
216
+ * than the name picks, only as many or more. Two or more names have none:
217
+ * such a probe watches the whole page (or group) until it is upgraded,
218
+ * rather than one of the names alone.
219
+ */
220
+ static toLegacyName(names) {
221
+ if (names.length !== 1) {
222
+ return undefined;
223
+ }
224
+ let longest = "";
225
+ for (const part of names[0].split(exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD)) {
226
+ const trimmed = part.trim();
227
+ if (trimmed.length > longest.length) {
228
+ longest = trimmed;
229
+ }
230
+ }
231
+ return longest || undefined;
232
+ }
233
+ // Whether a comparable name is empty, or stars and nothing else.
234
+ static isOnlyWildcards(name) {
235
+ for (let index = 0; index < name.length; index++) {
236
+ if (name.charAt(index) !== exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD) {
237
+ return false;
238
+ }
239
+ }
240
+ return true;
241
+ }
242
+ /*
243
+ * Whether a pattern of text and stars matches the whole of a text, both
244
+ * already comparable. The first piece must start the text, the last end
245
+ * it, and each piece between is found after the one before: for patterns
246
+ * whose only wildcard is "*", taking each piece where it is first found
247
+ * is never wrong.
248
+ */
249
+ static wildcardMatches(pattern, text) {
250
+ const pieces = pattern.split(exports.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD);
251
+ if (pieces.length === 1) {
252
+ return pattern === text;
253
+ }
254
+ const first = pieces[0];
255
+ const last = pieces[pieces.length - 1];
256
+ if (!text.startsWith(first)) {
257
+ return false;
258
+ }
259
+ let position = first.length;
260
+ for (let index = 1; index < pieces.length - 1; index++) {
261
+ const piece = pieces[index];
262
+ if (!piece) {
263
+ continue;
264
+ }
265
+ const found = text.indexOf(piece, position);
266
+ if (found === -1) {
267
+ return false;
268
+ }
269
+ position = found + piece.length;
270
+ }
271
+ return text.length - last.length >= position && text.endsWith(last);
272
+ }
273
+ }
274
+ exports.default = ExternalStatusPageComponentNames;
@@ -0,0 +1,6 @@
1
+ import commonJsModule from "./ExternalStatusPageComponentNames.js";
2
+ export default commonJsModule.default;
3
+ export const EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD = commonJsModule.EXTERNAL_STATUS_PAGE_COMPONENT_WILDCARD;
4
+ export const EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_COMPARED_LENGTH;
5
+ export const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAMES;
6
+ export const EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH = commonJsModule.EXTERNAL_STATUS_PAGE_MAX_COMPONENT_NAME_LENGTH;
@@ -0,0 +1,35 @@
1
+ import { StatusPageSummary } from "../../Types/StatusPage/StatusPageSummary.mjs";
2
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENTS: number;
3
+ export declare const EXTERNAL_STATUS_PAGE_MAX_INCIDENTS: number;
4
+ export declare const EXTERNAL_STATUS_PAGE_UNNAMED_INCIDENT: string;
5
+ export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN: string;
6
+ export interface ExternalStatusPageComponent {
7
+ name: string;
8
+ status: string;
9
+ description?: string | undefined;
10
+ groupName?: string | undefined;
11
+ key?: string | undefined;
12
+ }
13
+ export interface ExternalStatusPageIncident {
14
+ name: string;
15
+ affectedComponentNames: Array<string>;
16
+ affectedComponentKeys?: Array<string> | undefined;
17
+ }
18
+ export interface ExternalStatusPageContents {
19
+ components: Array<ExternalStatusPageComponent>;
20
+ incidents: Array<ExternalStatusPageIncident>;
21
+ }
22
+ export interface AtlassianStatuspageUrls {
23
+ status: string;
24
+ components: string;
25
+ unresolvedIncidents: string;
26
+ }
27
+ export default class ExternalStatusPageReading {
28
+ static getAtlassianUrls(statusPageUrl: string): AtlassianStatuspageUrls;
29
+ static getIncidentIoUrl(statusPageUrl: string): string | null;
30
+ static readAtlassianPageStatus(json: unknown): string | null;
31
+ static readAtlassianComponents(json: unknown): Array<ExternalStatusPageComponent> | null;
32
+ static readAtlassianIncidents(json: unknown): Array<ExternalStatusPageIncident>;
33
+ static readIncidentIo(json: unknown): ExternalStatusPageContents | null;
34
+ static readOneUptimeSummary(summary: StatusPageSummary): ExternalStatusPageContents;
35
+ }
@@ -0,0 +1,35 @@
1
+ import { StatusPageSummary } from "../../Types/StatusPage/StatusPageSummary";
2
+ export declare const EXTERNAL_STATUS_PAGE_MAX_COMPONENTS: number;
3
+ export declare const EXTERNAL_STATUS_PAGE_MAX_INCIDENTS: number;
4
+ export declare const EXTERNAL_STATUS_PAGE_UNNAMED_INCIDENT: string;
5
+ export declare const EXTERNAL_STATUS_PAGE_ONEUPTIME_STATUS_NOT_SHOWN: string;
6
+ export interface ExternalStatusPageComponent {
7
+ name: string;
8
+ status: string;
9
+ description?: string | undefined;
10
+ groupName?: string | undefined;
11
+ key?: string | undefined;
12
+ }
13
+ export interface ExternalStatusPageIncident {
14
+ name: string;
15
+ affectedComponentNames: Array<string>;
16
+ affectedComponentKeys?: Array<string> | undefined;
17
+ }
18
+ export interface ExternalStatusPageContents {
19
+ components: Array<ExternalStatusPageComponent>;
20
+ incidents: Array<ExternalStatusPageIncident>;
21
+ }
22
+ export interface AtlassianStatuspageUrls {
23
+ status: string;
24
+ components: string;
25
+ unresolvedIncidents: string;
26
+ }
27
+ export default class ExternalStatusPageReading {
28
+ static getAtlassianUrls(statusPageUrl: string): AtlassianStatuspageUrls;
29
+ static getIncidentIoUrl(statusPageUrl: string): string | null;
30
+ static readAtlassianPageStatus(json: unknown): string | null;
31
+ static readAtlassianComponents(json: unknown): Array<ExternalStatusPageComponent> | null;
32
+ static readAtlassianIncidents(json: unknown): Array<ExternalStatusPageIncident>;
33
+ static readIncidentIo(json: unknown): ExternalStatusPageContents | null;
34
+ static readOneUptimeSummary(summary: StatusPageSummary): ExternalStatusPageContents;
35
+ }