@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
@@ -12,6 +12,7 @@ const SerializableObject_1 = __importDefault(require("./SerializableObject"));
12
12
  const SerializableObjectDictionary_1 = __importDefault(require("./SerializableObjectDictionary"));
13
13
  const Typeof_1 = __importDefault(require("./Typeof"));
14
14
  const json5_1 = __importDefault(require("json5"));
15
+ const LookupTable_1 = require("../Utils/LookupTable");
15
16
  class JSONFunctions {
16
17
  static createSafeJSONObject() {
17
18
  return Object.create(null);
@@ -272,22 +273,28 @@ class JSONFunctions {
272
273
  // this function serializes JSON with Common Objects to JSON that can be stringified.
273
274
  static serialize(val) {
274
275
  const newVal = {};
276
+ /*
277
+ * Each key is written as the copy's own (writeOwnValue). A value read
278
+ * from a store can hold a key named __proto__ - a log's attribute, a
279
+ * series' label - and assigning it dropped it from the JSON, or made an
280
+ * object under it the copy's prototype, which hid it the same way.
281
+ */
275
282
  for (const key in val) {
276
283
  if (val[key] === undefined) {
277
284
  continue;
278
285
  }
279
286
  if (val[key] === null) {
280
- newVal[key] = val[key];
287
+ (0, LookupTable_1.writeOwnValue)(newVal, key, val[key]);
281
288
  }
282
289
  if (Array.isArray(val[key])) {
283
290
  const arraySerialize = [];
284
291
  for (const arrVal of val[key]) {
285
292
  arraySerialize.push(this.serializeValue(arrVal));
286
293
  }
287
- newVal[key] = arraySerialize;
294
+ (0, LookupTable_1.writeOwnValue)(newVal, key, arraySerialize);
288
295
  }
289
296
  else {
290
- newVal[key] = this.serializeValue(val[key]);
297
+ (0, LookupTable_1.writeOwnValue)(newVal, key, this.serializeValue(val[key]));
291
298
  }
292
299
  }
293
300
  return newVal;
package/Types/Link.d.mts CHANGED
@@ -5,6 +5,7 @@ export default interface Link {
5
5
  to: Route | URL;
6
6
  openInNewTab?: boolean | undefined;
7
7
  isRecordName?: boolean | undefined;
8
+ isTitleTranslated?: boolean | undefined;
8
9
  recordName?: string | undefined;
9
10
  recordNumber?: string | undefined;
10
11
  }
package/Types/Link.d.ts CHANGED
@@ -5,6 +5,7 @@ export default interface Link {
5
5
  to: Route | URL;
6
6
  openInNewTab?: boolean | undefined;
7
7
  isRecordName?: boolean | undefined;
8
+ isTitleTranslated?: boolean | undefined;
8
9
  recordName?: string | undefined;
9
10
  recordNumber?: string | undefined;
10
11
  }
@@ -0,0 +1,4 @@
1
+ export declare const MEANING_KEYS: ReadonlyArray<string>;
2
+ export declare const MEANING_KEY_PATTERN: RegExp;
3
+ export declare function getWordOfMeaningKey(text: string | undefined): string | undefined;
4
+ export declare function withMeaningKeyAsItsWord(text: string): string;
@@ -0,0 +1,4 @@
1
+ export declare const MEANING_KEYS: ReadonlyArray<string>;
2
+ export declare const MEANING_KEY_PATTERN: RegExp;
3
+ export declare function getWordOfMeaningKey(text: string | undefined): string | undefined;
4
+ export declare function withMeaningKeyAsItsWord(text: string): string;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MEANING_KEY_PATTERN = exports.MEANING_KEYS = void 0;
4
+ exports.getWordOfMeaningKey = getWordOfMeaningKey;
5
+ exports.withMeaningKeyAsItsWord = withMeaningKeyAsItsWord;
6
+ /*
7
+ * KEYS THAT NAME THEIR MEANING.
8
+ *
9
+ * A key of the Dashboard's locales is its English text, so an English word
10
+ * that means two things is worded one way in each language, for every place
11
+ * that looks it up. "Open" is every Open button's verb, so an open invoice
12
+ * read "Abrir" ("open it") in Spanish; "View" is the View buttons' verb, so a
13
+ * database's view read "Ver"; "Change" is the Change buttons' verb, so a
14
+ * schema change read "Cambiar".
15
+ *
16
+ * Such a meaning takes a key of its own: the word, then what it means in
17
+ * brackets, for the translator - "Open (invoice status)", "View (database
18
+ * object)" - worded as that meaning in every language ("Pendiente",
19
+ * "Vista"). English reads the word alone, "Open" or "View", and so does a
20
+ * language whose locale has no wording of the key yet.
21
+ *
22
+ * The translator knows the keys listed here: wherever one is looked up with
23
+ * no wording of its own - Translator's translateText and translateTerm, a
24
+ * value of an English sentence, the front ends' translateString - it reads as
25
+ * its word. So such a key can be anything a key can be: a column's or a
26
+ * filter's title, a dropdown's option, a pill's text, drawn by any component.
27
+ *
28
+ * A key is listed here once its meaning is checked against every place that
29
+ * looks it up (App/Tests/Dashboard/OneMeaningPerKey). A key that only looks
30
+ * like one - "Description (optional)", "Retention (days)" - is not, and reads
31
+ * as its whole text.
32
+ */
33
+ exports.MEANING_KEYS = [
34
+ // A data security issue that is still open (DataSecurityPills).
35
+ "Open (status)",
36
+ // An invoice that is issued and not paid yet (Settings > Invoices).
37
+ "Open (invoice status)",
38
+ // What an import did with a row (ImportResultWords).
39
+ "Created (import result)",
40
+ // A data asset's kind: a database's view and table (DataAssetKindWords).
41
+ "View (database object)",
42
+ "Table (database object)",
43
+ // The Schema Changes list's Change filter and column.
44
+ "Change (schema change)",
45
+ /*
46
+ * The storage array a hardware component or a volume is in: the storage
47
+ * widgets' column, a tile's row and the Sort setting's choice (#7522).
48
+ * The bare "Array" read as a programming array in six languages (配列,
49
+ * Matriz, Tableau, 배열, 数组, Matrise).
50
+ */
51
+ "Array (storage array)",
52
+ ];
53
+ // "<word> (<what it means>)": the word, and its meaning in brackets.
54
+ exports.MEANING_KEY_PATTERN = /^(\S(?:.*\S)?) \(([^()]+)\)$/;
55
+ const WORD_OF_MEANING_KEY = new Map(exports.MEANING_KEYS.map((key) => {
56
+ const match = key.match(exports.MEANING_KEY_PATTERN);
57
+ return [key, match ? match[1] : key];
58
+ }));
59
+ /*
60
+ * What a listed key reads as where the reader's language has no wording of
61
+ * its own: "Open" for "Open (invoice status)". Undefined for any other text,
62
+ * which reads as it is written.
63
+ */
64
+ function getWordOfMeaningKey(text) {
65
+ if (typeof text !== "string" || text.length === 0) {
66
+ return undefined;
67
+ }
68
+ return WORD_OF_MEANING_KEY.get(text);
69
+ }
70
+ // The text as English draws it: a listed key's word, any other text itself.
71
+ function withMeaningKeyAsItsWord(text) {
72
+ var _a;
73
+ return (_a = getWordOfMeaningKey(text)) !== null && _a !== void 0 ? _a : text;
74
+ }
@@ -0,0 +1,5 @@
1
+ import commonJsModule from "./MeaningKeys.js";
2
+ export const MEANING_KEYS = commonJsModule.MEANING_KEYS;
3
+ export const MEANING_KEY_PATTERN = commonJsModule.MEANING_KEY_PATTERN;
4
+ export const getWordOfMeaningKey = commonJsModule.getWordOfMeaningKey;
5
+ export const withMeaningKeyAsItsWord = commonJsModule.withMeaningKeyAsItsWord;
@@ -93,6 +93,7 @@ export declare enum WhoIsToldFix {
93
93
  MonitorCriteria = "MonitorCriteria",
94
94
  IncidentOnCallRules = "IncidentOnCallRules",
95
95
  AlertOnCallRules = "AlertOnCallRules",
96
+ OnCallGuidedSetup = "OnCallGuidedSetup",
96
97
  OnCallPolicy = "OnCallPolicy",
97
98
  OnCallReadiness = "OnCallReadiness",
98
99
  ProjectNotificationSettings = "ProjectNotificationSettings",
@@ -133,6 +134,7 @@ export declare function getWhoIsToldPersonReach(data: {
133
134
  }>;
134
135
  hasNoRule: boolean;
135
136
  isOptedOut: boolean;
137
+ fallbackChannels: ReadonlyArray<OnCallPageChannel>;
136
138
  verifiedChannels: ReadonlyArray<OnCallPageChannel>;
137
139
  isFallbackEnabled: boolean;
138
140
  channelsOff: ReadonlyArray<OnCallPageChannel>;
@@ -144,6 +146,7 @@ export declare function getWhoIsToldBreaks(data: {
144
146
  channels: WhoIsToldChannels;
145
147
  projectHasIncidentOnCallRules: boolean;
146
148
  projectHasAlertOnCallRules: boolean;
149
+ projectHasOnCallPolicies: boolean;
147
150
  }): Array<WhoIsToldBreak>;
148
151
  export declare function redactWhoIsTold(data: {
149
152
  result: WhoIsToldResult;
@@ -93,6 +93,7 @@ export declare enum WhoIsToldFix {
93
93
  MonitorCriteria = "MonitorCriteria",
94
94
  IncidentOnCallRules = "IncidentOnCallRules",
95
95
  AlertOnCallRules = "AlertOnCallRules",
96
+ OnCallGuidedSetup = "OnCallGuidedSetup",
96
97
  OnCallPolicy = "OnCallPolicy",
97
98
  OnCallReadiness = "OnCallReadiness",
98
99
  ProjectNotificationSettings = "ProjectNotificationSettings",
@@ -133,6 +134,7 @@ export declare function getWhoIsToldPersonReach(data: {
133
134
  }>;
134
135
  hasNoRule: boolean;
135
136
  isOptedOut: boolean;
137
+ fallbackChannels: ReadonlyArray<OnCallPageChannel>;
136
138
  verifiedChannels: ReadonlyArray<OnCallPageChannel>;
137
139
  isFallbackEnabled: boolean;
138
140
  channelsOff: ReadonlyArray<OnCallPageChannel>;
@@ -144,6 +146,7 @@ export declare function getWhoIsToldBreaks(data: {
144
146
  channels: WhoIsToldChannels;
145
147
  projectHasIncidentOnCallRules: boolean;
146
148
  projectHasAlertOnCallRules: boolean;
149
+ projectHasOnCallPolicies: boolean;
147
150
  }): Array<WhoIsToldBreak>;
148
151
  export declare function redactWhoIsTold(data: {
149
152
  result: WhoIsToldResult;
@@ -104,6 +104,12 @@ var WhoIsToldFix;
104
104
  WhoIsToldFix["MonitorCriteria"] = "MonitorCriteria";
105
105
  WhoIsToldFix["IncidentOnCallRules"] = "IncidentOnCallRules";
106
106
  WhoIsToldFix["AlertOnCallRules"] = "AlertOnCallRules";
107
+ /*
108
+ * The project has no on-call policy yet, so an on-call rule would have
109
+ * nothing to page: the on-call guided setup makes the first policy, with
110
+ * the on-call rules that run it for every new incident and alert (#7369).
111
+ */
112
+ WhoIsToldFix["OnCallGuidedSetup"] = "OnCallGuidedSetup";
107
113
  WhoIsToldFix["OnCallPolicy"] = "OnCallPolicy";
108
114
  WhoIsToldFix["OnCallReadiness"] = "OnCallReadiness";
109
115
  WhoIsToldFix["ProjectNotificationSettings"] = "ProjectNotificationSettings";
@@ -161,9 +167,13 @@ function getChannelsSwitchedOff(channels) {
161
167
  /*
162
168
  * HOW A PAGE OF ONE SEVERITY REACHES ONE PERSON - as the real page does
163
169
  * (UserOnCallLogService): through their rules for that kind and severity;
164
- * with none, through every verified method of theirs, unless the project
165
- * turned that fallback off or they opted out of the severity. A channel the
166
- * project switched off sends nothing.
170
+ * with none, unless the project turned the fallback off or they opted out
171
+ * of the severity, through what the fallback picks of their methods
172
+ * (UserNotificationRuleService.executeFallbackNotification): every free
173
+ * verified one, or else one paid one, or else a webhook (#7528). Listing
174
+ * every verified method there said a person with an email, a number and a
175
+ * phone was texted and called too, when a page only emails them. A channel
176
+ * the project switched off sends nothing.
167
177
  */
168
178
  function getWhoIsToldPersonReach(data) {
169
179
  if (data.hasNoRule && data.isOptedOut) {
@@ -182,9 +192,8 @@ function getWhoIsToldPersonReach(data) {
182
192
  problem: WhoIsToldPersonProblem.NoRuleNoFallback,
183
193
  };
184
194
  }
185
- const verified = [];
186
195
  const candidates = data.hasNoRule
187
- ? data.verifiedChannels
196
+ ? data.fallbackChannels
188
197
  : data.ruleMethods
189
198
  .filter((method) => {
190
199
  return method.isVerified;
@@ -192,12 +201,27 @@ function getWhoIsToldPersonReach(data) {
192
201
  .map((method) => {
193
202
  return method.channel;
194
203
  });
195
- for (const channel of candidates) {
196
- if (!verified.includes(channel)) {
197
- verified.push(channel);
198
- }
199
- }
204
+ const verified = eachOnce(candidates);
200
205
  if (verified.length === 0) {
206
+ /*
207
+ * The fallback picks nothing, while a method of theirs is verified on
208
+ * a channel the project switched off (a text number, with SMS off):
209
+ * the fallback skips a paid channel that is off, and would page them
210
+ * by it once it is on. That switch is the break, as it is for a rule.
211
+ */
212
+ const switchedOff = data.hasNoRule
213
+ ? eachOnce(data.verifiedChannels).filter((channel) => {
214
+ return data.channelsOff.includes(channel);
215
+ })
216
+ : [];
217
+ if (switchedOff.length > 0) {
218
+ return {
219
+ channels: switchedOff,
220
+ isFallback: true,
221
+ isReachable: false,
222
+ problem: WhoIsToldPersonProblem.ChannelsOff,
223
+ };
224
+ }
201
225
  return {
202
226
  channels: [],
203
227
  isFallback: data.hasNoRule,
@@ -222,6 +246,16 @@ function getWhoIsToldPersonReach(data) {
222
246
  isReachable: true,
223
247
  };
224
248
  }
249
+ // Each channel once, in the order first met.
250
+ function eachOnce(channels) {
251
+ const once = [];
252
+ for (const channel of channels) {
253
+ if (!once.includes(channel)) {
254
+ once.push(channel);
255
+ }
256
+ }
257
+ return once;
258
+ }
225
259
  // "incidents" or "alerts", in a sentence.
226
260
  function recordsWord(kind) {
227
261
  return kind === OnCallTestPage_1.OnCallTestPageRecordKind.Alert ? "alerts" : "incidents";
@@ -246,7 +280,9 @@ function getWhoIsToldBreakMessage(brk) {
246
280
  case WhoIsToldBreakKind.NothingHappens:
247
281
  return "No criteria of this monitor changes its status or opens an incident or an alert, so nobody is told when it goes down. Add one on the Criteria page.";
248
282
  case WhoIsToldBreakKind.NobodyPaged:
249
- return `Nobody is paged: no on-call rule matches ${recordsWord(brk.recordKind)} from this monitor, and its criteria names no on-call policy. Add an on-call rule for ${recordsWord(brk.recordKind)}.`;
283
+ return brk.fix === WhoIsToldFix.OnCallGuidedSetup
284
+ ? "Nobody is paged: this project has no on-call policy yet. Set up paging to make one that pages someone for every new incident and alert."
285
+ : `Nobody is paged: no on-call rule matches ${recordsWord(brk.recordKind)} from this monitor, and its criteria names no on-call policy. Add an on-call rule for ${recordsWord(brk.recordKind)}.`;
250
286
  case WhoIsToldBreakKind.OnlyIncidentsHaveRules:
251
287
  return "Nobody is paged for this monitor's alerts: only incidents have on-call rules. Add an on-call rule for alerts, or have the criteria open an incident.";
252
288
  case WhoIsToldBreakKind.PolicyHasNoLevels:
@@ -311,7 +347,10 @@ function getChannelsInUse(criteria) {
311
347
  *
312
348
  * `projectHasIncidentOnCallRules` tells a monitor that opens alerts while
313
349
  * only incidents have on-call rules (the most common silent break) from one
314
- * that has no rules at all.
350
+ * that has no rules at all. `projectHasOnCallPolicies` tells a project with
351
+ * no on-call policy yet - whose fix is the on-call guided setup, which
352
+ * makes the first one with the rules that run it - from one whose rules
353
+ * leave this monitor out (#7369): an on-call rule needs a policy to page.
315
354
  */
316
355
  function getWhoIsToldBreaks(data) {
317
356
  const breaks = [];
@@ -336,7 +375,18 @@ function getWhoIsToldBreaks(data) {
336
375
  for (const item of data.criteria) {
337
376
  for (const event of item.events) {
338
377
  if (event.policies.length === 0) {
339
- if (event.kind === OnCallTestPage_1.OnCallTestPageRecordKind.Alert &&
378
+ if (!data.projectHasOnCallPolicies) {
379
+ /*
380
+ * No policy at all: whatever rules the project has page nothing,
381
+ * so the first policy is what is missing (#7369).
382
+ */
383
+ add({
384
+ kind: WhoIsToldBreakKind.NobodyPaged,
385
+ fix: WhoIsToldFix.OnCallGuidedSetup,
386
+ recordKind: event.kind,
387
+ });
388
+ }
389
+ else if (event.kind === OnCallTestPage_1.OnCallTestPageRecordKind.Alert &&
340
390
  data.projectHasIncidentOnCallRules &&
341
391
  !data.projectHasAlertOnCallRules) {
342
392
  add({
@@ -0,0 +1,16 @@
1
+ export declare const NO_BREAK_SPACE: string;
2
+ export declare const NARROW_NO_BREAK_SPACE: string;
3
+ export declare const setsPunctuationApart: (language: string | null | undefined) => boolean;
4
+ export declare const withFrenchSpacing: (words: string) => string;
5
+ export declare const withFrenchSpacingInHtml: (html: string) => string;
6
+ export declare const withNumbersKeptWithUnits: (words: string, english: string) => string;
7
+ export declare const withNoBreakSpaces: (words: string, english: string, language: string | null | undefined) => string;
8
+ export type NoBreakLocaleTree = {
9
+ [key: string]: unknown;
10
+ };
11
+ export interface NoBreakLocaleInput {
12
+ locale: NoBreakLocaleTree;
13
+ language: string;
14
+ english?: NoBreakLocaleTree | undefined;
15
+ }
16
+ export declare const withNoBreakSpacesInLocale: (input: NoBreakLocaleInput) => NoBreakLocaleTree;
@@ -0,0 +1,16 @@
1
+ export declare const NO_BREAK_SPACE: string;
2
+ export declare const NARROW_NO_BREAK_SPACE: string;
3
+ export declare const setsPunctuationApart: (language: string | null | undefined) => boolean;
4
+ export declare const withFrenchSpacing: (words: string) => string;
5
+ export declare const withFrenchSpacingInHtml: (html: string) => string;
6
+ export declare const withNumbersKeptWithUnits: (words: string, english: string) => string;
7
+ export declare const withNoBreakSpaces: (words: string, english: string, language: string | null | undefined) => string;
8
+ export type NoBreakLocaleTree = {
9
+ [key: string]: unknown;
10
+ };
11
+ export interface NoBreakLocaleInput {
12
+ locale: NoBreakLocaleTree;
13
+ language: string;
14
+ english?: NoBreakLocaleTree | undefined;
15
+ }
16
+ export declare const withNoBreakSpacesInLocale: (input: NoBreakLocaleInput) => NoBreakLocaleTree;