@kontent-ai/webhook-helper
Version:
This utility helps with webhook notifications from Kontent.ai
10 lines • 387 B
JavaScript
import { fromZodError } from "zod-validation-error";
import { webhookResponseSchema } from "./webhook-schemas.js";
export const parseWebhookResponse = (data) => {
const result = webhookResponseSchema.safeParse(data);
if (!result.success) {
return { success: false, error: fromZodError(result.error) };
}
return result;
};
//# sourceMappingURL=parse-webhook.js.map