@oneuptime/common 14.0.92 → 14.0.94

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 (271) hide show
  1. package/Models/DatabaseModels/Alert.d.mts +2 -0
  2. package/Models/DatabaseModels/Alert.d.ts +2 -0
  3. package/Models/DatabaseModels/Alert.js +62 -1
  4. package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
  5. package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
  6. package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
  7. package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
  8. package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
  9. package/Models/DatabaseModels/CloudAccount.js +546 -0
  10. package/Models/DatabaseModels/CloudAccount.mjs +2 -0
  11. package/Models/DatabaseModels/CloudResource.d.mts +8 -0
  12. package/Models/DatabaseModels/CloudResource.d.ts +8 -0
  13. package/Models/DatabaseModels/CloudResource.js +169 -0
  14. package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
  15. package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
  16. package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
  17. package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
  18. package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
  19. package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
  20. package/Models/DatabaseModels/Incident.d.mts +2 -0
  21. package/Models/DatabaseModels/Incident.d.ts +2 -0
  22. package/Models/DatabaseModels/Incident.js +54 -0
  23. package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
  24. package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
  25. package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
  26. package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
  27. package/Models/DatabaseModels/Index.js +2 -0
  28. package/Models/DatabaseModels/LlmProvider.js +1 -1
  29. package/Models/DatabaseModels/Monitor.d.mts +2 -0
  30. package/Models/DatabaseModels/Monitor.d.ts +2 -0
  31. package/Models/DatabaseModels/Monitor.js +54 -0
  32. package/Models/DatabaseModels/MonitorTemplate.js +10 -4
  33. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
  34. package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
  35. package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
  36. package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
  37. package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
  38. package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
  39. package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
  40. package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
  41. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
  42. package/Models/DatabaseModels/StatusPage.d.mts +2 -0
  43. package/Models/DatabaseModels/StatusPage.d.ts +2 -0
  44. package/Models/DatabaseModels/StatusPage.js +100 -0
  45. package/Types/AI/AiAffectedResources.d.mts +40 -0
  46. package/Types/AI/AiAffectedResources.d.ts +40 -0
  47. package/Types/AI/AiAffectedResources.js +292 -0
  48. package/Types/AI/AiAffectedResources.mjs +10 -0
  49. package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
  50. package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
  51. package/Types/Cloud/CloudAccountSummary.js +114 -0
  52. package/Types/Cloud/CloudAccountSummary.mjs +5 -0
  53. package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
  54. package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
  55. package/Types/Cloud/CloudEndpointMatch.js +134 -0
  56. package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
  57. package/Types/Cloud/CloudInventory.d.mts +34 -0
  58. package/Types/Cloud/CloudInventory.d.ts +34 -0
  59. package/Types/Cloud/CloudInventory.js +362 -0
  60. package/Types/Cloud/CloudInventory.mjs +22 -0
  61. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  62. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  63. package/Types/Cloud/CloudResourceCatalog.js +29 -1
  64. package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
  65. package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
  66. package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
  67. package/Types/Cloud/CloudResourceIndex.js +191 -0
  68. package/Types/Cloud/CloudResourceIndex.mjs +4 -0
  69. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
  70. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
  71. package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
  72. package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
  73. package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
  74. package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
  75. package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
  76. package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
  77. package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
  78. package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
  79. package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
  80. package/Types/CloudConnection/CloudConnectionTest.js +1 -0
  81. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
  82. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
  83. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
  84. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
  85. package/Types/Database/BlankColumnValue.d.mts +6 -0
  86. package/Types/Database/BlankColumnValue.d.ts +6 -0
  87. package/Types/Database/BlankColumnValue.js +77 -0
  88. package/Types/Database/BlankColumnValue.mjs +4 -0
  89. package/Types/Date.d.mts +1 -0
  90. package/Types/Date.d.ts +1 -0
  91. package/Types/Date.js +32 -6
  92. package/Types/DateLanguage.d.mts +2 -0
  93. package/Types/DateLanguage.d.ts +2 -0
  94. package/Types/DateLanguage.js +67 -12
  95. package/Types/DateLanguage.mjs +2 -0
  96. package/Types/Domain.d.mts +2 -0
  97. package/Types/Domain.d.ts +2 -0
  98. package/Types/Domain.js +27 -0
  99. package/Types/Email/EmailTemplateType.d.mts +2 -0
  100. package/Types/Email/EmailTemplateType.d.ts +2 -0
  101. package/Types/Email/EmailTemplateType.js +2 -0
  102. package/Types/Email.d.mts +1 -0
  103. package/Types/Email.d.ts +1 -0
  104. package/Types/Email.js +16 -0
  105. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
  106. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
  107. package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
  108. package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
  109. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  110. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  111. package/Types/Monitor/CriteriaFilter.js +9 -0
  112. package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
  113. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
  114. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
  115. package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
  116. package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
  117. package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
  118. package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
  119. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
  120. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
  121. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
  122. package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
  123. package/Types/Monitor/MonitorType.js +12 -2
  124. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
  125. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
  126. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
  127. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
  128. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
  129. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
  130. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
  131. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
  132. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
  133. package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
  134. package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
  135. package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
  136. package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
  137. package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
  138. package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
  139. package/Types/Monitor/UptimeHistoryLabels.js +5 -0
  140. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
  141. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
  142. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  143. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  144. package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
  145. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
  146. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
  147. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
  148. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
  149. package/Types/ReadingDirection.d.mts +10 -0
  150. package/Types/ReadingDirection.d.ts +10 -0
  151. package/Types/ReadingDirection.js +171 -0
  152. package/Types/ReadingDirection.mjs +10 -0
  153. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
  154. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
  155. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
  156. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
  157. package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
  158. package/Types/Runbook/HttpStepVariables.d.mts +8 -0
  159. package/Types/Runbook/HttpStepVariables.d.ts +8 -0
  160. package/Types/Runbook/HttpStepVariables.js +109 -0
  161. package/Types/Runbook/HttpStepVariables.mjs +5 -0
  162. package/Types/Runbook/RunbookStep.d.mts +1 -0
  163. package/Types/Runbook/RunbookStep.d.ts +1 -0
  164. package/Types/Runbook/RunnerFeatures.d.mts +1 -0
  165. package/Types/Runbook/RunnerFeatures.d.ts +1 -0
  166. package/Types/Runbook/RunnerFeatures.js +15 -3
  167. package/Types/Runbook/RunnerFeatures.mjs +1 -0
  168. package/Types/Runbook/SshHostKey.d.mts +22 -0
  169. package/Types/Runbook/SshHostKey.d.ts +22 -0
  170. package/Types/Runbook/SshHostKey.js +201 -0
  171. package/Types/Runbook/SshHostKey.mjs +10 -0
  172. package/Types/Runner/CodeRepositoryRunner.js +2 -3
  173. package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
  174. package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
  175. package/Types/Runner/GlobalAIAgentsGone.js +19 -0
  176. package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
  177. package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
  178. package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
  179. package/Types/Runner/GlobalRunnerWork.js +21 -1
  180. package/Types/Runner/GlobalRunnerWork.mjs +1 -0
  181. package/Types/SSO/SignInMethods.d.mts +31 -0
  182. package/Types/SSO/SignInMethods.d.ts +31 -0
  183. package/Types/SSO/SignInMethods.js +160 -0
  184. package/Types/SSO/SignInMethods.mjs +8 -0
  185. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
  186. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
  187. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
  188. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
  189. package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
  190. package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
  191. package/Types/StatusPage/StatusPageLanguage.js +17 -1
  192. package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
  193. package/Types/Workflow/Templates.js +2 -5
  194. package/Types/Workflow/WorkflowPlan.d.mts +7 -0
  195. package/Types/Workflow/WorkflowPlan.d.ts +7 -0
  196. package/Types/Workflow/WorkflowPlan.js +39 -0
  197. package/Types/Workflow/WorkflowPlan.mjs +3 -0
  198. package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
  199. package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
  200. package/Utils/ColorContrast.d.mts +3 -0
  201. package/Utils/ColorContrast.d.ts +3 -0
  202. package/Utils/ColorContrast.js +41 -3
  203. package/Utils/ColorContrast.mjs +2 -0
  204. package/Utils/Dashboard/TableThresholds.d.mts +44 -0
  205. package/Utils/Dashboard/TableThresholds.d.ts +44 -0
  206. package/Utils/Dashboard/TableThresholds.js +288 -0
  207. package/Utils/Dashboard/TableThresholds.mjs +17 -0
  208. package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
  209. package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
  210. package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
  211. package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
  212. package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
  213. package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
  214. package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
  215. package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
  216. package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
  217. package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
  218. package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
  219. package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
  220. package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
  221. package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
  222. package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
  223. package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
  224. package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
  225. package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
  226. package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
  227. package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
  228. package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
  229. package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
  230. package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
  231. package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
  232. package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
  233. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
  234. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
  235. package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
  236. package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
  237. package/Utils/Rules/RuleRunSummary.d.mts +1 -0
  238. package/Utils/Rules/RuleRunSummary.d.ts +1 -0
  239. package/Utils/Rules/RuleRunSummary.js +19 -1
  240. package/Utils/Rules/RuleRunSummary.mjs +1 -0
  241. package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
  242. package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
  243. package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
  244. package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
  245. package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
  246. package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
  247. package/Utils/ScheduledMaintenanceStart.js +15 -0
  248. package/Utils/Sms/Gsm7Text.js +9 -1
  249. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  250. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  251. package/Utils/Sms/OnCallPageSms.js +19 -2
  252. package/Utils/Sms/OnCallPageSms.mjs +1 -0
  253. package/Utils/Sms/SubscriberSms.d.mts +2 -0
  254. package/Utils/Sms/SubscriberSms.d.ts +2 -0
  255. package/Utils/Sms/SubscriberSms.js +35 -0
  256. package/Utils/Sms/SubscriberSms.mjs +3 -0
  257. package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
  258. package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
  259. package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
  260. package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
  261. package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
  262. package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
  263. package/Utils/Telemetry/ChangeEventFields.js +52 -1
  264. package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
  265. package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
  266. package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
  267. package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
  268. package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
  269. package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
  270. package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
  271. package/package.json +1 -1
@@ -0,0 +1,160 @@
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.PROJECT_SSO_PROVIDER_TYPES = exports.GLOBAL_SSO_PROVIDER_TYPES = exports.MASTER_ADMIN_SIGN_IN_PATH = exports.MASTER_ADMIN_SIGN_IN_ROUTE = exports.SSO_REQUIRED_SIGN_UP_MESSAGE = exports.SSO_REQUIRED_SIGN_IN_MESSAGE = void 0;
7
+ const ObjectID_1 = __importDefault(require("../ObjectID"));
8
+ const SsoProviderDefaults_1 = require("./SsoProviderDefaults");
9
+ const SsoProviderType_1 = __importDefault(require("./SsoProviderType"));
10
+ /*
11
+ * What a sign-in that is not SSO is told while the server requires SSO: a
12
+ * password (and the second steps that finish one), a passkey, Sign in with
13
+ * Microsoft. Only someone who has already proved the account - a correct
14
+ * password, a passkey - is told; a wrong password is answered as always.
15
+ */
16
+ exports.SSO_REQUIRED_SIGN_IN_MESSAGE = "This server requires single sign-on (SSO). Sign in with SSO instead.";
17
+ // What a sign-up is told while the server requires SSO.
18
+ exports.SSO_REQUIRED_SIGN_UP_MESSAGE = "This server requires single sign-on (SSO), so accounts are not created with a password. Sign in with SSO instead.";
19
+ /*
20
+ * Where master admins sign in with their password while SSO is required: a
21
+ * page of the Accounts app (/accounts), which the sign-in page does not link
22
+ * to. The Admin Dashboard sends a signed-out visitor there, and its Require
23
+ * SSO card names the address.
24
+ */
25
+ exports.MASTER_ADMIN_SIGN_IN_ROUTE = "/admin-login";
26
+ exports.MASTER_ADMIN_SIGN_IN_PATH = `/accounts${exports.MASTER_ADMIN_SIGN_IN_ROUTE}`;
27
+ exports.GLOBAL_SSO_PROVIDER_TYPES = [
28
+ SsoProviderType_1.default.GlobalSSO,
29
+ SsoProviderType_1.default.GlobalOIDC,
30
+ ];
31
+ exports.PROJECT_SSO_PROVIDER_TYPES = [
32
+ SsoProviderType_1.default.ProjectSSO,
33
+ SsoProviderType_1.default.ProjectOIDC,
34
+ ];
35
+ const ALL_SSO_PROVIDER_TYPES = [
36
+ ...exports.GLOBAL_SSO_PROVIDER_TYPES,
37
+ ...exports.PROJECT_SSO_PROVIDER_TYPES,
38
+ ];
39
+ /*
40
+ * The longest name or description a sign-in page draws from an answer. The
41
+ * columns hold far less; this only keeps a forged or broken answer from
42
+ * drawing a wall of text.
43
+ */
44
+ const MAX_PROVIDER_TEXT_LENGTH = 500;
45
+ const readText = (value) => {
46
+ if (typeof value !== "string") {
47
+ return "";
48
+ }
49
+ return value.trim().slice(0, MAX_PROVIDER_TEXT_LENGTH);
50
+ };
51
+ class SignInMethodsUtil {
52
+ /*
53
+ * The providers in an answer, of the kinds asked for: each with a real id,
54
+ * a known kind and a name. Anything else in the list - a row with no name,
55
+ * an id that is not one, a kind this page does not start - is left out,
56
+ * never drawn as a button that cannot work.
57
+ */
58
+ static parseProviders(value, allowedTypes = ALL_SSO_PROVIDER_TYPES) {
59
+ if (!Array.isArray(value)) {
60
+ return [];
61
+ }
62
+ const providers = [];
63
+ const seen = new Set();
64
+ for (const item of value) {
65
+ if (!item || typeof item !== "object" || Array.isArray(item)) {
66
+ continue;
67
+ }
68
+ const row = item;
69
+ const type = row["type"];
70
+ const id = readText(row["id"]);
71
+ const name = readText(row["name"]);
72
+ if (typeof type !== "string" ||
73
+ !allowedTypes.includes(type) ||
74
+ !ObjectID_1.default.isValidUUID(id) ||
75
+ !name) {
76
+ continue;
77
+ }
78
+ const key = `${type}:${id.toLowerCase()}`;
79
+ if (seen.has(key)) {
80
+ continue;
81
+ }
82
+ seen.add(key);
83
+ providers.push({
84
+ type: type,
85
+ id: id,
86
+ name: name,
87
+ description: readText(row["description"]),
88
+ });
89
+ }
90
+ return providers;
91
+ }
92
+ /*
93
+ * The answer of GET /identity/sign-in-methods, or null when it is not one
94
+ * (a failed read, a proxy's page): the page then shows what it shows when
95
+ * nothing is known, and the server still refuses what it must.
96
+ */
97
+ static parse(value) {
98
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
99
+ return null;
100
+ }
101
+ const answer = value;
102
+ if (typeof answer["isSsoRequired"] !== "boolean") {
103
+ return null;
104
+ }
105
+ const isSsoRequired = answer["isSsoRequired"];
106
+ return {
107
+ isSsoRequired: isSsoRequired,
108
+ ssoProviders: SignInMethodsUtil.parseProviders(answer["ssoProviders"], exports.GLOBAL_SSO_PROVIDER_TYPES),
109
+ hasProjectSsoProviders: isSsoRequired && answer["hasProjectSsoProviders"] === true,
110
+ };
111
+ }
112
+ // The answer of GET /identity/project-sign-in-methods/:projectId.
113
+ static parseProjectMethods(value) {
114
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
115
+ return { ssoProviders: [] };
116
+ }
117
+ return {
118
+ ssoProviders: SignInMethodsUtil.parseProviders(value["ssoProviders"]),
119
+ };
120
+ }
121
+ /*
122
+ * Where a provider's sign-in starts, under the identity server's address
123
+ * (IDENTITY_URL): the instance-wide ones by their id, a project's by the
124
+ * project's and theirs. Null for a project's provider without a project.
125
+ */
126
+ static getSignInRoute(data) {
127
+ const providerId = encodeURIComponent(data.provider.id);
128
+ switch (data.provider.type) {
129
+ case SsoProviderType_1.default.GlobalSSO:
130
+ return `/global-sso/${providerId}`;
131
+ case SsoProviderType_1.default.GlobalOIDC:
132
+ return `/global-oidc/${providerId}`;
133
+ case SsoProviderType_1.default.ProjectSSO:
134
+ case SsoProviderType_1.default.ProjectOIDC: {
135
+ if (!data.projectId || !ObjectID_1.default.isValidUUID(data.projectId)) {
136
+ return null;
137
+ }
138
+ const projectId = encodeURIComponent(data.projectId);
139
+ return data.provider.type === SsoProviderType_1.default.ProjectSSO
140
+ ? `/sso/${projectId}/${providerId}`
141
+ : `/oidc/${projectId}/${providerId}`;
142
+ }
143
+ default:
144
+ return null;
145
+ }
146
+ }
147
+ /*
148
+ * Whether a provider's description is only "Sign in with <name>", the one
149
+ * it gets when nobody writes one (SsoProviderDefaults), or none: the page
150
+ * then says "Sign in with <name>" in the visitor's language instead of
151
+ * drawing the English one under the name.
152
+ */
153
+ static hasOwnDescription(provider) {
154
+ return !(0, SsoProviderDefaults_1.isDefaultSsoProviderDescription)({
155
+ description: provider.description,
156
+ name: provider.name,
157
+ });
158
+ }
159
+ }
160
+ exports.default = SignInMethodsUtil;
@@ -0,0 +1,8 @@
1
+ import commonJsModule from "./SignInMethods.js";
2
+ export default commonJsModule.default;
3
+ export const GLOBAL_SSO_PROVIDER_TYPES = commonJsModule.GLOBAL_SSO_PROVIDER_TYPES;
4
+ export const MASTER_ADMIN_SIGN_IN_PATH = commonJsModule.MASTER_ADMIN_SIGN_IN_PATH;
5
+ export const MASTER_ADMIN_SIGN_IN_ROUTE = commonJsModule.MASTER_ADMIN_SIGN_IN_ROUTE;
6
+ export const PROJECT_SSO_PROVIDER_TYPES = commonJsModule.PROJECT_SSO_PROVIDER_TYPES;
7
+ export const SSO_REQUIRED_SIGN_IN_MESSAGE = commonJsModule.SSO_REQUIRED_SIGN_IN_MESSAGE;
8
+ export const SSO_REQUIRED_SIGN_UP_MESSAGE = commonJsModule.SSO_REQUIRED_SIGN_UP_MESSAGE;
@@ -0,0 +1,24 @@
1
+ export declare const PUBLISH_ON_STATUS_PAGE_AT_COLUMN: string;
2
+ export declare const VISIBLE_ON_STATUS_PAGE_COLUMN: string;
3
+ export interface ScheduledMaintenancePublicationColumns {
4
+ isVisibleOnStatusPage?: unknown;
5
+ publishOnStatusPageAt?: unknown;
6
+ }
7
+ export declare const NOT_PUBLISHED_YET_SKIPPED_MESSAGE: string;
8
+ export declare const REMINDER_NOT_SENT_HIDDEN_MESSAGE: string;
9
+ export declare const REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE: string;
10
+ export declare enum ScheduledMaintenancePublicationState {
11
+ Hidden = "Hidden",
12
+ Scheduled = "Scheduled",
13
+ Published = "Published"
14
+ }
15
+ export default class ScheduledMaintenancePublication {
16
+ static readonly columns: ReadonlyArray<string>;
17
+ static hasPublishTime(record: ScheduledMaintenancePublicationColumns | undefined | null): boolean;
18
+ static getPublishAt(record: ScheduledMaintenancePublicationColumns | undefined | null): Date | null;
19
+ static isPublished(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
20
+ static isVisibilitySwitchedOn(record: ScheduledMaintenancePublicationColumns | undefined | null): boolean;
21
+ static isShown(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
22
+ static getState(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): ScheduledMaintenancePublicationState;
23
+ static isWaitingToPublish(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
24
+ }
@@ -0,0 +1,24 @@
1
+ export declare const PUBLISH_ON_STATUS_PAGE_AT_COLUMN: string;
2
+ export declare const VISIBLE_ON_STATUS_PAGE_COLUMN: string;
3
+ export interface ScheduledMaintenancePublicationColumns {
4
+ isVisibleOnStatusPage?: unknown;
5
+ publishOnStatusPageAt?: unknown;
6
+ }
7
+ export declare const NOT_PUBLISHED_YET_SKIPPED_MESSAGE: string;
8
+ export declare const REMINDER_NOT_SENT_HIDDEN_MESSAGE: string;
9
+ export declare const REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE: string;
10
+ export declare enum ScheduledMaintenancePublicationState {
11
+ Hidden = "Hidden",
12
+ Scheduled = "Scheduled",
13
+ Published = "Published"
14
+ }
15
+ export default class ScheduledMaintenancePublication {
16
+ static readonly columns: ReadonlyArray<string>;
17
+ static hasPublishTime(record: ScheduledMaintenancePublicationColumns | undefined | null): boolean;
18
+ static getPublishAt(record: ScheduledMaintenancePublicationColumns | undefined | null): Date | null;
19
+ static isPublished(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
20
+ static isVisibilitySwitchedOn(record: ScheduledMaintenancePublicationColumns | undefined | null): boolean;
21
+ static isShown(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
22
+ static getState(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): ScheduledMaintenancePublicationState;
23
+ static isWaitingToPublish(record: ScheduledMaintenancePublicationColumns | undefined | null, now?: Date | undefined): boolean;
24
+ }
@@ -0,0 +1,159 @@
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.ScheduledMaintenancePublicationState = exports.REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE = exports.REMINDER_NOT_SENT_HIDDEN_MESSAGE = exports.NOT_PUBLISHED_YET_SKIPPED_MESSAGE = exports.VISIBLE_ON_STATUS_PAGE_COLUMN = exports.PUBLISH_ON_STATUS_PAGE_AT_COLUMN = void 0;
7
+ const BooleanColumnValue_1 = require("../Database/BooleanColumnValue");
8
+ const Date_1 = __importDefault(require("../Date"));
9
+ const MaintenanceWindow_1 = require("./MaintenanceWindow");
10
+ /*
11
+ * WHEN A SCHEDULED MAINTENANCE EVENT IS PUBLIC.
12
+ *
13
+ * A status page shows an event - and its subscribers hear about it - only
14
+ * while both of these hold:
15
+ *
16
+ * - Visible on Status Page is on (isVisibleOnStatusPage), and
17
+ * - the event is published: it has no Publish on Status Page At
18
+ * (publishOnStatusPageAt) - it is public from the moment it is created,
19
+ * as every event created before the column was - or that time has come.
20
+ *
21
+ * Planned work is often known months before customers should hear of it
22
+ * (GitHub issue #5249): an event made on 1 October for 1 December can be
23
+ * kept to the team until 24 November, and on 24 November it shows on its
24
+ * status pages as coming up, and their subscribers are told it is
25
+ * scheduled - nobody has to remember to turn it on.
26
+ *
27
+ * ONE RULE, read by everything that puts an event in front of the public:
28
+ *
29
+ * - in SQL, every status page read of scheduled maintenance
30
+ * (StatusPageVisibilityQuery.shownScheduledMaintenance): the overview,
31
+ * the Scheduled Maintenance page and an event by its id, the uptime
32
+ * history, the attachments of its notes - and through them the page's
33
+ * RSS and Atom feeds, its maintenance calendar (.ics), its JSON API and
34
+ * the public MCP tools;
35
+ * - in code, every subscriber notification job about an event: the
36
+ * 'scheduled' notification, the reminders before the event, state
37
+ * changes and public notes (isShown, getState).
38
+ *
39
+ * PUBLISHED WHEN READ, NEVER WRITTEN. No job turns an event on at its time:
40
+ * whether it is published is worked out from the time each time it is read.
41
+ * So a publish time moved, cleared (published at once) or set again takes
42
+ * effect the moment it is saved, the event shows exactly at its time, and
43
+ * nothing can leave an event half published. The one thing that happens AT
44
+ * the time is the 'scheduled' notification, which the job that sends it
45
+ * every minute holds back until the event is published - so it is sent
46
+ * once, at publication, rather than when the event was created.
47
+ *
48
+ * Kept free of anything server-side: the dashboard says with it whether an
49
+ * event is public yet, and when it will be.
50
+ */
51
+ exports.PUBLISH_ON_STATUS_PAGE_AT_COLUMN = "publishOnStatusPageAt";
52
+ exports.VISIBLE_ON_STATUS_PAGE_COLUMN = "isVisibleOnStatusPage";
53
+ /*
54
+ * Why a notification about an event that is not published yet is not sent:
55
+ * a state change or a public note of an event kept to the team until its
56
+ * publish time. Subscribers hear of the event when it is published, and see
57
+ * its notes and its state on the page from then on.
58
+ */
59
+ exports.NOT_PUBLISHED_YET_SKIPPED_MESSAGE = "Notifications skipped as scheduled maintenance is not published on status pages yet.";
60
+ /*
61
+ * Why a reminder before the event is not sent: the event is hidden from its
62
+ * status pages, or not published on them yet. The feed says so instead of
63
+ * that the reminder went out.
64
+ */
65
+ exports.REMINDER_NOT_SENT_HIDDEN_MESSAGE = "This scheduled maintenance is hidden from its status pages, so their subscribers were not reminded.";
66
+ exports.REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE = "This scheduled maintenance is not published on its status pages yet, so their subscribers were not reminded.";
67
+ // Where an event stands with its status pages.
68
+ var ScheduledMaintenancePublicationState;
69
+ (function (ScheduledMaintenancePublicationState) {
70
+ // Visible on Status Page is off: shown nowhere public, whatever the time.
71
+ ScheduledMaintenancePublicationState["Hidden"] = "Hidden";
72
+ // On, with a publish time still to come: shown nowhere public until then.
73
+ ScheduledMaintenancePublicationState["Scheduled"] = "Scheduled";
74
+ // On, and published: shown on its status pages.
75
+ ScheduledMaintenancePublicationState["Published"] = "Published";
76
+ })(ScheduledMaintenancePublicationState || (exports.ScheduledMaintenancePublicationState = ScheduledMaintenancePublicationState = {}));
77
+ class ScheduledMaintenancePublication {
78
+ /*
79
+ * Whether an event has a publish time at all. None - never set (null),
80
+ * or cleared ("" from a cleared date input) - is published from the
81
+ * start.
82
+ */
83
+ static hasPublishTime(record) {
84
+ if (!record) {
85
+ return false;
86
+ }
87
+ const value = record.publishOnStatusPageAt;
88
+ return value !== undefined && value !== null && value !== "";
89
+ }
90
+ /*
91
+ * The event's publish time, or null when it has none. A value that is
92
+ * there but is not a time is no time it can be published at: see
93
+ * isPublished.
94
+ */
95
+ static getPublishAt(record) {
96
+ if (!this.hasPublishTime(record)) {
97
+ return null;
98
+ }
99
+ return (0, MaintenanceWindow_1.toMaintenanceDate)(record.publishOnStatusPageAt);
100
+ }
101
+ /*
102
+ * Whether the event is published by `now` (the current time when not
103
+ * given): it has no publish time, or that time is not after now. A value
104
+ * that is there but is not a time keeps it unpublished - an odd value
105
+ * hides the event rather than showing it early.
106
+ */
107
+ static isPublished(record, now) {
108
+ if (!this.hasPublishTime(record)) {
109
+ return true;
110
+ }
111
+ const publishAt = this.getPublishAt(record);
112
+ if (!publishAt) {
113
+ return false;
114
+ }
115
+ return (publishAt.getTime() <= (now || Date_1.default.getCurrentDate()).getTime());
116
+ }
117
+ /*
118
+ * Whether its Visible on Status Page switch is on. A switch never set
119
+ * (null), or not read, is off, as the database queries read it.
120
+ */
121
+ static isVisibilitySwitchedOn(record) {
122
+ if (!record) {
123
+ return false;
124
+ }
125
+ return (0, BooleanColumnValue_1.toStoredBoolean)(record.isVisibleOnStatusPage) === true;
126
+ }
127
+ // The rule: Visible on Status Page on, and published by `now`.
128
+ static isShown(record, now) {
129
+ return this.isVisibilitySwitchedOn(record) && this.isPublished(record, now);
130
+ }
131
+ /*
132
+ * Where the event stands by `now`: hidden (its switch is off, whatever
133
+ * its time), waiting for its publish time, or published.
134
+ */
135
+ static getState(record, now) {
136
+ if (!this.isVisibilitySwitchedOn(record)) {
137
+ return ScheduledMaintenancePublicationState.Hidden;
138
+ }
139
+ if (!this.isPublished(record, now)) {
140
+ return ScheduledMaintenancePublicationState.Scheduled;
141
+ }
142
+ return ScheduledMaintenancePublicationState.Published;
143
+ }
144
+ /*
145
+ * Whether the event is waiting to be published: its switch is on and its
146
+ * publish time is still to come. What the dashboard says "Not on status
147
+ * pages yet" for.
148
+ */
149
+ static isWaitingToPublish(record, now) {
150
+ return (this.getState(record, now) ===
151
+ ScheduledMaintenancePublicationState.Scheduled);
152
+ }
153
+ }
154
+ // The columns a reader must read to apply the rule: both, always.
155
+ ScheduledMaintenancePublication.columns = [
156
+ exports.VISIBLE_ON_STATUS_PAGE_COLUMN,
157
+ exports.PUBLISH_ON_STATUS_PAGE_AT_COLUMN,
158
+ ];
159
+ exports.default = ScheduledMaintenancePublication;
@@ -0,0 +1,8 @@
1
+ import commonJsModule from "./ScheduledMaintenancePublication.js";
2
+ export default commonJsModule.default;
3
+ export const NOT_PUBLISHED_YET_SKIPPED_MESSAGE = commonJsModule.NOT_PUBLISHED_YET_SKIPPED_MESSAGE;
4
+ export const PUBLISH_ON_STATUS_PAGE_AT_COLUMN = commonJsModule.PUBLISH_ON_STATUS_PAGE_AT_COLUMN;
5
+ export const REMINDER_NOT_SENT_HIDDEN_MESSAGE = commonJsModule.REMINDER_NOT_SENT_HIDDEN_MESSAGE;
6
+ export const REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE = commonJsModule.REMINDER_NOT_SENT_NOT_PUBLISHED_YET_MESSAGE;
7
+ export const ScheduledMaintenancePublicationState = commonJsModule.ScheduledMaintenancePublicationState;
8
+ export const VISIBLE_ON_STATUS_PAGE_COLUMN = commonJsModule.VISIBLE_ON_STATUS_PAGE_COLUMN;
@@ -1,3 +1,4 @@
1
+ import { ReadingDirection } from "../ReadingDirection.mjs";
1
2
  export interface StatusPageLanguage {
2
3
  code: string;
3
4
  nativeName: string;
@@ -6,3 +7,8 @@ export interface StatusPageLanguage {
6
7
  export declare const DEFAULT_STATUS_PAGE_LANGUAGE: string;
7
8
  export declare const SUPPORTED_STATUS_PAGE_LANGUAGES: Array<StatusPageLanguage>;
8
9
  export declare const SUPPORTED_STATUS_PAGE_LANGUAGE_CODES: Array<string>;
10
+ export interface StatusPageLanguageHead {
11
+ lang: string;
12
+ dir: ReadingDirection;
13
+ }
14
+ export declare const getStatusPageLanguageHead: (defaultLanguage: string | null | undefined) => StatusPageLanguageHead;
@@ -1,3 +1,4 @@
1
+ import { ReadingDirection } from "../ReadingDirection";
1
2
  export interface StatusPageLanguage {
2
3
  code: string;
3
4
  nativeName: string;
@@ -6,3 +7,8 @@ export interface StatusPageLanguage {
6
7
  export declare const DEFAULT_STATUS_PAGE_LANGUAGE: string;
7
8
  export declare const SUPPORTED_STATUS_PAGE_LANGUAGES: Array<StatusPageLanguage>;
8
9
  export declare const SUPPORTED_STATUS_PAGE_LANGUAGE_CODES: Array<string>;
10
+ export interface StatusPageLanguageHead {
11
+ lang: string;
12
+ dir: ReadingDirection;
13
+ }
14
+ export declare const getStatusPageLanguageHead: (defaultLanguage: string | null | undefined) => StatusPageLanguageHead;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SUPPORTED_STATUS_PAGE_LANGUAGE_CODES = exports.SUPPORTED_STATUS_PAGE_LANGUAGES = exports.DEFAULT_STATUS_PAGE_LANGUAGE = void 0;
3
+ exports.getStatusPageLanguageHead = exports.SUPPORTED_STATUS_PAGE_LANGUAGE_CODES = exports.SUPPORTED_STATUS_PAGE_LANGUAGES = exports.DEFAULT_STATUS_PAGE_LANGUAGE = void 0;
4
+ const ReadingDirection_1 = require("../ReadingDirection");
4
5
  exports.DEFAULT_STATUS_PAGE_LANGUAGE = "en";
5
6
  exports.SUPPORTED_STATUS_PAGE_LANGUAGES = [
6
7
  { code: "en", nativeName: "English", englishName: "English" },
@@ -32,3 +33,18 @@ exports.SUPPORTED_STATUS_PAGE_LANGUAGES = [
32
33
  exports.SUPPORTED_STATUS_PAGE_LANGUAGE_CODES = exports.SUPPORTED_STATUS_PAGE_LANGUAGES.map((language) => {
33
34
  return language.code;
34
35
  });
36
+ /*
37
+ * The language a status page's HTML is served in, before its app runs: the
38
+ * page's default language when it is one a status page can show, English
39
+ * otherwise - with the way it is read, so a page whose visitors read
40
+ * Persian is laid out right to left from its first paint. A visitor's own
41
+ * choice takes over once the app runs (Common/UI/Utils/PageLanguage).
42
+ */
43
+ const getStatusPageLanguageHead = (defaultLanguage) => {
44
+ const lang = defaultLanguage &&
45
+ exports.SUPPORTED_STATUS_PAGE_LANGUAGE_CODES.includes(defaultLanguage)
46
+ ? defaultLanguage
47
+ : exports.DEFAULT_STATUS_PAGE_LANGUAGE;
48
+ return { lang: lang, dir: (0, ReadingDirection_1.getReadingDirection)(lang) };
49
+ };
50
+ exports.getStatusPageLanguageHead = getStatusPageLanguageHead;
@@ -2,3 +2,4 @@ import commonJsModule from "./StatusPageLanguage.js";
2
2
  export const DEFAULT_STATUS_PAGE_LANGUAGE = commonJsModule.DEFAULT_STATUS_PAGE_LANGUAGE;
3
3
  export const SUPPORTED_STATUS_PAGE_LANGUAGES = commonJsModule.SUPPORTED_STATUS_PAGE_LANGUAGES;
4
4
  export const SUPPORTED_STATUS_PAGE_LANGUAGE_CODES = commonJsModule.SUPPORTED_STATUS_PAGE_LANGUAGE_CODES;
5
+ export const getStatusPageLanguageHead = commonJsModule.getStatusPageLanguageHead;
@@ -467,18 +467,15 @@ const ALERT_KIND = {
467
467
  creating: "Creating",
468
468
  quietCreateFields: {},
469
469
  quietCreateText: "",
470
- /*
471
- * An alert's root cause is written when the alert is created and cannot be
472
- * edited afterwards, so it is not listened on. The comment still shows it.
473
- */
474
470
  editListenOn: {
475
471
  title: true,
476
472
  description: true,
477
473
  alertSeverityId: true,
478
474
  alertSeverity: true,
475
+ rootCause: true,
479
476
  remediationNotes: true,
480
477
  },
481
- editedFieldsText: "title, severity, description or remediation notes",
478
+ editedFieldsText: "title, severity, description, root cause or remediation notes",
482
479
  hasPublicNotes: false,
483
480
  otherPlural: "incidents",
484
481
  };
@@ -1,3 +1,4 @@
1
+ import { PlanType } from "../Billing/SubscriptionPlan.mjs";
1
2
  declare enum WorkflowPlan {
2
3
  "Free" = 0,
3
4
  "Enterprise" = 9999999,
@@ -5,3 +6,9 @@ declare enum WorkflowPlan {
5
6
  "Scale" = 2000
6
7
  }
7
8
  export default WorkflowPlan;
9
+ export declare const LOWEST_PLAN_THAT_RUNS_WORKFLOWS: PlanType;
10
+ export declare function doesPlanRunWorkflows(plan: PlanType | string | null | undefined): boolean;
11
+ export declare function getWorkflowPlanRefusalMessage(data: {
12
+ plan: PlanType | string;
13
+ runsInLast30Days: number;
14
+ }): string;
@@ -1,3 +1,4 @@
1
+ import { PlanType } from "../Billing/SubscriptionPlan";
1
2
  declare enum WorkflowPlan {
2
3
  "Free" = 0,
3
4
  "Enterprise" = 9999999,
@@ -5,3 +6,9 @@ declare enum WorkflowPlan {
5
6
  "Scale" = 2000
6
7
  }
7
8
  export default WorkflowPlan;
9
+ export declare const LOWEST_PLAN_THAT_RUNS_WORKFLOWS: PlanType;
10
+ export declare function doesPlanRunWorkflows(plan: PlanType | string | null | undefined): boolean;
11
+ export declare function getWorkflowPlanRefusalMessage(data: {
12
+ plan: PlanType | string;
13
+ runsInLast30Days: number;
14
+ }): string;
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOWEST_PLAN_THAT_RUNS_WORKFLOWS = void 0;
4
+ exports.doesPlanRunWorkflows = doesPlanRunWorkflows;
5
+ exports.getWorkflowPlanRefusalMessage = getWorkflowPlanRefusalMessage;
6
+ const SubscriptionPlan_1 = require("../Billing/SubscriptionPlan");
7
+ // How many workflow runs a project of each plan may have in 30 days.
3
8
  var WorkflowPlan;
4
9
  (function (WorkflowPlan) {
5
10
  WorkflowPlan[WorkflowPlan["Free"] = 0] = "Free";
@@ -8,3 +13,37 @@ var WorkflowPlan;
8
13
  WorkflowPlan[WorkflowPlan["Scale"] = 2000] = "Scale";
9
14
  })(WorkflowPlan || (WorkflowPlan = {}));
10
15
  exports.default = WorkflowPlan;
16
+ /*
17
+ * The lowest plan whose projects run workflows: what a project on a plan
18
+ * that runs none is told to upgrade to.
19
+ */
20
+ exports.LOWEST_PLAN_THAT_RUNS_WORKFLOWS = SubscriptionPlan_1.PlanType.Growth;
21
+ /*
22
+ * Whether a project on this plan runs any workflow at all. A plan of 0 runs
23
+ * (Free) refuses every run, however it is started, so a workflow built there
24
+ * never does anything until the plan changes. An unknown plan - billing off,
25
+ * as on every self-hosted install, or a plan the server does not describe -
26
+ * runs them: the server has the last word.
27
+ */
28
+ function doesPlanRunWorkflows(plan) {
29
+ if (!plan) {
30
+ return true;
31
+ }
32
+ const runs = WorkflowPlan[plan];
33
+ if (typeof runs !== "number") {
34
+ return true;
35
+ }
36
+ return runs > 0;
37
+ }
38
+ /*
39
+ * What a run refused for its plan's runs says, in the run's log: a plan
40
+ * that runs none says so, and which plan does; a plan whose runs are used
41
+ * up says how many it allows.
42
+ */
43
+ function getWorkflowPlanRefusalMessage(data) {
44
+ if (!doesPlanRunWorkflows(data.plan)) {
45
+ return `Workflows do not run on the ${data.plan} plan. Upgrade to the ${exports.LOWEST_PLAN_THAT_RUNS_WORKFLOWS} plan or above to run them.`;
46
+ }
47
+ const runs = WorkflowPlan[data.plan];
48
+ return `Workflow cannot run because it already ran ${data.runsInLast30Days} in the last 30 days. Your current plan limit is ${runs}`;
49
+ }
@@ -1,2 +1,5 @@
1
1
  import commonJsModule from "./WorkflowPlan.js";
2
2
  export default commonJsModule.default;
3
+ export const LOWEST_PLAN_THAT_RUNS_WORKFLOWS = commonJsModule.LOWEST_PLAN_THAT_RUNS_WORKFLOWS;
4
+ export const doesPlanRunWorkflows = commonJsModule.doesPlanRunWorkflows;
5
+ export const getWorkflowPlanRefusalMessage = commonJsModule.getWorkflowPlanRefusalMessage;
@@ -110,6 +110,17 @@ export interface WorkspaceModalBlock extends WorkspaceMessageBlock {
110
110
  export interface WorkspacePayloadMarkdown extends WorkspaceMessageBlock {
111
111
  _type: "WorkspacePayloadMarkdown";
112
112
  text: string;
113
+ menu?: WorkspacePayloadMenu | undefined;
114
+ }
115
+ export interface WorkspacePayloadMenu {
116
+ actionId: string;
117
+ placeholder: string;
118
+ options: Array<WorkspacePayloadMenuOption>;
119
+ blockId?: string | undefined;
120
+ }
121
+ export interface WorkspacePayloadMenuOption {
122
+ label: string;
123
+ value: string;
113
124
  }
114
125
  export interface WorkspacePayloadContext extends WorkspaceMessageBlock {
115
126
  _type: "WorkspacePayloadContext";
@@ -110,6 +110,17 @@ export interface WorkspaceModalBlock extends WorkspaceMessageBlock {
110
110
  export interface WorkspacePayloadMarkdown extends WorkspaceMessageBlock {
111
111
  _type: "WorkspacePayloadMarkdown";
112
112
  text: string;
113
+ menu?: WorkspacePayloadMenu | undefined;
114
+ }
115
+ export interface WorkspacePayloadMenu {
116
+ actionId: string;
117
+ placeholder: string;
118
+ options: Array<WorkspacePayloadMenuOption>;
119
+ blockId?: string | undefined;
120
+ }
121
+ export interface WorkspacePayloadMenuOption {
122
+ label: string;
123
+ value: string;
113
124
  }
114
125
  export interface WorkspacePayloadContext extends WorkspaceMessageBlock {
115
126
  _type: "WorkspacePayloadContext";
@@ -8,7 +8,10 @@ export declare function getReadableShade(data: {
8
8
  background: RGB;
9
9
  minimumContrast: number;
10
10
  maximumSaturation?: number | undefined;
11
+ towards?: "dark" | "light" | undefined;
11
12
  }): RGB;
13
+ export declare const FILLED_TEXT_MINIMUM_CONTRAST: number;
14
+ export declare function getReadableTextOnFill(fill: RGB): RGB;
12
15
  export declare function getAlphaForLuminance(data: {
13
16
  color: RGB;
14
17
  surface: RGB;
@@ -8,7 +8,10 @@ export declare function getReadableShade(data: {
8
8
  background: RGB;
9
9
  minimumContrast: number;
10
10
  maximumSaturation?: number | undefined;
11
+ towards?: "dark" | "light" | undefined;
11
12
  }): RGB;
13
+ export declare const FILLED_TEXT_MINIMUM_CONTRAST: number;
14
+ export declare function getReadableTextOnFill(fill: RGB): RGB;
12
15
  export declare function getAlphaForLuminance(data: {
13
16
  color: RGB;
14
17
  surface: RGB;