@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
@@ -48,9 +48,15 @@
48
48
  * hold is read once; a "&" or a "]" costs nothing; and a run of an
49
49
  * email address's characters before an "@" costs the run times itself
50
50
  * and the domain after it.
51
+ * - for marked, each line of a list item it reads as a line of text: a
52
+ * look through half of the item (HOW MARKED READS A LIST ITEM, #7598).
53
+ * marked reads an item's text a line at a time, and looks through the
54
+ * rest of the item from each for a setext heading's underline: one
55
+ * item of 6,000 lines took it 4.4 s.
51
56
  * - its lines: a run may have limits.maxRunLines, and all the runs and
52
57
  * fenced code read as Markdown limits.maxLines together (the dashboard
53
- * and Slack only: marked reads lines in linear time).
58
+ * and Slack only: marked reads paragraphs, quotes and lists of short
59
+ * items in linear time).
54
60
  * - its longest paragraph, list item or heading, in lines
55
61
  * (limits.maxUnitLines) and in characters (limits.maxUnitLength):
56
62
  * Slack only - slackify reads a long list in good time, but not one
@@ -85,7 +91,7 @@
85
91
  * the text: the dashboard and the server both use it.
86
92
  */
87
93
  Object.defineProperty(exports, "__esModule", { value: true });
88
- exports.measureSlowMarkdownCodeBlocks = exports.measureSlowMarkdownRuns = exports.holdBackSlowMarkdown = exports.getMarkedLineWork = exports.getMarkedDefinitionAddressStart = exports.getMarkedLinkEnd = exports.MARKED_TAIL_READING_SHARE = exports.MAX_MARKED_LABEL_LENGTH = exports.MARKED_MASKED_ITEM_SHARE = exports.getWordPunctuationWork = exports.getInlineCharacterCount = exports.SLOW_MARKDOWN_MAX_NESTING_DEPTH = exports.SLOW_MARKDOWN_MAX_INLINE_WORK = exports.SLOW_MARKDOWN_MIN_LENGTH = void 0;
94
+ exports.measureSlowMarkdownCodeBlocks = exports.measureSlowMarkdownRuns = exports.holdBackSlowMarkdown = exports.MARKED_LIST_LINE_SHARE = exports.getMarkedLineWork = exports.getMarkedDefinitionAddressStart = exports.getMarkedLinkEnd = exports.MARKED_TAIL_READING_SHARE = exports.MAX_MARKED_LABEL_LENGTH = exports.MARKED_MASKED_ITEM_SHARE = exports.getWordPunctuationWork = exports.getInlineCharacterCount = exports.SLOW_MARKDOWN_MAX_NESTING_DEPTH = exports.SLOW_MARKDOWN_MAX_INLINE_WORK = exports.SLOW_MARKDOWN_MIN_LENGTH = void 0;
89
95
  const RegExpCharacterClasses_1 = require("../RegExpCharacterClasses");
90
96
  /*
91
97
  * Markdown of at most this many characters is given to a parser as it is:
@@ -1173,6 +1179,315 @@ const readLineStart = (text, start, end) => {
1173
1179
  isFirstOrdered: isFirstOrdered,
1174
1180
  };
1175
1181
  };
1182
+ /*
1183
+ * HOW MARKED READS A LIST ITEM (counting.countAsMarked: the emails, #7598).
1184
+ *
1185
+ * marked reads a list item's text with blockTokens(text, top = false), and
1186
+ * there it reads no paragraph whole: each line is a block of its own, and
1187
+ * before each it tries its rule for a setext heading, whose lazy loop reads
1188
+ * on through the lines after it - to the next blank line, or a line that
1189
+ * starts a block - for an underline. So an item of N lines of text costs
1190
+ * marked N looks through the rest of it: 6,000 lines of "aaa bbb" took it
1191
+ * 4.4 s where V8 compiles regular expressions unoptimized, four such items
1192
+ * 16 s, and a loose item's paragraphs as much, each after its blank line.
1193
+ * A paragraph or a block quote of the same lines it reads whole, in 10 ms,
1194
+ * and a list of as many one-line items in 22 ms.
1195
+ *
1196
+ * So each line of a list item that marked reads as a line of text costs a
1197
+ * look through half of the item's lines in its run, the rest of them on
1198
+ * average (MARKED_LIST_LINE_SHARE): measured, such looks cost marked 10 to
1199
+ * 28 ns a character, where a character it looks ahead from is counted at
1200
+ * 39. Its first line, lazy lines and indented ones alike, in a quote or in
1201
+ * another item too, and the lines of a loose item's later paragraphs -
1202
+ * indented at least as far as its text can start (MarkedListContext), each
1203
+ * paragraph a run of its own. An item starts at every line with a list
1204
+ * marker no more than three columns in, whatever the run's units: marked
1205
+ * reads "10) a" at a run's start as a list, and an empty "-" with the
1206
+ * lines after it. A line marked reads whole costs nothing more: one that
1207
+ * starts a quote (">") or a heading ("#"), and fenced code where the item's
1208
+ * text is known to start - one space after its one marker, no tab, and no
1209
+ * line of it read before that column or with a list marker of its own, so
1210
+ * no other item can hold the fence. A line this cannot place for sure is a
1211
+ * line of text: the measure only ever counts more than marked reads.
1212
+ */
1213
+ /*
1214
+ * What a line of text in a list item costs marked, as a share of a
1215
+ * character it looks ahead from: a look through the rest of the item, half
1216
+ * of it on average.
1217
+ */
1218
+ exports.MARKED_LIST_LINE_SHARE = 2;
1219
+ // Adds what `item`'s lines read since it was last added cost marked.
1220
+ const flushMarkedListItem = (item, costs) => {
1221
+ if (item) {
1222
+ costs.work += Math.ceil((item.lines * item.length) / exports.MARKED_LIST_LINE_SHARE);
1223
+ item.lines = 0;
1224
+ item.length = 0;
1225
+ }
1226
+ };
1227
+ /*
1228
+ * Reads up to `quoteMarkers` quote markers at the start of the line
1229
+ * text[start, end) - each up to three spaces, a ">" and a space or tab
1230
+ * after it - and the white space after them. Infinity reads as many as
1231
+ * there are.
1232
+ */
1233
+ const readMarkedIndentation = (text, start, end, quoteMarkers) => {
1234
+ let index = start;
1235
+ let markers = 0;
1236
+ let hasTab = false;
1237
+ while (markers < quoteMarkers) {
1238
+ let at = index;
1239
+ while (at < end && at - index < 3 && text.charCodeAt(at) === SPACE) {
1240
+ at++;
1241
+ }
1242
+ if (at >= end || text.charCodeAt(at) !== GREATER_THAN) {
1243
+ break;
1244
+ }
1245
+ at++;
1246
+ if (at < end && isSpaceOrTab(text.charCodeAt(at))) {
1247
+ hasTab = hasTab || text.charCodeAt(at) === TAB;
1248
+ at++;
1249
+ }
1250
+ index = at;
1251
+ markers++;
1252
+ }
1253
+ const textStart = index;
1254
+ while (index < end && isSpaceOrTab(text.charCodeAt(index))) {
1255
+ hasTab = hasTab || text.charCodeAt(index) === TAB;
1256
+ index++;
1257
+ }
1258
+ return {
1259
+ index: index,
1260
+ quoteMarkers: markers,
1261
+ columns: index - textStart,
1262
+ hasTab: hasTab,
1263
+ };
1264
+ };
1265
+ /*
1266
+ * The length of the list marker text[index] starts - "-", "*" or "+", or
1267
+ * one to nine digits and "." or ")" - followed by a space, a tab or the
1268
+ * line's end; 0 when it starts none.
1269
+ */
1270
+ const getListMarkerLength = (text, index, end) => {
1271
+ const code = text.charCodeAt(index);
1272
+ let markerEnd = index;
1273
+ if (code === 0x2d || code === ASTERISK || code === 0x2b) {
1274
+ markerEnd = index + 1;
1275
+ }
1276
+ else {
1277
+ while (markerEnd < end &&
1278
+ markerEnd - index < 9 &&
1279
+ isDigit(text.charCodeAt(markerEnd))) {
1280
+ markerEnd++;
1281
+ }
1282
+ const delimiter = text.charCodeAt(markerEnd);
1283
+ if (markerEnd === index ||
1284
+ markerEnd >= end ||
1285
+ (delimiter !== 0x2e && delimiter !== 0x29)) {
1286
+ return 0;
1287
+ }
1288
+ markerEnd++;
1289
+ }
1290
+ return markerEnd >= end || isSpaceOrTab(text.charCodeAt(markerEnd))
1291
+ ? markerEnd - index
1292
+ : 0;
1293
+ };
1294
+ /*
1295
+ * Whether text[index, end) closes `fence` as marked closes one, from where
1296
+ * a line's text starts: at least as many of its character, then backticks
1297
+ * and tildes, then spaces to the line's end.
1298
+ */
1299
+ const isMarkedFenceClosing = (text, index, end, fence) => {
1300
+ let at = index;
1301
+ while (at < end && text.charCodeAt(at) === fence.character) {
1302
+ at++;
1303
+ }
1304
+ if (at - index < fence.length) {
1305
+ return false;
1306
+ }
1307
+ while (at < end &&
1308
+ (text.charCodeAt(at) === BACKTICK || text.charCodeAt(at) === TILDE)) {
1309
+ at++;
1310
+ }
1311
+ while (at < end && text.charCodeAt(at) === SPACE) {
1312
+ at++;
1313
+ }
1314
+ return at >= end;
1315
+ };
1316
+ /*
1317
+ * Whether a line of a list item whose text starts with `code` can start a
1318
+ * block that runs on over the lines after it, a fence's among them: HTML
1319
+ * ("<") or a link reference definition whose title runs on ("["). marked
1320
+ * may then read a fence there as part of it - and where its fences are is
1321
+ * no longer known.
1322
+ */
1323
+ const mayHoldAFence = (code) => {
1324
+ return code === LESS_THAN || code === OPEN_BRACKET;
1325
+ };
1326
+ /*
1327
+ * Reads the first line of a list item, text[start, end), for marked: the
1328
+ * item it starts, the least column a line must start at to go on with it
1329
+ * past a blank line, and whether marked reads the line as a line of text.
1330
+ */
1331
+ const readMarkedListItemStart = (text, start, end) => {
1332
+ const before = readMarkedIndentation(text, start, end, Number.POSITIVE_INFINITY);
1333
+ const markerLength = getListMarkerLength(text, before.index, end);
1334
+ const leastColumn = before.columns + markerLength + 1;
1335
+ let index = before.index + markerLength;
1336
+ let spaces = 0;
1337
+ let isPlaced = !before.hasTab && markerLength > 0;
1338
+ while (index < end && isSpaceOrTab(text.charCodeAt(index))) {
1339
+ isPlaced = isPlaced && text.charCodeAt(index) === SPACE;
1340
+ spaces++;
1341
+ index++;
1342
+ }
1343
+ /*
1344
+ * Its text starts one space after its marker, and opens no list of its
1345
+ * own: else - an empty item too - where marked reads its other lines is
1346
+ * not worked out here.
1347
+ */
1348
+ isPlaced =
1349
+ isPlaced &&
1350
+ spaces === 1 &&
1351
+ index < end &&
1352
+ getListMarkerLength(text, index, end) === 0;
1353
+ const item = {
1354
+ quoteMarkers: before.quoteMarkers,
1355
+ textColumn: isPlaced ? leastColumn : null,
1356
+ fence: null,
1357
+ lines: 0,
1358
+ length: 0,
1359
+ };
1360
+ if (index >= end) {
1361
+ return { item: item, leastColumn: leastColumn, isText: false };
1362
+ }
1363
+ const code = text.charCodeAt(index);
1364
+ if (mayHoldAFence(code)) {
1365
+ item.textColumn = null;
1366
+ }
1367
+ if (code === GREATER_THAN || code === NUMBER_SIGN) {
1368
+ return { item: item, leastColumn: leastColumn, isText: false };
1369
+ }
1370
+ if (item.textColumn !== null) {
1371
+ item.fence = getFenceOpening(text, index, end);
1372
+ }
1373
+ return {
1374
+ item: item,
1375
+ leastColumn: leastColumn,
1376
+ isText: item.fence === null,
1377
+ };
1378
+ };
1379
+ /*
1380
+ * Reads a line of a list item after its first, text[start, end), for
1381
+ * marked, and returns whether marked reads it as a line of text - one it
1382
+ * looks through the rest of the item from. A line that starts a quote or a
1383
+ * heading it reads whole, and so the lines of fenced code where the item's
1384
+ * text is known to start: from its opening fence to the line that closes
1385
+ * it as marked closes it, up to three columns past the item's text column
1386
+ * - or to a line read before that column, which may end the item, and so
1387
+ * the code. From a line this cannot place on, no line of the item is
1388
+ * fenced code.
1389
+ */
1390
+ const readMarkedListItemLine = (text, start, end, item) => {
1391
+ const line = readMarkedIndentation(text, start, end, item.quoteMarkers);
1392
+ if (line.index >= end) {
1393
+ // White space alone - in a quote, a line of ">": no text.
1394
+ return false;
1395
+ }
1396
+ const code = text.charCodeAt(line.index);
1397
+ if (item.textColumn !== null &&
1398
+ (line.hasTab ||
1399
+ line.quoteMarkers !== item.quoteMarkers ||
1400
+ line.columns < item.textColumn ||
1401
+ getListMarkerLength(text, line.index, end) > 0 ||
1402
+ (item.fence === null && mayHoldAFence(code)))) {
1403
+ /*
1404
+ * A line marked may read in another item, another block, or past where
1405
+ * this one ended: no fence of this item is placed for sure from here on.
1406
+ */
1407
+ item.textColumn = null;
1408
+ item.fence = null;
1409
+ }
1410
+ if (item.fence !== null) {
1411
+ if (line.columns <= item.textColumn + 3 &&
1412
+ isMarkedFenceClosing(text, line.index, end, item.fence)) {
1413
+ item.fence = null;
1414
+ }
1415
+ return false;
1416
+ }
1417
+ if (code === GREATER_THAN || code === NUMBER_SIGN) {
1418
+ return false;
1419
+ }
1420
+ if (item.textColumn !== null && line.columns <= item.textColumn + 3) {
1421
+ item.fence = getFenceOpening(text, line.index, end);
1422
+ if (item.fence !== null) {
1423
+ return false;
1424
+ }
1425
+ }
1426
+ return true;
1427
+ };
1428
+ /*
1429
+ * Reads a line of a run for marked's list items (HOW MARKED READS A LIST
1430
+ * ITEM), adding to `costs` what an item's lines cost marked as each item's
1431
+ * lines in the run end, and returns the list context the next line is in:
1432
+ *
1433
+ * - a line with a list marker no more than three columns in starts an
1434
+ * item, in the items its context holds when it is in as many quotes;
1435
+ * - a heading's line goes on in the item it is indented as far as, with
1436
+ * where the item's text starts no longer known - else it ends the list;
1437
+ * - any other line goes on with the item, and the first line of a run -
1438
+ * past a blank line - only when it is indented as far as an item's
1439
+ * text can start: else the list has ended.
1440
+ */
1441
+ const readMarkedListLine = (data) => {
1442
+ const context = data.context;
1443
+ const length = data.end - data.start + 1;
1444
+ const marker = readMarkedIndentation(data.text, data.start, data.end, Number.POSITIVE_INFINITY);
1445
+ if (marker.columns <= 3 &&
1446
+ getListMarkerLength(data.text, marker.index, data.end) > 0) {
1447
+ flushMarkedListItem(context === null || context === void 0 ? void 0 : context.item, data.costs);
1448
+ const started = readMarkedListItemStart(data.text, data.start, data.end);
1449
+ started.item.lines = started.isText ? 1 : 0;
1450
+ started.item.length = length;
1451
+ return {
1452
+ quoteMarkers: started.item.quoteMarkers,
1453
+ leastColumn: context !== null && context.quoteMarkers === started.item.quoteMarkers
1454
+ ? Math.min(context.leastColumn, started.leastColumn)
1455
+ : started.leastColumn,
1456
+ item: started.item,
1457
+ };
1458
+ }
1459
+ if (context === null || context.item === null) {
1460
+ return null;
1461
+ }
1462
+ if (data.startsHeading || data.isFirstLine) {
1463
+ const line = readMarkedIndentation(data.text, data.start, data.end, context.quoteMarkers);
1464
+ if (line.quoteMarkers !== context.quoteMarkers ||
1465
+ line.columns < context.leastColumn) {
1466
+ flushMarkedListItem(context.item, data.costs);
1467
+ return null;
1468
+ }
1469
+ if (data.startsHeading) {
1470
+ // A heading in an item: the lines after it are the item's text.
1471
+ flushMarkedListItem(context.item, data.costs);
1472
+ return {
1473
+ quoteMarkers: context.quoteMarkers,
1474
+ leastColumn: context.leastColumn,
1475
+ item: {
1476
+ quoteMarkers: context.quoteMarkers,
1477
+ textColumn: null,
1478
+ fence: null,
1479
+ lines: 0,
1480
+ length: length,
1481
+ },
1482
+ };
1483
+ }
1484
+ }
1485
+ context.item.length += length;
1486
+ if (readMarkedListItemLine(data.text, data.start, data.end, context.item)) {
1487
+ context.item.lines++;
1488
+ }
1489
+ return context;
1490
+ };
1176
1491
  // The "|" in text[start, end) that a backslash does not escape.
1177
1492
  const getPipeCount = (text, start, end) => {
1178
1493
  let count = 0;
@@ -1196,8 +1511,14 @@ const getPipeCount = (text, start, end) => {
1196
1511
  * the same kind started: elsewhere it can be a paragraph's next line. The
1197
1512
  * punctuation of its words is added to it, line by line
1198
1513
  * (getWordPunctuationWork).
1514
+ *
1515
+ * For marked (counting.countAsMarked), each line of a list item it reads as
1516
+ * a line of text adds a look through half of the item's lines in the run
1517
+ * (HOW MARKED READS A LIST ITEM): `list` holds the item the run's lines may
1518
+ * be in, from the run before it past a blank line, and is left holding the
1519
+ * item the run's last lines are in.
1199
1520
  */
1200
- const measureRun = (text, lineStarts, counting) => {
1521
+ const measureRun = (text, lineStarts, counting, list) => {
1201
1522
  let inlineWork = 0;
1202
1523
  let longestUnit = 0;
1203
1524
  let longestUnitLines = 0;
@@ -1208,6 +1529,13 @@ const measureRun = (text, lineStarts, counting) => {
1208
1529
  let unit = newUnitWork();
1209
1530
  // What started the unit being read, if a marker did.
1210
1531
  let unitKind = null;
1532
+ // For marked: the list item the line is in, and the items around it.
1533
+ let context = counting.countAsMarked
1534
+ ? list.context
1535
+ : null;
1536
+ // For marked: what the lines of list items cost it (flushMarkedListItem).
1537
+ const listCosts = { work: 0 };
1538
+ let isFirstLine = true;
1211
1539
  // Adds what the unit read costs: marked's copies of it in their share.
1212
1540
  const addUnit = () => {
1213
1541
  inlineWork +=
@@ -1234,6 +1562,15 @@ const measureRun = (text, lineStarts, counting) => {
1234
1562
  unitLength += lineEnd - lineStart + 1;
1235
1563
  unitLines++;
1236
1564
  if (counting.countAsMarked) {
1565
+ context = readMarkedListLine({
1566
+ text: text,
1567
+ start: lineStart,
1568
+ end: lineEnd,
1569
+ startsHeading: startsUnit && unitKind === "heading",
1570
+ isFirstLine: isFirstLine,
1571
+ context: context,
1572
+ costs: listCosts,
1573
+ });
1237
1574
  readMarkedLine(text, start.contentStart, lineEnd, counting, unit);
1238
1575
  }
1239
1576
  else {
@@ -1242,8 +1579,15 @@ const measureRun = (text, lineStarts, counting) => {
1242
1579
  }
1243
1580
  nestingDepth = Math.max(nestingDepth, start.nestingDepth);
1244
1581
  cellsPerLine = Math.max(cellsPerLine, getPipeCount(text, start.contentStart, lineEnd));
1582
+ isFirstLine = false;
1245
1583
  }
1246
1584
  addUnit();
1585
+ // A blank line ends what the item's lines look through.
1586
+ flushMarkedListItem(context === null || context === void 0 ? void 0 : context.item, listCosts);
1587
+ inlineWork += listCosts.work;
1588
+ // An item in a quote ends with the quote, at the blank line.
1589
+ list.context =
1590
+ context !== null && context.quoteMarkers === 0 ? context : null;
1247
1591
  const lastLineStart = lineStarts[lineStarts.length - 1];
1248
1592
  return {
1249
1593
  start: lineStarts[0],
@@ -1283,16 +1627,22 @@ const readSegments = (text, counting) => {
1283
1627
  let htmlBlockEnds = null;
1284
1628
  // Whether a fence may still be read as one (see above).
1285
1629
  let isFenceReadable = true;
1630
+ /*
1631
+ * For marked: the list item a run may go on with past a blank line
1632
+ * (measureRun). Fenced code at a line's start ends every list.
1633
+ */
1634
+ const list = { context: null };
1286
1635
  const endRun = () => {
1287
1636
  if (runLineStarts.length > 0) {
1288
1637
  segments.push({
1289
1638
  kind: "run",
1290
- run: measureRun(text, runLineStarts, counting),
1639
+ run: measureRun(text, runLineStarts, counting, list),
1291
1640
  });
1292
1641
  runLineStarts = [];
1293
1642
  }
1294
1643
  };
1295
1644
  const pushCode = (contentEnd, end) => {
1645
+ list.context = null;
1296
1646
  segments.push({
1297
1647
  kind: "code",
1298
1648
  block: {
@@ -1,4 +1,5 @@
1
1
  import commonJsModule from "./SlowMarkdown.js";
2
+ export const MARKED_LIST_LINE_SHARE = commonJsModule.MARKED_LIST_LINE_SHARE;
2
3
  export const MARKED_MASKED_ITEM_SHARE = commonJsModule.MARKED_MASKED_ITEM_SHARE;
3
4
  export const MARKED_TAIL_READING_SHARE = commonJsModule.MARKED_TAIL_READING_SHARE;
4
5
  export const MAX_MARKED_LABEL_LENGTH = commonJsModule.MAX_MARKED_LABEL_LENGTH;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const BadDataException_1 = __importDefault(require("../../Types/Exception/BadDataException"));
7
+ const LookupTable_1 = require("../LookupTable");
7
8
  /**
8
9
  * Shunting-yard based evaluator for metric formulas such as
9
10
  * "$A + $B * 2" or "(a - b) / 100". Variables are matched by metric
@@ -427,22 +428,27 @@ class MetricFormulaEvaluator {
427
428
  const sampleAttributes = input.sample["attributes"] || {};
428
429
  if (input.groupByAttributeKeys.length > 0) {
429
430
  for (const key of input.groupByAttributeKeys) {
430
- const value = sampleAttributes[key];
431
- labels[key] = value === undefined || value === null ? "" : value;
431
+ /*
432
+ * The sample's own attributes, written as the labels' own keys, as
433
+ * extractSeriesLabels reads them: a group-by key may be named
434
+ * constructor, toString or __proto__.
435
+ */
436
+ const value = (0, LookupTable_1.readOwnValue)(sampleAttributes, key);
437
+ (0, LookupTable_1.writeOwnValue)(labels, key, value === undefined || value === null ? "" : value);
432
438
  }
433
439
  return labels;
434
440
  }
435
441
  for (const key of Object.keys(sampleAttributes)) {
436
442
  const value = sampleAttributes[key];
437
443
  if (value === undefined || value === null) {
438
- labels[key] = "";
444
+ (0, LookupTable_1.writeOwnValue)(labels, key, "");
439
445
  continue;
440
446
  }
441
447
  // Nested objects/arrays can't canonicalize into a stable label.
442
448
  if (typeof value === "object") {
443
449
  continue;
444
450
  }
445
- labels[key] = value;
451
+ (0, LookupTable_1.writeOwnValue)(labels, key, value);
446
452
  }
447
453
  return labels;
448
454
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FINGERPRINT_MEMO_MAX_TEXT_LENGTH = exports.FINGERPRINT_MEMO_MAX_ENTRIES = void 0;
4
4
  const crypto_1 = require("crypto");
5
+ const LookupTable_1 = require("../LookupTable");
5
6
  /*
6
7
  * The fingerprints of label sets seen lately, by their canonical text
7
8
  * ("key=value|key=value"). A grouped metric monitor fingerprints every raw
@@ -81,16 +82,24 @@ class MetricSeriesFingerprint {
81
82
  const sampleAttributes = input.sample["attributes"] || {};
82
83
  if (input.attributeKeys && input.attributeKeys.length > 0) {
83
84
  for (const key of input.attributeKeys) {
84
- const value = sampleAttributes[key];
85
+ /*
86
+ * The sample's own attributes only. A monitor may group by an
87
+ * attribute named constructor or toString, and a plain read of a
88
+ * sample without it found the function every object inherits: its
89
+ * text became the label, and the fingerprint hashed it. The label
90
+ * is written as the result's own key, so one named __proto__ is a
91
+ * label too, not dropped.
92
+ */
93
+ const value = (0, LookupTable_1.readOwnValue)(sampleAttributes, key);
85
94
  if (value !== undefined && value !== null) {
86
- result[key] = value;
95
+ (0, LookupTable_1.writeOwnValue)(result, key, value);
87
96
  }
88
97
  else {
89
98
  /*
90
99
  * Preserve the key even when missing so the fingerprint stays
91
100
  * stable across evaluations that happen to drop the attribute.
92
101
  */
93
- result[key] = "";
102
+ (0, LookupTable_1.writeOwnValue)(result, key, "");
94
103
  }
95
104
  }
96
105
  return result;
@@ -103,7 +112,7 @@ class MetricSeriesFingerprint {
103
112
  if (value === undefined || value === null) {
104
113
  continue;
105
114
  }
106
- result[key] = value;
115
+ (0, LookupTable_1.writeOwnValue)(result, key, value);
107
116
  }
108
117
  return result;
109
118
  }
@@ -88,9 +88,14 @@ export default class MetricSeriesScope {
88
88
  *
89
89
  * Returns "" when nothing was narrowed, which is exactly the condition
90
90
  * for the card to say nothing.
91
+ *
92
+ * An empty group reads `unsetLabel`: the reader's word for "(unset)"
93
+ * where the summary is drawn for them ("service.name = (nicht
94
+ * gesetzt)"), "(unset)" when none is given.
91
95
  */
92
96
  static getAppliedSeriesLabelSummary(input: {
93
97
  queryConfigs: Array<MetricQueryConfigData> | undefined | null;
94
98
  seriesLabels: JSONObject | null | undefined;
99
+ unsetLabel?: string | undefined;
95
100
  }): string;
96
101
  }
@@ -88,9 +88,14 @@ export default class MetricSeriesScope {
88
88
  *
89
89
  * Returns "" when nothing was narrowed, which is exactly the condition
90
90
  * for the card to say nothing.
91
+ *
92
+ * An empty group reads `unsetLabel`: the reader's word for "(unset)"
93
+ * where the summary is drawn for them ("service.name = (nicht
94
+ * gesetzt)"), "(unset)" when none is given.
91
95
  */
92
96
  static getAppliedSeriesLabelSummary(input: {
93
97
  queryConfigs: Array<MetricQueryConfigData> | undefined | null;
94
98
  seriesLabels: JSONObject | null | undefined;
99
+ unsetLabel?: string | undefined;
95
100
  }): string;
96
101
  }
@@ -179,6 +179,10 @@ class MetricSeriesScope {
179
179
  *
180
180
  * Returns "" when nothing was narrowed, which is exactly the condition
181
181
  * for the card to say nothing.
182
+ *
183
+ * An empty group reads `unsetLabel`: the reader's word for "(unset)"
184
+ * where the summary is drawn for them ("service.name = (nicht
185
+ * gesetzt)"), "(unset)" when none is given.
182
186
  */
183
187
  static getAppliedSeriesLabelSummary(input) {
184
188
  const parts = [];
@@ -196,7 +200,7 @@ class MetricSeriesScope {
196
200
  const filterValue = filters[key];
197
201
  parts.push(`${key} = ${typeof filterValue === "string"
198
202
  ? filterValue
199
- : MetricSeriesScope.UnsetLabelDisplayValue}`);
203
+ : input.unsetLabel || MetricSeriesScope.UnsetLabelDisplayValue}`);
200
204
  }
201
205
  }
202
206
  return parts.join(", ");
@@ -10,10 +10,13 @@ export default class MonitorRootCauseWording {
10
10
  translator: Translator;
11
11
  findings?: ReadonlyArray<RootCauseFinding> | undefined;
12
12
  options?: WordEvaluationSentenceOptions | undefined;
13
+ setsValuesApart?: boolean | undefined;
13
14
  }): string;
14
15
  private static boldLabel;
15
16
  private static word;
16
17
  private static wordProbeTimeout;
17
18
  private static wordFailedPhase;
19
+ private static wordErrorDescription;
20
+ private static setApart;
18
21
  private static getWordedFindings;
19
22
  }
@@ -10,10 +10,13 @@ export default class MonitorRootCauseWording {
10
10
  translator: Translator;
11
11
  findings?: ReadonlyArray<RootCauseFinding> | undefined;
12
12
  options?: WordEvaluationSentenceOptions | undefined;
13
+ setsValuesApart?: boolean | undefined;
13
14
  }): string;
14
15
  private static boldLabel;
15
16
  private static word;
16
17
  private static wordProbeTimeout;
17
18
  private static wordFailedPhase;
19
+ private static wordErrorDescription;
20
+ private static setApart;
18
21
  private static getWordedFindings;
19
22
  }