@oneuptime/common 14.0.92 → 14.0.94

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/DatabaseModels/Alert.d.mts +2 -0
  2. package/Models/DatabaseModels/Alert.d.ts +2 -0
  3. package/Models/DatabaseModels/Alert.js +62 -1
  4. package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
  5. package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
  6. package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
  7. package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
  8. package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
  9. package/Models/DatabaseModels/CloudAccount.js +546 -0
  10. package/Models/DatabaseModels/CloudAccount.mjs +2 -0
  11. package/Models/DatabaseModels/CloudResource.d.mts +8 -0
  12. package/Models/DatabaseModels/CloudResource.d.ts +8 -0
  13. package/Models/DatabaseModels/CloudResource.js +169 -0
  14. package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
  15. package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
  16. package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
  17. package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
  18. package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
  19. package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
  20. package/Models/DatabaseModels/Incident.d.mts +2 -0
  21. package/Models/DatabaseModels/Incident.d.ts +2 -0
  22. package/Models/DatabaseModels/Incident.js +54 -0
  23. package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
  24. package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
  25. package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
  26. package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
  27. package/Models/DatabaseModels/Index.js +2 -0
  28. package/Models/DatabaseModels/LlmProvider.js +1 -1
  29. package/Models/DatabaseModels/Monitor.d.mts +2 -0
  30. package/Models/DatabaseModels/Monitor.d.ts +2 -0
  31. package/Models/DatabaseModels/Monitor.js +54 -0
  32. package/Models/DatabaseModels/MonitorTemplate.js +10 -4
  33. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
  34. package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
  35. package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
  36. package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
  37. package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
  38. package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
  39. package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
  40. package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
  41. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
  42. package/Models/DatabaseModels/StatusPage.d.mts +2 -0
  43. package/Models/DatabaseModels/StatusPage.d.ts +2 -0
  44. package/Models/DatabaseModels/StatusPage.js +100 -0
  45. package/Types/AI/AiAffectedResources.d.mts +40 -0
  46. package/Types/AI/AiAffectedResources.d.ts +40 -0
  47. package/Types/AI/AiAffectedResources.js +292 -0
  48. package/Types/AI/AiAffectedResources.mjs +10 -0
  49. package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
  50. package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
  51. package/Types/Cloud/CloudAccountSummary.js +114 -0
  52. package/Types/Cloud/CloudAccountSummary.mjs +5 -0
  53. package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
  54. package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
  55. package/Types/Cloud/CloudEndpointMatch.js +134 -0
  56. package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
  57. package/Types/Cloud/CloudInventory.d.mts +34 -0
  58. package/Types/Cloud/CloudInventory.d.ts +34 -0
  59. package/Types/Cloud/CloudInventory.js +362 -0
  60. package/Types/Cloud/CloudInventory.mjs +22 -0
  61. package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
  62. package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
  63. package/Types/Cloud/CloudResourceCatalog.js +29 -1
  64. package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
  65. package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
  66. package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
  67. package/Types/Cloud/CloudResourceIndex.js +191 -0
  68. package/Types/Cloud/CloudResourceIndex.mjs +4 -0
  69. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
  70. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
  71. package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
  72. package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
  73. package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
  74. package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
  75. package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
  76. package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
  77. package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
  78. package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
  79. package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
  80. package/Types/CloudConnection/CloudConnectionTest.js +1 -0
  81. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
  82. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
  83. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
  84. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
  85. package/Types/Database/BlankColumnValue.d.mts +6 -0
  86. package/Types/Database/BlankColumnValue.d.ts +6 -0
  87. package/Types/Database/BlankColumnValue.js +77 -0
  88. package/Types/Database/BlankColumnValue.mjs +4 -0
  89. package/Types/Date.d.mts +1 -0
  90. package/Types/Date.d.ts +1 -0
  91. package/Types/Date.js +32 -6
  92. package/Types/DateLanguage.d.mts +2 -0
  93. package/Types/DateLanguage.d.ts +2 -0
  94. package/Types/DateLanguage.js +67 -12
  95. package/Types/DateLanguage.mjs +2 -0
  96. package/Types/Domain.d.mts +2 -0
  97. package/Types/Domain.d.ts +2 -0
  98. package/Types/Domain.js +27 -0
  99. package/Types/Email/EmailTemplateType.d.mts +2 -0
  100. package/Types/Email/EmailTemplateType.d.ts +2 -0
  101. package/Types/Email/EmailTemplateType.js +2 -0
  102. package/Types/Email.d.mts +1 -0
  103. package/Types/Email.d.ts +1 -0
  104. package/Types/Email.js +16 -0
  105. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
  106. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
  107. package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
  108. package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
  109. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  110. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  111. package/Types/Monitor/CriteriaFilter.js +9 -0
  112. package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
  113. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
  114. package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
  115. package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
  116. package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
  117. package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
  118. package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
  119. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
  120. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
  121. package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
  122. package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
  123. package/Types/Monitor/MonitorType.js +12 -2
  124. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
  125. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
  126. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
  127. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
  128. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
  129. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
  130. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
  131. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
  132. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
  133. package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
  134. package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
  135. package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
  136. package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
  137. package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
  138. package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
  139. package/Types/Monitor/UptimeHistoryLabels.js +5 -0
  140. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
  141. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
  142. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  143. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  144. package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
  145. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
  146. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
  147. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
  148. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
  149. package/Types/ReadingDirection.d.mts +10 -0
  150. package/Types/ReadingDirection.d.ts +10 -0
  151. package/Types/ReadingDirection.js +171 -0
  152. package/Types/ReadingDirection.mjs +10 -0
  153. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
  154. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
  155. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
  156. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
  157. package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
  158. package/Types/Runbook/HttpStepVariables.d.mts +8 -0
  159. package/Types/Runbook/HttpStepVariables.d.ts +8 -0
  160. package/Types/Runbook/HttpStepVariables.js +109 -0
  161. package/Types/Runbook/HttpStepVariables.mjs +5 -0
  162. package/Types/Runbook/RunbookStep.d.mts +1 -0
  163. package/Types/Runbook/RunbookStep.d.ts +1 -0
  164. package/Types/Runbook/RunnerFeatures.d.mts +1 -0
  165. package/Types/Runbook/RunnerFeatures.d.ts +1 -0
  166. package/Types/Runbook/RunnerFeatures.js +15 -3
  167. package/Types/Runbook/RunnerFeatures.mjs +1 -0
  168. package/Types/Runbook/SshHostKey.d.mts +22 -0
  169. package/Types/Runbook/SshHostKey.d.ts +22 -0
  170. package/Types/Runbook/SshHostKey.js +201 -0
  171. package/Types/Runbook/SshHostKey.mjs +10 -0
  172. package/Types/Runner/CodeRepositoryRunner.js +2 -3
  173. package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
  174. package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
  175. package/Types/Runner/GlobalAIAgentsGone.js +19 -0
  176. package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
  177. package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
  178. package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
  179. package/Types/Runner/GlobalRunnerWork.js +21 -1
  180. package/Types/Runner/GlobalRunnerWork.mjs +1 -0
  181. package/Types/SSO/SignInMethods.d.mts +31 -0
  182. package/Types/SSO/SignInMethods.d.ts +31 -0
  183. package/Types/SSO/SignInMethods.js +160 -0
  184. package/Types/SSO/SignInMethods.mjs +8 -0
  185. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
  186. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
  187. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
  188. package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
  189. package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
  190. package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
  191. package/Types/StatusPage/StatusPageLanguage.js +17 -1
  192. package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
  193. package/Types/Workflow/Templates.js +2 -5
  194. package/Types/Workflow/WorkflowPlan.d.mts +7 -0
  195. package/Types/Workflow/WorkflowPlan.d.ts +7 -0
  196. package/Types/Workflow/WorkflowPlan.js +39 -0
  197. package/Types/Workflow/WorkflowPlan.mjs +3 -0
  198. package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
  199. package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
  200. package/Utils/ColorContrast.d.mts +3 -0
  201. package/Utils/ColorContrast.d.ts +3 -0
  202. package/Utils/ColorContrast.js +41 -3
  203. package/Utils/ColorContrast.mjs +2 -0
  204. package/Utils/Dashboard/TableThresholds.d.mts +44 -0
  205. package/Utils/Dashboard/TableThresholds.d.ts +44 -0
  206. package/Utils/Dashboard/TableThresholds.js +288 -0
  207. package/Utils/Dashboard/TableThresholds.mjs +17 -0
  208. package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
  209. package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
  210. package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
  211. package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
  212. package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
  213. package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
  214. package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
  215. package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
  216. package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
  217. package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
  218. package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
  219. package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
  220. package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
  221. package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
  222. package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
  223. package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
  224. package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
  225. package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
  226. package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
  227. package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
  228. package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
  229. package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
  230. package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
  231. package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
  232. package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
  233. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
  234. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
  235. package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
  236. package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
  237. package/Utils/Rules/RuleRunSummary.d.mts +1 -0
  238. package/Utils/Rules/RuleRunSummary.d.ts +1 -0
  239. package/Utils/Rules/RuleRunSummary.js +19 -1
  240. package/Utils/Rules/RuleRunSummary.mjs +1 -0
  241. package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
  242. package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
  243. package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
  244. package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
  245. package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
  246. package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
  247. package/Utils/ScheduledMaintenanceStart.js +15 -0
  248. package/Utils/Sms/Gsm7Text.js +9 -1
  249. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  250. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  251. package/Utils/Sms/OnCallPageSms.js +19 -2
  252. package/Utils/Sms/OnCallPageSms.mjs +1 -0
  253. package/Utils/Sms/SubscriberSms.d.mts +2 -0
  254. package/Utils/Sms/SubscriberSms.d.ts +2 -0
  255. package/Utils/Sms/SubscriberSms.js +35 -0
  256. package/Utils/Sms/SubscriberSms.mjs +3 -0
  257. package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
  258. package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
  259. package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
  260. package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
  261. package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
  262. package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
  263. package/Utils/Telemetry/ChangeEventFields.js +52 -1
  264. package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
  265. package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
  266. package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
  267. package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
  268. package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
  269. package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
  270. package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
  271. package/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ import { JSONObject } from "../JSON.mjs";
2
+ export declare const CLOUD_TAGS_MAX: number;
3
+ export declare const CLOUD_TAG_KEY_MAX_LENGTH: number;
4
+ export declare const CLOUD_TAG_VALUE_MAX_LENGTH: number;
5
+ export declare const CLOUD_PROPERTIES_MAX_BYTES: number;
6
+ export declare const CLOUD_PROPERTY_VALUE_MAX_LENGTH: number;
7
+ export declare const CLOUD_RELATIONSHIPS_MAX: number;
8
+ export declare const CLOUD_ENDPOINTS_MAX: number;
9
+ export declare enum CloudRelationshipKind {
10
+ RunsIn = "runs-in",
11
+ PartOf = "part-of",
12
+ RoutesTo = "routes-to",
13
+ ProtectedBy = "protected-by",
14
+ AttachedTo = "attached-to",
15
+ DeadLettersTo = "dead-letters-to"
16
+ }
17
+ export declare const CLOUD_RELATIONSHIP_LABELS: Readonly<Record<CloudRelationshipKind, string>>;
18
+ export interface CloudResourceRelationship {
19
+ kind: CloudRelationshipKind;
20
+ target: string;
21
+ targetType?: string | undefined;
22
+ }
23
+ export declare function isCloudRelationshipKind(value: unknown): value is CloudRelationshipKind;
24
+ export declare function normalizeCloudTags(raw: unknown): Record<string, string>;
25
+ export declare function readCloudPath(source: unknown, path: string): unknown;
26
+ export declare function pickCloudProperties(source: unknown, paths: ReadonlyArray<string>): JSONObject;
27
+ export declare function boundCloudRelationships(relationships: ReadonlyArray<CloudResourceRelationship>): Array<CloudResourceRelationship>;
28
+ export declare function readCloudRelationships(value: unknown): Array<CloudResourceRelationship>;
29
+ export declare function normalizeCloudHost(value: unknown): string;
30
+ export declare function normalizeCloudEndpoints(values: ReadonlyArray<unknown>): Array<string>;
31
+ export declare function readCloudEndpoints(value: unknown): Array<string>;
32
+ export declare function readCloudTags(value: unknown): Record<string, string>;
33
+ export declare function flattenCloudProperties(properties: unknown): Record<string, string>;
34
+ export declare function getCloudTagRuleMatchValues(tags: unknown): Array<string>;
@@ -0,0 +1,34 @@
1
+ import { JSONObject } from "../JSON";
2
+ export declare const CLOUD_TAGS_MAX: number;
3
+ export declare const CLOUD_TAG_KEY_MAX_LENGTH: number;
4
+ export declare const CLOUD_TAG_VALUE_MAX_LENGTH: number;
5
+ export declare const CLOUD_PROPERTIES_MAX_BYTES: number;
6
+ export declare const CLOUD_PROPERTY_VALUE_MAX_LENGTH: number;
7
+ export declare const CLOUD_RELATIONSHIPS_MAX: number;
8
+ export declare const CLOUD_ENDPOINTS_MAX: number;
9
+ export declare enum CloudRelationshipKind {
10
+ RunsIn = "runs-in",
11
+ PartOf = "part-of",
12
+ RoutesTo = "routes-to",
13
+ ProtectedBy = "protected-by",
14
+ AttachedTo = "attached-to",
15
+ DeadLettersTo = "dead-letters-to"
16
+ }
17
+ export declare const CLOUD_RELATIONSHIP_LABELS: Readonly<Record<CloudRelationshipKind, string>>;
18
+ export interface CloudResourceRelationship {
19
+ kind: CloudRelationshipKind;
20
+ target: string;
21
+ targetType?: string | undefined;
22
+ }
23
+ export declare function isCloudRelationshipKind(value: unknown): value is CloudRelationshipKind;
24
+ export declare function normalizeCloudTags(raw: unknown): Record<string, string>;
25
+ export declare function readCloudPath(source: unknown, path: string): unknown;
26
+ export declare function pickCloudProperties(source: unknown, paths: ReadonlyArray<string>): JSONObject;
27
+ export declare function boundCloudRelationships(relationships: ReadonlyArray<CloudResourceRelationship>): Array<CloudResourceRelationship>;
28
+ export declare function readCloudRelationships(value: unknown): Array<CloudResourceRelationship>;
29
+ export declare function normalizeCloudHost(value: unknown): string;
30
+ export declare function normalizeCloudEndpoints(values: ReadonlyArray<unknown>): Array<string>;
31
+ export declare function readCloudEndpoints(value: unknown): Array<string>;
32
+ export declare function readCloudTags(value: unknown): Record<string, string>;
33
+ export declare function flattenCloudProperties(properties: unknown): Record<string, string>;
34
+ export declare function getCloudTagRuleMatchValues(tags: unknown): Array<string>;
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLOUD_RELATIONSHIP_LABELS = exports.CloudRelationshipKind = exports.CLOUD_ENDPOINTS_MAX = exports.CLOUD_RELATIONSHIPS_MAX = exports.CLOUD_PROPERTY_VALUE_MAX_LENGTH = exports.CLOUD_PROPERTIES_MAX_BYTES = exports.CLOUD_TAG_VALUE_MAX_LENGTH = exports.CLOUD_TAG_KEY_MAX_LENGTH = exports.CLOUD_TAGS_MAX = void 0;
4
+ exports.isCloudRelationshipKind = isCloudRelationshipKind;
5
+ exports.normalizeCloudTags = normalizeCloudTags;
6
+ exports.readCloudPath = readCloudPath;
7
+ exports.pickCloudProperties = pickCloudProperties;
8
+ exports.boundCloudRelationships = boundCloudRelationships;
9
+ exports.readCloudRelationships = readCloudRelationships;
10
+ exports.normalizeCloudHost = normalizeCloudHost;
11
+ exports.normalizeCloudEndpoints = normalizeCloudEndpoints;
12
+ exports.readCloudEndpoints = readCloudEndpoints;
13
+ exports.readCloudTags = readCloudTags;
14
+ exports.flattenCloudProperties = flattenCloudProperties;
15
+ exports.getCloudTagRuleMatchValues = getCloudTagRuleMatchValues;
16
+ /*
17
+ * WHAT A CLOUD ACCOUNT'S INVENTORY SAYS ABOUT A RESOURCE, BEYOND ITS METRICS.
18
+ *
19
+ * A cloud connection's inventory lists every resource of an account the way
20
+ * the cloud's own index lists it - AWS Cloud Control, Azure Resource Graph,
21
+ * Google Cloud Asset Inventory - and keeps four things on each Cloud
22
+ * Resource besides what its metrics say:
23
+ *
24
+ * - its tags (AWS tags, Azure tags, Google Cloud labels), which the label
25
+ * and owner rules can match;
26
+ * - a few properties: the ones a person reads first (an instance's type,
27
+ * a database's engine and version, a function's runtime) and never
28
+ * anything that can hold a secret - a Lambda function's environment, an
29
+ * instance's user data, a connection string;
30
+ * - its relationships: what it runs in, what it is part of, what traffic it
31
+ * sends on to - the edges of the account's topology;
32
+ * - its endpoints: the host names and addresses it answers on, which is
33
+ * how a website monitor is linked to the load balancer behind it.
34
+ *
35
+ * Everything is bounded as it is written (normalizeCloudTags,
36
+ * pickCloudProperties, boundCloudRelationships, normalizeCloudEndpoints): a
37
+ * resource with a thousand tags or a megabyte of configuration costs a row
38
+ * no more than one with a few.
39
+ */
40
+ exports.CLOUD_TAGS_MAX = 50;
41
+ exports.CLOUD_TAG_KEY_MAX_LENGTH = 128;
42
+ exports.CLOUD_TAG_VALUE_MAX_LENGTH = 256;
43
+ exports.CLOUD_PROPERTIES_MAX_BYTES = 8 * 1024;
44
+ exports.CLOUD_PROPERTY_VALUE_MAX_LENGTH = 512;
45
+ exports.CLOUD_RELATIONSHIPS_MAX = 100;
46
+ exports.CLOUD_ENDPOINTS_MAX = 50;
47
+ var CloudRelationshipKind;
48
+ (function (CloudRelationshipKind) {
49
+ // A resource runs in a network: an instance in a subnet or a VPC.
50
+ CloudRelationshipKind["RunsIn"] = "runs-in";
51
+ /*
52
+ * A resource is part of a larger one: an instance of a scaling group, a
53
+ * database instance of its cluster, a service of its ECS cluster.
54
+ */
55
+ CloudRelationshipKind["PartOf"] = "part-of";
56
+ /*
57
+ * Traffic goes on to it: a load balancer to its targets, a CDN to its
58
+ * origin, a topic to its subscribers.
59
+ */
60
+ CloudRelationshipKind["RoutesTo"] = "routes-to";
61
+ // A firewall or security group guards it.
62
+ CloudRelationshipKind["ProtectedBy"] = "protected-by";
63
+ // It is attached to another resource: a disk to a VM, an interface to it.
64
+ CloudRelationshipKind["AttachedTo"] = "attached-to";
65
+ // Messages it cannot process go there: a queue's dead-letter queue.
66
+ CloudRelationshipKind["DeadLettersTo"] = "dead-letters-to";
67
+ })(CloudRelationshipKind || (exports.CloudRelationshipKind = CloudRelationshipKind = {}));
68
+ exports.CLOUD_RELATIONSHIP_LABELS = {
69
+ [CloudRelationshipKind.RunsIn]: "Runs in",
70
+ [CloudRelationshipKind.PartOf]: "Part of",
71
+ [CloudRelationshipKind.RoutesTo]: "Sends traffic to",
72
+ [CloudRelationshipKind.ProtectedBy]: "Protected by",
73
+ [CloudRelationshipKind.AttachedTo]: "Attached to",
74
+ [CloudRelationshipKind.DeadLettersTo]: "Dead letters go to",
75
+ };
76
+ function isCloudRelationshipKind(value) {
77
+ return (typeof value === "string" &&
78
+ Object.values(CloudRelationshipKind).includes(value));
79
+ }
80
+ // A value as text: strings trimmed, numbers and booleans as written.
81
+ function asText(value) {
82
+ if (typeof value === "string") {
83
+ return value.trim();
84
+ }
85
+ if (typeof value === "number" || typeof value === "boolean") {
86
+ return String(value);
87
+ }
88
+ return "";
89
+ }
90
+ function clamp(value, maxLength) {
91
+ return value.length <= maxLength ? value : value.slice(0, maxLength);
92
+ }
93
+ /*
94
+ * Tags as one flat map, whichever shape the cloud wrote them in - AWS's
95
+ * [{ Key, Value }] list, Azure's and Google Cloud's { key: value } map -
96
+ * with at most CLOUD_TAGS_MAX entries, keys and values clamped, empty keys
97
+ * dropped and the first spelling of a repeated key kept. AWS's own
98
+ * `aws:` tags (aws:cloudformation:stack-name) are kept: they say which
99
+ * stack declares the resource.
100
+ */
101
+ function normalizeCloudTags(raw) {
102
+ var _a, _b;
103
+ const tags = {};
104
+ let count = 0;
105
+ const add = (key, value) => {
106
+ if (count >= exports.CLOUD_TAGS_MAX) {
107
+ return;
108
+ }
109
+ const name = clamp(asText(key), exports.CLOUD_TAG_KEY_MAX_LENGTH);
110
+ if (!name || Object.prototype.hasOwnProperty.call(tags, name)) {
111
+ return;
112
+ }
113
+ tags[name] = clamp(asText(value), exports.CLOUD_TAG_VALUE_MAX_LENGTH);
114
+ count++;
115
+ };
116
+ if (Array.isArray(raw)) {
117
+ for (const entry of raw) {
118
+ if (entry && typeof entry === "object" && !Array.isArray(entry)) {
119
+ const record = entry;
120
+ add((_a = record["Key"]) !== null && _a !== void 0 ? _a : record["key"], (_b = record["Value"]) !== null && _b !== void 0 ? _b : record["value"]);
121
+ }
122
+ }
123
+ return tags;
124
+ }
125
+ if (raw && typeof raw === "object") {
126
+ for (const key of Object.keys(raw)) {
127
+ add(key, raw[key]);
128
+ }
129
+ }
130
+ return tags;
131
+ }
132
+ // The value at a dotted path ("Endpoint.Address"), or undefined.
133
+ function readCloudPath(source, path) {
134
+ let current = source;
135
+ for (const part of path.split(".")) {
136
+ if (!current || typeof current !== "object" || Array.isArray(current)) {
137
+ return undefined;
138
+ }
139
+ current = current[part];
140
+ }
141
+ return current;
142
+ }
143
+ /*
144
+ * A property value fit to keep: text clamped, numbers and booleans as they
145
+ * are, a list of short values kept (clamped to twenty), anything else - an
146
+ * object, a long list of objects - left out.
147
+ */
148
+ function keepableValue(value) {
149
+ if (typeof value === "string") {
150
+ const text = value.trim();
151
+ return text ? clamp(text, exports.CLOUD_PROPERTY_VALUE_MAX_LENGTH) : undefined;
152
+ }
153
+ if (typeof value === "number" && Number.isFinite(value)) {
154
+ return value;
155
+ }
156
+ if (typeof value === "boolean") {
157
+ return value;
158
+ }
159
+ if (Array.isArray(value)) {
160
+ const items = [];
161
+ for (const item of value.slice(0, 20)) {
162
+ const kept = typeof item === "object" ? undefined : keepableValue(item);
163
+ if (kept !== undefined) {
164
+ items.push(kept);
165
+ }
166
+ }
167
+ return items.length > 0 ? items : undefined;
168
+ }
169
+ return undefined;
170
+ }
171
+ /*
172
+ * The properties a resource keeps: only the dotted paths its type names,
173
+ * each written under its path ("Endpoint.Address": "db.example.com"), and
174
+ * only while the whole stays under CLOUD_PROPERTIES_MAX_BYTES. A type names
175
+ * no path that can hold a secret, so nothing else of what the cloud
176
+ * returned is stored.
177
+ */
178
+ function pickCloudProperties(source, paths) {
179
+ const kept = {};
180
+ let size = 2;
181
+ for (const path of paths) {
182
+ const value = keepableValue(readCloudPath(source, path));
183
+ if (value === undefined) {
184
+ continue;
185
+ }
186
+ const entrySize = path.length + JSON.stringify(value).length + 4;
187
+ if (size + entrySize > exports.CLOUD_PROPERTIES_MAX_BYTES) {
188
+ break;
189
+ }
190
+ kept[path] = value;
191
+ size += entrySize;
192
+ }
193
+ return kept;
194
+ }
195
+ /*
196
+ * Relationships as they are kept: known kinds only, a target each, no two
197
+ * alike, at most CLOUD_RELATIONSHIPS_MAX.
198
+ */
199
+ function boundCloudRelationships(relationships) {
200
+ const kept = [];
201
+ const seen = new Set();
202
+ for (const relationship of relationships) {
203
+ if (kept.length >= exports.CLOUD_RELATIONSHIPS_MAX) {
204
+ break;
205
+ }
206
+ const target = clamp(asText(relationship.target), exports.CLOUD_PROPERTY_VALUE_MAX_LENGTH);
207
+ if (!target || !isCloudRelationshipKind(relationship.kind)) {
208
+ continue;
209
+ }
210
+ const key = `${relationship.kind}|${target.toLowerCase()}`;
211
+ if (seen.has(key)) {
212
+ continue;
213
+ }
214
+ seen.add(key);
215
+ const entry = {
216
+ kind: relationship.kind,
217
+ target,
218
+ };
219
+ const targetType = asText(relationship.targetType);
220
+ if (targetType) {
221
+ entry.targetType = clamp(targetType, 128);
222
+ }
223
+ kept.push(entry);
224
+ }
225
+ return kept;
226
+ }
227
+ // The relationships kept on a row, read back: anything malformed is skipped.
228
+ function readCloudRelationships(value) {
229
+ if (!Array.isArray(value)) {
230
+ return [];
231
+ }
232
+ const relationships = [];
233
+ for (const entry of value) {
234
+ if (entry && typeof entry === "object" && !Array.isArray(entry)) {
235
+ const record = entry;
236
+ const target = asText(record["target"]);
237
+ if (target && isCloudRelationshipKind(record["kind"])) {
238
+ relationships.push({
239
+ kind: record["kind"],
240
+ target,
241
+ targetType: asText(record["targetType"]) || undefined,
242
+ });
243
+ }
244
+ }
245
+ }
246
+ return relationships;
247
+ }
248
+ /*
249
+ * A host name as it is compared: lower case, without a scheme, a path, a
250
+ * port or the root's trailing dot ("https://Shop.example.com:443/x" ->
251
+ * "shop.example.com"). An IPv6 address keeps its brackets' contents. "" for
252
+ * anything that is not a host.
253
+ */
254
+ function normalizeCloudHost(value) {
255
+ let text = asText(value).toLowerCase();
256
+ if (!text) {
257
+ return "";
258
+ }
259
+ const scheme = text.indexOf("://");
260
+ if (scheme >= 0) {
261
+ text = text.slice(scheme + 3);
262
+ }
263
+ for (const separator of ["/", "?", "#"]) {
264
+ const index = text.indexOf(separator);
265
+ if (index >= 0) {
266
+ text = text.slice(0, index);
267
+ }
268
+ }
269
+ const at = text.lastIndexOf("@");
270
+ if (at >= 0) {
271
+ text = text.slice(at + 1);
272
+ }
273
+ if (text.startsWith("[")) {
274
+ const close = text.indexOf("]");
275
+ return close > 1 ? text.slice(1, close) : "";
276
+ }
277
+ const colon = text.indexOf(":");
278
+ // One colon is a port; more is an IPv6 address written bare.
279
+ if (colon >= 0 && text.indexOf(":", colon + 1) < 0) {
280
+ text = text.slice(0, colon);
281
+ }
282
+ while (text.endsWith(".")) {
283
+ text = text.slice(0, -1);
284
+ }
285
+ if (text.length > 253 || hasWhitespace(text)) {
286
+ return "";
287
+ }
288
+ return text;
289
+ }
290
+ function hasWhitespace(value) {
291
+ for (const character of value) {
292
+ if (character.trim() === "") {
293
+ return true;
294
+ }
295
+ }
296
+ return false;
297
+ }
298
+ // Endpoints as they are kept: normalized hosts, no repeats, at most the limit.
299
+ function normalizeCloudEndpoints(values) {
300
+ const endpoints = [];
301
+ for (const value of values) {
302
+ if (endpoints.length >= exports.CLOUD_ENDPOINTS_MAX) {
303
+ break;
304
+ }
305
+ const host = normalizeCloudHost(value);
306
+ if (host && !endpoints.includes(host)) {
307
+ endpoints.push(host);
308
+ }
309
+ }
310
+ return endpoints;
311
+ }
312
+ // The endpoints kept on a row, read back.
313
+ function readCloudEndpoints(value) {
314
+ return Array.isArray(value) ? normalizeCloudEndpoints(value) : [];
315
+ }
316
+ // The tags kept on a row, read back.
317
+ function readCloudTags(value) {
318
+ return value && typeof value === "object" && !Array.isArray(value)
319
+ ? normalizeCloudTags(value)
320
+ : {};
321
+ }
322
+ // A properties object as "path=value" pairs, one level of nesting deep.
323
+ function flattenCloudProperties(properties) {
324
+ const flat = {};
325
+ if (!properties ||
326
+ typeof properties !== "object" ||
327
+ Array.isArray(properties)) {
328
+ return flat;
329
+ }
330
+ const visit = (value, path) => {
331
+ if (value === null || value === undefined || value === "") {
332
+ return;
333
+ }
334
+ if (typeof value === "object" && !Array.isArray(value)) {
335
+ for (const [key, child] of Object.entries(value)) {
336
+ visit(child, path ? `${path}.${key}` : key);
337
+ }
338
+ return;
339
+ }
340
+ flat[path] = Array.isArray(value)
341
+ ? value
342
+ .map((item) => {
343
+ return typeof item === "object"
344
+ ? JSON.stringify(item)
345
+ : String(item);
346
+ })
347
+ .join(", ")
348
+ : String(value);
349
+ };
350
+ visit(properties, "");
351
+ return flat;
352
+ }
353
+ /*
354
+ * A resource's tags as label and owner rules match them: each written key=value ("team=payments"), so one pattern can say a key, a value or
355
+ * both (^team=payments$, ^env=, =production$).
356
+ */
357
+ function getCloudTagRuleMatchValues(tags) {
358
+ const normalized = readCloudTags(tags);
359
+ return Object.keys(normalized).map((key) => {
360
+ return `${key}=${normalized[key]}`;
361
+ });
362
+ }
@@ -0,0 +1,22 @@
1
+ import commonJsModule from "./CloudInventory.js";
2
+ export const CLOUD_ENDPOINTS_MAX = commonJsModule.CLOUD_ENDPOINTS_MAX;
3
+ export const CLOUD_PROPERTIES_MAX_BYTES = commonJsModule.CLOUD_PROPERTIES_MAX_BYTES;
4
+ export const CLOUD_PROPERTY_VALUE_MAX_LENGTH = commonJsModule.CLOUD_PROPERTY_VALUE_MAX_LENGTH;
5
+ export const CLOUD_RELATIONSHIPS_MAX = commonJsModule.CLOUD_RELATIONSHIPS_MAX;
6
+ export const CLOUD_RELATIONSHIP_LABELS = commonJsModule.CLOUD_RELATIONSHIP_LABELS;
7
+ export const CLOUD_TAGS_MAX = commonJsModule.CLOUD_TAGS_MAX;
8
+ export const CLOUD_TAG_KEY_MAX_LENGTH = commonJsModule.CLOUD_TAG_KEY_MAX_LENGTH;
9
+ export const CLOUD_TAG_VALUE_MAX_LENGTH = commonJsModule.CLOUD_TAG_VALUE_MAX_LENGTH;
10
+ export const CloudRelationshipKind = commonJsModule.CloudRelationshipKind;
11
+ export const boundCloudRelationships = commonJsModule.boundCloudRelationships;
12
+ export const flattenCloudProperties = commonJsModule.flattenCloudProperties;
13
+ export const getCloudTagRuleMatchValues = commonJsModule.getCloudTagRuleMatchValues;
14
+ export const isCloudRelationshipKind = commonJsModule.isCloudRelationshipKind;
15
+ export const normalizeCloudEndpoints = commonJsModule.normalizeCloudEndpoints;
16
+ export const normalizeCloudHost = commonJsModule.normalizeCloudHost;
17
+ export const normalizeCloudTags = commonJsModule.normalizeCloudTags;
18
+ export const pickCloudProperties = commonJsModule.pickCloudProperties;
19
+ export const readCloudEndpoints = commonJsModule.readCloudEndpoints;
20
+ export const readCloudPath = commonJsModule.readCloudPath;
21
+ export const readCloudRelationships = commonJsModule.readCloudRelationships;
22
+ export const readCloudTags = commonJsModule.readCloudTags;
@@ -56,8 +56,10 @@ export interface GcpMonitoredResourceRule extends CloudResourceTypeDescriptor {
56
56
  getFullResourceName?: (labels: Readonly<Record<string, string>>) => string | null;
57
57
  }
58
58
  export declare const GCP_MONITORED_RESOURCE_RULES: ReadonlyArray<GcpMonitoredResourceRule>;
59
+ export declare const INVENTORY_ONLY_RESOURCE_TYPES: ReadonlyArray<CloudResourceTypeDescriptor>;
59
60
  export declare const CLOUD_RESOURCE_TYPES: ReadonlyArray<CloudResourceTypeDescriptor>;
60
61
  export declare function getCloudResourceTypeDescriptor(provider: string | null | undefined, type: string | null | undefined): CloudResourceTypeDescriptor | null;
62
+ export declare function isInventoryOnlyCloudResourceType(provider: string | null | undefined, type: string | null | undefined): boolean;
61
63
  export declare function getCloudResourceTypeLabel(provider: string | null | undefined, type: string | null | undefined): string;
62
64
  export declare function getCanonicalCloudResourceType(provider: string, type: string): string;
63
65
  export declare function getAwsCloudWatchRulesForNamespace(namespace: string): ReadonlyArray<AwsCloudWatchResourceRule>;
@@ -56,8 +56,10 @@ export interface GcpMonitoredResourceRule extends CloudResourceTypeDescriptor {
56
56
  getFullResourceName?: (labels: Readonly<Record<string, string>>) => string | null;
57
57
  }
58
58
  export declare const GCP_MONITORED_RESOURCE_RULES: ReadonlyArray<GcpMonitoredResourceRule>;
59
+ export declare const INVENTORY_ONLY_RESOURCE_TYPES: ReadonlyArray<CloudResourceTypeDescriptor>;
59
60
  export declare const CLOUD_RESOURCE_TYPES: ReadonlyArray<CloudResourceTypeDescriptor>;
60
61
  export declare function getCloudResourceTypeDescriptor(provider: string | null | undefined, type: string | null | undefined): CloudResourceTypeDescriptor | null;
62
+ export declare function isInventoryOnlyCloudResourceType(provider: string | null | undefined, type: string | null | undefined): boolean;
61
63
  export declare function getCloudResourceTypeLabel(provider: string | null | undefined, type: string | null | undefined): string;
62
64
  export declare function getCanonicalCloudResourceType(provider: string, type: string): string;
63
65
  export declare function getAwsCloudWatchRulesForNamespace(namespace: string): ReadonlyArray<AwsCloudWatchResourceRule>;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AWS_CLOUDWATCH_DISCOVERY_NAMESPACES = exports.CLOUD_RESOURCE_TYPES = exports.GCP_MONITORED_RESOURCE_RULES = exports.AWS_CLOUDWATCH_RESOURCE_RULES = exports.AWS_RESOURCE_TYPES = exports.AZURE_RESOURCE_TYPES = exports.CLOUD_RESOURCE_CATEGORY_LABELS = exports.CLOUD_SERVICE_MODEL_LABELS = exports.CloudResourceCategory = exports.CloudServiceModel = void 0;
3
+ exports.AWS_CLOUDWATCH_DISCOVERY_NAMESPACES = exports.CLOUD_RESOURCE_TYPES = exports.INVENTORY_ONLY_RESOURCE_TYPES = exports.GCP_MONITORED_RESOURCE_RULES = exports.AWS_CLOUDWATCH_RESOURCE_RULES = exports.AWS_RESOURCE_TYPES = exports.AZURE_RESOURCE_TYPES = exports.CLOUD_RESOURCE_CATEGORY_LABELS = exports.CLOUD_SERVICE_MODEL_LABELS = exports.CloudResourceCategory = exports.CloudServiceModel = void 0;
4
4
  exports.getAwsPartitionForRegion = getAwsPartitionForRegion;
5
5
  exports.getCloudResourceTypeDescriptor = getCloudResourceTypeDescriptor;
6
+ exports.isInventoryOnlyCloudResourceType = isInventoryOnlyCloudResourceType;
6
7
  exports.getCloudResourceTypeLabel = getCloudResourceTypeLabel;
7
8
  exports.getCanonicalCloudResourceType = getCanonicalCloudResourceType;
8
9
  exports.getAwsCloudWatchRulesForNamespace = getAwsCloudWatchRulesForNamespace;
@@ -1110,10 +1111,23 @@ exports.GCP_MONITORED_RESOURCE_RULES = [
1110
1111
  /*
1111
1112
  * ---- Lookups -------------------------------------------------------------
1112
1113
  */
1114
+ /*
1115
+ * ---- Listed only ---------------------------------------------------------
1116
+ *
1117
+ * Types a cloud connection's inventory lists (CloudInventory) that publish
1118
+ * no metrics of their own - the networks other resources run in, which an
1119
+ * account's topology draws them inside. No metric rule finds them, so they
1120
+ * are kept apart from the lists above, which every rule is held to.
1121
+ */
1122
+ exports.INVENTORY_ONLY_RESOURCE_TYPES = [
1123
+ descriptorOf(CloudPlatform_1.CloudProvider.AWS, "AWS::EC2::VPC", "VPC", IAAS, C.Networking),
1124
+ descriptorOf(CloudPlatform_1.CloudProvider.GCP, "compute.googleapis.com/Network", "VPC Network", IAAS, C.Networking),
1125
+ ];
1113
1126
  exports.CLOUD_RESOURCE_TYPES = [
1114
1127
  ...exports.AZURE_RESOURCE_TYPES,
1115
1128
  ...exports.AWS_RESOURCE_TYPES,
1116
1129
  ...exports.GCP_MONITORED_RESOURCE_RULES,
1130
+ ...exports.INVENTORY_ONLY_RESOURCE_TYPES,
1117
1131
  ];
1118
1132
  function typeLookupKey(provider, type) {
1119
1133
  return `${provider.trim().toLowerCase()}|${type.trim().toLowerCase()}`;
@@ -1135,6 +1149,20 @@ function getCloudResourceTypeDescriptor(provider, type) {
1135
1149
  }
1136
1150
  return DESCRIPTORS_BY_TYPE.get(typeLookupKey(provider, type)) || null;
1137
1151
  }
1152
+ const INVENTORY_ONLY_TYPE_KEYS = new Set(exports.INVENTORY_ONLY_RESOURCE_TYPES.map((descriptor) => {
1153
+ return typeLookupKey(descriptor.provider, descriptor.type);
1154
+ }));
1155
+ /*
1156
+ * Whether resources of this type publish no metrics of their own (a
1157
+ * network: INVENTORY_ONLY_RESOURCE_TYPES), whatever case it is spelled in:
1158
+ * a resource's page has none to list, and says nothing about them.
1159
+ */
1160
+ function isInventoryOnlyCloudResourceType(provider, type) {
1161
+ if (!provider || !type) {
1162
+ return false;
1163
+ }
1164
+ return INVENTORY_ONLY_TYPE_KEYS.has(typeLookupKey(provider, type));
1165
+ }
1138
1166
  /*
1139
1167
  * What to call a resource of this type: the catalog's label, or - for a
1140
1168
  * type the catalog does not list - the type itself, so nothing renders
@@ -9,9 +9,11 @@ export const CLOUD_SERVICE_MODEL_LABELS = commonJsModule.CLOUD_SERVICE_MODEL_LAB
9
9
  export const CloudResourceCategory = commonJsModule.CloudResourceCategory;
10
10
  export const CloudServiceModel = commonJsModule.CloudServiceModel;
11
11
  export const GCP_MONITORED_RESOURCE_RULES = commonJsModule.GCP_MONITORED_RESOURCE_RULES;
12
+ export const INVENTORY_ONLY_RESOURCE_TYPES = commonJsModule.INVENTORY_ONLY_RESOURCE_TYPES;
12
13
  export const getAwsCloudWatchRulesForNamespace = commonJsModule.getAwsCloudWatchRulesForNamespace;
13
14
  export const getAwsPartitionForRegion = commonJsModule.getAwsPartitionForRegion;
14
15
  export const getCanonicalCloudResourceType = commonJsModule.getCanonicalCloudResourceType;
15
16
  export const getCloudResourceTypeDescriptor = commonJsModule.getCloudResourceTypeDescriptor;
16
17
  export const getCloudResourceTypeLabel = commonJsModule.getCloudResourceTypeLabel;
17
18
  export const getGcpMonitoredResourceRule = commonJsModule.getGcpMonitoredResourceRule;
19
+ export const isInventoryOnlyCloudResourceType = commonJsModule.isInventoryOnlyCloudResourceType;
@@ -0,0 +1,44 @@
1
+ import ObjectID from "../ObjectID.mjs";
2
+ import { CloudRelationshipKind, CloudResourceRelationship } from "./CloudInventory.mjs";
3
+ export interface CloudIndexedResource {
4
+ id: ObjectID;
5
+ name: string;
6
+ providerResourceId: string;
7
+ type: string;
8
+ }
9
+ export interface CloudIndexEntry {
10
+ id: ObjectID;
11
+ name: string;
12
+ }
13
+ export interface CloudLinkedResource extends CloudIndexedResource {
14
+ relationships: Array<CloudResourceRelationship>;
15
+ }
16
+ export declare class CloudResourceIndex {
17
+ private byKey;
18
+ private ambiguous;
19
+ constructor(rows: Array<CloudIndexedResource>);
20
+ private add;
21
+ find(resource: {
22
+ id: string;
23
+ type?: string | undefined;
24
+ }): CloudIndexEntry | null;
25
+ }
26
+ export type CloudRelationshipDirection = "out" | "in";
27
+ export interface CloudResolvedRelationship {
28
+ kind: CloudRelationshipKind;
29
+ direction: CloudRelationshipDirection;
30
+ other: CloudLinkedResource | null;
31
+ otherName: string;
32
+ otherType: string;
33
+ }
34
+ export declare function resolveCloudRelationships(data: {
35
+ resource: Omit<CloudIndexedResource, "name">;
36
+ relationships: Array<CloudResourceRelationship>;
37
+ neighbours: Array<CloudLinkedResource>;
38
+ }): Array<CloudResolvedRelationship>;
39
+ export interface CloudResourceLink {
40
+ fromId: string;
41
+ toId: string;
42
+ kind: CloudRelationshipKind;
43
+ }
44
+ export declare function getCloudResourceLinks(resources: Array<CloudLinkedResource>): Array<CloudResourceLink>;
@@ -0,0 +1,44 @@
1
+ import ObjectID from "../ObjectID";
2
+ import { CloudRelationshipKind, CloudResourceRelationship } from "./CloudInventory";
3
+ export interface CloudIndexedResource {
4
+ id: ObjectID;
5
+ name: string;
6
+ providerResourceId: string;
7
+ type: string;
8
+ }
9
+ export interface CloudIndexEntry {
10
+ id: ObjectID;
11
+ name: string;
12
+ }
13
+ export interface CloudLinkedResource extends CloudIndexedResource {
14
+ relationships: Array<CloudResourceRelationship>;
15
+ }
16
+ export declare class CloudResourceIndex {
17
+ private byKey;
18
+ private ambiguous;
19
+ constructor(rows: Array<CloudIndexedResource>);
20
+ private add;
21
+ find(resource: {
22
+ id: string;
23
+ type?: string | undefined;
24
+ }): CloudIndexEntry | null;
25
+ }
26
+ export type CloudRelationshipDirection = "out" | "in";
27
+ export interface CloudResolvedRelationship {
28
+ kind: CloudRelationshipKind;
29
+ direction: CloudRelationshipDirection;
30
+ other: CloudLinkedResource | null;
31
+ otherName: string;
32
+ otherType: string;
33
+ }
34
+ export declare function resolveCloudRelationships(data: {
35
+ resource: Omit<CloudIndexedResource, "name">;
36
+ relationships: Array<CloudResourceRelationship>;
37
+ neighbours: Array<CloudLinkedResource>;
38
+ }): Array<CloudResolvedRelationship>;
39
+ export interface CloudResourceLink {
40
+ fromId: string;
41
+ toId: string;
42
+ kind: CloudRelationshipKind;
43
+ }
44
+ export declare function getCloudResourceLinks(resources: Array<CloudLinkedResource>): Array<CloudResourceLink>;