@oneuptime/common 14.0.95 → 14.0.97
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/NetworkFlow.d.mts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.d.ts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.js +50 -0
- package/Models/DatabaseModels/Alert.d.mts +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +63 -0
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
- 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/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +63 -0
- package/Models/DatabaseModels/Index.js +12 -0
- package/Models/DatabaseModels/NetworkAddressName.d.mts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.d.ts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.js +300 -0
- package/Models/DatabaseModels/NetworkAddressName.mjs +2 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +38 -0
- package/Models/DatabaseModels/SecurityCase.d.mts +8 -0
- package/Models/DatabaseModels/SecurityCase.d.ts +8 -0
- package/Models/DatabaseModels/SecurityCase.js +145 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.mts +28 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.ts +28 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.js +489 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.mjs +2 -0
- package/Models/DatabaseModels/SecurityCaseFeed.d.mts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.d.ts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.js +6 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.mts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.ts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.js +44 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.mts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.ts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.js +467 -0
- package/Models/DatabaseModels/SecurityCaseTask.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.mts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.ts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.js +411 -0
- package/Models/DatabaseModels/SecurityWatchlist.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.mts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.ts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.js +321 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.mjs +2 -0
- package/Types/AI/AiAffectedResources.d.mts +2 -1
- package/Types/AI/AiAffectedResources.d.ts +2 -1
- package/Types/AI/AiAffectedResources.js +12 -1
- package/Types/AffectedResources/AffectedResourceSearch.d.mts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.d.ts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.js +224 -0
- package/Types/AffectedResources/AffectedResourceSearch.mjs +11 -0
- package/Types/ArchivableValue/ArchivableValueUsage.d.mts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.d.ts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.js +91 -12
- package/Types/ArchivableValue/ArchivableValueUsage.mjs +1 -0
- package/Types/Color.d.mts +0 -2
- package/Types/Color.d.ts +0 -2
- package/Types/Color.js +0 -14
- package/Types/Database/DatabaseProperty.d.mts +0 -2
- package/Types/Database/DatabaseProperty.d.ts +0 -2
- package/Types/Database/DatabaseProperty.js +0 -3
- 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/Date.d.mts +0 -2
- package/Types/Date.d.ts +0 -2
- package/Types/Date.js +0 -23
- package/Types/Domain.d.mts +0 -2
- package/Types/Domain.d.ts +0 -2
- package/Types/Domain.js +0 -14
- package/Types/Email/EmailTemplateType.d.mts +2 -0
- package/Types/Email/EmailTemplateType.d.ts +2 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email.d.mts +0 -2
- package/Types/Email.d.ts +0 -2
- package/Types/Email.js +0 -15
- package/Types/IP/IP.d.mts +0 -2
- package/Types/IP/IP.d.ts +0 -2
- package/Types/IP/IP.js +0 -14
- package/Types/JSONFunctions.js +16 -1
- package/Types/Monitor/CriteriaAlert.d.mts +0 -2
- package/Types/Monitor/CriteriaAlert.d.ts +0 -2
- package/Types/Monitor/CriteriaAlert.js +0 -18
- package/Types/Monitor/CriteriaAlert.mjs +1 -2
- package/Types/Monitor/CriteriaFilter.d.mts +0 -2
- package/Types/Monitor/CriteriaFilter.d.ts +0 -2
- package/Types/Monitor/CriteriaFilter.js +1 -42
- package/Types/Monitor/CriteriaFilter.mjs +0 -1
- package/Types/Monitor/CriteriaIncident.d.mts +0 -2
- package/Types/Monitor/CriteriaIncident.d.ts +0 -2
- package/Types/Monitor/CriteriaIncident.js +0 -23
- package/Types/Monitor/CriteriaIncident.mjs +1 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.mts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.ts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.js +0 -11
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.mjs +1 -2
- package/Types/Monitor/MonitorCriteria.d.mts +0 -2
- package/Types/Monitor/MonitorCriteria.d.ts +0 -2
- package/Types/Monitor/MonitorCriteria.js +0 -21
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.js +0 -54
- package/Types/Monitor/MonitorStep.d.mts +0 -2
- package/Types/Monitor/MonitorStep.d.ts +0 -2
- package/Types/Monitor/MonitorStep.js +0 -80
- package/Types/Monitor/MonitorSteps.d.mts +0 -2
- package/Types/Monitor/MonitorSteps.d.ts +0 -2
- package/Types/Monitor/MonitorSteps.js +0 -31
- 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/Name.d.mts +0 -2
- package/Types/Name.d.ts +0 -2
- package/Types/Name.js +0 -14
- package/Types/NetFlow/NetworkAddressName.d.mts +30 -0
- package/Types/NetFlow/NetworkAddressName.d.ts +30 -0
- package/Types/NetFlow/NetworkAddressName.js +149 -0
- package/Types/NetFlow/NetworkAddressName.mjs +6 -0
- package/Types/NetFlow/NetworkTraffic.d.mts +20 -0
- package/Types/NetFlow/NetworkTraffic.d.ts +20 -0
- package/Types/NetFlow/NetworkTraffic.js +5 -1
- package/Types/NetFlow/NetworkTraffic.mjs +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.mts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.ts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +173 -8
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +3 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +6 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +9 -0
- package/Types/ObjectID.d.mts +0 -1
- package/Types/ObjectID.d.ts +0 -1
- package/Types/ObjectID.js +0 -9
- 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/OnCallDutyPolicyRunEnding.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.js +25 -1
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.mts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.ts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.js +118 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.mjs +9 -0
- package/Types/Permission.d.mts +8 -0
- package/Types/Permission.d.ts +8 -0
- package/Types/Permission.js +87 -3
- package/Types/Phone.d.mts +0 -2
- package/Types/Phone.d.ts +0 -2
- package/Types/Phone.js +0 -14
- package/Types/Port.d.mts +0 -2
- package/Types/Port.d.ts +0 -2
- package/Types/Port.js +0 -14
- package/Types/ProviderLogo/ProviderLogo.d.mts +24 -1
- package/Types/ProviderLogo/ProviderLogo.d.ts +24 -1
- package/Types/ProviderLogo/ProviderLogo.js +47 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.mts +7 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.ts +7 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.js +24 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.mjs +4 -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/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/SecurityWatchlist.d.mts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.d.ts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.js +648 -0
- package/Types/SecurityEvent/SecurityWatchlist.mjs +51 -0
- package/Types/SecurityEvent/SigmaRule.d.mts +2 -0
- package/Types/SecurityEvent/SigmaRule.d.ts +2 -0
- package/Types/SecurityEvent/SigmaRule.js +5 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
- package/Types/Telemetry/OpenTelemetryGuides.js +591 -0
- package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
- package/Types/Version.d.mts +0 -2
- package/Types/Version.d.ts +0 -2
- package/Types/Version.js +0 -14
- package/Types/Workflow/AffectedResourcesSetting.d.mts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.d.ts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.js +120 -0
- package/Types/Workflow/AffectedResourcesSetting.mjs +8 -0
- package/Types/Workflow/Components/BaseModel.js +15 -3
- package/Types/Workflow/Documentation/DatabaseDocumentation.js +36 -0
- package/Utils/Inventory/AssetFactSource.d.mts +6 -2
- package/Utils/Inventory/AssetFactSource.d.ts +6 -2
- package/Utils/Inventory/AssetFactSource.js +18 -1
- package/Utils/Inventory/AssetFactSource.mjs +1 -0
- package/Utils/Markdown/FeedLead.d.mts +10 -0
- package/Utils/Markdown/FeedLead.d.ts +10 -0
- package/Utils/Markdown/FeedLead.js +198 -0
- package/Utils/Markdown/FeedLead.mjs +8 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +139 -18
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.mts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.ts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.js +232 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.mjs +16 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.mts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.ts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.js +264 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.mjs +3 -0
- package/Utils/Schema/MonitorSchemas.d.mts +9 -0
- package/Utils/Schema/MonitorSchemas.d.ts +9 -0
- package/Utils/Schema/MonitorSchemas.js +291 -0
- package/Utils/Schema/MonitorSchemas.mjs +9 -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/TypeSchemas.d.mts +12 -0
- package/Utils/Schema/TypeSchemas.d.ts +12 -0
- package/Utils/Schema/TypeSchemas.js +176 -0
- package/Utils/Schema/TypeSchemas.mjs +11 -0
- package/Utils/Schema/Zod.js +23 -17
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +34 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +34 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.js +69 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +9 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.mts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.ts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.js +15 -1
- package/Utils/SecurityCase/SecurityCaseTargets.d.mts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.d.ts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.js +482 -0
- package/Utils/SecurityCase/SecurityCaseTargets.mjs +28 -0
- package/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +22 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.mts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.ts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.js +183 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.mjs +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ZodSchema } from "./Zod.mjs";
|
|
2
|
+
import type { ZodType } from "zod";
|
|
3
|
+
export declare function getObjectIDSchema(): ZodType;
|
|
4
|
+
export declare function getEmailSchema(): ZodSchema;
|
|
5
|
+
export declare function getPhoneSchema(): ZodSchema;
|
|
6
|
+
export declare function getNameSchema(): ZodSchema;
|
|
7
|
+
export declare function getDomainSchema(): ZodSchema;
|
|
8
|
+
export declare function getVersionSchema(): ZodSchema;
|
|
9
|
+
export declare function getIPSchema(): ZodSchema;
|
|
10
|
+
export declare function getPortSchema(): ZodSchema;
|
|
11
|
+
export declare function getColorSchema(): ZodSchema;
|
|
12
|
+
export declare function getDateSchema(): ZodSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ZodSchema } from "./Zod";
|
|
2
|
+
import type { ZodType } from "zod";
|
|
3
|
+
export declare function getObjectIDSchema(): ZodType;
|
|
4
|
+
export declare function getEmailSchema(): ZodSchema;
|
|
5
|
+
export declare function getPhoneSchema(): ZodSchema;
|
|
6
|
+
export declare function getNameSchema(): ZodSchema;
|
|
7
|
+
export declare function getDomainSchema(): ZodSchema;
|
|
8
|
+
export declare function getVersionSchema(): ZodSchema;
|
|
9
|
+
export declare function getIPSchema(): ZodSchema;
|
|
10
|
+
export declare function getPortSchema(): ZodSchema;
|
|
11
|
+
export declare function getColorSchema(): ZodSchema;
|
|
12
|
+
export declare function getDateSchema(): ZodSchema;
|
|
@@ -0,0 +1,176 @@
|
|
|
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.getObjectIDSchema = getObjectIDSchema;
|
|
7
|
+
exports.getEmailSchema = getEmailSchema;
|
|
8
|
+
exports.getPhoneSchema = getPhoneSchema;
|
|
9
|
+
exports.getNameSchema = getNameSchema;
|
|
10
|
+
exports.getDomainSchema = getDomainSchema;
|
|
11
|
+
exports.getVersionSchema = getVersionSchema;
|
|
12
|
+
exports.getIPSchema = getIPSchema;
|
|
13
|
+
exports.getPortSchema = getPortSchema;
|
|
14
|
+
exports.getColorSchema = getColorSchema;
|
|
15
|
+
exports.getDateSchema = getDateSchema;
|
|
16
|
+
const Zod_1 = __importDefault(require("./Zod"));
|
|
17
|
+
const JSON_1 = require("../../Types/JSON");
|
|
18
|
+
/*
|
|
19
|
+
* The API schemas of Common's value Types: how a column of each type looks
|
|
20
|
+
* in the OpenAPI document, and so in the API reference, the MCP tools and
|
|
21
|
+
* the Terraform provider. ModelSchema and AnalyticsModelSchema read them
|
|
22
|
+
* here, column by column.
|
|
23
|
+
*
|
|
24
|
+
* They used to be a static getSchema() on each Type (Email.getSchema(),
|
|
25
|
+
* ObjectID.getSchema() ...). Every frontend loads those Types - the
|
|
26
|
+
* Dashboard, Accounts, the Admin Dashboard, status pages and public
|
|
27
|
+
* dashboards, on every page - and no browser reads a schema, so each
|
|
28
|
+
* frontend carried zod and zod-to-openapi for nothing: about 111 KB (33 KB
|
|
29
|
+
* gzipped) of the chunks every page loads. Here, beside the schema builders
|
|
30
|
+
* that use them, only the server loads them. MonitorSchemas.ts does the same
|
|
31
|
+
* for the monitor Types, and Tests/Utils/Schema/ZodOutOfBrowserGuard keeps
|
|
32
|
+
* zod and these modules out of everything a frontend loads.
|
|
33
|
+
*
|
|
34
|
+
* Each schema takes a value of its Type as the API takes it - the
|
|
35
|
+
* { _type, value } its toJSON() writes, or, for an ID, the UUID itself - and
|
|
36
|
+
* its example is one such value (Tests/Utils/Schema/TypeSchemas holds both).
|
|
37
|
+
* Each call builds a new schema, as getSchema() did: a model's schema owns
|
|
38
|
+
* the schemas of its columns.
|
|
39
|
+
*/
|
|
40
|
+
// A unique identifier: a column of type ObjectID, as the API reads and writes it.
|
|
41
|
+
function getObjectIDSchema() {
|
|
42
|
+
return Zod_1.default.string().openapi({
|
|
43
|
+
type: "string",
|
|
44
|
+
example: "123e4567-e89b-12d3-a456-426614174000",
|
|
45
|
+
format: "uuid",
|
|
46
|
+
description: "A unique identifier for an object, represented as a UUID.",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function getEmailSchema() {
|
|
50
|
+
return Zod_1.default.object({
|
|
51
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Email),
|
|
52
|
+
value: Zod_1.default.string().email().openapi({
|
|
53
|
+
type: "string",
|
|
54
|
+
format: "email",
|
|
55
|
+
example: "user@example.com",
|
|
56
|
+
}),
|
|
57
|
+
}).openapi({
|
|
58
|
+
type: "object",
|
|
59
|
+
description: "Email object",
|
|
60
|
+
example: { _type: JSON_1.ObjectType.Email, value: "user@example.com" },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function getPhoneSchema() {
|
|
64
|
+
return Zod_1.default.object({
|
|
65
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Phone),
|
|
66
|
+
value: Zod_1.default.string().openapi({
|
|
67
|
+
type: "string",
|
|
68
|
+
example: "+1-555-123-4567",
|
|
69
|
+
}),
|
|
70
|
+
}).openapi({
|
|
71
|
+
type: "object",
|
|
72
|
+
description: "Phone object",
|
|
73
|
+
example: { _type: JSON_1.ObjectType.Phone, value: "+1-555-123-4567" },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function getNameSchema() {
|
|
77
|
+
return Zod_1.default.object({
|
|
78
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Name),
|
|
79
|
+
value: Zod_1.default.string().openapi({
|
|
80
|
+
type: "string",
|
|
81
|
+
example: "John Doe",
|
|
82
|
+
}),
|
|
83
|
+
}).openapi({
|
|
84
|
+
type: "object",
|
|
85
|
+
description: "Name object",
|
|
86
|
+
example: { _type: JSON_1.ObjectType.Name, value: "John Doe" },
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function getDomainSchema() {
|
|
90
|
+
return Zod_1.default.object({
|
|
91
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Domain),
|
|
92
|
+
value: Zod_1.default.string().openapi({
|
|
93
|
+
type: "string",
|
|
94
|
+
example: "example.com",
|
|
95
|
+
}),
|
|
96
|
+
}).openapi({
|
|
97
|
+
type: "object",
|
|
98
|
+
description: "Domain object",
|
|
99
|
+
example: { _type: JSON_1.ObjectType.Domain, value: "example.com" },
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function getVersionSchema() {
|
|
103
|
+
return Zod_1.default.object({
|
|
104
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Version),
|
|
105
|
+
value: Zod_1.default.string().openapi({
|
|
106
|
+
type: "string",
|
|
107
|
+
example: "1.0.0",
|
|
108
|
+
}),
|
|
109
|
+
}).openapi({
|
|
110
|
+
type: "object",
|
|
111
|
+
description: "Version object",
|
|
112
|
+
example: { _type: JSON_1.ObjectType.Version, value: "1.0.0" },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function getIPSchema() {
|
|
116
|
+
return Zod_1.default.object({
|
|
117
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.IP),
|
|
118
|
+
value: Zod_1.default.string().openapi({
|
|
119
|
+
type: "string",
|
|
120
|
+
example: "192.168.1.1",
|
|
121
|
+
}),
|
|
122
|
+
}).openapi({
|
|
123
|
+
type: "object",
|
|
124
|
+
description: "IP object",
|
|
125
|
+
example: { _type: JSON_1.ObjectType.IP, value: "192.168.1.1" },
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function getPortSchema() {
|
|
129
|
+
return Zod_1.default.object({
|
|
130
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Port),
|
|
131
|
+
value: Zod_1.default.number().int().min(0).max(65535).openapi({
|
|
132
|
+
type: "number",
|
|
133
|
+
example: 8080,
|
|
134
|
+
}),
|
|
135
|
+
}).openapi({
|
|
136
|
+
type: "object",
|
|
137
|
+
description: "Port object",
|
|
138
|
+
example: { _type: JSON_1.ObjectType.Port, value: 8080 },
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function getColorSchema() {
|
|
142
|
+
return Zod_1.default.object({
|
|
143
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.Color),
|
|
144
|
+
value: Zod_1.default.string().openapi({
|
|
145
|
+
type: "string",
|
|
146
|
+
example: "#ff0000",
|
|
147
|
+
}),
|
|
148
|
+
}).openapi({
|
|
149
|
+
type: "object",
|
|
150
|
+
description: "Color object",
|
|
151
|
+
example: { _type: JSON_1.ObjectType.Color, value: "#ff0000" },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// A date and time (OneUptimeDate), as the API reads and writes it.
|
|
155
|
+
function getDateSchema() {
|
|
156
|
+
return Zod_1.default.object({
|
|
157
|
+
_type: Zod_1.default.literal(JSON_1.ObjectType.DateTime),
|
|
158
|
+
value: Zod_1.default.string().openapi({
|
|
159
|
+
type: "string",
|
|
160
|
+
example: "2023-10-01T12:00:00Z",
|
|
161
|
+
}),
|
|
162
|
+
}).openapi({
|
|
163
|
+
type: "object",
|
|
164
|
+
description: "A date time object.",
|
|
165
|
+
/*
|
|
166
|
+
* Machine-readable marker so spec consumers (e.g. the Terraform provider
|
|
167
|
+
* generator) can treat this wrapper as an RFC3339 timestamp instead of an
|
|
168
|
+
* opaque object.
|
|
169
|
+
*/
|
|
170
|
+
"x-oneuptime-type": JSON_1.ObjectType.DateTime,
|
|
171
|
+
example: {
|
|
172
|
+
_type: JSON_1.ObjectType.DateTime,
|
|
173
|
+
value: "2023-10-01T12:00:00Z",
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import commonJsModule from "./TypeSchemas.js";
|
|
2
|
+
export const getColorSchema = commonJsModule.getColorSchema;
|
|
3
|
+
export const getDateSchema = commonJsModule.getDateSchema;
|
|
4
|
+
export const getDomainSchema = commonJsModule.getDomainSchema;
|
|
5
|
+
export const getEmailSchema = commonJsModule.getEmailSchema;
|
|
6
|
+
export const getIPSchema = commonJsModule.getIPSchema;
|
|
7
|
+
export const getNameSchema = commonJsModule.getNameSchema;
|
|
8
|
+
export const getObjectIDSchema = commonJsModule.getObjectIDSchema;
|
|
9
|
+
export const getPhoneSchema = commonJsModule.getPhoneSchema;
|
|
10
|
+
export const getPortSchema = commonJsModule.getPortSchema;
|
|
11
|
+
export const getVersionSchema = commonJsModule.getVersionSchema;
|
package/Utils/Schema/Zod.js
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const zod_to_openapi_1 = require("@asteasolutions/zod-to-openapi");
|
|
4
|
+
const OpenApiMetadataRegistry_1 = require("./OpenApiMetadataRegistry");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
/*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* No frontend loads this module. The API schemas are built in this folder
|
|
8
|
+
* (TypeSchemas, MonitorSchemas, ModelSchema ...), which only the server
|
|
9
|
+
* loads, and Tests/Utils/Schema/ZodOutOfBrowserGuard keeps every frontend's
|
|
10
|
+
* imports clear of it. Should zod reach a browser all the same, it turns no
|
|
11
|
+
* string into code there: zod 4 compiles each object schema's parser with
|
|
12
|
+
* new Function, and checks that it may as the first object schema is made,
|
|
13
|
+
* which a status page refuses and reports (StatusPageContentSecurityPolicy
|
|
14
|
+
* has no 'unsafe-eval'). Jitless zod parses the same, without the compiled
|
|
15
|
+
* fast path; on the server zod keeps it. (Common's jest runs in jsdom, so
|
|
16
|
+
* its tests parse jitless.)
|
|
14
17
|
*/
|
|
15
18
|
if (typeof window !== "undefined" && typeof window.document !== "undefined") {
|
|
16
19
|
(0, zod_1.config)({ jitless: true });
|
|
17
20
|
}
|
|
18
21
|
/*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* zod 3 cost 66 KB. Picked by name, zod costs what the schemas below use
|
|
27
|
-
* (Tests/Utils/Schema/ZodBrowserBundle holds the bundle to it).
|
|
22
|
+
* The zod functions OneUptime builds its schemas with are picked by name,
|
|
23
|
+
* and nothing here hands zod's namespace around as a value. A bundler keeps
|
|
24
|
+
* all of an object that is passed or exported whole, and zod 4's namespace
|
|
25
|
+
* carries every one of its ~45 locales: while the Types built their schemas
|
|
26
|
+
* and every frontend bundled this module, that was about 480 KB of zod on
|
|
27
|
+
* every page. The list below is also all of zod that OneUptime's schemas
|
|
28
|
+
* use, which is where the next zod upgrade starts.
|
|
28
29
|
*
|
|
29
30
|
* zod-to-openapi's .openapi(): extendZodWithOpenApi adds it to ZodType's
|
|
30
31
|
* prototype and reads nothing else of the zod it is given, so it is given
|
|
31
32
|
* that alone (Tests/Utils/Schema/Zod holds it to reading only ZodType).
|
|
32
33
|
*/
|
|
33
34
|
(0, zod_to_openapi_1.extendZodWithOpenApi)({ ZodType: zod_1.ZodType });
|
|
35
|
+
/*
|
|
36
|
+
* And what .openapi() is given lives as long as its schema, not as long as
|
|
37
|
+
* the process (OpenApiMetadataRegistry.ts says why).
|
|
38
|
+
*/
|
|
39
|
+
(0, OpenApiMetadataRegistry_1.holdOpenApiMetadataWeakly)(zod_to_openapi_1.zodToOpenAPIRegistry);
|
|
34
40
|
/*
|
|
35
41
|
* The zod functions OneUptime builds its schemas with. Something else of
|
|
36
42
|
* zod's - a class for instanceof, a type - comes from "zod" itself, after
|
|
@@ -175,3 +175,37 @@ export declare function entityRiskMarkdown(data: {
|
|
|
175
175
|
lastSeen: string;
|
|
176
176
|
}>;
|
|
177
177
|
}): MarkdownText;
|
|
178
|
+
export declare function taskAddedMarkdown(data: {
|
|
179
|
+
title: string;
|
|
180
|
+
assigneeName?: string | undefined;
|
|
181
|
+
}): MarkdownText;
|
|
182
|
+
export declare function taskDoneMarkdown(data: {
|
|
183
|
+
title: string;
|
|
184
|
+
}): MarkdownText;
|
|
185
|
+
export declare function taskReopenedMarkdown(data: {
|
|
186
|
+
title: string;
|
|
187
|
+
}): MarkdownText;
|
|
188
|
+
export declare function taskAssignedMarkdown(data: {
|
|
189
|
+
title: string;
|
|
190
|
+
assigneeName?: string | undefined;
|
|
191
|
+
}): MarkdownText;
|
|
192
|
+
export declare function taskDeletedMarkdown(data: {
|
|
193
|
+
title: string;
|
|
194
|
+
}): MarkdownText;
|
|
195
|
+
export declare function evidenceAddedMarkdown(data: {
|
|
196
|
+
name: string;
|
|
197
|
+
sha256?: string | undefined;
|
|
198
|
+
url?: string | undefined;
|
|
199
|
+
}): MarkdownText;
|
|
200
|
+
export declare function evidenceRemovedMarkdown(data: {
|
|
201
|
+
name: string;
|
|
202
|
+
}): MarkdownText;
|
|
203
|
+
export declare function targetAtRiskMarkdown(data: {
|
|
204
|
+
target: string;
|
|
205
|
+
timeLeft: string;
|
|
206
|
+
targetDuration?: string | undefined;
|
|
207
|
+
}): MarkdownText;
|
|
208
|
+
export declare function targetMissedMarkdown(data: {
|
|
209
|
+
target: string;
|
|
210
|
+
targetDuration?: string | undefined;
|
|
211
|
+
}): MarkdownText;
|
|
@@ -175,3 +175,37 @@ export declare function entityRiskMarkdown(data: {
|
|
|
175
175
|
lastSeen: string;
|
|
176
176
|
}>;
|
|
177
177
|
}): MarkdownText;
|
|
178
|
+
export declare function taskAddedMarkdown(data: {
|
|
179
|
+
title: string;
|
|
180
|
+
assigneeName?: string | undefined;
|
|
181
|
+
}): MarkdownText;
|
|
182
|
+
export declare function taskDoneMarkdown(data: {
|
|
183
|
+
title: string;
|
|
184
|
+
}): MarkdownText;
|
|
185
|
+
export declare function taskReopenedMarkdown(data: {
|
|
186
|
+
title: string;
|
|
187
|
+
}): MarkdownText;
|
|
188
|
+
export declare function taskAssignedMarkdown(data: {
|
|
189
|
+
title: string;
|
|
190
|
+
assigneeName?: string | undefined;
|
|
191
|
+
}): MarkdownText;
|
|
192
|
+
export declare function taskDeletedMarkdown(data: {
|
|
193
|
+
title: string;
|
|
194
|
+
}): MarkdownText;
|
|
195
|
+
export declare function evidenceAddedMarkdown(data: {
|
|
196
|
+
name: string;
|
|
197
|
+
sha256?: string | undefined;
|
|
198
|
+
url?: string | undefined;
|
|
199
|
+
}): MarkdownText;
|
|
200
|
+
export declare function evidenceRemovedMarkdown(data: {
|
|
201
|
+
name: string;
|
|
202
|
+
}): MarkdownText;
|
|
203
|
+
export declare function targetAtRiskMarkdown(data: {
|
|
204
|
+
target: string;
|
|
205
|
+
timeLeft: string;
|
|
206
|
+
targetDuration?: string | undefined;
|
|
207
|
+
}): MarkdownText;
|
|
208
|
+
export declare function targetMissedMarkdown(data: {
|
|
209
|
+
target: string;
|
|
210
|
+
targetDuration?: string | undefined;
|
|
211
|
+
}): MarkdownText;
|
|
@@ -58,6 +58,15 @@ exports.detectionRuleMatchMarkdown = detectionRuleMatchMarkdown;
|
|
|
58
58
|
exports.threatIntelMatchMarkdown = threatIntelMatchMarkdown;
|
|
59
59
|
exports.detectionOverflowMarkdown = detectionOverflowMarkdown;
|
|
60
60
|
exports.entityRiskMarkdown = entityRiskMarkdown;
|
|
61
|
+
exports.taskAddedMarkdown = taskAddedMarkdown;
|
|
62
|
+
exports.taskDoneMarkdown = taskDoneMarkdown;
|
|
63
|
+
exports.taskReopenedMarkdown = taskReopenedMarkdown;
|
|
64
|
+
exports.taskAssignedMarkdown = taskAssignedMarkdown;
|
|
65
|
+
exports.taskDeletedMarkdown = taskDeletedMarkdown;
|
|
66
|
+
exports.evidenceAddedMarkdown = evidenceAddedMarkdown;
|
|
67
|
+
exports.evidenceRemovedMarkdown = evidenceRemovedMarkdown;
|
|
68
|
+
exports.targetAtRiskMarkdown = targetAtRiskMarkdown;
|
|
69
|
+
exports.targetMissedMarkdown = targetMissedMarkdown;
|
|
61
70
|
const FeedMarkdown_1 = __importStar(require("../Markdown/FeedMarkdown"));
|
|
62
71
|
const MitreAttack_1 = require("../../Types/SecurityEvent/MitreAttack");
|
|
63
72
|
const SecurityConnection_1 = require("../../Types/SecurityCase/SecurityConnection");
|
|
@@ -390,3 +399,63 @@ function entityRiskMarkdown(data) {
|
|
|
390
399
|
}
|
|
391
400
|
return FeedMarkdown_1.default.join(parts, "\n\n");
|
|
392
401
|
}
|
|
402
|
+
// ---------- Tasks, evidence and response targets ----------
|
|
403
|
+
/*
|
|
404
|
+
* What a case's timeline says about its tasks (SecurityCaseTaskService):
|
|
405
|
+
* added, done, opened again, handed to somebody, deleted. A task's title is
|
|
406
|
+
* a person's words, and a person's name comes from their profile, so both
|
|
407
|
+
* are escaped text.
|
|
408
|
+
*/
|
|
409
|
+
function taskAddedMarkdown(data) {
|
|
410
|
+
return data.assigneeName
|
|
411
|
+
? (0, FeedMarkdown_1.mdText) `📋 Added the task **${data.title}** and assigned it to **${data.assigneeName}**.`
|
|
412
|
+
: (0, FeedMarkdown_1.mdText) `📋 Added the task **${data.title}**.`;
|
|
413
|
+
}
|
|
414
|
+
function taskDoneMarkdown(data) {
|
|
415
|
+
return (0, FeedMarkdown_1.mdText) `☑️ Completed the task **${data.title}**.`;
|
|
416
|
+
}
|
|
417
|
+
function taskReopenedMarkdown(data) {
|
|
418
|
+
return (0, FeedMarkdown_1.mdText) `↩️ Reopened the task **${data.title}**.`;
|
|
419
|
+
}
|
|
420
|
+
function taskAssignedMarkdown(data) {
|
|
421
|
+
return data.assigneeName
|
|
422
|
+
? (0, FeedMarkdown_1.mdText) `👤 Assigned the task **${data.title}** to **${data.assigneeName}**.`
|
|
423
|
+
: (0, FeedMarkdown_1.mdText) `👤 Unassigned the task **${data.title}**.`;
|
|
424
|
+
}
|
|
425
|
+
function taskDeletedMarkdown(data) {
|
|
426
|
+
return (0, FeedMarkdown_1.mdText) `🗑️ Deleted the task **${data.title}**.`;
|
|
427
|
+
}
|
|
428
|
+
/*
|
|
429
|
+
* What a case's timeline says about its evidence
|
|
430
|
+
* (SecurityCaseEvidenceService). A file's name is the uploader's, a link's
|
|
431
|
+
* address points outside OneUptime: each is code, so neither turns into a
|
|
432
|
+
* link or an image wherever the timeline is shown.
|
|
433
|
+
*/
|
|
434
|
+
function evidenceAddedMarkdown(data) {
|
|
435
|
+
if (data.sha256) {
|
|
436
|
+
return (0, FeedMarkdown_1.mdText) `🗄️ Added the file **${data.name}** as evidence. SHA-256 ${FeedMarkdown_1.default.code(data.sha256)}.`;
|
|
437
|
+
}
|
|
438
|
+
if (data.url) {
|
|
439
|
+
return (0, FeedMarkdown_1.mdText) `🔗 Added the link **${data.name}** as evidence: ${FeedMarkdown_1.default.code(data.url)}.`;
|
|
440
|
+
}
|
|
441
|
+
return (0, FeedMarkdown_1.mdText) `🗄️ Added **${data.name}** as evidence.`;
|
|
442
|
+
}
|
|
443
|
+
function evidenceRemovedMarkdown(data) {
|
|
444
|
+
return (0, FeedMarkdown_1.mdText) `🗑️ Removed **${data.name}** from the evidence.`;
|
|
445
|
+
}
|
|
446
|
+
/*
|
|
447
|
+
* What a case's timeline says when it is about to miss a response target,
|
|
448
|
+
* and when it misses it (SecurityCaseTargetCheck). `target` is the verb -
|
|
449
|
+
* "acknowledge", "contain" - and the durations are in words already
|
|
450
|
+
* ("3 minutes", "4 hours").
|
|
451
|
+
*/
|
|
452
|
+
function targetAtRiskMarkdown(data) {
|
|
453
|
+
return data.targetDuration
|
|
454
|
+
? (0, FeedMarkdown_1.mdText) `⏰ About to miss its **${data.target}** target of ${data.targetDuration}: ${data.timeLeft} left.`
|
|
455
|
+
: (0, FeedMarkdown_1.mdText) `⏰ About to miss its **${data.target}** target: ${data.timeLeft} left.`;
|
|
456
|
+
}
|
|
457
|
+
function targetMissedMarkdown(data) {
|
|
458
|
+
return data.targetDuration
|
|
459
|
+
? (0, FeedMarkdown_1.mdText) `🚨 Missed its **${data.target}** target of ${data.targetDuration}.`
|
|
460
|
+
: (0, FeedMarkdown_1.mdText) `🚨 Missed its **${data.target}** target.`;
|
|
461
|
+
}
|
|
@@ -12,6 +12,8 @@ export const detectionAddedMarkdown = commonJsModule.detectionAddedMarkdown;
|
|
|
12
12
|
export const detectionOverflowMarkdown = commonJsModule.detectionOverflowMarkdown;
|
|
13
13
|
export const detectionRuleMatchMarkdown = commonJsModule.detectionRuleMatchMarkdown;
|
|
14
14
|
export const entityRiskMarkdown = commonJsModule.entityRiskMarkdown;
|
|
15
|
+
export const evidenceAddedMarkdown = commonJsModule.evidenceAddedMarkdown;
|
|
16
|
+
export const evidenceRemovedMarkdown = commonJsModule.evidenceRemovedMarkdown;
|
|
15
17
|
export const incidentDeclaredFromCaseMarkdown = commonJsModule.incidentDeclaredFromCaseMarkdown;
|
|
16
18
|
export const incidentDeclaredMarkdown = commonJsModule.incidentDeclaredMarkdown;
|
|
17
19
|
export const noteAddedMarkdown = commonJsModule.noteAddedMarkdown;
|
|
@@ -25,5 +27,12 @@ export const priorityChangedMarkdown = commonJsModule.priorityChangedMarkdown;
|
|
|
25
27
|
export const renderSecurityCaseTemplate = commonJsModule.renderSecurityCaseTemplate;
|
|
26
28
|
export const securityCaseSummaryMarkdown = commonJsModule.securityCaseSummaryMarkdown;
|
|
27
29
|
export const statusChangedMarkdown = commonJsModule.statusChangedMarkdown;
|
|
30
|
+
export const targetAtRiskMarkdown = commonJsModule.targetAtRiskMarkdown;
|
|
31
|
+
export const targetMissedMarkdown = commonJsModule.targetMissedMarkdown;
|
|
28
32
|
export const targetUndoneMarkdown = commonJsModule.targetUndoneMarkdown;
|
|
33
|
+
export const taskAddedMarkdown = commonJsModule.taskAddedMarkdown;
|
|
34
|
+
export const taskAssignedMarkdown = commonJsModule.taskAssignedMarkdown;
|
|
35
|
+
export const taskDeletedMarkdown = commonJsModule.taskDeletedMarkdown;
|
|
36
|
+
export const taskDoneMarkdown = commonJsModule.taskDoneMarkdown;
|
|
37
|
+
export const taskReopenedMarkdown = commonJsModule.taskReopenedMarkdown;
|
|
29
38
|
export const threatIntelMatchMarkdown = commonJsModule.threatIntelMatchMarkdown;
|
|
@@ -9,6 +9,8 @@ export interface DefaultSecurityCasePriority {
|
|
|
9
9
|
color: Color;
|
|
10
10
|
order: number;
|
|
11
11
|
level: SecurityCasePriorityLevel;
|
|
12
|
+
acknowledgeWithinInMinutes: number | null;
|
|
13
|
+
containWithinInMinutes: number | null;
|
|
12
14
|
}
|
|
13
15
|
export declare const DEFAULT_SECURITY_CASE_PRIORITIES: ReadonlyArray<DefaultSecurityCasePriority>;
|
|
14
16
|
export default class SecurityCasePriorities {
|
|
@@ -9,6 +9,8 @@ export interface DefaultSecurityCasePriority {
|
|
|
9
9
|
color: Color;
|
|
10
10
|
order: number;
|
|
11
11
|
level: SecurityCasePriorityLevel;
|
|
12
|
+
acknowledgeWithinInMinutes: number | null;
|
|
13
|
+
containWithinInMinutes: number | null;
|
|
12
14
|
}
|
|
13
15
|
export declare const DEFAULT_SECURITY_CASE_PRIORITIES: ReadonlyArray<DefaultSecurityCasePriority>;
|
|
14
16
|
export default class SecurityCasePriorities {
|
|
@@ -44,7 +44,11 @@ const StateOrder_1 = require("../StateOrder");
|
|
|
44
44
|
/*
|
|
45
45
|
* A new project's case priorities: the scale every case has been on since
|
|
46
46
|
* cases began - the same names, order and colours - each the built-in
|
|
47
|
-
* priority of its level
|
|
47
|
+
* priority of its level, with the response targets a security team usually
|
|
48
|
+
* starts from: a Critical case taken on in 15 minutes and contained in 4
|
|
49
|
+
* hours, a High one in an hour and a day, a Medium one in 12 hours and 3
|
|
50
|
+
* days, a Low one in a day and a week. Informational cases need nothing
|
|
51
|
+
* done, so they have no targets.
|
|
48
52
|
*/
|
|
49
53
|
exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
50
54
|
{
|
|
@@ -53,6 +57,8 @@ exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
|
53
57
|
color: BrandColors_1.Red,
|
|
54
58
|
order: 1,
|
|
55
59
|
level: SecurityCasePriorityLevel_1.default.Critical,
|
|
60
|
+
acknowledgeWithinInMinutes: 15,
|
|
61
|
+
containWithinInMinutes: 4 * 60,
|
|
56
62
|
},
|
|
57
63
|
{
|
|
58
64
|
name: "High",
|
|
@@ -60,6 +66,8 @@ exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
|
60
66
|
color: BrandColors_1.Orange,
|
|
61
67
|
order: 2,
|
|
62
68
|
level: SecurityCasePriorityLevel_1.default.High,
|
|
69
|
+
acknowledgeWithinInMinutes: 60,
|
|
70
|
+
containWithinInMinutes: 24 * 60,
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
73
|
name: "Medium",
|
|
@@ -67,6 +75,8 @@ exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
|
67
75
|
color: BrandColors_1.Yellow,
|
|
68
76
|
order: 3,
|
|
69
77
|
level: SecurityCasePriorityLevel_1.default.Medium,
|
|
78
|
+
acknowledgeWithinInMinutes: 12 * 60,
|
|
79
|
+
containWithinInMinutes: 3 * 24 * 60,
|
|
70
80
|
},
|
|
71
81
|
{
|
|
72
82
|
name: "Low",
|
|
@@ -74,6 +84,8 @@ exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
|
74
84
|
color: BrandColors_1.Blue,
|
|
75
85
|
order: 4,
|
|
76
86
|
level: SecurityCasePriorityLevel_1.default.Low,
|
|
87
|
+
acknowledgeWithinInMinutes: 24 * 60,
|
|
88
|
+
containWithinInMinutes: 7 * 24 * 60,
|
|
77
89
|
},
|
|
78
90
|
{
|
|
79
91
|
name: "Informational",
|
|
@@ -81,6 +93,8 @@ exports.DEFAULT_SECURITY_CASE_PRIORITIES = [
|
|
|
81
93
|
color: BrandColors_1.Gray500,
|
|
82
94
|
order: 5,
|
|
83
95
|
level: SecurityCasePriorityLevel_1.default.Informational,
|
|
96
|
+
acknowledgeWithinInMinutes: null,
|
|
97
|
+
containWithinInMinutes: null,
|
|
84
98
|
},
|
|
85
99
|
];
|
|
86
100
|
const DEFINITION = StateOrder_1.STATE_LISTS[StateOrder_1.StateListType.SecurityCasePriority];
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export declare enum SecurityCaseTarget {
|
|
2
|
+
Acknowledge = "Acknowledge",
|
|
3
|
+
Contain = "Contain"
|
|
4
|
+
}
|
|
5
|
+
export declare const SECURITY_CASE_TARGETS: ReadonlyArray<SecurityCaseTarget>;
|
|
6
|
+
export declare const SECURITY_CASE_TARGET_AT_RISK_FRACTION: number;
|
|
7
|
+
export declare const MAX_SECURITY_CASE_TARGET_IN_MINUTES: number;
|
|
8
|
+
export interface SecurityCasePriorityTargets {
|
|
9
|
+
acknowledgeWithinInMinutes?: number | null | undefined;
|
|
10
|
+
containWithinInMinutes?: number | null | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface SecurityCaseTargetMoments {
|
|
13
|
+
createdAt?: Date | null | undefined;
|
|
14
|
+
acknowledgedAt?: Date | null | undefined;
|
|
15
|
+
containedAt?: Date | null | undefined;
|
|
16
|
+
closedAt?: Date | null | undefined;
|
|
17
|
+
acknowledgeDueAt?: Date | null | undefined;
|
|
18
|
+
containDueAt?: Date | null | undefined;
|
|
19
|
+
acknowledgeWarnedAt?: Date | null | undefined;
|
|
20
|
+
acknowledgeMissedAt?: Date | null | undefined;
|
|
21
|
+
containWarnedAt?: Date | null | undefined;
|
|
22
|
+
containMissedAt?: Date | null | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface SecurityCaseTargetColumns {
|
|
25
|
+
priorityColumn: keyof SecurityCasePriorityTargets;
|
|
26
|
+
dueColumn: "acknowledgeDueAt" | "containDueAt";
|
|
27
|
+
warnedColumn: "acknowledgeWarnedAt" | "containWarnedAt";
|
|
28
|
+
missedColumn: "acknowledgeMissedAt" | "containMissedAt";
|
|
29
|
+
}
|
|
30
|
+
export declare const SECURITY_CASE_TARGET_COLUMNS: Readonly<Record<SecurityCaseTarget, SecurityCaseTargetColumns>>;
|
|
31
|
+
export declare enum SecurityCaseTargetState {
|
|
32
|
+
None = "None",
|
|
33
|
+
OnTrack = "OnTrack",
|
|
34
|
+
AtRisk = "AtRisk",
|
|
35
|
+
Missed = "Missed",
|
|
36
|
+
Met = "Met",
|
|
37
|
+
MetLate = "MetLate"
|
|
38
|
+
}
|
|
39
|
+
export interface SecurityCaseTargetReading {
|
|
40
|
+
target: SecurityCaseTarget;
|
|
41
|
+
state: SecurityCaseTargetState;
|
|
42
|
+
dueAt: Date | null;
|
|
43
|
+
atRiskAt: Date | null;
|
|
44
|
+
metAt: Date | null;
|
|
45
|
+
targetInMinutes: number | null;
|
|
46
|
+
minutes: number | null;
|
|
47
|
+
}
|
|
48
|
+
export type SecurityCaseTargetWrite = Partial<Record<"acknowledgeDueAt" | "containDueAt" | "acknowledgeWarnedAt" | "acknowledgeMissedAt" | "containWarnedAt" | "containMissedAt" | "nextDueAt" | "nextTargetCheckAt", Date | null>>;
|
|
49
|
+
export declare function readTargetMinutes(value: unknown): number | null;
|
|
50
|
+
export declare function getTargetMinutes(priority: SecurityCasePriorityTargets | null | undefined, target: SecurityCaseTarget): number | null;
|
|
51
|
+
export declare function hasTargets(priority: SecurityCasePriorityTargets | null | undefined): boolean;
|
|
52
|
+
export declare function getTargetMetAt(securityCase: SecurityCaseTargetMoments, target: SecurityCaseTarget): Date | null;
|
|
53
|
+
export declare function getAtRiskAt(data: {
|
|
54
|
+
dueAt: Date | null;
|
|
55
|
+
targetInMinutes: number | null;
|
|
56
|
+
openedAt?: Date | null | undefined;
|
|
57
|
+
}): Date | null;
|
|
58
|
+
export declare function readSecurityCaseTarget(data: {
|
|
59
|
+
securityCase: SecurityCaseTargetMoments;
|
|
60
|
+
target: SecurityCaseTarget;
|
|
61
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
62
|
+
now: Date;
|
|
63
|
+
}): SecurityCaseTargetReading;
|
|
64
|
+
export declare function readSecurityCaseTargets(data: {
|
|
65
|
+
securityCase: SecurityCaseTargetMoments;
|
|
66
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
67
|
+
now: Date;
|
|
68
|
+
}): Array<SecurityCaseTargetReading>;
|
|
69
|
+
export declare function isPendingTarget(reading: SecurityCaseTargetReading): boolean;
|
|
70
|
+
export declare function getNextPendingTarget(readings: ReadonlyArray<SecurityCaseTargetReading>): SecurityCaseTargetReading | null;
|
|
71
|
+
export declare function getDueTimesForNewCase(data: {
|
|
72
|
+
openedAt: Date;
|
|
73
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
74
|
+
acknowledgedAt?: Date | null | undefined;
|
|
75
|
+
containedAt?: Date | null | undefined;
|
|
76
|
+
closedAt?: Date | null | undefined;
|
|
77
|
+
}): {
|
|
78
|
+
acknowledgeDueAt: Date | null;
|
|
79
|
+
containDueAt: Date | null;
|
|
80
|
+
};
|
|
81
|
+
export declare function getDueTimeAfterPriorityChange(data: {
|
|
82
|
+
dueAt: Date | null;
|
|
83
|
+
isSettled: boolean;
|
|
84
|
+
isRising: boolean;
|
|
85
|
+
newTargetInMinutes: number | null;
|
|
86
|
+
openedAt: Date;
|
|
87
|
+
now: Date;
|
|
88
|
+
}): Date | null | undefined;
|
|
89
|
+
export declare function getDueTimesAfterPriorityChange(data: {
|
|
90
|
+
securityCase: SecurityCaseTargetMoments;
|
|
91
|
+
newPriority: SecurityCasePriorityTargets | null | undefined;
|
|
92
|
+
isRising: boolean;
|
|
93
|
+
now: Date;
|
|
94
|
+
}): SecurityCaseTargetWrite;
|
|
95
|
+
export declare function getContainTargetAfterReopen(data: {
|
|
96
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
97
|
+
now: Date;
|
|
98
|
+
}): SecurityCaseTargetWrite;
|
|
99
|
+
export declare function getNextDueAt(securityCase: SecurityCaseTargetMoments): Date | null;
|
|
100
|
+
export declare function getNextTargetCheckAt(data: {
|
|
101
|
+
securityCase: SecurityCaseTargetMoments;
|
|
102
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
103
|
+
}): Date | null;
|
|
104
|
+
export declare function getTargetBookkeeping(data: {
|
|
105
|
+
securityCase: SecurityCaseTargetMoments;
|
|
106
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
107
|
+
}): {
|
|
108
|
+
nextDueAt: Date | null;
|
|
109
|
+
nextTargetCheckAt: Date | null;
|
|
110
|
+
};
|
|
111
|
+
export declare enum SecurityCaseTargetAlertKind {
|
|
112
|
+
AtRisk = "AtRisk",
|
|
113
|
+
Missed = "Missed"
|
|
114
|
+
}
|
|
115
|
+
export interface SecurityCaseTargetAlert {
|
|
116
|
+
target: SecurityCaseTarget;
|
|
117
|
+
kind: SecurityCaseTargetAlertKind;
|
|
118
|
+
dueAt: Date;
|
|
119
|
+
targetInMinutes: number | null;
|
|
120
|
+
}
|
|
121
|
+
export declare function getTargetAlertsDue(data: {
|
|
122
|
+
securityCase: SecurityCaseTargetMoments;
|
|
123
|
+
priority: SecurityCasePriorityTargets | null | undefined;
|
|
124
|
+
now: Date;
|
|
125
|
+
}): Array<SecurityCaseTargetAlert>;
|
|
126
|
+
export declare function getAlertStamps(alerts: ReadonlyArray<SecurityCaseTargetAlert>, now: Date): SecurityCaseTargetWrite;
|
|
127
|
+
export declare function describeTargetDuration(minutes: number): string;
|
|
128
|
+
export declare function getTargetVerb(target: SecurityCaseTarget): string;
|