@oneuptime/common 14.0.110 → 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 (527) hide show
  1. package/Models/DatabaseModels/AIRunRecording.d.mts +12 -0
  2. package/Models/DatabaseModels/AIRunRecording.d.ts +12 -0
  3. package/Models/DatabaseModels/AIRunRecording.js +181 -0
  4. package/Models/DatabaseModels/AIRunRecording.mjs +2 -0
  5. package/Models/DatabaseModels/Alert.d.mts +1 -0
  6. package/Models/DatabaseModels/Alert.d.ts +1 -0
  7. package/Models/DatabaseModels/Alert.js +52 -2
  8. package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
  9. package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
  10. package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
  11. package/Models/DatabaseModels/DataStore.js +9 -0
  12. package/Models/DatabaseModels/EmailLog.js +2 -2
  13. package/Models/DatabaseModels/Form.js +3 -3
  14. package/Models/DatabaseModels/FormSubmission.js +4 -4
  15. package/Models/DatabaseModels/GlobalConfig.js +46 -45
  16. package/Models/DatabaseModels/Incident.d.mts +1 -0
  17. package/Models/DatabaseModels/Incident.d.ts +1 -0
  18. package/Models/DatabaseModels/Incident.js +53 -2
  19. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
  20. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
  21. package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
  22. package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
  23. package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
  24. package/Models/DatabaseModels/Index.js +6 -0
  25. package/Models/DatabaseModels/InventoryItem.js +11 -0
  26. package/Models/DatabaseModels/Monitor.js +51 -17
  27. package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
  28. package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
  29. package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
  30. package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
  31. package/Models/DatabaseModels/MonitorProbe.js +22 -5
  32. package/Models/DatabaseModels/NetworkDevice.js +23 -7
  33. package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
  34. package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
  35. package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
  36. package/Models/DatabaseModels/NetworkInterface.js +5 -5
  37. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +19 -5
  38. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
  39. package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
  40. package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +2 -0
  41. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
  42. package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
  43. package/Models/DatabaseModels/Project.d.mts +1 -0
  44. package/Models/DatabaseModels/Project.d.ts +1 -0
  45. package/Models/DatabaseModels/Project.js +46 -3
  46. package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
  47. package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
  48. package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
  49. package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
  50. package/Models/DatabaseModels/RunbookExecution.js +2 -2
  51. package/Models/DatabaseModels/RunbookRule.js +6 -6
  52. package/Models/DatabaseModels/ScheduledMaintenance.js +3 -3
  53. package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
  54. package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
  55. package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
  56. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +1 -1
  57. package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
  58. package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
  59. package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
  60. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +3 -3
  61. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
  62. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +3 -3
  63. package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
  64. package/Models/DatabaseModels/TeamMember.js +10 -1
  65. package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
  66. package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
  67. package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
  68. package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
  69. package/Server/Services/DatabaseService.d.mts +4 -1
  70. package/Server/Services/DatabaseService.d.ts +4 -1
  71. package/Server/Types/Database/CountBy.d.mts +1 -0
  72. package/Server/Types/Database/CountBy.d.ts +1 -0
  73. package/Server/Types/Database/UpdateLimit.d.mts +6 -0
  74. package/Server/Types/Database/UpdateLimit.d.ts +6 -0
  75. package/Types/AI/AIActionWords.d.mts +28 -2
  76. package/Types/AI/AIActionWords.d.ts +28 -2
  77. package/Types/AI/AIActionWords.js +235 -3
  78. package/Types/AI/AIActionWords.mjs +8 -0
  79. package/Types/AI/AIChatTypes.d.mts +3 -1
  80. package/Types/AI/AIChatTypes.d.ts +3 -1
  81. package/Types/AI/AIReadTableWords.d.mts +192 -0
  82. package/Types/AI/AIReadTableWords.d.ts +192 -0
  83. package/Types/AI/AIReadTableWords.js +368 -0
  84. package/Types/AI/AIReadTableWords.mjs +18 -0
  85. package/Types/AI/AiOutcomes.d.mts +57 -0
  86. package/Types/AI/AiOutcomes.d.ts +57 -0
  87. package/Types/AI/AiOutcomes.js +67 -0
  88. package/Types/AI/AiOutcomes.mjs +10 -0
  89. package/Types/AI/AiRunRefusal.d.mts +48 -0
  90. package/Types/AI/AiRunRefusal.d.ts +48 -0
  91. package/Types/AI/AiRunRefusal.js +208 -0
  92. package/Types/AI/AiRunRefusal.mjs +12 -0
  93. package/Types/AI/InvestigationRecording.d.mts +46 -0
  94. package/Types/AI/InvestigationRecording.d.ts +46 -0
  95. package/Types/AI/InvestigationRecording.js +42 -0
  96. package/Types/AI/InvestigationRecording.mjs +7 -0
  97. package/Types/AI/ResourceAiAccessPermissions.js +7 -18
  98. package/Types/API/HTTPResponse.d.mts +3 -0
  99. package/Types/API/HTTPResponse.d.ts +3 -0
  100. package/Types/API/HTTPResponse.js +15 -0
  101. package/Types/AuditLog/AuditLogActionLabel.js +19 -9
  102. package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
  103. package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
  104. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +32 -1
  105. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +32 -1
  106. package/Types/BaseDatabase/AggregationIntervalUtil.js +199 -2
  107. package/Types/BaseDatabase/ListResult.d.mts +1 -0
  108. package/Types/BaseDatabase/ListResult.d.ts +1 -0
  109. package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
  110. package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
  111. package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
  112. package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
  113. package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
  114. package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
  115. package/Types/Cloud/CloudResourceHealth.js +405 -13
  116. package/Types/Cloud/CloudResourceHealth.mjs +28 -0
  117. package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
  118. package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
  119. package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
  120. package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
  121. package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
  122. package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
  123. package/Types/DataObservability/DataCheckRefusals.js +77 -0
  124. package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
  125. package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
  126. package/Types/Date.d.mts +8 -1
  127. package/Types/Date.d.ts +8 -1
  128. package/Types/Date.js +61 -7
  129. package/Types/Date.mjs +1 -0
  130. package/Types/DateLanguage.d.mts +2 -0
  131. package/Types/DateLanguage.d.ts +2 -0
  132. package/Types/DateLanguage.js +8 -5
  133. package/Types/Email/EmailTemplateType.d.mts +1 -0
  134. package/Types/Email/EmailTemplateType.d.ts +1 -0
  135. package/Types/Email/EmailTemplateType.js +2 -0
  136. package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
  137. package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
  138. package/Types/Email/ServerEmailEnvironment.js +793 -0
  139. package/Types/Email/ServerEmailEnvironment.mjs +14 -0
  140. package/Types/Exception/AiRunRefusalException.d.mts +6 -0
  141. package/Types/Exception/AiRunRefusalException.d.ts +6 -0
  142. package/Types/Exception/AiRunRefusalException.js +23 -0
  143. package/Types/Exception/AiRunRefusalException.mjs +2 -0
  144. package/Types/Exception/EgressGuardException.js +1 -1
  145. package/Types/Exception/ErrorMessageRule.d.mts +1 -0
  146. package/Types/Exception/ErrorMessageRule.d.ts +1 -0
  147. package/Types/Exception/ErrorMessageRule.js +67 -13
  148. package/Types/Exception/ErrorMessageRule.mjs +1 -0
  149. package/Types/Exception/ExceptionMessages.d.mts +2 -0
  150. package/Types/Exception/ExceptionMessages.d.ts +2 -0
  151. package/Types/Exception/ExceptionMessages.js +2 -0
  152. package/Types/Form/FormTargetCatalog.js +2 -2
  153. package/Types/Form/FormTargetType.js +2 -2
  154. package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
  155. package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
  156. package/Types/Incident/PostmortemActionItemStatus.js +74 -0
  157. package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
  158. package/Types/JSONFunctions.js +10 -3
  159. package/Types/Link.d.mts +1 -0
  160. package/Types/Link.d.ts +1 -0
  161. package/Types/ListData.d.mts +2 -0
  162. package/Types/ListData.d.ts +2 -0
  163. package/Types/ListData.js +4 -0
  164. package/Types/MeaningKeys.d.mts +4 -0
  165. package/Types/MeaningKeys.d.ts +4 -0
  166. package/Types/MeaningKeys.js +74 -0
  167. package/Types/MeaningKeys.mjs +5 -0
  168. package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
  169. package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
  170. package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
  171. package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
  172. package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
  173. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
  174. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
  175. package/Types/Monitor/UptimeHistoryLabels.js +2 -2
  176. package/Types/Monitor/WhoIsTold.d.mts +3 -0
  177. package/Types/Monitor/WhoIsTold.d.ts +3 -0
  178. package/Types/Monitor/WhoIsTold.js +63 -13
  179. package/Types/NoBreakSpaces.d.mts +16 -0
  180. package/Types/NoBreakSpaces.d.ts +16 -0
  181. package/Types/NoBreakSpaces.js +419 -0
  182. package/Types/NoBreakSpaces.mjs +9 -0
  183. package/Types/NotificationRule/PagingLadder.d.mts +12 -0
  184. package/Types/NotificationRule/PagingLadder.d.ts +12 -0
  185. package/Types/NotificationRule/PagingLadder.js +159 -11
  186. package/Types/NotificationRule/PagingLadder.mjs +3 -0
  187. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
  188. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
  189. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
  190. package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
  191. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
  192. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
  193. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
  194. package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
  195. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
  196. package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
  197. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
  198. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
  199. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
  200. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
  201. package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
  202. package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
  203. package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
  204. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
  205. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
  206. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
  207. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
  208. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
  209. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
  210. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
  211. package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
  212. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
  213. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
  214. package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
  215. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  216. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
  217. package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
  218. package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
  219. package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
  220. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
  221. package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
  222. package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
  223. package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
  224. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
  225. package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
  226. package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
  227. package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
  228. package/Types/OpenStack/OpenStackCapacity.js +12 -5
  229. package/Types/Permission.d.mts +4 -0
  230. package/Types/Permission.d.ts +4 -0
  231. package/Types/Permission.js +66 -10
  232. package/Types/Probe/ProbeCapability.d.mts +2 -1
  233. package/Types/Probe/ProbeCapability.d.ts +2 -1
  234. package/Types/Probe/ProbeCapability.js +10 -0
  235. package/Types/Product/ProductUsage.js +2 -1
  236. package/Types/Product/ProjectProductsAnswer.js +2 -1
  237. package/Types/ReaderLanguage.d.mts +1 -0
  238. package/Types/ReaderLanguage.d.ts +1 -0
  239. package/Types/ReaderLanguage.js +13 -1
  240. package/Types/ReaderLanguage.mjs +1 -0
  241. package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
  242. package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
  243. package/Types/ResourceAiAgent/AiResourceType.js +12 -0
  244. package/Types/Rules/RuleRun.js +2 -2
  245. package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
  246. package/Types/Rum/ProductAnalyticsEvents.js +13 -1
  247. package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
  248. package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
  249. package/Types/Rum/SessionReplayCustomEvents.js +12 -0
  250. package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
  251. package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
  252. package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
  253. package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
  254. package/Types/ServerSending/ServerSendingStatus.js +49 -2
  255. package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
  256. package/Types/SetupHealth/SetupHealth.d.mts +1 -0
  257. package/Types/SetupHealth/SetupHealth.d.ts +1 -0
  258. package/Types/SetupHealth/SetupHealth.js +13 -5
  259. package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
  260. package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
  261. package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
  262. package/Types/StatusPage/DefaultStatusNames.js +74 -28
  263. package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
  264. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
  265. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
  266. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
  267. package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
  268. package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
  269. package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
  270. package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
  271. package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
  272. package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
  273. package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
  274. package/Types/Telemetry/CompatibleIngest.js +123 -0
  275. package/Types/Telemetry/CompatibleIngest.mjs +21 -0
  276. package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
  277. package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
  278. package/Types/Telemetry/TelemetryIngestSurface.js +48 -7
  279. package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
  280. package/Types/TimezoneAlias.d.mts +1 -0
  281. package/Types/TimezoneAlias.d.ts +1 -0
  282. package/Types/TimezoneAlias.js +13 -0
  283. package/Types/Translator.d.mts +1 -0
  284. package/Types/Translator.d.ts +1 -0
  285. package/Types/Translator.js +470 -63
  286. package/Types/Translator.mjs +1 -0
  287. package/Types/UserSession/SessionLength.d.mts +33 -0
  288. package/Types/UserSession/SessionLength.d.ts +33 -0
  289. package/Types/UserSession/SessionLength.js +134 -5
  290. package/Types/UserSession/SessionLength.mjs +5 -0
  291. package/Types/Workflow/RunRecord.js +1 -1
  292. package/Types/Workflow/Templates.js +2 -2
  293. package/Types/Workflow/WorkflowStatus.js +21 -10
  294. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
  295. package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
  296. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +26 -1
  297. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +26 -1
  298. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
  299. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
  300. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
  301. package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
  302. package/Utils/AI/InvestigationReport.js +2 -2
  303. package/Utils/API.d.mts +0 -11
  304. package/Utils/API.d.ts +0 -11
  305. package/Utils/API.js +0 -432
  306. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
  307. package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
  308. package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
  309. package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
  310. package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
  311. package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
  312. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
  313. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
  314. package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
  315. package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
  316. package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
  317. package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
  318. package/Utils/DefaultRecordNames.d.mts +6 -0
  319. package/Utils/DefaultRecordNames.d.ts +6 -0
  320. package/Utils/DefaultRecordNames.js +122 -0
  321. package/Utils/DefaultRecordNames.mjs +6 -0
  322. package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
  323. package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
  324. package/Utils/Grok/Grok.js +7 -4
  325. package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
  326. package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
  327. package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
  328. package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
  329. package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
  330. package/Utils/HostAddressUtil.d.mts +1 -0
  331. package/Utils/HostAddressUtil.d.ts +1 -0
  332. package/Utils/HostAddressUtil.js +30 -0
  333. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
  334. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
  335. package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
  336. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
  337. package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
  338. package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
  339. package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
  340. package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
  341. package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
  342. package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
  343. package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
  344. package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
  345. package/Utils/LinearRegExp/LinearRegExp.js +5 -1
  346. package/Utils/LookupTable.d.mts +3 -0
  347. package/Utils/LookupTable.d.ts +3 -0
  348. package/Utils/LookupTable.js +61 -0
  349. package/Utils/LookupTable.mjs +3 -0
  350. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
  351. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
  352. package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
  353. package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
  354. package/Utils/Markdown/OverLongText.js +296 -2
  355. package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
  356. package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
  357. package/Utils/Markdown/SlowMarkdown.js +354 -4
  358. package/Utils/Markdown/SlowMarkdown.mjs +1 -0
  359. package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
  360. package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
  361. package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
  362. package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
  363. package/Utils/Metrics/MetricSeriesScope.js +5 -1
  364. package/Utils/Milliseconds.d.mts +7 -0
  365. package/Utils/Milliseconds.d.ts +7 -0
  366. package/Utils/Milliseconds.js +60 -0
  367. package/Utils/Milliseconds.mjs +4 -0
  368. package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
  369. package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
  370. package/Utils/Monitor/EndpointAttachmentUtil.js +91 -21
  371. package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
  372. package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
  373. package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
  374. package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
  375. package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
  376. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
  377. package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
  378. package/Utils/Monitor/MonitorRootCauseWording.d.mts +5 -0
  379. package/Utils/Monitor/MonitorRootCauseWording.d.ts +5 -0
  380. package/Utils/Monitor/MonitorRootCauseWording.js +148 -5
  381. package/Utils/Monitor/MonitoringOff.d.mts +2 -0
  382. package/Utils/Monitor/MonitoringOff.d.ts +2 -0
  383. package/Utils/Monitor/MonitoringOff.js +21 -0
  384. package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
  385. package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
  386. package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
  387. package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
  388. package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
  389. package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
  390. package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
  391. package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
  392. package/Utils/Monitor/ProbeAgreementRule.js +58 -0
  393. package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
  394. package/Utils/Monitor/ProbeFailureReading.d.mts +18 -0
  395. package/Utils/Monitor/ProbeFailureReading.d.ts +18 -0
  396. package/Utils/Monitor/ProbeFailureReading.js +166 -0
  397. package/Utils/Monitor/ProbeFailureReading.mjs +8 -0
  398. package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
  399. package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
  400. package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
  401. package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
  402. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
  403. package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
  404. package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
  405. package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
  406. package/Utils/Project/NextNumber.js +1 -1
  407. package/Utils/PromQL/PromQLAst.d.mts +159 -0
  408. package/Utils/PromQL/PromQLAst.d.ts +159 -0
  409. package/Utils/PromQL/PromQLAst.js +118 -0
  410. package/Utils/PromQL/PromQLAst.mjs +12 -0
  411. package/Utils/PromQL/PromQLDuration.d.mts +2 -0
  412. package/Utils/PromQL/PromQLDuration.d.ts +2 -0
  413. package/Utils/PromQL/PromQLDuration.js +78 -0
  414. package/Utils/PromQL/PromQLDuration.mjs +3 -0
  415. package/Utils/PromQL/PromQLEngine.d.mts +15 -0
  416. package/Utils/PromQL/PromQLEngine.d.ts +15 -0
  417. package/Utils/PromQL/PromQLEngine.js +974 -0
  418. package/Utils/PromQL/PromQLEngine.mjs +7 -0
  419. package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
  420. package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
  421. package/Utils/PromQL/PromQLEngineTypes.js +10 -0
  422. package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
  423. package/Utils/PromQL/PromQLError.d.mts +11 -0
  424. package/Utils/PromQL/PromQLError.d.ts +11 -0
  425. package/Utils/PromQL/PromQLError.js +27 -0
  426. package/Utils/PromQL/PromQLError.mjs +3 -0
  427. package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
  428. package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
  429. package/Utils/PromQL/PromQLFunctionEvaluators.js +829 -0
  430. package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
  431. package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
  432. package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
  433. package/Utils/PromQL/PromQLFunctions.js +127 -0
  434. package/Utils/PromQL/PromQLFunctions.mjs +4 -0
  435. package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
  436. package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
  437. package/Utils/PromQL/PromQLLabelOrder.js +212 -0
  438. package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
  439. package/Utils/PromQL/PromQLLabels.d.mts +11 -0
  440. package/Utils/PromQL/PromQLLabels.d.ts +11 -0
  441. package/Utils/PromQL/PromQLLabels.js +219 -0
  442. package/Utils/PromQL/PromQLLabels.mjs +9 -0
  443. package/Utils/PromQL/PromQLLexer.d.mts +39 -0
  444. package/Utils/PromQL/PromQLLexer.d.ts +39 -0
  445. package/Utils/PromQL/PromQLLexer.js +391 -0
  446. package/Utils/PromQL/PromQLLexer.mjs +3 -0
  447. package/Utils/PromQL/PromQLMath.d.mts +19 -0
  448. package/Utils/PromQL/PromQLMath.d.ts +19 -0
  449. package/Utils/PromQL/PromQLMath.js +200 -0
  450. package/Utils/PromQL/PromQLMath.mjs +9 -0
  451. package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
  452. package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
  453. package/Utils/PromQL/PromQLMetricNames.js +205 -0
  454. package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
  455. package/Utils/PromQL/PromQLParser.d.mts +4 -0
  456. package/Utils/PromQL/PromQLParser.d.ts +4 -0
  457. package/Utils/PromQL/PromQLParser.js +836 -0
  458. package/Utils/PromQL/PromQLParser.mjs +4 -0
  459. package/Utils/PromQL/PromQLRegex.d.mts +20 -0
  460. package/Utils/PromQL/PromQLRegex.d.ts +20 -0
  461. package/Utils/PromQL/PromQLRegex.js +1014 -0
  462. package/Utils/PromQL/PromQLRegex.mjs +5 -0
  463. package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
  464. package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
  465. package/Utils/PromQL/PrometheusResponse.js +92 -0
  466. package/Utils/PromQL/PrometheusResponse.mjs +3 -0
  467. package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
  468. package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
  469. package/Utils/PromQL/RE2CharacterClass.js +532 -0
  470. package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
  471. package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
  472. package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
  473. package/Utils/RequestFailedDetailsUtil.js +452 -0
  474. package/Utils/RequestFailedDetailsUtil.mjs +2 -0
  475. package/Utils/Rum/PathInSentence.d.mts +5 -0
  476. package/Utils/Rum/PathInSentence.d.ts +5 -0
  477. package/Utils/Rum/PathInSentence.js +46 -0
  478. package/Utils/Rum/PathInSentence.mjs +6 -0
  479. package/Utils/Rum/UrlScrubber.d.mts +5 -1
  480. package/Utils/Rum/UrlScrubber.d.ts +5 -1
  481. package/Utils/Rum/UrlScrubber.js +153 -7
  482. package/Utils/Rum/UserFlow.d.mts +1 -1
  483. package/Utils/Rum/UserFlow.d.ts +1 -1
  484. package/Utils/Rum/UserFlow.js +202 -29
  485. package/Utils/Rum/UserFlow.mjs +1 -1
  486. package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
  487. package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
  488. package/Utils/Runbook/RunbookStepsSignature.js +30 -0
  489. package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
  490. package/Utils/Schema/TypeSchemas.js +6 -0
  491. package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
  492. package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
  493. package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
  494. package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
  495. package/Utils/Slo/SloDuration.d.mts +5 -2
  496. package/Utils/Slo/SloDuration.d.ts +5 -2
  497. package/Utils/Slo/SloDuration.js +11 -6
  498. package/Utils/Slo/SloHealth.js +1 -1
  499. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  500. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  501. package/Utils/Sms/OnCallPageSms.js +3 -1
  502. package/Utils/StateListType.d.mts +11 -0
  503. package/Utils/StateListType.d.ts +11 -0
  504. package/Utils/StateListType.js +21 -0
  505. package/Utils/StateListType.mjs +2 -0
  506. package/Utils/StateOrder.d.mts +8 -11
  507. package/Utils/StateOrder.d.ts +8 -11
  508. package/Utils/StateOrder.js +50 -88
  509. package/Utils/StateOrder.mjs +2 -0
  510. package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
  511. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
  512. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
  513. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
  514. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
  515. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
  516. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
  517. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
  518. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
  519. package/Utils/Syslog/SyslogMessageParser.js +16 -6
  520. package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
  521. package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
  522. package/Utils/Telemetry/HeartbeatAvailability.js +113 -26
  523. package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
  524. package/Utils/ValueFormatter.d.mts +1 -0
  525. package/Utils/ValueFormatter.d.ts +1 -0
  526. package/Utils/ValueFormatter.js +258 -18
  527. package/package.json +1 -1
@@ -1,8 +1,28 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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
+ const RegExpEscape_1 = __importDefault(require("../Utils/RegExpEscape"));
4
8
  const DateLanguage_1 = require("./DateLanguage");
9
+ const MeaningKeys_1 = require("./MeaningKeys");
10
+ const NoBreakSpaces_1 = require("./NoBreakSpaces");
5
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";
6
26
  const translatableTerm = (text, options) => {
7
27
  return {
8
28
  translatableTerm: text,
@@ -43,48 +63,109 @@ const getBaseLanguage = (language) => {
43
63
  };
44
64
  /*
45
65
  * Languages that capitalize every noun, so a name keeps its capital in the
46
- * middle of a sentence. Languages without letter case (Japanese, Chinese,
47
- * Korean, Hindi, Persian) are unaffected by lower-casing either way.
66
+ * middle of a sentence.
48
67
  */
49
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
+ };
50
102
  /*
51
103
  * Proper nouns that keep their capital wherever they appear. Acronyms
52
104
  * ("API", "SLOs") and words with a capital inside them ("OneUptime",
53
105
  * "GitHub", "IoT") are kept without being listed.
106
+ *
107
+ * Among them every vendor the product names (issue #7692): the cloud vendors
108
+ * of CloudPlatform, the network vendors of the device catalog (the SNMP
109
+ * vendor templates, the traffic and events setups, the Meraki dashboard) and
110
+ * the integrations - a name said in a sentence ("Meraki devices") is never
111
+ * "meraki". A word that is also a word of its own ("Extreme", "Elastic",
112
+ * "Alto" - "high" in Spanish and Italian) is not listed: it would keep its
113
+ * capital as that word too.
54
114
  */
55
115
  const PROPER_NOUNS = [
116
+ "Alertmanager",
117
+ "Alibaba",
118
+ "Arista",
119
+ "Aruba",
56
120
  "Azure",
121
+ "Cambium",
57
122
  "Ceph",
123
+ "Cisco",
124
+ "Datadog",
125
+ "Dell",
58
126
  "Discord",
59
127
  "Docker",
128
+ "Fortinet",
60
129
  "Google",
61
130
  "Grafana",
131
+ "Huawei",
62
132
  "Huntress",
63
133
  "Jira",
134
+ "Juniper",
64
135
  "Kubernetes",
65
136
  "Linux",
66
137
  "Mattermost",
138
+ "Meraki",
67
139
  "Microsoft",
68
140
  "Okta",
69
141
  "OpenTelemetry",
142
+ "Opsgenie",
70
143
  "Podman",
71
144
  "Prometheus",
72
145
  "Proxmox",
73
146
  "OpenStack",
74
147
  "Slack",
148
+ "Sophos",
149
+ "Splunk",
75
150
  "Swarm",
76
151
  "Telegram",
152
+ "Tencent",
77
153
  "Terraform",
78
154
  "Twilio",
155
+ "Ubiquiti",
156
+ "Vercel",
79
157
  "Windows",
158
+ "Zabbix",
80
159
  ];
81
160
  /*
82
161
  * Proper nouns of two words: the second keeps its capital after the first
83
162
  * ("Google Cloud project", but "cloud resources").
84
163
  */
85
164
  const PROPER_NOUN_PAIRS = [
165
+ ["Alibaba", "Cloud"],
86
166
  ["Google", "Cloud"],
87
167
  ["Microsoft", "Teams"],
168
+ ["Tencent", "Cloud"],
88
169
  ];
89
170
  // "API", "SLOs": two capitals in a row.
90
171
  const ACRONYM_PATTERN = /\p{Lu}{2,}/u;
@@ -98,12 +179,13 @@ const keepsItsCase = (part) => {
98
179
  /*
99
180
  * A label as it is written in the middle of a sentence in `language`:
100
181
  * "On-Call Duty Policies" -> "on-call duty policies", "API Keys" -> "API
101
- * keys", "Kubernetes Clusters" -> "Kubernetes clusters"; unchanged in German.
102
- * 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.
103
185
  */
104
186
  const toSentenceTerm = (text, language) => {
105
187
  const words = text.trim().split(/\s+/).filter(Boolean);
106
- if (LANGUAGES_THAT_CAPITALIZE_NOUNS.includes(getBaseLanguage(language))) {
188
+ if (keepsTermsAsWritten(language)) {
107
189
  return words.join(" ");
108
190
  }
109
191
  return words
@@ -245,12 +327,269 @@ const LETTER = /\p{L}/u;
245
327
  const hasWords = (template) => {
246
328
  return LETTER.test(template.replace(PLACEHOLDER, ""));
247
329
  };
330
+ /*
331
+ * WHERE A VALUE STARTS A SENTENCE.
332
+ *
333
+ * A word cased for the middle of a sentence (an inSentence term: "le
334
+ * collecteur OneUptime", "monitors") takes a capital where the reader's
335
+ * sentence starts with it: French says "Configurez le collecteur OneUptime"
336
+ * and "Le collecteur OneUptime ne remonte plus de données", Dutch "Monitors
337
+ * zoeken…" (issue #7692). A language puts a value where its grammar wants
338
+ * it, so only the filled sentence knows where it starts one.
339
+ *
340
+ * A placeholder starts a sentence where, past any opening quote, bracket or
341
+ * Spanish opening mark, a line starts, or a sentence's end - ". ", "! ",
342
+ * "? ", "… ", with any closing quote or bracket - comes right before it; or
343
+ * where it starts the template, and the template reads as a sentence: it
344
+ * ends as one does (". ! ? … :"), or holds a sentence's end before more
345
+ * words. A template that does neither is a piece of another sentence -
346
+ * "{{kind}} {{name}}", "{{names}} and {{count}} more" - whose values are
347
+ * cased where that sentence puts them. The full stop of an abbreviation
348
+ * ends no sentence (NOT_A_SENTENCE_END).
349
+ */
350
+ /*
351
+ * The words a language shortens before the value they introduce, in lower
352
+ * case: "pr. time" (per hour), "kl. 12" (at 12 o'clock), "ca. 5", "z. B.",
353
+ * "bijv.", "máx. 10", "Serienr. 123". Their full stop never ends a
354
+ * sentence: Danish fixes one resource "pr. hændelse", never with a capital.
355
+ * Not a unit after a number ("5 min.", "3 Std."), whose full stop may end
356
+ * one: "Checked every 5 min. 2 more checks are off."
357
+ */
358
+ const SHORTENED_BEFORE_A_VALUE = [
359
+ "ad es", // Italian: for example ("es" alone is Spanish "is")
360
+ "aprox", // Spanish: about
361
+ "bijv", // Dutch: for example
362
+ "ca", // Danish: about
363
+ "col", // Spanish: column
364
+ "ex", // French, Portuguese: for example ("par ex.", "por ex.")
365
+ "gem", // Dutch: on average
366
+ "gns", // Danish: on average
367
+ "kl", // Danish, Norwegian, Swedish: at (a time)
368
+ "lín", // Spanish: line
369
+ "maks", // Danish, Norwegian: at most
370
+ "max", // German, French, Dutch: at most
371
+ "máx", // Spanish, Portuguese: at most
372
+ "moy", // French: on average
373
+ "n", // Italian: number
374
+ "nr", // Dutch: number
375
+ "pr", // Danish: per
376
+ "prom", // Spanish: on average
377
+ "serienr", // Danish, Dutch, Norwegian: serial number
378
+ "seriennr", // German: serial number
379
+ "z. b", // German: for example ("B." alone may end a sentence: "plan B.")
380
+ "админ", // Russian: administrative
381
+ "макс", // Russian: at most
382
+ "сред", // Russian: on average
383
+ ];
384
+ // Those words as a pattern.
385
+ const SHORTENED_WORDS = SHORTENED_BEFORE_A_VALUE.map(RegExpEscape_1.default).join("|");
386
+ /*
387
+ * Right before a full stop that ends no sentence: an abbreviation with a
388
+ * full stop inside ("e.g.", "z.B.", "f.eks.", "т.е."), or one of the words
389
+ * above as a word of its own, in either case ("Ca. 5 timer").
390
+ */
391
+ const NOT_A_SENTENCE_END = `(?<!\\p{L}\\.\\p{L}{1,3})(?<!(?:^|\\P{L})(?:${SHORTENED_WORDS}))`;
392
+ const SENTENCE_END = `(?:${NOT_A_SENTENCE_END}\\.|[!?…])["'»”’)\\]]*`;
393
+ // What a sentence may open with before its first word.
394
+ const OPENING_MARKS_AT_END = /["'«“„‘‚([¿¡]+$/u;
395
+ // A sentence's end and a space, or a line break, right before a placeholder.
396
+ const SENTENCE_END_BEFORE = new RegExp(`(?:${SENTENCE_END}\\s|\\n)\\s*$`, "iu");
397
+ // A template ending as a sentence does.
398
+ const ENDS_AS_A_SENTENCE = new RegExp(`(?:${SENTENCE_END}|:)\\s*$`, "iu");
399
+ // A sentence's end before more words, inside a template.
400
+ const SENTENCE_END_INSIDE = new RegExp(`${SENTENCE_END}\\s+\\S`, "iu");
401
+ const startsASentence = (template, at) => {
402
+ const before = template
403
+ .slice(0, at)
404
+ .replace(OPENING_MARKS_AT_END, "");
405
+ if (before.trim() === "") {
406
+ return (ENDS_AS_A_SENTENCE.test(template) || SENTENCE_END_INSIDE.test(template));
407
+ }
408
+ return SENTENCE_END_BEFORE.test(before);
409
+ };
410
+ /*
411
+ * `text`, the value as the middle of a sentence in `language` takes it, with
412
+ * its form where it starts one: an inSentence term takes a capital there
413
+ * (toLabelTerm); anything else - a name, a number, a term as written, a
414
+ * composed value - is the same wherever it goes.
415
+ */
416
+ const toSentenceValue = (value, text, language) => {
417
+ return {
418
+ text,
419
+ atSentenceStart: (0, exports.isTranslatableTerm)(value) && value.inSentence
420
+ ? (0, exports.toLabelTerm)(text, language)
421
+ : text,
422
+ isTerm: (0, exports.isTranslatableTerm)(value),
423
+ };
424
+ };
425
+ /*
426
+ * WHERE A TERM MEETS CHINESE OR JAPANESE WORDS.
427
+ *
428
+ * Chinese and Japanese write no space between their words. The Dashboard's
429
+ * zh-CN, zh-TW and ja files put one between their words and Latin text, a
430
+ * number or a {{placeholder}} (Dashboard/src/Locales/README.md), which reads
431
+ * right beside a name in Latin letters - "请设置 OneUptime Kubernetes
432
+ * Agent,只需几分钟。" - and wrong beside a term the language words in its
433
+ * own script: "请设置 设备或网关上的 OpenTelemetry 导出器,", "此操作会撤销
434
+ * 数据库 AI 代理 的密钥。" (issue #7864). One key can take a name of either
435
+ * kind - a host's collector is "OpenTelemetry Collector" or "OneUptime
436
+ * 收集器" - so no spacing written into the key reads right for both.
437
+ *
438
+ * So in a sentence of a language that writes no space between its words, a
439
+ * space the template puts between a term (translatableTerm) and a Chinese or
440
+ * Japanese letter is dropped where the term's own letter on that side is
441
+ * Chinese or Japanese too: "请设置设备或网关上的 OpenTelemetry 导出器,",
442
+ * "OneUptime 收集器已不再上报数据", "撤销数据库 AI 代理的密钥". A space
443
+ * beside a Latin letter, a digit or a sign stays ("请设置 OneUptime
444
+ * 收集器"), and so does one beside any other value - a name someone typed, a
445
+ * number, a date, a slot - which the space sets apart as the template wrote
446
+ * it. Two terms side by side meet the same way: "{{action}} {{itemName}}"
447
+ * reads "更新监控器". No space is ever added: a key that writes none reads
448
+ * as it is written.
449
+ */
450
+ // The languages that write no space between their words: Chinese, Japanese.
451
+ const LANGUAGES_WITHOUT_WORD_SPACES = ["ja", "zh"];
452
+ /*
453
+ * One letter of Chinese or Japanese - a Han character or a kana - by the
454
+ * scripts that use it (its script extensions), as ReadingDirection reads a
455
+ * right-to-left letter: the prolonged sound mark that ends "コレクター"
456
+ * (U+30FC) is a letter of both kana scripts and of neither alone. Not their
457
+ * punctuation ("。", "、", "「"): the space beside it is the template's.
458
+ */
459
+ const CHINESE_OR_JAPANESE_LETTER = /^(?=[\p{L}\p{Nl}])[\p{Script_Extensions=Han}\p{Script_Extensions=Hiragana}\p{Script_Extensions=Katakana}]$/u;
460
+ // Whether `text` starts with a letter of Chinese or Japanese.
461
+ const startsInChineseOrJapanese = (text) => {
462
+ const first = text.codePointAt(0);
463
+ return (first !== undefined &&
464
+ CHINESE_OR_JAPANESE_LETTER.test(String.fromCodePoint(first)));
465
+ };
466
+ // Whether `text` ends with a letter of Chinese or Japanese.
467
+ const endsInChineseOrJapanese = (text) => {
468
+ // Its last character, whole where it is a surrogate pair ("𠀀").
469
+ const last = Array.from(text.slice(-2)).pop() || "";
470
+ return CHINESE_OR_JAPANESE_LETTER.test(last);
471
+ };
472
+ // How many spaces `text` starts with, and how many it ends with.
473
+ const countLeadingSpaces = (text) => {
474
+ let count = 0;
475
+ while (text[count] === " ") {
476
+ count++;
477
+ }
478
+ return count;
479
+ };
480
+ const countTrailingSpaces = (text) => {
481
+ let count = 0;
482
+ while (count < text.length && text[text.length - 1 - count] === " ") {
483
+ count++;
484
+ }
485
+ return count;
486
+ };
487
+ /*
488
+ * The pieces of a filled template (fillPieces), in `language`: in one that
489
+ * writes no space between its words, each space its words put between a
490
+ * term and a letter of Chinese or Japanese is dropped where the term's own
491
+ * letter on that side is one too (WHERE A TERM MEETS CHINESE OR JAPANESE
492
+ * WORDS). The words beside any other value keep their spaces.
493
+ */
494
+ const closeSpacesBesideTerms = (pieces, language) => {
495
+ if (!LANGUAGES_WITHOUT_WORD_SPACES.includes(getBaseLanguage(language))) {
496
+ return pieces;
497
+ }
498
+ return pieces.map((piece, index) => {
499
+ if (piece.isValue || !piece.text) {
500
+ return piece;
501
+ }
502
+ // The values either side of these words: pieces take turns.
503
+ const before = pieces[index - 1];
504
+ const after = pieces[index + 1];
505
+ const leading = countLeadingSpaces(piece.text);
506
+ // Spaces and nothing else, between two values: two terms meet.
507
+ if (leading === piece.text.length) {
508
+ const termsMeet = Boolean((before === null || before === void 0 ? void 0 : before.isTerm) &&
509
+ (after === null || after === void 0 ? void 0 : after.isTerm) &&
510
+ endsInChineseOrJapanese(before.text) &&
511
+ startsInChineseOrJapanese(after.text));
512
+ return termsMeet ? Object.assign(Object.assign({}, piece), { text: "" }) : piece;
513
+ }
514
+ let text = piece.text;
515
+ if (leading > 0 &&
516
+ (before === null || before === void 0 ? void 0 : before.isTerm) &&
517
+ endsInChineseOrJapanese(before.text) &&
518
+ startsInChineseOrJapanese(text.slice(leading))) {
519
+ text = text.slice(leading);
520
+ }
521
+ const trailing = countTrailingSpaces(text);
522
+ const words = text.slice(0, text.length - trailing);
523
+ if (trailing > 0 &&
524
+ (after === null || after === void 0 ? void 0 : after.isTerm) &&
525
+ startsInChineseOrJapanese(after.text) &&
526
+ endsInChineseOrJapanese(words)) {
527
+ text = words;
528
+ }
529
+ return text === piece.text ? piece : Object.assign(Object.assign({}, piece), { text });
530
+ });
531
+ };
532
+ /*
533
+ * `template` filled with `values`, in pieces: its words and its values by
534
+ * turns, words first and last (empty where a value starts or ends it). Each
535
+ * value goes in the form its place takes (startsASentence), literally; a
536
+ * placeholder with no value is left among the words as it is. Beside a
537
+ * term, the words keep only the spaces `language` writes
538
+ * (closeSpacesBesideTerms).
539
+ */
540
+ const fillPieces = (template, values, language) => {
541
+ var _a;
542
+ const pieces = [];
543
+ let words = "";
544
+ let at = 0;
545
+ for (const match of template.matchAll(PLACEHOLDER)) {
546
+ const start = (_a = match.index) !== null && _a !== void 0 ? _a : 0;
547
+ const name = match[1] || "";
548
+ words += template.slice(at, start);
549
+ at = start + match[0].length;
550
+ if (!Object.prototype.hasOwnProperty.call(values, name)) {
551
+ words += match[0];
552
+ continue;
553
+ }
554
+ const value = values[name];
555
+ pieces.push({ text: words, isValue: false, isTerm: false });
556
+ pieces.push({
557
+ text: startsASentence(template, start)
558
+ ? value.atSentenceStart
559
+ : value.text,
560
+ isValue: true,
561
+ isTerm: value.isTerm,
562
+ });
563
+ words = "";
564
+ }
565
+ pieces.push({
566
+ text: words + template.slice(at),
567
+ isValue: false,
568
+ isTerm: false,
569
+ });
570
+ return closeSpacesBesideTerms(pieces, language);
571
+ };
572
+ /*
573
+ * `template` with each {{placeholder}} filled from `values`, in the form its
574
+ * place takes (startsASentence), as a sentence in `language` holds it
575
+ * (closeSpacesBesideTerms). A placeholder with no value is left as it is,
576
+ * and each value goes in literally.
577
+ */
578
+ const fillSentenceValues = (template, values, language) => {
579
+ return fillPieces(template, values, language)
580
+ .map((piece) => {
581
+ return piece.text;
582
+ })
583
+ .join("");
584
+ };
248
585
  // A value as the English sentence shows it.
249
586
  const englishValue = (value) => {
250
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);
251
590
  return value.inSentence
252
- ? (0, exports.toSentenceTerm)(value.translatableTerm, exports.DEFAULT_LANGUAGE)
253
- : value.translatableTerm.trim();
591
+ ? (0, exports.toSentenceTerm)(term, exports.DEFAULT_LANGUAGE)
592
+ : term.trim();
254
593
  }
255
594
  if ((0, exports.isComposedValue)(value)) {
256
595
  return value.compose(getEnglishTranslator());
@@ -279,7 +618,8 @@ const englishTextValues = (values) => {
279
618
  const dated = englishDateValues(values);
280
619
  const result = {};
281
620
  for (const key of Object.keys(dated)) {
282
- result[key] = englishValue(dated[key]);
621
+ const value = dated[key];
622
+ result[key] = toSentenceValue(value, englishValue(value), exports.DEFAULT_LANGUAGE);
283
623
  }
284
624
  return result;
285
625
  };
@@ -300,30 +640,23 @@ const englishTextValues = (values) => {
300
640
  * A slot's marker (TranslatedSentence, translateTemplateAround) is set
301
641
  * apart in a sentence read right to left when asked to (SentenceOptions'
302
642
  * setsSlotsApart), so what is drawn there as an element is too; otherwise
303
- * it is left as it is. As in fillTemplate, a placeholder with no value is
304
- * left as it is, and each value goes in literally.
643
+ * it is left as it is. As in fillSentenceValues, each value goes in the
644
+ * form its place takes (startsASentence), with the spaces beside a term
645
+ * that `language` writes (closeSpacesBesideTerms), a placeholder with no
646
+ * value is left as it is, and each value goes in literally.
305
647
  */
306
- const fillSettingValuesApart = (template, values, direction, setsSlotsApart) => {
307
- var _a;
308
- const pieces = [];
648
+ const fillSettingValuesApart = (template, values, direction, setsSlotsApart, language) => {
649
+ const pieces = fillPieces(template, values, language);
309
650
  // The sentence with every value as it is: what a number's signs are read in.
310
651
  let filled = "";
311
- let at = 0;
312
- const addPiece = (text, isValue) => {
313
- pieces.push({ text, start: filled.length, isValue });
314
- filled += text;
315
- };
316
- for (const match of template.matchAll(PLACEHOLDER)) {
317
- const start = (_a = match.index) !== null && _a !== void 0 ? _a : 0;
318
- const name = match[1] || "";
319
- const isFilled = Object.prototype.hasOwnProperty.call(values, name);
320
- addPiece(template.slice(at, start), false);
321
- addPiece(isFilled ? values[name] : match[0], isFilled);
322
- at = start + match[0].length;
652
+ // Where each piece starts in it.
653
+ const starts = [];
654
+ for (const piece of pieces) {
655
+ starts.push(filled.length);
656
+ filled += piece.text;
323
657
  }
324
- addPiece(template.slice(at), false);
325
658
  return pieces
326
- .map((piece) => {
659
+ .map((piece, index) => {
327
660
  if (!piece.isValue) {
328
661
  return piece.text;
329
662
  }
@@ -332,9 +665,10 @@ const fillSettingValuesApart = (template, values, direction, setsSlotsApart) =>
332
665
  ? `${ReadingDirection_1.FIRST_STRONG_ISOLATE}${piece.text}${ReadingDirection_1.POP_DIRECTIONAL_ISOLATE}`
333
666
  : piece.text;
334
667
  }
335
- const end = piece.start + piece.text.length;
668
+ const start = starts[index];
669
+ const end = start + piece.text.length;
336
670
  if (direction === ReadingDirection_1.RIGHT_TO_LEFT &&
337
- (0, ReadingDirection_1.isNumberJoinedToASign)(piece.text, filled.slice(Math.max(0, piece.start - 2), piece.start), filled.slice(end, end + 2))) {
671
+ (0, ReadingDirection_1.isNumberJoinedToASign)(piece.text, filled.slice(Math.max(0, start - 2), start), filled.slice(end, end + 2))) {
338
672
  return piece.text;
339
673
  }
340
674
  return (0, ReadingDirection_1.setApartInSentence)(piece.text, direction);
@@ -342,16 +676,22 @@ const fillSettingValuesApart = (template, values, direction, setsSlotsApart) =>
342
676
  .join("");
343
677
  };
344
678
  /*
345
- * Fills {{key}} placeholders from values. A placeholder with no value is left
346
- * as it is, which a test notices and a reader at least recognises as a slot.
347
- * Each value goes in literally: braces or "$t(" inside a name are never
348
- * looked up again.
679
+ * Fills {{key}} placeholders from values, as an English sentence takes them:
680
+ * a word cased for the middle of a sentence takes a capital where it starts
681
+ * one (startsASentence). A placeholder with no value is left as it is, which
682
+ * a test notices and a reader at least recognises as a slot. Each value goes
683
+ * in literally: braces or "$t(" inside a name are never looked up again.
349
684
  */
350
685
  const fillTemplate = (template, values = {}) => {
351
- return template.replace(PLACEHOLDER, (match, key) => {
352
- return Object.prototype.hasOwnProperty.call(values, key)
353
- ? englishValue(values[key])
354
- : match;
686
+ return template.replace(PLACEHOLDER, (match, key, at) => {
687
+ if (!Object.prototype.hasOwnProperty.call(values, key)) {
688
+ return match;
689
+ }
690
+ const value = values[key];
691
+ const text = englishValue(value);
692
+ return startsASentence(template, at)
693
+ ? toSentenceValue(value, text, exports.DEFAULT_LANGUAGE).atSentenceStart
694
+ : text;
355
695
  });
356
696
  };
357
697
  exports.fillTemplate = fillTemplate;
@@ -416,6 +756,15 @@ const createTranslator = (lookup, language) => {
416
756
  const punctuate = (words) => {
417
757
  return punctuateInLanguage(words, activeLanguage);
418
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
+ };
419
768
  // The stored wording for `key`, or undefined when nothing has one.
420
769
  const find = (key) => {
421
770
  if (!lookup || !key) {
@@ -423,7 +772,16 @@ const createTranslator = (lookup, language) => {
423
772
  }
424
773
  try {
425
774
  const result = lookup(key);
426
- 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)
427
785
  ? result
428
786
  : undefined;
429
787
  }
@@ -435,26 +793,35 @@ const createTranslator = (lookup, language) => {
435
793
  if (typeof text !== "string" || text.length === 0) {
436
794
  return text;
437
795
  }
438
- // 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
+ */
439
800
  const stored = find(text);
440
- return stored === undefined ? text : punctuate(stored);
801
+ return stored === undefined
802
+ ? (0, MeaningKeys_1.withMeaningKeyAsItsWord)(text)
803
+ : setWording(stored, text);
441
804
  };
442
805
  const hasTranslation = (text) => {
443
806
  return find(text) !== undefined;
444
807
  };
445
808
  const translateTerm = (text, options) => {
446
- var _a;
447
809
  if (!text) {
448
810
  return "";
449
811
  }
450
- 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);
451
816
  if (!(options === null || options === void 0 ? void 0 : options.inSentence)) {
452
817
  return translated.trim();
453
818
  }
454
819
  /*
455
820
  * Cased the reader's way, translated or not: a German noun spelled as in
456
- * English ("Labels", "Monitor") keeps its capital in a German sentence.
457
- * 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.
458
825
  */
459
826
  return (0, exports.toSentenceTerm)(translated, activeLanguage);
460
827
  };
@@ -463,17 +830,19 @@ const createTranslator = (lookup, language) => {
463
830
  const result = {};
464
831
  for (const key of Object.keys(values)) {
465
832
  const value = values[key];
833
+ let text;
466
834
  if ((0, exports.isTranslatableTerm)(value)) {
467
- result[key] = translateTerm(value.translatableTerm, {
835
+ text = translateTerm(value.translatableTerm, {
468
836
  inSentence: value.inSentence,
469
837
  });
470
838
  }
471
839
  else if ((0, exports.isComposedValue)(value)) {
472
- result[key] = value.compose(translator);
840
+ text = value.compose(translator);
473
841
  }
474
842
  else {
475
- result[key] = String(value);
843
+ text = String(value);
476
844
  }
845
+ result[key] = toSentenceValue(value, text, activeLanguage);
477
846
  }
478
847
  return result;
479
848
  };
@@ -484,7 +853,9 @@ const createTranslator = (lookup, language) => {
484
853
  * English one; then its terms are translated too. Otherwise the English
485
854
  * sentence is filled with the English terms - except for a template with no
486
855
  * words of its own ("{{action}} {{itemName}}"), which belongs to no
487
- * language and always takes the reader's words.
856
+ * language and always takes the reader's words. A word cased for the
857
+ * middle of a sentence takes a capital where the sentence starts with it
858
+ * (startsASentence).
488
859
  *
489
860
  * Asked to (SentenceOptions), each value is set apart from the sentence
490
861
  * where it could move the words around it (fillSettingValuesApart), by the
@@ -501,16 +872,17 @@ const createTranslator = (lookup, language) => {
501
872
  */
502
873
  if (hasWords(english)) {
503
874
  return setsValuesApart
504
- ? fillSettingValuesApart(punctuate(english), englishTextValues(values), ReadingDirection_1.LEFT_TO_RIGHT, setsSlotsApart)
875
+ ? fillSettingValuesApart(punctuate(english), englishTextValues(values), ReadingDirection_1.LEFT_TO_RIGHT, setsSlotsApart, exports.DEFAULT_LANGUAGE)
505
876
  : (0, exports.fillTemplate)(punctuate(english), englishDateValues(values));
506
877
  }
878
+ // No words of its own: the reader's words, as their sentence holds them.
507
879
  return setsValuesApart
508
- ? fillSettingValuesApart(punctuate(english), translatedValues(values), readerDirection, setsSlotsApart)
509
- : (0, exports.fillTemplate)(punctuate(english), translatedValues(values));
880
+ ? fillSettingValuesApart(punctuate(english), translatedValues(values), readerDirection, setsSlotsApart, activeLanguage)
881
+ : fillSentenceValues(punctuate(english), translatedValues(values), activeLanguage);
510
882
  }
511
883
  return setsValuesApart
512
- ? fillSettingValuesApart(punctuate(stored), translatedValues(values), readerDirection, setsSlotsApart)
513
- : (0, exports.fillTemplate)(punctuate(stored), translatedValues(values));
884
+ ? fillSettingValuesApart(setWording(stored, english), translatedValues(values), readerDirection, setsSlotsApart, activeLanguage)
885
+ : fillSentenceValues(setWording(stored, english), translatedValues(values), activeLanguage);
514
886
  };
515
887
  const translateTemplate = (template, values = {}, options) => {
516
888
  return fill(find(template), template, values, options);
@@ -527,7 +899,8 @@ const createTranslator = (lookup, language) => {
527
899
  /*
528
900
  * The form for `count` the way i18next resolves it: the language's own
529
901
  * category ("few" for 3 in Russian) under the key plus "_few", else the key
530
- * itself, which holds the language's general (other) form.
902
+ * itself, which holds the language's general (other) form - with the
903
+ * category of the key it came from ("other" for the key itself).
531
904
  *
532
905
  * A language's "one" form is said for every count its language calls one
533
906
  * - 21 and 31 in Russian, 0 in French. A one form that says exactly one
@@ -542,22 +915,56 @@ const createTranslator = (lookup, language) => {
542
915
  if (category !== "other" && !saysOnlyOne) {
543
916
  const form = find(`${key}_${category}`);
544
917
  if (form !== undefined) {
545
- return form;
918
+ return { text: form, category };
546
919
  }
547
920
  }
548
- return find(key);
921
+ const general = find(key);
922
+ return general === undefined
923
+ ? undefined
924
+ : { text: general, category: "other" };
925
+ };
926
+ /*
927
+ * Whether a plural form a locale holds is English left in it - a
928
+ * placeholder, not a translation. A form is read against the English text
929
+ * of its own key, never the other form's: a language's plural can read
930
+ * like English's singular - Italian's "{{count}} host" for 3 hosts, the
931
+ * "{{count}} VM" of French, Spanish, Hindi and Persian for 3 VMs.
932
+ *
933
+ * - A "_one" form is English left in the locale when it reads as
934
+ * English's one form, en.json's text for that key: Russian puts 21 in
935
+ * its "one" form, French puts 0 there, and neither may borrow the
936
+ * English "1 row" for it. Unless the language's general form reads the
937
+ * same: the language then words the sentence alike for every count, and
938
+ * the form is its own - French's "0 VM". A general form left English is
939
+ * never that witness: the lookup gives nothing for a key that maps to
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".
942
+ * - Every other form - the general one, and a "_few", "_many", "_two" or
943
+ * "_zero" one, which en.json has none of - is English left in the
944
+ * locale when it reads as English's other form, what English writes for
945
+ * every count but one. English's one form there is the language's own,
946
+ * as in its general form.
947
+ */
948
+ const isEnglishPlaceholder = (form, template) => {
949
+ if (form.category !== "one") {
950
+ return form.text === template.other;
951
+ }
952
+ return (form.text === template.one &&
953
+ find(template.other) !== form.text &&
954
+ find(`${template.other}_one${exports.SAME_AS_ENGLISH_MARK}`) !== form.text);
549
955
  };
550
956
  const translatePlural = (template, count, values = {}, options) => {
551
957
  // English has two forms: exactly one, and everything else.
552
958
  const english = count === 1 ? template.one : template.other;
553
959
  const stored = findPlural(template.other, count, (0, exports.isOneFormOnlyForOne)(template));
554
960
  /*
555
- * An English form left in a locale is a placeholder, not a translation:
556
- * the sentence is English, in English's form for the count. Russian puts
557
- * 21 in its "one" form, French puts 0 there - neither may borrow the
558
- * English "1 row" for it.
961
+ * An English form left in a locale is a placeholder, not a translation
962
+ * (isEnglishPlaceholder): the sentence is English, in English's form for
963
+ * the count.
559
964
  */
560
- const translated = stored === template.one || stored === template.other ? undefined : stored;
965
+ const translated = stored === undefined || isEnglishPlaceholder(stored, template)
966
+ ? undefined
967
+ : stored.text;
561
968
  // {{count}} is written the reader's way unless the caller passes its own.
562
969
  return fill(translated, english, Object.assign({ count: formatNumber(count) }, values), options);
563
970
  };
@@ -716,7 +1123,7 @@ const getSentencePartsAndLanguage = (data) => {
716
1123
  };
717
1124
  }
718
1125
  return {
719
- parts: split(fillSettingValuesApart(englishTemplate, englishTextValues(englishValues), ReadingDirection_1.LEFT_TO_RIGHT, false)) || [
1126
+ parts: split(fillSettingValuesApart(englishTemplate, englishTextValues(englishValues), ReadingDirection_1.LEFT_TO_RIGHT, false, exports.DEFAULT_LANGUAGE)) || [
720
1127
  {
721
1128
  kind: "text",
722
1129
  text: (0, exports.fillTemplate)(englishTemplate, englishDateValues(Object.assign(Object.assign({}, (isPlural ? { count: data.translator.formatNumber(count) } : {})), (data.values || {})))),