@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,197 @@
|
|
|
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.DASHBOARD_PLAYLIST_INTERVAL_PROBLEM = exports.DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM = exports.DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM = exports.DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS = exports.DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS = exports.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS = exports.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS = exports.DASHBOARD_PLAYLIST_MAX_DASHBOARDS = exports.DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD = void 0;
|
|
7
|
+
exports.getDashboardPlaylistEntryProblem = getDashboardPlaylistEntryProblem;
|
|
8
|
+
exports.readDashboardPlaylistDashboards = readDashboardPlaylistDashboards;
|
|
9
|
+
exports.getDashboardPlaylistDashboardsProblem = getDashboardPlaylistDashboardsProblem;
|
|
10
|
+
exports.toStoredDashboardPlaylistDashboards = toStoredDashboardPlaylistDashboards;
|
|
11
|
+
exports.isDashboardPlaylistIntervalInSeconds = isDashboardPlaylistIntervalInSeconds;
|
|
12
|
+
exports.getDashboardPlaylistIntervalProblem = getDashboardPlaylistIntervalProblem;
|
|
13
|
+
exports.readDashboardPlaylistIntervalInSeconds = readDashboardPlaylistIntervalInSeconds;
|
|
14
|
+
exports.getDashboardPlaylistIntervalChoices = getDashboardPlaylistIntervalChoices;
|
|
15
|
+
exports.isSameDashboardId = isSameDashboardId;
|
|
16
|
+
const ObjectID_1 = __importDefault(require("../ObjectID"));
|
|
17
|
+
// The one key an entry of the list has.
|
|
18
|
+
exports.DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD = "dashboardId";
|
|
19
|
+
// More than any wall shows in a rotation, and few enough to read at once.
|
|
20
|
+
exports.DASHBOARD_PLAYLIST_MAX_DASHBOARDS = 100;
|
|
21
|
+
/*
|
|
22
|
+
* How long each dashboard is shown, in seconds. Below ten seconds a
|
|
23
|
+
* dashboard is gone before its widgets have read their data; a day is more
|
|
24
|
+
* than any rotation needs.
|
|
25
|
+
*/
|
|
26
|
+
exports.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS = 10;
|
|
27
|
+
exports.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS = 24 * 60 * 60;
|
|
28
|
+
// What a new playlist shows each dashboard for: a minute.
|
|
29
|
+
exports.DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS = 60;
|
|
30
|
+
/*
|
|
31
|
+
* The times the playlist form offers, shortest first. The API takes any
|
|
32
|
+
* whole number of seconds between the minimum and the maximum; a playlist
|
|
33
|
+
* saved with one that is not offered here shows it as an extra choice.
|
|
34
|
+
*/
|
|
35
|
+
exports.DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS = [15, 30, 60, 120, 300, 600, 900, 1800, 3600];
|
|
36
|
+
exports.DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM = 'Dashboards must be a list like [{"dashboardId": "<dashboard id>"}], in the order they are shown.';
|
|
37
|
+
exports.DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM = `A playlist can show at most ${exports.DASHBOARD_PLAYLIST_MAX_DASHBOARDS} dashboards.`;
|
|
38
|
+
exports.DASHBOARD_PLAYLIST_INTERVAL_PROBLEM = `Interval must be a whole number of seconds, from ${exports.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS} to ${exports.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS} (a day).`;
|
|
39
|
+
/*
|
|
40
|
+
* Why entry `index` (0-based) of the list cannot be saved: it is no object
|
|
41
|
+
* with a dashboard's id alone.
|
|
42
|
+
*/
|
|
43
|
+
function getDashboardPlaylistEntryProblem(index) {
|
|
44
|
+
return `Dashboard ${index + 1} of the list must be {"dashboardId": "<dashboard id>"}, with a dashboard's id.`;
|
|
45
|
+
}
|
|
46
|
+
function isPlainObject(value) {
|
|
47
|
+
return (typeof value === "object" &&
|
|
48
|
+
value !== null &&
|
|
49
|
+
!Array.isArray(value) &&
|
|
50
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
51
|
+
}
|
|
52
|
+
/*
|
|
53
|
+
* A value as the list it holds: a list as is, JSON text as the list it
|
|
54
|
+
* spells (a form or an API client may send the column as text), nothing as
|
|
55
|
+
* an empty list. Null for anything else.
|
|
56
|
+
*/
|
|
57
|
+
function asList(value) {
|
|
58
|
+
if (value === undefined || value === null) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
if (typeof value === "string") {
|
|
62
|
+
if (value.trim() === "") {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(value);
|
|
67
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
68
|
+
}
|
|
69
|
+
catch (_a) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return Array.isArray(value) ? value : null;
|
|
74
|
+
}
|
|
75
|
+
// The dashboard id an entry names, or null when it is not an entry.
|
|
76
|
+
function readEntryDashboardId(entry) {
|
|
77
|
+
if (!isPlainObject(entry)) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const dashboardId = entry[exports.DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD];
|
|
81
|
+
if (typeof dashboardId !== "string" || !ObjectID_1.default.isValidUUID(dashboardId)) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return dashboardId;
|
|
85
|
+
}
|
|
86
|
+
/*
|
|
87
|
+
* The playlist's dashboards as stored, in order, for reading: whatever the
|
|
88
|
+
* column holds, every entry that names a dashboard, at most
|
|
89
|
+
* DASHBOARD_PLAYLIST_MAX_DASHBOARDS. Anything else is left out without a
|
|
90
|
+
* word - a reader never fails on a value it did not write.
|
|
91
|
+
*/
|
|
92
|
+
function readDashboardPlaylistDashboards(value) {
|
|
93
|
+
const list = asList(value);
|
|
94
|
+
if (!list) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
const dashboards = [];
|
|
98
|
+
for (const entry of list) {
|
|
99
|
+
const dashboardId = readEntryDashboardId(entry);
|
|
100
|
+
if (dashboardId) {
|
|
101
|
+
dashboards.push({ dashboardId: dashboardId });
|
|
102
|
+
}
|
|
103
|
+
if (dashboards.length >= exports.DASHBOARD_PLAYLIST_MAX_DASHBOARDS) {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return dashboards;
|
|
108
|
+
}
|
|
109
|
+
/*
|
|
110
|
+
* Why a write's `dashboards` cannot be saved, or null when it can: a list
|
|
111
|
+
* (or its JSON text) of at most DASHBOARD_PLAYLIST_MAX_DASHBOARDS entries,
|
|
112
|
+
* each {"dashboardId": "<id>"} and nothing else, or nothing at all, which
|
|
113
|
+
* is an empty playlist. Strict where reading is lenient: an API or
|
|
114
|
+
* Terraform user hears at once what a reader would have skipped.
|
|
115
|
+
*/
|
|
116
|
+
function getDashboardPlaylistDashboardsProblem(value) {
|
|
117
|
+
const list = asList(value);
|
|
118
|
+
if (!list) {
|
|
119
|
+
return exports.DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM;
|
|
120
|
+
}
|
|
121
|
+
if (list.length > exports.DASHBOARD_PLAYLIST_MAX_DASHBOARDS) {
|
|
122
|
+
return exports.DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM;
|
|
123
|
+
}
|
|
124
|
+
for (let index = 0; index < list.length; index++) {
|
|
125
|
+
const entry = list[index];
|
|
126
|
+
if (!readEntryDashboardId(entry) ||
|
|
127
|
+
Object.keys(entry).length !== 1) {
|
|
128
|
+
return getDashboardPlaylistEntryProblem(index);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
/*
|
|
134
|
+
* The list a write stores: the entries it was checked for, as a list
|
|
135
|
+
* (JSON text is stored as the list it spells, nothing as an empty list).
|
|
136
|
+
* Call it only once getDashboardPlaylistDashboardsProblem found none.
|
|
137
|
+
*/
|
|
138
|
+
function toStoredDashboardPlaylistDashboards(value) {
|
|
139
|
+
return readDashboardPlaylistDashboards(value);
|
|
140
|
+
}
|
|
141
|
+
// Whether a number is a time a playlist may show each dashboard for.
|
|
142
|
+
function isDashboardPlaylistIntervalInSeconds(value) {
|
|
143
|
+
return (typeof value === "number" &&
|
|
144
|
+
Number.isInteger(value) &&
|
|
145
|
+
value >= exports.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS &&
|
|
146
|
+
value <= exports.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS);
|
|
147
|
+
}
|
|
148
|
+
/*
|
|
149
|
+
* Why a write's `intervalInSeconds` cannot be saved, or null when it can:
|
|
150
|
+
* a whole number of seconds from the minimum to the maximum, or nothing,
|
|
151
|
+
* which keeps what is stored (a create stores the default).
|
|
152
|
+
*/
|
|
153
|
+
function getDashboardPlaylistIntervalProblem(value) {
|
|
154
|
+
if (value === undefined) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
return isDashboardPlaylistIntervalInSeconds(value)
|
|
158
|
+
? null
|
|
159
|
+
: exports.DASHBOARD_PLAYLIST_INTERVAL_PROBLEM;
|
|
160
|
+
}
|
|
161
|
+
/*
|
|
162
|
+
* How long the player shows each dashboard, in seconds, from what is
|
|
163
|
+
* stored: the stored time, held to the minimum and the maximum, else the
|
|
164
|
+
* default.
|
|
165
|
+
*/
|
|
166
|
+
function readDashboardPlaylistIntervalInSeconds(value) {
|
|
167
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
168
|
+
return exports.DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS;
|
|
169
|
+
}
|
|
170
|
+
return Math.min(exports.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS, Math.max(exports.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS, Math.round(value)));
|
|
171
|
+
}
|
|
172
|
+
/*
|
|
173
|
+
* The intervals the form offers: the choices, and the playlist's own time
|
|
174
|
+
* when it is none of them (set through the API), in order.
|
|
175
|
+
*/
|
|
176
|
+
function getDashboardPlaylistIntervalChoices(currentIntervalInSeconds) {
|
|
177
|
+
const choices = [
|
|
178
|
+
...exports.DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS,
|
|
179
|
+
];
|
|
180
|
+
if (currentIntervalInSeconds !== undefined &&
|
|
181
|
+
currentIntervalInSeconds !== null &&
|
|
182
|
+
isDashboardPlaylistIntervalInSeconds(currentIntervalInSeconds) &&
|
|
183
|
+
!choices.includes(currentIntervalInSeconds)) {
|
|
184
|
+
choices.push(currentIntervalInSeconds);
|
|
185
|
+
choices.sort((a, b) => {
|
|
186
|
+
return a - b;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return choices;
|
|
190
|
+
}
|
|
191
|
+
/*
|
|
192
|
+
* Whether two ids name the same dashboard: ids are compared as the API
|
|
193
|
+
* compares them, without regard to case.
|
|
194
|
+
*/
|
|
195
|
+
function isSameDashboardId(a, b) {
|
|
196
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
197
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import commonJsModule from "./DashboardPlaylist.js";
|
|
2
|
+
export const DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM = commonJsModule.DASHBOARD_PLAYLIST_DASHBOARDS_SHAPE_PROBLEM;
|
|
3
|
+
export const DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD = commonJsModule.DASHBOARD_PLAYLIST_DASHBOARD_ID_FIELD;
|
|
4
|
+
export const DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS = commonJsModule.DASHBOARD_PLAYLIST_DEFAULT_INTERVAL_IN_SECONDS;
|
|
5
|
+
export const DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS = commonJsModule.DASHBOARD_PLAYLIST_INTERVAL_CHOICES_IN_SECONDS;
|
|
6
|
+
export const DASHBOARD_PLAYLIST_INTERVAL_PROBLEM = commonJsModule.DASHBOARD_PLAYLIST_INTERVAL_PROBLEM;
|
|
7
|
+
export const DASHBOARD_PLAYLIST_MAX_DASHBOARDS = commonJsModule.DASHBOARD_PLAYLIST_MAX_DASHBOARDS;
|
|
8
|
+
export const DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS = commonJsModule.DASHBOARD_PLAYLIST_MAX_INTERVAL_IN_SECONDS;
|
|
9
|
+
export const DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS = commonJsModule.DASHBOARD_PLAYLIST_MIN_INTERVAL_IN_SECONDS;
|
|
10
|
+
export const DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM = commonJsModule.DASHBOARD_PLAYLIST_TOO_MANY_DASHBOARDS_PROBLEM;
|
|
11
|
+
export const getDashboardPlaylistDashboardsProblem = commonJsModule.getDashboardPlaylistDashboardsProblem;
|
|
12
|
+
export const getDashboardPlaylistEntryProblem = commonJsModule.getDashboardPlaylistEntryProblem;
|
|
13
|
+
export const getDashboardPlaylistIntervalChoices = commonJsModule.getDashboardPlaylistIntervalChoices;
|
|
14
|
+
export const getDashboardPlaylistIntervalProblem = commonJsModule.getDashboardPlaylistIntervalProblem;
|
|
15
|
+
export const isDashboardPlaylistIntervalInSeconds = commonJsModule.isDashboardPlaylistIntervalInSeconds;
|
|
16
|
+
export const isSameDashboardId = commonJsModule.isSameDashboardId;
|
|
17
|
+
export const readDashboardPlaylistDashboards = commonJsModule.readDashboardPlaylistDashboards;
|
|
18
|
+
export const readDashboardPlaylistIntervalInSeconds = commonJsModule.readDashboardPlaylistIntervalInSeconds;
|
|
19
|
+
export const toStoredDashboardPlaylistDashboards = commonJsModule.toStoredDashboardPlaylistDashboards;
|
|
@@ -36,3 +36,11 @@ type GetTableColumnFunction = <T extends BaseModel>(target: T, propertyKey: stri
|
|
|
36
36
|
export declare const getTableColumn: GetTableColumnFunction;
|
|
37
37
|
type GetTableColumnsFunction = <T extends BaseModel>(target: T) => Dictionary<TableColumnMetadata>;
|
|
38
38
|
export declare const getTableColumns: GetTableColumnsFunction;
|
|
39
|
+
export interface TableColumnNames {
|
|
40
|
+
all: ReadonlyArray<string>;
|
|
41
|
+
encrypted: ReadonlyArray<string>;
|
|
42
|
+
hashed: ReadonlyArray<string>;
|
|
43
|
+
unique: ReadonlyArray<string>;
|
|
44
|
+
required: ReadonlyArray<string>;
|
|
45
|
+
}
|
|
46
|
+
export declare const getTableColumnNames: <T extends BaseModel>(target: T) => TableColumnNames;
|
|
@@ -36,3 +36,11 @@ type GetTableColumnFunction = <T extends BaseModel>(target: T, propertyKey: stri
|
|
|
36
36
|
export declare const getTableColumn: GetTableColumnFunction;
|
|
37
37
|
type GetTableColumnsFunction = <T extends BaseModel>(target: T) => Dictionary<TableColumnMetadata>;
|
|
38
38
|
export declare const getTableColumns: GetTableColumnsFunction;
|
|
39
|
+
export interface TableColumnNames {
|
|
40
|
+
all: ReadonlyArray<string>;
|
|
41
|
+
encrypted: ReadonlyArray<string>;
|
|
42
|
+
hashed: ReadonlyArray<string>;
|
|
43
|
+
unique: ReadonlyArray<string>;
|
|
44
|
+
required: ReadonlyArray<string>;
|
|
45
|
+
}
|
|
46
|
+
export declare const getTableColumnNames: <T extends BaseModel>(target: T) => TableColumnNames;
|
|
@@ -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.getTableColumns = exports.getTableColumn = void 0;
|
|
6
|
+
exports.getTableColumnNames = exports.getTableColumns = exports.getTableColumn = void 0;
|
|
7
7
|
const CanonicalModelInstance_1 = __importDefault(require("./CanonicalModelInstance"));
|
|
8
8
|
const UserAttribution_1 = __importDefault(require("./UserAttribution"));
|
|
9
9
|
require("reflect-metadata");
|
|
@@ -47,35 +47,81 @@ exports.getTableColumn = getTableColumn;
|
|
|
47
47
|
* model would lose it. See CanonicalModelInstance.ts.
|
|
48
48
|
*/
|
|
49
49
|
const tableColumnsCache = new WeakMap();
|
|
50
|
-
|
|
50
|
+
/*
|
|
51
|
+
* The column dictionary of `target`'s class, and whether it is the one
|
|
52
|
+
* cached for the class. Never handed out as is: getTableColumns copies it,
|
|
53
|
+
* and getTableColumnNames reads lists from it.
|
|
54
|
+
*/
|
|
55
|
+
function readTableColumns(target) {
|
|
51
56
|
const modelClass = target.constructor;
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cached = dictonary;
|
|
65
|
-
/*
|
|
66
|
-
* No canonical instance (see CanonicalModelInstance): answer from the
|
|
67
|
-
* instance we were handed, but do NOT cache it for the class - that
|
|
68
|
-
* instance may be a mutilated one, and a cached answer outlives it.
|
|
69
|
-
*/
|
|
70
|
-
if (canonical) {
|
|
71
|
-
tableColumnsCache.set(modelClass, cached);
|
|
57
|
+
const cached = tableColumnsCache.get(modelClass);
|
|
58
|
+
if (cached) {
|
|
59
|
+
return { dictionary: cached, isClassCache: true };
|
|
60
|
+
}
|
|
61
|
+
const canonical = (0, CanonicalModelInstance_1.default)(target);
|
|
62
|
+
const metadataSource = canonical || target;
|
|
63
|
+
const dictonary = {};
|
|
64
|
+
const keys = Object.keys(metadataSource);
|
|
65
|
+
for (const key of keys) {
|
|
66
|
+
const metadata = Reflect.getMetadata(tableColumn, metadataSource, key);
|
|
67
|
+
if (metadata) {
|
|
68
|
+
dictonary[key] = resolveModelType(metadata);
|
|
72
69
|
}
|
|
73
70
|
}
|
|
71
|
+
/*
|
|
72
|
+
* No canonical instance (see CanonicalModelInstance): answer from the
|
|
73
|
+
* instance we were handed, but do NOT cache it for the class - that
|
|
74
|
+
* instance may be a mutilated one, and a cached answer outlives it.
|
|
75
|
+
*/
|
|
76
|
+
if (canonical) {
|
|
77
|
+
tableColumnsCache.set(modelClass, dictonary);
|
|
78
|
+
}
|
|
79
|
+
return { dictionary: dictonary, isClassCache: Boolean(canonical) };
|
|
80
|
+
}
|
|
81
|
+
const getTableColumns = (target) => {
|
|
74
82
|
/*
|
|
75
83
|
* Hand out a copy, not the cached dictionary itself: callers mutate the
|
|
76
84
|
* result (the API reference docs delete entries from it), which would
|
|
77
85
|
* otherwise strip columns from every later call for the same class.
|
|
78
86
|
*/
|
|
79
|
-
return Object.assign({},
|
|
87
|
+
return Object.assign({}, readTableColumns(target).dictionary);
|
|
80
88
|
};
|
|
81
89
|
exports.getTableColumns = getTableColumns;
|
|
90
|
+
const tableColumnNamesCache = new WeakMap();
|
|
91
|
+
function namesOf(dictionary) {
|
|
92
|
+
const all = [];
|
|
93
|
+
const encrypted = [];
|
|
94
|
+
const hashed = [];
|
|
95
|
+
const unique = [];
|
|
96
|
+
const required = [];
|
|
97
|
+
for (const key in dictionary) {
|
|
98
|
+
all.push(key);
|
|
99
|
+
const metadata = dictionary[key];
|
|
100
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.encrypted) {
|
|
101
|
+
encrypted.push(key);
|
|
102
|
+
}
|
|
103
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.hashed) {
|
|
104
|
+
hashed.push(key);
|
|
105
|
+
}
|
|
106
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.unique) {
|
|
107
|
+
unique.push(key);
|
|
108
|
+
}
|
|
109
|
+
if (metadata === null || metadata === void 0 ? void 0 : metadata.required) {
|
|
110
|
+
required.push(key);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return { all, encrypted, hashed, unique, required };
|
|
114
|
+
}
|
|
115
|
+
const getTableColumnNames = (target) => {
|
|
116
|
+
const read = readTableColumns(target);
|
|
117
|
+
if (!read.isClassCache) {
|
|
118
|
+
return namesOf(read.dictionary);
|
|
119
|
+
}
|
|
120
|
+
let names = tableColumnNamesCache.get(read.dictionary);
|
|
121
|
+
if (!names) {
|
|
122
|
+
names = namesOf(read.dictionary);
|
|
123
|
+
tableColumnNamesCache.set(read.dictionary, names);
|
|
124
|
+
}
|
|
125
|
+
return names;
|
|
126
|
+
};
|
|
127
|
+
exports.getTableColumnNames = getTableColumnNames;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import commonJsModule from "./TableColumn.js";
|
|
2
2
|
export default commonJsModule.default;
|
|
3
3
|
export const getTableColumn = commonJsModule.getTableColumn;
|
|
4
|
+
export const getTableColumnNames = commonJsModule.getTableColumnNames;
|
|
4
5
|
export const getTableColumns = commonJsModule.getTableColumns;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ObjectID from "./ObjectID.mjs";
|
|
1
2
|
import Permission, { UserPermission } from "./Permission.mjs";
|
|
2
3
|
export interface HeldPermissions {
|
|
3
4
|
allowed: Array<Permission>;
|
|
@@ -17,6 +18,7 @@ export default class HeldPermissionsUtil {
|
|
|
17
18
|
static isAllowRow(row: UserPermission): boolean;
|
|
18
19
|
static hasLabels(row: UserPermission): boolean;
|
|
19
20
|
static isProjectWideRow(row: UserPermission): boolean;
|
|
21
|
+
static getTeamIdsOfRows(rows: ReadonlyArray<UserPermission>): Array<ObjectID>;
|
|
20
22
|
static fromRows(data: {
|
|
21
23
|
rows?: ReadonlyArray<UserPermission> | null | undefined;
|
|
22
24
|
globalPermissions?: ReadonlyArray<Permission> | null | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ObjectID from "./ObjectID";
|
|
1
2
|
import Permission, { UserPermission } from "./Permission";
|
|
2
3
|
export interface HeldPermissions {
|
|
3
4
|
allowed: Array<Permission>;
|
|
@@ -17,6 +18,7 @@ export default class HeldPermissionsUtil {
|
|
|
17
18
|
static isAllowRow(row: UserPermission): boolean;
|
|
18
19
|
static hasLabels(row: UserPermission): boolean;
|
|
19
20
|
static isProjectWideRow(row: UserPermission): boolean;
|
|
21
|
+
static getTeamIdsOfRows(rows: ReadonlyArray<UserPermission>): Array<ObjectID>;
|
|
20
22
|
static fromRows(data: {
|
|
21
23
|
rows?: ReadonlyArray<UserPermission> | null | undefined;
|
|
22
24
|
globalPermissions?: ReadonlyArray<Permission> | null | undefined;
|
package/Types/HeldPermissions.js
CHANGED
|
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.ALWAYS_SELECTABLE_COLUMNS = void 0;
|
|
40
40
|
const PermissionScope_1 = __importDefault(require("./Database/AccessControl/PermissionScope"));
|
|
41
|
+
const ObjectID_1 = __importDefault(require("./ObjectID"));
|
|
41
42
|
const Permission_1 = __importStar(require("./Permission"));
|
|
42
43
|
/*
|
|
43
44
|
* The columns every select may name, whatever the caller holds: the server
|
|
@@ -63,19 +64,42 @@ class HeldPermissionsUtil {
|
|
|
63
64
|
return Boolean(row.labelIds && row.labelIds.length > 0);
|
|
64
65
|
}
|
|
65
66
|
/*
|
|
66
|
-
* Whether an allow row reaches every record of the project:
|
|
67
|
-
* Labels (or a legacy row without a scope)
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* Whether an allow row reaches every record of the project: a row with no
|
|
68
|
+
* labels on it, at scope All or Labels (or a legacy row without a scope),
|
|
69
|
+
* and an All row of a role that cannot be scoped. Labels narrow every
|
|
70
|
+
* other row, one stored as All too (PermissionHelper.isLimitedToLabels).
|
|
71
|
+
* An Owned row reaches only owned records - except on a role that cannot
|
|
72
|
+
* be scoped, which the read checks treat as project-wide whatever its row
|
|
73
|
+
* says.
|
|
70
74
|
*/
|
|
71
75
|
static isProjectWideRow(row) {
|
|
72
|
-
if (row.scope === PermissionScope_1.default.All) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
76
|
if (row.scope === PermissionScope_1.default.Owned) {
|
|
76
77
|
return !Permission_1.PermissionHelper.isScopeApplicable(row.permission);
|
|
77
78
|
}
|
|
78
|
-
return !
|
|
79
|
+
return !Permission_1.PermissionHelper.isLimitedToLabels(row);
|
|
80
|
+
}
|
|
81
|
+
/*
|
|
82
|
+
* The teams `rows` are granted on (UserPermission.teamId), each once, in
|
|
83
|
+
* the order the rows name them: the teams whose records an Owned row
|
|
84
|
+
* reaches, beside the caller's own - each team's grant reaching what that
|
|
85
|
+
* team owns, never what only another team of the caller's owns. A row no
|
|
86
|
+
* team grants names none.
|
|
87
|
+
*/
|
|
88
|
+
static getTeamIdsOfRows(rows) {
|
|
89
|
+
const seen = new Set();
|
|
90
|
+
const teamIds = [];
|
|
91
|
+
for (const row of rows) {
|
|
92
|
+
if (!row || !row.teamId) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const key = row.teamId.toString().toLowerCase();
|
|
96
|
+
if (seen.has(key)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
seen.add(key);
|
|
100
|
+
teamIds.push(new ObjectID_1.default(row.teamId.toString()));
|
|
101
|
+
}
|
|
102
|
+
return teamIds;
|
|
79
103
|
}
|
|
80
104
|
/*
|
|
81
105
|
* What `rows` (a caller's permission rows in one project) and
|
|
@@ -147,6 +147,9 @@ declare enum IconProp {
|
|
|
147
147
|
ExclaimationCircle = "ExclaimationCircle",
|
|
148
148
|
WhatsApp = "WhatsApp",
|
|
149
149
|
Telegram = "Telegram",
|
|
150
|
+
Discord = "Discord",
|
|
151
|
+
Mattermost = "Mattermost",
|
|
152
|
+
Terraform = "Terraform",
|
|
150
153
|
Brain = "Brain",
|
|
151
154
|
FlowDiagram = "FlowDiagram",
|
|
152
155
|
GitHub = "GitHub",
|
package/Types/Icon/IconProp.d.ts
CHANGED
|
@@ -147,6 +147,9 @@ declare enum IconProp {
|
|
|
147
147
|
ExclaimationCircle = "ExclaimationCircle",
|
|
148
148
|
WhatsApp = "WhatsApp",
|
|
149
149
|
Telegram = "Telegram",
|
|
150
|
+
Discord = "Discord",
|
|
151
|
+
Mattermost = "Mattermost",
|
|
152
|
+
Terraform = "Terraform",
|
|
150
153
|
Brain = "Brain",
|
|
151
154
|
FlowDiagram = "FlowDiagram",
|
|
152
155
|
GitHub = "GitHub",
|
package/Types/Icon/IconProp.js
CHANGED
|
@@ -151,6 +151,10 @@ var IconProp;
|
|
|
151
151
|
IconProp["ExclaimationCircle"] = "ExclaimationCircle";
|
|
152
152
|
IconProp["WhatsApp"] = "WhatsApp";
|
|
153
153
|
IconProp["Telegram"] = "Telegram";
|
|
154
|
+
// The brands' official one-colour marks, as Slack's and WhatsApp's are.
|
|
155
|
+
IconProp["Discord"] = "Discord";
|
|
156
|
+
IconProp["Mattermost"] = "Mattermost";
|
|
157
|
+
IconProp["Terraform"] = "Terraform";
|
|
154
158
|
IconProp["Brain"] = "Brain";
|
|
155
159
|
IconProp["FlowDiagram"] = "FlowDiagram";
|
|
156
160
|
IconProp["GitHub"] = "GitHub";
|
package/Types/JSONFunctions.js
CHANGED
|
@@ -414,8 +414,23 @@ class JSONFunctions {
|
|
|
414
414
|
}
|
|
415
415
|
return returnArr;
|
|
416
416
|
}
|
|
417
|
+
/*
|
|
418
|
+
* JSON5's grammar is a superset of JSON's, so it reads every JSON text to
|
|
419
|
+
* the same value JSON.parse does - and the engine's JSON.parse is about
|
|
420
|
+
* 25 times faster at it than JSON5's parser, written in JavaScript, for
|
|
421
|
+
* the short texts read here on every signed-in request (a token's payload)
|
|
422
|
+
* and every cache read. So JSON goes to JSON.parse, and only what JSON.parse
|
|
423
|
+
* refuses goes on to JSON5, whose syntax and errors are then what they
|
|
424
|
+
* were. Tests/Types/JSONFunctionsParseFastPath.test.ts holds the two paths
|
|
425
|
+
* to the same values.
|
|
426
|
+
*/
|
|
417
427
|
static parse(val) {
|
|
418
|
-
|
|
428
|
+
try {
|
|
429
|
+
return JSON.parse(val);
|
|
430
|
+
}
|
|
431
|
+
catch (_a) {
|
|
432
|
+
return json5_1.default.parse(val);
|
|
433
|
+
}
|
|
419
434
|
}
|
|
420
435
|
/*
|
|
421
436
|
* Guarding only against an array leaves every OTHER non-object through:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IconProp from "../Icon/IconProp.mjs";
|
|
2
|
+
import ProviderLogo from "../ProviderLogo/ProviderLogo.mjs";
|
|
2
3
|
import LlmConnectionProvider from "./LlmConnectionProvider.mjs";
|
|
3
4
|
export declare enum LlmConnectionKind {
|
|
4
5
|
ProviderAccount = "provider-account",
|
|
@@ -28,6 +29,7 @@ export interface LlmConnectionDefinition {
|
|
|
28
29
|
summary: string;
|
|
29
30
|
hint: string;
|
|
30
31
|
icon: IconProp;
|
|
32
|
+
logo: ProviderLogo;
|
|
31
33
|
genAiProviderName: string;
|
|
32
34
|
defaultServiceName: string;
|
|
33
35
|
docsPath: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IconProp from "../Icon/IconProp";
|
|
2
|
+
import ProviderLogo from "../ProviderLogo/ProviderLogo";
|
|
2
3
|
import LlmConnectionProvider from "./LlmConnectionProvider";
|
|
3
4
|
export declare enum LlmConnectionKind {
|
|
4
5
|
ProviderAccount = "provider-account",
|
|
@@ -28,6 +29,7 @@ export interface LlmConnectionDefinition {
|
|
|
28
29
|
summary: string;
|
|
29
30
|
hint: string;
|
|
30
31
|
icon: IconProp;
|
|
32
|
+
logo: ProviderLogo;
|
|
31
33
|
genAiProviderName: string;
|
|
32
34
|
defaultServiceName: string;
|
|
33
35
|
docsPath: string;
|
|
@@ -9,6 +9,7 @@ exports.getLlmConnectionTitle = getLlmConnectionTitle;
|
|
|
9
9
|
exports.getLlmConnectionDefinitionsOfKind = getLlmConnectionDefinitionsOfKind;
|
|
10
10
|
exports.isCompanyToolProvider = isCompanyToolProvider;
|
|
11
11
|
const IconProp_1 = __importDefault(require("../Icon/IconProp"));
|
|
12
|
+
const ProviderLogo_1 = __importDefault(require("../ProviderLogo/ProviderLogo"));
|
|
12
13
|
const LlmConnectionProvider_1 = __importDefault(require("./LlmConnectionProvider"));
|
|
13
14
|
/*
|
|
14
15
|
* EVERYTHING ABOUT A CONNECTION THAT IS NOT CODE: what to call it, what it
|
|
@@ -76,6 +77,7 @@ const AZURE_CLIENT_SECRET_FIELD = {
|
|
|
76
77
|
exports.LlmConnectionCatalog = [
|
|
77
78
|
{
|
|
78
79
|
provider: LlmConnectionProvider_1.default.OpenAI,
|
|
80
|
+
logo: ProviderLogo_1.default.OpenAI,
|
|
79
81
|
kind: LlmConnectionKind.ProviderAccount,
|
|
80
82
|
title: "OpenAI",
|
|
81
83
|
description: "Usage and cost of your OpenAI organization.",
|
|
@@ -102,6 +104,7 @@ exports.LlmConnectionCatalog = [
|
|
|
102
104
|
},
|
|
103
105
|
{
|
|
104
106
|
provider: LlmConnectionProvider_1.default.Anthropic,
|
|
107
|
+
logo: ProviderLogo_1.default.Anthropic,
|
|
105
108
|
kind: LlmConnectionKind.ProviderAccount,
|
|
106
109
|
title: "Anthropic",
|
|
107
110
|
description: "Usage and cost of your Claude API organization.",
|
|
@@ -128,6 +131,7 @@ exports.LlmConnectionCatalog = [
|
|
|
128
131
|
},
|
|
129
132
|
{
|
|
130
133
|
provider: LlmConnectionProvider_1.default.AzureOpenAI,
|
|
134
|
+
logo: ProviderLogo_1.default.AzureOpenAI,
|
|
131
135
|
kind: LlmConnectionKind.ProviderAccount,
|
|
132
136
|
title: "Azure OpenAI and Microsoft Foundry",
|
|
133
137
|
description: "Usage of every Azure OpenAI and Foundry resource in a subscription.",
|
|
@@ -157,6 +161,7 @@ exports.LlmConnectionCatalog = [
|
|
|
157
161
|
},
|
|
158
162
|
{
|
|
159
163
|
provider: LlmConnectionProvider_1.default.AwsBedrock,
|
|
164
|
+
logo: ProviderLogo_1.default.AmazonBedrock,
|
|
160
165
|
kind: LlmConnectionKind.ProviderAccount,
|
|
161
166
|
title: "Amazon Bedrock",
|
|
162
167
|
description: "Usage of Amazon Bedrock models in your AWS account.",
|
|
@@ -200,6 +205,7 @@ exports.LlmConnectionCatalog = [
|
|
|
200
205
|
},
|
|
201
206
|
{
|
|
202
207
|
provider: LlmConnectionProvider_1.default.GoogleVertexAI,
|
|
208
|
+
logo: ProviderLogo_1.default.GoogleVertexAI,
|
|
203
209
|
kind: LlmConnectionKind.ProviderAccount,
|
|
204
210
|
title: "Google Vertex AI",
|
|
205
211
|
description: "Usage of Gemini, Claude and other models on Vertex AI.",
|
|
@@ -235,6 +241,7 @@ exports.LlmConnectionCatalog = [
|
|
|
235
241
|
},
|
|
236
242
|
{
|
|
237
243
|
provider: LlmConnectionProvider_1.default.ClaudeEnterprise,
|
|
244
|
+
logo: ProviderLogo_1.default.Claude,
|
|
238
245
|
kind: LlmConnectionKind.CompanyTool,
|
|
239
246
|
title: "Claude Enterprise",
|
|
240
247
|
description: "What your people ask Claude on claude.ai.",
|
|
@@ -261,6 +268,7 @@ exports.LlmConnectionCatalog = [
|
|
|
261
268
|
},
|
|
262
269
|
{
|
|
263
270
|
provider: LlmConnectionProvider_1.default.Microsoft365Copilot,
|
|
271
|
+
logo: ProviderLogo_1.default.MicrosoftCopilot,
|
|
264
272
|
kind: LlmConnectionKind.CompanyTool,
|
|
265
273
|
title: "Microsoft 365 Copilot",
|
|
266
274
|
description: "What your people ask Copilot in Teams, Outlook, Word and Copilot Chat.",
|
|
@@ -690,7 +690,8 @@ class MonitorTypeHelper {
|
|
|
690
690
|
{
|
|
691
691
|
monitorType: MonitorType.Logs,
|
|
692
692
|
title: "Logs",
|
|
693
|
-
|
|
693
|
+
// What its recipes answer (TelemetryRuleRecipes), in their words.
|
|
694
|
+
description: "Alert when errors pile up, a message appears, or logs stop.",
|
|
694
695
|
icon: IconProp_1.default.Logs,
|
|
695
696
|
keywords: [
|
|
696
697
|
"log",
|
|
@@ -741,7 +742,7 @@ class MonitorTypeHelper {
|
|
|
741
742
|
{
|
|
742
743
|
monitorType: MonitorType.Exceptions,
|
|
743
744
|
title: "Exceptions",
|
|
744
|
-
description: "Alert
|
|
745
|
+
description: "Alert when an exception happens, comes back, or spikes.",
|
|
745
746
|
icon: IconProp_1.default.Bug,
|
|
746
747
|
keywords: [
|
|
747
748
|
"exception",
|
|
@@ -761,7 +762,7 @@ class MonitorTypeHelper {
|
|
|
761
762
|
* card promises no latency. Latency is alerted on through a Metrics
|
|
762
763
|
* monitor on a request duration metric, which answers "latency".
|
|
763
764
|
*/
|
|
764
|
-
description: "Alert
|
|
765
|
+
description: "Alert when requests fail, or stop arriving.",
|
|
765
766
|
icon: IconProp_1.default.Waterfall,
|
|
766
767
|
keywords: [
|
|
767
768
|
"trace",
|
|
@@ -778,7 +779,7 @@ class MonitorTypeHelper {
|
|
|
778
779
|
{
|
|
779
780
|
monitorType: MonitorType.Metrics,
|
|
780
781
|
title: "Metrics",
|
|
781
|
-
description: "Alert
|
|
782
|
+
description: "Alert when a metric goes above or below a value, or looks unusual.",
|
|
782
783
|
icon: IconProp_1.default.Heartbeat,
|
|
783
784
|
keywords: [
|
|
784
785
|
"metric",
|