[Synthetics] Fix type warning (#161745)

This commit is contained in:
Shahzad 2023-07-12 15:44:01 +02:00 committed by GitHub
parent c031900036
commit 91e065ebc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,20 +10,24 @@ import { ObserverCodec } from '../ping/observer';
import { ErrorStateCodec } from '../ping/error_state';
import { AgentType, MonitorType, PingErrorType, UrlType } from '..';
export const OverviewPingCode = t.interface({
'@timestamp': t.string,
summary: t.partial({
down: t.number,
up: t.number,
export const OverviewPingCodec = t.intersection([
t.interface({
'@timestamp': t.string,
summary: t.partial({
down: t.number,
up: t.number,
}),
monitor: MonitorType,
observer: ObserverCodec,
config_id: t.string,
agent: AgentType,
url: UrlType,
state: ErrorStateCodec,
}),
monitor: MonitorType,
observer: ObserverCodec,
config_id: t.string,
error: PingErrorType,
agent: AgentType,
url: UrlType,
state: ErrorStateCodec,
});
t.partial({
error: PingErrorType,
}),
]);
export const OverviewStatusMetaDataCodec = t.interface({
monitorQueryId: t.string,
@ -31,7 +35,7 @@ export const OverviewStatusMetaDataCodec = t.interface({
status: t.string,
location: t.string,
timestamp: t.string,
ping: OverviewPingCode,
ping: OverviewPingCodec,
});
export const OverviewPendingStatusMetaDataCodec = t.intersection([
@ -43,7 +47,7 @@ export const OverviewPendingStatusMetaDataCodec = t.intersection([
}),
t.partial({
timestamp: t.string,
ping: OverviewPingCode,
ping: OverviewPingCodec,
}),
]);
@ -70,7 +74,7 @@ export const OverviewStatusStateCodec = t.intersection([
}),
]);
export type OverviewPing = t.TypeOf<typeof OverviewPingCode>;
export type OverviewPing = t.TypeOf<typeof OverviewPingCodec>;
export type OverviewStatus = t.TypeOf<typeof OverviewStatusCodec>;
export type OverviewStatusState = t.TypeOf<typeof OverviewStatusStateCodec>;
export type OverviewStatusMetaData = t.TypeOf<typeof OverviewStatusMetaDataCodec>;