@oneuptime/common 14.0.96 → 14.0.98

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.
Files changed (271) hide show
  1. package/Models/AnalyticsModels/NetworkFlow.d.mts +4 -0
  2. package/Models/AnalyticsModels/NetworkFlow.d.ts +4 -0
  3. package/Models/AnalyticsModels/NetworkFlow.js +50 -0
  4. package/Models/DatabaseModels/Alert.d.mts +2 -0
  5. package/Models/DatabaseModels/Alert.d.ts +2 -0
  6. package/Models/DatabaseModels/Alert.js +63 -0
  7. package/Models/DatabaseModels/CodeRepository.d.mts +3 -0
  8. package/Models/DatabaseModels/CodeRepository.d.ts +3 -0
  9. package/Models/DatabaseModels/CodeRepository.js +104 -0
  10. package/Models/DatabaseModels/Incident.d.mts +2 -0
  11. package/Models/DatabaseModels/Incident.d.ts +2 -0
  12. package/Models/DatabaseModels/Incident.js +63 -0
  13. package/Models/DatabaseModels/Index.js +12 -0
  14. package/Models/DatabaseModels/NetworkAddressName.d.mts +14 -0
  15. package/Models/DatabaseModels/NetworkAddressName.d.ts +14 -0
  16. package/Models/DatabaseModels/NetworkAddressName.js +300 -0
  17. package/Models/DatabaseModels/NetworkAddressName.mjs +2 -0
  18. package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
  19. package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
  20. package/Models/DatabaseModels/NetworkDevice.js +38 -0
  21. package/Models/DatabaseModels/SecurityCase.d.mts +8 -0
  22. package/Models/DatabaseModels/SecurityCase.d.ts +8 -0
  23. package/Models/DatabaseModels/SecurityCase.js +145 -0
  24. package/Models/DatabaseModels/SecurityCaseEvidence.d.mts +32 -0
  25. package/Models/DatabaseModels/SecurityCaseEvidence.d.ts +32 -0
  26. package/Models/DatabaseModels/SecurityCaseEvidence.js +548 -0
  27. package/Models/DatabaseModels/SecurityCaseEvidence.mjs +2 -0
  28. package/Models/DatabaseModels/SecurityCaseFeed.d.mts +4 -1
  29. package/Models/DatabaseModels/SecurityCaseFeed.d.ts +4 -1
  30. package/Models/DatabaseModels/SecurityCaseFeed.js +6 -0
  31. package/Models/DatabaseModels/SecurityCasePriority.d.mts +2 -0
  32. package/Models/DatabaseModels/SecurityCasePriority.d.ts +2 -0
  33. package/Models/DatabaseModels/SecurityCasePriority.js +44 -0
  34. package/Models/DatabaseModels/SecurityCaseTask.d.mts +22 -0
  35. package/Models/DatabaseModels/SecurityCaseTask.d.ts +22 -0
  36. package/Models/DatabaseModels/SecurityCaseTask.js +467 -0
  37. package/Models/DatabaseModels/SecurityCaseTask.mjs +2 -0
  38. package/Models/DatabaseModels/SecurityHunt.d.mts +34 -0
  39. package/Models/DatabaseModels/SecurityHunt.d.ts +34 -0
  40. package/Models/DatabaseModels/SecurityHunt.js +608 -0
  41. package/Models/DatabaseModels/SecurityHunt.mjs +2 -0
  42. package/Models/DatabaseModels/SecurityWatchlist.d.mts +22 -0
  43. package/Models/DatabaseModels/SecurityWatchlist.d.ts +22 -0
  44. package/Models/DatabaseModels/SecurityWatchlist.js +411 -0
  45. package/Models/DatabaseModels/SecurityWatchlist.mjs +2 -0
  46. package/Models/DatabaseModels/SecurityWatchlistItem.d.mts +17 -0
  47. package/Models/DatabaseModels/SecurityWatchlistItem.d.ts +17 -0
  48. package/Models/DatabaseModels/SecurityWatchlistItem.js +321 -0
  49. package/Models/DatabaseModels/SecurityWatchlistItem.mjs +2 -0
  50. package/Types/AI/AIChatTypes.d.mts +1 -0
  51. package/Types/AI/AIChatTypes.d.ts +1 -0
  52. package/Types/AI/AIRunEventType.d.mts +1 -0
  53. package/Types/AI/AIRunEventType.d.ts +1 -0
  54. package/Types/AI/AIRunEventType.js +8 -0
  55. package/Types/AI/AiAffectedResources.d.mts +2 -1
  56. package/Types/AI/AiAffectedResources.d.ts +2 -1
  57. package/Types/AI/AiAffectedResources.js +12 -1
  58. package/Types/AI/AiTokenCount.d.mts +22 -1
  59. package/Types/AI/AiTokenCount.d.ts +22 -1
  60. package/Types/AI/AiTokenCount.js +126 -57
  61. package/Types/AI/AiTokenCount.mjs +2 -0
  62. package/Types/AI/CodeFixTaskContext.d.mts +1 -0
  63. package/Types/AI/CodeFixTaskContext.d.ts +1 -0
  64. package/Types/AffectedResources/AffectedResourceSearch.d.mts +53 -0
  65. package/Types/AffectedResources/AffectedResourceSearch.d.ts +53 -0
  66. package/Types/AffectedResources/AffectedResourceSearch.js +224 -0
  67. package/Types/AffectedResources/AffectedResourceSearch.mjs +11 -0
  68. package/Types/ArchivableValue/ArchivableValueUsage.d.mts +21 -2
  69. package/Types/ArchivableValue/ArchivableValueUsage.d.ts +21 -2
  70. package/Types/ArchivableValue/ArchivableValueUsage.js +91 -12
  71. package/Types/ArchivableValue/ArchivableValueUsage.mjs +1 -0
  72. package/Types/CodeRepository/CodeRepositorySetting.d.mts +1 -0
  73. package/Types/CodeRepository/CodeRepositorySetting.d.ts +1 -0
  74. package/Types/CodeRepository/CodeRepositorySetting.js +2 -0
  75. package/Types/Color.d.mts +0 -2
  76. package/Types/Color.d.ts +0 -2
  77. package/Types/Color.js +0 -14
  78. package/Types/Database/DatabaseProperty.d.mts +0 -2
  79. package/Types/Database/DatabaseProperty.d.ts +0 -2
  80. package/Types/Database/DatabaseProperty.js +0 -3
  81. package/Types/Date.d.mts +0 -2
  82. package/Types/Date.d.ts +0 -2
  83. package/Types/Date.js +0 -23
  84. package/Types/Domain.d.mts +0 -2
  85. package/Types/Domain.d.ts +0 -2
  86. package/Types/Domain.js +0 -14
  87. package/Types/Email/EmailTemplateType.d.mts +3 -0
  88. package/Types/Email/EmailTemplateType.d.ts +3 -0
  89. package/Types/Email/EmailTemplateType.js +4 -0
  90. package/Types/Email.d.mts +0 -2
  91. package/Types/Email.d.ts +0 -2
  92. package/Types/Email.js +0 -15
  93. package/Types/IP/IP.d.mts +0 -2
  94. package/Types/IP/IP.d.ts +0 -2
  95. package/Types/IP/IP.js +0 -14
  96. package/Types/Link.d.mts +1 -0
  97. package/Types/Link.d.ts +1 -0
  98. package/Types/Monitor/CriteriaAlert.d.mts +0 -2
  99. package/Types/Monitor/CriteriaAlert.d.ts +0 -2
  100. package/Types/Monitor/CriteriaAlert.js +0 -18
  101. package/Types/Monitor/CriteriaAlert.mjs +1 -2
  102. package/Types/Monitor/CriteriaFilter.d.mts +0 -2
  103. package/Types/Monitor/CriteriaFilter.d.ts +0 -2
  104. package/Types/Monitor/CriteriaFilter.js +1 -42
  105. package/Types/Monitor/CriteriaFilter.mjs +0 -1
  106. package/Types/Monitor/CriteriaIncident.d.mts +0 -2
  107. package/Types/Monitor/CriteriaIncident.d.ts +0 -2
  108. package/Types/Monitor/CriteriaIncident.js +0 -23
  109. package/Types/Monitor/CriteriaIncident.mjs +1 -2
  110. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.mts +0 -2
  111. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.ts +0 -2
  112. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.js +0 -11
  113. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.mjs +1 -2
  114. package/Types/Monitor/MonitorCriteria.d.mts +0 -2
  115. package/Types/Monitor/MonitorCriteria.d.ts +0 -2
  116. package/Types/Monitor/MonitorCriteria.js +0 -21
  117. package/Types/Monitor/MonitorCriteriaInstance.d.mts +0 -2
  118. package/Types/Monitor/MonitorCriteriaInstance.d.ts +0 -2
  119. package/Types/Monitor/MonitorCriteriaInstance.js +0 -54
  120. package/Types/Monitor/MonitorStep.d.mts +0 -2
  121. package/Types/Monitor/MonitorStep.d.ts +0 -2
  122. package/Types/Monitor/MonitorStep.js +0 -80
  123. package/Types/Monitor/MonitorSteps.d.mts +0 -2
  124. package/Types/Monitor/MonitorSteps.d.ts +0 -2
  125. package/Types/Monitor/MonitorSteps.js +0 -31
  126. package/Types/Name.d.mts +0 -2
  127. package/Types/Name.d.ts +0 -2
  128. package/Types/Name.js +0 -14
  129. package/Types/NetFlow/NetworkAddressName.d.mts +30 -0
  130. package/Types/NetFlow/NetworkAddressName.d.ts +30 -0
  131. package/Types/NetFlow/NetworkAddressName.js +149 -0
  132. package/Types/NetFlow/NetworkAddressName.mjs +6 -0
  133. package/Types/NetFlow/NetworkTraffic.d.mts +20 -0
  134. package/Types/NetFlow/NetworkTraffic.d.ts +20 -0
  135. package/Types/NetFlow/NetworkTraffic.js +5 -1
  136. package/Types/NetFlow/NetworkTraffic.mjs +2 -0
  137. package/Types/NetworkController/NetworkControllerReadSummary.d.mts +2 -0
  138. package/Types/NetworkController/NetworkControllerReadSummary.d.ts +2 -0
  139. package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
  140. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +47 -1
  141. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +47 -1
  142. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +173 -8
  143. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
  144. package/Types/NotificationSetting/NotificationEmailRollupCategory.d.mts +1 -0
  145. package/Types/NotificationSetting/NotificationEmailRollupCategory.d.ts +1 -0
  146. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +12 -0
  147. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +6 -0
  148. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +3 -0
  149. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +3 -0
  150. package/Types/NotificationSetting/NotificationSettingEventType.js +15 -0
  151. package/Types/ObjectID.d.mts +0 -1
  152. package/Types/ObjectID.d.ts +0 -1
  153. package/Types/ObjectID.js +0 -9
  154. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.mts +4 -0
  155. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.ts +4 -0
  156. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.js +25 -1
  157. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.mjs +4 -0
  158. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.mts +15 -0
  159. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.ts +15 -0
  160. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.js +118 -0
  161. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.mjs +9 -0
  162. package/Types/Permission.d.mts +8 -0
  163. package/Types/Permission.d.ts +8 -0
  164. package/Types/Permission.js +87 -3
  165. package/Types/Phone.d.mts +0 -2
  166. package/Types/Phone.d.ts +0 -2
  167. package/Types/Phone.js +0 -14
  168. package/Types/Port.d.mts +0 -2
  169. package/Types/Port.d.ts +0 -2
  170. package/Types/Port.js +0 -14
  171. package/Types/ProviderLogo/ProviderLogo.d.mts +8 -1
  172. package/Types/ProviderLogo/ProviderLogo.d.ts +8 -1
  173. package/Types/ProviderLogo/ProviderLogo.js +14 -0
  174. package/Types/SecurityCase/SecurityCaseEventEvidence.d.mts +67 -0
  175. package/Types/SecurityCase/SecurityCaseEventEvidence.d.ts +67 -0
  176. package/Types/SecurityCase/SecurityCaseEventEvidence.js +271 -0
  177. package/Types/SecurityCase/SecurityCaseEventEvidence.mjs +13 -0
  178. package/Types/SecurityCase/SecurityCaseEvidenceKind.d.mts +8 -0
  179. package/Types/SecurityCase/SecurityCaseEvidenceKind.d.ts +8 -0
  180. package/Types/SecurityCase/SecurityCaseEvidenceKind.js +34 -0
  181. package/Types/SecurityCase/SecurityCaseEvidenceKind.mjs +4 -0
  182. package/Types/SecurityEvent/SecurityHunt.d.mts +122 -0
  183. package/Types/SecurityEvent/SecurityHunt.d.ts +122 -0
  184. package/Types/SecurityEvent/SecurityHunt.js +391 -0
  185. package/Types/SecurityEvent/SecurityHunt.mjs +32 -0
  186. package/Types/SecurityEvent/SecurityWatchlist.d.mts +167 -0
  187. package/Types/SecurityEvent/SecurityWatchlist.d.ts +167 -0
  188. package/Types/SecurityEvent/SecurityWatchlist.js +648 -0
  189. package/Types/SecurityEvent/SecurityWatchlist.mjs +51 -0
  190. package/Types/SecurityEvent/SigmaRule.d.mts +2 -0
  191. package/Types/SecurityEvent/SigmaRule.d.ts +2 -0
  192. package/Types/SecurityEvent/SigmaRule.js +5 -0
  193. package/Types/Telemetry/OpenTelemetryGuides.js +177 -5
  194. package/Types/Version.d.mts +0 -2
  195. package/Types/Version.d.ts +0 -2
  196. package/Types/Version.js +0 -14
  197. package/Types/Workflow/AffectedResourcesSetting.d.mts +13 -0
  198. package/Types/Workflow/AffectedResourcesSetting.d.ts +13 -0
  199. package/Types/Workflow/AffectedResourcesSetting.js +120 -0
  200. package/Types/Workflow/AffectedResourcesSetting.mjs +8 -0
  201. package/Types/Workflow/Components/BaseModel.js +15 -3
  202. package/Types/Workflow/Documentation/DatabaseDocumentation.js +36 -0
  203. package/Types/Workflow/RunRecord.d.mts +3 -14
  204. package/Types/Workflow/RunRecord.d.ts +3 -14
  205. package/Types/Workflow/RunRecord.js +10 -51
  206. package/Utils/AI/InvestigationLogStall.d.mts +38 -0
  207. package/Utils/AI/InvestigationLogStall.d.ts +38 -0
  208. package/Utils/AI/InvestigationLogStall.js +163 -0
  209. package/Utils/AI/InvestigationLogStall.mjs +11 -0
  210. package/Utils/Inventory/AssetFactSource.d.mts +6 -2
  211. package/Utils/Inventory/AssetFactSource.d.ts +6 -2
  212. package/Utils/Inventory/AssetFactSource.js +18 -1
  213. package/Utils/Inventory/AssetFactSource.mjs +1 -0
  214. package/Utils/Markdown/FeedLead.d.mts +10 -0
  215. package/Utils/Markdown/FeedLead.d.ts +10 -0
  216. package/Utils/Markdown/FeedLead.js +198 -0
  217. package/Utils/Markdown/FeedLead.mjs +8 -0
  218. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +9 -1
  219. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +9 -1
  220. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +139 -18
  221. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
  222. package/Utils/NetworkDevice/NetworkDeviceRefresh.d.mts +88 -0
  223. package/Utils/NetworkDevice/NetworkDeviceRefresh.d.ts +88 -0
  224. package/Utils/NetworkDevice/NetworkDeviceRefresh.js +232 -0
  225. package/Utils/NetworkDevice/NetworkDeviceRefresh.mjs +16 -0
  226. package/Utils/NetworkTraffic/NetworkAddressBlock.d.mts +20 -0
  227. package/Utils/NetworkTraffic/NetworkAddressBlock.d.ts +20 -0
  228. package/Utils/NetworkTraffic/NetworkAddressBlock.js +264 -0
  229. package/Utils/NetworkTraffic/NetworkAddressBlock.mjs +3 -0
  230. package/Utils/Project/RecordNumber.d.mts +43 -0
  231. package/Utils/Project/RecordNumber.d.ts +43 -0
  232. package/Utils/Project/RecordNumber.js +151 -0
  233. package/Utils/Project/RecordNumber.mjs +6 -0
  234. package/Utils/Schema/MonitorSchemas.d.mts +9 -0
  235. package/Utils/Schema/MonitorSchemas.d.ts +9 -0
  236. package/Utils/Schema/MonitorSchemas.js +291 -0
  237. package/Utils/Schema/MonitorSchemas.mjs +9 -0
  238. package/Utils/Schema/TypeSchemas.d.mts +12 -0
  239. package/Utils/Schema/TypeSchemas.d.ts +12 -0
  240. package/Utils/Schema/TypeSchemas.js +176 -0
  241. package/Utils/Schema/TypeSchemas.mjs +11 -0
  242. package/Utils/Schema/Zod.js +17 -17
  243. package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +43 -0
  244. package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +43 -0
  245. package/Utils/SecurityCase/SecurityCaseMarkdown.js +89 -0
  246. package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +11 -0
  247. package/Utils/SecurityCase/SecurityCasePriorities.d.mts +2 -0
  248. package/Utils/SecurityCase/SecurityCasePriorities.d.ts +2 -0
  249. package/Utils/SecurityCase/SecurityCasePriorities.js +15 -1
  250. package/Utils/SecurityCase/SecurityCaseTargets.d.mts +128 -0
  251. package/Utils/SecurityCase/SecurityCaseTargets.d.ts +128 -0
  252. package/Utils/SecurityCase/SecurityCaseTargets.js +482 -0
  253. package/Utils/SecurityCase/SecurityCaseTargets.mjs +28 -0
  254. package/Utils/SecurityEvent/SecurityEventSearch.d.mts +56 -0
  255. package/Utils/SecurityEvent/SecurityEventSearch.d.ts +56 -0
  256. package/Utils/SecurityEvent/SecurityEventSearch.js +422 -0
  257. package/Utils/SecurityEvent/SecurityEventSearch.mjs +21 -0
  258. package/Utils/SecurityEvent/SecurityHuntSearch.d.mts +12 -0
  259. package/Utils/SecurityEvent/SecurityHuntSearch.d.ts +12 -0
  260. package/Utils/SecurityEvent/SecurityHuntSearch.js +51 -0
  261. package/Utils/SecurityEvent/SecurityHuntSearch.mjs +3 -0
  262. package/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +22 -0
  263. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.mts +24 -0
  264. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.ts +24 -0
  265. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.js +183 -0
  266. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.mjs +9 -0
  267. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +9 -0
  268. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +9 -0
  269. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +69 -1
  270. package/Utils/Suggestions/TracePerformanceFixSuggestion.mjs +4 -0
  271. package/package.json +1 -1
@@ -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;
@@ -4,28 +4,28 @@ const zod_to_openapi_1 = require("@asteasolutions/zod-to-openapi");
4
4
  const OpenApiMetadataRegistry_1 = require("./OpenApiMetadataRegistry");
5
5
  const zod_1 = require("zod");
6
6
  /*
7
- * In a browser, zod turns no string into code. zod 4 compiles each object
8
- * schema's parser with new Function, and checks that it may by calling new
9
- * Function as the first object schema is made - which the monitor criteria
10
- * Types do as their modules load, so on every page of every frontend. Status
11
- * pages forbid that (StatusPageContentSecurityPolicy has no 'unsafe-eval'),
12
- * and the browser refused it and reported a violation on each load. No
13
- * frontend parses with zod; jitless zod parses the same, without the
14
- * compiled fast path. On the server zod keeps it.
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.)
15
17
  */
16
18
  if (typeof window !== "undefined" && typeof window.document !== "undefined") {
17
19
  (0, zod_1.config)({ jitless: true });
18
20
  }
19
21
  /*
20
- * Every frontend bundles this module: Common's Types (Email, ObjectID,
21
- * Color, MonitorStep and the rest) build their OpenAPI schema with it, and
22
- * the Dashboard, Accounts, Admin Dashboard, Status Page and public
23
- * dashboards all load those Types. So nothing here hands zod's namespace
24
- * around as a value. A bundler keeps all of an object that is passed or
25
- * exported whole, and zod 4's namespace carries every one of its ~45 locales:
26
- * that put about 480 KB of zod (100 KB gzipped) into every frontend, where
27
- * zod 3 cost 66 KB. Picked by name, zod costs what the schemas below use
28
- * (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.
29
29
  *
30
30
  * zod-to-openapi's .openapi(): extendZodWithOpenApi adds it to ZodType's
31
31
  * prototype and reads nothing else of the zod it is given, so it is given
@@ -175,3 +175,46 @@ 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 eventsAddedMarkdown(data: {
204
+ count: number;
205
+ huntName?: string | undefined;
206
+ }): MarkdownText;
207
+ export declare function eventEvidenceLineMarkdown(data: {
208
+ time: string;
209
+ severity: string;
210
+ name: string;
211
+ }): MarkdownText;
212
+ export declare function targetAtRiskMarkdown(data: {
213
+ target: string;
214
+ timeLeft: string;
215
+ targetDuration?: string | undefined;
216
+ }): MarkdownText;
217
+ export declare function targetMissedMarkdown(data: {
218
+ target: string;
219
+ targetDuration?: string | undefined;
220
+ }): MarkdownText;
@@ -175,3 +175,46 @@ 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 eventsAddedMarkdown(data: {
204
+ count: number;
205
+ huntName?: string | undefined;
206
+ }): MarkdownText;
207
+ export declare function eventEvidenceLineMarkdown(data: {
208
+ time: string;
209
+ severity: string;
210
+ name: string;
211
+ }): MarkdownText;
212
+ export declare function targetAtRiskMarkdown(data: {
213
+ target: string;
214
+ timeLeft: string;
215
+ targetDuration?: string | undefined;
216
+ }): MarkdownText;
217
+ export declare function targetMissedMarkdown(data: {
218
+ target: string;
219
+ targetDuration?: string | undefined;
220
+ }): MarkdownText;
@@ -58,6 +58,17 @@ 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.eventsAddedMarkdown = eventsAddedMarkdown;
69
+ exports.eventEvidenceLineMarkdown = eventEvidenceLineMarkdown;
70
+ exports.targetAtRiskMarkdown = targetAtRiskMarkdown;
71
+ exports.targetMissedMarkdown = targetMissedMarkdown;
61
72
  const FeedMarkdown_1 = __importStar(require("../Markdown/FeedMarkdown"));
62
73
  const MitreAttack_1 = require("../../Types/SecurityEvent/MitreAttack");
63
74
  const SecurityConnection_1 = require("../../Types/SecurityCase/SecurityConnection");
@@ -390,3 +401,81 @@ function entityRiskMarkdown(data) {
390
401
  }
391
402
  return FeedMarkdown_1.default.join(parts, "\n\n");
392
403
  }
404
+ // ---------- Tasks, evidence and response targets ----------
405
+ /*
406
+ * What a case's timeline says about its tasks (SecurityCaseTaskService):
407
+ * added, done, opened again, handed to somebody, deleted. A task's title is
408
+ * a person's words, and a person's name comes from their profile, so both
409
+ * are escaped text.
410
+ */
411
+ function taskAddedMarkdown(data) {
412
+ return data.assigneeName
413
+ ? (0, FeedMarkdown_1.mdText) `📋 Added the task **${data.title}** and assigned it to **${data.assigneeName}**.`
414
+ : (0, FeedMarkdown_1.mdText) `📋 Added the task **${data.title}**.`;
415
+ }
416
+ function taskDoneMarkdown(data) {
417
+ return (0, FeedMarkdown_1.mdText) `☑️ Completed the task **${data.title}**.`;
418
+ }
419
+ function taskReopenedMarkdown(data) {
420
+ return (0, FeedMarkdown_1.mdText) `↩️ Reopened the task **${data.title}**.`;
421
+ }
422
+ function taskAssignedMarkdown(data) {
423
+ return data.assigneeName
424
+ ? (0, FeedMarkdown_1.mdText) `👤 Assigned the task **${data.title}** to **${data.assigneeName}**.`
425
+ : (0, FeedMarkdown_1.mdText) `👤 Unassigned the task **${data.title}**.`;
426
+ }
427
+ function taskDeletedMarkdown(data) {
428
+ return (0, FeedMarkdown_1.mdText) `🗑️ Deleted the task **${data.title}**.`;
429
+ }
430
+ /*
431
+ * What a case's timeline says about its evidence
432
+ * (SecurityCaseEvidenceService). A file's name is the uploader's, a link's
433
+ * address points outside OneUptime: each is code, so neither turns into a
434
+ * link or an image wherever the timeline is shown.
435
+ */
436
+ function evidenceAddedMarkdown(data) {
437
+ if (data.sha256) {
438
+ return (0, FeedMarkdown_1.mdText) `🗄️ Added the file **${data.name}** as evidence. SHA-256 ${FeedMarkdown_1.default.code(data.sha256)}.`;
439
+ }
440
+ if (data.url) {
441
+ return (0, FeedMarkdown_1.mdText) `🔗 Added the link **${data.name}** as evidence: ${FeedMarkdown_1.default.code(data.url)}.`;
442
+ }
443
+ return (0, FeedMarkdown_1.mdText) `🗄️ Added **${data.name}** as evidence.`;
444
+ }
445
+ function evidenceRemovedMarkdown(data) {
446
+ return (0, FeedMarkdown_1.mdText) `🗑️ Removed **${data.name}** from the evidence.`;
447
+ }
448
+ /*
449
+ * What a case's timeline says when security events are kept on it as
450
+ * evidence (SecurityCaseEvidenceService.addEvents): how many, and the hunt
451
+ * that found them when one did. Each event is a line under it
452
+ * (eventEvidenceLineMarkdown).
453
+ */
454
+ function eventsAddedMarkdown(data) {
455
+ const events = data.count === 1 ? "1 security event" : `${data.count} security events`;
456
+ return data.huntName
457
+ ? (0, FeedMarkdown_1.mdText) `🔖 Kept ${events} found by the hunt **${data.huntName}** as evidence.`
458
+ : (0, FeedMarkdown_1.mdText) `🔖 Kept ${events} as evidence.`;
459
+ }
460
+ // One kept event, as a line under that entry: when, how severe, and what it was.
461
+ function eventEvidenceLineMarkdown(data) {
462
+ return data.severity
463
+ ? (0, FeedMarkdown_1.mdText) `${data.time} · ${data.severity} · ${data.name}`
464
+ : (0, FeedMarkdown_1.mdText) `${data.time} · ${data.name}`;
465
+ }
466
+ /*
467
+ * What a case's timeline says when it is about to miss a response target,
468
+ * and when it misses it (SecurityCaseTargetCheck). `target` is the verb -
469
+ * "acknowledge", "contain" - and the durations are in words already
470
+ * ("3 minutes", "4 hours").
471
+ */
472
+ function targetAtRiskMarkdown(data) {
473
+ return data.targetDuration
474
+ ? (0, FeedMarkdown_1.mdText) `⏰ About to miss its **${data.target}** target of ${data.targetDuration}: ${data.timeLeft} left.`
475
+ : (0, FeedMarkdown_1.mdText) `⏰ About to miss its **${data.target}** target: ${data.timeLeft} left.`;
476
+ }
477
+ function targetMissedMarkdown(data) {
478
+ return data.targetDuration
479
+ ? (0, FeedMarkdown_1.mdText) `🚨 Missed its **${data.target}** target of ${data.targetDuration}.`
480
+ : (0, FeedMarkdown_1.mdText) `🚨 Missed its **${data.target}** target.`;
481
+ }
@@ -12,6 +12,10 @@ 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 eventEvidenceLineMarkdown = commonJsModule.eventEvidenceLineMarkdown;
16
+ export const eventsAddedMarkdown = commonJsModule.eventsAddedMarkdown;
17
+ export const evidenceAddedMarkdown = commonJsModule.evidenceAddedMarkdown;
18
+ export const evidenceRemovedMarkdown = commonJsModule.evidenceRemovedMarkdown;
15
19
  export const incidentDeclaredFromCaseMarkdown = commonJsModule.incidentDeclaredFromCaseMarkdown;
16
20
  export const incidentDeclaredMarkdown = commonJsModule.incidentDeclaredMarkdown;
17
21
  export const noteAddedMarkdown = commonJsModule.noteAddedMarkdown;
@@ -25,5 +29,12 @@ export const priorityChangedMarkdown = commonJsModule.priorityChangedMarkdown;
25
29
  export const renderSecurityCaseTemplate = commonJsModule.renderSecurityCaseTemplate;
26
30
  export const securityCaseSummaryMarkdown = commonJsModule.securityCaseSummaryMarkdown;
27
31
  export const statusChangedMarkdown = commonJsModule.statusChangedMarkdown;
32
+ export const targetAtRiskMarkdown = commonJsModule.targetAtRiskMarkdown;
33
+ export const targetMissedMarkdown = commonJsModule.targetMissedMarkdown;
28
34
  export const targetUndoneMarkdown = commonJsModule.targetUndoneMarkdown;
35
+ export const taskAddedMarkdown = commonJsModule.taskAddedMarkdown;
36
+ export const taskAssignedMarkdown = commonJsModule.taskAssignedMarkdown;
37
+ export const taskDeletedMarkdown = commonJsModule.taskDeletedMarkdown;
38
+ export const taskDoneMarkdown = commonJsModule.taskDoneMarkdown;
39
+ export const taskReopenedMarkdown = commonJsModule.taskReopenedMarkdown;
29
40
  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;