@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
@@ -3,16 +3,21 @@ 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.GCP_READ_ONLY_ROLE = exports.AZURE_READ_ONLY_ROLE = exports.AWS_READ_ONLY_ACTIONS = exports.GCP_SERVICE_ACCOUNT_ID = exports.CLOUD_CONNECTION_READ_ONLY_NAME = void 0;
6
+ exports.GCP_SERVICES = exports.GCP_READ_ONLY_ROLES = exports.GCP_SERVICE_HEALTH_ROLE = exports.GCP_AUDIT_LOG_ROLE = exports.GCP_INVENTORY_ROLE = exports.GCP_READ_ONLY_ROLE = exports.AZURE_READ_ONLY_ROLE = exports.AWS_SCOPED_READ_RESOURCES = exports.AWS_READ_ONLY_ACTIONS = exports.AWS_ORGANIZATION_ACTION_GROUP = exports.AWS_READ_ONLY_ACTION_GROUPS = exports.CloudConnectionSetupScope = exports.GCP_SERVICE_ACCOUNT_ID = exports.CLOUD_CONNECTION_READ_ONLY_NAME = void 0;
7
7
  exports.getAwsExternalIdForProject = getAwsExternalIdForProject;
8
8
  exports.getAwsRoleNameForExternalId = getAwsRoleNameForExternalId;
9
+ exports.getAwsOrganizationStackSetName = getAwsOrganizationStackSetName;
10
+ exports.getAwsReadOnlyPolicy = getAwsReadOnlyPolicy;
9
11
  exports.getAwsReadOnlyPolicyDocument = getAwsReadOnlyPolicyDocument;
10
12
  exports.getAwsTrustPolicyDocument = getAwsTrustPolicyDocument;
11
13
  exports.getAwsRoleSetupCommand = getAwsRoleSetupCommand;
14
+ exports.getAwsReadOnlyRoleTemplate = getAwsReadOnlyRoleTemplate;
15
+ exports.getAwsOrganizationSetupCommand = getAwsOrganizationSetupCommand;
12
16
  exports.getAwsAccessKeySetupCommand = getAwsAccessKeySetupCommand;
13
17
  exports.getAzureSetupCommand = getAzureSetupCommand;
14
18
  exports.getGcpSetupCommand = getGcpSetupCommand;
15
19
  exports.getCloudConnectionSetupCommand = getCloudConnectionSetupCommand;
20
+ exports.canSetUpOrganization = canSetUpOrganization;
16
21
  const Crypto_1 = __importDefault(require("../../Utils/Crypto"));
17
22
  const CloudPlatform_1 = require("../Cloud/CloudPlatform");
18
23
  const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
@@ -22,18 +27,27 @@ const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
22
27
  * Connecting a cloud takes one paste: the customer opens their cloud's own
23
28
  * browser terminal (AWS CloudShell, Azure Cloud Shell, Google Cloud Shell),
24
29
  * runs the command shown, and pastes back what it printed. Each command
25
- * creates access that can only read, and nothing else:
30
+ * creates access that can only read - metrics, the resources and how they
31
+ * are configured, what changed and the provider's health events, never
32
+ * data or secrets - and nothing more than a connection uses:
26
33
  *
27
34
  * - AWS, IAM role: a role trusting this OneUptime's AWS account with an
28
35
  * external id only this project's connections use, with an inline
29
- * policy of three read actions. Prints the role's ARN.
36
+ * read-only policy (AWS_READ_ONLY_ACTION_GROUPS). Prints the role's ARN.
37
+ * For a whole organization, the same role in every account through a
38
+ * CloudFormation StackSet of this project's own, and in the management
39
+ * account itself - the one role that may also list the organization's
40
+ * accounts (AWS_ORGANIZATION_ACTION_GROUP).
30
41
  * - AWS, access key: a user with the same policy, and an access key.
31
42
  * Prints the key.
32
43
  * - Azure: an app registration (service principal) with the built-in
33
- * Monitoring Reader role on the current subscription. Prints its app
34
- * id, password and tenant.
35
- * - Google Cloud: a service account with the built-in Monitoring Viewer
36
- * role on the current project, and a JSON key. Prints the key.
44
+ * Monitoring Reader role on the current subscription - or on the
45
+ * tenant's root management group, for every subscription. Prints its
46
+ * app id, password, tenant and when the password expires.
47
+ * - Google Cloud: a service account with the built-in Monitoring Viewer,
48
+ * Cloud Asset Viewer, Logs Viewer and Service Health Viewer roles on the
49
+ * current project - or on its organization, for every project - and a
50
+ * JSON key. Prints the key.
37
51
  *
38
52
  * Each can be run again: a role, a user or a service account that is
39
53
  * already there is updated, not duplicated.
@@ -46,18 +60,127 @@ const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
46
60
  exports.CLOUD_CONNECTION_READ_ONLY_NAME = "OneUptimeReadOnly";
47
61
  exports.GCP_SERVICE_ACCOUNT_ID = "oneuptime-read-only";
48
62
  /*
49
- * Every AWS action a connection uses. Reading metrics and their dimensions,
50
- * and the Name tags of the resources they are about - nothing that reads
51
- * data, configuration or secrets, and nothing that writes.
63
+ * Whom one command gives access: the account the shell is in, or every
64
+ * account of its organization (an AWS Organization, an Azure tenant, a
65
+ * Google Cloud organization).
52
66
  */
53
- exports.AWS_READ_ONLY_ACTIONS = [
54
- "cloudwatch:GetMetricData",
55
- "cloudwatch:ListMetrics",
56
- "tag:GetResources",
67
+ var CloudConnectionSetupScope;
68
+ (function (CloudConnectionSetupScope) {
69
+ CloudConnectionSetupScope["Account"] = "account";
70
+ CloudConnectionSetupScope["Organization"] = "organization";
71
+ })(CloudConnectionSetupScope || (exports.CloudConnectionSetupScope = CloudConnectionSetupScope = {}));
72
+ /*
73
+ * Every AWS action a connection uses, by what it is for. Each reads; none
74
+ * reads data (an object, a row, a message) or a secret, and none writes.
75
+ * Listing a resource type through Cloud Control calls that service's own
76
+ * List or Describe action as the role, which is why those are here.
77
+ */
78
+ exports.AWS_READ_ONLY_ACTION_GROUPS = [
79
+ {
80
+ purpose: "Find the resources that report metrics, and read their metrics",
81
+ actions: ["cloudwatch:GetMetricData", "cloudwatch:ListMetrics"],
82
+ },
83
+ {
84
+ purpose: "Name each resource and read its tags",
85
+ actions: ["tag:GetResources", "iam:ListAccountAliases"],
86
+ },
87
+ {
88
+ purpose: "List every resource and how it is configured, through Cloud Control",
89
+ actions: [
90
+ "cloudformation:ListResources",
91
+ "ec2:DescribeInstances",
92
+ "ec2:DescribeVolumes",
93
+ "ec2:DescribeVpcs",
94
+ "ec2:DescribeNatGateways",
95
+ "autoscaling:DescribeAutoScalingGroups",
96
+ "elasticloadbalancing:DescribeLoadBalancers",
97
+ "elasticloadbalancing:DescribeLoadBalancerAttributes",
98
+ "elasticloadbalancing:DescribeTargetGroups",
99
+ "elasticloadbalancing:DescribeTargetGroupAttributes",
100
+ "elasticloadbalancing:DescribeTargetHealth",
101
+ "elasticloadbalancing:DescribeTags",
102
+ "ecs:ListClusters",
103
+ "ecs:DescribeClusters",
104
+ "ecs:ListServices",
105
+ "ecs:DescribeServices",
106
+ "lambda:ListFunctions",
107
+ "rds:DescribeDBInstances",
108
+ "rds:DescribeDBClusters",
109
+ "elasticache:DescribeReplicationGroups",
110
+ "sqs:ListQueues",
111
+ "sqs:GetQueueAttributes",
112
+ "sns:ListTopics",
113
+ "sns:GetTopicAttributes",
114
+ "sns:ListSubscriptionsByTopic",
115
+ "dynamodb:ListTables",
116
+ "dynamodb:DescribeTable",
117
+ "kinesis:ListStreams",
118
+ "kinesis:DescribeStreamSummary",
119
+ "states:ListStateMachines",
120
+ "states:DescribeStateMachine",
121
+ "cloudfront:ListDistributions",
122
+ "elasticfilesystem:DescribeFileSystems",
123
+ "es:ListDomainNames",
124
+ "es:DescribeDomains",
125
+ "apprunner:ListServices",
126
+ "apprunner:DescribeService",
127
+ "apigateway:GET",
128
+ ],
129
+ },
130
+ {
131
+ purpose: "Read what changed: the account's management events",
132
+ actions: ["cloudtrail:LookupEvents"],
133
+ },
134
+ {
135
+ purpose: "Read AWS's own health events for the account",
136
+ actions: ["health:DescribeEvents", "health:DescribeEventDetails"],
137
+ },
57
138
  ];
139
+ /*
140
+ * What only the organization's management account's role may do besides:
141
+ * list the accounts the other roles are in. Never in an account's own
142
+ * role, nor in the roles the StackSet puts in every member account.
143
+ */
144
+ exports.AWS_ORGANIZATION_ACTION_GROUP = {
145
+ purpose: "List the organization's accounts, from its management account",
146
+ actions: ["organizations:ListAccounts"],
147
+ };
148
+ exports.AWS_READ_ONLY_ACTIONS = exports.AWS_READ_ONLY_ACTION_GROUPS.flatMap((group) => {
149
+ return group.actions;
150
+ });
151
+ /*
152
+ * Actions allowed only on some resources. API Gateway's reads are one
153
+ * action for every path, so it is allowed on the APIs' own definitions
154
+ * only - never on /apikeys, which can return a key's value.
155
+ */
156
+ exports.AWS_SCOPED_READ_RESOURCES = {
157
+ "apigateway:GET": [
158
+ "arn:aws:apigateway:*::/restapis",
159
+ "arn:aws:apigateway:*::/restapis/*",
160
+ "arn:aws:apigateway:*::/apis",
161
+ "arn:aws:apigateway:*::/apis/*",
162
+ ],
163
+ };
58
164
  // The built-in roles Azure and Google Cloud connections are given.
59
165
  exports.AZURE_READ_ONLY_ROLE = "Monitoring Reader";
60
166
  exports.GCP_READ_ONLY_ROLE = "roles/monitoring.viewer";
167
+ exports.GCP_INVENTORY_ROLE = "roles/cloudasset.viewer";
168
+ exports.GCP_AUDIT_LOG_ROLE = "roles/logging.viewer";
169
+ exports.GCP_SERVICE_HEALTH_ROLE = "roles/servicehealth.viewer";
170
+ exports.GCP_READ_ONLY_ROLES = [
171
+ exports.GCP_READ_ONLY_ROLE,
172
+ exports.GCP_INVENTORY_ROLE,
173
+ exports.GCP_AUDIT_LOG_ROLE,
174
+ exports.GCP_SERVICE_HEALTH_ROLE,
175
+ ];
176
+ // The Google Cloud APIs a connection calls, turned on by the command.
177
+ exports.GCP_SERVICES = [
178
+ "monitoring.googleapis.com",
179
+ "cloudasset.googleapis.com",
180
+ "logging.googleapis.com",
181
+ "cloudresourcemanager.googleapis.com",
182
+ "servicehealth.googleapis.com",
183
+ ];
61
184
  const EXTERNAL_ID_PREFIX = "oneuptime-";
62
185
  /*
63
186
  * The external id an AWS role trusts OneUptime with, for one project.
@@ -84,17 +207,49 @@ function getAwsRoleNameForExternalId(externalId) {
84
207
  : externalId.slice(0, 8);
85
208
  return `${exports.CLOUD_CONNECTION_READ_ONLY_NAME}-${suffix}`;
86
209
  }
87
- function getAwsReadOnlyPolicyDocument() {
88
- return JSON.stringify({
210
+ /*
211
+ * The StackSet that puts the role in every account of an AWS Organization:
212
+ * one per project, named like the project's role, so a second project that
213
+ * connects the same organization adds its own roles instead of replacing
214
+ * the first project's.
215
+ */
216
+ function getAwsOrganizationStackSetName(externalId) {
217
+ return getAwsRoleNameForExternalId(externalId);
218
+ }
219
+ /*
220
+ * The read-only policy as an object, for the commands and the template.
221
+ * An organization's management account's role (organization: true) may
222
+ * also list the organization's accounts.
223
+ */
224
+ function getAwsReadOnlyPolicy(options = {}) {
225
+ const scoped = Object.keys(exports.AWS_SCOPED_READ_RESOURCES);
226
+ return {
89
227
  Version: "2012-10-17",
90
228
  Statement: [
91
229
  {
92
230
  Effect: "Allow",
93
- Action: exports.AWS_READ_ONLY_ACTIONS,
231
+ Action: [
232
+ ...exports.AWS_READ_ONLY_ACTIONS.filter((action) => {
233
+ return !scoped.includes(action);
234
+ }),
235
+ ...(options.organization
236
+ ? exports.AWS_ORGANIZATION_ACTION_GROUP.actions
237
+ : []),
238
+ ],
94
239
  Resource: "*",
95
240
  },
241
+ ...scoped.map((action) => {
242
+ return {
243
+ Effect: "Allow",
244
+ Action: [action],
245
+ Resource: exports.AWS_SCOPED_READ_RESOURCES[action],
246
+ };
247
+ }),
96
248
  ],
97
- });
249
+ };
250
+ }
251
+ function getAwsReadOnlyPolicyDocument(options = {}) {
252
+ return JSON.stringify(getAwsReadOnlyPolicy(options));
98
253
  }
99
254
  function getAwsTrustPolicyDocument(data) {
100
255
  return JSON.stringify({
@@ -122,10 +277,61 @@ function getAwsRoleSetupCommand(data) {
122
277
  `ROLE=${role}`,
123
278
  `TRUST='${trust}'`,
124
279
  `aws iam create-role --role-name "$ROLE" --assume-role-policy-document "$TRUST" > /dev/null 2>&1 || aws iam update-assume-role-policy --role-name "$ROLE" --policy-document "$TRUST"`,
125
- `aws iam put-role-policy --role-name "$ROLE" --policy-name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --policy-document '${getAwsReadOnlyPolicyDocument()}'`,
280
+ `aws iam put-role-policy --role-name "$ROLE" --policy-name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --policy-document '${getAwsReadOnlyPolicyDocument({ organization: data.organization })}'`,
126
281
  `aws iam get-role --role-name "$ROLE" --query Role.Arn --output text`,
127
282
  ].join("\n");
128
283
  }
284
+ /*
285
+ * The CloudFormation template of the role: what a StackSet puts in every
286
+ * account of an organization, and what a team that keeps its IAM in
287
+ * CloudFormation deploys itself.
288
+ */
289
+ function getAwsReadOnlyRoleTemplate(data) {
290
+ return JSON.stringify({
291
+ AWSTemplateFormatVersion: "2010-09-09",
292
+ Description: "OneUptime: a role that can only read this account's metrics, resources, changes and health events.",
293
+ Resources: {
294
+ OneUptimeReadOnlyRole: {
295
+ Type: "AWS::IAM::Role",
296
+ Properties: {
297
+ RoleName: getAwsRoleNameForExternalId(data.externalId),
298
+ AssumeRolePolicyDocument: JSON.parse(getAwsTrustPolicyDocument(data)),
299
+ Policies: [
300
+ {
301
+ PolicyName: exports.CLOUD_CONNECTION_READ_ONLY_NAME,
302
+ PolicyDocument: getAwsReadOnlyPolicy(),
303
+ },
304
+ ],
305
+ },
306
+ },
307
+ },
308
+ Outputs: {
309
+ RoleArn: {
310
+ Value: { "Fn::GetAtt": ["OneUptimeReadOnlyRole", "Arn"] },
311
+ },
312
+ },
313
+ });
314
+ }
315
+ /*
316
+ * A whole AWS Organization, from its management account: StackSets'
317
+ * trusted access to the organization turned on (nothing happens when it
318
+ * is on already), the role in every member account (a service-managed
319
+ * StackSet of this project's own that also reaches accounts added later),
320
+ * then in the management account itself, whose ARN it prints. IAM is
321
+ * global, so the StackSet deploys to one Region.
322
+ */
323
+ function getAwsOrganizationSetupCommand(data) {
324
+ const stackSet = getAwsOrganizationStackSetName(data.externalId);
325
+ return [
326
+ `cat > oneuptime-read-only.json <<'TEMPLATE'`,
327
+ getAwsReadOnlyRoleTemplate(data),
328
+ "TEMPLATE",
329
+ `aws cloudformation activate-organizations-access > /dev/null 2>&1 || true`,
330
+ `aws cloudformation create-stack-set --stack-set-name ${stackSet} --template-body file://oneuptime-read-only.json --capabilities CAPABILITY_NAMED_IAM --permission-model SERVICE_MANAGED --auto-deployment Enabled=true,RetainStacksOnAccountRemoval=false > /dev/null 2>&1 || aws cloudformation update-stack-set --stack-set-name ${stackSet} --template-body file://oneuptime-read-only.json --capabilities CAPABILITY_NAMED_IAM > /dev/null`,
331
+ `aws cloudformation create-stack-instances --stack-set-name ${stackSet} --deployment-targets OrganizationalUnitIds=$(aws organizations list-roots --query "Roots[0].Id" --output text) --regions us-east-1 > /dev/null 2>&1 || true`,
332
+ getAwsRoleSetupCommand(Object.assign(Object.assign({}, data), { organization: true })),
333
+ ].join("\n");
334
+ }
129
335
  function getAwsAccessKeySetupCommand() {
130
336
  const user = exports.CLOUD_CONNECTION_READ_ONLY_NAME;
131
337
  return [
@@ -134,16 +340,45 @@ function getAwsAccessKeySetupCommand() {
134
340
  `aws iam create-access-key --user-name ${user}`,
135
341
  ].join("\n");
136
342
  }
137
- function getAzureSetupCommand() {
138
- return `az ad sp create-for-rbac --name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --role "${exports.AZURE_READ_ONLY_ROLE}" --scopes "/subscriptions/$(az account show --query id --output tsv)"`;
343
+ /*
344
+ * Azure: the app, its role on the scope, and what it printed with the
345
+ * password's expiry added, so OneUptime can say before the password stops
346
+ * working. The tenant's root management group is named after the tenant.
347
+ */
348
+ function getAzureSetupCommand(scope = CloudConnectionSetupScope.Account) {
349
+ const scopeLine = scope === CloudConnectionSetupScope.Organization
350
+ ? `SCOPE="/providers/Microsoft.Management/managementGroups/$(az account show --query tenantId --output tsv)"`
351
+ : `SCOPE="/subscriptions/$(az account show --query id --output tsv)"`;
352
+ return [
353
+ scopeLine,
354
+ `OUT=$(az ad sp create-for-rbac --name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --role "${exports.AZURE_READ_ONLY_ROLE}" --scopes "$SCOPE")`,
355
+ `APP=$(echo "$OUT" | jq -r .appId)`,
356
+ `END=$(az ad app credential list --id "$APP" --query "max([].endDateTime)" --output tsv)`,
357
+ `echo "$OUT" | jq --arg end "$END" '. + {endDateTime: $end}'`,
358
+ ].join("\n");
139
359
  }
140
- function getGcpSetupCommand() {
360
+ /*
361
+ * Google Cloud: the APIs a connection calls, the service account, its
362
+ * roles on the project - or on the project's organization, for every
363
+ * project - and a key it prints and then deletes from the shell.
364
+ */
365
+ function getGcpSetupCommand(scope = CloudConnectionSetupScope.Account) {
141
366
  const member = `${exports.GCP_SERVICE_ACCOUNT_ID}@$PROJECT_ID.iam.gserviceaccount.com`;
367
+ const bind = (role) => {
368
+ return scope === CloudConnectionSetupScope.Organization
369
+ ? `gcloud organizations add-iam-policy-binding "$ORG_ID" --member "serviceAccount:${member}" --role ${role} --condition=None > /dev/null`
370
+ : `gcloud projects add-iam-policy-binding "$PROJECT_ID" --member "serviceAccount:${member}" --role ${role} --condition=None > /dev/null`;
371
+ };
142
372
  return [
143
373
  "PROJECT_ID=$(gcloud config get-value project)",
144
- "gcloud services enable monitoring.googleapis.com",
145
- `gcloud iam service-accounts create ${exports.GCP_SERVICE_ACCOUNT_ID} --display-name "OneUptime (read only)"`,
146
- `gcloud projects add-iam-policy-binding "$PROJECT_ID" --member "serviceAccount:${member}" --role ${exports.GCP_READ_ONLY_ROLE} --condition=None > /dev/null`,
374
+ ...(scope === CloudConnectionSetupScope.Organization
375
+ ? [
376
+ `ORG_ID=$(gcloud projects get-ancestors "$PROJECT_ID" --format="value(id)" | tail -1)`,
377
+ ]
378
+ : []),
379
+ `gcloud services enable ${exports.GCP_SERVICES.join(" ")}`,
380
+ `gcloud iam service-accounts create ${exports.GCP_SERVICE_ACCOUNT_ID} --display-name "OneUptime (read only)" > /dev/null 2>&1 || true`,
381
+ ...exports.GCP_READ_ONLY_ROLES.map(bind),
147
382
  `gcloud iam service-accounts keys create oneuptime-key.json --iam-account "${member}"`,
148
383
  "cat oneuptime-key.json && rm oneuptime-key.json",
149
384
  ].join("\n");
@@ -151,23 +386,38 @@ function getGcpSetupCommand() {
151
386
  /*
152
387
  * The command for a cloud and sign-in method, or undefined when it cannot
153
388
  * be written yet (an AWS role before this OneUptime's AWS identity is
154
- * known).
389
+ * known). An AWS organization is read through roles only: an access key's
390
+ * user cannot sign in to the member accounts' roles.
155
391
  */
156
392
  function getCloudConnectionSetupCommand(provider, method, context = {}) {
393
+ const scope = context.scope || CloudConnectionSetupScope.Account;
157
394
  if (provider === CloudPlatform_1.CloudProvider.AWS) {
158
395
  if (method === CloudConnectionCatalog_1.CloudConnectionAuthMethod.AwsRole) {
159
396
  if (!context.trustedPrincipalArn || !context.externalId) {
160
397
  return undefined;
161
398
  }
162
- return getAwsRoleSetupCommand({
399
+ const role = {
163
400
  trustedPrincipalArn: context.trustedPrincipalArn,
164
401
  externalId: context.externalId,
165
- });
402
+ };
403
+ return scope === CloudConnectionSetupScope.Organization
404
+ ? getAwsOrganizationSetupCommand(role)
405
+ : getAwsRoleSetupCommand(role);
166
406
  }
167
407
  return getAwsAccessKeySetupCommand();
168
408
  }
169
409
  if (provider === CloudPlatform_1.CloudProvider.Azure) {
170
- return getAzureSetupCommand();
410
+ return getAzureSetupCommand(scope);
411
+ }
412
+ return getGcpSetupCommand(scope);
413
+ }
414
+ /*
415
+ * Whether a cloud and sign-in method can be set up for a whole
416
+ * organization: Azure and Google Cloud always, AWS through a role.
417
+ */
418
+ function canSetUpOrganization(provider, method) {
419
+ if (provider === CloudPlatform_1.CloudProvider.AWS) {
420
+ return method === CloudConnectionCatalog_1.CloudConnectionAuthMethod.AwsRole;
171
421
  }
172
- return getGcpSetupCommand();
422
+ return true;
173
423
  }
@@ -1,12 +1,26 @@
1
1
  import commonJsModule from "./CloudConnectionSetupCommands.js";
2
+ export const AWS_ORGANIZATION_ACTION_GROUP = commonJsModule.AWS_ORGANIZATION_ACTION_GROUP;
2
3
  export const AWS_READ_ONLY_ACTIONS = commonJsModule.AWS_READ_ONLY_ACTIONS;
4
+ export const AWS_READ_ONLY_ACTION_GROUPS = commonJsModule.AWS_READ_ONLY_ACTION_GROUPS;
5
+ export const AWS_SCOPED_READ_RESOURCES = commonJsModule.AWS_SCOPED_READ_RESOURCES;
3
6
  export const AZURE_READ_ONLY_ROLE = commonJsModule.AZURE_READ_ONLY_ROLE;
4
7
  export const CLOUD_CONNECTION_READ_ONLY_NAME = commonJsModule.CLOUD_CONNECTION_READ_ONLY_NAME;
8
+ export const CloudConnectionSetupScope = commonJsModule.CloudConnectionSetupScope;
9
+ export const GCP_AUDIT_LOG_ROLE = commonJsModule.GCP_AUDIT_LOG_ROLE;
10
+ export const GCP_INVENTORY_ROLE = commonJsModule.GCP_INVENTORY_ROLE;
5
11
  export const GCP_READ_ONLY_ROLE = commonJsModule.GCP_READ_ONLY_ROLE;
12
+ export const GCP_READ_ONLY_ROLES = commonJsModule.GCP_READ_ONLY_ROLES;
13
+ export const GCP_SERVICES = commonJsModule.GCP_SERVICES;
6
14
  export const GCP_SERVICE_ACCOUNT_ID = commonJsModule.GCP_SERVICE_ACCOUNT_ID;
15
+ export const GCP_SERVICE_HEALTH_ROLE = commonJsModule.GCP_SERVICE_HEALTH_ROLE;
16
+ export const canSetUpOrganization = commonJsModule.canSetUpOrganization;
7
17
  export const getAwsAccessKeySetupCommand = commonJsModule.getAwsAccessKeySetupCommand;
8
18
  export const getAwsExternalIdForProject = commonJsModule.getAwsExternalIdForProject;
19
+ export const getAwsOrganizationSetupCommand = commonJsModule.getAwsOrganizationSetupCommand;
20
+ export const getAwsOrganizationStackSetName = commonJsModule.getAwsOrganizationStackSetName;
21
+ export const getAwsReadOnlyPolicy = commonJsModule.getAwsReadOnlyPolicy;
9
22
  export const getAwsReadOnlyPolicyDocument = commonJsModule.getAwsReadOnlyPolicyDocument;
23
+ export const getAwsReadOnlyRoleTemplate = commonJsModule.getAwsReadOnlyRoleTemplate;
10
24
  export const getAwsRoleNameForExternalId = commonJsModule.getAwsRoleNameForExternalId;
11
25
  export const getAwsRoleSetupCommand = commonJsModule.getAwsRoleSetupCommand;
12
26
  export const getAwsTrustPolicyDocument = commonJsModule.getAwsTrustPolicyDocument;
@@ -33,6 +33,7 @@ export interface CloudConnectionReadSummary {
33
33
  newResources: number;
34
34
  archivedResources: number;
35
35
  pointsWritten: number;
36
+ changesRecorded: number;
36
37
  requestCount: number;
37
38
  warnings: Array<string>;
38
39
  failureKind?: CloudConnectionFailureKind | undefined;
@@ -33,6 +33,7 @@ export interface CloudConnectionReadSummary {
33
33
  newResources: number;
34
34
  archivedResources: number;
35
35
  pointsWritten: number;
36
+ changesRecorded: number;
36
37
  requestCount: number;
37
38
  warnings: Array<string>;
38
39
  failureKind?: CloudConnectionFailureKind | undefined;
@@ -70,6 +70,7 @@ function readCloudConnectionReadSummary(value) {
70
70
  newResources: readNumber(value["newResources"]),
71
71
  archivedResources: readNumber(value["archivedResources"]),
72
72
  pointsWritten: readNumber(value["pointsWritten"]),
73
+ changesRecorded: readNumber(value["changesRecorded"]),
73
74
  requestCount: readNumber(value["requestCount"]),
74
75
  warnings: readStrings(value["warnings"]),
75
76
  failureKind: typeof failureKind === "string" &&
@@ -17,6 +17,23 @@ export declare enum TableColumnKind {
17
17
  Metric = "Metric",
18
18
  Formula = "Formula"
19
19
  }
20
+ export declare enum TableThresholdDirection {
21
+ HigherIsWorse = "HigherIsWorse",
22
+ LowerIsWorse = "LowerIsWorse"
23
+ }
24
+ export declare enum TableThresholdStyle {
25
+ Text = "Text",
26
+ Background = "Background"
27
+ }
28
+ export declare enum TableThresholdLevel {
29
+ Warning = "Warning",
30
+ Critical = "Critical"
31
+ }
32
+ export interface TableColumnThresholds {
33
+ warning?: number | undefined;
34
+ critical?: number | undefined;
35
+ direction?: TableThresholdDirection | undefined;
36
+ }
20
37
  export interface TableColumn {
21
38
  id: string;
22
39
  variable: string;
@@ -28,6 +45,7 @@ export interface TableColumn {
28
45
  formula?: string | undefined;
29
46
  decimals?: number | undefined;
30
47
  unit?: string | undefined;
48
+ thresholds?: TableColumnThresholds | undefined;
31
49
  }
32
50
  export interface TableGroupByAttribute {
33
51
  key: string;
@@ -45,6 +63,7 @@ export default interface DashboardTableComponent extends BaseComponent {
45
63
  maxRows?: number | undefined;
46
64
  reduce?: TableReduce | undefined;
47
65
  decimals?: number | undefined;
66
+ thresholdStyle?: TableThresholdStyle | undefined;
48
67
  attributeFilters?: Dictionary<DictionaryEntryValue> | undefined;
49
68
  metricQueryConfig?: MetricQueryConfigData | undefined;
50
69
  metricQueryConfigs?: Array<MetricQueryConfigData> | undefined;
@@ -17,6 +17,23 @@ export declare enum TableColumnKind {
17
17
  Metric = "Metric",
18
18
  Formula = "Formula"
19
19
  }
20
+ export declare enum TableThresholdDirection {
21
+ HigherIsWorse = "HigherIsWorse",
22
+ LowerIsWorse = "LowerIsWorse"
23
+ }
24
+ export declare enum TableThresholdStyle {
25
+ Text = "Text",
26
+ Background = "Background"
27
+ }
28
+ export declare enum TableThresholdLevel {
29
+ Warning = "Warning",
30
+ Critical = "Critical"
31
+ }
32
+ export interface TableColumnThresholds {
33
+ warning?: number | undefined;
34
+ critical?: number | undefined;
35
+ direction?: TableThresholdDirection | undefined;
36
+ }
20
37
  export interface TableColumn {
21
38
  id: string;
22
39
  variable: string;
@@ -28,6 +45,7 @@ export interface TableColumn {
28
45
  formula?: string | undefined;
29
46
  decimals?: number | undefined;
30
47
  unit?: string | undefined;
48
+ thresholds?: TableColumnThresholds | undefined;
31
49
  }
32
50
  export interface TableGroupByAttribute {
33
51
  key: string;
@@ -45,6 +63,7 @@ export default interface DashboardTableComponent extends BaseComponent {
45
63
  maxRows?: number | undefined;
46
64
  reduce?: TableReduce | undefined;
47
65
  decimals?: number | undefined;
66
+ thresholdStyle?: TableThresholdStyle | undefined;
48
67
  attributeFilters?: Dictionary<DictionaryEntryValue> | undefined;
49
68
  metricQueryConfig?: MetricQueryConfigData | undefined;
50
69
  metricQueryConfigs?: Array<MetricQueryConfigData> | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableColumnKind = exports.TableReduce = void 0;
3
+ exports.TableThresholdLevel = exports.TableThresholdStyle = exports.TableThresholdDirection = exports.TableColumnKind = exports.TableReduce = void 0;
4
4
  var TableReduce;
5
5
  (function (TableReduce) {
6
6
  TableReduce["Last"] = "Last";
@@ -14,3 +14,29 @@ var TableColumnKind;
14
14
  TableColumnKind["Metric"] = "Metric";
15
15
  TableColumnKind["Formula"] = "Formula";
16
16
  })(TableColumnKind || (exports.TableColumnKind = TableColumnKind = {}));
17
+ /*
18
+ * Which way a column's values go bad (issue #5231). Higher is worse - CPU,
19
+ * memory or disk in use, errors, latency - reaches a threshold at or above
20
+ * it; lower is worse - free space, availability, throughput - at or below
21
+ * it.
22
+ */
23
+ var TableThresholdDirection;
24
+ (function (TableThresholdDirection) {
25
+ TableThresholdDirection["HigherIsWorse"] = "HigherIsWorse";
26
+ TableThresholdDirection["LowerIsWorse"] = "LowerIsWorse";
27
+ })(TableThresholdDirection || (exports.TableThresholdDirection = TableThresholdDirection = {}));
28
+ /*
29
+ * How a value past a threshold is colored, for the whole table: the number
30
+ * itself (the default), or the whole cell behind it.
31
+ */
32
+ var TableThresholdStyle;
33
+ (function (TableThresholdStyle) {
34
+ TableThresholdStyle["Text"] = "Text";
35
+ TableThresholdStyle["Background"] = "Background";
36
+ })(TableThresholdStyle || (exports.TableThresholdStyle = TableThresholdStyle = {}));
37
+ // The level a value has reached, worst last.
38
+ var TableThresholdLevel;
39
+ (function (TableThresholdLevel) {
40
+ TableThresholdLevel["Warning"] = "Warning";
41
+ TableThresholdLevel["Critical"] = "Critical";
42
+ })(TableThresholdLevel || (exports.TableThresholdLevel = TableThresholdLevel = {}));
@@ -1,3 +1,6 @@
1
1
  import commonJsModule from "./DashboardTableComponent.js";
2
2
  export const TableColumnKind = commonJsModule.TableColumnKind;
3
3
  export const TableReduce = commonJsModule.TableReduce;
4
+ export const TableThresholdDirection = commonJsModule.TableThresholdDirection;
5
+ export const TableThresholdLevel = commonJsModule.TableThresholdLevel;
6
+ export const TableThresholdStyle = commonJsModule.TableThresholdStyle;
@@ -0,0 +1,6 @@
1
+ import { JSONObject } from "../JSON.mjs";
2
+ import { ColumnMetadataSource } from "./NumericColumnValue.mjs";
3
+ import TableColumnType from "./TableColumnType.mjs";
4
+ export declare function cannotHoldBlank(type: TableColumnType | undefined | null): boolean;
5
+ export declare function isBlankFormValue(value: unknown): boolean;
6
+ export declare function clearBlankColumnValues(json: JSONObject, model: ColumnMetadataSource): JSONObject;
@@ -0,0 +1,6 @@
1
+ import { JSONObject } from "../JSON";
2
+ import { ColumnMetadataSource } from "./NumericColumnValue";
3
+ import TableColumnType from "./TableColumnType";
4
+ export declare function cannotHoldBlank(type: TableColumnType | undefined | null): boolean;
5
+ export declare function isBlankFormValue(value: unknown): boolean;
6
+ export declare function clearBlankColumnValues(json: JSONObject, model: ColumnMetadataSource): JSONObject;