@oneuptime/common 14.0.93 → 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 +54 -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/Index.js +2 -0
- 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/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/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/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 +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +1 -0
- package/Types/Email.d.mts +1 -0
- package/Types/Email.d.ts +1 -0
- package/Types/Email.js +16 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -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/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/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/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/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/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/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/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/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,10 @@
|
|
|
1
|
+
import commonJsModule from "./SshHostKey.js";
|
|
2
|
+
export const MAX_SSH_HOST_KEYS = commonJsModule.MAX_SSH_HOST_KEYS;
|
|
3
|
+
export const MAX_SSH_HOST_KEY_TEXT_LENGTH = commonJsModule.MAX_SSH_HOST_KEY_TEXT_LENGTH;
|
|
4
|
+
export const SSH_FINGERPRINT_PREFIX = commonJsModule.SSH_FINGERPRINT_PREFIX;
|
|
5
|
+
export const SSH_HOST_KEY_TYPES = commonJsModule.SSH_HOST_KEY_TYPES;
|
|
6
|
+
export const decodeSshBase64 = commonJsModule.decodeSshBase64;
|
|
7
|
+
export const getSshHostKeyProblem = commonJsModule.getSshHostKeyProblem;
|
|
8
|
+
export const hasSshHostKeys = commonJsModule.hasSshHostKeys;
|
|
9
|
+
export const parseSshHostKeys = commonJsModule.parseSshHostKeys;
|
|
10
|
+
export const readSshKeyBlobType = commonJsModule.readSshKeyBlobType;
|
|
@@ -73,9 +73,8 @@ var CodeWorkerKind;
|
|
|
73
73
|
// One of the repository's project's own Runners (a Runner row).
|
|
74
74
|
CodeWorkerKind["ProjectRunner"] = "project-runner";
|
|
75
75
|
/*
|
|
76
|
-
* A global Runner
|
|
77
|
-
*
|
|
78
|
-
* fleet).
|
|
76
|
+
* A global Runner: a Runner row with no project (isGlobalRunner), which
|
|
77
|
+
* OneUptime runs for every project.
|
|
79
78
|
*/
|
|
80
79
|
CodeWorkerKind["GlobalRunner"] = "global-runner";
|
|
81
80
|
// An AI agent of the project's own, from before Runners.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GLOBAL_AI_AGENT_GONE_MESSAGE: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GLOBAL_AI_AGENT_GONE_MESSAGE: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GLOBAL_AI_AGENT_GONE_MESSAGE = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* GLOBAL AI AGENTS ARE GONE
|
|
6
|
+
*
|
|
7
|
+
* A global AI agent - an AI agent with no project - was either the shared
|
|
8
|
+
* Runner's registration or one a master admin added on the Admin
|
|
9
|
+
* Dashboard's Global AI Agents page and started a Runner with. Global
|
|
10
|
+
* Runners took the work they did (OneUptime AI's code fixes), and the
|
|
11
|
+
* shared Runner, the page and the agents' registration went with them.
|
|
12
|
+
*
|
|
13
|
+
* Their rows stay in the database, unused: a global AI agent's id and key
|
|
14
|
+
* prove nothing on the code-fix routes (CodeFixAgentAuth), and its heartbeat
|
|
15
|
+
* (/api/ai-agent/alive) is answered with this, which a Runner started with
|
|
16
|
+
* them logs (RegisterRunner), so whoever runs it learns what to start
|
|
17
|
+
* instead of watching every request fail.
|
|
18
|
+
*/
|
|
19
|
+
exports.GLOBAL_AI_AGENT_GONE_MESSAGE = "This is a global AI agent, which OneUptime no longer uses: global Runners do its AI code fixes now. In the Admin Dashboard, open Settings > Global Runners, create a global Runner, and start this Runner with that Runner's ID and key instead.";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import RunbookStepType from "../Runbook/RunbookStepType.mjs";
|
|
2
2
|
import { TimeoutBounds } from "../Runbook/RunbookStepTimeout.mjs";
|
|
3
3
|
export declare const GLOBAL_RUNNER_STEP_TYPES: ReadonlyArray<RunbookStepType>;
|
|
4
|
+
export declare const CODE_AGENT_COMMAND_TOOL_NAME: string;
|
|
4
5
|
export declare function canGlobalRunnersRunStepType(stepType: unknown): boolean;
|
|
5
6
|
export declare const GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS: number;
|
|
6
7
|
export declare const GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS: TimeoutBounds;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import RunbookStepType from "../Runbook/RunbookStepType";
|
|
2
2
|
import { TimeoutBounds } from "../Runbook/RunbookStepTimeout";
|
|
3
3
|
export declare const GLOBAL_RUNNER_STEP_TYPES: ReadonlyArray<RunbookStepType>;
|
|
4
|
+
export declare const CODE_AGENT_COMMAND_TOOL_NAME: string;
|
|
4
5
|
export declare function canGlobalRunnersRunStepType(stepType: unknown): boolean;
|
|
5
6
|
export declare const GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS: number;
|
|
6
7
|
export declare const GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS: TimeoutBounds;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MAX_GLOBAL_RUNNER_JOBS_PER_PROJECT = exports.GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS = exports.GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS = exports.GLOBAL_RUNNER_STEP_TYPES = void 0;
|
|
6
|
+
exports.MAX_GLOBAL_RUNNER_JOBS_PER_PROJECT = exports.GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS = exports.GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS = exports.CODE_AGENT_COMMAND_TOOL_NAME = exports.GLOBAL_RUNNER_STEP_TYPES = void 0;
|
|
7
7
|
exports.canGlobalRunnersRunStepType = canGlobalRunnersRunStepType;
|
|
8
8
|
exports.clampGlobalRunnerExecutionTimeoutInMs = clampGlobalRunnerExecutionTimeoutInMs;
|
|
9
9
|
const RunbookStepType_1 = __importDefault(require("../Runbook/RunbookStepType"));
|
|
@@ -24,6 +24,18 @@ const RunbookStepTimeout_1 = require("../Runbook/RunbookStepTimeout");
|
|
|
24
24
|
* guard on the strict policy: public internet addresses only, never a
|
|
25
25
|
* private, loopback or link-local address or a cloud metadata endpoint -
|
|
26
26
|
* so never a project's network, nor the network the Runner sits in.
|
|
27
|
+
* - OneUptime AI's code fixes, in every code repository on the Global
|
|
28
|
+
* Runner (Types/Runner/CodeRepositoryRunner), one at a time, each in a
|
|
29
|
+
* workspace of its own that is deleted when the fix ends. The code agent
|
|
30
|
+
* writes the fix with its file tools alone: none of the repository's own
|
|
31
|
+
* commands (setup, build, test) and no command a model composes ever
|
|
32
|
+
* runs there. The server never hands a global Runner either - a
|
|
33
|
+
* repository's commands, or the command tool to the model
|
|
34
|
+
* (CodeFixAgentAuth) - and the Runner refuses both
|
|
35
|
+
* (Config.runsProjectAuthoredCommands). A global Runner acts only for
|
|
36
|
+
* the run it claimed and is handed a repository's token only for that
|
|
37
|
+
* run (CodeFixAgentAuth.deniesAccessToRun); a GitHub repository's token
|
|
38
|
+
* covers that one repository and is revoked when the fix ends.
|
|
27
39
|
*
|
|
28
40
|
* Bash, SSH and Kubernetes steps never run on a global Runner. A shell
|
|
29
41
|
* cannot be kept apart from the other projects' steps on the same host
|
|
@@ -49,6 +61,14 @@ const RunbookStepTimeout_1 = require("../Runbook/RunbookStepTimeout");
|
|
|
49
61
|
exports.GLOBAL_RUNNER_STEP_TYPES = [
|
|
50
62
|
RunbookStepType_1.default.JavaScript,
|
|
51
63
|
];
|
|
64
|
+
/*
|
|
65
|
+
* The code agent's tool that runs a shell command in the repository
|
|
66
|
+
* (packages/Runner InHouseCodeAgent). Never offered on a global Runner: the
|
|
67
|
+
* Runner leaves it out and refuses the call, and the server takes it out of
|
|
68
|
+
* the tools the model is offered for a global Runner's run
|
|
69
|
+
* (CodeFixAgentAuth.getOfferedTools).
|
|
70
|
+
*/
|
|
71
|
+
exports.CODE_AGENT_COMMAND_TOOL_NAME = "run_command";
|
|
52
72
|
// Whether a global Runner may run a step of this type.
|
|
53
73
|
function canGlobalRunnersRunStepType(stepType) {
|
|
54
74
|
return (typeof stepType === "string" &&
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import commonJsModule from "./GlobalRunnerWork.js";
|
|
2
|
+
export const CODE_AGENT_COMMAND_TOOL_NAME = commonJsModule.CODE_AGENT_COMMAND_TOOL_NAME;
|
|
2
3
|
export const GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS = commonJsModule.GLOBAL_RUNNER_MAX_EXECUTION_TIMEOUT_IN_MS;
|
|
3
4
|
export const GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS = commonJsModule.GLOBAL_RUNNER_STEP_EXECUTION_TIMEOUT_BOUNDS;
|
|
4
5
|
export const GLOBAL_RUNNER_STEP_TYPES = commonJsModule.GLOBAL_RUNNER_STEP_TYPES;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import SsoProviderType from "./SsoProviderType.mjs";
|
|
2
|
+
export interface SsoSignInProvider {
|
|
3
|
+
type: SsoProviderType;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SignInMethods {
|
|
9
|
+
isSsoRequired: boolean;
|
|
10
|
+
ssoProviders: Array<SsoSignInProvider>;
|
|
11
|
+
hasProjectSsoProviders: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectSignInMethods {
|
|
14
|
+
ssoProviders: Array<SsoSignInProvider>;
|
|
15
|
+
}
|
|
16
|
+
export declare const SSO_REQUIRED_SIGN_IN_MESSAGE: string;
|
|
17
|
+
export declare const SSO_REQUIRED_SIGN_UP_MESSAGE: string;
|
|
18
|
+
export declare const MASTER_ADMIN_SIGN_IN_ROUTE: string;
|
|
19
|
+
export declare const MASTER_ADMIN_SIGN_IN_PATH: string;
|
|
20
|
+
export declare const GLOBAL_SSO_PROVIDER_TYPES: ReadonlyArray<SsoProviderType>;
|
|
21
|
+
export declare const PROJECT_SSO_PROVIDER_TYPES: ReadonlyArray<SsoProviderType>;
|
|
22
|
+
export default class SignInMethodsUtil {
|
|
23
|
+
static parseProviders(value: unknown, allowedTypes?: ReadonlyArray<SsoProviderType>): Array<SsoSignInProvider>;
|
|
24
|
+
static parse(value: unknown): SignInMethods | null;
|
|
25
|
+
static parseProjectMethods(value: unknown): ProjectSignInMethods;
|
|
26
|
+
static getSignInRoute(data: {
|
|
27
|
+
provider: SsoSignInProvider;
|
|
28
|
+
projectId?: string | undefined;
|
|
29
|
+
}): string | null;
|
|
30
|
+
static hasOwnDescription(provider: SsoSignInProvider): boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import SsoProviderType from "./SsoProviderType";
|
|
2
|
+
export interface SsoSignInProvider {
|
|
3
|
+
type: SsoProviderType;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SignInMethods {
|
|
9
|
+
isSsoRequired: boolean;
|
|
10
|
+
ssoProviders: Array<SsoSignInProvider>;
|
|
11
|
+
hasProjectSsoProviders: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectSignInMethods {
|
|
14
|
+
ssoProviders: Array<SsoSignInProvider>;
|
|
15
|
+
}
|
|
16
|
+
export declare const SSO_REQUIRED_SIGN_IN_MESSAGE: string;
|
|
17
|
+
export declare const SSO_REQUIRED_SIGN_UP_MESSAGE: string;
|
|
18
|
+
export declare const MASTER_ADMIN_SIGN_IN_ROUTE: string;
|
|
19
|
+
export declare const MASTER_ADMIN_SIGN_IN_PATH: string;
|
|
20
|
+
export declare const GLOBAL_SSO_PROVIDER_TYPES: ReadonlyArray<SsoProviderType>;
|
|
21
|
+
export declare const PROJECT_SSO_PROVIDER_TYPES: ReadonlyArray<SsoProviderType>;
|
|
22
|
+
export default class SignInMethodsUtil {
|
|
23
|
+
static parseProviders(value: unknown, allowedTypes?: ReadonlyArray<SsoProviderType>): Array<SsoSignInProvider>;
|
|
24
|
+
static parse(value: unknown): SignInMethods | null;
|
|
25
|
+
static parseProjectMethods(value: unknown): ProjectSignInMethods;
|
|
26
|
+
static getSignInRoute(data: {
|
|
27
|
+
provider: SsoSignInProvider;
|
|
28
|
+
projectId?: string | undefined;
|
|
29
|
+
}): string | null;
|
|
30
|
+
static hasOwnDescription(provider: SsoSignInProvider): boolean;
|
|
31
|
+
}
|
|
@@ -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;
|