@middlewr/contracts 0.0.48 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,30 @@ const PasswordNodeSchema = z.object({
86
86
  next: z.string().nullable(),
87
87
  });
88
88
 
89
+ const CountdownNodeSchema = z.object({
90
+ id: z.string(),
91
+ type: z.literal('countdown'),
92
+ position: PositionSchema,
93
+ seconds: z.number().int().min(1).max(300),
94
+ message: z.string().max(500).nullable(),
95
+ next: z.string().nullable(),
96
+ });
97
+
98
+ const WebhookNodeSchema = z.object({
99
+ id: z.string(),
100
+ type: z.literal('webhook'),
101
+ position: PositionSchema,
102
+ url: z
103
+ .string()
104
+ .url()
105
+ .refine((u) => u.startsWith('https://') || u.startsWith('http://'), {
106
+ message: 'Webhook URL must use http or https protocol',
107
+ }),
108
+ method: z.enum(['POST', 'GET']),
109
+ headers: z.record(z.string(), z.string().regex(/^[^\r\n]*$/, 'Header value must not contain newlines')).optional(),
110
+ next: z.string().nullable(),
111
+ });
112
+
89
113
  const EntryNodeSchema = z.object({
90
114
  id: z.string(),
91
115
  type: z.literal('entry'),
@@ -102,6 +126,8 @@ export const RuleGraphNodeSchema = z.discriminatedUnion('type', [
102
126
  DestinationNodeSchema,
103
127
  TransformNodeSchema,
104
128
  PasswordNodeSchema,
129
+ CountdownNodeSchema,
130
+ WebhookNodeSchema,
105
131
  EntryNodeSchema,
106
132
  ]);
107
133