Files
demat-facturation/server/webPortalUrl.ts
2026-09-30 14:55:13 +02:00

14 lines
502 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { z } from "zod";
import { isValidWebPortalUrl, normalizeWebPortalUrl } from "@shared/webPortalUrl";
/**
* Normalise les domaines saisis sans protocole puis impose une URL HTTP(S).
* Le même schéma est utilisé à la création et à la mise à jour d’un connecteur.
*/
export const webPortalUrlSchema = z
.string()
.transform(normalizeWebPortalUrl)
.refine(isValidWebPortalUrl, {
message: "Saisissez une URL HTTP(S) valide, par exemple https://espaceclient.exemple.fr.",
});