Skip to content

Commit a49473b

Browse files
author
John Schulz
authored
[Ingest Manager] Replace AgentAssetType enum with new approach (#82387)
## Summary Expands on pattern added in #82188 `AgentAssetType` `enum` is only used as part of a single type definition
1 parent d8c37fe commit a49473b

File tree

2 files changed

+8
-6
lines changed
  • x-pack/plugins/ingest_manager/common

2 files changed

+8
-6
lines changed

x-pack/plugins/ingest_manager/common/constants/epm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export const requiredPackages = {
1414
Endpoint: 'endpoint',
1515
} as const;
1616

17+
export const agentAssetTypes = {
18+
Input: 'input',
19+
} as const;
20+
1721
export const dataTypes = {
1822
Logs: 'logs',
1923
Metrics: 'metrics',

x-pack/plugins/ingest_manager/common/types/models/epm.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// Follow pattern from https://github.com/elastic/kibana/pull/52447
88
// TODO: Update when https://github.com/elastic/kibana/issues/53021 is closed
99
import { SavedObject, SavedObjectAttributes, SavedObjectReference } from 'src/core/public';
10-
import { dataTypes, requiredPackages } from '../../constants';
10+
import { agentAssetTypes, dataTypes, requiredPackages } from '../../constants';
11+
import { ValueOf } from '../../types';
1112

1213
export enum InstallationStatus {
1314
installed = 'installed',
@@ -27,7 +28,8 @@ export type EpmPackageInstallStatus = 'installed' | 'installing';
2728

2829
export type DetailViewPanelName = 'overview' | 'usages' | 'settings';
2930
export type ServiceName = 'kibana' | 'elasticsearch';
30-
export type AssetType = KibanaAssetType | ElasticsearchAssetType | AgentAssetType;
31+
export type AgentAssetType = typeof agentAssetTypes;
32+
export type AssetType = KibanaAssetType | ElasticsearchAssetType | ValueOf<AgentAssetType>;
3133

3234
export enum KibanaAssetType {
3335
dashboard = 'dashboard',
@@ -47,10 +49,6 @@ export enum ElasticsearchAssetType {
4749

4850
export type DataType = typeof dataTypes;
4951

50-
export enum AgentAssetType {
51-
input = 'input',
52-
}
53-
5452
export type RegistryRelease = 'ga' | 'beta' | 'experimental';
5553

5654
// Fields common to packages that come from direct upload and the registry

0 commit comments

Comments
 (0)