@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.
- package/Models/DatabaseModels/Alert.d.mts +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +62 -1
- package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
- package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
- package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
- package/Models/DatabaseModels/CloudAccount.js +546 -0
- package/Models/DatabaseModels/CloudAccount.mjs +2 -0
- package/Models/DatabaseModels/CloudResource.d.mts +8 -0
- package/Models/DatabaseModels/CloudResource.d.ts +8 -0
- package/Models/DatabaseModels/CloudResource.js +169 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
- package/Models/DatabaseModels/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +54 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
- package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/LlmProvider.js +1 -1
- package/Models/DatabaseModels/Monitor.d.mts +2 -0
- package/Models/DatabaseModels/Monitor.d.ts +2 -0
- package/Models/DatabaseModels/Monitor.js +54 -0
- package/Models/DatabaseModels/MonitorTemplate.js +10 -4
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
- package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
- package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
- package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
- package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
- package/Models/DatabaseModels/StatusPage.d.mts +2 -0
- package/Models/DatabaseModels/StatusPage.d.ts +2 -0
- package/Models/DatabaseModels/StatusPage.js +100 -0
- package/Types/AI/AiAffectedResources.d.mts +40 -0
- package/Types/AI/AiAffectedResources.d.ts +40 -0
- package/Types/AI/AiAffectedResources.js +292 -0
- package/Types/AI/AiAffectedResources.mjs +10 -0
- package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
- package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
- package/Types/Cloud/CloudAccountSummary.js +114 -0
- package/Types/Cloud/CloudAccountSummary.mjs +5 -0
- package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
- package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
- package/Types/Cloud/CloudEndpointMatch.js +134 -0
- package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
- package/Types/Cloud/CloudInventory.d.mts +34 -0
- package/Types/Cloud/CloudInventory.d.ts +34 -0
- package/Types/Cloud/CloudInventory.js +362 -0
- package/Types/Cloud/CloudInventory.mjs +22 -0
- package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
- package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
- package/Types/Cloud/CloudResourceCatalog.js +29 -1
- package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
- package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
- package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
- package/Types/Cloud/CloudResourceIndex.js +191 -0
- package/Types/Cloud/CloudResourceIndex.mjs +4 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
- package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
- package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
- package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
- package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.js +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
- package/Types/Database/BlankColumnValue.d.mts +6 -0
- package/Types/Database/BlankColumnValue.d.ts +6 -0
- package/Types/Database/BlankColumnValue.js +77 -0
- package/Types/Database/BlankColumnValue.mjs +4 -0
- package/Types/Date.d.mts +1 -0
- package/Types/Date.d.ts +1 -0
- package/Types/Date.js +32 -6
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +67 -12
- package/Types/DateLanguage.mjs +2 -0
- package/Types/Domain.d.mts +2 -0
- package/Types/Domain.d.ts +2 -0
- package/Types/Domain.js +27 -0
- package/Types/Email/EmailTemplateType.d.mts +2 -0
- package/Types/Email/EmailTemplateType.d.ts +2 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email.d.mts +1 -0
- package/Types/Email.d.ts +1 -0
- package/Types/Email.js +16 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
- package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
- package/Types/Monitor/CriteriaFilter.d.mts +1 -0
- package/Types/Monitor/CriteriaFilter.d.ts +1 -0
- package/Types/Monitor/CriteriaFilter.js +9 -0
- package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
- package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
- package/Types/Monitor/MonitorType.js +12 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
- package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.js +5 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
- package/Types/ReadingDirection.d.mts +10 -0
- package/Types/ReadingDirection.d.ts +10 -0
- package/Types/ReadingDirection.js +171 -0
- package/Types/ReadingDirection.mjs +10 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
- package/Types/Runbook/HttpStepVariables.d.mts +8 -0
- package/Types/Runbook/HttpStepVariables.d.ts +8 -0
- package/Types/Runbook/HttpStepVariables.js +109 -0
- package/Types/Runbook/HttpStepVariables.mjs +5 -0
- package/Types/Runbook/RunbookStep.d.mts +1 -0
- package/Types/Runbook/RunbookStep.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.d.mts +1 -0
- package/Types/Runbook/RunnerFeatures.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.js +15 -3
- package/Types/Runbook/RunnerFeatures.mjs +1 -0
- package/Types/Runbook/SshHostKey.d.mts +22 -0
- package/Types/Runbook/SshHostKey.d.ts +22 -0
- package/Types/Runbook/SshHostKey.js +201 -0
- package/Types/Runbook/SshHostKey.mjs +10 -0
- package/Types/Runner/CodeRepositoryRunner.js +2 -3
- package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.js +19 -0
- package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
- package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
- package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
- package/Types/Runner/GlobalRunnerWork.js +21 -1
- package/Types/Runner/GlobalRunnerWork.mjs +1 -0
- package/Types/SSO/SignInMethods.d.mts +31 -0
- package/Types/SSO/SignInMethods.d.ts +31 -0
- package/Types/SSO/SignInMethods.js +160 -0
- package/Types/SSO/SignInMethods.mjs +8 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
- package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
- package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
- package/Types/StatusPage/StatusPageLanguage.js +17 -1
- package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
- package/Types/Workflow/Templates.js +2 -5
- package/Types/Workflow/WorkflowPlan.d.mts +7 -0
- package/Types/Workflow/WorkflowPlan.d.ts +7 -0
- package/Types/Workflow/WorkflowPlan.js +39 -0
- package/Types/Workflow/WorkflowPlan.mjs +3 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
- package/Utils/ColorContrast.d.mts +3 -0
- package/Utils/ColorContrast.d.ts +3 -0
- package/Utils/ColorContrast.js +41 -3
- package/Utils/ColorContrast.mjs +2 -0
- package/Utils/Dashboard/TableThresholds.d.mts +44 -0
- package/Utils/Dashboard/TableThresholds.d.ts +44 -0
- package/Utils/Dashboard/TableThresholds.js +288 -0
- package/Utils/Dashboard/TableThresholds.mjs +17 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
- package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
- package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
- package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
- package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
- package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
- package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
- package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
- package/Utils/Rules/RuleRunSummary.d.mts +1 -0
- package/Utils/Rules/RuleRunSummary.d.ts +1 -0
- package/Utils/Rules/RuleRunSummary.js +19 -1
- package/Utils/Rules/RuleRunSummary.mjs +1 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
- package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
- package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
- package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
- package/Utils/ScheduledMaintenanceStart.js +15 -0
- package/Utils/Sms/Gsm7Text.js +9 -1
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +19 -2
- package/Utils/Sms/OnCallPageSms.mjs +1 -0
- package/Utils/Sms/SubscriberSms.d.mts +2 -0
- package/Utils/Sms/SubscriberSms.d.ts +2 -0
- package/Utils/Sms/SubscriberSms.js +35 -0
- package/Utils/Sms/SubscriberSms.mjs +3 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
- package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
- package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
- package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
- package/Utils/Telemetry/ChangeEventFields.js +52 -1
- package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
- package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
- 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;
|
package/Utils/ColorContrast.d.ts
CHANGED
|
@@ -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;
|