import { Action, Trigger } from "@prisma/client"; import { FilterState } from "../types"; import { z } from "zod/v4"; export declare enum TriggerEventSource { Prompt = "prompt" } export declare const EventActionSchema: z.ZodEnum<{ created: "created"; updated: "updated"; deleted: "deleted"; }>; export type TriggerEventAction = z.infer; export declare const TriggerEventSourceSchema: z.ZodEnum<{ prompt: TriggerEventSource; }>; export type TriggerDomain = Omit & { filter: FilterState; eventSource: TriggerEventSource; eventActions: TriggerEventAction[]; }; export type AutomationDomain = { id: string; name: string; trigger: TriggerDomain; action: ActionDomain; }; export type ActionDomain = Omit & { config: SafeActionConfig; }; export type ActionDomainWithSecrets = Omit & { config: ActionConfigWithSecrets; }; export declare const ActionTypeSchema: z.ZodEnum<{ WEBHOOK: "WEBHOOK"; SLACK: "SLACK"; }>; export declare const AvailableWebhookApiSchema: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; export declare const RequestHeaderSchema: z.ZodObject<{ secret: z.ZodBoolean; value: z.ZodString; }, z.core.$strip>; export declare const WebhookActionConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; url: z.ZodURL; headers: z.ZodOptional>; requestHeaders: z.ZodOptional>>; displayHeaders: z.ZodOptional>>; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; secretKey: z.ZodString; displaySecretKey: z.ZodString; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>; export declare const SafeWebhookActionConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; url: z.ZodURL; displaySecretKey: z.ZodString; displayHeaders: z.ZodOptional>>; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>; export type SafeWebhookActionConfig = z.infer; export declare const WebhookActionCreateSchema: z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; url: z.ZodURL; requestHeaders: z.ZodOptional>>; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>; export declare const SlackActionConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"SLACK">; channelId: z.ZodString; channelName: z.ZodString; messageTemplate: z.ZodOptional; }, z.core.$strip>; export type SlackActionConfig = z.infer; export declare const ActionConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; url: z.ZodURL; headers: z.ZodOptional>; requestHeaders: z.ZodOptional>>; displayHeaders: z.ZodOptional>>; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; secretKey: z.ZodString; displaySecretKey: z.ZodString; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"SLACK">; channelId: z.ZodString; channelName: z.ZodString; messageTemplate: z.ZodOptional; }, z.core.$strip>]>; export declare const ActionCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; url: z.ZodURL; requestHeaders: z.ZodOptional>>; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"SLACK">; channelId: z.ZodString; channelName: z.ZodString; messageTemplate: z.ZodOptional; }, z.core.$strip>]>; export declare const SafeActionConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"WEBHOOK">; apiVersion: z.ZodRecord, z.ZodEnum<{ v1: "v1"; }>>; url: z.ZodURL; displaySecretKey: z.ZodString; displayHeaders: z.ZodOptional>>; lastFailingExecutionId: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"SLACK">; channelId: z.ZodString; channelName: z.ZodString; messageTemplate: z.ZodOptional; }, z.core.$strip>]>; export type ActionTypes = z.infer; export type ActionConfig = z.infer; export type ActionCreate = z.infer; export type SafeActionConfig = z.infer; export type WebhookActionCreate = z.infer; export type WebhookActionConfigWithSecrets = z.infer; export type ActionConfigWithSecrets = z.infer; /** * Type guard to check if a config is a valid webhook configuration with secrets */ export declare function isWebhookActionConfig(config: unknown): config is WebhookActionConfigWithSecrets; /** * Type guard to check if a config is a valid Slack configuration */ export declare function isSlackActionConfig(config: unknown): config is SlackActionConfig; /** * Type guard to check if an entire action has valid webhook configuration */ export declare function isWebhookAction(action: { type: string; config: unknown; }): action is { type: "WEBHOOK"; config: WebhookActionConfigWithSecrets; }; /** * Type guard for safe webhook config (without secrets) */ export declare function isSafeWebhookActionConfig(config: unknown): config is SafeWebhookActionConfig; /** * Converts webhook config with secrets to safe config by only including allowed fields */ export declare function convertToSafeWebhookConfig(webhookConfig: WebhookActionConfigWithSecrets): SafeWebhookActionConfig; //# sourceMappingURL=automations.d.ts.map