@oneuptime/common 14.0.109 → 14.0.110

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 (285) hide show
  1. package/Models/AnalyticsModels/SecurityEvent.js +1 -1
  2. package/Models/DatabaseModels/AIInsight.js +2 -2
  3. package/Models/DatabaseModels/Alert.js +2 -2
  4. package/Models/DatabaseModels/AlertEpisode.js +2 -2
  5. package/Models/DatabaseModels/AlertEpisodeOnCallRule.js +3 -3
  6. package/Models/DatabaseModels/AlertGroupingRule.d.mts +1 -0
  7. package/Models/DatabaseModels/AlertGroupingRule.d.ts +1 -0
  8. package/Models/DatabaseModels/AlertGroupingRule.js +48 -2
  9. package/Models/DatabaseModels/AlertOnCallRule.js +3 -3
  10. package/Models/DatabaseModels/AlertSeverity.js +13 -4
  11. package/Models/DatabaseModels/AlertState.js +1 -1
  12. package/Models/DatabaseModels/CallLog.js +12 -12
  13. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.mts +2 -0
  14. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.d.ts +2 -0
  15. package/Models/DatabaseModels/EmailLog.js +12 -12
  16. package/Models/DatabaseModels/FormSubmission.js +2 -2
  17. package/Models/DatabaseModels/GlobalConfig.d.mts +1 -0
  18. package/Models/DatabaseModels/GlobalConfig.d.ts +1 -0
  19. package/Models/DatabaseModels/GlobalConfig.js +28 -0
  20. package/Models/DatabaseModels/Incident.js +2 -2
  21. package/Models/DatabaseModels/IncidentEpisode.js +2 -2
  22. package/Models/DatabaseModels/IncidentEpisodeOnCallRule.js +3 -3
  23. package/Models/DatabaseModels/IncidentGroupingRule.d.mts +1 -0
  24. package/Models/DatabaseModels/IncidentGroupingRule.d.ts +1 -0
  25. package/Models/DatabaseModels/IncidentGroupingRule.js +48 -2
  26. package/Models/DatabaseModels/IncidentOnCallRule.js +3 -3
  27. package/Models/DatabaseModels/IncidentSeverity.js +13 -4
  28. package/Models/DatabaseModels/IncidentState.js +1 -1
  29. package/Models/DatabaseModels/IncidentTemplate.js +2 -2
  30. package/Models/DatabaseModels/Monitor.js +3 -3
  31. package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
  32. package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
  33. package/Models/DatabaseModels/NetworkDevice.js +41 -0
  34. package/Models/DatabaseModels/OnCallDutyPolicy.js +4 -2
  35. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRule.js +1 -1
  36. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleSchedule.js +8 -5
  37. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleTeam.js +5 -2
  38. package/Models/DatabaseModels/OnCallDutyPolicyEscalationRuleUser.js +5 -2
  39. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +9 -6
  40. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +10 -7
  41. package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +14 -11
  42. package/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.js +7 -4
  43. package/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.js +7 -4
  44. package/Models/DatabaseModels/OnCallDutyPolicySchedule.js +6 -3
  45. package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +4 -4
  46. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +3 -3
  47. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +6 -6
  48. package/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js +9 -6
  49. package/Models/DatabaseModels/Project.d.mts +2 -0
  50. package/Models/DatabaseModels/Project.d.ts +2 -0
  51. package/Models/DatabaseModels/Project.js +96 -2
  52. package/Models/DatabaseModels/ProxmoxCluster.d.mts +1 -0
  53. package/Models/DatabaseModels/ProxmoxCluster.d.ts +1 -0
  54. package/Models/DatabaseModels/ProxmoxCluster.js +52 -3
  55. package/Models/DatabaseModels/PushNotificationLog.js +12 -12
  56. package/Models/DatabaseModels/Reseller.js +8 -2
  57. package/Models/DatabaseModels/ResellerPlan.js +8 -2
  58. package/Models/DatabaseModels/ScheduledMaintenance.js +6 -3
  59. package/Models/DatabaseModels/ScheduledMaintenanceInternalNote.js +7 -4
  60. package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +2 -2
  61. package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +7 -4
  62. package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -1
  63. package/Models/DatabaseModels/Service.js +1 -1
  64. package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +4 -4
  65. package/Models/DatabaseModels/ServiceLevelObjectiveErrorBudgetPolicyTier.js +4 -4
  66. package/Models/DatabaseModels/SmsLog.js +12 -12
  67. package/Models/DatabaseModels/StatusPage.js +5 -5
  68. package/Models/DatabaseModels/StatusPageSubscriber.js +2 -2
  69. package/Models/DatabaseModels/TelegramLog.js +12 -12
  70. package/Models/DatabaseModels/TelemetryIngestionKey.js +8 -5
  71. package/Models/DatabaseModels/TelemetryIngestionKeyRefusal.js +7 -4
  72. package/Models/DatabaseModels/User.d.mts +4 -0
  73. package/Models/DatabaseModels/User.d.ts +4 -0
  74. package/Models/DatabaseModels/User.js +100 -0
  75. package/Models/DatabaseModels/UserOnCallLog.js +6 -6
  76. package/Models/DatabaseModels/UserOnCallLogTimeline.js +3 -3
  77. package/Models/DatabaseModels/UserOnCallShiftReminderLog.js +2 -2
  78. package/Models/DatabaseModels/WebhookLog.js +12 -12
  79. package/Models/DatabaseModels/WhatsAppLog.js +12 -12
  80. package/Models/DatabaseModels/WorkspaceNotificationLog.js +12 -12
  81. package/Types/AI/AIChatTypes.d.mts +2 -1
  82. package/Types/AI/AIChatTypes.d.ts +2 -1
  83. package/Types/AI/AIChatTypes.js +5 -0
  84. package/Types/Analytics/ProductEvent.d.mts +6 -1
  85. package/Types/Analytics/ProductEvent.d.ts +6 -1
  86. package/Types/Analytics/ProductEvent.js +41 -0
  87. package/Types/AuditLog/AuditLogCoverage.d.mts +1 -0
  88. package/Types/AuditLog/AuditLogCoverage.d.ts +1 -0
  89. package/Types/AuditLog/AuditLogCoverage.js +4 -2
  90. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  91. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  92. package/Types/Cloud/CloudResourceCatalog.js +33 -3
  93. package/Types/Cloud/CloudResourceCatalog.mjs +1 -0
  94. package/Types/DataObservability/DataCheckSuggestions.d.mts +25 -0
  95. package/Types/DataObservability/DataCheckSuggestions.d.ts +25 -0
  96. package/Types/DataObservability/DataCheckSuggestions.js +102 -65
  97. package/Types/DataObservability/DataCheckSuggestions.mjs +1 -0
  98. package/Types/Database/TableMetadata.d.mts +2 -0
  99. package/Types/Database/TableMetadata.d.ts +2 -0
  100. package/Types/Database/TableMetadata.js +6 -0
  101. package/Types/Date.d.mts +20 -1
  102. package/Types/Date.d.ts +20 -1
  103. package/Types/Date.js +42 -2
  104. package/Types/DateLanguage.d.mts +2 -0
  105. package/Types/DateLanguage.d.ts +2 -0
  106. package/Types/DateLanguage.js +44 -2
  107. package/Types/DateLanguage.mjs +2 -0
  108. package/Types/DirectionArrow.d.mts +7 -0
  109. package/Types/DirectionArrow.d.ts +7 -0
  110. package/Types/DirectionArrow.js +88 -0
  111. package/Types/DirectionArrow.mjs +7 -0
  112. package/Types/Docs/GlossaryTerm.d.mts +1 -0
  113. package/Types/Docs/GlossaryTerm.d.ts +1 -0
  114. package/Types/Docs/GlossaryTerm.js +2 -0
  115. package/Types/Docs/RetiredNames.d.mts +11 -0
  116. package/Types/Docs/RetiredNames.d.ts +11 -0
  117. package/Types/Docs/RetiredNames.js +139 -0
  118. package/Types/Docs/RetiredNames.mjs +3 -0
  119. package/Types/Exception/RefusalWithValues.d.mts +7 -0
  120. package/Types/Exception/RefusalWithValues.d.ts +7 -0
  121. package/Types/Exception/RefusalWithValues.js +76 -0
  122. package/Types/Exception/RefusalWithValues.mjs +3 -0
  123. package/Types/Exception/UnexplainedError.d.mts +13 -0
  124. package/Types/Exception/UnexplainedError.d.ts +13 -0
  125. package/Types/Exception/UnexplainedError.js +53 -1
  126. package/Types/Exception/UnexplainedError.mjs +1 -0
  127. package/Types/File/FileSize.d.mts +4 -1
  128. package/Types/File/FileSize.d.ts +4 -1
  129. package/Types/File/FileSize.js +18 -17
  130. package/Types/HostCollector/HostCollector.d.mts +1 -0
  131. package/Types/HostCollector/HostCollector.d.ts +1 -0
  132. package/Types/HostCollector/HostCollector.js +26 -10
  133. package/Types/HostCollector/HostCollector.mjs +1 -0
  134. package/Types/Monitor/MonitorCriteria.js +2 -2
  135. package/Types/Monitor/MonitorStep.js +1 -1
  136. package/Types/Monitor/MonitorTemplateSyncField.d.mts +6 -0
  137. package/Types/Monitor/MonitorTemplateSyncField.d.ts +6 -0
  138. package/Types/Monitor/MonitorTemplateSyncField.js +106 -64
  139. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.mts +1 -0
  140. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.d.ts +1 -0
  141. package/Types/Monitor/NtpMonitor/NtpMonitorUtil.js +11 -3
  142. package/Types/Monitor/WhoIsTold.d.mts +3 -1
  143. package/Types/Monitor/WhoIsTold.d.ts +3 -1
  144. package/Types/Monitor/WhoIsTold.js +2 -1
  145. package/Types/NotificationRule/PagingLadder.d.mts +137 -0
  146. package/Types/NotificationRule/PagingLadder.d.ts +137 -0
  147. package/Types/NotificationRule/PagingLadder.js +682 -0
  148. package/Types/NotificationRule/PagingLadder.mjs +28 -0
  149. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +1 -1
  150. package/Types/OnCallDutyPolicy/OnCallPageLine.d.mts +26 -0
  151. package/Types/OnCallDutyPolicy/OnCallPageLine.d.ts +26 -0
  152. package/Types/OnCallDutyPolicy/OnCallPageLine.js +136 -0
  153. package/Types/OnCallDutyPolicy/OnCallPageLine.mjs +18 -0
  154. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +44 -0
  155. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +44 -0
  156. package/Types/OnCallDutyPolicy/OnCallTestPage.js +96 -5
  157. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  158. package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.mts +19 -0
  159. package/Types/OnCallDutyPolicy/OnCallTestPageLine.d.ts +19 -0
  160. package/Types/OnCallDutyPolicy/OnCallTestPageLine.js +222 -0
  161. package/Types/OnCallDutyPolicy/OnCallTestPageLine.mjs +6 -0
  162. package/Types/OnCallDutyPolicy/ScheduleLayerDefaults.js +5 -2
  163. package/Types/OnCallDutyPolicy/UserOverrideCoverRequest.js +9 -1
  164. package/Types/Permission.d.mts +2 -2
  165. package/Types/Permission.d.ts +2 -2
  166. package/Types/Permission.js +194 -193
  167. package/Types/Product/ProductCatalog.d.mts +10 -0
  168. package/Types/Product/ProductCatalog.d.ts +10 -0
  169. package/Types/Product/ProductCatalog.js +208 -0
  170. package/Types/Product/ProductCatalog.mjs +6 -0
  171. package/Types/Product/ProductOfTable.d.mts +3 -0
  172. package/Types/Product/ProductOfTable.d.ts +3 -0
  173. package/Types/Product/ProductOfTable.js +68 -0
  174. package/Types/Product/ProductOfTable.mjs +3 -0
  175. package/Types/Product/ProjectProductsAnswer.d.mts +3 -0
  176. package/Types/Product/ProjectProductsAnswer.d.ts +3 -0
  177. package/Types/Product/ProjectProductsAnswer.js +35 -2
  178. package/Types/Product/ProjectProductsAnswer.mjs +1 -0
  179. package/Types/Product/ServerProducts.d.mts +65 -0
  180. package/Types/Product/ServerProducts.d.ts +65 -0
  181. package/Types/Product/ServerProducts.js +383 -0
  182. package/Types/Product/ServerProducts.mjs +26 -0
  183. package/Types/Product/ServerProductsAnswer.d.mts +21 -0
  184. package/Types/Product/ServerProductsAnswer.d.ts +21 -0
  185. package/Types/Product/ServerProductsAnswer.js +78 -0
  186. package/Types/Product/ServerProductsAnswer.mjs +5 -0
  187. package/Types/ProductFeedback/ProductFeedback.d.mts +3 -1
  188. package/Types/ProductFeedback/ProductFeedback.d.ts +3 -1
  189. package/Types/ProductFeedback/ProductFeedback.js +8 -0
  190. package/Types/Rum/SessionReplayCustomEvents.d.mts +1 -0
  191. package/Types/Rum/SessionReplayCustomEvents.d.ts +1 -0
  192. package/Types/SampleProject/SampleProject.d.mts +54 -0
  193. package/Types/SampleProject/SampleProject.d.ts +54 -0
  194. package/Types/SampleProject/SampleProject.js +177 -0
  195. package/Types/SampleProject/SampleProject.mjs +22 -0
  196. package/Types/SampleProject/SampleProjectContent.d.mts +127 -0
  197. package/Types/SampleProject/SampleProjectContent.d.ts +127 -0
  198. package/Types/SampleProject/SampleProjectContent.js +397 -0
  199. package/Types/SampleProject/SampleProjectContent.mjs +18 -0
  200. package/Types/Telemetry/TelemetryIngestSurface.js +6 -5
  201. package/Types/Translator.d.mts +1 -0
  202. package/Types/Translator.d.ts +1 -0
  203. package/Types/Translator.js +40 -2
  204. package/Types/Translator.mjs +1 -0
  205. package/Types/UsedBy/UsedBy.d.mts +103 -0
  206. package/Types/UsedBy/UsedBy.d.ts +103 -0
  207. package/Types/UsedBy/UsedBy.js +389 -0
  208. package/Types/UsedBy/UsedBy.mjs +20 -0
  209. package/Types/UsedBy/UsedByServerProducts.d.mts +4 -0
  210. package/Types/UsedBy/UsedByServerProducts.d.ts +4 -0
  211. package/Types/UsedBy/UsedByServerProducts.js +48 -0
  212. package/Types/UsedBy/UsedByServerProducts.mjs +3 -0
  213. package/Types/WelcomeChecklist/WelcomeChecklist.d.mts +6 -0
  214. package/Types/WelcomeChecklist/WelcomeChecklist.d.ts +6 -0
  215. package/Types/WelcomeChecklist/WelcomeChecklist.js +54 -2
  216. package/Types/WelcomeChecklist/WelcomeChecklist.mjs +4 -0
  217. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.mts +1 -0
  218. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.ts +1 -0
  219. package/Types/WelcomeChecklist/WelcomeChecklistAnswer.js +3 -0
  220. package/Types/Workflow/PassedOnFields.js +2 -1
  221. package/Types/Workflow/Templates.js +1 -1
  222. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +2 -0
  223. package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +2 -0
  224. package/Utils/AI/MeaningMatch.d.mts +36 -0
  225. package/Utils/AI/MeaningMatch.d.ts +36 -0
  226. package/Utils/AI/MeaningMatch.js +535 -0
  227. package/Utils/AI/MeaningMatch.mjs +7 -0
  228. package/Utils/ArchivableValues.js +1 -1
  229. package/Utils/AuditLog/AuditLogValues.js +2 -2
  230. package/Utils/Dashboard/ClockWidgetFormat.d.mts +14 -2
  231. package/Utils/Dashboard/ClockWidgetFormat.d.ts +14 -2
  232. package/Utils/Dashboard/ClockWidgetFormat.js +105 -2
  233. package/Utils/Dashboard/DashboardViewConfigSignature.d.mts +3 -0
  234. package/Utils/Dashboard/DashboardViewConfigSignature.d.ts +3 -0
  235. package/Utils/Dashboard/DashboardViewConfigSignature.js +45 -0
  236. package/Utils/Dashboard/DashboardViewConfigSignature.mjs +3 -0
  237. package/Utils/DataSecurity/TextScanner.js +2 -2
  238. package/Utils/DeveloperDocs/AiAssistantExamples.js +4 -4
  239. package/Utils/DeveloperDocs/CliCommands.d.mts +1 -0
  240. package/Utils/DeveloperDocs/CliCommands.d.ts +1 -0
  241. package/Utils/DeveloperDocs/CliCommands.js +2 -1
  242. package/Utils/DeveloperDocs/CliResources.js +2 -1
  243. package/Utils/DeveloperDocs/TerraformSchema.js +3 -1
  244. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +8 -0
  245. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +8 -0
  246. package/Utils/Markdown/LinkReferenceDefinitions.js +1493 -131
  247. package/Utils/Markdown/LinkReferenceDefinitions.mjs +1 -0
  248. package/Utils/Markdown/MarkdownTableCell.js +2 -1
  249. package/Utils/Markdown/OverLongText.js +523 -5
  250. package/Utils/Markdown/SlowMarkdown.d.mts +14 -0
  251. package/Utils/Markdown/SlowMarkdown.d.ts +14 -0
  252. package/Utils/Markdown/SlowMarkdown.js +595 -11
  253. package/Utils/Markdown/SlowMarkdown.mjs +6 -0
  254. package/Utils/ModelApiName.d.mts +11 -0
  255. package/Utils/ModelApiName.d.ts +11 -0
  256. package/Utils/ModelApiName.js +72 -0
  257. package/Utils/ModelApiName.mjs +5 -0
  258. package/Utils/Monitor/DeviceMacLearningUtil.d.mts +2 -1
  259. package/Utils/Monitor/DeviceMacLearningUtil.d.ts +2 -1
  260. package/Utils/Monitor/DeviceMacLearningUtil.js +26 -0
  261. package/Utils/Monitor/EndpointAttachmentUtil.js +8 -3
  262. package/Utils/Monitor/ExternalStatusPageReading.d.mts +3 -0
  263. package/Utils/Monitor/ExternalStatusPageReading.d.ts +3 -0
  264. package/Utils/Monitor/ExternalStatusPageReading.js +35 -1
  265. package/Utils/Monitor/ExternalStatusPageReading.mjs +2 -0
  266. package/Utils/Monitor/MonitorTemplateLinkRefusal.d.mts +9 -0
  267. package/Utils/Monitor/MonitorTemplateLinkRefusal.d.ts +9 -0
  268. package/Utils/Monitor/MonitorTemplateLinkRefusal.js +45 -0
  269. package/Utils/Monitor/MonitorTemplateLinkRefusal.mjs +6 -0
  270. package/Utils/OpenStack/OpenStackCheckName.js +2 -1
  271. package/Utils/OpenStack/OpenStackLogScrub.js +1 -1
  272. package/Utils/OpenStack/OpenStackLogs.js +3 -2
  273. package/Utils/OpenStack/OpenStackTraces.js +2 -1
  274. package/Utils/Project/NotificationChannels.js +5 -5
  275. package/Utils/Project/ProjectBalance.js +2 -2
  276. package/Utils/Project/TwilioAccount.js +2 -2
  277. package/Utils/ScheduledMaintenanceStart.d.mts +3 -0
  278. package/Utils/ScheduledMaintenanceStart.d.ts +3 -0
  279. package/Utils/ScheduledMaintenanceStart.js +9 -0
  280. package/Utils/Schema/ModelSchema.js +10 -1
  281. package/Utils/Uptime/UptimeMaintenanceUtil.js +2 -1
  282. package/Utils/ValueFormatter.d.mts +8 -6
  283. package/Utils/ValueFormatter.d.ts +8 -6
  284. package/Utils/ValueFormatter.js +145 -0
  285. package/package.json +1 -1
package/Types/Date.js CHANGED
@@ -53,6 +53,10 @@ exports.Moment = moment_timezone_1.default;
53
53
  * are written in the reader's language for, as Intl asks for them. A shape
54
54
  * with no words in it ("YYYY", "HH:mm:ss.SSS") reads the same in every
55
55
  * language; one that is not listed is written by moment, in English.
56
+ *
57
+ * English's "hh" keeps a 12-hour time's zero ("05:01 PM"), as moment writes
58
+ * it; no other language writes one there ("오후 5:01", "5:01 م"), so the
59
+ * reader's language takes the hour without it (getHourOption, issue #7279).
56
60
  */
57
61
  const LOCALIZED_CUSTOM_DATE_FORMATS = {
58
62
  "MMM D": { month: "short", day: "numeric" },
@@ -64,7 +68,7 @@ const LOCALIZED_CUSTOM_DATE_FORMATS = {
64
68
  "MMMM YYYY": { month: "long", year: "numeric" },
65
69
  "MMMM D, YYYY": { month: "long", day: "numeric", year: "numeric" },
66
70
  "h:mm A": { hour: "numeric", minute: "2-digit", hour12: true },
67
- "hh:mm A": { hour: "2-digit", minute: "2-digit", hour12: true },
71
+ "hh:mm A": { hour: (0, DateLanguage_1.getHourOption)(true), minute: "2-digit", hour12: true },
68
72
  // A 24-hour time of day, in the reader's digits: "۲۲:۲۷" on a Persian page.
69
73
  "HH:mm": { hour: "2-digit", minute: "2-digit", hourCycle: "h23" },
70
74
  };
@@ -1274,11 +1278,31 @@ class OneUptimeDate {
1274
1278
  }
1275
1279
  /**
1276
1280
  * Render an instant as the value of an `<input type="datetime-local">` — a
1277
- * bare wall-clock with no offset — read in the current timezone.
1281
+ * bare wall-clock with no offset — read in the current timezone, to the
1282
+ * second ("2026-11-13T11:15:52").
1283
+ *
1284
+ * A field people schedule with shows toDateTimeLocalMinuteString instead:
1285
+ * a value with seconds makes the browser's picker show and ask for them
1286
+ * too. Only a field that compares with event timestamps (a telemetry time
1287
+ * range) keeps the seconds, by opting in (Input's showSecondsForDateTime).
1278
1288
  */
1279
1289
  static toDateTimeLocalString(date) {
1280
1290
  return this.inCurrentTimezone(date).format("YYYY-MM-DDTHH:mm:ss");
1281
1291
  }
1292
+ /**
1293
+ * The value an `<input type="datetime-local">` shows a person who picks a
1294
+ * time to schedule or record something: the wall clock in the current
1295
+ * timezone, to the minute ("2026-11-13T11:15"). Without seconds in its
1296
+ * value, the browser's picker shows hours and minutes and no seconds
1297
+ * column, and what is picked comes back to the minute.
1298
+ *
1299
+ * The seconds of an instant stored with them are not shown, and not lost:
1300
+ * a field left as it was keeps the value it was given (Input changes its
1301
+ * value only when the person changes the field).
1302
+ */
1303
+ static toDateTimeLocalMinuteString(date) {
1304
+ return this.inCurrentTimezone(date).format("YYYY-MM-DDTHH:mm");
1305
+ }
1282
1306
  /**
1283
1307
  * Inverse of toDateTimeLocalString: turn the offset-less wall-clock a user
1284
1308
  * typed into a `<input type="date">` / `<input type="datetime-local">` into
@@ -1610,6 +1634,22 @@ class OneUptimeDate {
1610
1634
  }
1611
1635
  return (0, moment_timezone_1.default)(date).endOf("day").toDate();
1612
1636
  }
1637
+ /*
1638
+ * The start of the minute `date` falls in: its seconds and milliseconds
1639
+ * dropped, as a new Date (the one given is left as it was). The same
1640
+ * instant in every timezone, since every zone's offset today is a whole
1641
+ * number of minutes.
1642
+ *
1643
+ * What "now" is in a field people schedule with: an override, a rotation
1644
+ * or an announcement that starts now starts at the minute the field shows
1645
+ * (11:15, never 11:15:52), which has already begun - never a minute late.
1646
+ */
1647
+ static getStartOfMinute(date) {
1648
+ const instant = this.fromString(date);
1649
+ const millisecondsInAMinute = 60 * 1000;
1650
+ return new Date(Math.floor(instant.getTime() / millisecondsInAMinute) *
1651
+ millisecondsInAMinute);
1652
+ }
1613
1653
  /*
1614
1654
  * Calendar arithmetic - "the previous calendar month", "add 3 calendar
1615
1655
  * months" - as opposed to the fixed-length arithmetic the rest of this class
@@ -36,6 +36,8 @@ export interface DateTextShape {
36
36
  hideYear?: boolean | undefined;
37
37
  twoDigitDay?: boolean | undefined;
38
38
  }
39
+ export declare const getHourOption: (use12HourFormat: boolean | undefined) => "numeric" | "2-digit";
40
+ export declare const getLocaleClockHourOption: (pinnedLocale: string) => "numeric" | "2-digit";
39
41
  export declare const getDateTimeOptions: (shape: DateTextShape) => Intl.DateTimeFormatOptions;
40
42
  export declare const formatDateText: (data: {
41
43
  date: Date;
@@ -36,6 +36,8 @@ export interface DateTextShape {
36
36
  hideYear?: boolean | undefined;
37
37
  twoDigitDay?: boolean | undefined;
38
38
  }
39
+ export declare const getHourOption: (use12HourFormat: boolean | undefined) => "numeric" | "2-digit";
40
+ export declare const getLocaleClockHourOption: (pinnedLocale: string) => "numeric" | "2-digit";
39
41
  export declare const getDateTimeOptions: (shape: DateTextShape) => Intl.DateTimeFormatOptions;
40
42
  export declare const formatDateText: (data: {
41
43
  date: Date;
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.writeDigitsInLocale = exports.getDigitsOf = exports.formatDecimal = exports.formatDurationText = exports.formatDurationUnit = exports.formatRelativeAmount = exports.formatRelativeDate = exports.getRelativeDistance = exports.formatDateText = exports.getDateTimeOptions = exports.getDateTimeFormat = exports.writeInDateDisplayLanguage = exports.forgetRememberedDateTexts = exports.getEnglishOf = exports.rememberEnglishOf = exports.MAX_REMEMBERED_DATE_TEXTS = exports.formatReaderFigure = exports.formatReaderNumber = exports.getReaderDateLocale = exports.getReaderNumberLocale = exports.getDateLocale = exports.getNumberLocale = exports.writesLatinDigits = exports.LATIN_DIGIT_LANGUAGES = exports.setDateDisplayLanguage = exports.getDateDisplayLanguage = exports.isEnglishDateLanguage = exports.ENGLISH_DATE_LANGUAGE = void 0;
36
+ exports.writeDigitsInLocale = exports.getDigitsOf = exports.formatDecimal = exports.formatDurationText = exports.formatDurationUnit = exports.formatRelativeAmount = exports.formatRelativeDate = exports.getRelativeDistance = exports.formatDateText = exports.getDateTimeOptions = exports.getLocaleClockHourOption = exports.getHourOption = exports.getDateTimeFormat = exports.writeInDateDisplayLanguage = exports.forgetRememberedDateTexts = exports.getEnglishOf = exports.rememberEnglishOf = exports.MAX_REMEMBERED_DATE_TEXTS = exports.formatReaderFigure = exports.formatReaderNumber = exports.getReaderDateLocale = exports.getReaderNumberLocale = exports.getDateLocale = exports.getNumberLocale = exports.writesLatinDigits = exports.LATIN_DIGIT_LANGUAGES = exports.setDateDisplayLanguage = exports.getDateDisplayLanguage = exports.isEnglishDateLanguage = exports.ENGLISH_DATE_LANGUAGE = void 0;
37
37
  exports.withDateDisplayLanguage = withDateDisplayLanguage;
38
38
  exports.inEnglishDates = inEnglishDates;
39
39
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
@@ -392,6 +392,48 @@ const getDateTimeFormat = (data) => {
392
392
  return null;
393
393
  };
394
394
  exports.getDateTimeFormat = getDateTimeFormat;
395
+ /*
396
+ * How Intl writes the hour of a time of day on the reader's clock.
397
+ *
398
+ * A 12-hour time's hour has no leading zero in any language: "5:14 AM",
399
+ * "오전 5:14", "上午5:14", "5:14 am", "5:14 ص", "۵:۱۴ ق.ظ.". Asked for two
400
+ * digits there, Intl wrote "오전 05:14" and "05:14 ص" in every language but
401
+ * English, which moment writes "5:14 AM" (issue #7279). A 24-hour time keeps
402
+ * its zero: "05:14" - "numeric" would drop it in German, French, Japanese
403
+ * and most others ("5:14") while Korean, Hindi and Arabic keep it.
404
+ */
405
+ const getHourOption = (use12HourFormat) => {
406
+ return use12HourFormat ? "numeric" : "2-digit";
407
+ };
408
+ exports.getHourOption = getHourOption;
409
+ const LOCALE_CLOCK_HOUR_OPTIONS = new Map();
410
+ /*
411
+ * The hour of a time that follows its language's own clock, not the
412
+ * reader's 12- or 24-hour setting: a calendar's grid, a chart's axis, a
413
+ * diagnostics line. Korean, Traditional Chinese, Hindi, Arabic and US
414
+ * English read a 12-hour clock ("오전 5:14", "5:14 ص", "5:14 AM"), the
415
+ * others a 24-hour one ("05:14"). A two-digit hour asked of the language's own clock
416
+ * wrote "오전 05:14" (issue #7279). `pinnedLocale` is a locale already made
417
+ * for the language (getNumberLocale, getDateLocale, getReaderDateLocale).
418
+ */
419
+ const getLocaleClockHourOption = (pinnedLocale) => {
420
+ const remembered = LOCALE_CLOCK_HOUR_OPTIONS.get(pinnedLocale);
421
+ if (remembered) {
422
+ return remembered;
423
+ }
424
+ let hour = "2-digit";
425
+ try {
426
+ hour = (0, exports.getHourOption)(new Intl.DateTimeFormat(pinnedLocale, {
427
+ hour: "numeric",
428
+ }).resolvedOptions().hour12);
429
+ }
430
+ catch (_a) {
431
+ // A locale Intl refuses: the 24-hour hour, as before.
432
+ }
433
+ LOCALE_CLOCK_HOUR_OPTIONS.set(pinnedLocale, hour);
434
+ return hour;
435
+ };
436
+ exports.getLocaleClockHourOption = getLocaleClockHourOption;
395
437
  // The Intl options a shape of OneUptimeDate's dates asks for.
396
438
  const getDateTimeOptions = (shape) => {
397
439
  const options = {
@@ -405,7 +447,7 @@ const getDateTimeOptions = (shape) => {
405
447
  options.weekday = "short";
406
448
  }
407
449
  if (!shape.onlyShowDate) {
408
- options.hour = "2-digit";
450
+ options.hour = (0, exports.getHourOption)(shape.use12HourFormat);
409
451
  options.minute = "2-digit";
410
452
  options.hour12 = Boolean(shape.use12HourFormat);
411
453
  if (shape.showSeconds) {
@@ -17,6 +17,8 @@ export const getDateTimeFormat = commonJsModule.getDateTimeFormat;
17
17
  export const getDateTimeOptions = commonJsModule.getDateTimeOptions;
18
18
  export const getDigitsOf = commonJsModule.getDigitsOf;
19
19
  export const getEnglishOf = commonJsModule.getEnglishOf;
20
+ export const getHourOption = commonJsModule.getHourOption;
21
+ export const getLocaleClockHourOption = commonJsModule.getLocaleClockHourOption;
20
22
  export const getNumberLocale = commonJsModule.getNumberLocale;
21
23
  export const getReaderDateLocale = commonJsModule.getReaderDateLocale;
22
24
  export const getReaderNumberLocale = commonJsModule.getReaderNumberLocale;
@@ -0,0 +1,7 @@
1
+ import { ReadingDirection } from "./ReadingDirection.mjs";
2
+ export declare const RIGHTWARDS_ARROW: string;
3
+ export declare const LEFTWARDS_ARROW: string;
4
+ export declare const getArrowOn: (language: string | null | undefined) => string;
5
+ export declare const getArrowBack: (language: string | null | undefined) => string;
6
+ export declare const joinWithArrowsInDirection: (values: ReadonlyArray<string>, direction: ReadingDirection) => string;
7
+ export declare const joinWithArrowsOn: (values: ReadonlyArray<string>, language: string | null | undefined) => string;
@@ -0,0 +1,7 @@
1
+ import { ReadingDirection } from "./ReadingDirection";
2
+ export declare const RIGHTWARDS_ARROW: string;
3
+ export declare const LEFTWARDS_ARROW: string;
4
+ export declare const getArrowOn: (language: string | null | undefined) => string;
5
+ export declare const getArrowBack: (language: string | null | undefined) => string;
6
+ export declare const joinWithArrowsInDirection: (values: ReadonlyArray<string>, direction: ReadingDirection) => string;
7
+ export declare const joinWithArrowsOn: (values: ReadonlyArray<string>, language: string | null | undefined) => string;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.joinWithArrowsOn = exports.joinWithArrowsInDirection = exports.getArrowBack = exports.getArrowOn = exports.LEFTWARDS_ARROW = exports.RIGHTWARDS_ARROW = void 0;
4
+ const ReadingDirection_1 = require("./ReadingDirection");
5
+ /*
6
+ * AN ARROW THAT POINTS THE WAY ITS LINE IS READ.
7
+ *
8
+ * A browser turns a bracket, ">" and "›" round on a line read from the
9
+ * right, but draws "→" and "←" as they are written. So an arrow a
10
+ * component wrote into its line pointed back on an Arabic or Persian page:
11
+ * between two values ("Declared → Acknowledged", "12.5% → 15.0%") from the
12
+ * second to the first, after a link's words ("Show on map →") back into
13
+ * them. Those languages write such an arrow "←" (the Dashboard's
14
+ * Locales/ARABIC.md), and so do the Persian docs.
15
+ *
16
+ * A component takes its arrow from here, for the language its line is
17
+ * read in, and never writes one itself:
18
+ *
19
+ * - getArrowOn: to what comes next - the second of two values, where a
20
+ * link leads. "→", and "←" in a language read from the right.
21
+ * - getArrowBack: to what came before - "← Back", a field that takes an
22
+ * answer's value ("Severity ← from answer"). "←", and "→".
23
+ * - joinWithArrowsOn: values in the order they are read, with the arrow
24
+ * on between each two. Each value is set apart where it could move the
25
+ * arrow (setApartInSentence): between two names in Latin letters the
26
+ * bidi algorithm would draw an arrow from the left on a Persian page,
27
+ * between two Persian ones from the right on an English page. Set
28
+ * apart, each value reads its own way and the arrow is the line's.
29
+ * - joinWithArrowsInDirection: the same in a line read one way on every
30
+ * page, as the names of a diagram drawn from the left everywhere are.
31
+ *
32
+ * Common/UI's DirectionArrow draws the arrow in a component.
33
+ * ComponentArrowsInRightToLeftPages (Common/Tests/App) fails on an arrow
34
+ * written into the Dashboard's or the shared UI's components instead.
35
+ */
36
+ exports.RIGHTWARDS_ARROW = "→";
37
+ exports.LEFTWARDS_ARROW = "←";
38
+ // The arrow to what comes next, in a line read `direction`.
39
+ const getArrowOnInDirection = (direction) => {
40
+ return direction === ReadingDirection_1.RIGHT_TO_LEFT ? exports.LEFTWARDS_ARROW : exports.RIGHTWARDS_ARROW;
41
+ };
42
+ // The arrow to what comes next, in a line read in `language`.
43
+ const getArrowOn = (language) => {
44
+ return getArrowOnInDirection((0, ReadingDirection_1.getReadingDirection)(language));
45
+ };
46
+ exports.getArrowOn = getArrowOn;
47
+ // The arrow to what came before, in a line read in `language`.
48
+ const getArrowBack = (language) => {
49
+ return (0, ReadingDirection_1.getReadingDirection)(language) === ReadingDirection_1.RIGHT_TO_LEFT
50
+ ? exports.RIGHTWARDS_ARROW
51
+ : exports.LEFTWARDS_ARROW;
52
+ };
53
+ exports.getArrowBack = getArrowBack;
54
+ // RIGHT-TO-LEFT ISOLATE: what follows it, up to its PDI, reads from the right.
55
+ const RIGHT_TO_LEFT_ISOLATE = String.fromCharCode(0x2067);
56
+ /*
57
+ * "first → second → third" in a line read `direction`: the values in
58
+ * the order they are read, each set apart where it could move the arrow.
59
+ * Read from the left, two names in Latin letters are written exactly as
60
+ * they were joined before ("m5.2xlarge → m5.xlarge").
61
+ *
62
+ * Read from the right, the whole is set apart once more, right to left
63
+ * (RLI ... PDI). A sentence that takes it as one of its values may set
64
+ * that value apart (setsValuesApart), and an isolate with no letter of its
65
+ * own outside the values it sets apart reads from the left: every arrow
66
+ * in it would point back again.
67
+ *
68
+ * A line takes its direction from the language its page reads
69
+ * (joinWithArrowsOn), except the names of a diagram drawn from the left on
70
+ * every page: the user flow map's bands run left to right on an Arabic
71
+ * page too, so a band is named the map's way there, "/home → /cart".
72
+ */
73
+ const joinWithArrowsInDirection = (values, direction) => {
74
+ const joined = values
75
+ .map((value) => {
76
+ return (0, ReadingDirection_1.setApartInSentence)(value, direction);
77
+ })
78
+ .join(` ${getArrowOnInDirection(direction)} `);
79
+ return direction === ReadingDirection_1.RIGHT_TO_LEFT && values.length > 1
80
+ ? `${RIGHT_TO_LEFT_ISOLATE}${joined}${ReadingDirection_1.POP_DIRECTIONAL_ISOLATE}`
81
+ : joined;
82
+ };
83
+ exports.joinWithArrowsInDirection = joinWithArrowsInDirection;
84
+ // The same, in a line read in `language`: the way its page reads.
85
+ const joinWithArrowsOn = (values, language) => {
86
+ return (0, exports.joinWithArrowsInDirection)(values, (0, ReadingDirection_1.getReadingDirection)(language));
87
+ };
88
+ exports.joinWithArrowsOn = joinWithArrowsOn;
@@ -0,0 +1,7 @@
1
+ import commonJsModule from "./DirectionArrow.js";
2
+ export const LEFTWARDS_ARROW = commonJsModule.LEFTWARDS_ARROW;
3
+ export const RIGHTWARDS_ARROW = commonJsModule.RIGHTWARDS_ARROW;
4
+ export const getArrowBack = commonJsModule.getArrowBack;
5
+ export const getArrowOn = commonJsModule.getArrowOn;
6
+ export const joinWithArrowsInDirection = commonJsModule.joinWithArrowsInDirection;
7
+ export const joinWithArrowsOn = commonJsModule.joinWithArrowsOn;
@@ -14,6 +14,7 @@ declare enum GlossaryTerm {
14
14
  OnCallSchedule = "on-call-schedule",
15
15
  Layer = "layer",
16
16
  NotificationMethod = "notification-method",
17
+ HowToReachMe = "how-to-reach-me",
17
18
  StatusPage = "status-page",
18
19
  Subscriber = "subscriber",
19
20
  ScheduledMaintenance = "scheduled-maintenance",
@@ -14,6 +14,7 @@ declare enum GlossaryTerm {
14
14
  OnCallSchedule = "on-call-schedule",
15
15
  Layer = "layer",
16
16
  NotificationMethod = "notification-method",
17
+ HowToReachMe = "how-to-reach-me",
17
18
  StatusPage = "status-page",
18
19
  Subscriber = "subscriber",
19
20
  ScheduledMaintenance = "scheduled-maintenance",
@@ -41,6 +41,8 @@ var GlossaryTerm;
41
41
  GlossaryTerm["OnCallSchedule"] = "on-call-schedule";
42
42
  GlossaryTerm["Layer"] = "layer";
43
43
  GlossaryTerm["NotificationMethod"] = "notification-method";
44
+ // A person's own paging rules: the page #6820 named, #6817 defined.
45
+ GlossaryTerm["HowToReachMe"] = "how-to-reach-me";
44
46
  GlossaryTerm["StatusPage"] = "status-page";
45
47
  GlossaryTerm["Subscriber"] = "subscriber";
46
48
  GlossaryTerm["ScheduledMaintenance"] = "scheduled-maintenance";
@@ -0,0 +1,11 @@
1
+ import GlossaryTerm from "./GlossaryTerm.mjs";
2
+ export interface RetiredName {
3
+ name: string;
4
+ nowCalled: string;
5
+ glossaryTerm: GlossaryTerm;
6
+ pattern: RegExp;
7
+ example?: string | undefined;
8
+ retiredIn: string;
9
+ }
10
+ export declare const RETIRED_NAMES: ReadonlyArray<RetiredName>;
11
+ export declare function findRetiredNames(text: string): Array<RetiredName>;
@@ -0,0 +1,11 @@
1
+ import GlossaryTerm from "./GlossaryTerm";
2
+ export interface RetiredName {
3
+ name: string;
4
+ nowCalled: string;
5
+ glossaryTerm: GlossaryTerm;
6
+ pattern: RegExp;
7
+ example?: string | undefined;
8
+ retiredIn: string;
9
+ }
10
+ export declare const RETIRED_NAMES: ReadonlyArray<RetiredName>;
11
+ export declare function findRetiredNames(text: string): Array<RetiredName>;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RETIRED_NAMES = void 0;
7
+ exports.findRetiredNames = findRetiredNames;
8
+ const GlossaryTerm_1 = __importDefault(require("./GlossaryTerm"));
9
+ exports.RETIRED_NAMES = [
10
+ {
11
+ name: "On-Call Duty",
12
+ nowCalled: "On-Call",
13
+ glossaryTerm: GlossaryTerm_1.default.OnCallPolicy,
14
+ // Also the policies and schedules it named, written in lower case.
15
+ pattern: /\bOn[- ]Call Duty\b|\b[Oo]n[- ]call[- ]duty (?:polic(?:y|ies)|schedules?)\b/,
16
+ retiredIn: "#6817 part 1",
17
+ },
18
+ {
19
+ name: "On Call",
20
+ nowCalled: "On-Call",
21
+ glossaryTerm: GlossaryTerm_1.default.OnCallPolicy,
22
+ // "On Call Policy", "User On Call Time", a heading of its own; never "whoever is on call".
23
+ pattern: /\bOn Call (?!Duty\b)(?=[A-Z])|^On Call$/,
24
+ example: "User On Call Time",
25
+ retiredIn: "#6817 part 1",
26
+ },
27
+ {
28
+ name: "On-Call Policy Schedule",
29
+ nowCalled: "On-Call Schedule",
30
+ glossaryTerm: GlossaryTerm_1.default.OnCallSchedule,
31
+ pattern: /\bon-call policy schedules?\b/i,
32
+ retiredIn: "#6817 part 1",
33
+ },
34
+ {
35
+ name: "Personal On-Call Rules",
36
+ nowCalled: "How to Reach Me",
37
+ glossaryTerm: GlossaryTerm_1.default.HowToReachMe,
38
+ pattern: /\bpersonal on-call rules?\b/i,
39
+ retiredIn: "#6817 part 1",
40
+ },
41
+ {
42
+ name: "Project Settings > Notifications > Notification Settings",
43
+ nowCalled: "Project Settings > Notifications > Notification Channels",
44
+ glossaryTerm: GlossaryTerm_1.default.NotificationSettings,
45
+ // The project's page; User Settings' page keeps the name.
46
+ pattern: /Project Settings\**\s*(?:→|>|›)\s*\**Notifications\**\s*(?:→|>|›)\s*\**Notification Settings/,
47
+ retiredIn: "#6817 part 1",
48
+ },
49
+ {
50
+ name: "Performance Profiles",
51
+ nowCalled: "Profiles",
52
+ glossaryTerm: GlossaryTerm_1.default.Profiles,
53
+ pattern: /\bPerformance Profiles?\b/,
54
+ retiredIn: "#6817 part 2",
55
+ },
56
+ {
57
+ name: "Profiler",
58
+ nowCalled: "Profiles",
59
+ glossaryTerm: GlossaryTerm_1.default.Profiles,
60
+ /*
61
+ * The page's title. Never "a profiler", the tool that sends profiles,
62
+ * nor one's own name: React's <Profiler>, the OpenTelemetry eBPF
63
+ * Profiler, Pyroscope.Profiler.Native.so.
64
+ */
65
+ pattern: /(?<!<|\w\.|eBPF )\bProfiler\b(?!>|\.\w)/,
66
+ retiredIn: "#6817 part 2",
67
+ },
68
+ {
69
+ name: "Continuous Profiling",
70
+ nowCalled: "Profiles",
71
+ glossaryTerm: GlossaryTerm_1.default.Profiles,
72
+ pattern: /\bContinuous Profiling\b/,
73
+ retiredIn: "#6817 part 2",
74
+ },
75
+ {
76
+ name: "Exception Tracking",
77
+ nowCalled: "Exceptions",
78
+ glossaryTerm: GlossaryTerm_1.default.Exception,
79
+ pattern: /\bException Tracking\b/,
80
+ retiredIn: "#6817 part 2",
81
+ },
82
+ {
83
+ name: "Monitor Criteria",
84
+ nowCalled: "Criteria",
85
+ glossaryTerm: GlossaryTerm_1.default.Criteria,
86
+ // Also "Monitoring Criteria"; the API's monitor steps keep their name.
87
+ pattern: /\bMonitor(?:ing)? Criteria\b/,
88
+ retiredIn: "#6817 part 2",
89
+ },
90
+ {
91
+ name: "Telemetry Ingestion Key",
92
+ nowCalled: "Ingestion Key",
93
+ glossaryTerm: GlossaryTerm_1.default.IngestionKey,
94
+ pattern: /\bTelemetry Ingestion Keys?\b/,
95
+ retiredIn: "#6817 part 2",
96
+ },
97
+ {
98
+ name: "Service Catalog",
99
+ nowCalled: "Services",
100
+ glossaryTerm: GlossaryTerm_1.default.Service,
101
+ pattern: /\bService Catalog\b/,
102
+ retiredIn: "#6817 part 3",
103
+ },
104
+ {
105
+ name: "Telemetry Service",
106
+ nowCalled: "Service",
107
+ glossaryTerm: GlossaryTerm_1.default.Service,
108
+ pattern: /\bTelemetry Services?\b/,
109
+ retiredIn: "#6817 part 3",
110
+ },
111
+ {
112
+ name: "Scheduled Maintenance Event",
113
+ nowCalled: "Maintenance Event",
114
+ glossaryTerm: GlossaryTerm_1.default.ScheduledMaintenance,
115
+ // One record: the product keeps its name, Scheduled Maintenance.
116
+ pattern: /\bScheduled Maintenance Events?\b/,
117
+ retiredIn: "#6817 part 3",
118
+ },
119
+ {
120
+ name: "Scheduled Event",
121
+ nowCalled: "Maintenance Event",
122
+ glossaryTerm: GlossaryTerm_1.default.ScheduledMaintenance,
123
+ pattern: /\bScheduled Events?\b/,
124
+ retiredIn: "#6817 part 3",
125
+ },
126
+ {
127
+ name: "Event State",
128
+ nowCalled: "Maintenance State",
129
+ glossaryTerm: GlossaryTerm_1.default.ScheduledMaintenance,
130
+ pattern: /\bEvent States?\b/,
131
+ retiredIn: "#6817 part 3",
132
+ },
133
+ ];
134
+ // The retired names a text uses, by name.
135
+ function findRetiredNames(text) {
136
+ return exports.RETIRED_NAMES.filter((retired) => {
137
+ return retired.pattern.test(text);
138
+ });
139
+ }
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./RetiredNames.js";
2
+ export const RETIRED_NAMES = commonJsModule.RETIRED_NAMES;
3
+ export const findRetiredNames = commonJsModule.findRetiredNames;
@@ -0,0 +1,7 @@
1
+ import { TemplateValues } from "../Translator.mjs";
2
+ export interface RefusalWithValues {
3
+ template: string;
4
+ terms: ReadonlyArray<string>;
5
+ }
6
+ export declare const getRefusalText: (refusal: RefusalWithValues, values: Record<string, string>) => string;
7
+ export declare const readRefusalValues: (refusal: RefusalWithValues, message: string | null | undefined) => TemplateValues | null;
@@ -0,0 +1,7 @@
1
+ import { TemplateValues } from "../Translator";
2
+ export interface RefusalWithValues {
3
+ template: string;
4
+ terms: ReadonlyArray<string>;
5
+ }
6
+ export declare const getRefusalText: (refusal: RefusalWithValues, values: Record<string, string>) => string;
7
+ export declare const readRefusalValues: (refusal: RefusalWithValues, message: string | null | undefined) => TemplateValues | null;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readRefusalValues = exports.getRefusalText = void 0;
4
+ const Translator_1 = require("../Translator");
5
+ // A {{placeholder}}, read as Common/Types/Translator fills one.
6
+ const PLACEHOLDER = /\{\{\s*([\w.]+)\s*\}\}/g;
7
+ /*
8
+ * The sentence cut at its placeholders: the words before each one, and the
9
+ * words after the last (so one more piece of words than placeholders).
10
+ */
11
+ const cutAtPlaceholders = (template) => {
12
+ const words = [];
13
+ const placeholders = [];
14
+ let wordsStart = 0;
15
+ for (const match of template.matchAll(PLACEHOLDER)) {
16
+ const start = match.index || 0;
17
+ words.push(template.slice(wordsStart, start));
18
+ placeholders.push(match[1] || "");
19
+ wordsStart = start + match[0].length;
20
+ }
21
+ words.push(template.slice(wordsStart));
22
+ return { words: words, placeholders: placeholders };
23
+ };
24
+ // The refusal as the server answers it: in English, with its values in it.
25
+ const getRefusalText = (refusal, values) => {
26
+ return (0, Translator_1.fillTemplate)(refusal.template, values);
27
+ };
28
+ exports.getRefusalText = getRefusalText;
29
+ /*
30
+ * The values of `refusal` that `message` holds, as the sentence's values -
31
+ * each of `terms` a word to say in the reader's language - or null when
32
+ * `message` is not that refusal. Each value is the text between the words
33
+ * around its placeholder; a placeholder the sentence names twice reads the
34
+ * same text both times, and no value is empty.
35
+ */
36
+ const readRefusalValues = (refusal, message) => {
37
+ const text = (message || "").trim();
38
+ const { words, placeholders } = cutAtPlaceholders(refusal.template);
39
+ const first = words[0] || "";
40
+ if (placeholders.length === 0 || !text.startsWith(first)) {
41
+ return null;
42
+ }
43
+ const read = {};
44
+ let position = first.length;
45
+ for (let index = 0; index < placeholders.length; index++) {
46
+ const placeholder = placeholders[index] || "";
47
+ const after = words[index + 1] || "";
48
+ const isLast = index === placeholders.length - 1;
49
+ let end = -1;
50
+ if (isLast) {
51
+ end = text.endsWith(after) ? text.length - after.length : -1;
52
+ }
53
+ else if (after) {
54
+ end = text.indexOf(after, position);
55
+ }
56
+ // Two placeholders with no words between them cannot be told apart.
57
+ if (end <= position) {
58
+ return null;
59
+ }
60
+ const value = text.slice(position, end);
61
+ if (read[placeholder] !== undefined && read[placeholder] !== value) {
62
+ return null;
63
+ }
64
+ read[placeholder] = value;
65
+ position = end + after.length;
66
+ }
67
+ const values = {};
68
+ for (const placeholder of Object.keys(read)) {
69
+ const value = read[placeholder] || "";
70
+ values[placeholder] = refusal.terms.includes(placeholder)
71
+ ? (0, Translator_1.translatableTerm)(value)
72
+ : value;
73
+ }
74
+ return values;
75
+ };
76
+ exports.readRefusalValues = readRefusalValues;
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./RefusalWithValues.js";
2
+ export const getRefusalText = commonJsModule.getRefusalText;
3
+ export const readRefusalValues = commonJsModule.readRefusalValues;
@@ -43,3 +43,16 @@ export interface UnexplainedError {
43
43
  reference: string | null;
44
44
  }
45
45
  export declare const readUnexplainedError: (message: string | undefined | null) => UnexplainedError | null;
46
+ export interface UnexplainedErrorReader {
47
+ isCloud: boolean;
48
+ isMasterAdmin: boolean;
49
+ isVisitor?: boolean | undefined;
50
+ }
51
+ export interface UnexplainedErrorExplanation {
52
+ why: string;
53
+ next: string;
54
+ whereToLook: string | null;
55
+ }
56
+ export declare const getExplanationWords: (data: {
57
+ error: UnexplainedError;
58
+ } & UnexplainedErrorReader) => UnexplainedErrorExplanation;
@@ -43,3 +43,16 @@ export interface UnexplainedError {
43
43
  reference: string | null;
44
44
  }
45
45
  export declare const readUnexplainedError: (message: string | undefined | null) => UnexplainedError | null;
46
+ export interface UnexplainedErrorReader {
47
+ isCloud: boolean;
48
+ isMasterAdmin: boolean;
49
+ isVisitor?: boolean | undefined;
50
+ }
51
+ export interface UnexplainedErrorExplanation {
52
+ why: string;
53
+ next: string;
54
+ whereToLook: string | null;
55
+ }
56
+ export declare const getExplanationWords: (data: {
57
+ error: UnexplainedError;
58
+ } & UnexplainedErrorReader) => UnexplainedErrorExplanation;