merge directly
parent
dbf4590ba7
commit
f9e98228c7
|
@ -12,25 +12,37 @@ const schemaWebhookBaseBodyParams = Webhook.pick({
|
||||||
payloadTemplate: true,
|
payloadTemplate: true,
|
||||||
}).partial();
|
}).partial();
|
||||||
|
|
||||||
const schemaWebhookCreateParams = z
|
// const schemaWebhookCreateParams = z
|
||||||
.object({
|
// .object({
|
||||||
|
// id: z.string(),
|
||||||
|
// subscriberUrl: z.string(),
|
||||||
|
// })
|
||||||
|
// .strict();
|
||||||
|
|
||||||
|
export const schemaWebhookCreateBodyParams = schemaWebhookBaseBodyParams.merge(
|
||||||
|
z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
subscriberUrl: z.string(),
|
subscriberUrl: z.string(),
|
||||||
})
|
})
|
||||||
.strict();
|
);
|
||||||
|
|
||||||
export const schemaWebhookCreateBodyParams = schemaWebhookBaseBodyParams.merge(schemaWebhookCreateParams);
|
// 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();
|
||||||
|
|
||||||
const schemaWebhookEditParams = z
|
export const schemaWebhookEditBodyParams = schemaWebhookBaseBodyParams.merge(
|
||||||
.object({
|
z.object({
|
||||||
payloadTemplate: z.string().optional(),
|
payloadTemplate: z.string().optional(),
|
||||||
/** @todo: don't use any here and validate eventTriggers proper */
|
/** @todo: don't use any here and validate eventTriggers proper */
|
||||||
eventTriggers: z.any(),
|
eventTriggers: z.any(),
|
||||||
subscriberUrl: z.string().optional(),
|
subscriberUrl: z.string().optional(),
|
||||||
})
|
})
|
||||||
.strict();
|
);
|
||||||
|
|
||||||
export const schemaWebhookEditBodyParams = schemaWebhookBaseBodyParams.merge(schemaWebhookEditParams);
|
|
||||||
|
|
||||||
export const schemaWebhookReadPublic = Webhook.pick({
|
export const schemaWebhookReadPublic = Webhook.pick({
|
||||||
id: true,
|
id: true,
|
||||||
|
|
Loading…
Reference in New Issue