@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.
Files changed (253) 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/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
  8. package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
  9. package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
  10. package/Models/DatabaseModels/DetectionRuleException.js +412 -0
  11. package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
  12. package/Models/DatabaseModels/Incident.d.mts +2 -0
  13. package/Models/DatabaseModels/Incident.d.ts +2 -0
  14. package/Models/DatabaseModels/Incident.js +63 -0
  15. package/Models/DatabaseModels/Index.js +12 -0
  16. package/Models/DatabaseModels/NetworkAddressName.d.mts +14 -0
  17. package/Models/DatabaseModels/NetworkAddressName.d.ts +14 -0
  18. package/Models/DatabaseModels/NetworkAddressName.js +300 -0
  19. package/Models/DatabaseModels/NetworkAddressName.mjs +2 -0
  20. package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
  21. package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
  22. package/Models/DatabaseModels/NetworkDevice.js +38 -0
  23. package/Models/DatabaseModels/SecurityCase.d.mts +8 -0
  24. package/Models/DatabaseModels/SecurityCase.d.ts +8 -0
  25. package/Models/DatabaseModels/SecurityCase.js +145 -0
  26. package/Models/DatabaseModels/SecurityCaseEvidence.d.mts +28 -0
  27. package/Models/DatabaseModels/SecurityCaseEvidence.d.ts +28 -0
  28. package/Models/DatabaseModels/SecurityCaseEvidence.js +489 -0
  29. package/Models/DatabaseModels/SecurityCaseEvidence.mjs +2 -0
  30. package/Models/DatabaseModels/SecurityCaseFeed.d.mts +4 -1
  31. package/Models/DatabaseModels/SecurityCaseFeed.d.ts +4 -1
  32. package/Models/DatabaseModels/SecurityCaseFeed.js +6 -0
  33. package/Models/DatabaseModels/SecurityCasePriority.d.mts +2 -0
  34. package/Models/DatabaseModels/SecurityCasePriority.d.ts +2 -0
  35. package/Models/DatabaseModels/SecurityCasePriority.js +44 -0
  36. package/Models/DatabaseModels/SecurityCaseTask.d.mts +22 -0
  37. package/Models/DatabaseModels/SecurityCaseTask.d.ts +22 -0
  38. package/Models/DatabaseModels/SecurityCaseTask.js +467 -0
  39. package/Models/DatabaseModels/SecurityCaseTask.mjs +2 -0
  40. package/Models/DatabaseModels/SecurityWatchlist.d.mts +22 -0
  41. package/Models/DatabaseModels/SecurityWatchlist.d.ts +22 -0
  42. package/Models/DatabaseModels/SecurityWatchlist.js +411 -0
  43. package/Models/DatabaseModels/SecurityWatchlist.mjs +2 -0
  44. package/Models/DatabaseModels/SecurityWatchlistItem.d.mts +17 -0
  45. package/Models/DatabaseModels/SecurityWatchlistItem.d.ts +17 -0
  46. package/Models/DatabaseModels/SecurityWatchlistItem.js +321 -0
  47. package/Models/DatabaseModels/SecurityWatchlistItem.mjs +2 -0
  48. package/Types/AI/AiAffectedResources.d.mts +2 -1
  49. package/Types/AI/AiAffectedResources.d.ts +2 -1
  50. package/Types/AI/AiAffectedResources.js +12 -1
  51. package/Types/AffectedResources/AffectedResourceSearch.d.mts +53 -0
  52. package/Types/AffectedResources/AffectedResourceSearch.d.ts +53 -0
  53. package/Types/AffectedResources/AffectedResourceSearch.js +224 -0
  54. package/Types/AffectedResources/AffectedResourceSearch.mjs +11 -0
  55. package/Types/ArchivableValue/ArchivableValueUsage.d.mts +21 -2
  56. package/Types/ArchivableValue/ArchivableValueUsage.d.ts +21 -2
  57. package/Types/ArchivableValue/ArchivableValueUsage.js +91 -12
  58. package/Types/ArchivableValue/ArchivableValueUsage.mjs +1 -0
  59. package/Types/Color.d.mts +0 -2
  60. package/Types/Color.d.ts +0 -2
  61. package/Types/Color.js +0 -14
  62. package/Types/Database/DatabaseProperty.d.mts +0 -2
  63. package/Types/Database/DatabaseProperty.d.ts +0 -2
  64. package/Types/Database/DatabaseProperty.js +0 -3
  65. package/Types/Database/TableColumn.d.mts +8 -0
  66. package/Types/Database/TableColumn.d.ts +8 -0
  67. package/Types/Database/TableColumn.js +69 -23
  68. package/Types/Database/TableColumn.mjs +1 -0
  69. package/Types/Date.d.mts +0 -2
  70. package/Types/Date.d.ts +0 -2
  71. package/Types/Date.js +0 -23
  72. package/Types/Domain.d.mts +0 -2
  73. package/Types/Domain.d.ts +0 -2
  74. package/Types/Domain.js +0 -14
  75. package/Types/Email/EmailTemplateType.d.mts +2 -0
  76. package/Types/Email/EmailTemplateType.d.ts +2 -0
  77. package/Types/Email/EmailTemplateType.js +2 -0
  78. package/Types/Email.d.mts +0 -2
  79. package/Types/Email.d.ts +0 -2
  80. package/Types/Email.js +0 -15
  81. package/Types/IP/IP.d.mts +0 -2
  82. package/Types/IP/IP.d.ts +0 -2
  83. package/Types/IP/IP.js +0 -14
  84. package/Types/JSONFunctions.js +16 -1
  85. package/Types/Monitor/CriteriaAlert.d.mts +0 -2
  86. package/Types/Monitor/CriteriaAlert.d.ts +0 -2
  87. package/Types/Monitor/CriteriaAlert.js +0 -18
  88. package/Types/Monitor/CriteriaAlert.mjs +1 -2
  89. package/Types/Monitor/CriteriaFilter.d.mts +0 -2
  90. package/Types/Monitor/CriteriaFilter.d.ts +0 -2
  91. package/Types/Monitor/CriteriaFilter.js +1 -42
  92. package/Types/Monitor/CriteriaFilter.mjs +0 -1
  93. package/Types/Monitor/CriteriaIncident.d.mts +0 -2
  94. package/Types/Monitor/CriteriaIncident.d.ts +0 -2
  95. package/Types/Monitor/CriteriaIncident.js +0 -23
  96. package/Types/Monitor/CriteriaIncident.mjs +1 -2
  97. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.mts +0 -2
  98. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.ts +0 -2
  99. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.js +0 -11
  100. package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.mjs +1 -2
  101. package/Types/Monitor/MonitorCriteria.d.mts +0 -2
  102. package/Types/Monitor/MonitorCriteria.d.ts +0 -2
  103. package/Types/Monitor/MonitorCriteria.js +0 -21
  104. package/Types/Monitor/MonitorCriteriaInstance.d.mts +0 -2
  105. package/Types/Monitor/MonitorCriteriaInstance.d.ts +0 -2
  106. package/Types/Monitor/MonitorCriteriaInstance.js +0 -54
  107. package/Types/Monitor/MonitorStep.d.mts +0 -2
  108. package/Types/Monitor/MonitorStep.d.ts +0 -2
  109. package/Types/Monitor/MonitorStep.js +0 -80
  110. package/Types/Monitor/MonitorSteps.d.mts +0 -2
  111. package/Types/Monitor/MonitorSteps.d.ts +0 -2
  112. package/Types/Monitor/MonitorSteps.js +0 -31
  113. package/Types/Monitor/MonitorType.js +5 -4
  114. package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
  115. package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
  116. package/Types/Monitor/TelemetryAlertRule.js +886 -0
  117. package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
  118. package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
  119. package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
  120. package/Types/Monitor/TelemetryRulePreview.js +190 -0
  121. package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
  122. package/Types/Name.d.mts +0 -2
  123. package/Types/Name.d.ts +0 -2
  124. package/Types/Name.js +0 -14
  125. package/Types/NetFlow/NetworkAddressName.d.mts +30 -0
  126. package/Types/NetFlow/NetworkAddressName.d.ts +30 -0
  127. package/Types/NetFlow/NetworkAddressName.js +149 -0
  128. package/Types/NetFlow/NetworkAddressName.mjs +6 -0
  129. package/Types/NetFlow/NetworkTraffic.d.mts +20 -0
  130. package/Types/NetFlow/NetworkTraffic.d.ts +20 -0
  131. package/Types/NetFlow/NetworkTraffic.js +5 -1
  132. package/Types/NetFlow/NetworkTraffic.mjs +2 -0
  133. package/Types/NetworkController/NetworkControllerReadSummary.d.mts +2 -0
  134. package/Types/NetworkController/NetworkControllerReadSummary.d.ts +2 -0
  135. package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
  136. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +47 -1
  137. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +47 -1
  138. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +173 -8
  139. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
  140. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +3 -0
  141. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +6 -0
  142. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +2 -0
  143. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +2 -0
  144. package/Types/NotificationSetting/NotificationSettingEventType.js +9 -0
  145. package/Types/ObjectID.d.mts +0 -1
  146. package/Types/ObjectID.d.ts +0 -1
  147. package/Types/ObjectID.js +0 -9
  148. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
  149. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
  150. package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
  151. package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
  152. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.mts +4 -0
  153. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.ts +4 -0
  154. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.js +25 -1
  155. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.mjs +4 -0
  156. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.mts +15 -0
  157. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.ts +15 -0
  158. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.js +118 -0
  159. package/Types/OnCallDutyPolicy/OnCallEmptyLevel.mjs +9 -0
  160. package/Types/Permission.d.mts +8 -0
  161. package/Types/Permission.d.ts +8 -0
  162. package/Types/Permission.js +87 -3
  163. package/Types/Phone.d.mts +0 -2
  164. package/Types/Phone.d.ts +0 -2
  165. package/Types/Phone.js +0 -14
  166. package/Types/Port.d.mts +0 -2
  167. package/Types/Port.d.ts +0 -2
  168. package/Types/Port.js +0 -14
  169. package/Types/ProviderLogo/ProviderLogo.d.mts +24 -1
  170. package/Types/ProviderLogo/ProviderLogo.d.ts +24 -1
  171. package/Types/ProviderLogo/ProviderLogo.js +47 -0
  172. package/Types/SecurityCase/SecurityCaseEvidenceKind.d.mts +7 -0
  173. package/Types/SecurityCase/SecurityCaseEvidenceKind.d.ts +7 -0
  174. package/Types/SecurityCase/SecurityCaseEvidenceKind.js +24 -0
  175. package/Types/SecurityCase/SecurityCaseEvidenceKind.mjs +4 -0
  176. package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
  177. package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
  178. package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
  179. package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
  180. package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
  181. package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
  182. package/Types/SecurityEvent/DetectionRuleException.js +441 -0
  183. package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
  184. package/Types/SecurityEvent/SecurityWatchlist.d.mts +167 -0
  185. package/Types/SecurityEvent/SecurityWatchlist.d.ts +167 -0
  186. package/Types/SecurityEvent/SecurityWatchlist.js +648 -0
  187. package/Types/SecurityEvent/SecurityWatchlist.mjs +51 -0
  188. package/Types/SecurityEvent/SigmaRule.d.mts +2 -0
  189. package/Types/SecurityEvent/SigmaRule.d.ts +2 -0
  190. package/Types/SecurityEvent/SigmaRule.js +5 -0
  191. package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
  192. package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
  193. package/Types/Telemetry/OpenTelemetryGuides.js +591 -0
  194. package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
  195. package/Types/Version.d.mts +0 -2
  196. package/Types/Version.d.ts +0 -2
  197. package/Types/Version.js +0 -14
  198. package/Types/Workflow/AffectedResourcesSetting.d.mts +13 -0
  199. package/Types/Workflow/AffectedResourcesSetting.d.ts +13 -0
  200. package/Types/Workflow/AffectedResourcesSetting.js +120 -0
  201. package/Types/Workflow/AffectedResourcesSetting.mjs +8 -0
  202. package/Types/Workflow/Components/BaseModel.js +15 -3
  203. package/Types/Workflow/Documentation/DatabaseDocumentation.js +36 -0
  204. package/Utils/Inventory/AssetFactSource.d.mts +6 -2
  205. package/Utils/Inventory/AssetFactSource.d.ts +6 -2
  206. package/Utils/Inventory/AssetFactSource.js +18 -1
  207. package/Utils/Inventory/AssetFactSource.mjs +1 -0
  208. package/Utils/Markdown/FeedLead.d.mts +10 -0
  209. package/Utils/Markdown/FeedLead.d.ts +10 -0
  210. package/Utils/Markdown/FeedLead.js +198 -0
  211. package/Utils/Markdown/FeedLead.mjs +8 -0
  212. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +9 -1
  213. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +9 -1
  214. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +139 -18
  215. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
  216. package/Utils/NetworkDevice/NetworkDeviceRefresh.d.mts +88 -0
  217. package/Utils/NetworkDevice/NetworkDeviceRefresh.d.ts +88 -0
  218. package/Utils/NetworkDevice/NetworkDeviceRefresh.js +232 -0
  219. package/Utils/NetworkDevice/NetworkDeviceRefresh.mjs +16 -0
  220. package/Utils/NetworkTraffic/NetworkAddressBlock.d.mts +20 -0
  221. package/Utils/NetworkTraffic/NetworkAddressBlock.d.ts +20 -0
  222. package/Utils/NetworkTraffic/NetworkAddressBlock.js +264 -0
  223. package/Utils/NetworkTraffic/NetworkAddressBlock.mjs +3 -0
  224. package/Utils/Schema/MonitorSchemas.d.mts +9 -0
  225. package/Utils/Schema/MonitorSchemas.d.ts +9 -0
  226. package/Utils/Schema/MonitorSchemas.js +291 -0
  227. package/Utils/Schema/MonitorSchemas.mjs +9 -0
  228. package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
  229. package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
  230. package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
  231. package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
  232. package/Utils/Schema/TypeSchemas.d.mts +12 -0
  233. package/Utils/Schema/TypeSchemas.d.ts +12 -0
  234. package/Utils/Schema/TypeSchemas.js +176 -0
  235. package/Utils/Schema/TypeSchemas.mjs +11 -0
  236. package/Utils/Schema/Zod.js +23 -17
  237. package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +34 -0
  238. package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +34 -0
  239. package/Utils/SecurityCase/SecurityCaseMarkdown.js +69 -0
  240. package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +9 -0
  241. package/Utils/SecurityCase/SecurityCasePriorities.d.mts +2 -0
  242. package/Utils/SecurityCase/SecurityCasePriorities.d.ts +2 -0
  243. package/Utils/SecurityCase/SecurityCasePriorities.js +15 -1
  244. package/Utils/SecurityCase/SecurityCaseTargets.d.mts +128 -0
  245. package/Utils/SecurityCase/SecurityCaseTargets.d.ts +128 -0
  246. package/Utils/SecurityCase/SecurityCaseTargets.js +482 -0
  247. package/Utils/SecurityCase/SecurityCaseTargets.mjs +28 -0
  248. package/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +22 -0
  249. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.mts +24 -0
  250. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.ts +24 -0
  251. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.js +183 -0
  252. package/Utils/SecurityEvent/Sigma/SigmaWatchlists.mjs +9 -0
  253. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  import commonJsModule from "./NetworkTraffic.js";
2
+ export const MAX_NETWORK_TRAFFIC_FIND_QUERY_LENGTH = commonJsModule.MAX_NETWORK_TRAFFIC_FIND_QUERY_LENGTH;
2
3
  export const MAX_NETWORK_TRAFFIC_RANGE_DAYS = commonJsModule.MAX_NETWORK_TRAFFIC_RANGE_DAYS;
4
+ export const NETWORK_TRAFFIC_FIND_LIMIT = commonJsModule.NETWORK_TRAFFIC_FIND_LIMIT;
3
5
  export const NETWORK_TRAFFIC_SOURCES_LIMIT = commonJsModule.NETWORK_TRAFFIC_SOURCES_LIMIT;
4
6
  export const NETWORK_TRAFFIC_SOURCES_LOOKBACK_MINUTES = commonJsModule.NETWORK_TRAFFIC_SOURCES_LOOKBACK_MINUTES;
5
7
  export const NETWORK_TRAFFIC_TOP_LIMIT = commonJsModule.NETWORK_TRAFFIC_TOP_LIMIT;
@@ -8,6 +8,8 @@ export interface NetworkControllerReadSummary {
8
8
  networkCount: number;
9
9
  applianceCount: number;
10
10
  matchedDeviceCount: number;
11
+ deviceCount?: number | undefined;
12
+ describedDeviceCount?: number | undefined;
11
13
  uplinkWindows: number;
12
14
  newestUplinkAt?: string | undefined;
13
15
  analyticsNetworks: number;
@@ -8,6 +8,8 @@ export interface NetworkControllerReadSummary {
8
8
  networkCount: number;
9
9
  applianceCount: number;
10
10
  matchedDeviceCount: number;
11
+ deviceCount?: number | undefined;
12
+ describedDeviceCount?: number | undefined;
11
13
  uplinkWindows: number;
12
14
  newestUplinkAt?: string | undefined;
13
15
  analyticsNetworks: number;
@@ -31,7 +31,13 @@ function readNetworkControllerReadSummary(value) {
31
31
  }
32
32
  const failureKind = summary["failureKind"];
33
33
  const newestUplinkAt = readText(summary["newestUplinkAt"]);
34
- return Object.assign(Object.assign(Object.assign(Object.assign({ status: status, organizationName: readText(summary["organizationName"]), networkCount: readNumber(summary["networkCount"]), applianceCount: readNumber(summary["applianceCount"]), matchedDeviceCount: readNumber(summary["matchedDeviceCount"]), uplinkWindows: readNumber(summary["uplinkWindows"]) }, (newestUplinkAt ? { newestUplinkAt: newestUplinkAt } : {})), { analyticsNetworks: readNumber(summary["analyticsNetworks"]), analyticsNetworksWaiting: readNumber(summary["analyticsNetworksWaiting"]), trafficAnalysisOffNetworks: readNumber(summary["trafficAnalysisOffNetworks"]), rowsWritten: readNumber(summary["rowsWritten"]), requestCount: readNumber(summary["requestCount"]), wasRateLimited: summary["wasRateLimited"] === true, warnings: Array.isArray(summary["warnings"])
34
+ const hasDeviceCounts = summary["deviceCount"] !== undefined && summary["deviceCount"] !== null;
35
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ status: status, organizationName: readText(summary["organizationName"]), networkCount: readNumber(summary["networkCount"]), applianceCount: readNumber(summary["applianceCount"]), matchedDeviceCount: readNumber(summary["matchedDeviceCount"]) }, (hasDeviceCounts
36
+ ? {
37
+ deviceCount: readNumber(summary["deviceCount"]),
38
+ describedDeviceCount: Math.min(readNumber(summary["deviceCount"]), readNumber(summary["describedDeviceCount"])),
39
+ }
40
+ : {})), { uplinkWindows: readNumber(summary["uplinkWindows"]) }), (newestUplinkAt ? { newestUplinkAt: newestUplinkAt } : {})), { analyticsNetworks: readNumber(summary["analyticsNetworks"]), analyticsNetworksWaiting: readNumber(summary["analyticsNetworksWaiting"]), trafficAnalysisOffNetworks: readNumber(summary["trafficAnalysisOffNetworks"]), rowsWritten: readNumber(summary["rowsWritten"]), requestCount: readNumber(summary["requestCount"]), wasRateLimited: summary["wasRateLimited"] === true, warnings: Array.isArray(summary["warnings"])
35
41
  ? summary["warnings"]
36
42
  .filter((warning) => {
37
43
  return typeof warning === "string" && warning.length > 0;
@@ -1,3 +1,4 @@
1
+ import NetworkControllerProvider from "../NetworkController/NetworkControllerProvider.mjs";
1
2
  export declare enum NetworkDeviceDiscoveredField {
2
3
  SystemName = "sysName",
3
4
  SystemDescription = "sysDescr",
@@ -19,7 +20,8 @@ export declare enum NetworkDeviceDiscoveryMethod {
19
20
  export declare enum NetworkDeviceDiscoveryReaderType {
20
21
  DiscoveryScan = "discoveryScan",
21
22
  NetworkDevice = "networkDevice",
22
- Probe = "probe"
23
+ Probe = "probe",
24
+ NetworkController = "networkController"
23
25
  }
24
26
  export interface NetworkDeviceDiscoveryReader {
25
27
  type: NetworkDeviceDiscoveryReaderType;
@@ -44,11 +46,33 @@ export interface NetworkDeviceOtherMachineSighting {
44
46
  dnsName?: string | undefined;
45
47
  netbiosName?: string | undefined;
46
48
  }
49
+ export declare enum NetworkDeviceControllerField {
50
+ Name = "name",
51
+ Model = "model",
52
+ SerialNumber = "serialNumber",
53
+ MacAddress = "macAddress",
54
+ IpAddress = "ipAddress",
55
+ FirmwareVersion = "firmwareVersion",
56
+ ProductType = "productType",
57
+ NetworkName = "networkName",
58
+ Address = "address"
59
+ }
60
+ export declare const NETWORK_DEVICE_CONTROLLER_FIELDS: ReadonlyArray<NetworkDeviceControllerField>;
61
+ export declare const NETWORK_CONTROLLER_PRODUCT_TYPES: ReadonlyArray<string>;
62
+ export declare const MAX_CONTROLLER_VALUE_LENGTH: Readonly<Record<NetworkDeviceControllerField, number>>;
63
+ export interface NetworkDeviceControllerReading {
64
+ provider: NetworkControllerProvider;
65
+ readBy: NetworkDeviceDiscoveryReader;
66
+ readAt: string;
67
+ values: Partial<Record<NetworkDeviceControllerField, string>>;
68
+ }
47
69
  export interface NetworkDeviceDiscoveredDetails {
48
70
  values: Partial<Record<NetworkDeviceDiscoveredField, NetworkDeviceDiscoveredValue>>;
49
71
  foundBy?: NetworkDeviceDiscoverySighting | undefined;
50
72
  otherMachine?: NetworkDeviceOtherMachineSighting | undefined;
73
+ controller?: NetworkDeviceControllerReading | undefined;
51
74
  }
75
+ export declare const DISCOVERED_DETAILS_CONTROLLER_KEY: string;
52
76
  export declare const DISCOVERED_DETAILS_FOUND_BY_KEY: string;
53
77
  export declare const DISCOVERED_DETAILS_OTHER_MACHINE_KEY: string;
54
78
  export declare const NETWORK_DEVICE_DISCOVERED_FIELDS: ReadonlyArray<NetworkDeviceDiscoveredField>;
@@ -107,6 +131,28 @@ export declare function buildOtherMachineSighting(data: {
107
131
  dnsName?: unknown;
108
132
  netbiosName?: unknown;
109
133
  }): NetworkDeviceOtherMachineSighting | undefined;
134
+ /**
135
+ * One value of a controller reading as it may be stored and shown, or
136
+ * undefined when it is not usable as one: a MAC through the one MAC
137
+ * normaliser, an address only when it is an address literal, a product type
138
+ * only when it is one the controller names, and cleaned, bounded text for the
139
+ * rest. The controller's answer is outside text, and so is the column an API
140
+ * create can carry: both pass through here.
141
+ */
142
+ export declare function normalizeControllerValue(field: NetworkDeviceControllerField, value: unknown): string | undefined;
143
+ /**
144
+ * A controller reading, ready to store - or undefined when the controller is
145
+ * not one OneUptime reads, the reader is not a network controller
146
+ * connection, the time does not parse, or nothing it holds is usable. Every
147
+ * writer builds its reading here, and the reader below reads stored ones
148
+ * through it, so what is stored is what is read back.
149
+ */
150
+ export declare function buildControllerReading(data: {
151
+ provider: unknown;
152
+ readBy: unknown;
153
+ readAt: unknown;
154
+ values: unknown;
155
+ }): NetworkDeviceControllerReading | undefined;
110
156
  /**
111
157
  * A device's discovered details, read defensively out of its jsonb column:
112
158
  * every entry that is not exactly what OneUptime writes - an unknown key, a
@@ -1,3 +1,4 @@
1
+ import NetworkControllerProvider from "../NetworkController/NetworkControllerProvider";
1
2
  export declare enum NetworkDeviceDiscoveredField {
2
3
  SystemName = "sysName",
3
4
  SystemDescription = "sysDescr",
@@ -19,7 +20,8 @@ export declare enum NetworkDeviceDiscoveryMethod {
19
20
  export declare enum NetworkDeviceDiscoveryReaderType {
20
21
  DiscoveryScan = "discoveryScan",
21
22
  NetworkDevice = "networkDevice",
22
- Probe = "probe"
23
+ Probe = "probe",
24
+ NetworkController = "networkController"
23
25
  }
24
26
  export interface NetworkDeviceDiscoveryReader {
25
27
  type: NetworkDeviceDiscoveryReaderType;
@@ -44,11 +46,33 @@ export interface NetworkDeviceOtherMachineSighting {
44
46
  dnsName?: string | undefined;
45
47
  netbiosName?: string | undefined;
46
48
  }
49
+ export declare enum NetworkDeviceControllerField {
50
+ Name = "name",
51
+ Model = "model",
52
+ SerialNumber = "serialNumber",
53
+ MacAddress = "macAddress",
54
+ IpAddress = "ipAddress",
55
+ FirmwareVersion = "firmwareVersion",
56
+ ProductType = "productType",
57
+ NetworkName = "networkName",
58
+ Address = "address"
59
+ }
60
+ export declare const NETWORK_DEVICE_CONTROLLER_FIELDS: ReadonlyArray<NetworkDeviceControllerField>;
61
+ export declare const NETWORK_CONTROLLER_PRODUCT_TYPES: ReadonlyArray<string>;
62
+ export declare const MAX_CONTROLLER_VALUE_LENGTH: Readonly<Record<NetworkDeviceControllerField, number>>;
63
+ export interface NetworkDeviceControllerReading {
64
+ provider: NetworkControllerProvider;
65
+ readBy: NetworkDeviceDiscoveryReader;
66
+ readAt: string;
67
+ values: Partial<Record<NetworkDeviceControllerField, string>>;
68
+ }
47
69
  export interface NetworkDeviceDiscoveredDetails {
48
70
  values: Partial<Record<NetworkDeviceDiscoveredField, NetworkDeviceDiscoveredValue>>;
49
71
  foundBy?: NetworkDeviceDiscoverySighting | undefined;
50
72
  otherMachine?: NetworkDeviceOtherMachineSighting | undefined;
73
+ controller?: NetworkDeviceControllerReading | undefined;
51
74
  }
75
+ export declare const DISCOVERED_DETAILS_CONTROLLER_KEY: string;
52
76
  export declare const DISCOVERED_DETAILS_FOUND_BY_KEY: string;
53
77
  export declare const DISCOVERED_DETAILS_OTHER_MACHINE_KEY: string;
54
78
  export declare const NETWORK_DEVICE_DISCOVERED_FIELDS: ReadonlyArray<NetworkDeviceDiscoveredField>;
@@ -107,6 +131,28 @@ export declare function buildOtherMachineSighting(data: {
107
131
  dnsName?: unknown;
108
132
  netbiosName?: unknown;
109
133
  }): NetworkDeviceOtherMachineSighting | undefined;
134
+ /**
135
+ * One value of a controller reading as it may be stored and shown, or
136
+ * undefined when it is not usable as one: a MAC through the one MAC
137
+ * normaliser, an address only when it is an address literal, a product type
138
+ * only when it is one the controller names, and cleaned, bounded text for the
139
+ * rest. The controller's answer is outside text, and so is the column an API
140
+ * create can carry: both pass through here.
141
+ */
142
+ export declare function normalizeControllerValue(field: NetworkDeviceControllerField, value: unknown): string | undefined;
143
+ /**
144
+ * A controller reading, ready to store - or undefined when the controller is
145
+ * not one OneUptime reads, the reader is not a network controller
146
+ * connection, the time does not parse, or nothing it holds is usable. Every
147
+ * writer builds its reading here, and the reader below reads stored ones
148
+ * through it, so what is stored is what is read back.
149
+ */
150
+ export declare function buildControllerReading(data: {
151
+ provider: unknown;
152
+ readBy: unknown;
153
+ readAt: unknown;
154
+ values: unknown;
155
+ }): NetworkDeviceControllerReading | undefined;
110
156
  /**
111
157
  * A device's discovered details, read defensively out of its jsonb column:
112
158
  * every entry that is not exactly what OneUptime writes - an unknown key, a
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MAX_DISCOVERY_READER_NAME_LENGTH = exports.MAX_DISCOVERY_READER_ID_LENGTH = exports.MAX_DISCOVERED_VALUE_LENGTH = exports.NETWORK_DEVICE_DISCOVERED_SNMP_FIELDS = exports.NETWORK_DEVICE_DISCOVERED_FIELDS = exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY = exports.DISCOVERED_DETAILS_FOUND_BY_KEY = exports.NetworkDeviceDiscoveryReaderType = exports.NetworkDeviceDiscoveryMethod = exports.NetworkDeviceDiscoveredField = void 0;
6
+ exports.MAX_DISCOVERY_READER_NAME_LENGTH = exports.MAX_DISCOVERY_READER_ID_LENGTH = exports.MAX_DISCOVERED_VALUE_LENGTH = exports.NETWORK_DEVICE_DISCOVERED_SNMP_FIELDS = exports.NETWORK_DEVICE_DISCOVERED_FIELDS = exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY = exports.DISCOVERED_DETAILS_FOUND_BY_KEY = exports.DISCOVERED_DETAILS_CONTROLLER_KEY = exports.MAX_CONTROLLER_VALUE_LENGTH = exports.NETWORK_CONTROLLER_PRODUCT_TYPES = exports.NETWORK_DEVICE_CONTROLLER_FIELDS = exports.NetworkDeviceControllerField = exports.NetworkDeviceDiscoveryReaderType = exports.NetworkDeviceDiscoveryMethod = exports.NetworkDeviceDiscoveredField = void 0;
7
7
  exports.isNetworkDeviceDiscoveredField = isNetworkDeviceDiscoveredField;
8
8
  exports.isDiscoveredDetailsKey = isDiscoveredDetailsKey;
9
9
  exports.getDiscoveryMethodForField = getDiscoveryMethodForField;
@@ -15,11 +15,14 @@ exports.readDiscoveryReader = readDiscoveryReader;
15
15
  exports.buildDiscoveredValue = buildDiscoveredValue;
16
16
  exports.buildDiscoverySighting = buildDiscoverySighting;
17
17
  exports.buildOtherMachineSighting = buildOtherMachineSighting;
18
+ exports.normalizeControllerValue = normalizeControllerValue;
19
+ exports.buildControllerReading = buildControllerReading;
18
20
  exports.readNetworkDeviceDiscoveredDetails = readNetworkDeviceDiscoveredDetails;
19
21
  exports.toDiscoveredDetailsJson = toDiscoveredDetailsJson;
20
22
  exports.sanitizeDiscoveredDetailsOnWrite = sanitizeDiscoveredDetailsOnWrite;
21
23
  exports.getDiscoveredTime = getDiscoveredTime;
22
24
  const IP_1 = __importDefault(require("../IP/IP"));
25
+ const NetworkControllerProvider_1 = require("../NetworkController/NetworkControllerProvider");
23
26
  const EndpointAttachmentUtil_1 = require("../../Utils/Monitor/EndpointAttachmentUtil");
24
27
  const NetbiosNameUtil_1 = require("../../Utils/NetworkDiscovery/NetbiosNameUtil");
25
28
  const ReverseDnsNameUtil_1 = require("../../Utils/NetworkDiscovery/ReverseDnsNameUtil");
@@ -56,10 +59,12 @@ const ReverseDnsNameUtil_1 = require("../../Utils/NetworkDiscovery/ReverseDnsNam
56
59
  * discovery read, both are shown.
57
60
  *
58
61
  * FLAT, ON PURPOSE. Each entry is a top-level key of the jsonb column, so the
59
- * three writers - the discovery engine (scan results), the ARP learner (MACs)
60
- * and the poll pipeline (resolved addresses) - each merge their own keys with
61
- * jsonb `||` in one statement (NetworkDeviceService.mergeDiscoveredDetails)
62
- * and never overwrite one another's.
62
+ * four writers - the discovery engine (scan results), the ARP learner (MACs),
63
+ * the poll pipeline (resolved addresses) and a network controller connection
64
+ * (what the device's controller says it is, under one key of its own) - each
65
+ * merge their own keys with jsonb `||` in one statement
66
+ * (NetworkDeviceService.mergeDiscoveredDetails) and never overwrite one
67
+ * another's.
63
68
  *
64
69
  * EVERY VALUE IS UNTRUSTED. A PTR name is chosen by whoever runs DNS for the
65
70
  * scanned subnet, a NetBIOS name and an SNMP system group by the machine at
@@ -101,7 +106,86 @@ var NetworkDeviceDiscoveryReaderType;
101
106
  // A walked device: the router or switch whose ARP table it is.
102
107
  NetworkDeviceDiscoveryReaderType["NetworkDevice"] = "networkDevice";
103
108
  NetworkDeviceDiscoveryReaderType["Probe"] = "probe";
109
+ /*
110
+ * A network controller connection - a Meraki organization the project
111
+ * reads (NetworkControllerConnection): what its controller says about the
112
+ * device. Only the controller reading below is read by one.
113
+ */
114
+ NetworkDeviceDiscoveryReaderType["NetworkController"] = "networkController";
104
115
  })(NetworkDeviceDiscoveryReaderType || (exports.NetworkDeviceDiscoveryReaderType = NetworkDeviceDiscoveryReaderType = {}));
116
+ /*
117
+ * What a device's network controller says it is: one reading of the
118
+ * controller's device list (the Meraki dashboard's, for a Meraki
119
+ * organization the project reads), recorded whole by the connection that
120
+ * read it - unlike the per-field entries above, every value of it was read
121
+ * at the same moment by the same reader, and it is replaced whole by the next
122
+ * reading. Integration data as a source of a device's details (the
123
+ * follow-ups of #5185 and #5225).
124
+ *
125
+ * The controller knows the box by its serial number, so what it says is the
126
+ * device's own: its model, serial number, firmware, MAC address and
127
+ * management address, the name it carries in the controller, its product
128
+ * type, the controller network it belongs to and the street address the
129
+ * controller files it under.
130
+ */
131
+ var NetworkDeviceControllerField;
132
+ (function (NetworkDeviceControllerField) {
133
+ NetworkDeviceControllerField["Name"] = "name";
134
+ NetworkDeviceControllerField["Model"] = "model";
135
+ NetworkDeviceControllerField["SerialNumber"] = "serialNumber";
136
+ NetworkDeviceControllerField["MacAddress"] = "macAddress";
137
+ NetworkDeviceControllerField["IpAddress"] = "ipAddress";
138
+ NetworkDeviceControllerField["FirmwareVersion"] = "firmwareVersion";
139
+ NetworkDeviceControllerField["ProductType"] = "productType";
140
+ NetworkDeviceControllerField["NetworkName"] = "networkName";
141
+ NetworkDeviceControllerField["Address"] = "address";
142
+ })(NetworkDeviceControllerField || (exports.NetworkDeviceControllerField = NetworkDeviceControllerField = {}));
143
+ exports.NETWORK_DEVICE_CONTROLLER_FIELDS = [
144
+ NetworkDeviceControllerField.Name,
145
+ NetworkDeviceControllerField.Model,
146
+ NetworkDeviceControllerField.SerialNumber,
147
+ NetworkDeviceControllerField.MacAddress,
148
+ NetworkDeviceControllerField.IpAddress,
149
+ NetworkDeviceControllerField.FirmwareVersion,
150
+ NetworkDeviceControllerField.ProductType,
151
+ NetworkDeviceControllerField.NetworkName,
152
+ NetworkDeviceControllerField.Address,
153
+ ];
154
+ /*
155
+ * The product types a Meraki device list names
156
+ * (developer.cisco.com/meraki/api-v1/get-organization-devices). Anything
157
+ * else is not one and is dropped, never shown.
158
+ */
159
+ exports.NETWORK_CONTROLLER_PRODUCT_TYPES = [
160
+ "appliance",
161
+ "switch",
162
+ "wireless",
163
+ "camera",
164
+ "sensor",
165
+ "cellularGateway",
166
+ "wirelessController",
167
+ "campusGateway",
168
+ "secureConnect",
169
+ "systemsManager",
170
+ ];
171
+ /*
172
+ * The longest each controller value is kept: a name, model, serial number,
173
+ * firmware and network name as wide as the device columns that hold the
174
+ * same kind of detail (varchar(100)); a street address 255.
175
+ */
176
+ exports.MAX_CONTROLLER_VALUE_LENGTH = {
177
+ [NetworkDeviceControllerField.Name]: 100,
178
+ [NetworkDeviceControllerField.Model]: 100,
179
+ [NetworkDeviceControllerField.SerialNumber]: 100,
180
+ [NetworkDeviceControllerField.MacAddress]: 17,
181
+ [NetworkDeviceControllerField.IpAddress]: 45,
182
+ [NetworkDeviceControllerField.FirmwareVersion]: 100,
183
+ [NetworkDeviceControllerField.ProductType]: 32,
184
+ [NetworkDeviceControllerField.NetworkName]: 100,
185
+ [NetworkDeviceControllerField.Address]: 255,
186
+ };
187
+ // The jsonb key of the controller reading.
188
+ exports.DISCOVERED_DETAILS_CONTROLLER_KEY = "controller";
105
189
  // The jsonb keys of the two address notes.
106
190
  exports.DISCOVERED_DETAILS_FOUND_BY_KEY = "foundBy";
107
191
  exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY = "otherMachine";
@@ -184,13 +268,15 @@ function isNetworkDeviceDiscoveredField(value) {
184
268
  return typeof value === "string" && KNOWN_FIELDS.has(value);
185
269
  }
186
270
  /*
187
- * True for a top-level key of the jsonb column: a field, or one of the two
188
- * address notes. A writer may set or drop only these.
271
+ * True for a top-level key of the jsonb column: a field, one of the two
272
+ * address notes, or the controller reading. A writer may set or drop only
273
+ * these.
189
274
  */
190
275
  function isDiscoveredDetailsKey(value) {
191
276
  return (isNetworkDeviceDiscoveredField(value) ||
192
277
  value === exports.DISCOVERED_DETAILS_FOUND_BY_KEY ||
193
- value === exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY);
278
+ value === exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY ||
279
+ value === exports.DISCOVERED_DETAILS_CONTROLLER_KEY);
194
280
  }
195
281
  function getDiscoveryMethodForField(field) {
196
282
  return METHOD_BY_FIELD[field];
@@ -418,6 +504,70 @@ function buildOtherMachineSighting(data) {
418
504
  }
419
505
  return note;
420
506
  }
507
+ /**
508
+ * One value of a controller reading as it may be stored and shown, or
509
+ * undefined when it is not usable as one: a MAC through the one MAC
510
+ * normaliser, an address only when it is an address literal, a product type
511
+ * only when it is one the controller names, and cleaned, bounded text for the
512
+ * rest. The controller's answer is outside text, and so is the column an API
513
+ * create can carry: both pass through here.
514
+ */
515
+ function normalizeControllerValue(field, value) {
516
+ switch (field) {
517
+ case NetworkDeviceControllerField.MacAddress:
518
+ return typeof value === "string"
519
+ ? (0, EndpointAttachmentUtil_1.normalizeMac)(value.substring(0, MAX_INPUT_SCAN_LENGTH))
520
+ : undefined;
521
+ case NetworkDeviceControllerField.IpAddress: {
522
+ const text = cleanDiscoveredText(value, exports.MAX_CONTROLLER_VALUE_LENGTH[NetworkDeviceControllerField.IpAddress]);
523
+ return text && IP_1.default.isIP(text) ? text : undefined;
524
+ }
525
+ case NetworkDeviceControllerField.ProductType: {
526
+ const text = cleanDiscoveredText(value, exports.MAX_CONTROLLER_VALUE_LENGTH[NetworkDeviceControllerField.ProductType]);
527
+ return text && exports.NETWORK_CONTROLLER_PRODUCT_TYPES.includes(text)
528
+ ? text
529
+ : undefined;
530
+ }
531
+ default:
532
+ return cleanDiscoveredText(value, exports.MAX_CONTROLLER_VALUE_LENGTH[field]);
533
+ }
534
+ }
535
+ /**
536
+ * A controller reading, ready to store - or undefined when the controller is
537
+ * not one OneUptime reads, the reader is not a network controller
538
+ * connection, the time does not parse, or nothing it holds is usable. Every
539
+ * writer builds its reading here, and the reader below reads stored ones
540
+ * through it, so what is stored is what is read back.
541
+ */
542
+ function buildControllerReading(data) {
543
+ if (!(0, NetworkControllerProvider_1.isNetworkControllerProvider)(data.provider)) {
544
+ return undefined;
545
+ }
546
+ const readBy = readDiscoveryReader(data.readBy);
547
+ const readAt = readDiscoveryTime(data.readAt);
548
+ if (!readBy ||
549
+ readBy.type !== NetworkDeviceDiscoveryReaderType.NetworkController ||
550
+ !readAt ||
551
+ !isPlainObject(data.values)) {
552
+ return undefined;
553
+ }
554
+ const values = {};
555
+ for (const field of exports.NETWORK_DEVICE_CONTROLLER_FIELDS) {
556
+ const value = normalizeControllerValue(field, data.values[field]);
557
+ if (value) {
558
+ values[field] = value;
559
+ }
560
+ }
561
+ if (Object.keys(values).length === 0) {
562
+ return undefined;
563
+ }
564
+ return {
565
+ provider: data.provider,
566
+ readBy: readBy,
567
+ readAt: readAt,
568
+ values: values,
569
+ };
570
+ }
421
571
  /**
422
572
  * A device's discovered details, read defensively out of its jsonb column:
423
573
  * every entry that is not exactly what OneUptime writes - an unknown key, a
@@ -460,6 +610,18 @@ function readNetworkDeviceDiscoveredDetails(raw) {
460
610
  details.otherMachine = note;
461
611
  }
462
612
  }
613
+ const controller = raw[exports.DISCOVERED_DETAILS_CONTROLLER_KEY];
614
+ if (isPlainObject(controller)) {
615
+ const reading = buildControllerReading({
616
+ provider: controller["provider"],
617
+ readBy: controller["readBy"],
618
+ readAt: controller["readAt"],
619
+ values: controller["values"],
620
+ });
621
+ if (reading) {
622
+ details.controller = reading;
623
+ }
624
+ }
463
625
  return details;
464
626
  }
465
627
  /**
@@ -481,6 +643,9 @@ function toDiscoveredDetailsJson(details) {
481
643
  if (details.otherMachine) {
482
644
  json[exports.DISCOVERED_DETAILS_OTHER_MACHINE_KEY] = details.otherMachine;
483
645
  }
646
+ if (details.controller) {
647
+ json[exports.DISCOVERED_DETAILS_CONTROLLER_KEY] = details.controller;
648
+ }
484
649
  return json;
485
650
  }
486
651
  /**
@@ -1,14 +1,20 @@
1
1
  import commonJsModule from "./NetworkDeviceDiscoveredDetails.js";
2
+ export const DISCOVERED_DETAILS_CONTROLLER_KEY = commonJsModule.DISCOVERED_DETAILS_CONTROLLER_KEY;
2
3
  export const DISCOVERED_DETAILS_FOUND_BY_KEY = commonJsModule.DISCOVERED_DETAILS_FOUND_BY_KEY;
3
4
  export const DISCOVERED_DETAILS_OTHER_MACHINE_KEY = commonJsModule.DISCOVERED_DETAILS_OTHER_MACHINE_KEY;
5
+ export const MAX_CONTROLLER_VALUE_LENGTH = commonJsModule.MAX_CONTROLLER_VALUE_LENGTH;
4
6
  export const MAX_DISCOVERED_VALUE_LENGTH = commonJsModule.MAX_DISCOVERED_VALUE_LENGTH;
5
7
  export const MAX_DISCOVERY_READER_ID_LENGTH = commonJsModule.MAX_DISCOVERY_READER_ID_LENGTH;
6
8
  export const MAX_DISCOVERY_READER_NAME_LENGTH = commonJsModule.MAX_DISCOVERY_READER_NAME_LENGTH;
9
+ export const NETWORK_CONTROLLER_PRODUCT_TYPES = commonJsModule.NETWORK_CONTROLLER_PRODUCT_TYPES;
10
+ export const NETWORK_DEVICE_CONTROLLER_FIELDS = commonJsModule.NETWORK_DEVICE_CONTROLLER_FIELDS;
7
11
  export const NETWORK_DEVICE_DISCOVERED_FIELDS = commonJsModule.NETWORK_DEVICE_DISCOVERED_FIELDS;
8
12
  export const NETWORK_DEVICE_DISCOVERED_SNMP_FIELDS = commonJsModule.NETWORK_DEVICE_DISCOVERED_SNMP_FIELDS;
13
+ export const NetworkDeviceControllerField = commonJsModule.NetworkDeviceControllerField;
9
14
  export const NetworkDeviceDiscoveredField = commonJsModule.NetworkDeviceDiscoveredField;
10
15
  export const NetworkDeviceDiscoveryMethod = commonJsModule.NetworkDeviceDiscoveryMethod;
11
16
  export const NetworkDeviceDiscoveryReaderType = commonJsModule.NetworkDeviceDiscoveryReaderType;
17
+ export const buildControllerReading = commonJsModule.buildControllerReading;
12
18
  export const buildDiscoveredValue = commonJsModule.buildDiscoveredValue;
13
19
  export const buildDiscoverySighting = commonJsModule.buildDiscoverySighting;
14
20
  export const buildOtherMachineSighting = commonJsModule.buildOtherMachineSighting;
@@ -18,6 +24,7 @@ export const getDiscoveryMethodForField = commonJsModule.getDiscoveryMethodForFi
18
24
  export const getDiscoveryReaderTypeForField = commonJsModule.getDiscoveryReaderTypeForField;
19
25
  export const isDiscoveredDetailsKey = commonJsModule.isDiscoveredDetailsKey;
20
26
  export const isNetworkDeviceDiscoveredField = commonJsModule.isNetworkDeviceDiscoveredField;
27
+ export const normalizeControllerValue = commonJsModule.normalizeControllerValue;
21
28
  export const normalizeDiscoveredValue = commonJsModule.normalizeDiscoveredValue;
22
29
  export const readDiscoveryReader = commonJsModule.readDiscoveryReader;
23
30
  export const readDiscoveryTime = commonJsModule.readDiscoveryTime;
@@ -146,6 +146,9 @@ exports.ROLLUP_CATEGORY_BY_EVENT_TYPE = {
146
146
  [NotificationSettingEventType_1.default.SEND_SECURITY_CASE_OPENED_NOTIFICATION]: RollupCategory.SecurityCases,
147
147
  [NotificationSettingEventType_1.default.SEND_SECURITY_CASE_ASSIGNED_NOTIFICATION]: RollupCategory.SecurityCases,
148
148
  [NotificationSettingEventType_1.default.SEND_SECURITY_PLAYBOOK_APPROVAL_NOTIFICATION]: RollupCategory.SecurityCases,
149
+ // Never held back (NEVER_ROLLED_UP_EVENT_TYPES): filed here all the same.
150
+ [NotificationSettingEventType_1.default.SEND_SECURITY_CASE_TARGET_NOTIFICATION]: RollupCategory.SecurityCases,
151
+ [NotificationSettingEventType_1.default.SEND_SECURITY_CASE_TASK_ASSIGNED_NOTIFICATION]: RollupCategory.SecurityCases,
149
152
  /*
150
153
  * On Call Notifications, including the two shift reminders. Five of these
151
154
  * seven are never rolled up at all (see NotificationEmailRollupPolicy); they
@@ -38,6 +38,12 @@ exports.NEVER_ROLLED_UP_EVENT_TYPES = new Set([
38
38
  NotificationSettingEventType_1.default.SEND_BEFORE_USER_ON_CALL_SHIFT_STARTS,
39
39
  NotificationSettingEventType_1.default.SEND_WHEN_USER_ON_CALL_SHIFT_IS_REASSIGNED,
40
40
  NotificationSettingEventType_1.default.SEND_INCIDENT_SLA_BREACHED_OWNER_NOTIFICATION,
41
+ /*
42
+ * A security case about to miss a response target, or missing it: a
43
+ * deadline, like an incident's SLA breach. Held back for five minutes, a
44
+ * three-minute warning would arrive after the target it warns of.
45
+ */
46
+ NotificationSettingEventType_1.default.SEND_SECURITY_CASE_TARGET_NOTIFICATION,
41
47
  ]);
42
48
  /*
43
49
  * SHRINK-ONLY. These two carry ON_CALL in their member name and are still
@@ -44,6 +44,8 @@ declare enum NotificationSettingEventType {
44
44
  SEND_SECURITY_CASE_OPENED_NOTIFICATION = "Send notification when a security case opens or rises to my chosen priority",
45
45
  SEND_SECURITY_CASE_ASSIGNED_NOTIFICATION = "Send notification when a security case is assigned to me or to a team I am on",
46
46
  SEND_SECURITY_PLAYBOOK_APPROVAL_NOTIFICATION = "Send notification when a playbook step on a security case is waiting for my approval",
47
+ SEND_SECURITY_CASE_TARGET_NOTIFICATION = "Send notification when a security case is about to miss, or misses, a response target",
48
+ SEND_SECURITY_CASE_TASK_ASSIGNED_NOTIFICATION = "Send notification when a task on a security case is assigned to me",
47
49
  SEND_WHEN_USER_IS_ON_CALL_ROSTER = "When user is on-call roster",
48
50
  SEND_WHEN_USER_IS_NEXT_ON_CALL_ROSTER = "When user is next on-call roster",
49
51
  SEND_WHEN_USER_IS_ADDED_TO_ON_CALL_POLICY = "When user is added to on-call policy",
@@ -44,6 +44,8 @@ declare enum NotificationSettingEventType {
44
44
  SEND_SECURITY_CASE_OPENED_NOTIFICATION = "Send notification when a security case opens or rises to my chosen priority",
45
45
  SEND_SECURITY_CASE_ASSIGNED_NOTIFICATION = "Send notification when a security case is assigned to me or to a team I am on",
46
46
  SEND_SECURITY_PLAYBOOK_APPROVAL_NOTIFICATION = "Send notification when a playbook step on a security case is waiting for my approval",
47
+ SEND_SECURITY_CASE_TARGET_NOTIFICATION = "Send notification when a security case is about to miss, or misses, a response target",
48
+ SEND_SECURITY_CASE_TASK_ASSIGNED_NOTIFICATION = "Send notification when a task on a security case is assigned to me",
47
49
  SEND_WHEN_USER_IS_ON_CALL_ROSTER = "When user is on-call roster",
48
50
  SEND_WHEN_USER_IS_NEXT_ON_CALL_ROSTER = "When user is next on-call roster",
49
51
  SEND_WHEN_USER_IS_ADDED_TO_ON_CALL_POLICY = "When user is added to on-call policy",
@@ -70,6 +70,15 @@ var NotificationSettingEventType;
70
70
  NotificationSettingEventType["SEND_SECURITY_CASE_OPENED_NOTIFICATION"] = "Send notification when a security case opens or rises to my chosen priority";
71
71
  NotificationSettingEventType["SEND_SECURITY_CASE_ASSIGNED_NOTIFICATION"] = "Send notification when a security case is assigned to me or to a team I am on";
72
72
  NotificationSettingEventType["SEND_SECURITY_PLAYBOOK_APPROVAL_NOTIFICATION"] = "Send notification when a playbook step on a security case is waiting for my approval";
73
+ /*
74
+ * A case is about to miss, or misses, a response target its priority sets
75
+ * (SecurityCaseTargetCheck): told to the people on the case - its assignee
76
+ * and its team - or, when nobody is, to the people told about cases at its
77
+ * priority. Never held back in a rollup: it is about a deadline.
78
+ */
79
+ NotificationSettingEventType["SEND_SECURITY_CASE_TARGET_NOTIFICATION"] = "Send notification when a security case is about to miss, or misses, a response target";
80
+ // A task on a security case is handed to the person (SecurityCaseTaskService).
81
+ NotificationSettingEventType["SEND_SECURITY_CASE_TASK_ASSIGNED_NOTIFICATION"] = "Send notification when a task on a security case is assigned to me";
73
82
  // On Call Notifications
74
83
  NotificationSettingEventType["SEND_WHEN_USER_IS_ON_CALL_ROSTER"] = "When user is on-call roster";
75
84
  NotificationSettingEventType["SEND_WHEN_USER_IS_NEXT_ON_CALL_ROSTER"] = "When user is next on-call roster";
@@ -33,5 +33,4 @@ export default class ObjectID extends DatabaseProperty {
33
33
  * Validate that a string is a valid UUID, throw BadDataException if not
34
34
  */
35
35
  static validateUUID(id: string): void;
36
- static getSchema(): any;
37
36
  }
@@ -33,5 +33,4 @@ export default class ObjectID extends DatabaseProperty {
33
33
  * Validate that a string is a valid UUID, throw BadDataException if not
34
34
  */
35
35
  static validateUUID(id: string): void;
36
- static getSchema(): any;
37
36
  }
package/Types/ObjectID.js CHANGED
@@ -8,7 +8,6 @@ const UUID_1 = __importDefault(require("../Utils/UUID"));
8
8
  const DatabaseProperty_1 = __importDefault(require("./Database/DatabaseProperty"));
9
9
  const BadDataException_1 = __importDefault(require("./Exception/BadDataException"));
10
10
  const JSON_1 = require("./JSON");
11
- const Zod_1 = __importDefault(require("../Utils/Schema/Zod"));
12
11
  const RefusedValue_1 = require("../Utils/RefusedValue");
13
12
  // UUID validation regex - matches standard UUID format
14
13
  const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -124,13 +123,5 @@ class ObjectID extends DatabaseProperty_1.default {
124
123
  throw new BadDataException_1.default(`Invalid ID format: "${(0, RefusedValue_1.refusedValue)(id)}". Expected a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000").`);
125
124
  }
126
125
  }
127
- static getSchema() {
128
- return Zod_1.default.string().openapi({
129
- type: "string",
130
- example: "123e4567-e89b-12d3-a456-426614174000",
131
- format: "uuid",
132
- description: "A unique identifier for an object, represented as a UUID.",
133
- });
134
- }
135
126
  }
136
127
  exports.default = ObjectID;
@@ -0,0 +1,23 @@
1
+ import { JSONObject } from "../JSON.mjs";
2
+ export declare const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY: string;
3
+ /**
4
+ * Whether a policy create asks for the two rules, read from its misc data.
5
+ *
6
+ * Only `true` (or the text "true") asks. Nothing sent, null or false asks
7
+ * nothing - an API caller, Terraform or an import gets the policy alone, as
8
+ * before. Anything else is refused rather than read as no: a caller who
9
+ * meant to page the policy must not get one that silently pages nobody.
10
+ */
11
+ export declare const readPageForEveryNewIncidentAndAlert: (miscDataProps: JSONObject | null | undefined) => boolean;
12
+ export declare const RULE_NAME_MAX_LENGTH: number;
13
+ export declare const getEveryNewIncidentRuleName: (policyName: string | undefined | null) => string;
14
+ export declare const getEveryNewAlertRuleName: (policyName: string | undefined | null) => string;
15
+ export declare const EVERY_NEW_INCIDENT_RULE_DESCRIPTION: string;
16
+ export declare const EVERY_NEW_ALERT_RULE_DESCRIPTION: string;
17
+ export interface EveryNewEventRulesOfferFacts {
18
+ policyCount: number | null;
19
+ incidentRuleCount: number | null;
20
+ alertRuleCount: number | null;
21
+ mayAddRules: boolean;
22
+ }
23
+ export declare const shouldOfferEveryNewEventRules: (facts: EveryNewEventRulesOfferFacts) => boolean;
@@ -0,0 +1,23 @@
1
+ import { JSONObject } from "../JSON";
2
+ export declare const PAGE_FOR_EVERY_NEW_INCIDENT_AND_ALERT_KEY: string;
3
+ /**
4
+ * Whether a policy create asks for the two rules, read from its misc data.
5
+ *
6
+ * Only `true` (or the text "true") asks. Nothing sent, null or false asks
7
+ * nothing - an API caller, Terraform or an import gets the policy alone, as
8
+ * before. Anything else is refused rather than read as no: a caller who
9
+ * meant to page the policy must not get one that silently pages nobody.
10
+ */
11
+ export declare const readPageForEveryNewIncidentAndAlert: (miscDataProps: JSONObject | null | undefined) => boolean;
12
+ export declare const RULE_NAME_MAX_LENGTH: number;
13
+ export declare const getEveryNewIncidentRuleName: (policyName: string | undefined | null) => string;
14
+ export declare const getEveryNewAlertRuleName: (policyName: string | undefined | null) => string;
15
+ export declare const EVERY_NEW_INCIDENT_RULE_DESCRIPTION: string;
16
+ export declare const EVERY_NEW_ALERT_RULE_DESCRIPTION: string;
17
+ export interface EveryNewEventRulesOfferFacts {
18
+ policyCount: number | null;
19
+ incidentRuleCount: number | null;
20
+ alertRuleCount: number | null;
21
+ mayAddRules: boolean;
22
+ }
23
+ export declare const shouldOfferEveryNewEventRules: (facts: EveryNewEventRulesOfferFacts) => boolean;