Added schema for create
parent
0e95a1d3e8
commit
2e22978838
|
@ -12,29 +12,21 @@ const schemaWebhookBaseBodyParams = Webhook.pick({
|
||||||
payloadTemplate: true,
|
payloadTemplate: true,
|
||||||
}).partial();
|
}).partial();
|
||||||
|
|
||||||
// const schemaWebhookCreateParams = z
|
export const schemaWebhookCreateParams = z
|
||||||
// .object({
|
.object({
|
||||||
// id: z.string(),
|
userId: z.number().or(z.string()).optional(),
|
||||||
// subscriberUrl: z.string(),
|
eventTypeId: z.number().or(z.string()).optional(),
|
||||||
// })
|
eventTriggers: z.any.optional(),
|
||||||
// .strict();
|
active: z.boolean().optional(),
|
||||||
|
subscriberUrl: z.string(),
|
||||||
|
payloadTemplate: z.string().optional(),
|
||||||
|
})
|
||||||
|
.strict();
|
||||||
|
|
||||||
export const schemaWebhookCreateBodyParams = schemaWebhookBaseBodyParams.merge(
|
export const schemaWebhookCreateBodyParams = schemaWebhookBaseBodyParams.merge(
|
||||||
z.object({
|
schemaWebhookCreateParams
|
||||||
id: z.string(),
|
|
||||||
subscriberUrl: z.string(),
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// const schemaWebhookEditParams = z
|
|
||||||
// .object({
|
|
||||||
// payloadTemplate: z.string().optional(),
|
|
||||||
// /** @todo: don't use any here and validate eventTriggers proper */
|
|
||||||
// eventTriggers: z.any(),
|
|
||||||
// subscriberUrl: z.string().optional(),
|
|
||||||
// })
|
|
||||||
// .strict();
|
|
||||||
|
|
||||||
export const schemaWebhookEditBodyParams = schemaWebhookBaseBodyParams.merge(
|
export const schemaWebhookEditBodyParams = schemaWebhookBaseBodyParams.merge(
|
||||||
z.object({
|
z.object({
|
||||||
payloadTemplate: z.string().optional(),
|
payloadTemplate: z.string().optional(),
|
||||||
|
|
Loading…
Reference in New Issue