@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,231 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = exports.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = exports.VerifiedFixRunbookRefusal = void 0;
7
+ exports.getSucceededCommands = getSucceededCommands;
8
+ exports.getSucceededMcpCalls = getSucceededMcpCalls;
9
+ exports.getVerifiedFixRunbookRefusal = getVerifiedFixRunbookRefusal;
10
+ exports.toRunbookSteps = toRunbookSteps;
11
+ exports.buildVerifiedFixRunbook = buildVerifiedFixRunbook;
12
+ exports.getUniqueRunbookName = getUniqueRunbookName;
13
+ const AiRemediationCommandPlan_1 = require("../../Types/AutoRemediation/AiRemediationCommandPlan");
14
+ const AiRemediationCommandPolicyVerdict_1 = require("../../Types/AutoRemediation/AiRemediationCommandPolicyVerdict");
15
+ const AutoRemediationSuggestionType_1 = __importDefault(require("../../Types/AutoRemediation/AutoRemediationSuggestionType"));
16
+ const AutoRemediationVerificationStatus_1 = __importDefault(require("../../Types/AutoRemediation/AutoRemediationVerificationStatus"));
17
+ const ExternalMcpToolCallPlan_1 = require("../../Types/AutoRemediation/ExternalMcpToolCallPlan");
18
+ const ColumnLength_1 = __importDefault(require("../../Types/Database/ColumnLength"));
19
+ const ObjectID_1 = __importDefault(require("../../Types/ObjectID"));
20
+ const RunbookStepType_1 = __importDefault(require("../../Types/Runbook/RunbookStepType"));
21
+ /*
22
+ * A FIX THAT WORKED, WRITTEN DOWN AS A RUNBOOK (issue #6801).
23
+ *
24
+ * OneUptime AI could run a runbook but never write one. When it fixes an
25
+ * incident or an alert itself - commands on a Runner, a change through a
26
+ * cluster's or a resource's AI agent, calls to an MCP server - and the fix
27
+ * is verified (the monitors recovered, or the subject was resolved, within
28
+ * the verification window), what it ran is exactly the procedure the team
29
+ * would want written down. Save as Runbook writes it: a runbook of the
30
+ * steps that ran, in the order they ran, each with why OneUptime AI ran it
31
+ * and how to undo it.
32
+ *
33
+ * - A command on a Runner becomes a Bash step on that Runner, as written,
34
+ * with the same time limit. One the policy made a person approve waits
35
+ * for an approval before it runs in the runbook too.
36
+ * - A change through a cluster's Kubernetes AI agent, through a
37
+ * resource's AI agent (Docker, a host, a cloud account ...) or through
38
+ * an MCP server becomes a manual step that holds the exact command or
39
+ * call: a runbook's own steps cannot reach those agents, and would go
40
+ * around the command policy if they could (as the OpenStack runbook
41
+ * templates do, OpenStackRunbookTemplates). The step says to ask
42
+ * OneUptime AI for the change, or to make it by hand.
43
+ * - A command or call that did not run, or failed, is left out: the
44
+ * runbook is what worked.
45
+ *
46
+ * The runbook starts turned off: OneUptime AI never picks it, no rule runs
47
+ * it, and nobody can start it until a person has read its steps and turned
48
+ * it on (RunbookService, RunbookStarter). Pure: the server builds the
49
+ * runbook with it, and the tests pin it.
50
+ */
51
+ // Why a fix cannot be saved as a runbook.
52
+ var VerifiedFixRunbookRefusal;
53
+ (function (VerifiedFixRunbookRefusal) {
54
+ // The fix was not verified: only what worked is written down.
55
+ VerifiedFixRunbookRefusal["NotVerified"] = "NotVerified";
56
+ // The fix ran a runbook already.
57
+ VerifiedFixRunbookRefusal["RanARunbook"] = "RanARunbook";
58
+ // Nothing of the fix ran and succeeded.
59
+ VerifiedFixRunbookRefusal["NothingRan"] = "NothingRan";
60
+ // It was saved as a runbook already.
61
+ VerifiedFixRunbookRefusal["AlreadySaved"] = "AlreadySaved";
62
+ })(VerifiedFixRunbookRefusal || (exports.VerifiedFixRunbookRefusal = VerifiedFixRunbookRefusal = {}));
63
+ exports.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = {
64
+ [VerifiedFixRunbookRefusal.NotVerified]: "Only a fix that worked can be saved as a runbook, and this one has not been verified. Wait for its verification, or write the runbook yourself under Runbooks.",
65
+ [VerifiedFixRunbookRefusal.RanARunbook]: "This fix ran a runbook already, so there is nothing new to save. Open the runbook from the fix to change it.",
66
+ [VerifiedFixRunbookRefusal.NothingRan]: "None of this fix's commands ran and succeeded, so there is nothing to save as a runbook.",
67
+ [VerifiedFixRunbookRefusal.AlreadySaved]: "This fix is saved as a runbook already. Open that runbook from the fix.",
68
+ };
69
+ // The longest step title the runbook editor shows on one line.
70
+ exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = 120;
71
+ function cut(text, maxLength) {
72
+ const line = text.replace(/\s+/g, " ").trim();
73
+ return line.length > maxLength
74
+ ? `${line.slice(0, maxLength - 1).trimEnd()}…`
75
+ : line;
76
+ }
77
+ // The commands of the fix that ran and succeeded, in the order they ran.
78
+ function getSucceededCommands(plan) {
79
+ return ((plan === null || plan === void 0 ? void 0 : plan.commands) || [])
80
+ .filter((command) => {
81
+ var _a;
82
+ return (!(0, AiRemediationCommandPlan_1.isRemovedSshCommand)(command) &&
83
+ ((_a = command.execution) === null || _a === void 0 ? void 0 : _a.status) ===
84
+ AiRemediationCommandPlan_1.AiRemediationCommandExecutionStatus.Succeeded);
85
+ })
86
+ .sort((a, b) => {
87
+ return a.sequence - b.sequence;
88
+ });
89
+ }
90
+ // The MCP calls of the fix that were made and succeeded, in the order they were made.
91
+ function getSucceededMcpCalls(plan) {
92
+ return ((plan === null || plan === void 0 ? void 0 : plan.calls) || [])
93
+ .filter((call) => {
94
+ return call.status === ExternalMcpToolCallPlan_1.ExternalMcpToolCallStatus.Succeeded;
95
+ })
96
+ .sort((a, b) => {
97
+ return a.sequence - b.sequence;
98
+ });
99
+ }
100
+ // Why a fix cannot be saved as a runbook, or null when it can.
101
+ function getVerifiedFixRunbookRefusal(input) {
102
+ if (input.suggestionType === AutoRemediationSuggestionType_1.default.Runbook) {
103
+ return VerifiedFixRunbookRefusal.RanARunbook;
104
+ }
105
+ if (input.savedAsRunbookId) {
106
+ return VerifiedFixRunbookRefusal.AlreadySaved;
107
+ }
108
+ if (input.verificationStatus !== AutoRemediationVerificationStatus_1.default.Verified) {
109
+ return VerifiedFixRunbookRefusal.NotVerified;
110
+ }
111
+ const ranSomething = input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
112
+ ? getSucceededMcpCalls(input.mcpToolCallPlan).length > 0
113
+ : getSucceededCommands(input.commandPlan).length > 0;
114
+ return ranSomething ? null : VerifiedFixRunbookRefusal.NothingRan;
115
+ }
116
+ // "incident #42", or "the incident" when it has no handle.
117
+ function nameSubject(subject) {
118
+ return subject.handle.trim()
119
+ ? `${subject.kind} ${subject.handle.trim()}`
120
+ : `the ${subject.kind}`;
121
+ }
122
+ // What a step says under its title: why it ran, what it did, how to undo it.
123
+ function describeCommand(command, lead) {
124
+ var _a;
125
+ return [
126
+ lead,
127
+ command.rationale.trim() ? `Why: ${command.rationale.trim()}` : null,
128
+ command.expectedEffect.trim()
129
+ ? `What it does: ${command.expectedEffect.trim()}`
130
+ : null,
131
+ ((_a = command.rollbackCommand) === null || _a === void 0 ? void 0 : _a.trim())
132
+ ? `To undo it: ${command.rollbackCommand.trim()}`
133
+ : null,
134
+ ]
135
+ .filter((line) => {
136
+ return Boolean(line);
137
+ })
138
+ .join("\n\n");
139
+ }
140
+ // Where a change through an AI agent ran: "the prod cluster", "web-01".
141
+ function getAgentTarget(command) {
142
+ if (command.stepType === RunbookStepType_1.default.Kubectl) {
143
+ const cluster = (command.kubernetesClusterNameSnapshot || "").trim();
144
+ return cluster ? `the ${cluster} cluster` : "the cluster";
145
+ }
146
+ const resource = (command.resourceNameSnapshot || "").trim();
147
+ const agent = (command.runnerNameSnapshot || "").trim();
148
+ if (resource && agent) {
149
+ return `${resource} (${agent})`;
150
+ }
151
+ return resource || agent || "the resource";
152
+ }
153
+ function toRunbookSteps(input) {
154
+ const steps = [];
155
+ const add = (step) => {
156
+ steps.push(Object.assign({ id: ObjectID_1.default.generate().toString(), order: steps.length + 1 }, step));
157
+ };
158
+ for (const command of input.commands) {
159
+ if (command.stepType === RunbookStepType_1.default.Bash) {
160
+ add({
161
+ type: RunbookStepType_1.default.Bash,
162
+ title: cut(command.command, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
163
+ description: describeCommand(command, null),
164
+ requireApprovalBeforeRunning: command.policyVerdict ===
165
+ AiRemediationCommandPolicyVerdict_1.AiRemediationCommandPolicyVerdict.RequiresApproval,
166
+ config: {
167
+ script: command.command,
168
+ agentId: command.runnerId,
169
+ timeoutInMs: command.timeoutInMs,
170
+ },
171
+ });
172
+ continue;
173
+ }
174
+ const target = getAgentTarget(command);
175
+ add({
176
+ type: RunbookStepType_1.default.Manual,
177
+ title: cut(`On ${target}: ${command.command}`, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
178
+ description: describeCommand(command, `Run this on ${target}: ${command.command}\n\nOneUptime AI made this change through the AI agent there. Ask OneUptime AI to make it again, or make it yourself, then mark this step done.`),
179
+ config: {},
180
+ });
181
+ }
182
+ for (const call of input.mcpCalls) {
183
+ const server = call.serverNameSnapshot.trim() || "the MCP server";
184
+ add({
185
+ type: RunbookStepType_1.default.Manual,
186
+ title: cut(`${call.toolName} on ${server}`, exports.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH),
187
+ description: `Call the tool ${call.toolName} on ${server} with these arguments:\n\n${JSON.stringify(call.arguments, null, 2)}\n\nOneUptime AI made this change through the MCP server. Ask OneUptime AI to make it again, or make it yourself, then mark this step done.`,
188
+ config: {},
189
+ });
190
+ }
191
+ return steps;
192
+ }
193
+ /*
194
+ * The runbook a verified fix is written down as: named for what it fixed,
195
+ * said where it comes from, its steps what ran. Its name may be taken in
196
+ * the project already - the server makes it unique (getUniqueRunbookName).
197
+ */
198
+ function buildVerifiedFixRunbook(input) {
199
+ const steps = toRunbookSteps({
200
+ commands: input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
201
+ ? []
202
+ : getSucceededCommands(input.commandPlan),
203
+ mcpCalls: input.suggestionType === AutoRemediationSuggestionType_1.default.McpToolCalls
204
+ ? getSucceededMcpCalls(input.mcpToolCallPlan)
205
+ : [],
206
+ });
207
+ const subjectTitle = input.subject.title.trim();
208
+ const name = cut(subjectTitle ? `Fix: ${subjectTitle}` : "Verified fix", ColumnLength_1.default.ShortText);
209
+ const description = cut(`Written from the fix OneUptime AI ran for ${nameSubject(input.subject)}${subjectTitle ? ` (${subjectTitle})` : ""}, which was verified when it recovered. Turned off until someone reviews each step and turns it on.`, ColumnLength_1.default.LongText);
210
+ return { name, description, steps };
211
+ }
212
+ /*
213
+ * A name no runbook of the project has yet: the name itself, or with " (2)",
214
+ * " (3)" ... after it, cut so the whole stays within a runbook's name.
215
+ */
216
+ function getUniqueRunbookName(name, takenNames) {
217
+ const taken = new Set(takenNames.map((taken) => {
218
+ return taken.trim().toLowerCase();
219
+ }));
220
+ if (!taken.has(name.trim().toLowerCase())) {
221
+ return name;
222
+ }
223
+ for (let number = 2; number < 1000; number++) {
224
+ const suffix = ` (${number.toString()})`;
225
+ const candidate = `${cut(name, ColumnLength_1.default.ShortText - suffix.length)}${suffix}`;
226
+ if (!taken.has(candidate.toLowerCase())) {
227
+ return candidate;
228
+ }
229
+ }
230
+ return `${cut(name, ColumnLength_1.default.ShortText - 37)} ${ObjectID_1.default.generate().toString()}`;
231
+ }
@@ -0,0 +1,10 @@
1
+ import commonJsModule from "./VerifiedFixRunbook.js";
2
+ export const MAX_VERIFIED_FIX_STEP_TITLE_LENGTH = commonJsModule.MAX_VERIFIED_FIX_STEP_TITLE_LENGTH;
3
+ export const VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES = commonJsModule.VERIFIED_FIX_RUNBOOK_REFUSAL_MESSAGES;
4
+ export const VerifiedFixRunbookRefusal = commonJsModule.VerifiedFixRunbookRefusal;
5
+ export const buildVerifiedFixRunbook = commonJsModule.buildVerifiedFixRunbook;
6
+ export const getSucceededCommands = commonJsModule.getSucceededCommands;
7
+ export const getSucceededMcpCalls = commonJsModule.getSucceededMcpCalls;
8
+ export const getUniqueRunbookName = commonJsModule.getUniqueRunbookName;
9
+ export const getVerifiedFixRunbookRefusal = commonJsModule.getVerifiedFixRunbookRefusal;
10
+ export const toRunbookSteps = commonJsModule.toRunbookSteps;
@@ -661,7 +661,12 @@ const DASHBOARD_WIDGET_SORT_SPECS = {
661
661
  title: "Used / Provisioned",
662
662
  path: "usedBytes",
663
663
  }),
664
- textColumn({ key: "array", title: "Array", path: "storageArray.name" }),
664
+ // The storage array's own key, as the header's (#7522, MeaningKeys).
665
+ textColumn({
666
+ key: "array",
667
+ title: "Array (storage array)",
668
+ path: "storageArray.name",
669
+ }),
665
670
  ],
666
671
  defaultSort: NAME_ASCENDING,
667
672
  thenBy: BY_NAME,
@@ -679,7 +684,11 @@ const DASHBOARD_WIDGET_SORT_SPECS = {
679
684
  path: ["kind", "componentType"],
680
685
  }),
681
686
  storageHardwareStatusColumn(),
682
- textColumn({ key: "array", title: "Array", path: "storageArray.name" }),
687
+ textColumn({
688
+ key: "array",
689
+ title: "Array (storage array)",
690
+ path: "storageArray.name",
691
+ }),
683
692
  ],
684
693
  defaultSort: NAME_ASCENDING,
685
694
  thenBy: BY_NAME,
@@ -1,4 +1,5 @@
1
1
  import Color from "../../Types/Color.mjs";
2
+ import ObjectID from "../../Types/ObjectID.mjs";
2
3
  import { MonitoringOffFlags } from "../Monitor/MonitoringOff.mjs";
3
4
  export declare const MONITOR_LIST_STATUS_FILTER_OPERATIONAL: string;
4
5
  export declare const MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL: string;
@@ -10,7 +11,7 @@ export interface MonitorListFilter {
10
11
  statusFilter?: string | undefined | null;
11
12
  monitorStatusIds?: Array<string> | undefined | null;
12
13
  }
13
- export type GetMonitorListQueryFunction = (filter: MonitorListFilter) => Record<string, unknown>;
14
+ export type GetMonitorListQueryFunction = (filter: MonitorListFilter, projectId?: ObjectID | string | null | undefined) => Record<string, unknown>;
14
15
  export declare const getMonitorListQuery: GetMonitorListQueryFunction;
15
16
  export interface MonitorListRowData extends MonitoringOffFlags {
16
17
  currentMonitorStatus?: {
@@ -1,4 +1,5 @@
1
1
  import Color from "../../Types/Color";
2
+ import ObjectID from "../../Types/ObjectID";
2
3
  import { MonitoringOffFlags } from "../Monitor/MonitoringOff";
3
4
  export declare const MONITOR_LIST_STATUS_FILTER_OPERATIONAL: string;
4
5
  export declare const MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL: string;
@@ -10,7 +11,7 @@ export interface MonitorListFilter {
10
11
  statusFilter?: string | undefined | null;
11
12
  monitorStatusIds?: Array<string> | undefined | null;
12
13
  }
13
- export type GetMonitorListQueryFunction = (filter: MonitorListFilter) => Record<string, unknown>;
14
+ export type GetMonitorListQueryFunction = (filter: MonitorListFilter, projectId?: ObjectID | string | null | undefined) => Record<string, unknown>;
14
15
  export declare const getMonitorListQuery: GetMonitorListQueryFunction;
15
16
  export interface MonitorListRowData extends MonitoringOffFlags {
16
17
  currentMonitorStatus?: {
@@ -16,7 +16,9 @@ const NotOperationalMonitorQuery_1 = __importDefault(require("../Monitor/NotOper
16
16
  * The widget in the browser and the public-dashboard policy on the server
17
17
  * (Server/Utils/Dashboard/PublicDashboardResourceListPolicy) both build their
18
18
  * query from getMonitorListQuery, so a board and its public page cannot list
19
- * different monitors. React-free and server-safe.
19
+ * different monitors. The board passes its project as well, which names the
20
+ * same monitors and reads them differently (getMonitorListQuery). React-free
21
+ * and server-safe.
20
22
  *
21
23
  * A monitor whose monitoring is turned off is not checked, so its status is
22
24
  * frozen at what its last check saw (Utils/Monitor/MonitoringOff). The list
@@ -38,10 +40,10 @@ exports.MONITOR_LIST_MONITORING_OFF_STATUS_LABEL = (0, Translator_1.translationK
38
40
  exports.MONITOR_LIST_MONITORING_OFF_STATUS_COLOR = BrandColors_1.Gray500;
39
41
  // The same word the row has always drawn for a monitor read with no status.
40
42
  exports.MONITOR_LIST_NO_STATUS_LABEL = "Unknown";
41
- const getMonitorListQuery = (filter) => {
43
+ const getMonitorListQuery = (filter, projectId) => {
42
44
  const query = { isArchived: false };
43
45
  if (filter.statusFilter === exports.MONITOR_LIST_STATUS_FILTER_NON_OPERATIONAL) {
44
- Object.assign(query, NotOperationalMonitorQuery_1.default.getQuery());
46
+ Object.assign(query, NotOperationalMonitorQuery_1.default.getQuery(projectId));
45
47
  }
46
48
  else if (filter.statusFilter === exports.MONITOR_LIST_STATUS_FILTER_OPERATIONAL) {
47
49
  Object.assign(query, MonitoringOff_1.default.getMonitoredQuery(), {
@@ -0,0 +1,6 @@
1
+ import { TemplateValue, TermOptions, Translator } from "../Types/Translator.mjs";
2
+ export declare const getDefaultRecordNames: (tableName: string | null | undefined) => ReadonlyArray<string>;
3
+ export declare const isDefaultRecordName: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
4
+ export declare const isRecordNameAsWritten: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
5
+ export declare const translateRecordName: (translator: Translator, tableName: string | null | undefined, name: string | null | undefined) => string;
6
+ export declare const recordNameInSentence: (tableName: string | null | undefined, name: string | null | undefined, options?: TermOptions) => TemplateValue;
@@ -0,0 +1,6 @@
1
+ import { TemplateValue, TermOptions, Translator } from "../Types/Translator";
2
+ export declare const getDefaultRecordNames: (tableName: string | null | undefined) => ReadonlyArray<string>;
3
+ export declare const isDefaultRecordName: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
4
+ export declare const isRecordNameAsWritten: (tableName: string | null | undefined, name: string | null | undefined) => boolean;
5
+ export declare const translateRecordName: (translator: Translator, tableName: string | null | undefined, name: string | null | undefined) => string;
6
+ export declare const recordNameInSentence: (tableName: string | null | undefined, name: string | null | undefined, options?: TermOptions) => TemplateValue;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recordNameInSentence = exports.translateRecordName = exports.isRecordNameAsWritten = exports.isDefaultRecordName = exports.getDefaultRecordNames = void 0;
4
+ const DefaultStatusNames_1 = require("../Types/StatusPage/DefaultStatusNames");
5
+ const Translator_1 = require("../Types/Translator");
6
+ const StateListType_1 = require("./StateListType");
7
+ /*
8
+ * A RECORD'S NAME, AS ITS READER READS IT - ONE RULE, WHEREVER IT IS DRAWN.
9
+ *
10
+ * A record's name is its owner's: a label, a monitor, a probe, a template,
11
+ * a state or a severity a project made. It is drawn as written in every
12
+ * language - a label named "Network" is "Network" on a Spanish page, never
13
+ * "Red" - in a badge (Pill, StatusBubble), in a picker's options and in a
14
+ * filter's menu and chip (DropdownOption.isUserContent), as a line of text
15
+ * (translateRecordName) and in a sentence (recordNameInSentence).
16
+ *
17
+ * The records a new project starts with that OneUptime names itself
18
+ * (ProjectService) are the exception: its states, severities, monitor
19
+ * statuses, postmortem statuses and security case priorities and statuses,
20
+ * the lists a project orders (StateListType, whose values are the tables'
21
+ * names). Their default names are OneUptime's words, read in the reader's
22
+ * language - "Resolved" is "Resuelto" - for as long as a record keeps one.
23
+ * A name the project gave a record of its own, or gave a default one in its
24
+ * place, is the project's and reads as written: a state named "Open" stays
25
+ * "Open", never the verb "Abrir", and a severity renamed "Critical" stays
26
+ * "Critical", never "Kritisch".
27
+ *
28
+ * A name is a default by its record's table and by the whole name, as
29
+ * written: an alert severity named "High" is OneUptime's word, a monitor
30
+ * status named "High" the project's, and "Critical incident" is a severity
31
+ * the project renamed. Nothing a record carries says whether OneUptime or
32
+ * the project made it (a severity has no built-in flag, both get the same
33
+ * kind of slug, and a badge is handed a name and a colour), so a project's
34
+ * own record named exactly as a default of its list reads as that default
35
+ * does - the same word the status page and the notifications use for it.
36
+ * A status page (StatusPage/src/Utils/StatusTranslation), an on-call page
37
+ * (OnCallDutyPolicy/OnCallPageWords) and a status page's notifications
38
+ * (Server/Utils/StatusPage/SubscriberMessageText) decide by this rule too,
39
+ * each handed its record's list (#8066).
40
+ */
41
+ /*
42
+ * Every list a project orders has the names it starts with. Only names:
43
+ * every form loads this, so it loads none of the lists' own modules
44
+ * (StateOrder, PostmortemStatus, SecurityCaseStatuses and _Priorities).
45
+ */
46
+ const DEFAULT_NAMES_BY_TABLE = {
47
+ [StateListType_1.StateListType.IncidentState]: DefaultStatusNames_1.DEFAULT_INCIDENT_STATE_NAMES,
48
+ [StateListType_1.StateListType.AlertState]: DefaultStatusNames_1.DEFAULT_ALERT_STATE_NAMES,
49
+ [StateListType_1.StateListType.ScheduledMaintenanceState]: DefaultStatusNames_1.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES,
50
+ [StateListType_1.StateListType.MonitorStatus]: DefaultStatusNames_1.DEFAULT_MONITOR_STATUS_NAMES,
51
+ [StateListType_1.StateListType.IncidentSeverity]: DefaultStatusNames_1.DEFAULT_INCIDENT_SEVERITY_NAMES,
52
+ [StateListType_1.StateListType.AlertSeverity]: DefaultStatusNames_1.DEFAULT_ALERT_SEVERITY_NAMES,
53
+ [StateListType_1.StateListType.IncidentPostmortemStatus]: DefaultStatusNames_1.DEFAULT_POSTMORTEM_STATUS_NAMES,
54
+ [StateListType_1.StateListType.SecurityCaseStatus]: DefaultStatusNames_1.DEFAULT_SECURITY_CASE_STATUS_NAMES,
55
+ [StateListType_1.StateListType.SecurityCasePriority]: DefaultStatusNames_1.DEFAULT_SECURITY_CASE_PRIORITY_NAMES,
56
+ };
57
+ /*
58
+ * The names OneUptime gives the records of a table: a StateListType, or a
59
+ * record's own tableName. None for any other table - a label's, a
60
+ * monitor's, a team's - whose names are all their owners'.
61
+ */
62
+ const getDefaultRecordNames = (tableName) => {
63
+ if (!tableName ||
64
+ !Object.prototype.hasOwnProperty.call(DEFAULT_NAMES_BY_TABLE, tableName)) {
65
+ return [];
66
+ }
67
+ return DEFAULT_NAMES_BY_TABLE[tableName];
68
+ };
69
+ exports.getDefaultRecordNames = getDefaultRecordNames;
70
+ // Whether `name` is one of OneUptime's default names for its table's records.
71
+ const isDefaultRecordName = (tableName, name) => {
72
+ return (typeof name === "string" &&
73
+ (0, exports.getDefaultRecordNames)(tableName).includes(name.trim()));
74
+ };
75
+ exports.isDefaultRecordName = isDefaultRecordName;
76
+ /*
77
+ * Whether a record's name is drawn as written, never looked up: a Pill's
78
+ * or a StatusBubble's isUserContent, a DropdownOption's. True for a name its
79
+ * owner gave; false for one of OneUptime's default names, and for no name
80
+ * at all - a badge's "Unknown" in its place is the product's word.
81
+ */
82
+ const isRecordNameAsWritten = (tableName, name) => {
83
+ return (typeof name === "string" &&
84
+ name.trim().length > 0 &&
85
+ !(0, exports.isDefaultRecordName)(tableName, name));
86
+ };
87
+ exports.isRecordNameAsWritten = isRecordNameAsWritten;
88
+ /*
89
+ * A record's name in `translator`'s reader's words, for where it is drawn
90
+ * as text: a default name in their language, any other name as written.
91
+ */
92
+ const translateRecordName = (translator, tableName, name) => {
93
+ if (!name) {
94
+ return "";
95
+ }
96
+ if (!(0, exports.isDefaultRecordName)(tableName, name)) {
97
+ return name;
98
+ }
99
+ return translator.translateText(name.trim()) || name;
100
+ };
101
+ exports.translateRecordName = translateRecordName;
102
+ /*
103
+ * A record's name as a value of a sentence - "{{stateName}} in", "Mark as
104
+ * {{state}}", "Incident · {{severity}}" - by the same rule. One of
105
+ * OneUptime's default names of its table goes in as a term, translated
106
+ * with the sentence and only then (Types/Translator): a sentence the
107
+ * reader's language words reads "Marcar como Resuelto", one it does not
108
+ * yet reads "Mark as Resolved" whole, and `inSentence` cases the name for
109
+ * the middle of one ("Not yet resolved"). Any other name goes in as
110
+ * written, never looked up: a state a project named "Open" reads "Marcar
111
+ * como Open", never the verb "Abrir", in any language and in any case.
112
+ */
113
+ const recordNameInSentence = (tableName, name, options) => {
114
+ if (!name) {
115
+ return "";
116
+ }
117
+ if (!(0, exports.isDefaultRecordName)(tableName, name)) {
118
+ return name;
119
+ }
120
+ return (0, Translator_1.translatableTerm)(name.trim(), options);
121
+ };
122
+ exports.recordNameInSentence = recordNameInSentence;
@@ -0,0 +1,6 @@
1
+ import commonJsModule from "./DefaultRecordNames.js";
2
+ export const getDefaultRecordNames = commonJsModule.getDefaultRecordNames;
3
+ export const isDefaultRecordName = commonJsModule.isDefaultRecordName;
4
+ export const isRecordNameAsWritten = commonJsModule.isRecordNameAsWritten;
5
+ export const recordNameInSentence = commonJsModule.recordNameInSentence;
6
+ export const translateRecordName = commonJsModule.translateRecordName;
@@ -15,6 +15,7 @@ const BadDataException_1 = __importDefault(require("../../Types/Exception/BadDat
15
15
  const LinearRegExp_1 = __importDefault(require("../LinearRegExp/LinearRegExp"));
16
16
  const PatternProblem_1 = require("../LinearRegExp/PatternProblem");
17
17
  const PatternWork_1 = require("../LinearRegExp/PatternWork");
18
+ const LookupTable_1 = require("../LookupTable");
18
19
  const GrokPatterns_1 = __importDefault(require("./GrokPatterns"));
19
20
  /*
20
21
  * Grok engine.
@@ -125,7 +126,8 @@ function resolveReference(match, context) {
125
126
  if (context.expansions > exports.MAX_GROK_EXPANSIONS) {
126
127
  throw new BadDataException_1.default(`This grok pattern expands to more than ${exports.MAX_GROK_EXPANSIONS} sub-patterns. Please simplify it.`);
127
128
  }
128
- const definition = context.patterns[patternName];
129
+ // A library's own names only: %{constructor} names no pattern.
130
+ const definition = (0, LookupTable_1.readOwnValue)(context.patterns, patternName);
129
131
  if (definition === undefined) {
130
132
  throw new BadDataException_1.default(`Unknown grok pattern "%{${patternName}}". Check the list of supported patterns.`);
131
133
  }
@@ -311,12 +313,13 @@ function matchGrokPattern(compiled, input) {
311
313
  * The same field name can legitimately appear twice (alternation
312
314
  * branches, or a library pattern that already names it). Whichever
313
315
  * group actually matched first wins, so a later branch that did not
314
- * participate cannot blank out a real value.
316
+ * participate cannot blank out a real value. Own fields only, and
317
+ * written as own: a field may be named constructor or __proto__.
315
318
  */
316
- if (extracted[capture.fieldName] !== undefined) {
319
+ if (Object.prototype.hasOwnProperty.call(extracted, capture.fieldName)) {
317
320
  continue;
318
321
  }
319
- extracted[capture.fieldName] = coerceValue(raw, capture.fieldType);
322
+ (0, LookupTable_1.writeOwnValue)(extracted, capture.fieldName, coerceValue(raw, capture.fieldType));
320
323
  }
321
324
  return extracted;
322
325
  }
@@ -0,0 +1,20 @@
1
+ export declare enum ActionItemCodeTaskKind {
2
+ PullRequest = "PullRequest",
3
+ Test = "Test"
4
+ }
5
+ export declare const ALL_ACTION_ITEM_CODE_TASK_KINDS: ReadonlyArray<ActionItemCodeTaskKind>;
6
+ export declare const MAX_ACTION_ITEM_REQUEST_LENGTH: number;
7
+ export declare const MAX_ACTION_ITEM_DESCRIPTION_IN_REQUEST: number;
8
+ export declare const MAX_ACTION_ITEM_INSTRUCTIONS_LENGTH: number;
9
+ export declare const MAX_POSTMORTEM_IN_CONTEXT: number;
10
+ export interface ActionItemCodeTaskRequestInput {
11
+ kind: ActionItemCodeTaskKind;
12
+ title: string;
13
+ description?: string | null | undefined;
14
+ incidentNumber?: string | null | undefined;
15
+ incidentTitle?: string | null | undefined;
16
+ instructions?: string | null | undefined;
17
+ }
18
+ export declare function parseActionItemCodeTaskKind(value: unknown): ActionItemCodeTaskKind | null;
19
+ export declare function buildActionItemCodeTaskRequest(input: ActionItemCodeTaskRequestInput): string;
20
+ export declare function getPostmortemContextNote(postmortemNote: string | null | undefined): string | null;
@@ -0,0 +1,20 @@
1
+ export declare enum ActionItemCodeTaskKind {
2
+ PullRequest = "PullRequest",
3
+ Test = "Test"
4
+ }
5
+ export declare const ALL_ACTION_ITEM_CODE_TASK_KINDS: ReadonlyArray<ActionItemCodeTaskKind>;
6
+ export declare const MAX_ACTION_ITEM_REQUEST_LENGTH: number;
7
+ export declare const MAX_ACTION_ITEM_DESCRIPTION_IN_REQUEST: number;
8
+ export declare const MAX_ACTION_ITEM_INSTRUCTIONS_LENGTH: number;
9
+ export declare const MAX_POSTMORTEM_IN_CONTEXT: number;
10
+ export interface ActionItemCodeTaskRequestInput {
11
+ kind: ActionItemCodeTaskKind;
12
+ title: string;
13
+ description?: string | null | undefined;
14
+ incidentNumber?: string | null | undefined;
15
+ incidentTitle?: string | null | undefined;
16
+ instructions?: string | null | undefined;
17
+ }
18
+ export declare function parseActionItemCodeTaskKind(value: unknown): ActionItemCodeTaskKind | null;
19
+ export declare function buildActionItemCodeTaskRequest(input: ActionItemCodeTaskRequestInput): string;
20
+ export declare function getPostmortemContextNote(postmortemNote: string | null | undefined): string | null;