make EntityDefinition 'type' a plain string instead of an enum (#187451)

make EntityDefinition 'type' a plain string instead of an enum
This commit is contained in:
Tom Myers 2024-07-03 13:15:30 +01:00 committed by GitHub
parent 93e127e44d
commit 19db776f4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 11 deletions

View file

@ -8,17 +8,8 @@
import { z } from 'zod';
import moment from 'moment';
export enum EntityType {
service = 'service',
host = 'host',
pod = 'pod',
node = 'node',
}
export const arrayOfStringsSchema = z.array(z.string());
export const entityTypeSchema = z.nativeEnum(EntityType);
export enum BasicAggregations {
avg = 'avg',
max = 'max',

View file

@ -8,7 +8,6 @@
import { z } from 'zod';
import {
arrayOfStringsSchema,
entityTypeSchema,
keyMetricSchema,
metadataSchema,
filterSchema,
@ -20,7 +19,7 @@ export const entityDefinitionSchema = z.object({
id: z.string().regex(/^[\w-]+$/),
name: z.string(),
description: z.optional(z.string()),
type: entityTypeSchema,
type: z.string(),
filter: filterSchema,
indexPatterns: arrayOfStringsSchema,
identityFields: z.array(identityFieldsSchema),