@oneuptime/common 14.0.94 → 14.0.96
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/AnalyticsModels/ExceptionInstance.d.mts +2 -0
- package/Models/AnalyticsModels/ExceptionInstance.d.ts +2 -0
- package/Models/AnalyticsModels/ExceptionInstance.js +7 -0
- package/Models/AnalyticsModels/Log.d.mts +2 -0
- package/Models/AnalyticsModels/Log.d.ts +2 -0
- package/Models/AnalyticsModels/Log.js +7 -0
- package/Models/AnalyticsModels/SecurityEvent.d.mts +8 -0
- package/Models/AnalyticsModels/SecurityEvent.d.ts +8 -0
- package/Models/AnalyticsModels/SecurityEvent.js +55 -0
- package/Models/AnalyticsModels/Span.d.mts +4 -0
- package/Models/AnalyticsModels/Span.d.ts +4 -0
- package/Models/AnalyticsModels/Span.js +63 -0
- package/Models/DatabaseModels/CustomNotificationChannel.d.mts +16 -0
- package/Models/DatabaseModels/CustomNotificationChannel.d.ts +16 -0
- package/Models/DatabaseModels/CustomNotificationChannel.js +337 -0
- package/Models/DatabaseModels/CustomNotificationChannel.mjs +2 -0
- package/Models/DatabaseModels/DashboardPlaylist.d.mts +16 -0
- package/Models/DatabaseModels/DashboardPlaylist.d.ts +16 -0
- package/Models/DatabaseModels/DashboardPlaylist.js +314 -0
- package/Models/DatabaseModels/DashboardPlaylist.mjs +2 -0
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
- package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.mts +1 -0
- package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.ts +1 -0
- package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.js +27 -3
- package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
- package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
- package/Models/DatabaseModels/DetectionRuleException.js +412 -0
- package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
- package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
- package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
- package/Models/DatabaseModels/GlobalConfig.js +107 -0
- package/Models/DatabaseModels/Index.js +8 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +40 -0
- package/Models/DatabaseModels/SecurityTelemetrySource.d.mts +21 -0
- package/Models/DatabaseModels/SecurityTelemetrySource.d.ts +21 -0
- package/Models/DatabaseModels/SecurityTelemetrySource.js +357 -0
- package/Models/DatabaseModels/SecurityTelemetrySource.mjs +2 -0
- package/Models/DatabaseModels/TeamComplianceSetting.js +2 -2
- package/Models/DatabaseModels/TeamPermission.js +5 -7
- package/Models/DatabaseModels/UserNotificationRule.d.mts +3 -0
- package/Models/DatabaseModels/UserNotificationRule.d.ts +3 -0
- package/Models/DatabaseModels/UserNotificationRule.js +67 -0
- package/Models/DatabaseModels/UserNotificationSetting.d.mts +1 -0
- package/Models/DatabaseModels/UserNotificationSetting.d.ts +1 -0
- package/Models/DatabaseModels/UserNotificationSetting.js +26 -0
- package/Models/DatabaseModels/UserOnCallLogTimeline.d.mts +3 -0
- package/Models/DatabaseModels/UserOnCallLogTimeline.d.ts +3 -0
- package/Models/DatabaseModels/UserOnCallLogTimeline.js +53 -0
- package/Types/AI/AIChatPermissionMode.js +11 -5
- package/Types/AI/ResourceCardFacts.d.mts +11 -0
- package/Types/AI/ResourceCardFacts.d.ts +11 -0
- package/Types/AI/ResourceCardFacts.js +80 -0
- package/Types/AI/ResourceCardFacts.mjs +4 -0
- package/Types/AnalyticsDatabase/TableColumn.d.mts +4 -0
- package/Types/AnalyticsDatabase/TableColumn.d.ts +4 -0
- package/Types/AnalyticsDatabase/TableColumn.js +7 -0
- package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.mts +2 -0
- package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.ts +2 -0
- package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.js +4 -0
- package/Types/Backup/BackupDestinationCatalog.d.mts +2 -0
- package/Types/Backup/BackupDestinationCatalog.d.ts +2 -0
- package/Types/Backup/BackupDestinationCatalog.js +8 -0
- package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.mts +25 -0
- package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.ts +25 -0
- package/Types/CallAndSMS/CallAndSmsGatewayPayload.js +86 -0
- package/Types/CallAndSMS/CallAndSmsGatewayPayload.mjs +6 -0
- package/Types/CallAndSMS/CallAndSmsProvider.d.mts +23 -0
- package/Types/CallAndSMS/CallAndSmsProvider.d.ts +23 -0
- package/Types/CallAndSMS/CallAndSmsProvider.js +107 -0
- package/Types/CallAndSMS/CallAndSmsProvider.mjs +7 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.mts +2 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.ts +2 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +4 -0
- package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.mts +95 -0
- package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.ts +95 -0
- package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.js +236 -0
- package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.mjs +16 -0
- package/Types/Dashboard/DashboardPlaylist.d.mts +21 -0
- package/Types/Dashboard/DashboardPlaylist.d.ts +21 -0
- package/Types/Dashboard/DashboardPlaylist.js +197 -0
- package/Types/Dashboard/DashboardPlaylist.mjs +19 -0
- package/Types/Database/TableColumn.d.mts +8 -0
- package/Types/Database/TableColumn.d.ts +8 -0
- package/Types/Database/TableColumn.js +69 -23
- package/Types/Database/TableColumn.mjs +1 -0
- package/Types/HeldPermissions.d.mts +2 -0
- package/Types/HeldPermissions.d.ts +2 -0
- package/Types/HeldPermissions.js +32 -8
- package/Types/Icon/IconProp.d.mts +3 -0
- package/Types/Icon/IconProp.d.ts +3 -0
- package/Types/Icon/IconProp.js +4 -0
- package/Types/JSONFunctions.js +16 -1
- package/Types/LlmObservability/LlmConnectionCatalog.d.mts +2 -0
- package/Types/LlmObservability/LlmConnectionCatalog.d.ts +2 -0
- package/Types/LlmObservability/LlmConnectionCatalog.js +8 -0
- package/Types/Monitor/MonitorType.js +5 -4
- package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
- package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
- package/Types/Monitor/TelemetryAlertRule.js +886 -0
- package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
- package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
- package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
- package/Types/Monitor/TelemetryRulePreview.js +190 -0
- package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.js +23 -8
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.mjs +2 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.mts +47 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.ts +47 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.js +122 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.mjs +12 -0
- package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.mts +2 -1
- package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.ts +2 -1
- package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.js +10 -1
- package/Types/Permission.d.mts +10 -0
- package/Types/Permission.d.ts +10 -0
- package/Types/Permission.js +83 -19
- package/Types/ProviderLogo/ProviderLogo.d.mts +87 -0
- package/Types/ProviderLogo/ProviderLogo.d.ts +87 -0
- package/Types/ProviderLogo/ProviderLogo.js +215 -0
- package/Types/ProviderLogo/ProviderLogo.mjs +6 -0
- package/Types/PushNotification/PushNotificationsTurnedOff.d.mts +3 -0
- package/Types/PushNotification/PushNotificationsTurnedOff.d.ts +3 -0
- package/Types/PushNotification/PushNotificationsTurnedOff.js +32 -0
- package/Types/PushNotification/PushNotificationsTurnedOff.mjs +4 -0
- package/Types/RollingTime/RollingTimeUtil.js +20 -10
- package/Types/Runbook/RunbookTriggerType.d.mts +2 -1
- package/Types/Runbook/RunbookTriggerType.d.ts +2 -1
- package/Types/Runbook/RunbookTriggerType.js +5 -1
- package/Types/SecurityCase/SecurityCaseContext.d.mts +188 -0
- package/Types/SecurityCase/SecurityCaseContext.d.ts +188 -0
- package/Types/SecurityCase/SecurityCaseContext.js +165 -0
- package/Types/SecurityCase/SecurityCaseContext.mjs +30 -0
- package/Types/SecurityCase/SecurityEntityRisk.d.mts +11 -0
- package/Types/SecurityCase/SecurityEntityRisk.d.ts +11 -0
- package/Types/SecurityCase/SecurityEntityRisk.js +9 -1
- package/Types/SecurityCase/SecurityEntityRisk.mjs +1 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.mts +2 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.ts +2 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +9 -0
- package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.mts +2 -0
- package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.ts +2 -0
- package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.js +5 -0
- package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
- package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
- package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
- package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
- package/Types/SecurityEvent/DetectionRuleDataKind.d.mts +5 -1
- package/Types/SecurityEvent/DetectionRuleDataKind.d.ts +5 -1
- package/Types/SecurityEvent/DetectionRuleDataKind.js +42 -0
- package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
- package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
- package/Types/SecurityEvent/DetectionRuleException.js +441 -0
- package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
- package/Types/SecurityEvent/DetectionRuleLibrary.js +330 -0
- package/Types/SecurityEvent/NormalizedSecurityEvent.d.mts +5 -0
- package/Types/SecurityEvent/NormalizedSecurityEvent.d.ts +5 -0
- package/Types/SecurityEvent/SecurityAttackCampaign.d.mts +31 -0
- package/Types/SecurityEvent/SecurityAttackCampaign.d.ts +31 -0
- package/Types/SecurityEvent/SecurityAttackCampaign.js +81 -0
- package/Types/SecurityEvent/SecurityAttackCampaign.mjs +8 -0
- package/Types/SecurityEvent/SecurityEventRequestOutcome.d.mts +28 -0
- package/Types/SecurityEvent/SecurityEventRequestOutcome.d.ts +28 -0
- package/Types/SecurityEvent/SecurityEventRequestOutcome.js +78 -0
- package/Types/SecurityEvent/SecurityEventRequestOutcome.mjs +6 -0
- package/Types/SecurityEvent/SecurityTelemetrySource.d.mts +39 -0
- package/Types/SecurityEvent/SecurityTelemetrySource.d.ts +39 -0
- package/Types/SecurityEvent/SecurityTelemetrySource.js +127 -0
- package/Types/SecurityEvent/SecurityTelemetrySource.mjs +12 -0
- package/Types/SecurityEvent/TurnOnRecommended.d.mts +2 -0
- package/Types/SecurityEvent/TurnOnRecommended.d.ts +2 -0
- package/Types/SecurityEvent/TurnOnRecommended.js +7 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +7 -1
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +7 -1
- package/Types/SecurityPlaybook/SecurityPlaybookAction.js +46 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.mjs +1 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +10 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +10 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.js +37 -1
- package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +1 -0
- package/Types/SecurityPlaybook/SecurityPlaybookTemplates.js +17 -0
- package/Types/Team/ComplianceNotificationChannel.d.mts +2 -1
- package/Types/Team/ComplianceNotificationChannel.d.ts +2 -1
- package/Types/Team/ComplianceNotificationChannel.js +10 -1
- package/Types/Team/ComplianceRule.d.mts +8 -3
- package/Types/Team/ComplianceRule.d.ts +8 -3
- package/Types/Team/ComplianceRule.js +34 -22
- package/Types/Team/TeamComplianceStatus.d.mts +1 -0
- package/Types/Team/TeamComplianceStatus.d.ts +1 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.js +419 -0
- package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
- package/Types/Telemetry/TelemetrySavedViewState.d.mts +1 -0
- package/Types/Telemetry/TelemetrySavedViewState.d.ts +1 -0
- package/Types/Telemetry/TraceHealth.d.mts +24 -0
- package/Types/Telemetry/TraceHealth.d.ts +24 -0
- package/Types/Telemetry/TraceHealth.js +97 -0
- package/Types/Telemetry/TraceHealth.mjs +4 -0
- package/Types/Telemetry/TraceSpanType.d.mts +90 -0
- package/Types/Telemetry/TraceSpanType.d.ts +90 -0
- package/Types/Telemetry/TraceSpanType.js +238 -0
- package/Types/Telemetry/TraceSpanType.mjs +19 -0
- package/Types/Theme/ThemePreference.d.mts +26 -0
- package/Types/Theme/ThemePreference.d.ts +26 -0
- package/Types/Theme/ThemePreference.js +104 -0
- package/Types/Theme/ThemePreference.mjs +12 -0
- package/Types/Workflow/Component.d.mts +3 -0
- package/Types/Workflow/Component.d.ts +3 -0
- package/Types/Workflow/Components/Discord.js +2 -0
- package/Types/Workflow/Components/Mattermost.js +2 -0
- package/Types/Workflow/Components/MicrosoftTeams.js +2 -0
- package/Types/Workflow/Components/Slack.js +2 -0
- package/Types/Workflow/Components/Telegram.js +2 -0
- package/Types/Workflow/Components.js +6 -0
- package/Types/Workflow/Templates.js +5 -3
- package/Utils/ColorContrast.d.mts +0 -3
- package/Utils/ColorContrast.d.ts +0 -3
- package/Utils/ColorContrast.js +3 -41
- package/Utils/ColorContrast.mjs +0 -2
- package/Utils/NameInitials.d.mts +5 -0
- package/Utils/NameInitials.d.ts +5 -0
- package/Utils/NameInitials.js +92 -0
- package/Utils/NameInitials.mjs +6 -0
- package/Utils/OldestKeyCursor.d.mts +7 -0
- package/Utils/OldestKeyCursor.d.ts +7 -0
- package/Utils/OldestKeyCursor.js +68 -0
- package/Utils/OldestKeyCursor.mjs +2 -0
- package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
- package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
- package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
- package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
- package/Utils/Schema/Zod.js +6 -0
- package/Utils/SecurityCase/SecurityCaseImpactFacts.d.mts +41 -0
- package/Utils/SecurityCase/SecurityCaseImpactFacts.d.ts +41 -0
- package/Utils/SecurityCase/SecurityCaseImpactFacts.js +215 -0
- package/Utils/SecurityCase/SecurityCaseImpactFacts.mjs +6 -0
- package/Utils/SecurityCase/SecurityCaseStoryItems.d.mts +46 -0
- package/Utils/SecurityCase/SecurityCaseStoryItems.d.ts +46 -0
- package/Utils/SecurityCase/SecurityCaseStoryItems.js +327 -0
- package/Utils/SecurityCase/SecurityCaseStoryItems.mjs +17 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.mts +5 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.ts +5 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.js +22 -2
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.mjs +2 -0
- package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.mts +20 -0
- package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.ts +20 -0
- package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.js +347 -31
- package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.mjs +11 -0
- package/Utils/SecurityEvent/RequestFollowUp.d.mts +4 -0
- package/Utils/SecurityEvent/RequestFollowUp.d.ts +4 -0
- package/Utils/SecurityEvent/RequestFollowUp.js +127 -0
- package/Utils/SecurityEvent/RequestFollowUp.mjs +3 -0
- package/Utils/SecurityEvent/RequestOutcome.d.mts +80 -0
- package/Utils/SecurityEvent/RequestOutcome.d.ts +80 -0
- package/Utils/SecurityEvent/RequestOutcome.js +371 -0
- package/Utils/SecurityEvent/RequestOutcome.mjs +18 -0
- package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.mts +76 -0
- package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.ts +76 -0
- package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.js +348 -0
- package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.mjs +15 -0
- package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.mts +61 -0
- package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.ts +61 -0
- package/Utils/SecurityEvent/TelemetryScan/FlowSignals.js +260 -0
- package/Utils/SecurityEvent/TelemetryScan/FlowSignals.mjs +17 -0
- package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.mts +30 -0
- package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.ts +30 -0
- package/Utils/SecurityEvent/TelemetryScan/RumSignals.js +134 -0
- package/Utils/SecurityEvent/TelemetryScan/RumSignals.mjs +8 -0
- package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.mts +40 -0
- package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.ts +40 -0
- package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.js +190 -0
- package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.mjs +6 -0
- package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.mts +57 -0
- package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.ts +57 -0
- package/Utils/SecurityEvent/TelemetryScan/TraceSignals.js +491 -0
- package/Utils/SecurityEvent/TelemetryScan/TraceSignals.mjs +27 -0
- package/Utils/Telemetry/EntrySpan.d.mts +8 -0
- package/Utils/Telemetry/EntrySpan.d.ts +8 -0
- package/Utils/Telemetry/EntrySpan.js +53 -0
- package/Utils/Telemetry/EntrySpan.mjs +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CALL_AND_SMS_GATEWAY_URL_TITLE = exports.CALL_AND_SMS_PROVIDER_TITLE = exports.DEFAULT_CALL_AND_SMS_PROVIDER = exports.CALL_AND_SMS_PROVIDERS = exports.CallAndSmsProvider = void 0;
|
|
4
|
+
const RefusedValue_1 = require("../../Utils/RefusedValue");
|
|
5
|
+
/*
|
|
6
|
+
* WHAT CARRIES THE ONEUPTIME SERVER'S SMS AND CALLS: TWILIO, OR A GATEWAY.
|
|
7
|
+
*
|
|
8
|
+
* The server's own Twilio account (Admin Dashboard > Settings > Call and
|
|
9
|
+
* SMS) is what every installation sent through before the choice, and what
|
|
10
|
+
* the column starts with (GlobalConfig.callAndSmsProvider). An installation
|
|
11
|
+
* that may not use Twilio - its rules send every message through its own
|
|
12
|
+
* provider, or through a proxy that scrubs it first - sends through its own
|
|
13
|
+
* gateway instead: a URL OneUptime posts each SMS and call to, signed with a
|
|
14
|
+
* secret, as it posts to a custom channel (CallAndSmsGatewayPayload). The
|
|
15
|
+
* gateway delivers them however the installation does.
|
|
16
|
+
*
|
|
17
|
+
* Only what would go through the server's own account: a project with a
|
|
18
|
+
* Twilio config of its own (Dashboard > Project Settings > Call & SMS) still
|
|
19
|
+
* sends through that config, as it did. Whatever carries a message, the
|
|
20
|
+
* project's switches and balance are checked the same way first.
|
|
21
|
+
*
|
|
22
|
+
* Kept free of server and React code: the server, the Admin Dashboard and
|
|
23
|
+
* the tests read the same rules.
|
|
24
|
+
*/
|
|
25
|
+
var CallAndSmsProvider;
|
|
26
|
+
(function (CallAndSmsProvider) {
|
|
27
|
+
CallAndSmsProvider["Twilio"] = "Twilio";
|
|
28
|
+
CallAndSmsProvider["Gateway"] = "Gateway";
|
|
29
|
+
})(CallAndSmsProvider || (exports.CallAndSmsProvider = CallAndSmsProvider = {}));
|
|
30
|
+
// In the order the form offers them: what every installation had, first.
|
|
31
|
+
exports.CALL_AND_SMS_PROVIDERS = [
|
|
32
|
+
CallAndSmsProvider.Twilio,
|
|
33
|
+
CallAndSmsProvider.Gateway,
|
|
34
|
+
];
|
|
35
|
+
/*
|
|
36
|
+
* What a server that says nothing sends through: Twilio, as every
|
|
37
|
+
* installation did before the choice - and what the column starts with.
|
|
38
|
+
*/
|
|
39
|
+
exports.DEFAULT_CALL_AND_SMS_PROVIDER = CallAndSmsProvider.Twilio;
|
|
40
|
+
// The titles of the columns, as the form and the API reference name them.
|
|
41
|
+
exports.CALL_AND_SMS_PROVIDER_TITLE = "Send SMS and Calls Through";
|
|
42
|
+
exports.CALL_AND_SMS_GATEWAY_URL_TITLE = "Gateway URL";
|
|
43
|
+
class CallAndSmsProviders {
|
|
44
|
+
static isProvider(value) {
|
|
45
|
+
return (typeof value === "string" &&
|
|
46
|
+
exports.CALL_AND_SMS_PROVIDERS.includes(value));
|
|
47
|
+
}
|
|
48
|
+
/*
|
|
49
|
+
* What a stored value says the server sends through. Unset - every
|
|
50
|
+
* installation before the choice - is Twilio, and so is a value that is
|
|
51
|
+
* not a provider: the writes that store one refuse it
|
|
52
|
+
* (getProviderError), so only a row edited by hand can hold one, and it
|
|
53
|
+
* keeps sending as every installation did.
|
|
54
|
+
*/
|
|
55
|
+
static getProvider(value) {
|
|
56
|
+
return CallAndSmsProviders.isProvider(value)
|
|
57
|
+
? value
|
|
58
|
+
: exports.DEFAULT_CALL_AND_SMS_PROVIDER;
|
|
59
|
+
}
|
|
60
|
+
// Whether a server whose column holds this sends through its own gateway.
|
|
61
|
+
static isGateway(value) {
|
|
62
|
+
return (CallAndSmsProviders.getProvider(value) === CallAndSmsProvider.Gateway);
|
|
63
|
+
}
|
|
64
|
+
/*
|
|
65
|
+
* What is wrong with a value a write gives for what the server sends
|
|
66
|
+
* through, or null when it is one of the providers - or not given at all:
|
|
67
|
+
* the column then keeps, or starts with, what it holds.
|
|
68
|
+
*/
|
|
69
|
+
static getProviderError(value) {
|
|
70
|
+
if (value === undefined || value === null) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (CallAndSmsProviders.isProvider(value)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const choices = `${exports.CALL_AND_SMS_PROVIDER_TITLE} must be "${CallAndSmsProvider.Twilio}" or "${CallAndSmsProvider.Gateway}"`;
|
|
77
|
+
// A text is repeated, as far as a refusal repeats one; anything else is not text.
|
|
78
|
+
return typeof value === "string"
|
|
79
|
+
? `${choices}, not "${(0, RefusedValue_1.refusedValue)(value)}".`
|
|
80
|
+
: `${choices}.`;
|
|
81
|
+
}
|
|
82
|
+
/*
|
|
83
|
+
* The gateway the server sends through, or null when it sends through
|
|
84
|
+
* Twilio - or is set to the gateway without a URL to post to, which the
|
|
85
|
+
* write refuses (GlobalConfigService), so only a row edited by hand holds
|
|
86
|
+
* it. Such a server has nothing to send through, and says so as a server
|
|
87
|
+
* without a Twilio account does.
|
|
88
|
+
*/
|
|
89
|
+
static getGateway(config) {
|
|
90
|
+
if (!CallAndSmsProviders.isGateway(config.callAndSmsProvider)) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const url = typeof config.callAndSmsGatewayUrl === "string"
|
|
94
|
+
? config.callAndSmsGatewayUrl.trim()
|
|
95
|
+
: "";
|
|
96
|
+
if (!url) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
url: url,
|
|
101
|
+
secret: typeof config.callAndSmsGatewaySecret === "string"
|
|
102
|
+
? config.callAndSmsGatewaySecret
|
|
103
|
+
: "",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.default = CallAndSmsProviders;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import commonJsModule from "./CallAndSmsProvider.js";
|
|
2
|
+
export default commonJsModule.default;
|
|
3
|
+
export const CALL_AND_SMS_GATEWAY_URL_TITLE = commonJsModule.CALL_AND_SMS_GATEWAY_URL_TITLE;
|
|
4
|
+
export const CALL_AND_SMS_PROVIDERS = commonJsModule.CALL_AND_SMS_PROVIDERS;
|
|
5
|
+
export const CALL_AND_SMS_PROVIDER_TITLE = commonJsModule.CALL_AND_SMS_PROVIDER_TITLE;
|
|
6
|
+
export const CallAndSmsProvider = commonJsModule.CallAndSmsProvider;
|
|
7
|
+
export const DEFAULT_CALL_AND_SMS_PROVIDER = commonJsModule.DEFAULT_CALL_AND_SMS_PROVIDER;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CloudProvider } from "../Cloud/CloudPlatform.mjs";
|
|
2
2
|
import IconProp from "../Icon/IconProp.mjs";
|
|
3
|
+
import ProviderLogo from "../ProviderLogo/ProviderLogo.mjs";
|
|
3
4
|
export declare enum CloudConnectionAuthMethod {
|
|
4
5
|
AwsRole = "aws-role",
|
|
5
6
|
AwsAccessKey = "aws-access-key",
|
|
@@ -37,6 +38,7 @@ export interface CloudConnectionDefinition {
|
|
|
37
38
|
summary: string;
|
|
38
39
|
explanation: string;
|
|
39
40
|
icon: IconProp;
|
|
41
|
+
logo: ProviderLogo;
|
|
40
42
|
docsPath: string;
|
|
41
43
|
shellTitle: string;
|
|
42
44
|
shellUrl: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CloudProvider } from "../Cloud/CloudPlatform";
|
|
2
2
|
import IconProp from "../Icon/IconProp";
|
|
3
|
+
import ProviderLogo from "../ProviderLogo/ProviderLogo";
|
|
3
4
|
export declare enum CloudConnectionAuthMethod {
|
|
4
5
|
AwsRole = "aws-role",
|
|
5
6
|
AwsAccessKey = "aws-access-key",
|
|
@@ -37,6 +38,7 @@ export interface CloudConnectionDefinition {
|
|
|
37
38
|
summary: string;
|
|
38
39
|
explanation: string;
|
|
39
40
|
icon: IconProp;
|
|
41
|
+
logo: ProviderLogo;
|
|
40
42
|
docsPath: string;
|
|
41
43
|
shellTitle: string;
|
|
42
44
|
shellUrl: string;
|
|
@@ -15,6 +15,7 @@ exports.getCloudConnectionReadIntervalInMinutes = getCloudConnectionReadInterval
|
|
|
15
15
|
exports.splitCloudConnectionList = splitCloudConnectionList;
|
|
16
16
|
const CloudPlatform_1 = require("../Cloud/CloudPlatform");
|
|
17
17
|
const IconProp_1 = __importDefault(require("../Icon/IconProp"));
|
|
18
|
+
const ProviderLogo_1 = __importDefault(require("../ProviderLogo/ProviderLogo"));
|
|
18
19
|
/*
|
|
19
20
|
* EVERYTHING ABOUT A CLOUD CONNECTION THAT IS NOT CODE.
|
|
20
21
|
*
|
|
@@ -122,6 +123,7 @@ exports.CloudConnectionCatalog = [
|
|
|
122
123
|
{
|
|
123
124
|
provider: CloudPlatform_1.CloudProvider.AWS,
|
|
124
125
|
title: "Amazon Web Services",
|
|
126
|
+
logo: ProviderLogo_1.default.Aws,
|
|
125
127
|
description: "EC2, RDS, Lambda, load balancers and more, read from CloudWatch.",
|
|
126
128
|
summary: "Every resource in every region you use, with its key metrics and what changed.",
|
|
127
129
|
explanation: "OneUptime can only read: metrics, resources and how they are set up, changes and health events. Never data or secrets.",
|
|
@@ -195,6 +197,7 @@ exports.CloudConnectionCatalog = [
|
|
|
195
197
|
{
|
|
196
198
|
provider: CloudPlatform_1.CloudProvider.Azure,
|
|
197
199
|
title: "Microsoft Azure",
|
|
200
|
+
logo: ProviderLogo_1.default.Azure,
|
|
198
201
|
description: "Virtual machines, App Service, SQL, storage and more, read from Azure Monitor.",
|
|
199
202
|
summary: "Every resource in the subscriptions the app can read, with its key metrics and what changed.",
|
|
200
203
|
explanation: "OneUptime can only read: resources, metrics and the activity log. Never data or secrets.",
|
|
@@ -279,6 +282,7 @@ exports.CloudConnectionCatalog = [
|
|
|
279
282
|
{
|
|
280
283
|
provider: CloudPlatform_1.CloudProvider.GCP,
|
|
281
284
|
title: "Google Cloud",
|
|
285
|
+
logo: ProviderLogo_1.default.GoogleCloud,
|
|
282
286
|
description: "Compute Engine, Cloud SQL, Cloud Run, buckets and more, read from Cloud Monitoring.",
|
|
283
287
|
summary: "Every resource in your projects, with its key metrics and what changed.",
|
|
284
288
|
explanation: "OneUptime can only read: metrics, resources and the audit log. Never data or secrets.",
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { JSONObject } from "../JSON.mjs";
|
|
2
|
+
import UserNotificationEventType from "../UserNotification/UserNotificationEventType.mjs";
|
|
3
|
+
export declare const CUSTOM_CHANNEL_PAYLOAD_VERSION: number;
|
|
4
|
+
export declare const CUSTOM_CHANNEL_METHOD_LABEL: string;
|
|
5
|
+
export declare const CUSTOM_CHANNEL_EVENT_HEADER: string;
|
|
6
|
+
export declare const CUSTOM_CHANNEL_SIGNATURE_HEADER: string;
|
|
7
|
+
export declare const MAX_CUSTOM_CHANNEL_TEXT_LENGTH: number;
|
|
8
|
+
export declare enum CustomChannelEvent {
|
|
9
|
+
IncidentCreated = "on-call.incident.created",
|
|
10
|
+
AlertCreated = "on-call.alert.created",
|
|
11
|
+
IncidentEpisodeCreated = "on-call.incidentEpisode.created",
|
|
12
|
+
AlertEpisodeCreated = "on-call.alertEpisode.created",
|
|
13
|
+
Notification = "notification",
|
|
14
|
+
Test = "test"
|
|
15
|
+
}
|
|
16
|
+
export declare enum CustomChannelRecordType {
|
|
17
|
+
Incident = "incident",
|
|
18
|
+
Alert = "alert",
|
|
19
|
+
IncidentEpisode = "incidentEpisode",
|
|
20
|
+
AlertEpisode = "alertEpisode"
|
|
21
|
+
}
|
|
22
|
+
export declare enum CustomChannelAction {
|
|
23
|
+
Acknowledge = "acknowledge",
|
|
24
|
+
Escalate = "escalate",
|
|
25
|
+
Resolve = "resolve"
|
|
26
|
+
}
|
|
27
|
+
export declare const CUSTOM_CHANNEL_ACTIONS: ReadonlyArray<CustomChannelAction>;
|
|
28
|
+
export declare const isCustomChannelAction: (value: unknown) => value is CustomChannelAction;
|
|
29
|
+
export declare enum CustomChannelActionResult {
|
|
30
|
+
Acknowledged = "acknowledged",
|
|
31
|
+
AlreadyAcknowledged = "alreadyAcknowledged",
|
|
32
|
+
Escalated = "escalated",
|
|
33
|
+
NotEscalated = "notEscalated",
|
|
34
|
+
Resolved = "resolved",
|
|
35
|
+
AlreadyResolved = "alreadyResolved"
|
|
36
|
+
}
|
|
37
|
+
export interface CustomChannelReference {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CustomChannelPerson {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
email: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CustomChannelRecord {
|
|
47
|
+
id: string;
|
|
48
|
+
number: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
severity: string;
|
|
52
|
+
state: string;
|
|
53
|
+
url: string;
|
|
54
|
+
}
|
|
55
|
+
export type CustomChannelActionLinks = Record<CustomChannelAction, string>;
|
|
56
|
+
export interface CustomChannelPageInput {
|
|
57
|
+
event: CustomChannelEvent;
|
|
58
|
+
notificationId: string;
|
|
59
|
+
sentAt: Date;
|
|
60
|
+
channel: CustomChannelReference;
|
|
61
|
+
title: string;
|
|
62
|
+
message: string;
|
|
63
|
+
project: CustomChannelReference;
|
|
64
|
+
team?: CustomChannelReference | undefined;
|
|
65
|
+
user: CustomChannelPerson;
|
|
66
|
+
recordType: CustomChannelRecordType;
|
|
67
|
+
record: CustomChannelRecord;
|
|
68
|
+
onCallPolicy?: CustomChannelReference | undefined;
|
|
69
|
+
escalationRule?: CustomChannelReference | undefined;
|
|
70
|
+
isPageAgain: boolean;
|
|
71
|
+
actions: CustomChannelActionLinks;
|
|
72
|
+
}
|
|
73
|
+
export interface CustomChannelTestInput {
|
|
74
|
+
sentAt: Date;
|
|
75
|
+
channel: CustomChannelReference;
|
|
76
|
+
user: CustomChannelPerson;
|
|
77
|
+
project?: CustomChannelReference | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface CustomChannelNotificationInput {
|
|
80
|
+
sentAt: Date;
|
|
81
|
+
channel: CustomChannelReference;
|
|
82
|
+
notificationType: string;
|
|
83
|
+
title: string;
|
|
84
|
+
message: string;
|
|
85
|
+
url?: string | undefined;
|
|
86
|
+
project: CustomChannelReference;
|
|
87
|
+
user: CustomChannelPerson;
|
|
88
|
+
}
|
|
89
|
+
export declare const getCustomChannelEventFor: (eventType: UserNotificationEventType) => {
|
|
90
|
+
event: CustomChannelEvent;
|
|
91
|
+
recordType: CustomChannelRecordType;
|
|
92
|
+
};
|
|
93
|
+
export declare const buildCustomChannelPagePayload: (input: CustomChannelPageInput) => JSONObject;
|
|
94
|
+
export declare const buildCustomChannelTestPayload: (input: CustomChannelTestInput) => JSONObject;
|
|
95
|
+
export declare const buildCustomChannelNotificationPayload: (input: CustomChannelNotificationInput) => JSONObject;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { JSONObject } from "../JSON";
|
|
2
|
+
import UserNotificationEventType from "../UserNotification/UserNotificationEventType";
|
|
3
|
+
export declare const CUSTOM_CHANNEL_PAYLOAD_VERSION: number;
|
|
4
|
+
export declare const CUSTOM_CHANNEL_METHOD_LABEL: string;
|
|
5
|
+
export declare const CUSTOM_CHANNEL_EVENT_HEADER: string;
|
|
6
|
+
export declare const CUSTOM_CHANNEL_SIGNATURE_HEADER: string;
|
|
7
|
+
export declare const MAX_CUSTOM_CHANNEL_TEXT_LENGTH: number;
|
|
8
|
+
export declare enum CustomChannelEvent {
|
|
9
|
+
IncidentCreated = "on-call.incident.created",
|
|
10
|
+
AlertCreated = "on-call.alert.created",
|
|
11
|
+
IncidentEpisodeCreated = "on-call.incidentEpisode.created",
|
|
12
|
+
AlertEpisodeCreated = "on-call.alertEpisode.created",
|
|
13
|
+
Notification = "notification",
|
|
14
|
+
Test = "test"
|
|
15
|
+
}
|
|
16
|
+
export declare enum CustomChannelRecordType {
|
|
17
|
+
Incident = "incident",
|
|
18
|
+
Alert = "alert",
|
|
19
|
+
IncidentEpisode = "incidentEpisode",
|
|
20
|
+
AlertEpisode = "alertEpisode"
|
|
21
|
+
}
|
|
22
|
+
export declare enum CustomChannelAction {
|
|
23
|
+
Acknowledge = "acknowledge",
|
|
24
|
+
Escalate = "escalate",
|
|
25
|
+
Resolve = "resolve"
|
|
26
|
+
}
|
|
27
|
+
export declare const CUSTOM_CHANNEL_ACTIONS: ReadonlyArray<CustomChannelAction>;
|
|
28
|
+
export declare const isCustomChannelAction: (value: unknown) => value is CustomChannelAction;
|
|
29
|
+
export declare enum CustomChannelActionResult {
|
|
30
|
+
Acknowledged = "acknowledged",
|
|
31
|
+
AlreadyAcknowledged = "alreadyAcknowledged",
|
|
32
|
+
Escalated = "escalated",
|
|
33
|
+
NotEscalated = "notEscalated",
|
|
34
|
+
Resolved = "resolved",
|
|
35
|
+
AlreadyResolved = "alreadyResolved"
|
|
36
|
+
}
|
|
37
|
+
export interface CustomChannelReference {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CustomChannelPerson {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
email: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CustomChannelRecord {
|
|
47
|
+
id: string;
|
|
48
|
+
number: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
severity: string;
|
|
52
|
+
state: string;
|
|
53
|
+
url: string;
|
|
54
|
+
}
|
|
55
|
+
export type CustomChannelActionLinks = Record<CustomChannelAction, string>;
|
|
56
|
+
export interface CustomChannelPageInput {
|
|
57
|
+
event: CustomChannelEvent;
|
|
58
|
+
notificationId: string;
|
|
59
|
+
sentAt: Date;
|
|
60
|
+
channel: CustomChannelReference;
|
|
61
|
+
title: string;
|
|
62
|
+
message: string;
|
|
63
|
+
project: CustomChannelReference;
|
|
64
|
+
team?: CustomChannelReference | undefined;
|
|
65
|
+
user: CustomChannelPerson;
|
|
66
|
+
recordType: CustomChannelRecordType;
|
|
67
|
+
record: CustomChannelRecord;
|
|
68
|
+
onCallPolicy?: CustomChannelReference | undefined;
|
|
69
|
+
escalationRule?: CustomChannelReference | undefined;
|
|
70
|
+
isPageAgain: boolean;
|
|
71
|
+
actions: CustomChannelActionLinks;
|
|
72
|
+
}
|
|
73
|
+
export interface CustomChannelTestInput {
|
|
74
|
+
sentAt: Date;
|
|
75
|
+
channel: CustomChannelReference;
|
|
76
|
+
user: CustomChannelPerson;
|
|
77
|
+
project?: CustomChannelReference | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface CustomChannelNotificationInput {
|
|
80
|
+
sentAt: Date;
|
|
81
|
+
channel: CustomChannelReference;
|
|
82
|
+
notificationType: string;
|
|
83
|
+
title: string;
|
|
84
|
+
message: string;
|
|
85
|
+
url?: string | undefined;
|
|
86
|
+
project: CustomChannelReference;
|
|
87
|
+
user: CustomChannelPerson;
|
|
88
|
+
}
|
|
89
|
+
export declare const getCustomChannelEventFor: (eventType: UserNotificationEventType) => {
|
|
90
|
+
event: CustomChannelEvent;
|
|
91
|
+
recordType: CustomChannelRecordType;
|
|
92
|
+
};
|
|
93
|
+
export declare const buildCustomChannelPagePayload: (input: CustomChannelPageInput) => JSONObject;
|
|
94
|
+
export declare const buildCustomChannelTestPayload: (input: CustomChannelTestInput) => JSONObject;
|
|
95
|
+
export declare const buildCustomChannelNotificationPayload: (input: CustomChannelNotificationInput) => JSONObject;
|
|
@@ -0,0 +1,236 @@
|
|
|
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.buildCustomChannelNotificationPayload = exports.buildCustomChannelTestPayload = exports.buildCustomChannelPagePayload = exports.getCustomChannelEventFor = exports.CustomChannelActionResult = exports.isCustomChannelAction = exports.CUSTOM_CHANNEL_ACTIONS = exports.CustomChannelAction = exports.CustomChannelRecordType = exports.CustomChannelEvent = exports.MAX_CUSTOM_CHANNEL_TEXT_LENGTH = exports.CUSTOM_CHANNEL_SIGNATURE_HEADER = exports.CUSTOM_CHANNEL_EVENT_HEADER = exports.CUSTOM_CHANNEL_METHOD_LABEL = exports.CUSTOM_CHANNEL_PAYLOAD_VERSION = void 0;
|
|
7
|
+
const UserNotificationEventType_1 = __importDefault(require("../UserNotification/UserNotificationEventType"));
|
|
8
|
+
const MessageFit_1 = require("../../Utils/MessageFit");
|
|
9
|
+
/*
|
|
10
|
+
* WHAT A CUSTOM CHANNEL'S SERVICE RECEIVES.
|
|
11
|
+
*
|
|
12
|
+
* One JSON POST per person per notification, signed with the channel's secret
|
|
13
|
+
* (X-OneUptime-Signature: sha256=<hex HMAC-SHA256 of the body>) and naming its
|
|
14
|
+
* event in X-OneUptime-Event. A page to several people is several requests,
|
|
15
|
+
* each with that person's own action links, so OneUptime knows who answered.
|
|
16
|
+
*
|
|
17
|
+
* The shape is a contract with services OneUptime does not own, so it carries
|
|
18
|
+
* a version, fields are only ever added to it, and the docs
|
|
19
|
+
* (self-hosted/custom-notification-channels) describe every one of them.
|
|
20
|
+
*
|
|
21
|
+
* Pure, with no Node or browser APIs.
|
|
22
|
+
*/
|
|
23
|
+
exports.CUSTOM_CHANNEL_PAYLOAD_VERSION = 1;
|
|
24
|
+
/*
|
|
25
|
+
* How a custom channel is named among the methods - in readiness, an on-call
|
|
26
|
+
* log, the fallback's list of channels used - beside "Email", "SMS" and the
|
|
27
|
+
* rest. OnCallReadinessService's ReadinessMethodType.CustomChannel spells it
|
|
28
|
+
* the same.
|
|
29
|
+
*/
|
|
30
|
+
exports.CUSTOM_CHANNEL_METHOD_LABEL = "Custom Channel";
|
|
31
|
+
// The header a request names its event in.
|
|
32
|
+
exports.CUSTOM_CHANNEL_EVENT_HEADER = "X-OneUptime-Event";
|
|
33
|
+
// The header a request's signature rides in.
|
|
34
|
+
exports.CUSTOM_CHANNEL_SIGNATURE_HEADER = "X-OneUptime-Signature";
|
|
35
|
+
/*
|
|
36
|
+
* The text a request carries at most - title, message and description
|
|
37
|
+
* together, in characters. A description can be megabytes (a response body
|
|
38
|
+
* or a log a template placed in it); the longest text is cut first and ends
|
|
39
|
+
* with the note that sends the reader to OneUptime (MessageFit), so a title
|
|
40
|
+
* stays whole.
|
|
41
|
+
*/
|
|
42
|
+
exports.MAX_CUSTOM_CHANNEL_TEXT_LENGTH = 16384;
|
|
43
|
+
var CustomChannelEvent;
|
|
44
|
+
(function (CustomChannelEvent) {
|
|
45
|
+
CustomChannelEvent["IncidentCreated"] = "on-call.incident.created";
|
|
46
|
+
CustomChannelEvent["AlertCreated"] = "on-call.alert.created";
|
|
47
|
+
CustomChannelEvent["IncidentEpisodeCreated"] = "on-call.incidentEpisode.created";
|
|
48
|
+
CustomChannelEvent["AlertEpisodeCreated"] = "on-call.alertEpisode.created";
|
|
49
|
+
/*
|
|
50
|
+
* A notification that is not a page - an owner's, a note posted, a shift
|
|
51
|
+
* starting - for a person who turned on custom channels for it in their
|
|
52
|
+
* notification settings (UserNotificationSetting.alertByCustomChannel).
|
|
53
|
+
*/
|
|
54
|
+
CustomChannelEvent["Notification"] = "notification";
|
|
55
|
+
// Sent by Send test, from the admin's page or a person's own.
|
|
56
|
+
CustomChannelEvent["Test"] = "test";
|
|
57
|
+
})(CustomChannelEvent || (exports.CustomChannelEvent = CustomChannelEvent = {}));
|
|
58
|
+
// What the record a page is about is, in `recordType`.
|
|
59
|
+
var CustomChannelRecordType;
|
|
60
|
+
(function (CustomChannelRecordType) {
|
|
61
|
+
CustomChannelRecordType["Incident"] = "incident";
|
|
62
|
+
CustomChannelRecordType["Alert"] = "alert";
|
|
63
|
+
CustomChannelRecordType["IncidentEpisode"] = "incidentEpisode";
|
|
64
|
+
CustomChannelRecordType["AlertEpisode"] = "alertEpisode";
|
|
65
|
+
})(CustomChannelRecordType || (exports.CustomChannelRecordType = CustomChannelRecordType = {}));
|
|
66
|
+
/*
|
|
67
|
+
* What a channel's service can do about a page, each by a POST to the link of
|
|
68
|
+
* that name in `actions`: acknowledge it, escalate it to the next level (the
|
|
69
|
+
* person cannot take it - the "Can't take it? Escalate" of every other
|
|
70
|
+
* channel), or resolve the record.
|
|
71
|
+
*/
|
|
72
|
+
var CustomChannelAction;
|
|
73
|
+
(function (CustomChannelAction) {
|
|
74
|
+
CustomChannelAction["Acknowledge"] = "acknowledge";
|
|
75
|
+
CustomChannelAction["Escalate"] = "escalate";
|
|
76
|
+
CustomChannelAction["Resolve"] = "resolve";
|
|
77
|
+
})(CustomChannelAction || (exports.CustomChannelAction = CustomChannelAction = {}));
|
|
78
|
+
exports.CUSTOM_CHANNEL_ACTIONS = [
|
|
79
|
+
CustomChannelAction.Acknowledge,
|
|
80
|
+
CustomChannelAction.Escalate,
|
|
81
|
+
CustomChannelAction.Resolve,
|
|
82
|
+
];
|
|
83
|
+
const isCustomChannelAction = (value) => {
|
|
84
|
+
return exports.CUSTOM_CHANNEL_ACTIONS.includes(value);
|
|
85
|
+
};
|
|
86
|
+
exports.isCustomChannelAction = isCustomChannelAction;
|
|
87
|
+
/*
|
|
88
|
+
* What an action did, in the answer to its POST. "already" answers are not
|
|
89
|
+
* errors: somebody else got there first, or the same button was pressed
|
|
90
|
+
* twice.
|
|
91
|
+
*/
|
|
92
|
+
var CustomChannelActionResult;
|
|
93
|
+
(function (CustomChannelActionResult) {
|
|
94
|
+
CustomChannelActionResult["Acknowledged"] = "acknowledged";
|
|
95
|
+
CustomChannelActionResult["AlreadyAcknowledged"] = "alreadyAcknowledged";
|
|
96
|
+
CustomChannelActionResult["Escalated"] = "escalated";
|
|
97
|
+
CustomChannelActionResult["NotEscalated"] = "notEscalated";
|
|
98
|
+
CustomChannelActionResult["Resolved"] = "resolved";
|
|
99
|
+
CustomChannelActionResult["AlreadyResolved"] = "alreadyResolved";
|
|
100
|
+
})(CustomChannelActionResult || (exports.CustomChannelActionResult = CustomChannelActionResult = {}));
|
|
101
|
+
// The event and record type of an on-call page, by what fired it.
|
|
102
|
+
const getCustomChannelEventFor = (eventType) => {
|
|
103
|
+
switch (eventType) {
|
|
104
|
+
case UserNotificationEventType_1.default.IncidentCreated:
|
|
105
|
+
return {
|
|
106
|
+
event: CustomChannelEvent.IncidentCreated,
|
|
107
|
+
recordType: CustomChannelRecordType.Incident,
|
|
108
|
+
};
|
|
109
|
+
case UserNotificationEventType_1.default.AlertCreated:
|
|
110
|
+
return {
|
|
111
|
+
event: CustomChannelEvent.AlertCreated,
|
|
112
|
+
recordType: CustomChannelRecordType.Alert,
|
|
113
|
+
};
|
|
114
|
+
case UserNotificationEventType_1.default.IncidentEpisodeCreated:
|
|
115
|
+
return {
|
|
116
|
+
event: CustomChannelEvent.IncidentEpisodeCreated,
|
|
117
|
+
recordType: CustomChannelRecordType.IncidentEpisode,
|
|
118
|
+
};
|
|
119
|
+
case UserNotificationEventType_1.default.AlertEpisodeCreated:
|
|
120
|
+
return {
|
|
121
|
+
event: CustomChannelEvent.AlertEpisodeCreated,
|
|
122
|
+
recordType: CustomChannelRecordType.AlertEpisode,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.getCustomChannelEventFor = getCustomChannelEventFor;
|
|
127
|
+
const toReferenceJson = (reference) => {
|
|
128
|
+
if (!reference) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
id: reference.id,
|
|
133
|
+
name: reference.name,
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
// The body of a request about an on-call page.
|
|
137
|
+
const buildCustomChannelPagePayload = (input) => {
|
|
138
|
+
const [title, message, description] = (0, MessageFit_1.fitTextsToBudget)([input.title, input.message, input.record.description], exports.MAX_CUSTOM_CHANNEL_TEXT_LENGTH);
|
|
139
|
+
return {
|
|
140
|
+
version: exports.CUSTOM_CHANNEL_PAYLOAD_VERSION,
|
|
141
|
+
event: input.event,
|
|
142
|
+
notificationId: input.notificationId,
|
|
143
|
+
sentAt: input.sentAt.toISOString(),
|
|
144
|
+
channel: toReferenceJson(input.channel),
|
|
145
|
+
title: title || "",
|
|
146
|
+
message: message || "",
|
|
147
|
+
project: toReferenceJson(input.project),
|
|
148
|
+
team: toReferenceJson(input.team),
|
|
149
|
+
user: {
|
|
150
|
+
id: input.user.id,
|
|
151
|
+
name: input.user.name,
|
|
152
|
+
email: input.user.email,
|
|
153
|
+
},
|
|
154
|
+
recordType: input.recordType,
|
|
155
|
+
record: {
|
|
156
|
+
id: input.record.id,
|
|
157
|
+
number: input.record.number,
|
|
158
|
+
title: input.record.title,
|
|
159
|
+
description: description || "",
|
|
160
|
+
severity: input.record.severity,
|
|
161
|
+
state: input.record.state,
|
|
162
|
+
url: input.record.url,
|
|
163
|
+
},
|
|
164
|
+
onCallPolicy: toReferenceJson(input.onCallPolicy),
|
|
165
|
+
escalationRule: toReferenceJson(input.escalationRule),
|
|
166
|
+
isPageAgain: input.isPageAgain,
|
|
167
|
+
actions: {
|
|
168
|
+
[CustomChannelAction.Acknowledge]: input.actions[CustomChannelAction.Acknowledge],
|
|
169
|
+
[CustomChannelAction.Escalate]: input.actions[CustomChannelAction.Escalate],
|
|
170
|
+
[CustomChannelAction.Resolve]: input.actions[CustomChannelAction.Resolve],
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
exports.buildCustomChannelPagePayload = buildCustomChannelPagePayload;
|
|
175
|
+
/*
|
|
176
|
+
* The body of Send test: the same shape with no record and nothing to act
|
|
177
|
+
* on, so a service can be tried against it before a real page arrives.
|
|
178
|
+
*/
|
|
179
|
+
const buildCustomChannelTestPayload = (input) => {
|
|
180
|
+
return {
|
|
181
|
+
version: exports.CUSTOM_CHANNEL_PAYLOAD_VERSION,
|
|
182
|
+
event: CustomChannelEvent.Test,
|
|
183
|
+
notificationId: null,
|
|
184
|
+
sentAt: input.sentAt.toISOString(),
|
|
185
|
+
channel: toReferenceJson(input.channel),
|
|
186
|
+
title: `Test from OneUptime: ${input.channel.name}`,
|
|
187
|
+
message: `This is a test of the ${input.channel.name} custom channel for ${input.user.name || input.user.email}. On-call pages to this person will arrive like this.`,
|
|
188
|
+
project: toReferenceJson(input.project),
|
|
189
|
+
team: null,
|
|
190
|
+
user: {
|
|
191
|
+
id: input.user.id,
|
|
192
|
+
name: input.user.name,
|
|
193
|
+
email: input.user.email,
|
|
194
|
+
},
|
|
195
|
+
recordType: null,
|
|
196
|
+
record: null,
|
|
197
|
+
onCallPolicy: null,
|
|
198
|
+
escalationRule: null,
|
|
199
|
+
isPageAgain: false,
|
|
200
|
+
actions: null,
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
exports.buildCustomChannelTestPayload = buildCustomChannelTestPayload;
|
|
204
|
+
/*
|
|
205
|
+
* The body of a notification that is not a page: the same shape, with no
|
|
206
|
+
* record and nothing to act on, what it is about in `notificationType` and,
|
|
207
|
+
* when it links somewhere, where to read more in `url`.
|
|
208
|
+
*/
|
|
209
|
+
const buildCustomChannelNotificationPayload = (input) => {
|
|
210
|
+
const [title, message] = (0, MessageFit_1.fitTextsToBudget)([input.title, input.message], exports.MAX_CUSTOM_CHANNEL_TEXT_LENGTH);
|
|
211
|
+
return {
|
|
212
|
+
version: exports.CUSTOM_CHANNEL_PAYLOAD_VERSION,
|
|
213
|
+
event: CustomChannelEvent.Notification,
|
|
214
|
+
notificationId: null,
|
|
215
|
+
sentAt: input.sentAt.toISOString(),
|
|
216
|
+
channel: toReferenceJson(input.channel),
|
|
217
|
+
title: title || "",
|
|
218
|
+
message: message || "",
|
|
219
|
+
project: toReferenceJson(input.project),
|
|
220
|
+
team: null,
|
|
221
|
+
user: {
|
|
222
|
+
id: input.user.id,
|
|
223
|
+
name: input.user.name,
|
|
224
|
+
email: input.user.email,
|
|
225
|
+
},
|
|
226
|
+
recordType: null,
|
|
227
|
+
record: null,
|
|
228
|
+
onCallPolicy: null,
|
|
229
|
+
escalationRule: null,
|
|
230
|
+
isPageAgain: false,
|
|
231
|
+
actions: null,
|
|
232
|
+
notificationType: input.notificationType,
|
|
233
|
+
url: input.url || null,
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
exports.buildCustomChannelNotificationPayload = buildCustomChannelNotificationPayload;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import commonJsModule from "./CustomNotificationChannelPayload.js";
|
|
2
|
+
export const CUSTOM_CHANNEL_ACTIONS = commonJsModule.CUSTOM_CHANNEL_ACTIONS;
|
|
3
|
+
export const CUSTOM_CHANNEL_EVENT_HEADER = commonJsModule.CUSTOM_CHANNEL_EVENT_HEADER;
|
|
4
|
+
export const CUSTOM_CHANNEL_METHOD_LABEL = commonJsModule.CUSTOM_CHANNEL_METHOD_LABEL;
|
|
5
|
+
export const CUSTOM_CHANNEL_PAYLOAD_VERSION = commonJsModule.CUSTOM_CHANNEL_PAYLOAD_VERSION;
|
|
6
|
+
export const CUSTOM_CHANNEL_SIGNATURE_HEADER = commonJsModule.CUSTOM_CHANNEL_SIGNATURE_HEADER;
|
|
7
|
+
export const CustomChannelAction = commonJsModule.CustomChannelAction;
|
|
8
|
+
export const CustomChannelActionResult = commonJsModule.CustomChannelActionResult;
|
|
9
|
+
export const CustomChannelEvent = commonJsModule.CustomChannelEvent;
|
|
10
|
+
export const CustomChannelRecordType = commonJsModule.CustomChannelRecordType;
|
|
11
|
+
export const MAX_CUSTOM_CHANNEL_TEXT_LENGTH = commonJsModule.MAX_CUSTOM_CHANNEL_TEXT_LENGTH;
|
|
12
|
+
export const buildCustomChannelNotificationPayload = commonJsModule.buildCustomChannelNotificationPayload;
|
|
13
|
+
export const buildCustomChannelPagePayload = commonJsModule.buildCustomChannelPagePayload;
|
|
14
|
+
export const buildCustomChannelTestPayload = commonJsModule.buildCustomChannelTestPayload;
|
|
15
|
+
export const getCustomChannelEventFor = commonJsModule.getCustomChannelEventFor;
|
|
16
|
+
export const isCustomChannelAction = commonJsModule.isCustomChannelAction;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DashboardPlaylistDashboard {
|
|
2
|
+
dashboardId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD: string;
|
|
5
|
+
export declare const DASHBOARD_PLAYLIST_MAX_DASHBOARDS: number;
|
|
6
|
+
export declare const DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS: number;
|
|
7
|
+
export declare const DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS: number;
|
|
8
|
+
export declare const DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS: number;
|
|
9
|
+
export declare const DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS: ReadonlyArray<number>;
|
|
10
|
+
export declare const DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM: string;
|
|
11
|
+
export declare const DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM: string;
|
|
12
|
+
export declare const DASHBOARD_PLAYLIST_INTERVAL_PROBLEM: string;
|
|
13
|
+
export declare function getDashboardPlaylistEntryProblem(index: number): string;
|
|
14
|
+
export declare function readDashboardPlaylistDashboards(value: unknown): Array<DashboardPlaylistDashboard>;
|
|
15
|
+
export declare function getDashboardPlaylistDashboardsProblem(value: unknown): string | null;
|
|
16
|
+
export declare function toStoredDashboardPlaylistDashboards(value: unknown): Array<DashboardPlaylistDashboard>;
|
|
17
|
+
export declare function isDashboardPlaylistIntervalInSeconds(value: unknown): boolean;
|
|
18
|
+
export declare function getDashboardPlaylistIntervalProblem(value: unknown): string | null;
|
|
19
|
+
export declare function readDashboardPlaylistIntervalInSeconds(value: unknown): number;
|
|
20
|
+
export declare function getDashboardPlaylistIntervalChoices(currentIntervalInSeconds?: number | null | undefined): Array<number>;
|
|
21
|
+
export declare function isSameDashboardId(a: string, b: string): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DashboardPlaylistDashboard {
|
|
2
|
+
dashboardId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD: string;
|
|
5
|
+
export declare const DASHBOARD_PLAYLIST_MAX_DASHBOARDS: number;
|
|
6
|
+
export declare const DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS: number;
|
|
7
|
+
export declare const DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS: number;
|
|
8
|
+
export declare const DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS: number;
|
|
9
|
+
export declare const DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS: ReadonlyArray<number>;
|
|
10
|
+
export declare const DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM: string;
|
|
11
|
+
export declare const DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM: string;
|
|
12
|
+
export declare const DASHBOARD_PLAYLIST_INTERVAL_PROBLEM: string;
|
|
13
|
+
export declare function getDashboardPlaylistEntryProblem(index: number): string;
|
|
14
|
+
export declare function readDashboardPlaylistDashboards(value: unknown): Array<DashboardPlaylistDashboard>;
|
|
15
|
+
export declare function getDashboardPlaylistDashboardsProblem(value: unknown): string | null;
|
|
16
|
+
export declare function toStoredDashboardPlaylistDashboards(value: unknown): Array<DashboardPlaylistDashboard>;
|
|
17
|
+
export declare function isDashboardPlaylistIntervalInSeconds(value: unknown): boolean;
|
|
18
|
+
export declare function getDashboardPlaylistIntervalProblem(value: unknown): string | null;
|
|
19
|
+
export declare function readDashboardPlaylistIntervalInSeconds(value: unknown): number;
|
|
20
|
+
export declare function getDashboardPlaylistIntervalChoices(currentIntervalInSeconds?: number | null | undefined): Array<number>;
|
|
21
|
+
export declare function isSameDashboardId(a: string, b: string): boolean;
|