@middlewr/contracts 0.0.48 → 0.0.49
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.
- package/dist/cjs/index.d.ts +672 -64
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +21 -9
- package/dist/cjs/link-templates.schema.d.ts +96 -0
- package/dist/cjs/link-templates.schema.d.ts.map +1 -1
- package/dist/cjs/links.schema.d.ts +96 -16
- package/dist/cjs/links.schema.d.ts.map +1 -1
- package/dist/cjs/rules.schema.d.ts +72 -0
- package/dist/cjs/rules.schema.d.ts.map +1 -1
- package/dist/esm/index.d.ts +672 -64
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +21 -9
- package/dist/esm/link-templates.schema.d.ts +96 -0
- package/dist/esm/link-templates.schema.d.ts.map +1 -1
- package/dist/esm/links.schema.d.ts +96 -16
- package/dist/esm/links.schema.d.ts.map +1 -1
- package/dist/esm/rules.schema.d.ts +72 -0
- package/dist/esm/rules.schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/links.schema.ts +51 -64
- package/src/rules.schema.ts +26 -0
package/src/rules.schema.ts
CHANGED
|
@@ -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
|
|