@oneuptime/common 14.1.0 → 14.2.0

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 (249) hide show
  1. package/Models/DatabaseModels/Alert.d.mts +1 -0
  2. package/Models/DatabaseModels/Alert.d.ts +1 -0
  3. package/Models/DatabaseModels/Alert.js +34 -0
  4. package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
  5. package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
  6. package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
  7. package/Models/DatabaseModels/Incident.d.mts +1 -0
  8. package/Models/DatabaseModels/Incident.d.ts +1 -0
  9. package/Models/DatabaseModels/Incident.js +35 -0
  10. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
  11. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
  12. package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
  13. package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
  14. package/Models/DatabaseModels/Index.js +2 -0
  15. package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
  16. package/Types/AI/AIActionWords.d.mts +3 -1
  17. package/Types/AI/AIActionWords.d.ts +3 -1
  18. package/Types/AI/AIActionWords.js +70 -1
  19. package/Types/AI/AIActionWords.mjs +2 -0
  20. package/Types/AI/AIChatTypes.d.mts +2 -1
  21. package/Types/AI/AIChatTypes.d.ts +2 -1
  22. package/Types/AI/AIReadTableWords.d.mts +192 -0
  23. package/Types/AI/AIReadTableWords.d.ts +192 -0
  24. package/Types/AI/AIReadTableWords.js +368 -0
  25. package/Types/AI/AIReadTableWords.mjs +18 -0
  26. package/Types/AI/AiRunRefusal.d.mts +3 -0
  27. package/Types/AI/AiRunRefusal.d.ts +3 -0
  28. package/Types/AI/AiRunRefusal.js +22 -1
  29. package/Types/AI/ResourceAiAccessPermissions.js +7 -18
  30. package/Types/AuditLog/AuditLogActionLabel.js +19 -9
  31. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
  32. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
  33. package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
  34. package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
  35. package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
  36. package/Types/Cloud/CloudResourceHealth.js +405 -13
  37. package/Types/Cloud/CloudResourceHealth.mjs +28 -0
  38. package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
  39. package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
  40. package/Types/DataObservability/DataCheckRefusals.js +77 -0
  41. package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
  42. package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
  43. package/Types/Date.d.mts +2 -0
  44. package/Types/Date.d.ts +2 -0
  45. package/Types/Date.js +22 -0
  46. package/Types/DateLanguage.d.mts +2 -0
  47. package/Types/DateLanguage.d.ts +2 -0
  48. package/Types/DateLanguage.js +8 -5
  49. package/Types/Email/EmailTemplateType.d.mts +1 -0
  50. package/Types/Email/EmailTemplateType.d.ts +1 -0
  51. package/Types/Email/EmailTemplateType.js +2 -0
  52. package/Types/Exception/EgressGuardException.js +1 -1
  53. package/Types/Exception/ErrorMessageRule.d.mts +1 -0
  54. package/Types/Exception/ErrorMessageRule.d.ts +1 -0
  55. package/Types/Exception/ErrorMessageRule.js +67 -13
  56. package/Types/Exception/ErrorMessageRule.mjs +1 -0
  57. package/Types/Exception/ExceptionMessages.d.mts +2 -0
  58. package/Types/Exception/ExceptionMessages.d.ts +2 -0
  59. package/Types/Exception/ExceptionMessages.js +2 -0
  60. package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
  61. package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
  62. package/Types/Incident/PostmortemActionItemStatus.js +74 -0
  63. package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
  64. package/Types/JSONFunctions.js +10 -3
  65. package/Types/Link.d.mts +1 -0
  66. package/Types/Link.d.ts +1 -0
  67. package/Types/MeaningKeys.d.mts +4 -0
  68. package/Types/MeaningKeys.d.ts +4 -0
  69. package/Types/MeaningKeys.js +74 -0
  70. package/Types/MeaningKeys.mjs +5 -0
  71. package/Types/Monitor/WhoIsTold.d.mts +3 -0
  72. package/Types/Monitor/WhoIsTold.d.ts +3 -0
  73. package/Types/Monitor/WhoIsTold.js +63 -13
  74. package/Types/NoBreakSpaces.d.mts +16 -0
  75. package/Types/NoBreakSpaces.d.ts +16 -0
  76. package/Types/NoBreakSpaces.js +419 -0
  77. package/Types/NoBreakSpaces.mjs +9 -0
  78. package/Types/NotificationRule/PagingLadder.d.mts +12 -0
  79. package/Types/NotificationRule/PagingLadder.d.ts +12 -0
  80. package/Types/NotificationRule/PagingLadder.js +159 -11
  81. package/Types/NotificationRule/PagingLadder.mjs +3 -0
  82. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
  83. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
  84. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
  85. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
  86. package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
  87. package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
  88. package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
  89. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
  90. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
  91. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
  92. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
  93. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
  94. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
  95. package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
  96. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  97. package/Types/OpenStack/OpenStackCapacity.js +12 -5
  98. package/Types/Permission.d.mts +4 -0
  99. package/Types/Permission.d.ts +4 -0
  100. package/Types/Permission.js +64 -8
  101. package/Types/Product/ProductUsage.js +2 -1
  102. package/Types/Product/ProjectProductsAnswer.js +2 -1
  103. package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
  104. package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
  105. package/Types/ResourceAiAgent/AiResourceType.js +12 -0
  106. package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
  107. package/Types/Rum/ProductAnalyticsEvents.js +13 -1
  108. package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
  109. package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
  110. package/Types/Rum/SessionReplayCustomEvents.js +12 -0
  111. package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
  112. package/Types/SetupHealth/SetupHealth.d.mts +1 -0
  113. package/Types/SetupHealth/SetupHealth.d.ts +1 -0
  114. package/Types/SetupHealth/SetupHealth.js +13 -5
  115. package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
  116. package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
  117. package/Types/StatusPage/DefaultStatusNames.js +74 -28
  118. package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
  119. package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
  120. package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
  121. package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
  122. package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
  123. package/Types/Translator.d.mts +1 -0
  124. package/Types/Translator.d.ts +1 -0
  125. package/Types/Translator.js +100 -19
  126. package/Types/Translator.mjs +1 -0
  127. package/Types/UserSession/SessionLength.d.mts +33 -0
  128. package/Types/UserSession/SessionLength.d.ts +33 -0
  129. package/Types/UserSession/SessionLength.js +134 -5
  130. package/Types/UserSession/SessionLength.mjs +5 -0
  131. package/Types/Workflow/WorkflowStatus.js +21 -10
  132. package/Utils/AI/InvestigationReport.js +2 -2
  133. package/Utils/API.d.mts +0 -11
  134. package/Utils/API.d.ts +0 -11
  135. package/Utils/API.js +0 -432
  136. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
  137. package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
  138. package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
  139. package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
  140. package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
  141. package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
  142. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
  143. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
  144. package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
  145. package/Utils/DefaultRecordNames.d.mts +6 -0
  146. package/Utils/DefaultRecordNames.d.ts +6 -0
  147. package/Utils/DefaultRecordNames.js +122 -0
  148. package/Utils/DefaultRecordNames.mjs +6 -0
  149. package/Utils/Grok/Grok.js +7 -4
  150. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
  151. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
  152. package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
  153. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
  154. package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
  155. package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
  156. package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
  157. package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
  158. package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
  159. package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
  160. package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
  161. package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
  162. package/Utils/LookupTable.d.mts +3 -0
  163. package/Utils/LookupTable.d.ts +3 -0
  164. package/Utils/LookupTable.js +61 -0
  165. package/Utils/LookupTable.mjs +3 -0
  166. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
  167. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
  168. package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
  169. package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
  170. package/Utils/Markdown/OverLongText.js +296 -2
  171. package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
  172. package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
  173. package/Utils/Markdown/SlowMarkdown.js +354 -4
  174. package/Utils/Markdown/SlowMarkdown.mjs +1 -0
  175. package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
  176. package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
  177. package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
  178. package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
  179. package/Utils/Metrics/MetricSeriesScope.js +5 -1
  180. package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
  181. package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
  182. package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
  183. package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
  184. package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
  185. package/Utils/Monitor/ProbeAgreementRule.js +58 -0
  186. package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
  187. package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
  188. package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
  189. package/Utils/Monitor/ProbeFailureReading.js +30 -1
  190. package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
  191. package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
  192. package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
  193. package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
  194. package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
  195. package/Utils/PromQL/PromQLEngine.js +18 -9
  196. package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
  197. package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
  198. package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
  199. package/Utils/PromQL/PromQLLabelOrder.js +212 -0
  200. package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
  201. package/Utils/PromQL/PromQLLabels.js +4 -3
  202. package/Utils/PromQL/PromQLMetricNames.js +8 -2
  203. package/Utils/PromQL/PromQLParser.js +11 -6
  204. package/Utils/PromQL/PromQLRegex.d.mts +11 -0
  205. package/Utils/PromQL/PromQLRegex.d.ts +11 -0
  206. package/Utils/PromQL/PromQLRegex.js +990 -50
  207. package/Utils/PromQL/PromQLRegex.mjs +3 -0
  208. package/Utils/PromQL/PrometheusResponse.js +3 -1
  209. package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
  210. package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
  211. package/Utils/PromQL/RE2CharacterClass.js +532 -0
  212. package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
  213. package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
  214. package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
  215. package/Utils/RequestFailedDetailsUtil.js +452 -0
  216. package/Utils/RequestFailedDetailsUtil.mjs +2 -0
  217. package/Utils/Rum/UrlScrubber.d.mts +1 -1
  218. package/Utils/Rum/UrlScrubber.d.ts +1 -1
  219. package/Utils/Rum/UrlScrubber.js +10 -4
  220. package/Utils/Rum/UserFlow.js +22 -4
  221. package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
  222. package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
  223. package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
  224. package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
  225. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  226. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  227. package/Utils/Sms/OnCallPageSms.js +3 -1
  228. package/Utils/StateListType.d.mts +11 -0
  229. package/Utils/StateListType.d.ts +11 -0
  230. package/Utils/StateListType.js +21 -0
  231. package/Utils/StateListType.mjs +2 -0
  232. package/Utils/StateOrder.d.mts +8 -11
  233. package/Utils/StateOrder.d.ts +8 -11
  234. package/Utils/StateOrder.js +49 -84
  235. package/Utils/StateOrder.mjs +2 -0
  236. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
  237. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
  238. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
  239. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
  240. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
  241. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
  242. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
  243. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
  244. package/Utils/Syslog/SyslogMessageParser.js +16 -6
  245. package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
  246. package/Utils/ValueFormatter.d.mts +1 -0
  247. package/Utils/ValueFormatter.d.ts +1 -0
  248. package/Utils/ValueFormatter.js +258 -18
  249. package/package.json +1 -1
@@ -0,0 +1,452 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const axios_1 = __importDefault(require("axios"));
40
+ const ApiException_1 = __importDefault(require("../Types/Exception/ApiException"));
41
+ const EgressGuardException_1 = __importStar(require("../Types/Exception/EgressGuardException"));
42
+ const RequestFailedDetails_1 = require("../Types/Probe/RequestFailedDetails");
43
+ const API_1 = __importDefault(require("./API"));
44
+ const HostAddressUtil_1 = __importDefault(require("./HostAddressUtil"));
45
+ const RequestFailureDescriptions_1 = require("./Monitor/RequestFailureDescriptions");
46
+ const ProbeNetworkFailureUtil_1 = __importStar(require("./ProbeNetworkFailureUtil"));
47
+ // What a probe-side failure calls the target when the error has no request URL.
48
+ const UNKNOWN_REQUEST_HOST = "the server";
49
+ // How far down an error's `cause` / `errors` the connect addresses are read.
50
+ const MAX_CONNECT_ADDRESS_DEPTH = 5;
51
+ /*
52
+ * The code a probe-side failure is reported under. Taken from the
53
+ * classification rather than the thrown error because fetch's TypeError and
54
+ * the API monitor's APIException have no usable code of their own, and an
55
+ * aggregate carries only its first attempt's. NoRouteToHost never comes out
56
+ * of a TCP connect; it is listed so the map stays total.
57
+ */
58
+ const PROBE_NETWORK_FAILURE_ERROR_CODES = {
59
+ [ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NoSourceAddress]: "EADDRNOTAVAIL",
60
+ [ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.AddressFamilyNotSupported]: "EAFNOSUPPORT",
61
+ [ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NetworkUnreachable]: "ENETUNREACH",
62
+ [ProbeNetworkFailureUtil_1.ProbeNetworkFailureKind.NoRouteToHost]: "EHOSTUNREACH",
63
+ };
64
+ class RequestFailedDetailsUtil {
65
+ /**
66
+ * Extracts detailed error information from an axios error or generic error.
67
+ * This provides more context about where and why a request failed.
68
+ */
69
+ static getRequestFailedDetails(error) {
70
+ const axiosError = axios_1.default.isAxiosError(error)
71
+ ? error
72
+ : null;
73
+ const nativeErrorCode = typeof error === "object" && error !== null && "code" in error
74
+ ? error.code
75
+ : undefined;
76
+ const errorCode = typeof nativeErrorCode === "string" ? nativeErrorCode : undefined;
77
+ const rawErrorMessage = (error === null || error === void 0 ? void 0 : error.message) || String(error) || "Unknown error";
78
+ /*
79
+ * The egress guard refuses a target BEFORE any socket is opened, and for
80
+ * tenant-facing callers it sanitizes its message down to one sentence that
81
+ * matches none of the patterns below. Left to the fall-through, every such
82
+ * failure was reported as phase "Unknown" with the sanitized sentence
83
+ * echoed back as its own explanation — which is exactly what a monitor
84
+ * incident showed for a host whose DNS had hiccuped. Classify it here
85
+ * instead, from the exception TYPE rather than from its text.
86
+ */
87
+ if (error instanceof EgressGuardException_1.default) {
88
+ return {
89
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TargetResolution,
90
+ errorCode: error.reason === EgressGuardException_1.EgressFailureReason.InvalidTarget
91
+ ? "INVALID_TARGET"
92
+ : "TARGET_UNREACHABLE",
93
+ /*
94
+ * One constant description for every unreachable reason. It names all
95
+ * the possibilities without saying which occurred, so it stays useful
96
+ * without telling a tenant on a shared probe whether a hostname
97
+ * resolved — that difference is the enumeration oracle the guard's
98
+ * sanitized message exists to close.
99
+ */
100
+ errorDescription: error.reason === EgressGuardException_1.EgressFailureReason.InvalidTarget
101
+ ? (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.InvalidTarget, { message: rawErrorMessage })
102
+ : (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.TargetUnreachable),
103
+ rawErrorMessage,
104
+ };
105
+ }
106
+ /*
107
+ * The connect failed on the probe, before the request left it. Checked
108
+ * ahead of the string rules below because none of them describe it:
109
+ * EADDRNOTAVAIL matched nothing and fell through to "The request was sent
110
+ * but no response was returned", when nothing was sent at all, and a
111
+ * probe with no IPv6 was told there was no route to the network where the
112
+ * server resides. Still the TCP connection phase, since connect() is what
113
+ * failed. The failure cause the monitor reports alongside this already
114
+ * quotes the OS error (getProbeNetworkFailureDescription), so this only
115
+ * says what it means for the request.
116
+ */
117
+ const probeSideFailure = RequestFailedDetailsUtil.getProbeSideRequestFailure(error);
118
+ if (probeSideFailure) {
119
+ return {
120
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
121
+ errorCode: PROBE_NETWORK_FAILURE_ERROR_CODES[probeSideFailure.failure.kind],
122
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailedDetailsUtil.getProbeSideFailureDescription(probeSideFailure)),
123
+ rawErrorMessage,
124
+ };
125
+ }
126
+ // Helper to determine the phase and description based on error code/message
127
+ const lowerMessage = rawErrorMessage.toLowerCase();
128
+ // DNS resolution failures
129
+ if (errorCode === "ENOTFOUND" || lowerMessage.includes("enotfound")) {
130
+ return {
131
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.DNSResolution,
132
+ errorCode: errorCode || "ENOTFOUND",
133
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.DnsResolutionFailed),
134
+ rawErrorMessage,
135
+ };
136
+ }
137
+ // Connection refused
138
+ if (errorCode === "ECONNREFUSED" || lowerMessage.includes("econnrefused")) {
139
+ return {
140
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
141
+ errorCode: errorCode || "ECONNREFUSED",
142
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.ConnectionRefused),
143
+ rawErrorMessage,
144
+ };
145
+ }
146
+ // Connection reset
147
+ if (errorCode === "ECONNRESET" ||
148
+ lowerMessage.includes("econnreset") ||
149
+ lowerMessage.includes("connection reset")) {
150
+ return {
151
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
152
+ errorCode: errorCode || "ECONNRESET",
153
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.ConnectionReset),
154
+ rawErrorMessage,
155
+ };
156
+ }
157
+ // Connection aborted
158
+ if (errorCode === "ECONNABORTED" ||
159
+ lowerMessage.includes("econnaborted") ||
160
+ lowerMessage.includes("connection aborted")) {
161
+ return {
162
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.RequestAborted,
163
+ errorCode: errorCode || "ECONNABORTED",
164
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.ConnectionAborted),
165
+ rawErrorMessage,
166
+ };
167
+ }
168
+ // Timeout errors
169
+ if (errorCode === "ETIMEDOUT" ||
170
+ errorCode === "ESOCKETTIMEDOUT" ||
171
+ lowerMessage.includes("timeout") ||
172
+ lowerMessage.includes("exceeded")) {
173
+ return {
174
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.RequestTimeout,
175
+ errorCode: errorCode || "TIMEOUT",
176
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.RequestTimedOut),
177
+ rawErrorMessage,
178
+ };
179
+ }
180
+ // SSL/TLS Certificate errors
181
+ if (errorCode === "CERT_REVOKED" ||
182
+ lowerMessage.includes("certificate has been revoked") ||
183
+ lowerMessage.includes("cert_revoked")) {
184
+ return {
185
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
186
+ errorCode: "CERT_REVOKED",
187
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.CertificateRevoked),
188
+ rawErrorMessage,
189
+ };
190
+ }
191
+ if (lowerMessage.includes("certificate has expired") ||
192
+ lowerMessage.includes("cert_has_expired")) {
193
+ return {
194
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
195
+ errorCode: "CERT_HAS_EXPIRED",
196
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.CertificateExpired),
197
+ rawErrorMessage,
198
+ };
199
+ }
200
+ if (lowerMessage.includes("self-signed certificate") ||
201
+ lowerMessage.includes("self signed certificate") ||
202
+ lowerMessage.includes("depth_zero_self_signed_cert")) {
203
+ return {
204
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
205
+ errorCode: "SELF_SIGNED_CERT",
206
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.SelfSignedCertificate),
207
+ rawErrorMessage,
208
+ };
209
+ }
210
+ if (lowerMessage.includes("certificate signed by unknown authority") ||
211
+ lowerMessage.includes("unable_to_verify_leaf_signature") ||
212
+ lowerMessage.includes("unable to verify")) {
213
+ return {
214
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.CertificateError,
215
+ errorCode: "CERT_UNKNOWN_AUTHORITY",
216
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.CertificateUnknownAuthority),
217
+ rawErrorMessage,
218
+ };
219
+ }
220
+ if (lowerMessage.includes("ssl") ||
221
+ lowerMessage.includes("tls") ||
222
+ lowerMessage.includes("certificate") ||
223
+ lowerMessage.includes("handshake")) {
224
+ return {
225
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TLSHandshake,
226
+ errorCode: errorCode || "TLS_ERROR",
227
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.TlsHandshakeFailed),
228
+ rawErrorMessage,
229
+ };
230
+ }
231
+ // Network errors
232
+ if (lowerMessage.includes("network error") || errorCode === "ERR_NETWORK") {
233
+ return {
234
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.NetworkError,
235
+ errorCode: errorCode || "NETWORK_ERROR",
236
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.NetworkError),
237
+ rawErrorMessage,
238
+ };
239
+ }
240
+ // Host unreachable
241
+ if (errorCode === "EHOSTUNREACH" ||
242
+ lowerMessage.includes("host unreachable")) {
243
+ return {
244
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
245
+ errorCode: errorCode || "EHOSTUNREACH",
246
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.HostUnreachable),
247
+ rawErrorMessage,
248
+ };
249
+ }
250
+ // Network unreachable
251
+ if (errorCode === "ENETUNREACH" ||
252
+ lowerMessage.includes("network unreachable")) {
253
+ return {
254
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.TCPConnection,
255
+ errorCode: errorCode || "ENETUNREACH",
256
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.NetworkUnreachable),
257
+ rawErrorMessage,
258
+ };
259
+ }
260
+ // Server responded with error status
261
+ if (axiosError === null || axiosError === void 0 ? void 0 : axiosError.response) {
262
+ const status = axiosError.response.status;
263
+ return {
264
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.ServerResponse,
265
+ errorCode: `HTTP_${status}`,
266
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailedDetailsUtil.getHttpStatusDescription(status), { status: status }),
267
+ rawErrorMessage,
268
+ };
269
+ }
270
+ // Request was made but no response received
271
+ if ((axiosError === null || axiosError === void 0 ? void 0 : axiosError.request) && !(axiosError === null || axiosError === void 0 ? void 0 : axiosError.response)) {
272
+ return {
273
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.NetworkError,
274
+ errorCode: errorCode || "NO_RESPONSE",
275
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.NoResponse),
276
+ rawErrorMessage,
277
+ };
278
+ }
279
+ // Default/Unknown error
280
+ return {
281
+ failedPhase: RequestFailedDetails_1.RequestFailedPhase.Unknown,
282
+ errorCode: errorCode,
283
+ errorDescription: (0, RequestFailureDescriptions_1.writeRequestFailureDescription)(RequestFailureDescriptions_1.RequestFailureDescription.RequestFailed, {
284
+ message: API_1.default.getFriendlyErrorMessage(error),
285
+ }),
286
+ rawErrorMessage,
287
+ };
288
+ }
289
+ /*
290
+ * The failure cause for a monitor request that failed on the probe itself,
291
+ * in the shared probe-side wording (which quotes the OS error), or null for
292
+ * any other failure. A probe with no usable IPv6 fails every IPv6 URL with
293
+ * a bare "connect EADDRNOTAVAIL ...", which reads as the customer's site
294
+ * being down while it may be answering perfectly well.
295
+ *
296
+ * ENETUNREACH from a TCP connect can also be a router's "no route" to the
297
+ * destination, so it is only reworded for an IPv6 destination, where the
298
+ * shared wording says "most likely". Otherwise it keeps its message.
299
+ *
300
+ * Separate from getFriendlyErrorMessage on purpose: that one is also used
301
+ * by the dashboard and by the server's own outbound requests, where "this
302
+ * probe" would be false. Only the Website and API monitors call this.
303
+ */
304
+ static getProbeNetworkFailureDescription(error) {
305
+ const probeSideFailure = RequestFailedDetailsUtil.getProbeSideRequestFailure(error);
306
+ if (!probeSideFailure ||
307
+ (!probeSideFailure.failure.isCertain &&
308
+ !probeSideFailure.isIPv6Destination)) {
309
+ return null;
310
+ }
311
+ return ProbeNetworkFailureUtil_1.default.describe({
312
+ host: probeSideFailure.host,
313
+ failure: probeSideFailure.failure,
314
+ isIPv6Destination: probeSideFailure.isIPv6Destination,
315
+ });
316
+ }
317
+ /*
318
+ * Classifies a request error as a connect that failed on the probe, with
319
+ * the host to name and whether to word it as IPv6.
320
+ *
321
+ * IPv6 wording needs evidence. It is used when every address the probe
322
+ * tried to connect to was IPv6 or, when the error names no address, when
323
+ * the request URL's host is an IPv6 literal. A dual-stack name whose IPv4
324
+ * attempt failed as well is not an IPv6 problem, and neither is an IPv4
325
+ * proxy the probe could not reach on the way to an IPv6 target.
326
+ */
327
+ static getProbeSideRequestFailure(error) {
328
+ // The guard refuses before any socket exists; its message is its own.
329
+ if (error instanceof EgressGuardException_1.default) {
330
+ return null;
331
+ }
332
+ /*
333
+ * The API monitor gets the AxiosError wrapped in an APIException (see
334
+ * getErrorResponse). The wrapper's own code is an ExceptionCode number
335
+ * and its message carries the errno but not the OS text, so the
336
+ * classifier would find nothing on it.
337
+ */
338
+ const requestError = error instanceof ApiException_1.default && error.error ? error.error : error;
339
+ const failure = ProbeNetworkFailureUtil_1.default.classifyError({
340
+ error: requestError,
341
+ operation: ProbeNetworkFailureUtil_1.ProbeNetworkOperation.TcpConnect,
342
+ });
343
+ if (!failure) {
344
+ return null;
345
+ }
346
+ const requestHost = RequestFailedDetailsUtil.getRequestHost(requestError);
347
+ const connectAddresses = [];
348
+ RequestFailedDetailsUtil.collectConnectAddresses(requestError, 0, connectAddresses);
349
+ const isIPv6Destination = connectAddresses.length > 0
350
+ ? connectAddresses.every((address) => {
351
+ return HostAddressUtil_1.default.isIPv6(address);
352
+ })
353
+ : Boolean(requestHost && HostAddressUtil_1.default.isIPv6(requestHost));
354
+ return {
355
+ failure: failure,
356
+ host: requestHost || UNKNOWN_REQUEST_HOST,
357
+ isIPv6Destination: isIPv6Destination,
358
+ };
359
+ }
360
+ /*
361
+ * The "Error Details" explanation of a probe-side failure. ENETUNREACH
362
+ * that is not towards IPv6 keeps the family-neutral description it
363
+ * always had.
364
+ */
365
+ static getProbeSideFailureDescription(probeSideFailure) {
366
+ const failure = probeSideFailure.failure;
367
+ if (!probeSideFailure.isIPv6Destination) {
368
+ return failure.isCertain
369
+ ? RequestFailureDescriptions_1.RequestFailureDescription.ProbeCouldNotConnect
370
+ : RequestFailureDescriptions_1.RequestFailureDescription.NetworkUnreachable;
371
+ }
372
+ /*
373
+ * EADDRNOTAVAIL from a TCP connect is also what a probe that has run
374
+ * out of local ports gets, IPv6 or not, so it is not stated as missing
375
+ * IPv6.
376
+ */
377
+ if (failure.isCertain && failure.isCauseAmbiguous) {
378
+ return RequestFailureDescriptions_1.RequestFailureDescription.ProbeCouldNotConnectOverIPv6;
379
+ }
380
+ if (failure.isCertain) {
381
+ return RequestFailureDescriptions_1.RequestFailureDescription.ProbeCannotSendIPv6;
382
+ }
383
+ return RequestFailureDescriptions_1.RequestFailureDescription.NoIPv6Route;
384
+ }
385
+ /*
386
+ * What a server's HTTP status means, as the request's explanation says
387
+ * it after "Server responded with HTTP status 503.".
388
+ */
389
+ static getHttpStatusDescription(status) {
390
+ if (status >= 500) {
391
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpServerError;
392
+ }
393
+ if (status === 404) {
394
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpNotFound;
395
+ }
396
+ if (status === 403) {
397
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpForbidden;
398
+ }
399
+ if (status === 401) {
400
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpUnauthorized;
401
+ }
402
+ if (status === 400) {
403
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpBadRequest;
404
+ }
405
+ if (status >= 400) {
406
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpClientError;
407
+ }
408
+ return RequestFailureDescriptions_1.RequestFailureDescription.HttpStatus;
409
+ }
410
+ /*
411
+ * The host of the URL an axios request was sent to, without IPv6
412
+ * brackets, or null when the error is not an axios one or has no usable
413
+ * URL. It is the hop that failed, which after a redirect is not
414
+ * necessarily the monitor's own URL.
415
+ */
416
+ static getRequestHost(error) {
417
+ var _a;
418
+ if (!axios_1.default.isAxiosError(error) || !((_a = error.config) === null || _a === void 0 ? void 0 : _a.url)) {
419
+ return null;
420
+ }
421
+ try {
422
+ const requestUrl = new globalThis.URL(error.config.url, error.config.baseURL || undefined);
423
+ return HostAddressUtil_1.default.stripBrackets(requestUrl.hostname) || null;
424
+ }
425
+ catch (_b) {
426
+ return null;
427
+ }
428
+ }
429
+ /*
430
+ * Every `address` a socket error in the chain names: the error's own, its
431
+ * cause's (axios and fetch keep the socket error there) and each attempt
432
+ * of an aggregate (Node's happy-eyeballs connect, one error per address).
433
+ */
434
+ static collectConnectAddresses(value, depth, addresses) {
435
+ if (!value ||
436
+ typeof value !== "object" ||
437
+ depth > MAX_CONNECT_ADDRESS_DEPTH) {
438
+ return;
439
+ }
440
+ const errorLike = value;
441
+ if (typeof errorLike.address === "string" && errorLike.address) {
442
+ addresses.push(HostAddressUtil_1.default.stripBrackets(errorLike.address));
443
+ }
444
+ if (Array.isArray(errorLike.errors)) {
445
+ for (const attempt of errorLike.errors) {
446
+ RequestFailedDetailsUtil.collectConnectAddresses(attempt, depth + 1, addresses);
447
+ }
448
+ }
449
+ RequestFailedDetailsUtil.collectConnectAddresses(errorLike.cause, depth + 1, addresses);
450
+ }
451
+ }
452
+ exports.default = RequestFailedDetailsUtil;
@@ -0,0 +1,2 @@
1
+ import commonJsModule from "./RequestFailedDetailsUtil.js";
2
+ export default commonJsModule.default;
@@ -6,5 +6,5 @@ export default class UrlScrubber {
6
6
  private static spellWords;
7
7
  static scrubPath(pathname: string): string;
8
8
  static scrubQuery(params: URLSearchParams, allowlistedQueryParams?: Array<string> | undefined): string;
9
- static getScrubbedPathname(rawUrl: string): string;
9
+ static getScrubbedPage(rawUrl: string): string;
10
10
  }
@@ -6,5 +6,5 @@ export default class UrlScrubber {
6
6
  private static spellWords;
7
7
  static scrubPath(pathname: string): string;
8
8
  static scrubQuery(params: URLSearchParams, allowlistedQueryParams?: Array<string> | undefined): string;
9
- static getScrubbedPathname(rawUrl: string): string;
9
+ static getScrubbedPage(rawUrl: string): string;
10
10
  }
@@ -272,17 +272,23 @@ class UrlScrubber {
272
272
  return kept.join("&");
273
273
  }
274
274
  /*
275
- * Path-only form, used for the refresh-rage detector, which needs to
276
- * compare "the same page" across reloads without the origin.
275
+ * The page a URL is, without its origin or query: the scrubbed path and,
276
+ * for a hash router, the route scrub keeps ("/#/orders/[redacted]",
277
+ * "/app/#!/cart"). The refresh-rage log compares it across page loads,
278
+ * and the support bundle names the page by it.
279
+ *
280
+ * The path alone was the page before: every route of a hash-routed app
281
+ * has the path "/", so a full load of #/a and then of #/b was counted as
282
+ * two reloads of one page, and raised refresh rage.
277
283
  */
278
- static getScrubbedPathname(rawUrl) {
284
+ static getScrubbedPage(rawUrl) {
279
285
  const scrubbed = UrlScrubber.scrub(rawUrl);
280
286
  if (!scrubbed || scrubbed === REDACTED) {
281
287
  return REDACTED;
282
288
  }
283
289
  try {
284
290
  const parsed = new URL(scrubbed, "https://redacted.invalid");
285
- return parsed.pathname;
291
+ return parsed.pathname + parsed.hash;
286
292
  }
287
293
  catch (_a) {
288
294
  return REDACTED;
@@ -1121,12 +1121,30 @@ function buildUserFlowInsights(journeys, pages, loops) {
1121
1121
  /* ------------------------------------------------------------------ */
1122
1122
  /* Entry point */
1123
1123
  /* ------------------------------------------------------------------ */
1124
+ /*
1125
+ * The anchor and the hidden pages are page keys, in the key's one spelling
1126
+ * (UrlScrubber.normalizePathSpelling, as toUserFlowPageKey writes them). A
1127
+ * link made before the keys had one spelling still holds the spelling its
1128
+ * session was stored in - "/caf%c3%a9", "/cafe%CC%81" - which no row has any
1129
+ * more: the anchor was lost and the hidden page shown again. Read in the
1130
+ * key's spelling, it names the row it named, and the page writes the link
1131
+ * back in that spelling.
1132
+ */
1124
1133
  function normalizeUserFlowOptions(options) {
1125
1134
  const merged = Object.assign(Object.assign({}, exports.DEFAULT_USER_FLOW_OPTIONS), options);
1126
- return Object.assign(Object.assign({}, merged), { anchorPage: merged.anchorPage || null, direction: merged.direction === "backward" ? "backward" : "forward", steps: clamp(merged.steps, exports.USER_FLOW_MIN_STEPS, exports.USER_FLOW_MAX_STEPS), pagesPerStep: clamp(merged.pagesPerStep, exports.USER_FLOW_MIN_PAGES_PER_STEP, exports.USER_FLOW_MAX_PAGES_PER_STEP), hiddenPages: (merged.hiddenPages || []).filter((page) => {
1127
- /* The anchor cannot be hidden: the map would have nothing to draw. */
1128
- return Boolean(page) && page !== merged.anchorPage;
1129
- }) });
1135
+ const anchorPage = merged.anchorPage
1136
+ ? UrlScrubber_1.default.normalizePathSpelling(merged.anchorPage)
1137
+ : null;
1138
+ /* Once each, in the order given: a pasted link can repeat a key. */
1139
+ const hiddenPages = new Set();
1140
+ for (const page of merged.hiddenPages || []) {
1141
+ const key = page ? UrlScrubber_1.default.normalizePathSpelling(page) : "";
1142
+ /* The anchor cannot be hidden: the map would have nothing to draw. */
1143
+ if (key && key !== anchorPage) {
1144
+ hiddenPages.add(key);
1145
+ }
1146
+ }
1147
+ return Object.assign(Object.assign({}, merged), { anchorPage: anchorPage, direction: merged.direction === "backward" ? "backward" : "forward", steps: clamp(merged.steps, exports.USER_FLOW_MIN_STEPS, exports.USER_FLOW_MAX_STEPS), pagesPerStep: clamp(merged.pagesPerStep, exports.USER_FLOW_MIN_PAGES_PER_STEP, exports.USER_FLOW_MAX_PAGES_PER_STEP), hiddenPages: Array.from(hiddenPages) });
1130
1148
  }
1131
1149
  function analyzeUserFlow(response, partialOptions = {}) {
1132
1150
  const options = normalizeUserFlowOptions(partialOptions);
@@ -1,5 +1,6 @@
1
1
  import SecurityCaseVerdict from "../../Types/SecurityCase/SecurityCaseVerdict.mjs";
2
2
  import SecurityDetectionSource from "../../Types/SecurityCase/SecurityDetectionSource.mjs";
3
+ import Timezone from "../../Types/Timezone.mjs";
3
4
  export interface OverviewCaseRow {
4
5
  createdAt: Date;
5
6
  priorityId: string | undefined;
@@ -24,6 +25,11 @@ export interface DayCount {
24
25
  total: number;
25
26
  byKey: Record<string, number>;
26
27
  }
28
+ export interface CalendarDay {
29
+ day: string;
30
+ startMs: number;
31
+ endMs: number;
32
+ }
27
33
  export interface RuleCount {
28
34
  ruleName: string;
29
35
  detectionRuleId: string | null;
@@ -53,7 +59,10 @@ export interface SecurityOverviewMetrics {
53
59
  topTactics: Array<TacticCount>;
54
60
  }
55
61
  export declare function utcDay(date: Date): string;
56
- export declare function daysBetween(start: Date, end: Date): Array<string>;
62
+ export declare function dayInTimezone(date: Date, timezone?: Timezone | undefined): string;
63
+ export declare function calendarDaysBetween(start: Date, end: Date, timezone?: Timezone | undefined): Array<CalendarDay>;
64
+ export declare function daysBetween(start: Date, end: Date, timezone?: Timezone | undefined): Array<string>;
65
+ export declare function findCalendarDay(days: ReadonlyArray<CalendarDay>, date: Date): CalendarDay | undefined;
57
66
  export declare function computeSecurityOverviewMetrics(data: {
58
67
  priorities: ReadonlyArray<unknown>;
59
68
  statuses: ReadonlyArray<unknown>;
@@ -64,5 +73,6 @@ export declare function computeSecurityOverviewMetrics(data: {
64
73
  detectionWindowStart: Date;
65
74
  now: Date;
66
75
  topLimit?: number | undefined;
76
+ timezone?: Timezone | undefined;
67
77
  }): SecurityOverviewMetrics;
68
78
  export declare function formatDurationInMinutes(minutes: number | null): string;
@@ -1,5 +1,6 @@
1
1
  import SecurityCaseVerdict from "../../Types/SecurityCase/SecurityCaseVerdict";
2
2
  import SecurityDetectionSource from "../../Types/SecurityCase/SecurityDetectionSource";
3
+ import Timezone from "../../Types/Timezone";
3
4
  export interface OverviewCaseRow {
4
5
  createdAt: Date;
5
6
  priorityId: string | undefined;
@@ -24,6 +25,11 @@ export interface DayCount {
24
25
  total: number;
25
26
  byKey: Record<string, number>;
26
27
  }
28
+ export interface CalendarDay {
29
+ day: string;
30
+ startMs: number;
31
+ endMs: number;
32
+ }
27
33
  export interface RuleCount {
28
34
  ruleName: string;
29
35
  detectionRuleId: string | null;
@@ -53,7 +59,10 @@ export interface SecurityOverviewMetrics {
53
59
  topTactics: Array<TacticCount>;
54
60
  }
55
61
  export declare function utcDay(date: Date): string;
56
- export declare function daysBetween(start: Date, end: Date): Array<string>;
62
+ export declare function dayInTimezone(date: Date, timezone?: Timezone | undefined): string;
63
+ export declare function calendarDaysBetween(start: Date, end: Date, timezone?: Timezone | undefined): Array<CalendarDay>;
64
+ export declare function daysBetween(start: Date, end: Date, timezone?: Timezone | undefined): Array<string>;
65
+ export declare function findCalendarDay(days: ReadonlyArray<CalendarDay>, date: Date): CalendarDay | undefined;
57
66
  export declare function computeSecurityOverviewMetrics(data: {
58
67
  priorities: ReadonlyArray<unknown>;
59
68
  statuses: ReadonlyArray<unknown>;
@@ -64,5 +73,6 @@ export declare function computeSecurityOverviewMetrics(data: {
64
73
  detectionWindowStart: Date;
65
74
  now: Date;
66
75
  topLimit?: number | undefined;
76
+ timezone?: Timezone | undefined;
67
77
  }): SecurityOverviewMetrics;
68
78
  export declare function formatDurationInMinutes(minutes: number | null): string;