feat(agent-config): add typed dashboard mutation API
This commit is contained in:
parent
8af0fce6f1
commit
9b7f20c486
5 changed files with 1668 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ const LinkSchema = Type.Object(
|
|||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const StaticDatasourceSchema = Type.Object(
|
||||
export const StaticDatasourceSchema = Type.Object(
|
||||
{
|
||||
type: Type.Literal("static"),
|
||||
label: Type.Optional(Type.String({ minLength: 1 })),
|
||||
|
|
@ -36,7 +36,7 @@ const StaticDatasourceSchema = Type.Object(
|
|||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const PlaceholderDatasourceSchema = Type.Object(
|
||||
export const PlaceholderDatasourceSchema = Type.Object(
|
||||
{
|
||||
type: Type.Literal("placeholder"),
|
||||
reason: Type.String({ minLength: 1 }),
|
||||
|
|
@ -44,7 +44,7 @@ const PlaceholderDatasourceSchema = Type.Object(
|
|||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const ExternalDatasourceSchema = Type.Object(
|
||||
export const ExternalDatasourceSchema = Type.Object(
|
||||
{
|
||||
type: Type.Literal("external"),
|
||||
adapter: Type.Union([
|
||||
|
|
@ -58,7 +58,7 @@ const ExternalDatasourceSchema = Type.Object(
|
|||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const DatasourceReferenceSchema = Type.Union([
|
||||
export const DatasourceReferenceSchema = Type.Union([
|
||||
StaticDatasourceSchema,
|
||||
PlaceholderDatasourceSchema,
|
||||
ExternalDatasourceSchema,
|
||||
|
|
@ -98,13 +98,13 @@ const TextMetricValueSchema = Type.Object(
|
|||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const MetricValueSchema = Type.Union([
|
||||
export const MetricValueSchema = Type.Union([
|
||||
PercentMetricValueSchema,
|
||||
NonNegativeMetricValueSchema,
|
||||
TextMetricValueSchema,
|
||||
]);
|
||||
|
||||
const ThresholdSchema = Type.Object(
|
||||
export const ThresholdSchema = Type.Object(
|
||||
{
|
||||
warning: Type.Optional(Type.Number({ minimum: 0 })),
|
||||
danger: Type.Optional(Type.Number({ minimum: 0 })),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue