diff --git a/packages/api/src/entity/rule.ts b/packages/api/src/entity/rule.ts index fe19b360d..561200815 100644 --- a/packages/api/src/entity/rule.ts +++ b/packages/api/src/entity/rule.ts @@ -21,8 +21,8 @@ export class Rule { @Column('text') query!: string - @Column('text', { array: true }) - actions!: string[] + @Column('simple-json') + actions!: { type: string; params: string[] }[] @Column('text', { nullable: true }) description?: string | null diff --git a/packages/api/src/generated/graphql.ts b/packages/api/src/generated/graphql.ts index 663313b57..cbb2d5b01 100644 --- a/packages/api/src/generated/graphql.ts +++ b/packages/api/src/generated/graphql.ts @@ -1660,13 +1660,13 @@ export type Rule = { export type RuleAction = { __typename?: 'RuleAction'; + params: Array>; type: RuleActionType; - value?: Maybe; }; export type RuleActionInput = { + params: Array>; type: RuleActionType; - value?: InputMaybe; }; export enum RuleActionType { @@ -4413,8 +4413,8 @@ export type RuleResolvers = { + params?: Resolver>, ParentType, ContextType>; type?: Resolver; - value?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; diff --git a/packages/api/src/generated/schema.graphql b/packages/api/src/generated/schema.graphql index a802be59d..5af648662 100644 --- a/packages/api/src/generated/schema.graphql +++ b/packages/api/src/generated/schema.graphql @@ -1167,13 +1167,13 @@ type Rule { } type RuleAction { + params: [String]! type: RuleActionType! - value: String } input RuleActionInput { + params: [String]! type: RuleActionType! - value: String } enum RuleActionType { diff --git a/packages/api/src/schema.ts b/packages/api/src/schema.ts index 007ed31b1..f7ece5505 100755 --- a/packages/api/src/schema.ts +++ b/packages/api/src/schema.ts @@ -1968,7 +1968,7 @@ const schema = gql` type RuleAction { type: RuleActionType! - value: String + params: [String]! } enum RuleActionType { @@ -1997,7 +1997,7 @@ const schema = gql` input RuleActionInput { type: RuleActionType! - value: String + params: [String]! } union SetRuleResult = SetRuleSuccess | SetRuleError