Skip to content

Commit 1a03d1e

Browse files
hop-devkowalczyk-krzysztof
authored andcommitted
[Entity Analytics][Chore] Tidy Privmon URLs, imports and routes (elastic#233400)
## Summary Currently blocked by elastic#233112 Some tidying of the privmon code: - move all privmon URLs to constants - split monitoring entity source routes into their own files - tidy .gen imports by creating a few .index.ts files (allows us to consolidate imports and makes the paths a lot shorter) It might be nicer to review commit by commit
1 parent 60829c0 commit 1a03d1e

File tree

107 files changed

+854
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+854
-503
lines changed

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ export * from './asset_criticality';
99
export * from './risk_engine';
1010
export * from './entity_store';
1111
export * from './monitoring';
12-
1312
export type { EntityAnalyticsPrivileges } from './common';
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export const MonitoringEngineDescriptor = z.object({
3131
status: PrivilegeMonitoringEngineStatus,
3232
});
3333

34-
export type EngineComponentResource = z.infer<typeof EngineComponentResource>;
35-
export const EngineComponentResource = z.enum(['privmon_engine', 'index', 'task']);
36-
export type EngineComponentResourceEnum = typeof EngineComponentResource.enum;
37-
export const EngineComponentResourceEnum = EngineComponentResource.enum;
34+
export type MonitoringEngineComponentResource = z.infer<typeof MonitoringEngineComponentResource>;
35+
export const MonitoringEngineComponentResource = z.enum(['privmon_engine', 'index', 'task']);
36+
export type MonitoringEngineComponentResourceEnum = typeof MonitoringEngineComponentResource.enum;
37+
export const MonitoringEngineComponentResourceEnum = MonitoringEngineComponentResource.enum;
3838

39-
export type EngineComponentStatus = z.infer<typeof EngineComponentStatus>;
40-
export const EngineComponentStatus = z.object({
39+
export type MonitoringEngineComponentStatus = z.infer<typeof MonitoringEngineComponentStatus>;
40+
export const MonitoringEngineComponentStatus = z.object({
4141
id: z.string(),
4242
installed: z.boolean(),
43-
resource: EngineComponentResource,
43+
resource: MonitoringEngineComponentResource,
4444
health: z.enum(['green', 'yellow', 'red', 'unknown']).optional(),
4545
errors: z
4646
.array(
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ components:
2323
- disabled
2424
- not_installed
2525

26-
EngineComponentStatus:
26+
MonitoringEngineComponentStatus:
2727
type: object
2828
required:
2929
- id
@@ -35,7 +35,7 @@ components:
3535
installed:
3636
type: boolean
3737
resource:
38-
$ref: "#/components/schemas/EngineComponentResource"
38+
$ref: "#/components/schemas/MonitoringEngineComponentResource"
3939
health:
4040
type: string
4141
enum:
@@ -53,7 +53,7 @@ components:
5353
message:
5454
type: string
5555

56-
EngineComponentResource:
56+
MonitoringEngineComponentResource:
5757
type: string
5858
enum:
5959
- privmon_engine
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
export * from './delete.gen';
9+
export * from './disable.gen';
10+
export * from './init.gen';
11+
export * from './schedule_now.gen';

0 commit comments

Comments
 (0)