@stndrds/schema 1.0.0-alpha.349 → 1.0.0-alpha.351
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-CnoQ40WJ.d.mts → all-CxrR3FfQ.d.mts} +8 -8
- package/dist/{all-DZp7BWOq.d.ts → all-DgCMEIjc.d.ts} +8 -8
- package/dist/attributes-BrWmES5w.d.mts +684 -0
- package/dist/attributes-DF899HOt.d.ts +684 -0
- package/dist/{checkbox-Cli_fh_9.d.ts → checkbox-Clb_FZ4C.d.mts} +2 -2
- package/dist/{checkbox-De7-FSiU.d.mts → checkbox-DdyYfy8E.d.ts} +2 -2
- package/dist/config-CYuFravl.js +13 -0
- package/dist/config-CiAtjzem.mjs +13 -0
- package/dist/{date-CxGxPeHR.d.mts → date-CXp1zJM4.d.mts} +2 -2
- package/dist/{date-CJGbHQZF.d.ts → date-DhwNqFU4.d.ts} +2 -2
- package/dist/empty-BgAwlO54.mjs +2 -0
- package/dist/empty-CRCKZcwK.js +2 -0
- package/dist/exceptions-DrrzAhuA.d.mts +590 -0
- package/dist/exceptions-DrrzAhuA.d.ts +590 -0
- package/dist/exceptions.d.mts +2 -2
- package/dist/exceptions.d.ts +2 -2
- package/dist/exceptions.js +1 -2
- package/dist/exceptions.mjs +1 -2
- package/dist/{index-DqfX-ct_.d.mts → index-BOibflWy.d.ts} +15 -2
- package/dist/{index-UancE_wI.d.ts → index-Bfvc4AZB.d.mts} +15 -2
- package/dist/{index-Dz6tbe0o.d.ts → index-DCw-X_sc.d.ts} +3 -6
- package/dist/{index-fWrEgqge.d.mts → index-DggAjGTr.d.mts} +1 -1
- package/dist/{index-DRfeDI4f.d.mts → index-Lp5dhlhc.d.mts} +3 -6
- package/dist/{index-C9whsQlG.d.ts → index-OvRk1isl.d.ts} +1 -1
- package/dist/index.d.mts +221 -115
- package/dist/index.d.ts +221 -115
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/{number-BtJHcFCQ.d.ts → number-C_ZN3qJO.d.mts} +2 -2
- package/dist/{number-DJ-nhMMq.d.mts → number-CoTBX03I.d.ts} +2 -2
- package/dist/object-AqI3n2CP.mjs +4 -0
- package/dist/object-BEwZx-Fu.js +4 -0
- package/dist/{text-RUwIi6jM.d.mts → text-D_rs4VYZ.d.mts} +2 -2
- package/dist/{text-qHaUKcUU.d.ts → text-Z8QjbxUx.d.ts} +2 -2
- package/dist/utils-Cl3b_6d8.d.mts +163 -0
- package/dist/utils-Cuz_wSKI.d.ts +163 -0
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/validation/all.d.mts +5 -5
- package/dist/validation/all.d.ts +5 -5
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +2 -2
- package/dist/validation/config/index.d.ts +2 -2
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/view-config.schema-CCrM5b-O.mjs +2 -0
- package/dist/view-config.schema-CgU86fLj.js +2 -0
- package/package.json +2 -2
- package/dist/config-BiQGgy7f.mjs +0 -13
- package/dist/config-WUWITOeW.js +0 -13
- package/dist/exceptions-B2EKDci0.d.mts +0 -1460
- package/dist/exceptions-B2EKDci0.d.ts +0 -1460
- package/dist/object-BA3vKFl0.js +0 -4
- package/dist/object-C92B0Oei.mjs +0 -4
- package/dist/view-config.schema-PCAznd98.mjs +0 -2
- package/dist/view-config.schema-VEoY_VAd.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { S as NumberAttribute } from "./attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/number.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { S as NumberAttribute } from "./attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/number.d.ts
|
|
6
6
|
/**
|
|
@@ -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{n,t as r}from"./core-BLHhNykL.mjs";import{createNumberValidator as i}from"./validation/primitives/number.mjs";import{createCheckboxValidator as a}from"./validation/primitives/checkbox.mjs";import{createDateValidator as o}from"./validation/primitives/date.mjs";import{n as s}from"./empty-BgAwlO54.mjs";import{t as c}from"./phone-CsV9QNwF.mjs";import{createCurrencyValidator as l}from"./validation/complex/currency.mjs";import{createLocationValidator as u}from"./validation/complex/location.mjs";import{createRelationValidator as d}from"./validation/complex/relation.mjs";import{createRichtextValidator as f}from"./validation/complex/richtext.mjs";import{createMultiselectValidator as p,createSelectValidator as m,createStatusValidator as h}from"./validation/complex/select.mjs";import{createUserValidator as g}from"./validation/complex/user.mjs";import{createFormulaValidator as _}from"./validation/computed/formula.mjs";import{createRollupValidator as v}from"./validation/computed/rollup.mjs";import{z as y}from"zod";const b={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 y.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,r=n){switch(e.type){case`text`:return t(e,r);case`richtext`:return f(e,r);case`number`:return i(e,r);case`checkbox`:return a(e,r);case`date`:return o(e,r);case`phone`:return c(e,r);case`currency`:return l(e,r);case`status`:return h(e,r);case`location`:return u(e,r);case`select`:return m(e,r);case`multiselect`:return p(e,r);case`user`:return g(e,r);case`relation`:return d(e,r);case`formula`:return _(e,r);case`rollup`:return v(e,r);default:return y.unknown()}}function createFormAttributeValidator(e,t=n){let r=createAttributeValidator(e,t);return e.required?r:withEmptyToNull(r,b[e.type])}const x=new WeakMap,S=new WeakMap;function createObjectValidator(e){let t=x.get(e);if(t)return t;let r={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?r[t.name]=e.refine(s,{message:n.required(t)}):r[t.name]=withEmptyToNull(e,b[t.type])}let i=y.object(r).passthrough();return x.set(e,i),i}function createDraftValidator(e){let t=S.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,b[t.type])}let r=y.object(n).passthrough();return S.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(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(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:r(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&&!s(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,isRecordComplete as n,validateDraftOrThrow as o,rejectUnknownAttributesOrThrow as r,validateObject as s,getMissingRequiredAttributes as t,createObjectValidator as u};
|
|
@@ -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("./core-397tQy5q.js"),r=require("./validation/primitives/number.js"),i=require("./validation/primitives/checkbox.js"),a=require("./validation/primitives/date.js"),o=require("./empty-CRCKZcwK.js"),s=require("./phone-MN6Li5Wx.js"),c=require("./validation/complex/currency.js"),l=require("./validation/complex/location.js"),u=require("./validation/complex/relation.js"),d=require("./validation/complex/richtext.js"),f=require("./validation/complex/select.js"),p=require("./validation/complex/user.js"),m=require("./validation/computed/formula.js"),h=require("./validation/computed/rollup.js");let g=require("zod");const _={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 g.z.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,o=n.n){switch(e.type){case`text`:return t.t(e,o);case`richtext`:return d.createRichtextValidator(e,o);case`number`:return r.createNumberValidator(e,o);case`checkbox`:return i.createCheckboxValidator(e,o);case`date`:return a.createDateValidator(e,o);case`phone`:return s.t(e,o);case`currency`:return c.createCurrencyValidator(e,o);case`status`:return f.createStatusValidator(e,o);case`location`:return l.createLocationValidator(e,o);case`select`:return f.createSelectValidator(e,o);case`multiselect`:return f.createMultiselectValidator(e,o);case`user`:return p.createUserValidator(e,o);case`relation`:return u.createRelationValidator(e,o);case`formula`:return m.createFormulaValidator(e,o);case`rollup`:return h.createRollupValidator(e,o);default:return g.z.unknown()}}function createFormAttributeValidator(e,t=n.n){let r=createAttributeValidator(e,t);return e.required?r:withEmptyToNull(r,_[e.type])}const v=new WeakMap,y=new WeakMap;function createObjectValidator(e){let t=v.get(e);if(t)return t;let r={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?r[t.name]=e.refine(o.n,{message:n.n.required(t)}):r[t.name]=withEmptyToNull(e,_[t.type])}let i=g.z.object(r).passthrough();return v.set(e,i),i}function createDraftValidator(e){let t=y.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,_[t.type])}let r=g.z.object(n).passthrough();return y.set(e,r),r}function validateAttribute(e,t){let r=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=r.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:n.t(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let r=createObjectValidator(e).safeParse(t);return r.success?{success:!0,data:r.data}:{success:!1,errors:n.t(r.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 r=createDraftValidator(e).safeParse(t);return r.success?{success:!0,data:r.data}:{success:!1,errors:n.t(r.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&&!o.n(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,"n",{enumerable:!0,get:function(){return isRecordComplete}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return validateDraftOrThrow}}),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}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { R as TextAttribute } from "./attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/text.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { R as TextAttribute } from "./attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/text.d.ts
|
|
6
6
|
/**
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
import { D as SchemaError } from "./exceptions-DrrzAhuA.mjs";
|
|
3
|
+
//#region src/utils/stable-json.d.ts
|
|
4
|
+
declare class NonJsonValueError extends SchemaError {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Serializes a value into deterministic JSON: object keys are sorted
|
|
9
|
+
* recursively, array order is preserved, `undefined` object entries are
|
|
10
|
+
* omitted, and no whitespace is emitted.
|
|
11
|
+
*
|
|
12
|
+
* The canonicalization hashed across the runtime boot seed, the server, the CLI
|
|
13
|
+
* and `@stndrds/reflex` — the output must stay byte-identical for equivalent
|
|
14
|
+
* inputs regardless of key insertion order or jsonb storage round-trips.
|
|
15
|
+
*
|
|
16
|
+
* @throws {ValidationError} On circular references, unsupported value types
|
|
17
|
+
* (functions, symbols, bigint), and on a `Date`, `Map`, `Set` or any other
|
|
18
|
+
* non-plain object — it is a content identity, and those carry no own
|
|
19
|
+
* enumerable entry, so emitting them as `{}` made two different values hash
|
|
20
|
+
* alike (#3406). Project such a value yourself (`date.toISOString()`,
|
|
21
|
+
* `[...map]`) before hashing it.
|
|
22
|
+
*/
|
|
23
|
+
declare function canonicalStringify(value: unknown): string;
|
|
24
|
+
/**
|
|
25
|
+
* Key-sorted JSON for comparing values that round-trip through jsonb. Coerces
|
|
26
|
+
* what JSON cannot express rather than refusing — the caller is asking "are
|
|
27
|
+
* these the same?", not "is this valid?".
|
|
28
|
+
*/
|
|
29
|
+
declare function serializeStableJson(value: unknown): string;
|
|
30
|
+
/**
|
|
31
|
+
* Key-sorted JSON for content identity. Throws {@link NonJsonValueError} on
|
|
32
|
+
* anything JSON cannot represent, so two different values never hash alike.
|
|
33
|
+
*/
|
|
34
|
+
declare function serializeCanonicalJson(value: unknown): string;
|
|
35
|
+
/**
|
|
36
|
+
* Order-insensitive deep equality over {@link serializeStableJson}.
|
|
37
|
+
*
|
|
38
|
+
* Not `deepEqual` from `../utils`: that one compares in place without
|
|
39
|
+
* allocating, and answers differently for `NaN`, for an explicitly-`undefined`
|
|
40
|
+
* entry, and for a cycle. Reach for this when the bytes are the point.
|
|
41
|
+
*/
|
|
42
|
+
declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils.d.ts
|
|
45
|
+
/**
|
|
46
|
+
* Brand symbol for nominal typing.
|
|
47
|
+
* This ensures type-safety by making IDs non-interchangeable.
|
|
48
|
+
*/
|
|
49
|
+
declare const __brand: unique symbol;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a branded type from a base type.
|
|
52
|
+
* Branded types are structurally identical but nominally different.
|
|
53
|
+
*/
|
|
54
|
+
type Brand<T, B> = T & {
|
|
55
|
+
readonly [__brand]: B;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* UUID string type for all identifiers
|
|
59
|
+
*/
|
|
60
|
+
type Uuid = string;
|
|
61
|
+
/**
|
|
62
|
+
* Tenant identifier for multi-tenant isolation.
|
|
63
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const tenantId: TenantId = asTenantId('tenant-123');
|
|
68
|
+
* const userId: UserId = asUserId('user-456');
|
|
69
|
+
*
|
|
70
|
+
* // Type error: cannot assign UserId to TenantId
|
|
71
|
+
* const wrong: TenantId = userId;
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
type TenantId = Brand<string, "TenantId">;
|
|
75
|
+
/**
|
|
76
|
+
* User identifier for audit trails and permissions.
|
|
77
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
78
|
+
*/
|
|
79
|
+
type UserId = Brand<string, "UserId">;
|
|
80
|
+
/**
|
|
81
|
+
* Convert a string to a TenantId.
|
|
82
|
+
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
83
|
+
*
|
|
84
|
+
* @param id - The string to convert
|
|
85
|
+
* @returns A branded TenantId
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare function asTenantId(id: string): TenantId;
|
|
93
|
+
/**
|
|
94
|
+
* Convert a string to a UserId.
|
|
95
|
+
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
96
|
+
*
|
|
97
|
+
* @param id - The string to convert
|
|
98
|
+
* @returns A branded UserId
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const userId = asUserId(jwtPayload.sub);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare function asUserId(id: string): UserId;
|
|
106
|
+
/**
|
|
107
|
+
* Generate a unique UUID v4
|
|
108
|
+
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
109
|
+
* Falls back to a manual implementation for older environments
|
|
110
|
+
*
|
|
111
|
+
* @returns A UUID v4 string
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const id = generateId();
|
|
116
|
+
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function generateId(): Uuid;
|
|
120
|
+
/**
|
|
121
|
+
* Create a Map indexed by a key extracted from each item.
|
|
122
|
+
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
123
|
+
*
|
|
124
|
+
* Time complexity: O(n)
|
|
125
|
+
* Space complexity: O(n)
|
|
126
|
+
*
|
|
127
|
+
* @param items - Array of items to index
|
|
128
|
+
* @param keyFn - Function to extract the key from each item
|
|
129
|
+
* @returns Map indexed by the extracted key
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const attributes = [{ name: "title", type: "text" }, { name: "status", type: "select" }];
|
|
134
|
+
*
|
|
135
|
+
* // Before:
|
|
136
|
+
* const attrMap = new Map(attributes.map(a => [a.name, a]));
|
|
137
|
+
*
|
|
138
|
+
* // After:
|
|
139
|
+
* const attrMap = indexBy(attributes, a => a.name);
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
143
|
+
/**
|
|
144
|
+
* Deep equality comparison for plain objects and arrays.
|
|
145
|
+
* Handles nested structures, arrays, primitives, null, and undefined.
|
|
146
|
+
*
|
|
147
|
+
* Time complexity: O(n) where n is total number of properties
|
|
148
|
+
*
|
|
149
|
+
* @param a - First value to compare
|
|
150
|
+
* @param b - Second value to compare
|
|
151
|
+
* @returns true if values are deeply equal
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true
|
|
156
|
+
* deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }); // true (order-independent)
|
|
157
|
+
* deepEqual([1, 2, 3], [1, 2, 3]); // true
|
|
158
|
+
* deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
+
//#endregion
|
|
163
|
+
export { asUserId as a, indexBy as c, sameStableValue as d, serializeCanonicalJson as f, asTenantId as i, NonJsonValueError as l, UserId as n, deepEqual as o, serializeStableJson as p, Uuid as r, generateId as s, TenantId as t, canonicalStringify as u };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
import { D as SchemaError } from "./exceptions-DrrzAhuA.js";
|
|
3
|
+
//#region src/utils/stable-json.d.ts
|
|
4
|
+
declare class NonJsonValueError extends SchemaError {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Serializes a value into deterministic JSON: object keys are sorted
|
|
9
|
+
* recursively, array order is preserved, `undefined` object entries are
|
|
10
|
+
* omitted, and no whitespace is emitted.
|
|
11
|
+
*
|
|
12
|
+
* The canonicalization hashed across the runtime boot seed, the server, the CLI
|
|
13
|
+
* and `@stndrds/reflex` — the output must stay byte-identical for equivalent
|
|
14
|
+
* inputs regardless of key insertion order or jsonb storage round-trips.
|
|
15
|
+
*
|
|
16
|
+
* @throws {ValidationError} On circular references, unsupported value types
|
|
17
|
+
* (functions, symbols, bigint), and on a `Date`, `Map`, `Set` or any other
|
|
18
|
+
* non-plain object — it is a content identity, and those carry no own
|
|
19
|
+
* enumerable entry, so emitting them as `{}` made two different values hash
|
|
20
|
+
* alike (#3406). Project such a value yourself (`date.toISOString()`,
|
|
21
|
+
* `[...map]`) before hashing it.
|
|
22
|
+
*/
|
|
23
|
+
declare function canonicalStringify(value: unknown): string;
|
|
24
|
+
/**
|
|
25
|
+
* Key-sorted JSON for comparing values that round-trip through jsonb. Coerces
|
|
26
|
+
* what JSON cannot express rather than refusing — the caller is asking "are
|
|
27
|
+
* these the same?", not "is this valid?".
|
|
28
|
+
*/
|
|
29
|
+
declare function serializeStableJson(value: unknown): string;
|
|
30
|
+
/**
|
|
31
|
+
* Key-sorted JSON for content identity. Throws {@link NonJsonValueError} on
|
|
32
|
+
* anything JSON cannot represent, so two different values never hash alike.
|
|
33
|
+
*/
|
|
34
|
+
declare function serializeCanonicalJson(value: unknown): string;
|
|
35
|
+
/**
|
|
36
|
+
* Order-insensitive deep equality over {@link serializeStableJson}.
|
|
37
|
+
*
|
|
38
|
+
* Not `deepEqual` from `../utils`: that one compares in place without
|
|
39
|
+
* allocating, and answers differently for `NaN`, for an explicitly-`undefined`
|
|
40
|
+
* entry, and for a cycle. Reach for this when the bytes are the point.
|
|
41
|
+
*/
|
|
42
|
+
declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils.d.ts
|
|
45
|
+
/**
|
|
46
|
+
* Brand symbol for nominal typing.
|
|
47
|
+
* This ensures type-safety by making IDs non-interchangeable.
|
|
48
|
+
*/
|
|
49
|
+
declare const __brand: unique symbol;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a branded type from a base type.
|
|
52
|
+
* Branded types are structurally identical but nominally different.
|
|
53
|
+
*/
|
|
54
|
+
type Brand<T, B> = T & {
|
|
55
|
+
readonly [__brand]: B;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* UUID string type for all identifiers
|
|
59
|
+
*/
|
|
60
|
+
type Uuid = string;
|
|
61
|
+
/**
|
|
62
|
+
* Tenant identifier for multi-tenant isolation.
|
|
63
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const tenantId: TenantId = asTenantId('tenant-123');
|
|
68
|
+
* const userId: UserId = asUserId('user-456');
|
|
69
|
+
*
|
|
70
|
+
* // Type error: cannot assign UserId to TenantId
|
|
71
|
+
* const wrong: TenantId = userId;
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
type TenantId = Brand<string, "TenantId">;
|
|
75
|
+
/**
|
|
76
|
+
* User identifier for audit trails and permissions.
|
|
77
|
+
* Branded type to prevent accidental mixing with other string IDs.
|
|
78
|
+
*/
|
|
79
|
+
type UserId = Brand<string, "UserId">;
|
|
80
|
+
/**
|
|
81
|
+
* Convert a string to a TenantId.
|
|
82
|
+
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
83
|
+
*
|
|
84
|
+
* @param id - The string to convert
|
|
85
|
+
* @returns A branded TenantId
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare function asTenantId(id: string): TenantId;
|
|
93
|
+
/**
|
|
94
|
+
* Convert a string to a UserId.
|
|
95
|
+
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
96
|
+
*
|
|
97
|
+
* @param id - The string to convert
|
|
98
|
+
* @returns A branded UserId
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const userId = asUserId(jwtPayload.sub);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare function asUserId(id: string): UserId;
|
|
106
|
+
/**
|
|
107
|
+
* Generate a unique UUID v4
|
|
108
|
+
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
109
|
+
* Falls back to a manual implementation for older environments
|
|
110
|
+
*
|
|
111
|
+
* @returns A UUID v4 string
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const id = generateId();
|
|
116
|
+
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function generateId(): Uuid;
|
|
120
|
+
/**
|
|
121
|
+
* Create a Map indexed by a key extracted from each item.
|
|
122
|
+
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
123
|
+
*
|
|
124
|
+
* Time complexity: O(n)
|
|
125
|
+
* Space complexity: O(n)
|
|
126
|
+
*
|
|
127
|
+
* @param items - Array of items to index
|
|
128
|
+
* @param keyFn - Function to extract the key from each item
|
|
129
|
+
* @returns Map indexed by the extracted key
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const attributes = [{ name: "title", type: "text" }, { name: "status", type: "select" }];
|
|
134
|
+
*
|
|
135
|
+
* // Before:
|
|
136
|
+
* const attrMap = new Map(attributes.map(a => [a.name, a]));
|
|
137
|
+
*
|
|
138
|
+
* // After:
|
|
139
|
+
* const attrMap = indexBy(attributes, a => a.name);
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
143
|
+
/**
|
|
144
|
+
* Deep equality comparison for plain objects and arrays.
|
|
145
|
+
* Handles nested structures, arrays, primitives, null, and undefined.
|
|
146
|
+
*
|
|
147
|
+
* Time complexity: O(n) where n is total number of properties
|
|
148
|
+
*
|
|
149
|
+
* @param a - First value to compare
|
|
150
|
+
* @param b - Second value to compare
|
|
151
|
+
* @returns true if values are deeply equal
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true
|
|
156
|
+
* deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }); // true (order-independent)
|
|
157
|
+
* deepEqual([1, 2, 3], [1, 2, 3]); // true
|
|
158
|
+
* deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
+
//#endregion
|
|
163
|
+
export { asUserId as a, indexBy as c, sameStableValue as d, serializeCanonicalJson as f, asTenantId as i, NonJsonValueError as l, UserId as n, deepEqual as o, serializeStableJson as p, Uuid as r, generateId as s, TenantId as t, canonicalStringify as u };
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { a as asUserId, c as indexBy, i as asTenantId, n as UserId, o as deepEqual, r as Uuid, s as generateId, t as TenantId, u as canonicalStringify } from "./utils-Cl3b_6d8.mjs";
|
|
3
3
|
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { a as asUserId, c as indexBy, i as asTenantId, n as UserId, o as deepEqual, r as Uuid, s as generateId, t as TenantId, u as canonicalStringify } from "./utils-Cuz_wSKI.js";
|
|
3
3
|
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { d as colorIdSchema, f as iconNameSchema, l as publishedViewContentDefinitionSchema, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, r as contentViewDefinitionSchema, t as collectionContentSourceSchema } from "../all-
|
|
3
|
-
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-
|
|
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-
|
|
5
|
-
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-
|
|
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 };
|
|
2
|
+
import { d as colorIdSchema, f as iconNameSchema, l as publishedViewContentDefinitionSchema, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, r as contentViewDefinitionSchema, t as collectionContentSourceSchema } from "../all-CxrR3FfQ.mjs";
|
|
3
|
+
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-Lp5dhlhc.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, v as withoutUnknownOptionKeys } from "../index-Bfvc4AZB.mjs";
|
|
5
|
+
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-DggAjGTr.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, withoutUnknownOptionKeys };
|
package/dist/validation/all.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { d as colorIdSchema, f as iconNameSchema, l as publishedViewContentDefinitionSchema, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, r as contentViewDefinitionSchema, t as collectionContentSourceSchema } from "../all-
|
|
3
|
-
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-
|
|
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-
|
|
5
|
-
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-
|
|
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 };
|
|
2
|
+
import { d as colorIdSchema, f as iconNameSchema, l as publishedViewContentDefinitionSchema, o as draftContentViewDefinitionSchema, p as SCHEMA_LIMITS, r as contentViewDefinitionSchema, t as collectionContentSourceSchema } from "../all-DgCMEIjc.js";
|
|
3
|
+
import { a as validateDraft, c as validateObjectOrThrow, f as createFormAttributeValidator, o as validateDraftOrThrow, r as rejectUnknownAttributesOrThrow, s as validateObject } from "../index-DCw-X_sc.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, v as withoutUnknownOptionKeys } from "../index-BOibflWy.js";
|
|
5
|
+
import { n as DEFAULT_VALIDATION_MESSAGES, r as ValidationMessages, t as formatZodErrors } from "../index-OvRk1isl.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, withoutUnknownOptionKeys };
|
package/dist/validation/all.js
CHANGED
|
@@ -1,2 +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-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../config-CYuFravl.js"),t=require("../view-config.schema-CgU86fLj.js"),n=require("../core-397tQy5q.js"),r=require("../object-BEwZx-Fu.js");exports.DEFAULT_VALIDATION_MESSAGES=n.n,exports.SCHEMA_LIMITS=e.U,exports.SIMPLE_PROPERTY_TYPES=e.t,exports.WIRE_OMITTED_CONFIG_KEYS=e.n,exports.attributeConfigSchemas=e.r,exports.collectionContentSourceSchema=t.t,exports.colorIdSchema=e.V,exports.contentViewDefinitionSchema=t.r,exports.createFormAttributeValidator=r.f,exports.draftContentViewDefinitionSchema=t.o,exports.formatZodErrors=n.t,exports.iconNameSchema=e.H,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.l,exports.refuseForeignKeys=e.m,exports.rejectUnknownAttributesOrThrow=r.r,exports.selectOptionWriteSchema=e.h,exports.statusGroupSchema=e.g,exports.statusOptionWriteSchema=e._,exports.validateDraft=r.a,exports.validateDraftOrThrow=r.o,exports.validateObject=r.s,exports.validateObjectOrThrow=r.c,exports.withoutUnknownOptionKeys=e.v;
|
package/dist/validation/all.mjs
CHANGED
|
@@ -1,2 +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{l as e,o as t,r as n,t as r}from"../view-config.schema-
|
|
2
|
+
import{l as e,o as t,r as n,t as r}from"../view-config.schema-CCrM5b-O.mjs";import{H as i,U as a,V as o,_ as s,c,d as l,f as u,g as d,h as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S}from"../config-CiAtjzem.mjs";import{n as C,t as w}from"../core-BLHhNykL.mjs";import{a as T,c as E,f as D,o as O,r as k,s as A}from"../object-AqI3n2CP.mjs";export{C as DEFAULT_VALIDATION_MESSAGES,a as SCHEMA_LIMITS,b as SIMPLE_PROPERTY_TYPES,h as WIRE_OMITTED_CONFIG_KEYS,v as attributeConfigSchemas,r as collectionContentSourceSchema,o as colorIdSchema,n as contentViewDefinitionSchema,D as createFormAttributeValidator,t as draftContentViewDefinitionSchema,w as formatZodErrors,i as iconNameSchema,g as multiselectOptionWriteSchema,y as parseAttributeConfig,c as parseAttributeConfigForCreate,p as parseAttributeConfigForUpdate,x as propertyAttributeSchema,l as propertyAttributeWireSchema,u as propertySchemaSchema,_ as propertySchemaWireSchema,e as publishedViewContentDefinitionSchema,m as refuseForeignKeys,k as rejectUnknownAttributesOrThrow,f as selectOptionWriteSchema,d as statusGroupSchema,s as statusOptionWriteSchema,T as validateDraft,O as validateDraftOrThrow,A as validateObject,E as validateObjectOrThrow,S as withoutUnknownOptionKeys};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { l as CurrencyAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/currency.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { l as CurrencyAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/currency.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { v as LocationAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/location.d.ts
|
|
6
6
|
type LocationShape = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { v as LocationAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/location.d.ts
|
|
6
6
|
type LocationShape = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { E as PhoneAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/phone.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { E as PhoneAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/phone.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { F as SingleRelationAttribute, O as RelationAttribute, b as MultiRelationAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/relation.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { F as SingleRelationAttribute, O as RelationAttribute, b as MultiRelationAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/relation.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { j as RichtextAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/richtext.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { j as RichtextAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/richtext.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { I as StatusAttribute, P as SelectAttribute, x as MultiselectAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/select.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { I as StatusAttribute, P as SelectAttribute, x as MultiselectAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/select.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { B as UserAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/user.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { B as UserAttribute } from "../../attributes-DF899HOt.js";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-OvRk1isl.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/complex/user.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { r as ValidationMessages } from "../../index-
|
|
2
|
+
import { h as FormulaAttribute } from "../../attributes-BrWmES5w.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "../../index-DggAjGTr.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/computed/formula.d.ts
|
|
6
6
|
/**
|