@stndrds/schema 1.0.0-alpha.329 → 1.0.0-alpha.331
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/all-CWDgBPuS.d.ts +1186 -0
- package/dist/all-DilIWUev.d.mts +1186 -0
- package/dist/capabilities.d.mts +94 -94
- package/dist/capabilities.d.ts +94 -94
- package/dist/capabilities.js +2 -2
- package/dist/capabilities.mjs +2 -2
- package/dist/checkbox-CjnTd8DE.d.ts +11 -0
- package/dist/checkbox-preO352q.d.mts +11 -0
- package/dist/config-BQJJHopR.js +13 -0
- package/dist/config-_sOeudpS.mjs +13 -0
- package/dist/core-397tQy5q.js +2 -0
- package/dist/core-BLHhNykL.mjs +2 -0
- package/dist/date-BL3UHIXs.d.mts +24 -0
- package/dist/date-CxwHkbid.d.ts +24 -0
- package/dist/exceptions-DGCzCc9t.d.mts +1405 -0
- package/dist/exceptions-DGCzCc9t.d.ts +1405 -0
- package/dist/exceptions.d.mts +3 -2
- package/dist/exceptions.d.ts +3 -2
- package/dist/exceptions.js +3 -1
- package/dist/exceptions.mjs +3 -1
- package/dist/index-B7HmBsUS.d.ts +53 -0
- package/dist/{helpers-qMMFwD1I.d.ts → index-BoUwfrDH.d.mts} +172 -145
- package/dist/index-C8M7Amy9.d.mts +254 -0
- package/dist/{helpers-lqSDjgQ1.d.mts → index-DqwNrDSp.d.ts} +172 -145
- package/dist/index-Uwy7CTKo.d.ts +254 -0
- package/dist/index-XtmC-C7J.d.mts +53 -0
- package/dist/index.d.mts +9151 -9136
- package/dist/index.d.ts +9151 -9136
- package/dist/index.js +21 -27
- package/dist/index.mjs +21 -27
- package/dist/number-Ddi_YYfm.d.mts +11 -0
- package/dist/number-GmD5PM5s.d.ts +11 -0
- package/dist/object-DGu0m2Y1.js +4 -0
- package/dist/object-DSRy1coV.mjs +4 -0
- package/dist/phone-BawtTYVi.mjs +2 -0
- package/dist/phone-DVaELsa3.js +2 -0
- package/dist/text-A9AJ1wUO.js +2 -0
- package/dist/text-C8Lb-NFo.mjs +2 -0
- package/dist/text-CxwF5K4k.d.mts +11 -0
- package/dist/text-D6UypN8p.d.ts +11 -0
- package/dist/utils-fXIvFFl6.mjs +2 -0
- package/dist/utils-gY3d9Dwp.js +2 -0
- package/dist/utils.d.mts +3 -2
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +2 -1
- package/dist/utils.mjs +2 -1
- package/dist/validation/all.d.mts +6 -8
- package/dist/validation/all.d.ts +6 -8
- package/dist/validation/all.js +2 -1
- package/dist/validation/all.mjs +2 -1
- package/dist/validation/complex/currency.d.mts +8 -9
- package/dist/validation/complex/currency.d.ts +8 -9
- package/dist/validation/complex/currency.js +2 -1
- package/dist/validation/complex/currency.mjs +2 -1
- package/dist/validation/complex/location.d.mts +14 -15
- package/dist/validation/complex/location.d.ts +14 -15
- package/dist/validation/complex/location.js +2 -1
- package/dist/validation/complex/location.mjs +2 -1
- package/dist/validation/complex/phone.d.mts +8 -9
- package/dist/validation/complex/phone.d.ts +8 -9
- package/dist/validation/complex/phone.js +2 -1
- package/dist/validation/complex/phone.mjs +2 -1
- package/dist/validation/complex/relation.d.mts +8 -9
- package/dist/validation/complex/relation.d.ts +8 -9
- package/dist/validation/complex/relation.js +2 -1
- package/dist/validation/complex/relation.mjs +2 -1
- package/dist/validation/complex/richtext.d.mts +6 -7
- package/dist/validation/complex/richtext.d.ts +6 -7
- package/dist/validation/complex/richtext.js +2 -1
- package/dist/validation/complex/richtext.mjs +2 -1
- package/dist/validation/complex/select.d.mts +8 -9
- package/dist/validation/complex/select.d.ts +8 -9
- package/dist/validation/complex/select.js +2 -1
- package/dist/validation/complex/select.mjs +2 -1
- package/dist/validation/complex/user.d.mts +6 -7
- package/dist/validation/complex/user.d.ts +6 -7
- package/dist/validation/complex/user.js +2 -1
- package/dist/validation/complex/user.mjs +2 -1
- package/dist/validation/computed/formula.d.mts +6 -7
- package/dist/validation/computed/formula.d.ts +6 -7
- package/dist/validation/computed/formula.js +2 -1
- package/dist/validation/computed/formula.mjs +2 -1
- package/dist/validation/computed/rollup.d.mts +6 -7
- package/dist/validation/computed/rollup.d.ts +6 -7
- package/dist/validation/computed/rollup.js +2 -1
- package/dist/validation/computed/rollup.mjs +2 -1
- package/dist/validation/config/index.d.mts +3 -4
- package/dist/validation/config/index.d.ts +3 -4
- package/dist/validation/config/index.js +2 -1
- package/dist/validation/config/index.mjs +2 -1
- package/dist/validation/core/index.d.mts +2 -17
- package/dist/validation/core/index.d.ts +2 -17
- package/dist/validation/core/index.js +2 -1
- package/dist/validation/core/index.mjs +2 -1
- package/dist/validation/object/index.d.mts +2 -29
- package/dist/validation/object/index.d.ts +2 -29
- package/dist/validation/object/index.js +2 -1
- package/dist/validation/object/index.mjs +2 -1
- package/dist/validation/primitives/checkbox.d.mts +2 -10
- package/dist/validation/primitives/checkbox.d.ts +2 -10
- package/dist/validation/primitives/checkbox.js +2 -1
- package/dist/validation/primitives/checkbox.mjs +2 -1
- package/dist/validation/primitives/date.d.mts +2 -23
- package/dist/validation/primitives/date.d.ts +2 -23
- package/dist/validation/primitives/date.js +2 -1
- package/dist/validation/primitives/date.mjs +2 -1
- package/dist/validation/primitives/number.d.mts +2 -10
- package/dist/validation/primitives/number.d.ts +2 -10
- package/dist/validation/primitives/number.js +2 -1
- package/dist/validation/primitives/number.mjs +2 -1
- package/dist/validation/primitives/text.d.mts +2 -10
- package/dist/validation/primitives/text.d.ts +2 -10
- package/dist/validation/primitives/text.js +2 -1
- package/dist/validation/primitives/text.mjs +2 -1
- package/dist/view-config.schema-B4AkqLKQ.mjs +2 -0
- package/dist/view-config.schema-to6p1m8L.js +2 -0
- package/package.json +7 -6
- package/dist/all-BgP-bB0i.d.mts +0 -1178
- package/dist/all-Cq8ZMfM4.d.ts +0 -1178
- package/dist/attributes-Cv6IP8-a.d.mts +0 -1365
- package/dist/attributes-Cv6IP8-a.d.ts +0 -1365
- package/dist/chunk-23KPS33D.js +0 -2
- package/dist/chunk-2M4YXNYZ.js +0 -15
- package/dist/chunk-47KVYDKG.js +0 -2
- package/dist/chunk-4OTKOCGB.mjs +0 -2
- package/dist/chunk-4VCADZK4.mjs +0 -2
- package/dist/chunk-53RAH3XB.mjs +0 -2
- package/dist/chunk-DPD6ZWL2.js +0 -2
- package/dist/chunk-EZCWO4XV.mjs +0 -15
- package/dist/chunk-GKXTXH4Y.mjs +0 -2
- package/dist/chunk-GXSNLYRR.js +0 -2
- package/dist/chunk-IBM4ID4Y.js +0 -6
- package/dist/chunk-JFSQ24XR.js +0 -2
- package/dist/chunk-JOS2XMXY.js +0 -2
- package/dist/chunk-JSKLP4GI.js +0 -12
- package/dist/chunk-JVLH3DVZ.js +0 -2
- package/dist/chunk-KG2ADZG6.mjs +0 -2
- package/dist/chunk-KLR22JMC.js +0 -2
- package/dist/chunk-KSPJP74K.mjs +0 -2
- package/dist/chunk-KYPEBOPW.mjs +0 -2
- package/dist/chunk-LB4TNMZU.mjs +0 -2
- package/dist/chunk-LSCBR4VS.js +0 -2
- package/dist/chunk-LWSOKXPF.js +0 -2
- package/dist/chunk-O34B5KOW.mjs +0 -2
- package/dist/chunk-PFO7NWQW.mjs +0 -2
- package/dist/chunk-Q7TQCRSD.mjs +0 -2
- package/dist/chunk-RTHLB6T6.js +0 -2
- package/dist/chunk-SLYRQ72J.js +0 -2
- package/dist/chunk-UKFOBZX2.js +0 -2
- package/dist/chunk-UXISKZ5Y.js +0 -2
- package/dist/chunk-VKFLXFPP.mjs +0 -2
- package/dist/chunk-WMQRTFOP.mjs +0 -2
- package/dist/chunk-XAVRKIBE.mjs +0 -6
- package/dist/chunk-XHEBV2HE.js +0 -2
- package/dist/chunk-XMQV2WFY.mjs +0 -2
- package/dist/chunk-XRDP2Y4J.mjs +0 -2
- package/dist/chunk-XRWRECDA.mjs +0 -12
- package/dist/chunk-XUAP7KWK.js +0 -2
- package/dist/chunk-XXTKNIBK.js +0 -2
- package/dist/chunk-YIXNAWH6.mjs +0 -2
- package/dist/chunk-YJSVWV3Z.mjs +0 -2
- package/dist/index-Comy7znP.d.ts +0 -252
- package/dist/index-D4XlMkLV.d.mts +0 -252
- package/dist/types-C5Bqalr9.d.ts +0 -38
- package/dist/types-CILLmEj-.d.mts +0 -38
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { ht as NumberAttribute } from "./exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/primitives/number.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a number attribute
|
|
8
|
+
*/
|
|
9
|
+
declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z$1.ZodNumber;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { createNumberValidator as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { ht as NumberAttribute } from "./exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/primitives/number.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a number attribute
|
|
8
|
+
*/
|
|
9
|
+
declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z$1.ZodNumber;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { createNumberValidator as t };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./exceptions.js"),t=require("./text-A9AJ1wUO.js"),n=require("./phone-DVaELsa3.js"),r=require("./core-397tQy5q.js"),i=require("./validation/complex/currency.js"),a=require("./validation/complex/location.js"),o=require("./validation/complex/relation.js"),s=require("./validation/complex/richtext.js"),c=require("./validation/complex/select.js"),l=require("./validation/complex/user.js"),u=require("./validation/computed/formula.js"),d=require("./validation/computed/rollup.js"),f=require("./validation/primitives/checkbox.js"),p=require("./validation/primitives/date.js"),m=require("./validation/primitives/number.js");let h=require("zod");function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const g={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return h.z.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,g=r.n){switch(e.type){case`text`:return t.t(e,g);case`richtext`:return s.createRichtextValidator(e,g);case`number`:return m.createNumberValidator(e,g);case`checkbox`:return f.createCheckboxValidator(e,g);case`date`:return p.createDateValidator(e,g);case`phone`:return n.t(e,g);case`currency`:return i.createCurrencyValidator(e,g);case`status`:return c.createStatusValidator(e,g);case`location`:return a.createLocationValidator(e,g);case`select`:return c.createSelectValidator(e,g);case`multiselect`:return c.createMultiselectValidator(e,g);case`user`:return l.createUserValidator(e,g);case`relation`:return o.createRelationValidator(e,g);case`formula`:return u.createFormulaValidator(e,g);case`rollup`:return d.createRollupValidator(e,g);default:return h.z.unknown()}}function createFormAttributeValidator(e,t=r.n){let n=createAttributeValidator(e,t);return e.required?n:withEmptyToNull(n,g[e.type])}const _=new WeakMap,v=new WeakMap;function createObjectValidator(e){let t=_.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?n[t.name]=e.refine(isValuePresent,{message:r.n.required(t)}):n[t.name]=withEmptyToNull(e,g[t.type])}let i=h.z.object(n).passthrough();return _.set(e,i),i}function createDraftValidator(e){let t=v.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,g[t.type])}let r=h.z.object(n).passthrough();return v.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=n.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:r.t(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.t(n.error)}}function validateObjectOrThrow(t,n){let r=validateObject(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
3
|
+
`)||`Unknown validation error`;throw new e.ValidationError(`Validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.t(n.error)}}function validateDraftOrThrow(t,n){let r=validateDraft(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
4
|
+
`)||`Unknown validation error`;throw new e.ValidationError(`Draft validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(t,n){let r=new Set(t.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new e.ValidationError(`Unknown attribute${i.length>1?`s`:``} for ${t.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return validateDraft}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return validateObjectOrThrow}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return createAttributeValidator}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return createFormAttributeValidator}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return validateAttribute}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return createDraftValidator}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return isValuePresent}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return isRecordComplete}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return validateDraftOrThrow}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return isNullishOrEmptyString}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return rejectUnknownAttributesOrThrow}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return validateObject}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return getMissingRequiredAttributes}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return createObjectValidator}});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{ValidationError as e}from"./exceptions.mjs";import{t}from"./text-C8Lb-NFo.mjs";import{t as n}from"./phone-BawtTYVi.mjs";import{n as r,t as i}from"./core-BLHhNykL.mjs";import{createCurrencyValidator as a}from"./validation/complex/currency.mjs";import{createLocationValidator as o}from"./validation/complex/location.mjs";import{createRelationValidator as s}from"./validation/complex/relation.mjs";import{createRichtextValidator as c}from"./validation/complex/richtext.mjs";import{createMultiselectValidator as l,createSelectValidator as u,createStatusValidator as d}from"./validation/complex/select.mjs";import{createUserValidator as f}from"./validation/complex/user.mjs";import{createFormulaValidator as p}from"./validation/computed/formula.mjs";import{createRollupValidator as m}from"./validation/computed/rollup.mjs";import{createCheckboxValidator as h}from"./validation/primitives/checkbox.mjs";import{createDateValidator as g}from"./validation/primitives/date.mjs";import{createNumberValidator as _}from"./validation/primitives/number.mjs";import{z as v}from"zod";function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const y={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return v.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,i=r){switch(e.type){case`text`:return t(e,i);case`richtext`:return c(e,i);case`number`:return _(e,i);case`checkbox`:return h(e,i);case`date`:return g(e,i);case`phone`:return n(e,i);case`currency`:return a(e,i);case`status`:return d(e,i);case`location`:return o(e,i);case`select`:return u(e,i);case`multiselect`:return l(e,i);case`user`:return f(e,i);case`relation`:return s(e,i);case`formula`:return p(e,i);case`rollup`:return m(e,i);default:return v.unknown()}}function createFormAttributeValidator(e,t=r){let n=createAttributeValidator(e,t);return e.required?n:withEmptyToNull(n,y[e.type])}const b=new WeakMap,x=new WeakMap;function createObjectValidator(e){let t=b.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?n[t.name]=e.refine(isValuePresent,{message:r.required(t)}):n[t.name]=withEmptyToNull(e,y[t.type])}let i=v.object(n).passthrough();return b.set(e,i),i}function createDraftValidator(e){let t=x.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,y[t.type])}let r=v.object(n).passthrough();return x.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let r=n.safeParse(t);return r.success?{success:!0,data:{[e.name]:r.data}}:{success:!1,errors:i(r.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:i(n.error)}}function validateObjectOrThrow(t,n){let r=validateObject(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
3
|
+
`)||`Unknown validation error`;throw new e(`Validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:i(n.error)}}function validateDraftOrThrow(t,n){let r=validateDraft(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
4
|
+
`)||`Unknown validation error`;throw new e(`Draft validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(t,n){let r=new Set(t.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new e(`Unknown attribute${i.length>1?`s`:``} for ${t.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}export{validateDraft as a,validateObjectOrThrow as c,createAttributeValidator as d,createFormAttributeValidator as f,validateAttribute as i,createDraftValidator as l,isValuePresent as m,isRecordComplete as n,validateDraftOrThrow as o,isNullishOrEmptyString as p,rejectUnknownAttributesOrThrow as r,validateObject as s,getMissingRequiredAttributes as t,createObjectValidator as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"./core-BLHhNykL.mjs";import{getCountryByIso3 as t,isValidIso3 as n,stripTrunkPrefix as r}from"@stndrds/constants";import{parsePhoneNumberFromString as i}from"libphonenumber-js";import{z as a}from"zod";function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return t(e)?.iso2}function normalizePhoneNumber(e,n){if(!e)return``;let a=getIso2(n);if(!a)return digitsOnly(e);let o=i(e,a);if(o)return o.nationalNumber;let s=t(n),c=digitsOnly(e);if(s){let e=s.phoneCode.replace(`+`,``),t=c.startsWith(e)?c.slice(e.length):c;return r(t,s.phoneTrunkPrefix??``)}return c}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let n=getIso2(e.countryCode),r=t(e.countryCode)?.phoneCode??``;if(!n)return`${r} ${e.phoneNumber}`.trim();let a=`${r}${digitsOnly(e.phoneNumber)}`,o=i(a);return o?o.formatInternational():`${r} ${e.phoneNumber}`.trim()}function createPhoneValidator(t,r=e){return a.object({countryCode:a.string().length(3),phoneNumber:a.string().min(1,{message:r.required(t)})},{message:r.invalidPhone(t)}).refine(e=>n(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}export{normalizePhoneNumber as i,formatPhoneForDisplay as n,normalizeCountrylessPhoneNumber as r,createPhoneValidator as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./core-397tQy5q.js");let t=require("@stndrds/constants"),n=require("libphonenumber-js"),r=require("zod");function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return(0,t.getCountryByIso3)(e)?.iso2}function normalizePhoneNumber(e,r){if(!e)return``;let i=getIso2(r);if(!i)return digitsOnly(e);let a=(0,n.parsePhoneNumberFromString)(e,i);if(a)return a.nationalNumber;let o=(0,t.getCountryByIso3)(r),s=digitsOnly(e);if(o){let e=o.phoneCode.replace(`+`,``),n=s.startsWith(e)?s.slice(e.length):s;return(0,t.stripTrunkPrefix)(n,o.phoneTrunkPrefix??``)}return s}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let r=getIso2(e.countryCode),i=(0,t.getCountryByIso3)(e.countryCode)?.phoneCode??``;if(!r)return`${i} ${e.phoneNumber}`.trim();let a=`${i}${digitsOnly(e.phoneNumber)}`,o=(0,n.parsePhoneNumberFromString)(a);return o?o.formatInternational():`${i} ${e.phoneNumber}`.trim()}function createPhoneValidator(n,i=e.n){return r.z.object({countryCode:r.z.string().length(3),phoneNumber:r.z.string().min(1,{message:i.required(n)})},{message:i.invalidPhone(n)}).refine(e=>(0,t.isValidIso3)(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return normalizePhoneNumber}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return formatPhoneForDisplay}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return normalizeCountrylessPhoneNumber}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return createPhoneValidator}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./core-397tQy5q.js");let t=require("zod");const n={email:`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$`,url:`^https?:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$`,slug:`^[a-z0-9]+(?:-[a-z0-9]+)*$`};function resolveTextPattern(e){return e.pattern?e.pattern:e.format?n[e.format]:void 0}var LRUCache=class{constructor(e){if(!Number.isInteger(e)||e<=0)throw Error(`LRU cache capacity must be greater than 0`);this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next();e.done||this.cache.delete(e.value)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};function createRegexCache(e=100){return new LRUCache(e)}function getCachedRegex(e,t){let n=e.get(t);return n||(n=new RegExp(t),e.set(t,n)),n}const r=createRegexCache();function createTextValidator(n,i=e.n){let a=t.z.string();n.minLength!==void 0&&(a=a.min(n.minLength,i.minLength(n,n.minLength))),n.maxLength!==void 0&&(a=a.max(n.maxLength,i.maxLength(n,n.maxLength)));let o=resolveTextPattern(n);return o&&(a=a.regex(getCachedRegex(r,o),i.invalidPattern(n))),a}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return resolveTextPattern}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return createTextValidator}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"./core-BLHhNykL.mjs";import{z as t}from"zod";const n={email:`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$`,url:`^https?:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$`,slug:`^[a-z0-9]+(?:-[a-z0-9]+)*$`};function resolveTextPattern(e){return e.pattern?e.pattern:e.format?n[e.format]:void 0}var LRUCache=class{constructor(e){if(!Number.isInteger(e)||e<=0)throw Error(`LRU cache capacity must be greater than 0`);this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next();e.done||this.cache.delete(e.value)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};function createRegexCache(e=100){return new LRUCache(e)}function getCachedRegex(e,t){let n=e.get(t);return n||(n=new RegExp(t),e.set(t,n)),n}const r=createRegexCache();function createTextValidator(n,i=e){let a=t.string();n.minLength!==void 0&&(a=a.min(n.minLength,i.minLength(n,n.minLength))),n.maxLength!==void 0&&(a=a.max(n.maxLength,i.maxLength(n,n.maxLength)));let o=resolveTextPattern(n);return o&&(a=a.regex(getCachedRegex(r,o),i.invalidPattern(n))),a}export{n,resolveTextPattern as r,createTextValidator as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { jt as TextAttribute } from "./exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/primitives/text.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a text attribute
|
|
8
|
+
*/
|
|
9
|
+
declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z$1.ZodString;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { createTextValidator as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { jt as TextAttribute } from "./exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/primitives/text.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a text attribute
|
|
8
|
+
*/
|
|
9
|
+
declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z$1.ZodString;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { createTextValidator as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";var NonJsonValueError=class extends e{constructor(){super(`Value must contain only JSON-compatible values`,t.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,r={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},i={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},a={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:e=>new n(`Cannot canonicalize ${describeUnrepresentable(e)}`,[]),circular:()=>new n(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,a,new Set)}function serializeStableJson(e){return serialize(e,i,new Set)}function serializeCanonicalJson(e){return serialize(e,r,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}export{indexBy as a,sameStableValue as c,generateId as i,serializeCanonicalJson as l,asUserId as n,NonJsonValueError as o,deepEqual as r,canonicalStringify as s,asTenantId as t,serializeStableJson as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./exceptions.js");var NonJsonValueError=class extends e.SchemaError{constructor(){super(`Value must contain only JSON-compatible values`,e.SchemaErrorCode.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,t={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},n={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},r={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:t=>new e.ValidationError(`Cannot canonicalize ${describeUnrepresentable(t)}`,[]),circular:()=>new e.ValidationError(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,r,new Set)}function serializeStableJson(e){return serialize(e,n,new Set)}function serializeCanonicalJson(e){return serialize(e,t,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return indexBy}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return sameStableValue}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return generateId}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return serializeCanonicalJson}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return asUserId}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return NonJsonValueError}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return deepEqual}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return canonicalStringify}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return asTenantId}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return serializeStableJson}});
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
|
|
2
|
+
import { $t as indexBy, Jt as Uuid, Kt as TenantId, Qt as generateId, Xt as asUserId, Yt as asTenantId, Zt as deepEqual, qt as UserId, tn as canonicalStringify } from "./exceptions-DGCzCc9t.mjs";
|
|
3
|
+
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
|
|
2
|
+
import { $t as indexBy, Jt as Uuid, Kt as TenantId, Qt as generateId, Xt as asUserId, Yt as asTenantId, Zt as deepEqual, qt as UserId, tn as canonicalStringify } from "./exceptions-DGCzCc9t.js";
|
|
3
|
+
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
package/dist/utils.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-gY3d9Dwp.js");exports.asTenantId=e.t,exports.asUserId=e.n,exports.canonicalStringify=e.s,exports.deepEqual=e.r,exports.generateId=e.i,exports.indexBy=e.a;
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{a as e,i as t,n,r,s as i,t as a}from"./utils-fXIvFFl6.mjs";export{a as asTenantId,n as asUserId,i as canonicalStringify,r as deepEqual,t as generateId,e as indexBy};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '@stndrds/constants';
|
|
8
|
-
import 'zod';
|
|
1
|
+
|
|
2
|
+
import { f as colorIdSchema, i as contentViewDefinitionSchema, m as SCHEMA_LIMITS, n as collectionContentSourceSchema, p as iconNameSchema, s as draftContentViewDefinitionSchema, u as publishedViewContentDefinitionSchema } from "../all-DilIWUev.mjs";
|
|
3
|
+
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-BoUwfrDH.mjs";
|
|
4
|
+
import { _ as statusOptionWriteSchema, c as parseAttributeConfigForCreate, d as propertyAttributeWireSchema, f as propertySchemaSchema, g as statusGroupSchema, h as selectOptionWriteSchema, l as parseAttributeConfigForUpdate, m as refuseForeignKeys, n as WIRE_OMITTED_CONFIG_KEYS, o as multiselectOptionWriteSchema, p as propertySchemaWireSchema, r as attributeConfigSchemas, s as parseAttributeConfig, t as SIMPLE_PROPERTY_TYPES, u as propertyAttributeSchema } from "../index-C8M7Amy9.mjs";
|
|
5
|
+
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-XtmC-C7J.mjs";
|
|
6
|
+
export { DEFAULT_VALIDATION_MESSAGES, SCHEMA_LIMITS, SIMPLE_PROPERTY_TYPES, type ValidationMessages, WIRE_OMITTED_CONFIG_KEYS, attributeConfigSchemas, collectionContentSourceSchema, colorIdSchema, contentViewDefinitionSchema, createFormAttributeValidator, draftContentViewDefinitionSchema, formatZodErrors, iconNameSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, propertyAttributeSchema, propertyAttributeWireSchema, propertySchemaSchema, propertySchemaWireSchema, publishedViewContentDefinitionSchema, refuseForeignKeys, rejectUnknownAttributesOrThrow, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow };
|
package/dist/validation/all.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '@stndrds/constants';
|
|
8
|
-
import 'zod';
|
|
1
|
+
|
|
2
|
+
import { f as colorIdSchema, i as contentViewDefinitionSchema, m as SCHEMA_LIMITS, n as collectionContentSourceSchema, p as iconNameSchema, s as draftContentViewDefinitionSchema, u as publishedViewContentDefinitionSchema } from "../all-CWDgBPuS.js";
|
|
3
|
+
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-DqwNrDSp.js";
|
|
4
|
+
import { _ as statusOptionWriteSchema, c as parseAttributeConfigForCreate, d as propertyAttributeWireSchema, f as propertySchemaSchema, g as statusGroupSchema, h as selectOptionWriteSchema, l as parseAttributeConfigForUpdate, m as refuseForeignKeys, n as WIRE_OMITTED_CONFIG_KEYS, o as multiselectOptionWriteSchema, p as propertySchemaWireSchema, r as attributeConfigSchemas, s as parseAttributeConfig, t as SIMPLE_PROPERTY_TYPES, u as propertyAttributeSchema } from "../index-Uwy7CTKo.js";
|
|
5
|
+
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-B7HmBsUS.js";
|
|
6
|
+
export { DEFAULT_VALIDATION_MESSAGES, SCHEMA_LIMITS, SIMPLE_PROPERTY_TYPES, type ValidationMessages, WIRE_OMITTED_CONFIG_KEYS, attributeConfigSchemas, collectionContentSourceSchema, colorIdSchema, contentViewDefinitionSchema, createFormAttributeValidator, draftContentViewDefinitionSchema, formatZodErrors, iconNameSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, propertyAttributeSchema, propertyAttributeWireSchema, propertySchemaSchema, propertySchemaWireSchema, publishedViewContentDefinitionSchema, refuseForeignKeys, rejectUnknownAttributesOrThrow, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow };
|
package/dist/validation/all.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../config-BQJJHopR.js"),t=require("../view-config.schema-to6p1m8L.js"),n=require("../object-DGu0m2Y1.js"),r=require("../core-397tQy5q.js");exports.DEFAULT_VALIDATION_MESSAGES=r.n,exports.SCHEMA_LIMITS=e.S,exports.SIMPLE_PROPERTY_TYPES=e.t,exports.WIRE_OMITTED_CONFIG_KEYS=e.n,exports.attributeConfigSchemas=e.r,exports.collectionContentSourceSchema=t.n,exports.colorIdSchema=e.b,exports.contentViewDefinitionSchema=t.i,exports.createFormAttributeValidator=n.f,exports.draftContentViewDefinitionSchema=t.s,exports.formatZodErrors=r.t,exports.iconNameSchema=e.x,exports.multiselectOptionWriteSchema=e.o,exports.parseAttributeConfig=e.s,exports.parseAttributeConfigForCreate=e.c,exports.parseAttributeConfigForUpdate=e.l,exports.propertyAttributeSchema=e.u,exports.propertyAttributeWireSchema=e.d,exports.propertySchemaSchema=e.f,exports.propertySchemaWireSchema=e.p,exports.publishedViewContentDefinitionSchema=t.u,exports.refuseForeignKeys=e.m,exports.rejectUnknownAttributesOrThrow=n.r,exports.selectOptionWriteSchema=e.h,exports.statusGroupSchema=e.g,exports.statusOptionWriteSchema=e._,exports.validateDraft=n.a,exports.validateDraftOrThrow=n.o,exports.validateObject=n.s,exports.validateObjectOrThrow=n.c;
|
package/dist/validation/all.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{i as e,n as t,s as n,u as r}from"../view-config.schema-B4AkqLKQ.mjs";import{S as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,x}from"../config-_sOeudpS.mjs";import{a as S,c as C,f as w,o as T,r as E,s as D}from"../object-DSRy1coV.mjs";import{n as O,t as k}from"../core-BLHhNykL.mjs";export{O as DEFAULT_VALIDATION_MESSAGES,i as SCHEMA_LIMITS,y as SIMPLE_PROPERTY_TYPES,m as WIRE_OMITTED_CONFIG_KEYS,_ as attributeConfigSchemas,t as collectionContentSourceSchema,o as colorIdSchema,e as contentViewDefinitionSchema,w as createFormAttributeValidator,n as draftContentViewDefinitionSchema,k as formatZodErrors,x as iconNameSchema,h as multiselectOptionWriteSchema,v as parseAttributeConfig,s as parseAttributeConfigForCreate,f as parseAttributeConfigForUpdate,b as propertyAttributeSchema,c as propertyAttributeWireSchema,l as propertySchemaSchema,g as propertySchemaWireSchema,r as publishedViewContentDefinitionSchema,p as refuseForeignKeys,E as rejectUnknownAttributesOrThrow,d as selectOptionWriteSchema,u as statusGroupSchema,a as statusOptionWriteSchema,S as validateDraft,T as validateDraftOrThrow,D as validateObject,C as validateObjectOrThrow};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { a as CurrencyAttribute } from '../../attributes-Cv6IP8-a.mjs';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-CILLmEj-.mjs';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { nt as CurrencyAttribute } from "../../exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/currency.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a currency attribute
|
|
8
8
|
*/
|
|
9
|
-
declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z$1.ZodType<{
|
|
10
|
+
code: string;
|
|
11
|
+
value: number;
|
|
12
12
|
}>;
|
|
13
|
-
|
|
14
|
-
export { createCurrencyValidator };
|
|
13
|
+
//#endregion
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { a as CurrencyAttribute } from '../../attributes-Cv6IP8-a.js';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-C5Bqalr9.js';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { nt as CurrencyAttribute } from "../../exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/currency.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a currency attribute
|
|
8
8
|
*/
|
|
9
|
-
declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z$1.ZodType<{
|
|
10
|
+
code: string;
|
|
11
|
+
value: number;
|
|
12
12
|
}>;
|
|
13
|
-
|
|
14
|
-
export { createCurrencyValidator };
|
|
13
|
+
//#endregion
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../core-397tQy5q.js");let t=require("zod");function createCurrencyValidator(n,r=e.n){let i=n.allowNegative?t.z.number():t.z.number().min(0);return t.z.object({code:t.z.string().length(3),value:i},{message:r.invalidCurrency(n)})}exports.createCurrencyValidator=createCurrencyValidator;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"../../core-BLHhNykL.mjs";import{z as t}from"zod";function createCurrencyValidator(n,r=e){let i=n.allowNegative?t.number():t.number().min(0);return t.object({code:t.string().length(3),value:i},{message:r.invalidCurrency(n)})}export{createCurrencyValidator};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { L as LocationAttribute } from '../../attributes-Cv6IP8-a.mjs';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-CILLmEj-.mjs';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { dt as LocationAttribute } from "../../exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/location.d.ts
|
|
6
6
|
type LocationShape = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
address?: string;
|
|
8
|
+
address2?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
postalCode?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
latitude?: number;
|
|
14
|
+
longitude?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Create a Zod schema for a location attribute
|
|
18
18
|
*/
|
|
19
|
-
declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z.ZodType<LocationShape>;
|
|
20
|
-
|
|
21
|
-
export { createLocationValidator };
|
|
19
|
+
export declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z$1.ZodType<LocationShape>;
|
|
20
|
+
//#endregion
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { L as LocationAttribute } from '../../attributes-Cv6IP8-a.js';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-C5Bqalr9.js';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { dt as LocationAttribute } from "../../exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/location.d.ts
|
|
6
6
|
type LocationShape = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
address?: string;
|
|
8
|
+
address2?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
postalCode?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
latitude?: number;
|
|
14
|
+
longitude?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Create a Zod schema for a location attribute
|
|
18
18
|
*/
|
|
19
|
-
declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z.ZodType<LocationShape>;
|
|
20
|
-
|
|
21
|
-
export { createLocationValidator };
|
|
19
|
+
export declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z$1.ZodType<LocationShape>;
|
|
20
|
+
//#endregion
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../core-397tQy5q.js");let t=require("zod");function createLocationValidator(n,r=e.n){return t.z.object({address:t.z.string().optional(),address2:t.z.string().optional(),city:t.z.string().optional(),state:t.z.string().optional(),postalCode:t.z.string().optional(),country:t.z.string().length(3).optional(),latitude:t.z.number().min(-90).max(90).optional(),longitude:t.z.number().min(-180).max(180).optional()},{message:r.invalidLocation(n)})}exports.createLocationValidator=createLocationValidator;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"../../core-BLHhNykL.mjs";import{z as t}from"zod";function createLocationValidator(n,r=e){return t.object({address:t.string().optional(),address2:t.string().optional(),city:t.string().optional(),state:t.string().optional(),postalCode:t.string().optional(),country:t.string().length(3).optional(),latitude:t.number().min(-90).max(90).optional(),longitude:t.number().min(-180).max(180).optional()},{message:r.invalidLocation(n)})}export{createLocationValidator};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { P as PhoneAttribute } from '../../attributes-Cv6IP8-a.mjs';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-CILLmEj-.mjs';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { yt as PhoneAttribute } from "../../exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/phone.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a phone attribute.
|
|
8
8
|
*
|
|
@@ -13,9 +13,8 @@ import '@stndrds/constants';
|
|
|
13
13
|
* Transforms:
|
|
14
14
|
* - Normalizes phoneNumber to national digits without trunk prefix
|
|
15
15
|
*/
|
|
16
|
-
declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z$1.ZodType<{
|
|
17
|
+
countryCode: string;
|
|
18
|
+
phoneNumber: string;
|
|
19
19
|
}>;
|
|
20
|
-
|
|
21
|
-
export { createPhoneValidator };
|
|
20
|
+
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { P as PhoneAttribute } from '../../attributes-Cv6IP8-a.js';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-C5Bqalr9.js';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { yt as PhoneAttribute } from "../../exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/phone.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a phone attribute.
|
|
8
8
|
*
|
|
@@ -13,9 +13,8 @@ import '@stndrds/constants';
|
|
|
13
13
|
* Transforms:
|
|
14
14
|
* - Normalizes phoneNumber to national digits without trunk prefix
|
|
15
15
|
*/
|
|
16
|
-
declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z.ZodType<{
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z$1.ZodType<{
|
|
17
|
+
countryCode: string;
|
|
18
|
+
phoneNumber: string;
|
|
19
19
|
}>;
|
|
20
|
-
|
|
21
|
-
export { createPhoneValidator };
|
|
20
|
+
//#endregion
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../phone-DVaELsa3.js");exports.createPhoneValidator=e.t;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{t as e}from"../../phone-BawtTYVi.mjs";export{e as createPhoneValidator};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { c as MultiRelationAttribute, d as RelationAttribute, e as SingleRelationAttribute } from '../../attributes-Cv6IP8-a.mjs';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-CILLmEj-.mjs';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { Ot as SingleRelationAttribute, pt as MultiRelationAttribute, xt as RelationAttribute } from "../../exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/relation.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a single relation attribute (cardinality: "one")
|
|
8
8
|
* Supports hybrid format `{ id, props }` from qualified relations.
|
|
9
9
|
* IMPORTANT: Validates the ID but preserves the original format (keeps props).
|
|
10
10
|
*/
|
|
11
|
-
declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
+
export declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
12
12
|
/**
|
|
13
13
|
* Create a Zod schema for a multi relation attribute (cardinality: "many")
|
|
14
14
|
* Supports hybrid format arrays with `{ id, props }` items from qualified relations.
|
|
15
15
|
* IMPORTANT: Validates the IDs but preserves the original format (keeps props).
|
|
16
16
|
*/
|
|
17
|
-
declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
17
|
+
export declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
18
18
|
/**
|
|
19
19
|
* Create a Zod schema for a relation attribute
|
|
20
20
|
* Dispatches to single or multi validator based on cardinality
|
|
21
21
|
*/
|
|
22
|
-
declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
23
|
-
|
|
24
|
-
export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator };
|
|
22
|
+
export declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
23
|
+
//#endregion
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { c as MultiRelationAttribute, d as RelationAttribute, e as SingleRelationAttribute } from '../../attributes-Cv6IP8-a.js';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-C5Bqalr9.js';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { Ot as SingleRelationAttribute, pt as MultiRelationAttribute, xt as RelationAttribute } from "../../exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/relation.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a single relation attribute (cardinality: "one")
|
|
8
8
|
* Supports hybrid format `{ id, props }` from qualified relations.
|
|
9
9
|
* IMPORTANT: Validates the ID but preserves the original format (keeps props).
|
|
10
10
|
*/
|
|
11
|
-
declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
+
export declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
12
12
|
/**
|
|
13
13
|
* Create a Zod schema for a multi relation attribute (cardinality: "many")
|
|
14
14
|
* Supports hybrid format arrays with `{ id, props }` items from qualified relations.
|
|
15
15
|
* IMPORTANT: Validates the IDs but preserves the original format (keeps props).
|
|
16
16
|
*/
|
|
17
|
-
declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
17
|
+
export declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
18
18
|
/**
|
|
19
19
|
* Create a Zod schema for a relation attribute
|
|
20
20
|
* Dispatches to single or multi validator based on cardinality
|
|
21
21
|
*/
|
|
22
|
-
declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
23
|
-
|
|
24
|
-
export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator };
|
|
22
|
+
export declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
23
|
+
//#endregion
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../core-397tQy5q.js");let t=require("zod");function extractRelationId(e){return typeof e==`object`&&e&&`id`in e?e.id:e}function createSingleRelationValidator(n,r=e.n){let i=t.z.guid({message:r.invalidId(n)}),a=t.z.union([i,t.z.null()]);return t.z.union([a,t.z.object({id:i,props:t.z.record(t.z.string(),t.z.unknown()).optional()}).passthrough()])}function createMultiRelationValidator(n,r=e.n){let i=t.z.guid({message:r.invalidId(n)}),a=t.z.union([i,t.z.object({id:i,props:t.z.record(t.z.string(),t.z.unknown()).optional()}).passthrough()]),o=t.z.array(a);return n.maxItems!==void 0&&(o=o.max(n.maxItems,r.maxItems(n,n.maxItems))),o.refine(e=>e.every(e=>{let t=extractRelationId(e);return typeof t==`string`&&i.safeParse(t).success}),{message:r.invalidId(n)})}function createRelationValidator(t,n=e.n){return t.cardinality===`many`?createMultiRelationValidator(t,n):createSingleRelationValidator(t,n)}exports.createMultiRelationValidator=createMultiRelationValidator,exports.createRelationValidator=createRelationValidator,exports.createSingleRelationValidator=createSingleRelationValidator;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"../../core-BLHhNykL.mjs";import{z as t}from"zod";function extractRelationId(e){return typeof e==`object`&&e&&`id`in e?e.id:e}function createSingleRelationValidator(n,r=e){let i=t.guid({message:r.invalidId(n)}),a=t.union([i,t.null()]);return t.union([a,t.object({id:i,props:t.record(t.string(),t.unknown()).optional()}).passthrough()])}function createMultiRelationValidator(n,r=e){let i=t.guid({message:r.invalidId(n)}),a=t.union([i,t.object({id:i,props:t.record(t.string(),t.unknown()).optional()}).passthrough()]),o=t.array(a);return n.maxItems!==void 0&&(o=o.max(n.maxItems,r.maxItems(n,n.maxItems))),o.refine(e=>e.every(e=>{let t=extractRelationId(e);return typeof t==`string`&&i.safeParse(t).success}),{message:r.invalidId(n)})}function createRelationValidator(t,n=e){return t.cardinality===`many`?createMultiRelationValidator(t,n):createSingleRelationValidator(t,n)}export{createMultiRelationValidator,createRelationValidator,createSingleRelationValidator};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { R as RichtextAttribute } from '../../attributes-Cv6IP8-a.mjs';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-CILLmEj-.mjs';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { wt as RichtextAttribute } from "../../exceptions-DGCzCc9t.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-XtmC-C7J.mjs";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/richtext.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a richtext attribute.
|
|
8
8
|
* Validates semantic markdown content as a string.
|
|
9
9
|
*/
|
|
10
|
-
declare function createRichtextValidator(attr: RichtextAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
-
|
|
12
|
-
export { createRichtextValidator };
|
|
10
|
+
export declare function createRichtextValidator(attr: RichtextAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
11
|
+
//#endregion
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { R as RichtextAttribute } from '../../attributes-Cv6IP8-a.js';
|
|
3
|
-
import { V as ValidationMessages } from '../../types-C5Bqalr9.js';
|
|
4
|
-
import '@stndrds/constants';
|
|
5
1
|
|
|
2
|
+
import { wt as RichtextAttribute } from "../../exceptions-DGCzCc9t.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-B7HmBsUS.js";
|
|
4
|
+
import { z as z$1 } from "zod";
|
|
5
|
+
//#region src/validation/complex/richtext.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a Zod schema for a richtext attribute.
|
|
8
8
|
* Validates semantic markdown content as a string.
|
|
9
9
|
*/
|
|
10
|
-
declare function createRichtextValidator(attr: RichtextAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
-
|
|
12
|
-
export { createRichtextValidator };
|
|
10
|
+
export declare function createRichtextValidator(attr: RichtextAttribute, messages?: ValidationMessages): z$1.ZodTypeAny;
|
|
11
|
+
//#endregion
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../core-397tQy5q.js");let t=require("zod");function createRichtextValidator(n,r=e.n){return t.z.string({message:r.invalidRichtext(n)})}exports.createRichtextValidator=createRichtextValidator;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{n as e}from"../../core-BLHhNykL.mjs";import{z as t}from"zod";function createRichtextValidator(n,r=e){return t.string({message:r.invalidRichtext(n)})}export{createRichtextValidator};
|