@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
@@ -1,50 +1,96 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.translateStateName = exports.isDefaultStatusName = exports.DEFAULT_STATUS_NAMES = void 0;
3
+ exports.DEFAULT_STATUS_NAMES = exports.DEFAULT_SECURITY_CASE_PRIORITY_NAMES = exports.DEFAULT_SECURITY_CASE_STATUS_NAMES = exports.DEFAULT_POSTMORTEM_STATUS_NAMES = exports.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES = exports.DEFAULT_MONITOR_STATUS_NAMES = exports.DEFAULT_ALERT_SEVERITY_NAMES = exports.DEFAULT_INCIDENT_SEVERITY_NAMES = exports.DEFAULT_ALERT_STATE_NAMES = exports.DEFAULT_INCIDENT_STATE_NAMES = void 0;
4
4
  const Translator_1 = require("../Translator");
5
5
  /*
6
6
  * THE NAMES ONEUPTIME GIVES EVERY NEW PROJECT'S STATES, SEVERITIES AND
7
- * STATUSES (ProjectService): incident states, incident severities, monitor
8
- * statuses and scheduled maintenance states.
9
- *
10
- * A status page shows these in its reader's language
11
- * (StatusPage/src/Utils/StatusTranslation), and so do its notifications to
12
- * its subscribers (Server/Utils/StatusPage/SubscriberMessageText). A name
13
- * the project changed is its own, and reads as written in every language.
7
+ * STATUSES (ProjectService), one list for each kind of record. They are
8
+ * OneUptime's words, read in the reader's language; a name the project
9
+ * changed is its own, and reads as written in every language. Which list a
10
+ * record's name is read against goes by its table (Utils/DefaultRecordNames).
14
11
  */
15
- exports.DEFAULT_STATUS_NAMES = [
12
+ // A new project's incident states (addDefaultIncidentState).
13
+ exports.DEFAULT_INCIDENT_STATE_NAMES = [
16
14
  (0, Translator_1.translationKey)("Identified"),
17
15
  (0, Translator_1.translationKey)("Acknowledged"),
18
16
  (0, Translator_1.translationKey)("Resolved"),
17
+ ];
18
+ // Its alert states (addDefaultAlertState), named as its incident states are.
19
+ exports.DEFAULT_ALERT_STATE_NAMES = exports.DEFAULT_INCIDENT_STATE_NAMES;
20
+ // Its incident severities (addDefaultIncidentSeverity).
21
+ exports.DEFAULT_INCIDENT_SEVERITY_NAMES = [
19
22
  (0, Translator_1.translationKey)("Critical Incident"),
20
23
  (0, Translator_1.translationKey)("Major Incident"),
21
24
  (0, Translator_1.translationKey)("Minor Incident"),
25
+ ];
26
+ /*
27
+ * Its alert severities (addDefaultAlertSeverity). A status page never shows
28
+ * an alert, so they are not among the status page's names below; a
29
+ * person's on-call page shows them (OnCallDutyPolicy/OnCallPageWords).
30
+ */
31
+ exports.DEFAULT_ALERT_SEVERITY_NAMES = [
32
+ (0, Translator_1.translationKey)("High"),
33
+ (0, Translator_1.translationKey)("Low"),
34
+ ];
35
+ // Its monitor statuses (addDefaultMonitorStatus).
36
+ exports.DEFAULT_MONITOR_STATUS_NAMES = [
22
37
  (0, Translator_1.translationKey)("Operational"),
23
38
  (0, Translator_1.translationKey)("Degraded"),
24
39
  (0, Translator_1.translationKey)("Offline"),
40
+ ];
41
+ // Its scheduled maintenance states (addDefaultScheduledMaintenanceState).
42
+ exports.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES = [
25
43
  (0, Translator_1.translationKey)("Scheduled"),
26
44
  (0, Translator_1.translationKey)("Ongoing"),
27
45
  (0, Translator_1.translationKey)("Ended"),
28
46
  (0, Translator_1.translationKey)("Completed"),
29
47
  ];
30
- // Whether `name` is one of OneUptime's default names, as it gave it.
31
- const isDefaultStatusName = (name) => {
32
- return typeof name === "string" && exports.DEFAULT_STATUS_NAMES.includes(name.trim());
33
- };
34
- exports.isDefaultStatusName = isDefaultStatusName;
35
48
  /*
36
- * A state's, a severity's or a status's name as `translator`'s reader reads
37
- * it: OneUptime's own default names in their language, any other name as
38
- * written.
49
+ * The names of its postmortem statuses (DEFAULT_POSTMORTEM_STATUSES,
50
+ * Utils/Incident/PostmortemStatus) and of its security case statuses and
51
+ * priorities (DEFAULT_SECURITY_CASE_STATUSES and _PRIORITIES, in
52
+ * Utils/SecurityCase), and nothing else of them: DefaultRecordNames reads a
53
+ * record's name against them on every form, and loading those lists'
54
+ * colours, descriptions and rules would load them on every page that has
55
+ * one (packages/Common/Scripts/first-load-budgets.js). Tests/Utils/
56
+ * DefaultRecordNames holds each to its list's names. Written as those lists
57
+ * write them, not as lookups: no message the server sends names one.
39
58
  */
40
- const translateStateName = (translator, name) => {
41
- if (!name) {
42
- return "";
43
- }
44
- if (!(0, exports.isDefaultStatusName)(name)) {
45
- return name;
46
- }
47
- const trimmed = name.trim();
48
- return translator.translateText(trimmed) || name;
49
- };
50
- exports.translateStateName = translateStateName;
59
+ exports.DEFAULT_POSTMORTEM_STATUS_NAMES = [
60
+ "Not Started",
61
+ "Draft",
62
+ "Completed",
63
+ "Not Needed",
64
+ ];
65
+ exports.DEFAULT_SECURITY_CASE_STATUS_NAMES = [
66
+ "New",
67
+ "Investigating",
68
+ "Contained",
69
+ "Closed",
70
+ ];
71
+ exports.DEFAULT_SECURITY_CASE_PRIORITY_NAMES = [
72
+ "Critical",
73
+ "High",
74
+ "Medium",
75
+ "Low",
76
+ "Informational",
77
+ ];
78
+ /*
79
+ * The default names a status page shows, of all four lists. A status page
80
+ * shows these in its reader's language
81
+ * (StatusPage/src/Utils/StatusTranslation), and so do its notifications to
82
+ * its subscribers (Server/Utils/StatusPage/SubscriberMessageText).
83
+ *
84
+ * Whether a record's name is one of them is never decided against this
85
+ * union: an incident state a project named "Degraded" is the project's own,
86
+ * though Degraded is a default monitor status. It goes by the record's own
87
+ * list (Utils/DefaultRecordNames: isDefaultRecordName, translateRecordName),
88
+ * on the Dashboard, a status page, an on-call page and in every message
89
+ * (#8066).
90
+ */
91
+ exports.DEFAULT_STATUS_NAMES = [
92
+ ...exports.DEFAULT_INCIDENT_STATE_NAMES,
93
+ ...exports.DEFAULT_INCIDENT_SEVERITY_NAMES,
94
+ ...exports.DEFAULT_MONITOR_STATUS_NAMES,
95
+ ...exports.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES,
96
+ ];
@@ -1,4 +1,11 @@
1
1
  import commonJsModule from "./DefaultStatusNames.js";
2
+ export const DEFAULT_ALERT_SEVERITY_NAMES = commonJsModule.DEFAULT_ALERT_SEVERITY_NAMES;
3
+ export const DEFAULT_ALERT_STATE_NAMES = commonJsModule.DEFAULT_ALERT_STATE_NAMES;
4
+ export const DEFAULT_INCIDENT_SEVERITY_NAMES = commonJsModule.DEFAULT_INCIDENT_SEVERITY_NAMES;
5
+ export const DEFAULT_INCIDENT_STATE_NAMES = commonJsModule.DEFAULT_INCIDENT_STATE_NAMES;
6
+ export const DEFAULT_MONITOR_STATUS_NAMES = commonJsModule.DEFAULT_MONITOR_STATUS_NAMES;
7
+ export const DEFAULT_POSTMORTEM_STATUS_NAMES = commonJsModule.DEFAULT_POSTMORTEM_STATUS_NAMES;
8
+ export const DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES = commonJsModule.DEFAULT_SCHEDULED_MAINTENANCE_STATE_NAMES;
9
+ export const DEFAULT_SECURITY_CASE_PRIORITY_NAMES = commonJsModule.DEFAULT_SECURITY_CASE_PRIORITY_NAMES;
10
+ export const DEFAULT_SECURITY_CASE_STATUS_NAMES = commonJsModule.DEFAULT_SECURITY_CASE_STATUS_NAMES;
2
11
  export const DEFAULT_STATUS_NAMES = commonJsModule.DEFAULT_STATUS_NAMES;
3
- export const isDefaultStatusName = commonJsModule.isDefaultStatusName;
4
- export const translateStateName = commonJsModule.translateStateName;
@@ -1,5 +1,6 @@
1
1
  import { MarkdownText } from "../../Utils/Markdown/FeedMarkdown.mjs";
2
2
  import { ComposedValue, Translator } from "../Translator.mjs";
3
+ import { StatusPageNameList } from "./DefaultStatusNames.mjs";
3
4
  export declare const StateChangeNoteText: {
4
5
  readonly incidentEmailSubject: string;
5
6
  readonly incidentCustomTemplateEmailSubject: string;
@@ -12,7 +13,7 @@ export declare const StateChangeNoteText: {
12
13
  export default class StateChangeNoteMessage {
13
14
  static readonly statusLabel: string;
14
15
  static formatStateName(stateName: string): string;
15
- static stateInSentence(stateName: string): ComposedValue;
16
+ static stateInSentence(list: StatusPageNameList, stateName: string): ComposedValue;
16
17
  static getIncidentEmailSubject(data: {
17
18
  stateName: string;
18
19
  incidentTitle: string;
@@ -45,5 +46,5 @@ export default class StateChangeNoteMessage {
45
46
  statusPageName: string;
46
47
  translator?: Translator | undefined;
47
48
  }): string;
48
- static getChatStatusLine(stateName: string, translator?: Translator | undefined): MarkdownText;
49
+ static getChatStatusLine(list: StatusPageNameList, stateName: string, translator?: Translator | undefined): MarkdownText;
49
50
  }
@@ -1,5 +1,6 @@
1
1
  import { MarkdownText } from "../../Utils/Markdown/FeedMarkdown";
2
2
  import { ComposedValue, Translator } from "../Translator";
3
+ import { StatusPageNameList } from "./DefaultStatusNames";
3
4
  export declare const StateChangeNoteText: {
4
5
  readonly incidentEmailSubject: string;
5
6
  readonly incidentCustomTemplateEmailSubject: string;
@@ -12,7 +13,7 @@ export declare const StateChangeNoteText: {
12
13
  export default class StateChangeNoteMessage {
13
14
  static readonly statusLabel: string;
14
15
  static formatStateName(stateName: string): string;
15
- static stateInSentence(stateName: string): ComposedValue;
16
+ static stateInSentence(list: StatusPageNameList, stateName: string): ComposedValue;
16
17
  static getIncidentEmailSubject(data: {
17
18
  stateName: string;
18
19
  incidentTitle: string;
@@ -45,5 +46,5 @@ export default class StateChangeNoteMessage {
45
46
  statusPageName: string;
46
47
  translator?: Translator | undefined;
47
48
  }): string;
48
- static getChatStatusLine(stateName: string, translator?: Translator | undefined): MarkdownText;
49
+ static getChatStatusLine(list: StatusPageNameList, stateName: string, translator?: Translator | undefined): MarkdownText;
49
50
  }
@@ -7,7 +7,8 @@ exports.StateChangeNoteText = void 0;
7
7
  const Text_1 = __importDefault(require("../Text"));
8
8
  const FeedMarkdown_1 = require("../../Utils/Markdown/FeedMarkdown");
9
9
  const Translator_1 = require("../Translator");
10
- const DefaultStatusNames_1 = require("./DefaultStatusNames");
10
+ const DefaultRecordNames_1 = require("../../Utils/DefaultRecordNames");
11
+ const StateOrder_1 = require("../../Utils/StateOrder");
11
12
  /*
12
13
  * WHAT A PUBLIC NOTE POSTED WITH A STATE CHANGE ADDS TO ITS MESSAGES.
13
14
  *
@@ -35,7 +36,9 @@ const DefaultStatusNames_1 = require("./DefaultStatusNames");
35
36
  * Each message is written in the language of the translator it is handed -
36
37
  * a subscriber's (Server/Utils/StatusPage/SubscriberLanguage), with
37
38
  * OneUptime's default state names in that language and a project's own as
38
- * written. Without one it is the English it always was.
39
+ * written - an incident's state read against the incident states' defaults,
40
+ * a scheduled maintenance event's against the maintenance states' (#8066).
41
+ * Without one it is the English it always was.
39
42
  */
40
43
  const ENGLISH = (0, Translator_1.createTranslator)(undefined, "en");
41
44
  exports.StateChangeNoteText = {
@@ -54,17 +57,17 @@ class StateChangeNoteMessage {
54
57
  }
55
58
  /*
56
59
  * A state as a sentence names it: as formatStateName writes it, with
57
- * OneUptime's default names in the sentence's language.
60
+ * OneUptime's default names of its `list` in the sentence's language.
58
61
  */
59
- static stateInSentence(stateName) {
62
+ static stateInSentence(list, stateName) {
60
63
  return (0, Translator_1.composedValue)((translator) => {
61
- return StateChangeNoteMessage.formatStateName((0, DefaultStatusNames_1.translateStateName)(translator, stateName.trim()));
64
+ return StateChangeNoteMessage.formatStateName((0, DefaultRecordNames_1.translateRecordName)(translator, list, stateName.trim()));
62
65
  });
63
66
  }
64
67
  // The default incident email's subject: "[Resolved Incident] <title>".
65
68
  static getIncidentEmailSubject(data) {
66
69
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.incidentEmailSubject, {
67
- state: this.stateInSentence(data.stateName),
70
+ state: this.stateInSentence(StateOrder_1.StateListType.IncidentState, data.stateName),
68
71
  title: data.incidentTitle,
69
72
  });
70
73
  }
@@ -74,7 +77,7 @@ class StateChangeNoteMessage {
74
77
  */
75
78
  static getIncidentCustomTemplateEmailSubject(data) {
76
79
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.incidentCustomTemplateEmailSubject, {
77
- state: this.stateInSentence(data.stateName),
80
+ state: this.stateInSentence(StateOrder_1.StateListType.IncidentState, data.stateName),
78
81
  title: data.incidentTitle,
79
82
  });
80
83
  }
@@ -84,7 +87,7 @@ class StateChangeNoteMessage {
84
87
  */
85
88
  static getScheduledMaintenanceEmailSubject(data) {
86
89
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.scheduledMaintenanceEmailSubject, {
87
- state: this.stateInSentence(data.stateName),
90
+ state: this.stateInSentence(StateOrder_1.StateListType.ScheduledMaintenanceState, data.stateName),
88
91
  title: data.eventTitle,
89
92
  });
90
93
  }
@@ -94,7 +97,7 @@ class StateChangeNoteMessage {
94
97
  */
95
98
  static getScheduledMaintenanceCustomTemplateEmailSubject(data) {
96
99
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.scheduledMaintenanceCustomTemplateEmailSubject, {
97
- state: this.stateInSentence(data.stateName),
100
+ state: this.stateInSentence(StateOrder_1.StateListType.ScheduledMaintenanceState, data.stateName),
98
101
  title: data.eventTitle,
99
102
  });
100
103
  }
@@ -103,7 +106,7 @@ class StateChangeNoteMessage {
103
106
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.incidentSmsHeadline, {
104
107
  title: data.incidentTitle,
105
108
  statusPageName: data.statusPageName,
106
- state: this.stateInSentence(data.stateName),
109
+ state: this.stateInSentence(StateOrder_1.StateListType.IncidentState, data.stateName),
107
110
  });
108
111
  }
109
112
  /*
@@ -114,7 +117,7 @@ class StateChangeNoteMessage {
114
117
  return (data.translator || ENGLISH).translateTemplate(exports.StateChangeNoteText.scheduledMaintenanceSmsHeadline, {
115
118
  title: data.eventTitle,
116
119
  statusPageName: data.statusPageName,
117
- state: this.stateInSentence(data.stateName),
120
+ state: this.stateInSentence(StateOrder_1.StateListType.ScheduledMaintenanceState, data.stateName),
118
121
  });
119
122
  }
120
123
  /*
@@ -123,11 +126,11 @@ class StateChangeNoteMessage {
123
126
  * (mdText), so it reads as typed - OneUptime's default names in the
124
127
  * reader's language, a project's own as written.
125
128
  */
126
- static getChatStatusLine(stateName, translator) {
129
+ static getChatStatusLine(list, stateName, translator) {
127
130
  const reader = translator || ENGLISH;
128
131
  const label = reader.translateText(exports.StateChangeNoteText.chatStatusLabel) ||
129
132
  exports.StateChangeNoteText.chatStatusLabel;
130
- return (0, FeedMarkdown_1.mdText) `**${label}** ${(0, DefaultStatusNames_1.translateStateName)(reader, stateName.trim())}`;
133
+ return (0, FeedMarkdown_1.mdText) `**${label}** ${(0, DefaultRecordNames_1.translateRecordName)(reader, list, stateName.trim())}`;
131
134
  }
132
135
  }
133
136
  // The label of the line every chat message and email names the state on.
@@ -13,12 +13,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  * historical behaviour and the DEFAULT, so every key that already exists
14
14
  * keeps working exactly as before.
15
15
  * - Browser keys are pasted into a public web page - the session-replay
16
- * snippet, a browser OTLP exporter - which means "secret" is a fiction:
17
- * anyone who views source has it. They are therefore treated as PUBLIC
18
- * write-only credentials and are constrained on every axis that can be
19
- * enforced server-side: a required origin allowlist, a pinned service.name,
20
- * a per-key rate limit, an expiry, a kill switch, and a reduced set of
21
- * ingest surfaces (see BROWSER_ALLOWED_INGEST_SURFACES).
16
+ * snippet, a browser OTLP exporter, a Sentry browser SDK's DSN - which
17
+ * means "secret" is a fiction: anyone who views source has it. They are
18
+ * therefore treated as PUBLIC write-only credentials and are constrained
19
+ * on every axis that can be enforced server-side: a required origin
20
+ * allowlist, a pinned service.name, a per-key rate limit, an expiry, a
21
+ * kill switch, and a reduced set of ingest surfaces (see
22
+ * BROWSER_ALLOWED_INGEST_SURFACES).
22
23
  *
23
24
  * The type of a key is immutable after creation - see the keyType column on
24
25
  * TelemetryIngestionKey for why.
@@ -11,6 +11,7 @@ export interface PluralTemplate {
11
11
  one: string;
12
12
  other: string;
13
13
  }
14
+ export declare const SAME_AS_ENGLISH_MARK: string;
14
15
  export type TextLookup = (text: string) => string | undefined;
15
16
  export interface TermOptions {
16
17
  inSentence?: boolean | undefined;
@@ -11,6 +11,7 @@ export interface PluralTemplate {
11
11
  one: string;
12
12
  other: string;
13
13
  }
14
+ export declare const SAME_AS_ENGLISH_MARK: string;
14
15
  export type TextLookup = (text: string) => string | undefined;
15
16
  export interface TermOptions {
16
17
  inSentence?: boolean | undefined;
@@ -3,10 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getTemplateAround = exports.getSentencePartsAndLanguage = exports.getSentenceParts = exports.translateNamedAction = exports.getSentenceLanguage = exports.formatInline = exports.formatList = exports.getListSeparator = exports.createTranslator = exports.getInlineSeparator = exports.writesZeroAsADot = exports.DOT_ZERO_INLINE_SEPARATOR = exports.INLINE_SEPARATOR = exports.fillTemplate = exports.isOneFormOnlyForOne = exports.getTemplatePlaceholders = exports.getPluralCategory = exports.toLabelTerm = exports.toSentenceTerm = exports.DEFAULT_LANGUAGE = exports.translationKey = exports.isComposedValue = exports.composedValue = exports.isTranslatableTerm = exports.translatableTerm = void 0;
6
+ exports.getTemplateAround = exports.getSentencePartsAndLanguage = exports.getSentenceParts = exports.translateNamedAction = exports.getSentenceLanguage = exports.formatInline = exports.formatList = exports.getListSeparator = exports.createTranslator = exports.getInlineSeparator = exports.writesZeroAsADot = exports.DOT_ZERO_INLINE_SEPARATOR = exports.INLINE_SEPARATOR = exports.fillTemplate = exports.isOneFormOnlyForOne = exports.getTemplatePlaceholders = exports.getPluralCategory = exports.toLabelTerm = exports.toSentenceTerm = exports.DEFAULT_LANGUAGE = exports.translationKey = exports.isComposedValue = exports.composedValue = exports.isTranslatableTerm = exports.translatableTerm = exports.SAME_AS_ENGLISH_MARK = void 0;
7
7
  const RegExpEscape_1 = __importDefault(require("../Utils/RegExpEscape"));
8
8
  const DateLanguage_1 = require("./DateLanguage");
9
+ const MeaningKeys_1 = require("./MeaningKeys");
10
+ const NoBreakSpaces_1 = require("./NoBreakSpaces");
9
11
  const ReadingDirection_1 = require("./ReadingDirection");
12
+ /*
13
+ * A plural's one form that a language words exactly as English does, on
14
+ * purpose - French "{{count}} signal" beside its "{{count}} signaux",
15
+ * Portuguese "{{count}} monitor" - is marked as the language's own by one
16
+ * more entry: the "_one" key plus this suffix, holding the same text.
17
+ * Unmarked, a one form that reads as English's is English left in the
18
+ * locale (isEnglishPlaceholder in createTranslator), and French at 0 or
19
+ * Russian at 21 read English's "0 signals". No locale file holds a mark:
20
+ * the language's same-as-English list says which forms are its own, and
21
+ * the lookup answers with them - the Dashboard's bundle carries them
22
+ * (UI/esbuild-locales.js), the server's translator reads its own list
23
+ * (Server/Utils/ServerTranslation).
24
+ */
25
+ exports.SAME_AS_ENGLISH_MARK = "_sameAsEnglish";
10
26
  const translatableTerm = (text, options) => {
11
27
  return {
12
28
  translatableTerm: text,
@@ -47,10 +63,42 @@ const getBaseLanguage = (language) => {
47
63
  };
48
64
  /*
49
65
  * Languages that capitalize every noun, so a name keeps its capital in the
50
- * middle of a sentence. Languages without letter case (Japanese, Chinese,
51
- * Korean, Hindi, Persian) are unaffected by lower-casing either way.
66
+ * middle of a sentence.
52
67
  */
53
68
  const LANGUAGES_THAT_CAPITALIZE_NOUNS = ["de", "lb"];
69
+ /*
70
+ * Languages whose own script has no letter case: Arabic, Persian, Hindi,
71
+ * Japanese, Korean and Chinese, the product's, and Hebrew, Urdu and Thai.
72
+ * Their words have no capital to lower, but their translations carry Latin
73
+ * words - "Kubernetes Pod", "Namespace", "Deployment", "AWS" - and write each
74
+ * one with the capital the translator chose for that sentence: Japanese
75
+ * writes "Pod" 408 times to once. Lowering those would write a Japanese
76
+ * reader "このKubernetes podには" (#7951), so a term in one of these
77
+ * languages is left as its translation writes it, as it is in German. The
78
+ * capitals of a label in English, a Latin-script language or Russian are
79
+ * title case, and a sentence there still lowers them.
80
+ */
81
+ const LANGUAGES_WITHOUT_LETTER_CASE = [
82
+ "ar", // Arabic
83
+ "fa", // Persian
84
+ "he", // Hebrew
85
+ "hi", // Hindi
86
+ "ja", // Japanese
87
+ "ko", // Korean
88
+ "th", // Thai
89
+ "ur", // Urdu
90
+ "zh", // Chinese
91
+ ];
92
+ /*
93
+ * Whether a term keeps the case its translation writes in the middle of a
94
+ * sentence in `language`: in a language that capitalizes every noun, and in
95
+ * one whose script has no letter case.
96
+ */
97
+ const keepsTermsAsWritten = (language) => {
98
+ const base = getBaseLanguage(language);
99
+ return (LANGUAGES_THAT_CAPITALIZE_NOUNS.includes(base) ||
100
+ LANGUAGES_WITHOUT_LETTER_CASE.includes(base));
101
+ };
54
102
  /*
55
103
  * Proper nouns that keep their capital wherever they appear. Acronyms
56
104
  * ("API", "SLOs") and words with a capital inside them ("OneUptime",
@@ -131,12 +179,13 @@ const keepsItsCase = (part) => {
131
179
  /*
132
180
  * A label as it is written in the middle of a sentence in `language`:
133
181
  * "On-Call Duty Policies" -> "on-call duty policies", "API Keys" -> "API
134
- * keys", "Kubernetes Clusters" -> "Kubernetes clusters"; unchanged in German.
135
- * Runs of spaces collapse and the ends are trimmed.
182
+ * keys", "Kubernetes Clusters" -> "Kubernetes clusters"; unchanged in German
183
+ * and in a language whose script has no letter case ("Kubernetes Pod" in
184
+ * Japanese). Runs of spaces collapse and the ends are trimmed.
136
185
  */
137
186
  const toSentenceTerm = (text, language) => {
138
187
  const words = text.trim().split(/\s+/).filter(Boolean);
139
- if (LANGUAGES_THAT_CAPITALIZE_NOUNS.includes(getBaseLanguage(language))) {
188
+ if (keepsTermsAsWritten(language)) {
140
189
  return words.join(" ");
141
190
  }
142
191
  return words
@@ -536,9 +585,11 @@ const fillSentenceValues = (template, values, language) => {
536
585
  // A value as the English sentence shows it.
537
586
  const englishValue = (value) => {
538
587
  if ((0, exports.isTranslatableTerm)(value)) {
588
+ // A key that names its meaning goes in as its word (MeaningKeys).
589
+ const term = (0, MeaningKeys_1.withMeaningKeyAsItsWord)(value.translatableTerm);
539
590
  return value.inSentence
540
- ? (0, exports.toSentenceTerm)(value.translatableTerm, exports.DEFAULT_LANGUAGE)
541
- : value.translatableTerm.trim();
591
+ ? (0, exports.toSentenceTerm)(term, exports.DEFAULT_LANGUAGE)
592
+ : term.trim();
542
593
  }
543
594
  if ((0, exports.isComposedValue)(value)) {
544
595
  return value.compose(getEnglishTranslator());
@@ -705,6 +756,15 @@ const createTranslator = (lookup, language) => {
705
756
  const punctuate = (words) => {
706
757
  return punctuateInLanguage(words, activeLanguage);
707
758
  };
759
+ /*
760
+ * The reader's language's own wording of `english`, as it sets a line:
761
+ * punctuated, each number kept with its unit, and French's marks kept
762
+ * with their words (Types/NoBreakSpaces). Never a value's: it is set
763
+ * before the values go in.
764
+ */
765
+ const setWording = (wording, english) => {
766
+ return (0, NoBreakSpaces_1.withNoBreakSpaces)(punctuate(wording), english, activeLanguage);
767
+ };
708
768
  // The stored wording for `key`, or undefined when nothing has one.
709
769
  const find = (key) => {
710
770
  if (!lookup || !key) {
@@ -712,7 +772,16 @@ const createTranslator = (lookup, language) => {
712
772
  }
713
773
  try {
714
774
  const result = lookup(key);
715
- return typeof result === "string" && result.length > 0 && result !== key
775
+ /*
776
+ * Neither the key itself nor the word a key that names its meaning
777
+ * reads as (MeaningKeys) is a wording of its own: a lookup that
778
+ * already went back to the word (the front ends' translateString)
779
+ * leaves the key as untranslated as one that did not.
780
+ */
781
+ return typeof result === "string" &&
782
+ result.length > 0 &&
783
+ result !== key &&
784
+ result !== (0, MeaningKeys_1.getWordOfMeaningKey)(key)
716
785
  ? result
717
786
  : undefined;
718
787
  }
@@ -724,26 +793,35 @@ const createTranslator = (lookup, language) => {
724
793
  if (typeof text !== "string" || text.length === 0) {
725
794
  return text;
726
795
  }
727
- // A text with no wording of its own may be a value: as it is.
796
+ /*
797
+ * A text with no wording of its own may be a value: as it is. A key
798
+ * that names its meaning reads as its word (MeaningKeys).
799
+ */
728
800
  const stored = find(text);
729
- return stored === undefined ? text : punctuate(stored);
801
+ return stored === undefined
802
+ ? (0, MeaningKeys_1.withMeaningKeyAsItsWord)(text)
803
+ : setWording(stored, text);
730
804
  };
731
805
  const hasTranslation = (text) => {
732
806
  return find(text) !== undefined;
733
807
  };
734
808
  const translateTerm = (text, options) => {
735
- var _a;
736
809
  if (!text) {
737
810
  return "";
738
811
  }
739
- const translated = (_a = find(text)) !== null && _a !== void 0 ? _a : text;
812
+ const stored = find(text);
813
+ const translated = stored === undefined
814
+ ? (0, MeaningKeys_1.withMeaningKeyAsItsWord)(text)
815
+ : (0, NoBreakSpaces_1.withNoBreakSpaces)(stored, text, activeLanguage);
740
816
  if (!(options === null || options === void 0 ? void 0 : options.inSentence)) {
741
817
  return translated.trim();
742
818
  }
743
819
  /*
744
820
  * Cased the reader's way, translated or not: a German noun spelled as in
745
- * English ("Labels", "Monitor") keeps its capital in a German sentence.
746
- * An English sentence never comes here - it is filled by fillTemplate.
821
+ * English ("Labels", "Monitor") keeps its capital in a German sentence,
822
+ * and so does Japanese's "Kubernetes Pod", which its file writes as
823
+ * English does. An English sentence never comes here - it is filled by
824
+ * fillTemplate.
747
825
  */
748
826
  return (0, exports.toSentenceTerm)(translated, activeLanguage);
749
827
  };
@@ -803,8 +881,8 @@ const createTranslator = (lookup, language) => {
803
881
  : fillSentenceValues(punctuate(english), translatedValues(values), activeLanguage);
804
882
  }
805
883
  return setsValuesApart
806
- ? fillSettingValuesApart(punctuate(stored), translatedValues(values), readerDirection, setsSlotsApart, activeLanguage)
807
- : fillSentenceValues(punctuate(stored), translatedValues(values), activeLanguage);
884
+ ? fillSettingValuesApart(setWording(stored, english), translatedValues(values), readerDirection, setsSlotsApart, activeLanguage)
885
+ : fillSentenceValues(setWording(stored, english), translatedValues(values), activeLanguage);
808
886
  };
809
887
  const translateTemplate = (template, values = {}, options) => {
810
888
  return fill(find(template), template, values, options);
@@ -859,7 +937,8 @@ const createTranslator = (lookup, language) => {
859
937
  * same: the language then words the sentence alike for every count, and
860
938
  * the form is its own - French's "0 VM". A general form left English is
861
939
  * never that witness: the lookup gives nothing for a key that maps to
862
- * itself.
940
+ * itself. Or unless the locale marks the form as its own
941
+ * (SAME_AS_ENGLISH_MARK): French says "0 signal" beside its "3 signaux".
863
942
  * - Every other form - the general one, and a "_few", "_many", "_two" or
864
943
  * "_zero" one, which en.json has none of - is English left in the
865
944
  * locale when it reads as English's other form, what English writes for
@@ -870,7 +949,9 @@ const createTranslator = (lookup, language) => {
870
949
  if (form.category !== "one") {
871
950
  return form.text === template.other;
872
951
  }
873
- return form.text === template.one && find(template.other) !== form.text;
952
+ return (form.text === template.one &&
953
+ find(template.other) !== form.text &&
954
+ find(`${template.other}_one${exports.SAME_AS_ENGLISH_MARK}`) !== form.text);
874
955
  };
875
956
  const translatePlural = (template, count, values = {}, options) => {
876
957
  // English has two forms: exactly one, and everything else.
@@ -2,6 +2,7 @@ import commonJsModule from "./Translator.js";
2
2
  export const DEFAULT_LANGUAGE = commonJsModule.DEFAULT_LANGUAGE;
3
3
  export const DOT_ZERO_INLINE_SEPARATOR = commonJsModule.DOT_ZERO_INLINE_SEPARATOR;
4
4
  export const INLINE_SEPARATOR = commonJsModule.INLINE_SEPARATOR;
5
+ export const SAME_AS_ENGLISH_MARK = commonJsModule.SAME_AS_ENGLISH_MARK;
5
6
  export const composedValue = commonJsModule.composedValue;
6
7
  export const createTranslator = commonJsModule.createTranslator;
7
8
  export const fillTemplate = commonJsModule.fillTemplate;
@@ -86,3 +86,36 @@ export declare const getActivityAtRenewal: (data: {
86
86
  reportedInactivityInSeconds: number | null;
87
87
  now: Date;
88
88
  }) => Date;
89
+ export declare const LONGEST_INACTIVITY_FIELD: string;
90
+ export interface ReportedInactivity {
91
+ forSeconds: number;
92
+ endedSecondsAgo: number;
93
+ }
94
+ export declare const readReportedLongestInactivity: (value: unknown) => ReportedInactivity | null;
95
+ export interface RenewalReport {
96
+ inactiveForInSeconds: number | null;
97
+ longestInactivity: ReportedInactivity | null;
98
+ }
99
+ export declare const NO_RENEWAL_REPORT: RenewalReport;
100
+ export type SessionRenewalOutcome = {
101
+ hasEnded: true;
102
+ reason: SessionEndReason;
103
+ lastActiveAt: Date;
104
+ } | {
105
+ hasEnded: false;
106
+ lastActiveAt: Date;
107
+ };
108
+ export declare const getUnknownInactivity: (data: {
109
+ storedLastActiveAt: Date;
110
+ longestInactivity: ReportedInactivity | null;
111
+ now: Date;
112
+ }) => {
113
+ fromMs: number;
114
+ toMs: number;
115
+ } | null;
116
+ export declare const decideSessionRenewal: (data: {
117
+ facts: SessionFacts;
118
+ lengths: SessionLengths | null | undefined;
119
+ report: RenewalReport;
120
+ now: Date;
121
+ }) => SessionRenewalOutcome;
@@ -86,3 +86,36 @@ export declare const getActivityAtRenewal: (data: {
86
86
  reportedInactivityInSeconds: number | null;
87
87
  now: Date;
88
88
  }) => Date;
89
+ export declare const LONGEST_INACTIVITY_FIELD: string;
90
+ export interface ReportedInactivity {
91
+ forSeconds: number;
92
+ endedSecondsAgo: number;
93
+ }
94
+ export declare const readReportedLongestInactivity: (value: unknown) => ReportedInactivity | null;
95
+ export interface RenewalReport {
96
+ inactiveForInSeconds: number | null;
97
+ longestInactivity: ReportedInactivity | null;
98
+ }
99
+ export declare const NO_RENEWAL_REPORT: RenewalReport;
100
+ export type SessionRenewalOutcome = {
101
+ hasEnded: true;
102
+ reason: SessionEndReason;
103
+ lastActiveAt: Date;
104
+ } | {
105
+ hasEnded: false;
106
+ lastActiveAt: Date;
107
+ };
108
+ export declare const getUnknownInactivity: (data: {
109
+ storedLastActiveAt: Date;
110
+ longestInactivity: ReportedInactivity | null;
111
+ now: Date;
112
+ }) => {
113
+ fromMs: number;
114
+ toMs: number;
115
+ } | null;
116
+ export declare const decideSessionRenewal: (data: {
117
+ facts: SessionFacts;
118
+ lengths: SessionLengths | null | undefined;
119
+ report: RenewalReport;
120
+ now: Date;
121
+ }) => SessionRenewalOutcome;