Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaweiWu committed Jul 3, 2023
1 parent dcba4c4 commit 587cd34
Show file tree
Hide file tree
Showing 13 changed files with 4,313 additions and 35 deletions.
15 changes: 14 additions & 1 deletion x-pack/plugins/alerting/common/routes/rule/create/types/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ export type CreateRuleAction = TypeOf<typeof actionSchemaV1>;
export type CreateRuleActionFrequency = TypeOf<typeof actionFrequencySchemaV1>;

export type CreateRuleRequestParams = TypeOf<typeof createParamsSchemaV1>;
export type CreateRuleRequestBody = TypeOf<typeof createBodySchemaV1>;
type CreateBodySchema = TypeOf<typeof createBodySchemaV1>;

export interface CreateRuleRequestBody<Params extends RuleParamsV1 = never> {
name: CreateBodySchema['name'];
rule_type_id: CreateBodySchema['rule_type_id'];
enabled: CreateBodySchema['enabled'];
consumer: CreateBodySchema['consumer'];
tags: CreateBodySchema['tags'];
throttle?: CreateBodySchema['throttle'];
params: Params;
schedule: CreateBodySchema['schedule'];
actions: CreateBodySchema['actions'];
notify_when?: CreateBodySchema['notify_when'];
}

export interface CreateRuleResponse<Params extends RuleParamsV1 = never> {
body: RuleResponseV1<Params>;
Expand Down
Loading

0 comments on commit 587cd34

Please sign in to comment.