@stndrds/schema 1.0.0-alpha.320 → 1.0.0-alpha.321

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.
@@ -0,0 +1,15 @@
1
+ 'use strict';var chunkJSKLP4GI_js=require('./chunk-JSKLP4GI.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),I=require('zod'),constants=require('@stndrds/constants');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var I__default=/*#__PURE__*/_interopDefault(I);/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var E=["skill","memory","drives","artifact","meeting"];function it(e){return E.includes(e)}chunkDPD6ZWL2_js.a(it,"isNativeObjectName");var A=["workspace","private"],pt=["all",...A];function lt(e){if(typeof e=="string"&&A.includes(e))return e;throw new chunkJSKLP4GI_js.h(`visibility must be one of: ${A.join(", ")} (received: ${String(e)})`,[])}chunkDPD6ZWL2_js.a(lt,"parseResourceVisibility");var Se=["id","createdAt","updatedAt","createdBy","lastUpdatedBy","visibility","ownedBy"],h=[...Se,"objectId","label","embeddingText","values","metadata","deletedAt","deletedBy","schemaVersion","owned_by"],dt=E;var ve=new Set(constants.ICONS),U=/^[a-zA-Z_][a-zA-Z0-9_]*$/,Ee=/^[a-z][a-z0-9-]*$/,m=63,W=128,Ae=I__default.default.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
3
+ Name must be in kebab-case (slug format):
4
+ \u2705 Valid: 'products', 'user-profiles', 'order-items'
5
+ \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function xt(e){try{Ae.parse(e);}catch(t){throw t instanceof I__default.default.ZodError?new chunkJSKLP4GI_js.b(t.issues[0].message,chunkJSKLP4GI_js.a.INVALID_OBJECT_NAME):t}}chunkDPD6ZWL2_js.a(xt,"validateObjectName");function St(e){if(!e||e.length===0)throw new chunkJSKLP4GI_js.h("View name cannot be empty",[{path:["name"],message:"View name cannot be empty"}]);if(e.length>m)throw new chunkJSKLP4GI_js.h("View name is too long",[{path:["name"],message:`View name is too long (max ${m} characters)`}]);if(!Ee.test(e))throw new chunkJSKLP4GI_js.h("Invalid view name format",[{path:["name"],message:"View name must be in kebab-case (e.g., 'detail', 'list-view')"}])}chunkDPD6ZWL2_js.a(St,"validateViewName");function wt(e,t,n){let o=new Set;for(let s of e){let a=t(s);if(o.has(a))throw n(a);o.add(a);}}chunkDPD6ZWL2_js.a(wt,"assertUniqueBy");var Z=I__default.default.string().min(1,"Attribute name cannot be empty").max(m,`Attribute name is too long (max ${m} characters)`).regex(U,{message:`Invalid attribute name format.
6
+ Name must be a valid variable identifier:
7
+ \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
8
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!h.includes(e),{message:`This is a reserved attribute name. Reserved names: ${h.join(", ")}`});function vt(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute name cannot be empty");if(e.length>m)throw new Error(`[AttributeBuilder] Attribute name is too long (max ${m} characters)`);if(!U.test(e))throw new Error(`[AttributeBuilder] Invalid attribute name format.
9
+ Name must be a valid variable identifier:
10
+ \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
11
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(h.includes(e))throw new Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.
12
+ Reserved names: ${h.join(", ")}`)}chunkDPD6ZWL2_js.a(vt,"validateAttributeName");function Et(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute label cannot be empty");if(e.length>W)throw new Error(`[AttributeBuilder] Attribute label is too long (max ${W} characters)`)}chunkDPD6ZWL2_js.a(Et,"validateLabel");function At(e,t){if(!ve.has(e))throw new Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.
13
+ Icon must be one of the predefined icons from @stndrds/constants.`)}chunkDPD6ZWL2_js.a(At,"validateIconName");function It(e,t){let n=new Set;for(let o of t){if(!o.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!o.label?.trim())throw new Error(`[AttributeBuilder] Option "${o.value}" in "${e}" has an empty or missing label.`);if(n.has(o.value))throw new Error(`[AttributeBuilder] Duplicate option value "${o.value}" in "${e}".`);n.add(o.value);}for(let o of t){if(o.inverse===void 0)continue;let s=t.find(a=>a.value===o.inverse);if(!s)throw new Error(`[AttributeBuilder] Option "${o.value}" in "${e}" has inverse "${o.inverse}" which does not match any option value.`);if(s.inverse!==o.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${o.value}" points to "${o.inverse}", but "${o.inverse}" points to "${s.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}chunkDPD6ZWL2_js.a(It,"validateOptions");var k=class k extends Error{constructor(t){super(t),this.name="ComputedFormulaParseError";}};chunkDPD6ZWL2_js.a(k,"ComputedFormulaParseError");var p=k;function Y(e){let t=new T(Ie(e)),n=t.parseExpression();return t.expectEnd(),n}chunkDPD6ZWL2_js.a(Y,"parseComputedFormula");function Ie(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o===" "||o===" "||o===`
14
+ `||o==="\r"){n+=1;continue}if(o==='"'||o==="'"){let a=Te(e,n,o);t.push({kind:"string",value:a.value,position:n}),n=a.nextIndex;continue}if(y(o)){let a=Re(e,n);t.push({kind:"number",value:a.value,position:n}),n=a.nextIndex;continue}if(Ce(o)){let a=Oe(e,n),u=a.value.toLowerCase();u==="true"?t.push({kind:"boolean",value:true,position:n}):u==="false"?t.push({kind:"boolean",value:false,position:n}):u==="null"?t.push({kind:"null",position:n}):t.push({kind:"identifier",value:a.value,position:n}),n=a.nextIndex;continue}let s=e.slice(n,n+2);if(s===">="||s==="<="||s==="=="||s==="!="){t.push({kind:"operator",value:s,position:n}),n+=2;continue}if(o===">"||o==="<"||o==="+"||o==="-"||o==="*"||o==="/"){t.push({kind:"operator",value:o,position:n}),n+=1;continue}if(o==="("||o===")"||o===","||o==="."){t.push({kind:"punctuation",value:o,position:n}),n+=1;continue}throw new p(`Unexpected character "${o}" at position ${n}`)}return t}chunkDPD6ZWL2_js.a(Ie,"tokenize");function Te(e,t,n='"'){let o="",s=t+1;for(;s<e.length;){let a=e[s];if(a===n)return {value:o,nextIndex:s+1};if(a==="\\"){let u=e[s+1];if(u===void 0)throw new p(`Unterminated string literal at position ${s}`);o+=ke(u,s),s+=2;continue}o+=a,s+=1;}throw new p(`Unterminated string literal at position ${t}`)}chunkDPD6ZWL2_js.a(Te,"scanString");function ke(e,t){switch(e){case '"':case "\\":return e;case "n":return `
15
+ `;case "r":return "\r";case "t":return " ";default:throw new p(`Unknown escape sequence "\\${e}" at position ${t}`)}}chunkDPD6ZWL2_js.a(ke,"decodeEscape");function Re(e,t){let n=t;for(;n<e.length&&y(e[n]);)n+=1;if(e[n]==="."){let a=n;if(n+=1,!y(e[n]))throw new p(`Invalid number literal at position ${a}`);for(;n<e.length&&y(e[n]);)n+=1;}let o=e.slice(t,n),s=Number(o);if(!Number.isFinite(s))throw new p(`Invalid number literal "${o}"`);return {value:s,nextIndex:n}}chunkDPD6ZWL2_js.a(Re,"scanNumber");function Oe(e,t){let n=t+1;for(;n<e.length&&Pe(e[n]);)n+=1;return {value:e.slice(t,n),nextIndex:n}}chunkDPD6ZWL2_js.a(Oe,"scanIdentifier");function y(e){return e!==void 0&&e>="0"&&e<="9"}chunkDPD6ZWL2_js.a(y,"isDigit");function Ce(e){return e!==void 0&&/[A-Za-z_]/.test(e)}chunkDPD6ZWL2_js.a(Ce,"isIdentifierStart");function Pe(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}chunkDPD6ZWL2_js.a(Pe,"isIdentifierPart");var R=class R{constructor(t){this.tokens=t;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let t=this.peek();if(t!==void 0)throw new p(`Unexpected token ${_e(t)} at position ${t.position}`)}parseBinaryExpression(t){let n=this.parsePrimary();for(;;){let o=this.peek();if(o?.kind!=="operator")return n;let s=Ne(o.value);if(s<t)return n;let a=o.value;this.consume();let u=this.parseBinaryExpression(s+1);n={kind:"binary",operator:a,left:n,right:u};}}parsePrimary(){let t=this.consume();if(t===void 0)throw new p("Unexpected end of expression");switch(t.kind){case "string":case "number":case "boolean":return {kind:"literal",value:t.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(t.value);case "punctuation":if(t.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(t.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new p(`Expected literal, path, call, or parenthesized expression at position ${t.position}`)}parseIdentifier(t){if(this.matchPunctuation("(")){let o=[];if(!this.matchPunctuation(")")){do o.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:t.toLowerCase(),args:o}}let n=[t];for(;this.matchPunctuation(".");){let o=this.consume();if(o?.kind!=="identifier"){let s=o?.position??this.previousPosition();throw new p(`Expected attribute name after path separator at position ${s}`)}n.push(o.value);}return {kind:"path",parts:n}}expectPunctuation(t){if(!this.matchPunctuation(t)){let o=this.peek()?.position??this.previousPosition();throw new p(`Expected "${t}" at position ${o}`)}}matchPunctuation(t){let n=this.peek();return n?.kind==="punctuation"&&n.value===t?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let t=this.tokens[this.position];return this.position+=1,t}previousPosition(){return this.tokens[this.position-1]?.position??0}};chunkDPD6ZWL2_js.a(R,"Parser");var T=R;function _e(e){switch(e.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(e.value)}"`;case "null":return '"null"';default:return e}}chunkDPD6ZWL2_js.a(_e,"describeToken");function Ne(e){switch(e){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return e}}chunkDPD6ZWL2_js.a(Ne,"getOperatorPrecedence");var x={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var Ve=Object.keys(constants.COLORS),Be=new Set(constants.ICONS),O=I.z.enum(Ve).describe("A color id from the palette"),C=I.z.string().superRefine((e,t)=>{Be.has(e)||t.addIssue({code:"custom",message:"Invalid icon name"});}).transform(e=>e);var c=I.z.object({placeholder:I.z.string().optional(),description:I.z.string().optional(),defaultValue:I.z.unknown().optional(),icon:I.z.string().optional(),order:I.z.number().int().optional(),hidden:I.z.boolean().optional(),archived:I.z.boolean().optional(),deprecated:I.z.boolean().optional(),metadata:I.z.record(I.z.string(),I.z.unknown()).optional()}),q=["placeholder","description","defaultValue","icon","order","hidden","archived","deprecated","metadata"];function J(e,t,n=[]){let o=new Set(n);return chunkDPD6ZWL2_js.a(function(a,u,f,g=[]){let b=e[a];if(!(b===void 0||u===void 0))for(let d of Object.keys(u))b.has(d)||o.has(d)||f.addIssue({code:"custom",path:[...g,d],message:`"${d}" is not a ${a} ${t}; keys of ${a}: ${[...b].join(", ")}`});},"refuse")}chunkDPD6ZWL2_js.a(J,"refuseForeignKeys");var P=I.z.object({value:I.z.string().min(1).describe("Stored value"),label:I.z.string().min(1).describe("Label people see"),description:I.z.string().describe("Extra context").optional(),inverse:I.z.string().describe("Paired option's value (symmetric)").optional(),archived:I.z.boolean().describe("Hides without deleting").optional()}),_=I.z.enum(["idle","in_progress","finished"]).describe("Workflow stage"),N=P.extend({color:O}).strict(),X=N,Q=P.extend({color:O,group:_}).strict(),ee=P.extend({color:I.z.string().optional().describe("A color id"),group:_.optional()}).strict(),j=I.z.array(ee).min(1).refine(e=>{let t=e.map(n=>n.value);return new Set(t).size===t.length},{message:"Duplicate option values are not allowed"});function M(e){return I.z.array(e).min(1).max(x.optionsPerAttribute).refine(t=>{let n=t.map(o=>o.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}chunkDPD6ZWL2_js.a(M,"writeOptionsArraySchema");var te=M(N),re=M(X),ne=M(Q),Fe=I.z.object({object:I.z.string().min(1).describe("Target object"),displayTemplate:I.z.string().optional().describe("Linked record label template"),filter:I.z.record(I.z.string(),I.z.unknown()).optional().describe("Restricts linkable records")}),$e=I.z.object({object:I.z.string().min(1).describe("Other side's object"),attribute:I.z.string().min(1).describe("Other side's attribute"),cardinality:I.z.enum(["one","many"]).optional().describe("Other side's cardinality"),label:I.z.string().min(1).optional().describe("Other side's label"),storageOwner:I.z.boolean().optional().describe("Owns the join storage")}),oe=I.z.object({objectName:I.z.string().min(1).describe("API name of the object whose options are mirrored"),attributeName:I.z.string().min(1).describe("API name of the select/status attribute to mirror options from"),attributeId:I.z.string().optional().describe("Id of the source attribute, resolved by the server")}),ie=c.extend({multiline:I.z.boolean().describe("Renders as a multi-line textarea").optional(),minLength:I.z.number().int().min(0).describe("Minimum character count").optional(),maxLength:I.z.number().int().min(1).describe("Maximum character count").optional(),pattern:I.z.string().describe("Regular expression the value must match").optional(),format:I.z.enum(["email","url","slug"]).describe("Validates and renders as this format").optional()}),ze=c,se=c.extend({renderAs:I.z.enum(["number","rating"]).describe("Plain number or a star rating").optional(),min:I.z.number().describe("Minimum allowed value").optional(),max:I.z.number().describe("Maximum allowed value").optional(),unit:I.z.enum(["integer","decimal","percentage"]).describe("How the value is stored and rendered").optional(),decimals:I.z.number().int().min(0).max(10).describe("Decimal places shown").optional()}),ae=c,ce=c.extend({dateFormat:I.z.enum(["short","long","full","relative"]).describe("How the date is rendered").optional(),minDate:I.z.string().describe("Earliest allowed date (ISO)").optional(),maxDate:I.z.string().describe("Latest allowed date (ISO)").optional(),includeTime:I.z.boolean().describe("Also captures a time of day").optional(),endDate:I.z.boolean().describe("Paired with another date attribute as a range's end").optional(),timeFormat:I.z.enum(["12h","24h"]).describe("Clock format when a time is included").optional()}),ue=c.extend({defaultCountryCode:I.z.string().length(3).describe("ISO country code preselected in the dialer").optional()}),pe=c.extend({defaultCurrency:I.z.string().length(3).describe("ISO currency code preselected for new values").optional(),allowedCurrencies:I.z.array(I.z.string().length(3)).describe("ISO currency codes a value may use; any currency when omitted").optional(),allowNegative:I.z.boolean().describe("Whether a negative amount is accepted").optional()}),V=c.extend({options:j.describe("The workflow statuses, in order")}),le=c.extend({granularity:I.z.enum(["full","address","city","state","country","coordinates"]).describe("How precise a location must be captured").optional(),defaultCountry:I.z.string().length(3).describe("ISO country code preselected for new values").optional(),allowedCountries:I.z.array(I.z.string().length(3)).describe("ISO country codes a value may use; any country when omitted").optional()}),B=c.extend({options:j.describe("Options"),renderAs:I.z.literal("badges").optional().describe("Renders the chosen option as a colored badge")}),F=c.extend({options:j.describe("Options"),renderAs:I.z.literal("badges").optional().describe("Renders the chosen options as colored badges")}),Le=c.extend({types:I.z.array(I.z.enum(["user","agent"])).min(1).optional().describe("Which kinds of actor can be picked; both when omitted"),multiple:I.z.boolean().optional().describe("Whether more than one actor can be picked")}),S={name:Z.describe("Property API name"),label:I.z.string().min(1).describe("Label people see"),required:I.z.boolean().describe("Required on every edge").optional()},De={id:I.z.string().optional(),objectId:I.z.string().optional(),system:I.z.boolean().optional(),unique:I.z.boolean().optional()},We=Object.fromEntries(q.map(e=>[e,true])),w=["text","number","checkbox","date","phone","currency","location"],de=[...w,"select","multiselect","status"],me={text:ie,number:se,checkbox:ae,date:ce,phone:ue,currency:pe,location:le,select:B,multiselect:F,status:V},Ue={...me,select:B.extend({options:te.describe("Options")}),multiselect:F.extend({options:re.describe("Options")}),status:V.extend({options:ne.describe("Statuses")})},$=chunkDPD6ZWL2_js.a(e=>Ue[e].omit(We).shape,"propertyWireConfigShapeFor"),Ze=chunkDPD6ZWL2_js.a(e=>I.z.object({...S,...De,type:I.z.literal(e).describe("Property type"),...me[e].shape}).strip(),"storedPropertyMember"),be=I.z.discriminatedUnion("type",de.map(Ze)),z=I.z.object({definitions:I.z.array(be).min(1).max(x.optionsPerAttribute).describe("Edge properties")}).strip().describe("Properties carried by the edge itself (role, share, since\u2026), never a third object"),Ye=Object.fromEntries(de.map(e=>[e,new Set(Object.keys($(e)))])),He=J(Ye,"property key",[...Object.keys(S),"type"]);function Ge(e,t){He(e.type,e,t);}chunkDPD6ZWL2_js.a(Ge,"refuseForeignPropertyKeys");var Ke=w.reduce((e,t)=>(Object.assign(e,$(t)),e),{}),G=chunkDPD6ZWL2_js.a(e=>I.z.object({...S,type:e.length===1?I.z.literal(e[0]).describe("Property type"):I.z.enum(e).describe("Property type"),...$(e[0])}).strict(),"optionPropertyWireMember"),he=I.z.discriminatedUnion("type",[G(["select","multiselect"]),G(["status"]),I.z.object({...S,type:I.z.enum(w).describe("Property type"),...Ke}).strict().superRefine(Ge)]),qe=I.z.object({definitions:I.z.array(he).min(1).max(x.optionsPerAttribute).describe("Edge properties")}).strict().describe("Properties carried by the edge itself (role, share, since\u2026), never a third object"),Je=c.extend({targets:I.z.array(Fe).min(1).describe("Target object(s)"),cardinality:I.z.enum(["one","many"]).describe("one or many"),maxItems:I.z.number().int().min(1).optional().describe("Max linked records"),bilateral:$e.optional().describe("Syncs the other side's attribute"),properties:z.optional()}),Xe=c.extend({expression:I.z.string().min(1).superRefine((e,t)=>{try{Y(e);}catch(n){t.addIssue({code:I.z.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}).describe("The formula expression, compiled against this object's attributes"),returnType:I.z.enum(["text","number","boolean","date","select","multiselect"]).describe("The formula's result type"),decimals:I.z.number().int().min(0).max(10).optional().describe("Decimal places shown for a number result"),allowRelations:I.z.boolean().optional().describe("Whether the expression may read across a relation"),optionsSource:oe.optional().describe("Mirrors an option set")}),Qe=c.extend({relationAttribute:I.z.string().min(1).optional().describe("API name of the relation this rollup aggregates through"),relationPath:I.z.string().optional().describe("Not supported yet \u2014 single-hop only"),targetAttribute:I.z.string().min(1).describe("API name of the attribute aggregated on the relation's target object"),function:I.z.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]).describe("The aggregation applied across the linked records"),decimals:I.z.number().int().min(0).max(10).optional().describe("Decimal places shown for a numeric result"),targetAttributeType:I.z.string().optional().describe("Server-set"),targetAttributeOptions:I.z.array(ee).optional().describe("Server-set"),targetCurrencyCode:I.z.string().length(3).optional().describe("Server-set"),optionsSource:oe.optional().describe("Mirrors an option set")}),et=c.extend({properties:z.optional(),accepts:I.z.array(I.z.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:I.z.number().int().min(1).optional().describe("Maximum file size in bytes")}),fe={text:ie,richtext:ze,number:se,checkbox:ae,date:ce,phone:ue,currency:pe,status:V,location:le,select:B,multiselect:F,user:Le,relation:Je,formula:Xe,rollup:Qe,document:et};function v(e){let t=fe[e];if(!t)throw new chunkJSKLP4GI_js.h(`Unsupported attribute type: ${e}`,[]);return t}chunkDPD6ZWL2_js.a(v,"getAttributeConfigSchema");function tt(e,t){return v(e).strip().parse(t)}chunkDPD6ZWL2_js.a(tt,"parseAttributeConfig");function ge(e){let t=v(e).extend({icon:C.optional()});switch(e){case "select":return t.extend({options:te.describe("Options")});case "multiselect":return t.extend({options:re.describe("Options")});case "status":return t.extend({options:ne.describe("Statuses")});default:return t}}chunkDPD6ZWL2_js.a(ge,"getAttributeConfigWriteSchema");function ye(e){return chunkJSKLP4GI_js.h.fromZodErrors(e.map(t=>({path:t.path.map(n=>typeof n=="symbol"?String(n):n),message:t.message})))}chunkDPD6ZWL2_js.a(ye,"validationErrorFromIssues");function xe(e,t){let n=ge(e).strip().safeParse(t);if(!n.success)throw ye(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(xe,"parseWriteSchema");function rt(e,t){return xe(e,t)}chunkDPD6ZWL2_js.a(rt,"parseAttributeConfigForCreate");function nt(e){if(!Object.prototype.hasOwnProperty.call(e,"icon"))return;let t=C.optional().safeParse(e.icon);if(!t.success)throw chunkJSKLP4GI_js.h.fromZodErrors(t.error.issues.map(n=>({path:["icon",...n.path.map(o=>typeof o=="symbol"?String(o):o)],message:n.message})))}chunkDPD6ZWL2_js.a(nt,"validatePatchedIcon");function K(e){return e==="select"||e==="multiselect"||e==="status"}chunkDPD6ZWL2_js.a(K,"isSelectLike");function ot(e,t){let n=Object.prototype.hasOwnProperty.call(t,"options"),o=Object.prototype.hasOwnProperty.call(t,"icon"),s={...e,...t};if(nt(t),n){let{icon:g,...b}=s,d=xe(e.type,o?s:b);return !o&&g!==void 0&&(d.icon=g),d}let a=e.options;K(e.type)&&(s.options=[{value:"__legacy__",label:"__legacy__"}]);let u=v(e.type).strip().safeParse(s);if(!u.success)throw ye(u.error.issues);let f=u.data;return K(e.type)&&(f.options=a),f}chunkDPD6ZWL2_js.a(ot,"parseAttributeConfigForUpdate");exports.A=X;exports.B=Q;exports.C=w;exports.D=be;exports.E=z;exports.F=he;exports.G=qe;exports.H=fe;exports.I=v;exports.J=tt;exports.K=ge;exports.L=rt;exports.M=ot;exports.a=E;exports.b=it;exports.c=A;exports.d=pt;exports.e=lt;exports.f=Se;exports.g=h;exports.h=dt;exports.i=Ae;exports.j=xt;exports.k=St;exports.l=wt;exports.m=Z;exports.n=vt;exports.o=Et;exports.p=At;exports.q=It;exports.r=x;exports.s=O;exports.t=C;exports.u=p;exports.v=Y;exports.w=q;exports.x=J;exports.y=_;exports.z=N;
@@ -0,0 +1,15 @@
1
+ import {h as h$1,b,a as a$1}from'./chunk-XRWRECDA.mjs';import {a}from'./chunk-KSPJP74K.mjs';import I,{z as z$1}from'zod';import {ICONS,COLORS}from'@stndrds/constants';/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var E=["skill","memory","drives","artifact","meeting"];function it(e){return E.includes(e)}a(it,"isNativeObjectName");var A=["workspace","private"],pt=["all",...A];function lt(e){if(typeof e=="string"&&A.includes(e))return e;throw new h$1(`visibility must be one of: ${A.join(", ")} (received: ${String(e)})`,[])}a(lt,"parseResourceVisibility");var Se=["id","createdAt","updatedAt","createdBy","lastUpdatedBy","visibility","ownedBy"],h=[...Se,"objectId","label","embeddingText","values","metadata","deletedAt","deletedBy","schemaVersion","owned_by"],dt=E;var ve=new Set(ICONS),U=/^[a-zA-Z_][a-zA-Z0-9_]*$/,Ee=/^[a-z][a-z0-9-]*$/,m=63,W=128,Ae=I.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
3
+ Name must be in kebab-case (slug format):
4
+ \u2705 Valid: 'products', 'user-profiles', 'order-items'
5
+ \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function xt(e){try{Ae.parse(e);}catch(t){throw t instanceof I.ZodError?new b(t.issues[0].message,a$1.INVALID_OBJECT_NAME):t}}a(xt,"validateObjectName");function St(e){if(!e||e.length===0)throw new h$1("View name cannot be empty",[{path:["name"],message:"View name cannot be empty"}]);if(e.length>m)throw new h$1("View name is too long",[{path:["name"],message:`View name is too long (max ${m} characters)`}]);if(!Ee.test(e))throw new h$1("Invalid view name format",[{path:["name"],message:"View name must be in kebab-case (e.g., 'detail', 'list-view')"}])}a(St,"validateViewName");function wt(e,t,n){let o=new Set;for(let s of e){let a=t(s);if(o.has(a))throw n(a);o.add(a);}}a(wt,"assertUniqueBy");var Z=I.string().min(1,"Attribute name cannot be empty").max(m,`Attribute name is too long (max ${m} characters)`).regex(U,{message:`Invalid attribute name format.
6
+ Name must be a valid variable identifier:
7
+ \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
8
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!h.includes(e),{message:`This is a reserved attribute name. Reserved names: ${h.join(", ")}`});function vt(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute name cannot be empty");if(e.length>m)throw new Error(`[AttributeBuilder] Attribute name is too long (max ${m} characters)`);if(!U.test(e))throw new Error(`[AttributeBuilder] Invalid attribute name format.
9
+ Name must be a valid variable identifier:
10
+ \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
11
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(h.includes(e))throw new Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.
12
+ Reserved names: ${h.join(", ")}`)}a(vt,"validateAttributeName");function Et(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute label cannot be empty");if(e.length>W)throw new Error(`[AttributeBuilder] Attribute label is too long (max ${W} characters)`)}a(Et,"validateLabel");function At(e,t){if(!ve.has(e))throw new Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.
13
+ Icon must be one of the predefined icons from @stndrds/constants.`)}a(At,"validateIconName");function It(e,t){let n=new Set;for(let o of t){if(!o.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!o.label?.trim())throw new Error(`[AttributeBuilder] Option "${o.value}" in "${e}" has an empty or missing label.`);if(n.has(o.value))throw new Error(`[AttributeBuilder] Duplicate option value "${o.value}" in "${e}".`);n.add(o.value);}for(let o of t){if(o.inverse===void 0)continue;let s=t.find(a=>a.value===o.inverse);if(!s)throw new Error(`[AttributeBuilder] Option "${o.value}" in "${e}" has inverse "${o.inverse}" which does not match any option value.`);if(s.inverse!==o.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${o.value}" points to "${o.inverse}", but "${o.inverse}" points to "${s.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}a(It,"validateOptions");var k=class k extends Error{constructor(t){super(t),this.name="ComputedFormulaParseError";}};a(k,"ComputedFormulaParseError");var p=k;function Y(e){let t=new T(Ie(e)),n=t.parseExpression();return t.expectEnd(),n}a(Y,"parseComputedFormula");function Ie(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o===" "||o===" "||o===`
14
+ `||o==="\r"){n+=1;continue}if(o==='"'||o==="'"){let a=Te(e,n,o);t.push({kind:"string",value:a.value,position:n}),n=a.nextIndex;continue}if(y(o)){let a=Re(e,n);t.push({kind:"number",value:a.value,position:n}),n=a.nextIndex;continue}if(Ce(o)){let a=Oe(e,n),u=a.value.toLowerCase();u==="true"?t.push({kind:"boolean",value:true,position:n}):u==="false"?t.push({kind:"boolean",value:false,position:n}):u==="null"?t.push({kind:"null",position:n}):t.push({kind:"identifier",value:a.value,position:n}),n=a.nextIndex;continue}let s=e.slice(n,n+2);if(s===">="||s==="<="||s==="=="||s==="!="){t.push({kind:"operator",value:s,position:n}),n+=2;continue}if(o===">"||o==="<"||o==="+"||o==="-"||o==="*"||o==="/"){t.push({kind:"operator",value:o,position:n}),n+=1;continue}if(o==="("||o===")"||o===","||o==="."){t.push({kind:"punctuation",value:o,position:n}),n+=1;continue}throw new p(`Unexpected character "${o}" at position ${n}`)}return t}a(Ie,"tokenize");function Te(e,t,n='"'){let o="",s=t+1;for(;s<e.length;){let a=e[s];if(a===n)return {value:o,nextIndex:s+1};if(a==="\\"){let u=e[s+1];if(u===void 0)throw new p(`Unterminated string literal at position ${s}`);o+=ke(u,s),s+=2;continue}o+=a,s+=1;}throw new p(`Unterminated string literal at position ${t}`)}a(Te,"scanString");function ke(e,t){switch(e){case '"':case "\\":return e;case "n":return `
15
+ `;case "r":return "\r";case "t":return " ";default:throw new p(`Unknown escape sequence "\\${e}" at position ${t}`)}}a(ke,"decodeEscape");function Re(e,t){let n=t;for(;n<e.length&&y(e[n]);)n+=1;if(e[n]==="."){let a=n;if(n+=1,!y(e[n]))throw new p(`Invalid number literal at position ${a}`);for(;n<e.length&&y(e[n]);)n+=1;}let o=e.slice(t,n),s=Number(o);if(!Number.isFinite(s))throw new p(`Invalid number literal "${o}"`);return {value:s,nextIndex:n}}a(Re,"scanNumber");function Oe(e,t){let n=t+1;for(;n<e.length&&Pe(e[n]);)n+=1;return {value:e.slice(t,n),nextIndex:n}}a(Oe,"scanIdentifier");function y(e){return e!==void 0&&e>="0"&&e<="9"}a(y,"isDigit");function Ce(e){return e!==void 0&&/[A-Za-z_]/.test(e)}a(Ce,"isIdentifierStart");function Pe(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}a(Pe,"isIdentifierPart");var R=class R{constructor(t){this.tokens=t;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let t=this.peek();if(t!==void 0)throw new p(`Unexpected token ${_e(t)} at position ${t.position}`)}parseBinaryExpression(t){let n=this.parsePrimary();for(;;){let o=this.peek();if(o?.kind!=="operator")return n;let s=Ne(o.value);if(s<t)return n;let a=o.value;this.consume();let u=this.parseBinaryExpression(s+1);n={kind:"binary",operator:a,left:n,right:u};}}parsePrimary(){let t=this.consume();if(t===void 0)throw new p("Unexpected end of expression");switch(t.kind){case "string":case "number":case "boolean":return {kind:"literal",value:t.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(t.value);case "punctuation":if(t.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(t.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new p(`Expected literal, path, call, or parenthesized expression at position ${t.position}`)}parseIdentifier(t){if(this.matchPunctuation("(")){let o=[];if(!this.matchPunctuation(")")){do o.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:t.toLowerCase(),args:o}}let n=[t];for(;this.matchPunctuation(".");){let o=this.consume();if(o?.kind!=="identifier"){let s=o?.position??this.previousPosition();throw new p(`Expected attribute name after path separator at position ${s}`)}n.push(o.value);}return {kind:"path",parts:n}}expectPunctuation(t){if(!this.matchPunctuation(t)){let o=this.peek()?.position??this.previousPosition();throw new p(`Expected "${t}" at position ${o}`)}}matchPunctuation(t){let n=this.peek();return n?.kind==="punctuation"&&n.value===t?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let t=this.tokens[this.position];return this.position+=1,t}previousPosition(){return this.tokens[this.position-1]?.position??0}};a(R,"Parser");var T=R;function _e(e){switch(e.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(e.value)}"`;case "null":return '"null"';default:return e}}a(_e,"describeToken");function Ne(e){switch(e){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return e}}a(Ne,"getOperatorPrecedence");var x={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var Ve=Object.keys(COLORS),Be=new Set(ICONS),O=z$1.enum(Ve).describe("A color id from the palette"),C=z$1.string().superRefine((e,t)=>{Be.has(e)||t.addIssue({code:"custom",message:"Invalid icon name"});}).transform(e=>e);var c=z$1.object({placeholder:z$1.string().optional(),description:z$1.string().optional(),defaultValue:z$1.unknown().optional(),icon:z$1.string().optional(),order:z$1.number().int().optional(),hidden:z$1.boolean().optional(),archived:z$1.boolean().optional(),deprecated:z$1.boolean().optional(),metadata:z$1.record(z$1.string(),z$1.unknown()).optional()}),q=["placeholder","description","defaultValue","icon","order","hidden","archived","deprecated","metadata"];function J(e,t,n=[]){let o=new Set(n);return a(function(a,u,f,g=[]){let b=e[a];if(!(b===void 0||u===void 0))for(let d of Object.keys(u))b.has(d)||o.has(d)||f.addIssue({code:"custom",path:[...g,d],message:`"${d}" is not a ${a} ${t}; keys of ${a}: ${[...b].join(", ")}`});},"refuse")}a(J,"refuseForeignKeys");var P=z$1.object({value:z$1.string().min(1).describe("Stored value"),label:z$1.string().min(1).describe("Label people see"),description:z$1.string().describe("Extra context").optional(),inverse:z$1.string().describe("Paired option's value (symmetric)").optional(),archived:z$1.boolean().describe("Hides without deleting").optional()}),_=z$1.enum(["idle","in_progress","finished"]).describe("Workflow stage"),N=P.extend({color:O}).strict(),X=N,Q=P.extend({color:O,group:_}).strict(),ee=P.extend({color:z$1.string().optional().describe("A color id"),group:_.optional()}).strict(),j=z$1.array(ee).min(1).refine(e=>{let t=e.map(n=>n.value);return new Set(t).size===t.length},{message:"Duplicate option values are not allowed"});function M(e){return z$1.array(e).min(1).max(x.optionsPerAttribute).refine(t=>{let n=t.map(o=>o.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}a(M,"writeOptionsArraySchema");var te=M(N),re=M(X),ne=M(Q),Fe=z$1.object({object:z$1.string().min(1).describe("Target object"),displayTemplate:z$1.string().optional().describe("Linked record label template"),filter:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Restricts linkable records")}),$e=z$1.object({object:z$1.string().min(1).describe("Other side's object"),attribute:z$1.string().min(1).describe("Other side's attribute"),cardinality:z$1.enum(["one","many"]).optional().describe("Other side's cardinality"),label:z$1.string().min(1).optional().describe("Other side's label"),storageOwner:z$1.boolean().optional().describe("Owns the join storage")}),oe=z$1.object({objectName:z$1.string().min(1).describe("API name of the object whose options are mirrored"),attributeName:z$1.string().min(1).describe("API name of the select/status attribute to mirror options from"),attributeId:z$1.string().optional().describe("Id of the source attribute, resolved by the server")}),ie=c.extend({multiline:z$1.boolean().describe("Renders as a multi-line textarea").optional(),minLength:z$1.number().int().min(0).describe("Minimum character count").optional(),maxLength:z$1.number().int().min(1).describe("Maximum character count").optional(),pattern:z$1.string().describe("Regular expression the value must match").optional(),format:z$1.enum(["email","url","slug"]).describe("Validates and renders as this format").optional()}),ze=c,se=c.extend({renderAs:z$1.enum(["number","rating"]).describe("Plain number or a star rating").optional(),min:z$1.number().describe("Minimum allowed value").optional(),max:z$1.number().describe("Maximum allowed value").optional(),unit:z$1.enum(["integer","decimal","percentage"]).describe("How the value is stored and rendered").optional(),decimals:z$1.number().int().min(0).max(10).describe("Decimal places shown").optional()}),ae=c,ce=c.extend({dateFormat:z$1.enum(["short","long","full","relative"]).describe("How the date is rendered").optional(),minDate:z$1.string().describe("Earliest allowed date (ISO)").optional(),maxDate:z$1.string().describe("Latest allowed date (ISO)").optional(),includeTime:z$1.boolean().describe("Also captures a time of day").optional(),endDate:z$1.boolean().describe("Paired with another date attribute as a range's end").optional(),timeFormat:z$1.enum(["12h","24h"]).describe("Clock format when a time is included").optional()}),ue=c.extend({defaultCountryCode:z$1.string().length(3).describe("ISO country code preselected in the dialer").optional()}),pe=c.extend({defaultCurrency:z$1.string().length(3).describe("ISO currency code preselected for new values").optional(),allowedCurrencies:z$1.array(z$1.string().length(3)).describe("ISO currency codes a value may use; any currency when omitted").optional(),allowNegative:z$1.boolean().describe("Whether a negative amount is accepted").optional()}),V=c.extend({options:j.describe("The workflow statuses, in order")}),le=c.extend({granularity:z$1.enum(["full","address","city","state","country","coordinates"]).describe("How precise a location must be captured").optional(),defaultCountry:z$1.string().length(3).describe("ISO country code preselected for new values").optional(),allowedCountries:z$1.array(z$1.string().length(3)).describe("ISO country codes a value may use; any country when omitted").optional()}),B=c.extend({options:j.describe("Options"),renderAs:z$1.literal("badges").optional().describe("Renders the chosen option as a colored badge")}),F=c.extend({options:j.describe("Options"),renderAs:z$1.literal("badges").optional().describe("Renders the chosen options as colored badges")}),Le=c.extend({types:z$1.array(z$1.enum(["user","agent"])).min(1).optional().describe("Which kinds of actor can be picked; both when omitted"),multiple:z$1.boolean().optional().describe("Whether more than one actor can be picked")}),S={name:Z.describe("Property API name"),label:z$1.string().min(1).describe("Label people see"),required:z$1.boolean().describe("Required on every edge").optional()},De={id:z$1.string().optional(),objectId:z$1.string().optional(),system:z$1.boolean().optional(),unique:z$1.boolean().optional()},We=Object.fromEntries(q.map(e=>[e,true])),w=["text","number","checkbox","date","phone","currency","location"],de=[...w,"select","multiselect","status"],me={text:ie,number:se,checkbox:ae,date:ce,phone:ue,currency:pe,location:le,select:B,multiselect:F,status:V},Ue={...me,select:B.extend({options:te.describe("Options")}),multiselect:F.extend({options:re.describe("Options")}),status:V.extend({options:ne.describe("Statuses")})},$=a(e=>Ue[e].omit(We).shape,"propertyWireConfigShapeFor"),Ze=a(e=>z$1.object({...S,...De,type:z$1.literal(e).describe("Property type"),...me[e].shape}).strip(),"storedPropertyMember"),be=z$1.discriminatedUnion("type",de.map(Ze)),z=z$1.object({definitions:z$1.array(be).min(1).max(x.optionsPerAttribute).describe("Edge properties")}).strip().describe("Properties carried by the edge itself (role, share, since\u2026), never a third object"),Ye=Object.fromEntries(de.map(e=>[e,new Set(Object.keys($(e)))])),He=J(Ye,"property key",[...Object.keys(S),"type"]);function Ge(e,t){He(e.type,e,t);}a(Ge,"refuseForeignPropertyKeys");var Ke=w.reduce((e,t)=>(Object.assign(e,$(t)),e),{}),G=a(e=>z$1.object({...S,type:e.length===1?z$1.literal(e[0]).describe("Property type"):z$1.enum(e).describe("Property type"),...$(e[0])}).strict(),"optionPropertyWireMember"),he=z$1.discriminatedUnion("type",[G(["select","multiselect"]),G(["status"]),z$1.object({...S,type:z$1.enum(w).describe("Property type"),...Ke}).strict().superRefine(Ge)]),qe=z$1.object({definitions:z$1.array(he).min(1).max(x.optionsPerAttribute).describe("Edge properties")}).strict().describe("Properties carried by the edge itself (role, share, since\u2026), never a third object"),Je=c.extend({targets:z$1.array(Fe).min(1).describe("Target object(s)"),cardinality:z$1.enum(["one","many"]).describe("one or many"),maxItems:z$1.number().int().min(1).optional().describe("Max linked records"),bilateral:$e.optional().describe("Syncs the other side's attribute"),properties:z.optional()}),Xe=c.extend({expression:z$1.string().min(1).superRefine((e,t)=>{try{Y(e);}catch(n){t.addIssue({code:z$1.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}).describe("The formula expression, compiled against this object's attributes"),returnType:z$1.enum(["text","number","boolean","date","select","multiselect"]).describe("The formula's result type"),decimals:z$1.number().int().min(0).max(10).optional().describe("Decimal places shown for a number result"),allowRelations:z$1.boolean().optional().describe("Whether the expression may read across a relation"),optionsSource:oe.optional().describe("Mirrors an option set")}),Qe=c.extend({relationAttribute:z$1.string().min(1).optional().describe("API name of the relation this rollup aggregates through"),relationPath:z$1.string().optional().describe("Not supported yet \u2014 single-hop only"),targetAttribute:z$1.string().min(1).describe("API name of the attribute aggregated on the relation's target object"),function:z$1.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]).describe("The aggregation applied across the linked records"),decimals:z$1.number().int().min(0).max(10).optional().describe("Decimal places shown for a numeric result"),targetAttributeType:z$1.string().optional().describe("Server-set"),targetAttributeOptions:z$1.array(ee).optional().describe("Server-set"),targetCurrencyCode:z$1.string().length(3).optional().describe("Server-set"),optionsSource:oe.optional().describe("Mirrors an option set")}),et=c.extend({properties:z.optional(),accepts:z$1.array(z$1.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:z$1.number().int().min(1).optional().describe("Maximum file size in bytes")}),fe={text:ie,richtext:ze,number:se,checkbox:ae,date:ce,phone:ue,currency:pe,status:V,location:le,select:B,multiselect:F,user:Le,relation:Je,formula:Xe,rollup:Qe,document:et};function v(e){let t=fe[e];if(!t)throw new h$1(`Unsupported attribute type: ${e}`,[]);return t}a(v,"getAttributeConfigSchema");function tt(e,t){return v(e).strip().parse(t)}a(tt,"parseAttributeConfig");function ge(e){let t=v(e).extend({icon:C.optional()});switch(e){case "select":return t.extend({options:te.describe("Options")});case "multiselect":return t.extend({options:re.describe("Options")});case "status":return t.extend({options:ne.describe("Statuses")});default:return t}}a(ge,"getAttributeConfigWriteSchema");function ye(e){return h$1.fromZodErrors(e.map(t=>({path:t.path.map(n=>typeof n=="symbol"?String(n):n),message:t.message})))}a(ye,"validationErrorFromIssues");function xe(e,t){let n=ge(e).strip().safeParse(t);if(!n.success)throw ye(n.error.issues);return n.data}a(xe,"parseWriteSchema");function rt(e,t){return xe(e,t)}a(rt,"parseAttributeConfigForCreate");function nt(e){if(!Object.prototype.hasOwnProperty.call(e,"icon"))return;let t=C.optional().safeParse(e.icon);if(!t.success)throw h$1.fromZodErrors(t.error.issues.map(n=>({path:["icon",...n.path.map(o=>typeof o=="symbol"?String(o):o)],message:n.message})))}a(nt,"validatePatchedIcon");function K(e){return e==="select"||e==="multiselect"||e==="status"}a(K,"isSelectLike");function ot(e,t){let n=Object.prototype.hasOwnProperty.call(t,"options"),o=Object.prototype.hasOwnProperty.call(t,"icon"),s={...e,...t};if(nt(t),n){let{icon:g,...b}=s,d=xe(e.type,o?s:b);return !o&&g!==void 0&&(d.icon=g),d}let a=e.options;K(e.type)&&(s.options=[{value:"__legacy__",label:"__legacy__"}]);let u=v(e.type).strip().safeParse(s);if(!u.success)throw ye(u.error.issues);let f=u.data;return K(e.type)&&(f.options=a),f}a(ot,"parseAttributeConfigForUpdate");export{X as A,Q as B,w as C,be as D,z as E,he as F,qe as G,fe as H,v as I,tt as J,ge as K,rt as L,ot as M,E as a,it as b,A as c,pt as d,lt as e,Se as f,h as g,dt as h,Ae as i,xt as j,St as k,wt as l,Z as m,vt as n,Et as o,At as p,It as q,x as r,O as s,C as t,p as u,Y as v,q as w,J as x,_ as y,N as z};
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk2M4YXNYZ_js=require('./chunk-2M4YXNYZ.js'),chunkJSKLP4GI_js=require('./chunk-JSKLP4GI.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),zod=require('zod');/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var Se={createdAt:"createdAt",updatedAt:"updatedAt",createdBy:"createdBy",lastUpdatedBy:"lastUpdatedBy",attachments:"attachments"};function Nt(e){return Se[e]}chunkDPD6ZWL2_js.a(Nt,"getSystemAttributeI18nKey");var Re={createdAt:{id:"system:createdAt",name:"createdAt",label:"Created time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was created"},updatedAt:{id:"system:updatedAt",name:"updatedAt",label:"Last edited time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was last modified"},createdBy:{id:"system:createdBy",name:"createdBy",label:"Created by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who created this record"},lastUpdatedBy:{id:"system:lastUpdatedBy",name:"lastUpdatedBy",label:"Last edited by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who last modified this record"},attachments:{id:"system:attachments",name:"attachments",label:"Attachments",type:"document",required:false,system:true,hidden:true,icon:"paperclip",description:"Free-form document attachments"}};function qt(){return Object.values(Re)}chunkDPD6ZWL2_js.a(qt,"getSystemAttributeList");function $(e){return e.id?.startsWith("system:")??false}chunkDPD6ZWL2_js.a($,"isManagedSystemAttribute");var K=["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty"],Y=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_empty","is_not_empty"],Oe=["is"],Te=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","is_empty","is_not_empty"],z=["is","is_not","any_of","none_of","is_empty","is_not_empty"],Ee=["any_of","none_of","is_empty","is_not_empty"],W=["is","is_not","any_of","none_of","is_empty","is_not_empty"],xe=["is_empty","is_not_empty"],Fe=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","contains","not_contains","is_empty","is_not_empty"],x=["city","postalCode","country"];function F(e){return x.includes(e)}chunkDPD6ZWL2_js.a(F,"isLocationFilterProperty");function Yt(e){return K.includes(e)}chunkDPD6ZWL2_js.a(Yt,"isLocationPartOperator");var y={text:K,richtext:[],number:Y,checkbox:Oe,date:Te,phone:["is","is_not","contains","not_contains","starts_with","is_empty","is_not_empty"],currency:Y,status:z,select:z,multiselect:Ee,location:[],user:W,relation:W,formula:Fe,document:xe},we=new Set(["formula","rollup"]),Ce=new Set(["user","relation","document"]),Pe=new Set(["text","richtext","number","select","multiselect","status","date","phone","currency","location","user","relation","document"]),ve=new Set(["text","number","date","phone","currency","select","multiselect"]),De=new Set(["text","phone","status","select","multiselect"]),Ie=new Set(["text","number","checkbox","date","phone","currency","status","select"]);function g(e){let r=!!(e.hidden||e.archived),o=!e.archived,i=we.has(e.type),a=e.type==="document",s=Ce.has(e.type),l=ke(e),c=r?[]:Ve(e),u=c.length>0&&!r,h=!r&&De.has(e.type),_=!r&&Ie.has(e.type),A=!r&&Ye(e.type),T=!r&&e.type==="status",_e=$(e),M=i||a||_e,E=!(r||M),ge=Ne(e.type)?"forbidden":"allowed",Ae=qe(e.type),L=Me(e),N=ve.has(e.type),q=!!(e.deprecated&&!r),B=$e(e);return {lifecycle:{active:o,deprecated:!!e.deprecated,visibleInArchitect:true,visibleInRuntime:!r,warningWhenDeprecated:q},storage:{mode:i?"computed":s?"edge":"value",cardinality:l,edgeBacked:s,preservesExistingValues:!!e.archived,qualifiedProperties:Le(e.type),polymorphic:je(e),maxItems:L},authoring:{editable:E,readOnly:M,directEdit:E&&B==="inline",required:ge,defaultValue:Ae,placeholder:N,maxItems:L},presentation:{formField:!r&&Ue(e.type),tableCell:!r&&G(e.type),defaultColumn:!r&&Be(e.type),compactDisplay:!r,popoverEditor:!r&&B==="popover",placeholder:N,warningWhenDeprecated:q},query:{filterable:u,searchable:h,sortable:_,groupable:A,kanbanGroupable:T,operators:c},agent:{readable:!r,writable:E&&!a,compactReadable:!r,contentReadable:!r&&ze(e.type),requiresDedicatedTool:a},exchange:{importable:!r,exportable:!r,schemaExportable:true,metadataExportable:false}}}chunkDPD6ZWL2_js.a(g,"getAttributeCapabilities");function J(e){return g(e).query.operators}chunkDPD6ZWL2_js.a(J,"getAttributeFilterOperators");function zt(e){return g(e).query.filterable}chunkDPD6ZWL2_js.a(zt,"isAttributeFilterable");function Wt(e){return g(e).query.searchable}chunkDPD6ZWL2_js.a(Wt,"isAttributeSearchable");function Kt(e){return g(e).query.sortable}chunkDPD6ZWL2_js.a(Kt,"isAttributeSortable");function Jt(e){return g(e).query.groupable}chunkDPD6ZWL2_js.a(Jt,"isAttributeGroupable");function Gt(e){return g(e).query.kanbanGroupable}chunkDPD6ZWL2_js.a(Gt,"isAttributeKanbanGroupable");function w(e){if(e.type!=="rollup")return e.type;let r=e;if(r.function==="earliest"||r.function==="latest")return "date";if(r.function==="original"){let o=r.targetAttributeType;if(o&&Q(o))return o}return "number"}chunkDPD6ZWL2_js.a(w,"resolveEffectiveFilterType");function C(e){let r=w(e);return Q(r)?y[r]:y.number}chunkDPD6ZWL2_js.a(C,"getRollupFilterOperators");function Ve(e){return e.type==="rollup"?C(e):y[e.type]??[]}chunkDPD6ZWL2_js.a(Ve,"getRawFilterOperators");function ke(e){return e.type==="multiselect"||e.type==="document"||e.type==="user"&&e.multiple===true||e.type==="relation"&&e.cardinality==="many"?"many":"one"}chunkDPD6ZWL2_js.a(ke,"getAttributeCardinality");function je(e){if(e.type!=="relation")return "none";let o=e.targets??[];return o.length===1&&o[0]?.object==="*"?"internal":o.length>1?"code-only":"none"}chunkDPD6ZWL2_js.a(je,"getPolymorphicCapability");function Me(e){return e.type==="multiselect"?true:e.type==="relation"?e.cardinality==="many":false}chunkDPD6ZWL2_js.a(Me,"supportsMaxItems");function Le(e){return e==="relation"||e==="document"}chunkDPD6ZWL2_js.a(Le,"supportsQualifiedProperties");function Ne(e){return e==="checkbox"||e==="formula"||e==="rollup"}chunkDPD6ZWL2_js.a(Ne,"isRequiredForbidden");function qe(e){return e==="checkbox"?"automatic":e==="formula"||e==="rollup"?"forbidden":Pe.has(e)?"static":"forbidden"}chunkDPD6ZWL2_js.a(qe,"getDefaultValueCapability");function Be(e){return G(e)}chunkDPD6ZWL2_js.a(Be,"isDefaultColumnType");function G(e){return e!=="richtext"&&e!=="document"}chunkDPD6ZWL2_js.a(G,"isTableCellType");function Ue(e){return e!=="richtext"}chunkDPD6ZWL2_js.a(Ue,"isFormFieldType");function $e(e){switch(e.type){case "checkbox":return "inline";case "number":return e.renderAs==="rating"?"inline":"default";case "select":case "multiselect":return e.renderAs==="badges"?"inline":"popover";case "status":case "relation":case "user":case "date":return "popover";default:return "default"}}chunkDPD6ZWL2_js.a($e,"resolveEditMode");function Ye(e){return e==="status"||e==="currency"}chunkDPD6ZWL2_js.a(Ye,"isGroupableType");function ze(e){return e==="richtext"||e==="document"}chunkDPD6ZWL2_js.a(ze,"isContentReadableType");function Q(e){return Object.prototype.hasOwnProperty.call(y,e)}chunkDPD6ZWL2_js.a(Q,"hasFilterOperatorEntry");var f=y,We=["is_empty","is_not_empty"];function H(e){return We.includes(e)}chunkDPD6ZWL2_js.a(H,"isNoValueOperator");function Zt(e){return C(e)}chunkDPD6ZWL2_js.a(Zt,"getRollupFilterOperators");function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"dynamic"in e}chunkDPD6ZWL2_js.a(R,"isDynamicValue");function rr(){return {dynamic:"actor",ref:"current"}}chunkDPD6ZWL2_js.a(rr,"currentActor");function or(){return {dynamic:"date",anchor:"today"}}chunkDPD6ZWL2_js.a(or,"today");function nr(){return {dynamic:"date",anchor:"now"}}chunkDPD6ZWL2_js.a(nr,"now");function X(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let r=Number(e);return Number.isFinite(r)?r:null}return null}chunkDPD6ZWL2_js.a(X,"toAmount");function Z(e){return e!==null&&typeof e=="object"?"value"in e?X(e.value):null:X(e)}chunkDPD6ZWL2_js.a(Z,"extractCurrencyFilterValue");function sr(e){return e==null?null:typeof e=="object"&&"value"in e?e.value??null:e}chunkDPD6ZWL2_js.a(sr,"extractFilterValue");var Ke=new Set(["is_not","not_contains","none_of","is_empty"]),Je={is_not:"is",not_contains:"contains",none_of:"any_of",is_empty:"is_not_empty"};function ur(e){return Ke.has(e)?"none":"any"}chunkDPD6ZWL2_js.a(ur,"getOperatorPolarity");function pr(e){return Je[e]??e}chunkDPD6ZWL2_js.a(pr,"normalizeForEdgeRpc");var ee={is:"any_of",is_not:"none_of"};function dr(e){return ee[e]??e}chunkDPD6ZWL2_js.a(dr,"toMultiValueOperator");var Ge=new Set(Object.values(ee).filter(e=>e!==void 0));function te(e){return Ge.has(e)}chunkDPD6ZWL2_js.a(te,"isSetMembershipOperator");function re(e,r){let o=e.value;if(H(e.operator)||o==null||R(o))return;if(te(e.operator)){Array.isArray(o)||(e.value=[o]);return}if(r!=="currency")return;let i=Z(o);if(i!==null){e.value=i;return}if(!Qe(o))return;let a=`Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(o)}`;throw new chunkJSKLP4GI_js.h(a,[{path:["value"],message:a}])}chunkDPD6ZWL2_js.a(re,"canonicalizeFilterValue");function Qe(e){return typeof e!="object"?true:"value"in e?e.value!=null:false}chunkDPD6ZWL2_js.a(Qe,"hasCurrencyAmount");var He={eq:"is",equals:"is",equal:"is","==":"is","=":"is",neq:"is_not",notEqual:"is_not",isNot:"is_not","!=":"is_not","<>":"is_not",lt:"less_than","<":"less_than",gt:"greater_than",">":"greater_than",lte:"less_or_equal","<=":"less_or_equal",gte:"greater_or_equal",">=":"greater_or_equal",in:"any_of",isAnyOf:"any_of",anyOf:"any_of",oneOf:"any_of",notIn:"none_of",not_in:"none_of",isNoneOf:"none_of",noneOf:"none_of",notOneOf:"none_of",startsWith:"starts_with",beginsWith:"starts_with",endsWith:"ends_with",doesNotContain:"not_contains",notContain:"not_contains",isEmpty:"is_empty",isNotEmpty:"is_not_empty"};function P(e){return He[e]??e}chunkDPD6ZWL2_js.a(P,"normalizeOperator");function Rr(e){let r=P(e.operator);return r===e.operator?e:{...e,operator:r}}chunkDPD6ZWL2_js.a(Rr,"normalizeFilterRule");var Xe=new Set(["days","weeks","months","years"]),Ze=new Set(["past","future"]);function v(e){if(typeof e!="object"||e===null)return false;let r=e;return typeof r.amount=="number"&&Number.isFinite(r.amount)&&r.amount>0&&typeof r.unit=="string"&&Xe.has(r.unit)&&typeof r.direction=="string"&&Ze.has(r.direction)}chunkDPD6ZWL2_js.a(v,"isRelativeDateValue");function ne(e){return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}chunkDPD6ZWL2_js.a(ne,"utcDayStart");function oe(e,r,o){if(o==="days")return e+r*864e5;if(o==="weeks")return e+r*7*864e5;let i=new Date(e),a=i.getUTCFullYear()+(o==="years"?r:0),s=i.getUTCMonth()+(o==="months"?r:0),l=new Date(Date.UTC(a,s+1,0)).getUTCDate();return Date.UTC(a,s,Math.min(i.getUTCDate(),l))}chunkDPD6ZWL2_js.a(oe,"shiftUtcDay");function Er(e,r=new Date){if(!v(e))return null;let o=ne(r),i=Math.trunc(e.amount),a=e.direction==="past"?{startMs:oe(o,-i,e.unit),endMs:o+864e5}:{startMs:o,endMs:oe(o,i,e.unit)+864e5};return Number.isFinite(a.startMs)&&Number.isFinite(a.endMs)?a:null}chunkDPD6ZWL2_js.a(Er,"resolveIsWithinBounds");function xr(e){if(!Number.isFinite(e))return null;let r=ne(new Date(e));return Number.isFinite(r)?{startMs:r,endMs:r+864e5}:null}chunkDPD6ZWL2_js.a(xr,"resolveUtcDayBounds");function Fr(e){return new Date(e).toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(Fr,"toUtcDayString");var et=new Set(["relation","document","user"]),D=["is","is_not","any_of","none_of","is_empty","is_not_empty"],tt={id:D,objectId:D,tenantId:D,label:f.text,createdAt:f.date,updatedAt:f.date,deletedAt:f.date,createdBy:f.user,lastUpdatedBy:f.user},rt={id:"text",objectId:"text",objectName:"text",tenantId:"text",label:"text",createdAt:"date",updatedAt:"date",deletedAt:"date",deletedBy:"user",createdBy:"user",lastUpdatedBy:"user",visibility:"select",ownedBy:"user"},k={before:'"less_than"',after:'"greater_than"',on_or_before:'"less_or_equal"',on_or_after:'"greater_or_equal"',is_checked:'"is" with value true',is_not_checked:'"is" with value false',day_month_eq:'"on_day_month"'},ot=new Set(Object.entries(y).filter(([,e])=>e.includes("any_of")&&!e.includes("contains")).map(([e])=>e)),nt={contains:"any_of",not_contains:"none_of"};function I(e,r){let o=k[e];if(o){let s=`Unknown filter operator "${e}" \u2014 use ${o}`;throw new chunkJSKLP4GI_js.h(s,[{path:["operator"],message:s}])}let i=P(e),a=nt[i];if(a&&ot.has(r)){let s=`Operator "${i}" is not valid for type "${r}" \u2014 use "${a}"`;throw new chunkJSKLP4GI_js.h(s,[{path:["operator"],message:s}])}return i}chunkDPD6ZWL2_js.a(I,"resolveCanonicalOperator");function ie(e,r,o){let i=I(e,r),a=f[r];if(!a?.includes(i)){let s=a?.length?a.join(", "):"(no operators registered for this type)",l=`Operator "${e}" is not valid for ${o} type "${r}". Valid operators: ${s}.`;throw new chunkJSKLP4GI_js.h(l,[{path:["operator"],message:l}])}return i}chunkDPD6ZWL2_js.a(ie,"assertOperatorForType");function it(e){if(e.operator==="is_within"&&!v(e.value)){let r='Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }';throw new chunkJSKLP4GI_js.h(r,[{path:["value"],message:r}])}}chunkDPD6ZWL2_js.a(it,"assertRelativeDateValue");function O(e,r,o){e.operator=r,re(e,o),it(e);}chunkDPD6ZWL2_js.a(O,"applyCanonicalForm");function ae(e,r){if(!R(e.value))return;let o=e.value;if(o.dynamic==="actor"&&r!=="user"){let i=`actor token (@me) is only valid on user attributes, not "${r}"`;throw new chunkJSKLP4GI_js.h(i,[{path:["value"],message:i}])}if(o.dynamic==="date"&&r!=="date"){let i=`date token (@today/@now) is only valid on date attributes, not "${r}"`;throw new chunkJSKLP4GI_js.h(i,[{path:["value"],message:i}])}}chunkDPD6ZWL2_js.a(ae,"assertDynamicValueForAttribute");var V=x.map(e=>`"${e}"`).join(", ");function at(e){return e==="location"?` A location is filtered on one of its parts: set "property" to one of ${V} and use a text operator (e.g. contains).`:""}chunkDPD6ZWL2_js.a(at,"locationPartsHint");function Mr(e,r){try{return st({...e},r),[]}catch(o){if(!(o instanceof chunkJSKLP4GI_js.h))throw o;return o.errors.map(i=>({...i,path:[...i.path]}))}}chunkDPD6ZWL2_js.a(Mr,"collectQualifiedRuleIssues");function st(e,r){let o=r.attributes.find(c=>c.name===e.attribute),i=tt[e.attribute];if(!(o||i)){let[c,...u]=e.attribute.split("."),_=(u.length>0?r.attributes.find(T=>T.name===c):void 0)?.type==="location"?` Dotted paths are not supported \u2014 set "attribute" to "${c}" and "property" to ${F(u[0]??"")?`"${u[0]}"`:`one of ${V}`}.`:e.attribute.includes(".")?' Dotted paths are not supported \u2014 filter on the attribute name alone, or use the full-text "query" parameter to match text inside a value.':"",A=`Unknown attribute: ${e.attribute}${_}`;throw new chunkJSKLP4GI_js.h(A,[{path:["attribute"],message:A}])}if(e.quantifier!==void 0&&!e.property){let c='quantifier is only valid on qualified edge rules (set "property")';throw new chunkJSKLP4GI_js.h(c,[{path:["quantifier"],message:c}])}if(!o){if(e.property)throw new chunkJSKLP4GI_js.h(`Cannot qualify system attribute "${e.attribute}"`,[{path:["property"],message:`"${e.attribute}" is a system column, not a reference`}]);let c=rt[e.attribute]??"text",u=I(e.operator,c);if(!i.includes(u)){let h=`Operator "${e.operator}" is not valid for system attribute "${e.attribute}". Valid operators: ${i.join(", ")}.`;throw new chunkJSKLP4GI_js.h(h,[{path:["operator"],message:h}])}O(e,u,c);return}if(!e.property){ae(e,o.type);let c=J(o),u=I(e.operator,o.type);if(!c.includes(u)){let h=c.length?c.join(", "):"(not filterable)",_=`Operator "${e.operator}" is not valid for attribute "${o.name}". Valid operators: ${h}.${at(o.type)}`;throw new chunkJSKLP4GI_js.h(_,[{path:["operator"],message:_}])}O(e,u,w(o));return}if(o.type==="location"){if(e.quantifier!==void 0){let u="quantifier is not valid on a location part \u2014 a location is one value, not a set of edges";throw new chunkJSKLP4GI_js.h(u,[{path:["quantifier"],message:u}])}if(!F(e.property)){let u=`Property "${e.property}" is not a part of location "${e.attribute}". Valid parts: ${V}.`;throw new chunkJSKLP4GI_js.h(u,[{path:["property"],message:u}])}ae(e,"text");let c=ie(e.operator,"text","property");O(e,c,"text");return}if(!et.has(o.type))throw new chunkJSKLP4GI_js.h(`Cannot qualify ${o.type} attribute "${e.attribute}"`,[{path:["property"],message:`Attribute "${e.attribute}" is not a reference type`}]);let a=o.properties;if(!a)throw new chunkJSKLP4GI_js.h(`Attribute "${e.attribute}" has no qualifyWith schema`,[{path:["property"],message:`"${e.attribute}" has no qualifyWith`}]);let s=a.definitions.find(c=>c.name===e.property);if(!s)throw new chunkJSKLP4GI_js.h(`Property "${e.property}" not defined on "${e.attribute}".qualifyWith()`,[{path:["property"],message:`Unknown property: ${e.property}`}]);let l=ie(e.operator,s.type,"property");O(e,l,s.type);}chunkDPD6ZWL2_js.a(st,"validateQualifiedRule");var se=64,le=1e4;function ce(e){let r=Object.getPrototypeOf(e);return r===Object.prototype||r===null}chunkDPD6ZWL2_js.a(ce,"isPlainJsonObject");function m(e,r,o=[]){e.addIssue({code:"custom",message:r,path:o});}chunkDPD6ZWL2_js.a(m,"addJsonIssue");function ct(e,r,o,i){for(let a of Reflect.ownKeys(e))if(a!=="length"){if(a==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",[...r.path,a]);continue}(typeof a=="symbol"||!/^(0|[1-9]\d*)$/.test(a))&&m(i,"Arrays cannot contain non-index JSON properties",[...r.path,a]);}for(let a=e.length-1;a>=0;a--){let s=Object.getOwnPropertyDescriptor(e,String(a)),l=[...r.path,a];if(!(s&&"value"in s)){m(i,"Sparse arrays are not valid JSON values",l);continue}o.push({kind:"enter",value:s.value,path:l,depth:r.depth+1});}}chunkDPD6ZWL2_js.a(ct,"pushJsonArrayChildren");function ut(e,r,o,i){let a=Reflect.ownKeys(e);for(let s=a.length-1;s>=0;s--){let l=a[s],c=[...r.path,l];if(l==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",c);continue}if(typeof l=="symbol"){m(i,"Symbol keys are not valid JSON keys",c);continue}let u=Object.getOwnPropertyDescriptor(e,l);if(!(u?.enumerable&&"value"in u)){m(i,"Custom props must contain enumerable data properties only",c);continue}o.push({kind:"enter",value:u.value,path:c,depth:r.depth+1});}}chunkDPD6ZWL2_js.a(ut,"pushJsonObjectChildren");function pt(e,r){if(e===null||typeof e!="object"){m(r,"Expected a plain JSON object");return}try{if(Array.isArray(e)||!ce(e)){m(r,"Expected a plain JSON object");return}}catch{m(r,"Custom props contain an object that cannot be safely inspected");return}let o=new WeakSet,i=[{kind:"enter",value:e,path:[],depth:0}],a=0;for(;i.length>0;){let s=i.pop();if(!s)break;if(s.kind==="exit"){o.delete(s.value);continue}if(a++,a>le){m(r,`Custom props cannot exceed ${le.toLocaleString("en-US")} total JSON nodes`,s.path);return}if(s.depth>se){m(r,`Custom props cannot exceed depth ${se}`,s.path);continue}let l=s.value;if(!(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"&&Number.isFinite(l))){if(typeof l!="object"){m(r,"Expected a JSON value",s.path);continue}if(o.has(l)){m(r,"Custom props cannot contain circular references",s.path);continue}try{if(Array.isArray(l)){o.add(l),i.push({kind:"exit",value:l}),ct(l,s,i,r);continue}if(!ce(l)){m(r,"Expected an array or plain JSON object",s.path);continue}o.add(l),i.push({kind:"exit",value:l}),ut(l,s,i,r);}catch{m(r,"Custom props contain an object that cannot be safely inspected",s.path);}}}}chunkDPD6ZWL2_js.a(pt,"validateJsonProps");var ue=zod.z.unknown().superRefine(pt).transform(e=>e);var Gr=zod.z.array(zod.z.string()).max(chunk2M4YXNYZ_js.r.columnsPerTab),dt=zod.z.array(zod.z.string().min(1)).max(chunk2M4YXNYZ_js.r.columnsPerTab).refine(e=>new Set(e).size===e.length,{message:"Displayed attribute names must be unique"}),mt=zod.z.object({attribute:zod.z.string().describe("Attribute to sort by"),direction:zod.z.enum(["asc","desc"]).describe("asc or desc")}).strict(),bt=zod.z.array(mt).max(chunk2M4YXNYZ_js.r.sortsPerTab),yt=zod.z.object({amount:zod.z.number().describe("Count"),unit:zod.z.enum(["days","weeks","months","years"]).describe("Unit"),direction:zod.z.enum(["past","future"]).describe("Past or future")}).strict(),ft=zod.z.object({value:zod.z.number().nullable().describe("Amount"),code:zod.z.array(zod.z.string()).optional().describe("Currency codes")}).strict(),ht=zod.z.object({phoneNumber:zod.z.string().nullable().describe("Number"),countryCode:zod.z.string().optional().describe("ISO country code")}).strict(),_t=zod.z.discriminatedUnion("dynamic",[zod.z.object({dynamic:zod.z.literal("actor").describe("Resolved at filter time"),ref:zod.z.literal("current").describe("The current actor")}).strict(),zod.z.object({dynamic:zod.z.literal("date").describe("Resolved at filter time"),anchor:zod.z.enum(["today","now"]).describe("Anchor")}).strict()]),gt=zod.z.object({month:zod.z.number().describe("1-12"),day:zod.z.number().describe("Day")}).strict(),At=zod.z.union([zod.z.string(),zod.z.number(),zod.z.boolean(),zod.z.array(zod.z.string()),yt,ft,ht,gt,_t,zod.z.null()]),St=zod.z.enum(["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","any_of","none_of"],{error:chunkDPD6ZWL2_js.a(e=>{let r=e.input,o=typeof r=="string"?k[r]:void 0;return o?`Unknown filter operator "${r}" \u2014 use ${o}`:void 0},"error")}),Rt=zod.z.object({attribute:zod.z.string().describe("Attribute to filter on"),property:zod.z.string().optional().describe("Qualified edge property"),quantifier:zod.z.enum(["any","none"]).optional().describe("For a multi-value attribute"),operator:St.describe("Comparison"),value:At.describe("Comparison value, by attribute type")}).strict(),Ot=zod.z.array(Rt).max(chunk2M4YXNYZ_js.r.filterRulesPerTab),Tt=zod.z.object({combinator:zod.z.enum(["and","or"]).describe("Match every rule or any rule"),rules:Ot.describe("The rules")}).strict(),Et={span:zod.z.union([zod.z.literal(1),zod.z.literal(2),zod.z.literal(3),zod.z.literal(4),zod.z.literal(5),zod.z.literal(6),zod.z.literal(7),zod.z.literal(8),zod.z.literal(9),zod.z.literal(10),zod.z.literal(11),zod.z.literal(12)]).optional().describe("Columns of 12 this field occupies"),label:zod.z.string().optional().describe("Overrides the attribute's label"),readOnly:zod.z.boolean().optional().describe("Shows the value, not editable")},xt=zod.z.object({attribute:zod.z.string().describe("Attribute API name shown by this field"),...Et}).strict(),Ft=zod.z.object({name:zod.z.string().describe("Group API name, unique in the form"),label:zod.z.string().describe("Label people see"),description:zod.z.string().optional().describe("Extra context under the label"),collapsible:zod.z.boolean().optional().describe("Whether the group can be collapsed"),collapsed:zod.z.boolean().optional().describe("Whether the group starts collapsed"),fields:zod.z.array(xt).max(chunk2M4YXNYZ_js.r.fieldsPerGroup).describe("Fields in this group, in order")}).strict();function pe(e,r){e.groups.reduce((s,l)=>s+l.fields.length,0)>chunk2M4YXNYZ_js.r.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:chunk2M4YXNYZ_js.r.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${chunk2M4YXNYZ_js.r.fieldsPerFormTab} fields`,path:["groups"]});let i=new Set,a=new Set;e.groups.forEach((s,l)=>{i.has(s.name)&&r.addIssue({code:"custom",message:`Duplicate group name "${s.name}"`,path:["groups",l,"name"]}),i.add(s.name),s.fields.forEach((c,u)=>{a.has(c.attribute)&&r.addIssue({code:"custom",message:`Duplicate field attribute "${c.attribute}"`,path:["groups",l,"fields",u,"attribute"]}),a.add(c.attribute);});});}chunkDPD6ZWL2_js.a(pe,"refineFormContent");var b={name:zod.z.string().describe("Content API name, unique in the view"),label:zod.z.string().optional().describe("Label people see"),icon:chunk2M4YXNYZ_js.t.optional().describe("Icon name"),placement:zod.z.enum(["main","aside"]).describe("main: any tabs. aside: at most one, a form")},de=zod.z.object({object:zod.z.string().optional().describe("Every record of this object"),relation:zod.z.string().optional().describe("Records linked through this relation")}).strict().superRefine((e,r)=>{e.object===void 0&&e.relation===void 0&&r.addIssue({code:"custom",message:"Collection source must define an object, a relation, or both"});}).transform(e=>e.relation===void 0?{object:e.object}:e.object===void 0?{relation:e.relation}:{object:e.object,relation:e.relation}),wt={...b,type:zod.z.literal("collection"),source:de.describe("object: every record; relation: records linked to this record; both: records of object whose relation points at this record"),visibility:zod.z.enum(chunk2M4YXNYZ_js.d).optional().describe("all: no scope; workspace: every member; private: viewer's own"),columns:zod.z.array(zod.z.union([zod.z.string(),zod.z.object({relationProperty:zod.z.string().refine(e=>e.trim().length>0).describe("Qualified edge property shown as a column")}).strict()])).max(chunk2M4YXNYZ_js.r.columnsPerTab).optional().describe("Table columns, in order"),descriptionAttribute:zod.z.string().optional().describe("Secondary line under each row's title (list layout)"),displayAttributes:dt.optional().describe("Attributes shown on each card"),filters:Tt.optional().describe("Restricts which records show"),sorts:bt.optional().describe("Sort order"),actions:zod.z.enum(["create","update","delete","attach","detach"]).array().optional().describe("Offered actions; absent = every action, [] = none"),openMode:zod.z.enum(["page","peek"]).optional().describe("page or peek (the record panel)"),createMode:zod.z.enum(["page","peek","inline"]).optional().describe("page, peek, or inline (creates without opening)")},Ct=zod.z.object({...wt,layout:zod.z.enum(["table","list","kanban"]).describe("table columns, list cards, kanban board grouped by a select/status attribute"),columnSizing:zod.z.record(zod.z.string(),zod.z.number()).optional().describe("Column widths in pixels, by attribute name"),groupByAttribute:zod.z.string().optional().describe("Kanban only: the select or status attribute that names the columns"),kanbanColumnOrder:zod.z.array(zod.z.string()).optional().describe("Kanban: column order by option value"),kanbanColumnVisibility:zod.z.record(zod.z.string(),zod.z.boolean()).optional().describe("Kanban: which columns are shown"),kanbanPinnedColumns:zod.z.array(zod.z.string()).optional().describe("Kanban: columns pinned first")}).strict().superRefine((e,r)=>{let o=["groupByAttribute","kanbanColumnOrder","kanbanColumnVisibility","kanbanPinnedColumns"];if(e.layout==="kanban"){e.groupByAttribute===void 0&&r.addIssue({code:"custom",path:["groupByAttribute"],message:"A kanban layout requires groupByAttribute"});return}for(let i of o)e[i]!==void 0&&r.addIssue({code:"custom",path:[i],message:"Only a kanban layout groups by an attribute"});}),j={...b,type:zod.z.literal("form"),groups:zod.z.array(Ft).max(chunk2M4YXNYZ_js.r.groupsPerFormTab).describe("Field groups, in order"),formColumns:zod.z.union([zod.z.literal(1),zod.z.literal(2),zod.z.literal(3)]).optional().describe("Grid columns, 1-3"),density:zod.z.enum(["compact","comfortable","spacious"]).optional().describe("Vertical spacing between fields")},Pt=zod.z.object(j).strict().superRefine(pe),vt=zod.z.object({...j,groups:j.groups.min(1,"A published form content requires at least one group")}).strict().superRefine(pe),me=[Ct,zod.z.object({...b,type:zod.z.literal("custom"),extension:zod.z.string().describe("Name of a registered extension"),parameters:zod.z.lazy(()=>ue).optional().describe("Extension parameters")}).strict(),zod.z.object({...b,type:zod.z.literal("activity")}).strict(),zod.z.object({...b,type:zod.z.literal("richtext"),attribute:zod.z.string().describe("Richtext attribute edited in place"),titleAttribute:zod.z.string().optional().describe("Text attribute shown as the title")}).strict(),zod.z.object({...b,type:zod.z.literal("documents"),allowUpload:zod.z.boolean().optional().describe("Lets people add files here"),allowRemove:zod.z.boolean().optional().describe("Lets people remove files here"),hideAttachments:zod.z.boolean().optional().describe("Hides files attached elsewhere (e.g. emails)"),relations:zod.z.array(zod.z.string()).optional().describe("Document relations shown; the record's own files if absent")}).strict(),zod.z.object({...b,type:zod.z.literal("forms"),objectName:zod.z.string().optional().describe("Limits to this object's published forms")}).strict(),zod.z.object({...b,type:zod.z.literal("emails"),emailAttributes:zod.z.array(zod.z.string()).max(chunk2M4YXNYZ_js.r.emailAttributesPerTab).describe("Addresses")}).strict(),zod.z.object({...b,type:zod.z.literal("meetings"),emailAttributes:zod.z.array(zod.z.string()).max(chunk2M4YXNYZ_js.r.emailAttributesPerTab).describe("Addresses")}).strict()],Dt=zod.z.discriminatedUnion("type",[Pt,...me]),be=zod.z.discriminatedUnion("type",[vt,...me]),ye={object:zod.z.string(),name:zod.z.string(),label:zod.z.string(),description:zod.z.string().optional(),icon:chunk2M4YXNYZ_js.t.optional(),context:zod.z.enum(["collection","record"]),default:zod.z.boolean().optional()},It=zod.z.object({...ye,contents:zod.z.array(Dt).max(chunk2M4YXNYZ_js.r.tabsPerView)}).strict(),Vt=zod.z.object({...ye,contents:zod.z.array(be).max(chunk2M4YXNYZ_js.r.tabsPerView)}).strict();function fe(e,r){let o=new Set;e.contents.forEach((i,a)=>{o.has(i.name)&&r.addIssue({code:"custom",message:`Duplicate content name "${i.name}"`,path:["contents",a,"name"]}),o.add(i.name);});}chunkDPD6ZWL2_js.a(fe,"addDuplicateContentNameIssues");function he(e,r){let o=e.contents.map((i,a)=>({content:i,index:a})).filter(({content:i})=>i.placement==="aside");o.length>1&&r.addIssue({code:"custom",path:["contents",o[1].index,"placement"],message:"Aside holds one content for now; put the others in main"});for(let{content:i,index:a}of o)i.type!=="form"&&r.addIssue({code:"custom",path:["contents",a,"type"],message:`Only a form content can sit in aside for now; put ${i.type} in main`});}chunkDPD6ZWL2_js.a(he,"addAsideIssues");function kt({asideRule:e="enforce"}={}){return It.superRefine((r,o)=>{fe(r,o),e==="enforce"&&he(r,o);})}chunkDPD6ZWL2_js.a(kt,"draftContentViewDefinitionSchemaFor");function jt({asideRule:e="enforce"}={}){return Vt.superRefine((r,o)=>{fe(r,o),r.contents.some(i=>i.placement==="main")||o.addIssue({code:"custom",message:"A published view requires at least one main content",path:["contents"]}),e==="enforce"&&he(r,o);})}chunkDPD6ZWL2_js.a(jt,"contentViewDefinitionSchemaFor");var Mt=kt(),Lt=jt();exports.A=sr;exports.B=ur;exports.C=pr;exports.D=dr;exports.E=te;exports.F=re;exports.G=He;exports.H=P;exports.I=Rr;exports.J=v;exports.K=Er;exports.L=xr;exports.M=Fr;exports.N=rt;exports.O=k;exports.P=Mr;exports.Q=st;exports.R=Gr;exports.S=dt;exports.T=bt;exports.U=Tt;exports.V=de;exports.W=be;exports.X=kt;exports.Y=jt;exports.Z=Mt;exports._=Lt;exports.a=Se;exports.b=Nt;exports.c=Re;exports.d=qt;exports.e=$;exports.f=x;exports.g=F;exports.h=Yt;exports.i=y;exports.j=g;exports.k=J;exports.l=zt;exports.m=Wt;exports.n=Kt;exports.o=Jt;exports.p=Gt;exports.q=w;exports.r=f;exports.s=We;exports.t=H;exports.u=Zt;exports.v=R;exports.w=rr;exports.x=or;exports.y=nr;exports.z=Z;
@@ -0,0 +1,2 @@
1
+ import {r,t,d}from'./chunk-EZCWO4XV.mjs';import {h}from'./chunk-XRWRECDA.mjs';import {a}from'./chunk-KSPJP74K.mjs';import {z as z$1}from'zod';/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var Se={createdAt:"createdAt",updatedAt:"updatedAt",createdBy:"createdBy",lastUpdatedBy:"lastUpdatedBy",attachments:"attachments"};function Nt(e){return Se[e]}a(Nt,"getSystemAttributeI18nKey");var Re={createdAt:{id:"system:createdAt",name:"createdAt",label:"Created time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was created"},updatedAt:{id:"system:updatedAt",name:"updatedAt",label:"Last edited time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was last modified"},createdBy:{id:"system:createdBy",name:"createdBy",label:"Created by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who created this record"},lastUpdatedBy:{id:"system:lastUpdatedBy",name:"lastUpdatedBy",label:"Last edited by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who last modified this record"},attachments:{id:"system:attachments",name:"attachments",label:"Attachments",type:"document",required:false,system:true,hidden:true,icon:"paperclip",description:"Free-form document attachments"}};function qt(){return Object.values(Re)}a(qt,"getSystemAttributeList");function $(e){return e.id?.startsWith("system:")??false}a($,"isManagedSystemAttribute");var K=["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty"],Y=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_empty","is_not_empty"],Oe=["is"],Te=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","is_empty","is_not_empty"],z=["is","is_not","any_of","none_of","is_empty","is_not_empty"],Ee=["any_of","none_of","is_empty","is_not_empty"],W=["is","is_not","any_of","none_of","is_empty","is_not_empty"],xe=["is_empty","is_not_empty"],Fe=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","contains","not_contains","is_empty","is_not_empty"],x=["city","postalCode","country"];function F(e){return x.includes(e)}a(F,"isLocationFilterProperty");function Yt(e){return K.includes(e)}a(Yt,"isLocationPartOperator");var y={text:K,richtext:[],number:Y,checkbox:Oe,date:Te,phone:["is","is_not","contains","not_contains","starts_with","is_empty","is_not_empty"],currency:Y,status:z,select:z,multiselect:Ee,location:[],user:W,relation:W,formula:Fe,document:xe},we=new Set(["formula","rollup"]),Ce=new Set(["user","relation","document"]),Pe=new Set(["text","richtext","number","select","multiselect","status","date","phone","currency","location","user","relation","document"]),ve=new Set(["text","number","date","phone","currency","select","multiselect"]),De=new Set(["text","phone","status","select","multiselect"]),Ie=new Set(["text","number","checkbox","date","phone","currency","status","select"]);function g(e){let r=!!(e.hidden||e.archived),o=!e.archived,i=we.has(e.type),a=e.type==="document",s=Ce.has(e.type),l=ke(e),c=r?[]:Ve(e),u=c.length>0&&!r,h=!r&&De.has(e.type),_=!r&&Ie.has(e.type),A=!r&&Ye(e.type),T=!r&&e.type==="status",_e=$(e),M=i||a||_e,E=!(r||M),ge=Ne(e.type)?"forbidden":"allowed",Ae=qe(e.type),L=Me(e),N=ve.has(e.type),q=!!(e.deprecated&&!r),B=$e(e);return {lifecycle:{active:o,deprecated:!!e.deprecated,visibleInArchitect:true,visibleInRuntime:!r,warningWhenDeprecated:q},storage:{mode:i?"computed":s?"edge":"value",cardinality:l,edgeBacked:s,preservesExistingValues:!!e.archived,qualifiedProperties:Le(e.type),polymorphic:je(e),maxItems:L},authoring:{editable:E,readOnly:M,directEdit:E&&B==="inline",required:ge,defaultValue:Ae,placeholder:N,maxItems:L},presentation:{formField:!r&&Ue(e.type),tableCell:!r&&G(e.type),defaultColumn:!r&&Be(e.type),compactDisplay:!r,popoverEditor:!r&&B==="popover",placeholder:N,warningWhenDeprecated:q},query:{filterable:u,searchable:h,sortable:_,groupable:A,kanbanGroupable:T,operators:c},agent:{readable:!r,writable:E&&!a,compactReadable:!r,contentReadable:!r&&ze(e.type),requiresDedicatedTool:a},exchange:{importable:!r,exportable:!r,schemaExportable:true,metadataExportable:false}}}a(g,"getAttributeCapabilities");function J(e){return g(e).query.operators}a(J,"getAttributeFilterOperators");function zt(e){return g(e).query.filterable}a(zt,"isAttributeFilterable");function Wt(e){return g(e).query.searchable}a(Wt,"isAttributeSearchable");function Kt(e){return g(e).query.sortable}a(Kt,"isAttributeSortable");function Jt(e){return g(e).query.groupable}a(Jt,"isAttributeGroupable");function Gt(e){return g(e).query.kanbanGroupable}a(Gt,"isAttributeKanbanGroupable");function w(e){if(e.type!=="rollup")return e.type;let r=e;if(r.function==="earliest"||r.function==="latest")return "date";if(r.function==="original"){let o=r.targetAttributeType;if(o&&Q(o))return o}return "number"}a(w,"resolveEffectiveFilterType");function C(e){let r=w(e);return Q(r)?y[r]:y.number}a(C,"getRollupFilterOperators");function Ve(e){return e.type==="rollup"?C(e):y[e.type]??[]}a(Ve,"getRawFilterOperators");function ke(e){return e.type==="multiselect"||e.type==="document"||e.type==="user"&&e.multiple===true||e.type==="relation"&&e.cardinality==="many"?"many":"one"}a(ke,"getAttributeCardinality");function je(e){if(e.type!=="relation")return "none";let o=e.targets??[];return o.length===1&&o[0]?.object==="*"?"internal":o.length>1?"code-only":"none"}a(je,"getPolymorphicCapability");function Me(e){return e.type==="multiselect"?true:e.type==="relation"?e.cardinality==="many":false}a(Me,"supportsMaxItems");function Le(e){return e==="relation"||e==="document"}a(Le,"supportsQualifiedProperties");function Ne(e){return e==="checkbox"||e==="formula"||e==="rollup"}a(Ne,"isRequiredForbidden");function qe(e){return e==="checkbox"?"automatic":e==="formula"||e==="rollup"?"forbidden":Pe.has(e)?"static":"forbidden"}a(qe,"getDefaultValueCapability");function Be(e){return G(e)}a(Be,"isDefaultColumnType");function G(e){return e!=="richtext"&&e!=="document"}a(G,"isTableCellType");function Ue(e){return e!=="richtext"}a(Ue,"isFormFieldType");function $e(e){switch(e.type){case "checkbox":return "inline";case "number":return e.renderAs==="rating"?"inline":"default";case "select":case "multiselect":return e.renderAs==="badges"?"inline":"popover";case "status":case "relation":case "user":case "date":return "popover";default:return "default"}}a($e,"resolveEditMode");function Ye(e){return e==="status"||e==="currency"}a(Ye,"isGroupableType");function ze(e){return e==="richtext"||e==="document"}a(ze,"isContentReadableType");function Q(e){return Object.prototype.hasOwnProperty.call(y,e)}a(Q,"hasFilterOperatorEntry");var f=y,We=["is_empty","is_not_empty"];function H(e){return We.includes(e)}a(H,"isNoValueOperator");function Zt(e){return C(e)}a(Zt,"getRollupFilterOperators");function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"dynamic"in e}a(R,"isDynamicValue");function rr(){return {dynamic:"actor",ref:"current"}}a(rr,"currentActor");function or(){return {dynamic:"date",anchor:"today"}}a(or,"today");function nr(){return {dynamic:"date",anchor:"now"}}a(nr,"now");function X(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let r=Number(e);return Number.isFinite(r)?r:null}return null}a(X,"toAmount");function Z(e){return e!==null&&typeof e=="object"?"value"in e?X(e.value):null:X(e)}a(Z,"extractCurrencyFilterValue");function sr(e){return e==null?null:typeof e=="object"&&"value"in e?e.value??null:e}a(sr,"extractFilterValue");var Ke=new Set(["is_not","not_contains","none_of","is_empty"]),Je={is_not:"is",not_contains:"contains",none_of:"any_of",is_empty:"is_not_empty"};function ur(e){return Ke.has(e)?"none":"any"}a(ur,"getOperatorPolarity");function pr(e){return Je[e]??e}a(pr,"normalizeForEdgeRpc");var ee={is:"any_of",is_not:"none_of"};function dr(e){return ee[e]??e}a(dr,"toMultiValueOperator");var Ge=new Set(Object.values(ee).filter(e=>e!==void 0));function te(e){return Ge.has(e)}a(te,"isSetMembershipOperator");function re(e,r){let o=e.value;if(H(e.operator)||o==null||R(o))return;if(te(e.operator)){Array.isArray(o)||(e.value=[o]);return}if(r!=="currency")return;let i=Z(o);if(i!==null){e.value=i;return}if(!Qe(o))return;let a=`Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(o)}`;throw new h(a,[{path:["value"],message:a}])}a(re,"canonicalizeFilterValue");function Qe(e){return typeof e!="object"?true:"value"in e?e.value!=null:false}a(Qe,"hasCurrencyAmount");var He={eq:"is",equals:"is",equal:"is","==":"is","=":"is",neq:"is_not",notEqual:"is_not",isNot:"is_not","!=":"is_not","<>":"is_not",lt:"less_than","<":"less_than",gt:"greater_than",">":"greater_than",lte:"less_or_equal","<=":"less_or_equal",gte:"greater_or_equal",">=":"greater_or_equal",in:"any_of",isAnyOf:"any_of",anyOf:"any_of",oneOf:"any_of",notIn:"none_of",not_in:"none_of",isNoneOf:"none_of",noneOf:"none_of",notOneOf:"none_of",startsWith:"starts_with",beginsWith:"starts_with",endsWith:"ends_with",doesNotContain:"not_contains",notContain:"not_contains",isEmpty:"is_empty",isNotEmpty:"is_not_empty"};function P(e){return He[e]??e}a(P,"normalizeOperator");function Rr(e){let r=P(e.operator);return r===e.operator?e:{...e,operator:r}}a(Rr,"normalizeFilterRule");var Xe=new Set(["days","weeks","months","years"]),Ze=new Set(["past","future"]);function v(e){if(typeof e!="object"||e===null)return false;let r=e;return typeof r.amount=="number"&&Number.isFinite(r.amount)&&r.amount>0&&typeof r.unit=="string"&&Xe.has(r.unit)&&typeof r.direction=="string"&&Ze.has(r.direction)}a(v,"isRelativeDateValue");function ne(e){return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}a(ne,"utcDayStart");function oe(e,r,o){if(o==="days")return e+r*864e5;if(o==="weeks")return e+r*7*864e5;let i=new Date(e),a=i.getUTCFullYear()+(o==="years"?r:0),s=i.getUTCMonth()+(o==="months"?r:0),l=new Date(Date.UTC(a,s+1,0)).getUTCDate();return Date.UTC(a,s,Math.min(i.getUTCDate(),l))}a(oe,"shiftUtcDay");function Er(e,r=new Date){if(!v(e))return null;let o=ne(r),i=Math.trunc(e.amount),a=e.direction==="past"?{startMs:oe(o,-i,e.unit),endMs:o+864e5}:{startMs:o,endMs:oe(o,i,e.unit)+864e5};return Number.isFinite(a.startMs)&&Number.isFinite(a.endMs)?a:null}a(Er,"resolveIsWithinBounds");function xr(e){if(!Number.isFinite(e))return null;let r=ne(new Date(e));return Number.isFinite(r)?{startMs:r,endMs:r+864e5}:null}a(xr,"resolveUtcDayBounds");function Fr(e){return new Date(e).toISOString().slice(0,10)}a(Fr,"toUtcDayString");var et=new Set(["relation","document","user"]),D=["is","is_not","any_of","none_of","is_empty","is_not_empty"],tt={id:D,objectId:D,tenantId:D,label:f.text,createdAt:f.date,updatedAt:f.date,deletedAt:f.date,createdBy:f.user,lastUpdatedBy:f.user},rt={id:"text",objectId:"text",objectName:"text",tenantId:"text",label:"text",createdAt:"date",updatedAt:"date",deletedAt:"date",deletedBy:"user",createdBy:"user",lastUpdatedBy:"user",visibility:"select",ownedBy:"user"},k={before:'"less_than"',after:'"greater_than"',on_or_before:'"less_or_equal"',on_or_after:'"greater_or_equal"',is_checked:'"is" with value true',is_not_checked:'"is" with value false',day_month_eq:'"on_day_month"'},ot=new Set(Object.entries(y).filter(([,e])=>e.includes("any_of")&&!e.includes("contains")).map(([e])=>e)),nt={contains:"any_of",not_contains:"none_of"};function I(e,r){let o=k[e];if(o){let s=`Unknown filter operator "${e}" \u2014 use ${o}`;throw new h(s,[{path:["operator"],message:s}])}let i=P(e),a=nt[i];if(a&&ot.has(r)){let s=`Operator "${i}" is not valid for type "${r}" \u2014 use "${a}"`;throw new h(s,[{path:["operator"],message:s}])}return i}a(I,"resolveCanonicalOperator");function ie(e,r,o){let i=I(e,r),a=f[r];if(!a?.includes(i)){let s=a?.length?a.join(", "):"(no operators registered for this type)",l=`Operator "${e}" is not valid for ${o} type "${r}". Valid operators: ${s}.`;throw new h(l,[{path:["operator"],message:l}])}return i}a(ie,"assertOperatorForType");function it(e){if(e.operator==="is_within"&&!v(e.value)){let r='Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }';throw new h(r,[{path:["value"],message:r}])}}a(it,"assertRelativeDateValue");function O(e,r,o){e.operator=r,re(e,o),it(e);}a(O,"applyCanonicalForm");function ae(e,r){if(!R(e.value))return;let o=e.value;if(o.dynamic==="actor"&&r!=="user"){let i=`actor token (@me) is only valid on user attributes, not "${r}"`;throw new h(i,[{path:["value"],message:i}])}if(o.dynamic==="date"&&r!=="date"){let i=`date token (@today/@now) is only valid on date attributes, not "${r}"`;throw new h(i,[{path:["value"],message:i}])}}a(ae,"assertDynamicValueForAttribute");var V=x.map(e=>`"${e}"`).join(", ");function at(e){return e==="location"?` A location is filtered on one of its parts: set "property" to one of ${V} and use a text operator (e.g. contains).`:""}a(at,"locationPartsHint");function Mr(e,r){try{return st({...e},r),[]}catch(o){if(!(o instanceof h))throw o;return o.errors.map(i=>({...i,path:[...i.path]}))}}a(Mr,"collectQualifiedRuleIssues");function st(e,r){let o=r.attributes.find(c=>c.name===e.attribute),i=tt[e.attribute];if(!(o||i)){let[c,...u]=e.attribute.split("."),_=(u.length>0?r.attributes.find(T=>T.name===c):void 0)?.type==="location"?` Dotted paths are not supported \u2014 set "attribute" to "${c}" and "property" to ${F(u[0]??"")?`"${u[0]}"`:`one of ${V}`}.`:e.attribute.includes(".")?' Dotted paths are not supported \u2014 filter on the attribute name alone, or use the full-text "query" parameter to match text inside a value.':"",A=`Unknown attribute: ${e.attribute}${_}`;throw new h(A,[{path:["attribute"],message:A}])}if(e.quantifier!==void 0&&!e.property){let c='quantifier is only valid on qualified edge rules (set "property")';throw new h(c,[{path:["quantifier"],message:c}])}if(!o){if(e.property)throw new h(`Cannot qualify system attribute "${e.attribute}"`,[{path:["property"],message:`"${e.attribute}" is a system column, not a reference`}]);let c=rt[e.attribute]??"text",u=I(e.operator,c);if(!i.includes(u)){let h$1=`Operator "${e.operator}" is not valid for system attribute "${e.attribute}". Valid operators: ${i.join(", ")}.`;throw new h(h$1,[{path:["operator"],message:h$1}])}O(e,u,c);return}if(!e.property){ae(e,o.type);let c=J(o),u=I(e.operator,o.type);if(!c.includes(u)){let h$1=c.length?c.join(", "):"(not filterable)",_=`Operator "${e.operator}" is not valid for attribute "${o.name}". Valid operators: ${h$1}.${at(o.type)}`;throw new h(_,[{path:["operator"],message:_}])}O(e,u,w(o));return}if(o.type==="location"){if(e.quantifier!==void 0){let u="quantifier is not valid on a location part \u2014 a location is one value, not a set of edges";throw new h(u,[{path:["quantifier"],message:u}])}if(!F(e.property)){let u=`Property "${e.property}" is not a part of location "${e.attribute}". Valid parts: ${V}.`;throw new h(u,[{path:["property"],message:u}])}ae(e,"text");let c=ie(e.operator,"text","property");O(e,c,"text");return}if(!et.has(o.type))throw new h(`Cannot qualify ${o.type} attribute "${e.attribute}"`,[{path:["property"],message:`Attribute "${e.attribute}" is not a reference type`}]);let a=o.properties;if(!a)throw new h(`Attribute "${e.attribute}" has no qualifyWith schema`,[{path:["property"],message:`"${e.attribute}" has no qualifyWith`}]);let s=a.definitions.find(c=>c.name===e.property);if(!s)throw new h(`Property "${e.property}" not defined on "${e.attribute}".qualifyWith()`,[{path:["property"],message:`Unknown property: ${e.property}`}]);let l=ie(e.operator,s.type,"property");O(e,l,s.type);}a(st,"validateQualifiedRule");var se=64,le=1e4;function ce(e){let r=Object.getPrototypeOf(e);return r===Object.prototype||r===null}a(ce,"isPlainJsonObject");function m(e,r,o=[]){e.addIssue({code:"custom",message:r,path:o});}a(m,"addJsonIssue");function ct(e,r,o,i){for(let a of Reflect.ownKeys(e))if(a!=="length"){if(a==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",[...r.path,a]);continue}(typeof a=="symbol"||!/^(0|[1-9]\d*)$/.test(a))&&m(i,"Arrays cannot contain non-index JSON properties",[...r.path,a]);}for(let a=e.length-1;a>=0;a--){let s=Object.getOwnPropertyDescriptor(e,String(a)),l=[...r.path,a];if(!(s&&"value"in s)){m(i,"Sparse arrays are not valid JSON values",l);continue}o.push({kind:"enter",value:s.value,path:l,depth:r.depth+1});}}a(ct,"pushJsonArrayChildren");function ut(e,r,o,i){let a=Reflect.ownKeys(e);for(let s=a.length-1;s>=0;s--){let l=a[s],c=[...r.path,l];if(l==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",c);continue}if(typeof l=="symbol"){m(i,"Symbol keys are not valid JSON keys",c);continue}let u=Object.getOwnPropertyDescriptor(e,l);if(!(u?.enumerable&&"value"in u)){m(i,"Custom props must contain enumerable data properties only",c);continue}o.push({kind:"enter",value:u.value,path:c,depth:r.depth+1});}}a(ut,"pushJsonObjectChildren");function pt(e,r){if(e===null||typeof e!="object"){m(r,"Expected a plain JSON object");return}try{if(Array.isArray(e)||!ce(e)){m(r,"Expected a plain JSON object");return}}catch{m(r,"Custom props contain an object that cannot be safely inspected");return}let o=new WeakSet,i=[{kind:"enter",value:e,path:[],depth:0}],a=0;for(;i.length>0;){let s=i.pop();if(!s)break;if(s.kind==="exit"){o.delete(s.value);continue}if(a++,a>le){m(r,`Custom props cannot exceed ${le.toLocaleString("en-US")} total JSON nodes`,s.path);return}if(s.depth>se){m(r,`Custom props cannot exceed depth ${se}`,s.path);continue}let l=s.value;if(!(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"&&Number.isFinite(l))){if(typeof l!="object"){m(r,"Expected a JSON value",s.path);continue}if(o.has(l)){m(r,"Custom props cannot contain circular references",s.path);continue}try{if(Array.isArray(l)){o.add(l),i.push({kind:"exit",value:l}),ct(l,s,i,r);continue}if(!ce(l)){m(r,"Expected an array or plain JSON object",s.path);continue}o.add(l),i.push({kind:"exit",value:l}),ut(l,s,i,r);}catch{m(r,"Custom props contain an object that cannot be safely inspected",s.path);}}}}a(pt,"validateJsonProps");var ue=z$1.unknown().superRefine(pt).transform(e=>e);var Gr=z$1.array(z$1.string()).max(r.columnsPerTab),dt=z$1.array(z$1.string().min(1)).max(r.columnsPerTab).refine(e=>new Set(e).size===e.length,{message:"Displayed attribute names must be unique"}),mt=z$1.object({attribute:z$1.string().describe("Attribute to sort by"),direction:z$1.enum(["asc","desc"]).describe("asc or desc")}).strict(),bt=z$1.array(mt).max(r.sortsPerTab),yt=z$1.object({amount:z$1.number().describe("Count"),unit:z$1.enum(["days","weeks","months","years"]).describe("Unit"),direction:z$1.enum(["past","future"]).describe("Past or future")}).strict(),ft=z$1.object({value:z$1.number().nullable().describe("Amount"),code:z$1.array(z$1.string()).optional().describe("Currency codes")}).strict(),ht=z$1.object({phoneNumber:z$1.string().nullable().describe("Number"),countryCode:z$1.string().optional().describe("ISO country code")}).strict(),_t=z$1.discriminatedUnion("dynamic",[z$1.object({dynamic:z$1.literal("actor").describe("Resolved at filter time"),ref:z$1.literal("current").describe("The current actor")}).strict(),z$1.object({dynamic:z$1.literal("date").describe("Resolved at filter time"),anchor:z$1.enum(["today","now"]).describe("Anchor")}).strict()]),gt=z$1.object({month:z$1.number().describe("1-12"),day:z$1.number().describe("Day")}).strict(),At=z$1.union([z$1.string(),z$1.number(),z$1.boolean(),z$1.array(z$1.string()),yt,ft,ht,gt,_t,z$1.null()]),St=z$1.enum(["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","any_of","none_of"],{error:a(e=>{let r=e.input,o=typeof r=="string"?k[r]:void 0;return o?`Unknown filter operator "${r}" \u2014 use ${o}`:void 0},"error")}),Rt=z$1.object({attribute:z$1.string().describe("Attribute to filter on"),property:z$1.string().optional().describe("Qualified edge property"),quantifier:z$1.enum(["any","none"]).optional().describe("For a multi-value attribute"),operator:St.describe("Comparison"),value:At.describe("Comparison value, by attribute type")}).strict(),Ot=z$1.array(Rt).max(r.filterRulesPerTab),Tt=z$1.object({combinator:z$1.enum(["and","or"]).describe("Match every rule or any rule"),rules:Ot.describe("The rules")}).strict(),Et={span:z$1.union([z$1.literal(1),z$1.literal(2),z$1.literal(3),z$1.literal(4),z$1.literal(5),z$1.literal(6),z$1.literal(7),z$1.literal(8),z$1.literal(9),z$1.literal(10),z$1.literal(11),z$1.literal(12)]).optional().describe("Columns of 12 this field occupies"),label:z$1.string().optional().describe("Overrides the attribute's label"),readOnly:z$1.boolean().optional().describe("Shows the value, not editable")},xt=z$1.object({attribute:z$1.string().describe("Attribute API name shown by this field"),...Et}).strict(),Ft=z$1.object({name:z$1.string().describe("Group API name, unique in the form"),label:z$1.string().describe("Label people see"),description:z$1.string().optional().describe("Extra context under the label"),collapsible:z$1.boolean().optional().describe("Whether the group can be collapsed"),collapsed:z$1.boolean().optional().describe("Whether the group starts collapsed"),fields:z$1.array(xt).max(r.fieldsPerGroup).describe("Fields in this group, in order")}).strict();function pe(e,r$1){e.groups.reduce((s,l)=>s+l.fields.length,0)>r.fieldsPerFormTab&&r$1.addIssue({code:"too_big",origin:"array",maximum:r.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${r.fieldsPerFormTab} fields`,path:["groups"]});let i=new Set,a=new Set;e.groups.forEach((s,l)=>{i.has(s.name)&&r$1.addIssue({code:"custom",message:`Duplicate group name "${s.name}"`,path:["groups",l,"name"]}),i.add(s.name),s.fields.forEach((c,u)=>{a.has(c.attribute)&&r$1.addIssue({code:"custom",message:`Duplicate field attribute "${c.attribute}"`,path:["groups",l,"fields",u,"attribute"]}),a.add(c.attribute);});});}a(pe,"refineFormContent");var b={name:z$1.string().describe("Content API name, unique in the view"),label:z$1.string().optional().describe("Label people see"),icon:t.optional().describe("Icon name"),placement:z$1.enum(["main","aside"]).describe("main: any tabs. aside: at most one, a form")},de=z$1.object({object:z$1.string().optional().describe("Every record of this object"),relation:z$1.string().optional().describe("Records linked through this relation")}).strict().superRefine((e,r)=>{e.object===void 0&&e.relation===void 0&&r.addIssue({code:"custom",message:"Collection source must define an object, a relation, or both"});}).transform(e=>e.relation===void 0?{object:e.object}:e.object===void 0?{relation:e.relation}:{object:e.object,relation:e.relation}),wt={...b,type:z$1.literal("collection"),source:de.describe("object: every record; relation: records linked to this record; both: records of object whose relation points at this record"),visibility:z$1.enum(d).optional().describe("all: no scope; workspace: every member; private: viewer's own"),columns:z$1.array(z$1.union([z$1.string(),z$1.object({relationProperty:z$1.string().refine(e=>e.trim().length>0).describe("Qualified edge property shown as a column")}).strict()])).max(r.columnsPerTab).optional().describe("Table columns, in order"),descriptionAttribute:z$1.string().optional().describe("Secondary line under each row's title (list layout)"),displayAttributes:dt.optional().describe("Attributes shown on each card"),filters:Tt.optional().describe("Restricts which records show"),sorts:bt.optional().describe("Sort order"),actions:z$1.enum(["create","update","delete","attach","detach"]).array().optional().describe("Offered actions; absent = every action, [] = none"),openMode:z$1.enum(["page","peek"]).optional().describe("page or peek (the record panel)"),createMode:z$1.enum(["page","peek","inline"]).optional().describe("page, peek, or inline (creates without opening)")},Ct=z$1.object({...wt,layout:z$1.enum(["table","list","kanban"]).describe("table columns, list cards, kanban board grouped by a select/status attribute"),columnSizing:z$1.record(z$1.string(),z$1.number()).optional().describe("Column widths in pixels, by attribute name"),groupByAttribute:z$1.string().optional().describe("Kanban only: the select or status attribute that names the columns"),kanbanColumnOrder:z$1.array(z$1.string()).optional().describe("Kanban: column order by option value"),kanbanColumnVisibility:z$1.record(z$1.string(),z$1.boolean()).optional().describe("Kanban: which columns are shown"),kanbanPinnedColumns:z$1.array(z$1.string()).optional().describe("Kanban: columns pinned first")}).strict().superRefine((e,r)=>{let o=["groupByAttribute","kanbanColumnOrder","kanbanColumnVisibility","kanbanPinnedColumns"];if(e.layout==="kanban"){e.groupByAttribute===void 0&&r.addIssue({code:"custom",path:["groupByAttribute"],message:"A kanban layout requires groupByAttribute"});return}for(let i of o)e[i]!==void 0&&r.addIssue({code:"custom",path:[i],message:"Only a kanban layout groups by an attribute"});}),j={...b,type:z$1.literal("form"),groups:z$1.array(Ft).max(r.groupsPerFormTab).describe("Field groups, in order"),formColumns:z$1.union([z$1.literal(1),z$1.literal(2),z$1.literal(3)]).optional().describe("Grid columns, 1-3"),density:z$1.enum(["compact","comfortable","spacious"]).optional().describe("Vertical spacing between fields")},Pt=z$1.object(j).strict().superRefine(pe),vt=z$1.object({...j,groups:j.groups.min(1,"A published form content requires at least one group")}).strict().superRefine(pe),me=[Ct,z$1.object({...b,type:z$1.literal("custom"),extension:z$1.string().describe("Name of a registered extension"),parameters:z$1.lazy(()=>ue).optional().describe("Extension parameters")}).strict(),z$1.object({...b,type:z$1.literal("activity")}).strict(),z$1.object({...b,type:z$1.literal("richtext"),attribute:z$1.string().describe("Richtext attribute edited in place"),titleAttribute:z$1.string().optional().describe("Text attribute shown as the title")}).strict(),z$1.object({...b,type:z$1.literal("documents"),allowUpload:z$1.boolean().optional().describe("Lets people add files here"),allowRemove:z$1.boolean().optional().describe("Lets people remove files here"),hideAttachments:z$1.boolean().optional().describe("Hides files attached elsewhere (e.g. emails)"),relations:z$1.array(z$1.string()).optional().describe("Document relations shown; the record's own files if absent")}).strict(),z$1.object({...b,type:z$1.literal("forms"),objectName:z$1.string().optional().describe("Limits to this object's published forms")}).strict(),z$1.object({...b,type:z$1.literal("emails"),emailAttributes:z$1.array(z$1.string()).max(r.emailAttributesPerTab).describe("Addresses")}).strict(),z$1.object({...b,type:z$1.literal("meetings"),emailAttributes:z$1.array(z$1.string()).max(r.emailAttributesPerTab).describe("Addresses")}).strict()],Dt=z$1.discriminatedUnion("type",[Pt,...me]),be=z$1.discriminatedUnion("type",[vt,...me]),ye={object:z$1.string(),name:z$1.string(),label:z$1.string(),description:z$1.string().optional(),icon:t.optional(),context:z$1.enum(["collection","record"]),default:z$1.boolean().optional()},It=z$1.object({...ye,contents:z$1.array(Dt).max(r.tabsPerView)}).strict(),Vt=z$1.object({...ye,contents:z$1.array(be).max(r.tabsPerView)}).strict();function fe(e,r){let o=new Set;e.contents.forEach((i,a)=>{o.has(i.name)&&r.addIssue({code:"custom",message:`Duplicate content name "${i.name}"`,path:["contents",a,"name"]}),o.add(i.name);});}a(fe,"addDuplicateContentNameIssues");function he(e,r){let o=e.contents.map((i,a)=>({content:i,index:a})).filter(({content:i})=>i.placement==="aside");o.length>1&&r.addIssue({code:"custom",path:["contents",o[1].index,"placement"],message:"Aside holds one content for now; put the others in main"});for(let{content:i,index:a}of o)i.type!=="form"&&r.addIssue({code:"custom",path:["contents",a,"type"],message:`Only a form content can sit in aside for now; put ${i.type} in main`});}a(he,"addAsideIssues");function kt({asideRule:e="enforce"}={}){return It.superRefine((r,o)=>{fe(r,o),e==="enforce"&&he(r,o);})}a(kt,"draftContentViewDefinitionSchemaFor");function jt({asideRule:e="enforce"}={}){return Vt.superRefine((r,o)=>{fe(r,o),r.contents.some(i=>i.placement==="main")||o.addIssue({code:"custom",message:"A published view requires at least one main content",path:["contents"]}),e==="enforce"&&he(r,o);})}a(jt,"contentViewDefinitionSchemaFor");var Mt=kt(),Lt=jt();export{sr as A,ur as B,pr as C,dr as D,te as E,re as F,He as G,P as H,Rr as I,v as J,Er as K,xr as L,Fr as M,rt as N,k as O,Mr as P,st as Q,Gr as R,dt as S,bt as T,Tt as U,de as V,be as W,kt as X,jt as Y,Mt as Z,Lt as _,Se as a,Nt as b,Re as c,qt as d,$ as e,x as f,F as g,Yt as h,y as i,g as j,J as k,zt as l,Wt as m,Kt as n,Jt as o,Gt as p,w as q,f as r,We as s,H as t,Zt as u,R as v,rr as w,or as x,nr as y,Z as z};
@@ -52,6 +52,30 @@ interface RelationOptionsResponse {
52
52
  nextOffset?: number;
53
53
  }
54
54
 
55
+ /**
56
+ * `baseConfigSchema`'s keys — the model never sets these directly, and the
57
+ * prompt (`attribute-reference.ts`'s `BASE_CONFIG_KEYS`) already hides them
58
+ * from every `<attribute_types>` line. `ADD_ATTRIBUTE_WIRE` omits them from
59
+ * each per-type wire config for the same reason, so the wire never offers a
60
+ * key the model was never told about — and never exposes `metadata`, the one
61
+ * genuine open record among them, on the wire. Single source: the runtime
62
+ * prompt imports this instead of keeping its own copy.
63
+ */
64
+ declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
65
+ /**
66
+ * Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
67
+ * than the one sent.
68
+ *
69
+ * Two wire shapes merge several types into one member for size — the nine
70
+ * simple attribute types of `ADD_ATTRIBUTE_WIRE`, and the seven simple
71
+ * qualified-property types below — so a merged member structurally accepts
72
+ * every merged type's keys. Without this, a `text`-only `format` sent on a
73
+ * `number` parses and is then silently `.strip()`-ped at store: a key lost
74
+ * with no feedback. Checked against the SENT type, and the message names the
75
+ * keys that type does accept so the next call is right. One factory rather
76
+ * than two near-identical loops — the second one drifted first.
77
+ */
78
+ declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z.RefinementCtx, path?: readonly string[]) => void;
55
79
  declare const statusGroupSchema: z.ZodEnum<{
56
80
  idle: "idle";
57
81
  in_progress: "in_progress";
@@ -146,6 +170,50 @@ declare const statusOptionWriteSchema: z.ZodObject<{
146
170
  finished: "finished";
147
171
  }>;
148
172
  }, z.core.$strict>;
173
+ /**
174
+ * Property types whose config differs from `baseConfigSchema` only by
175
+ * independent optional scalars — no options array, no relation targets. Same
176
+ * shape as `SIMPLE_ATTRIBUTE_TYPES` in `architect/operations/schema.ts` minus
177
+ * `richtext`/`user` (not valid property types) — none of these seven types'
178
+ * keys collide, proven by `tests/validation/config/property-config.test.ts`.
179
+ * Merged into one wire member for the same reason `ADD_ATTRIBUTE_WIRE` merges
180
+ * its nine: the model reads one shape instead of seven near-identical ones,
181
+ * and this is also what keeps a qualified relation/document's `add_attribute`
182
+ * leaf under its wire-size cap (`tests/architect/wire-schema-size.test.ts`) —
183
+ * ten separate members, each paying its own JSON Schema object/`$defs`
184
+ * boilerplate, blew the budget even after the base config keys were omitted.
185
+ */
186
+ declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
187
+ declare const propertyAttributeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
188
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
189
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
190
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
191
+ }>, z.core.$strip>[]], "type">;
192
+ declare const propertySchemaSchema: z.ZodObject<{
193
+ definitions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
194
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
195
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
196
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
197
+ }>, z.core.$strip>[]], "type">>;
198
+ }, z.core.$strip>;
199
+ /**
200
+ * The wire-facing property union, derived from the stored one: the same seven
201
+ * simple types merged into one member, the option-carrying types alongside,
202
+ * everything the model never sets omitted, and `.strict()` so an invented key
203
+ * is refused by name instead of silently stripped at store.
204
+ */
205
+ declare const propertyAttributeWireSchema: z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
206
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
207
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
208
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
209
+ }>, z.core.$strip>[]], "type">;
210
+ declare const propertySchemaWireSchema: z.ZodObject<{
211
+ definitions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
212
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
213
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
214
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
215
+ }>, z.core.$strip>[]], "type">>;
216
+ }, z.core.$strict>;
149
217
  /**
150
218
  * Map of attribute type to config schema
151
219
  */
@@ -181,4 +249,4 @@ declare function parseAttributeConfigForCreate(type: AttributeType, input: unkno
181
249
  */
182
250
  declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
183
251
 
184
- export { type AddAttributeInput as A, type CreateCustomObjectInput as C, type RelationOption as R, type UpdateObjectInput as U, type RelationOptionsResponse as a, attributeConfigSchemas as b, parseAttributeConfigForCreate as c, parseAttributeConfigForUpdate as d, statusGroupSchema as e, statusOptionWriteSchema as f, getAttributeConfigSchema as g, getAttributeConfigWriteSchema as h, multiselectOptionWriteSchema as m, parseAttributeConfig as p, selectOptionWriteSchema as s };
252
+ export { type AddAttributeInput as A, type CreateCustomObjectInput as C, type RelationOption as R, SIMPLE_PROPERTY_TYPES as S, type UpdateObjectInput as U, WIRE_OMITTED_CONFIG_KEYS as W, type RelationOptionsResponse as a, attributeConfigSchemas as b, parseAttributeConfigForCreate as c, parseAttributeConfigForUpdate as d, propertyAttributeSchema as e, propertyAttributeWireSchema as f, propertySchemaSchema as g, propertySchemaWireSchema as h, statusGroupSchema as i, statusOptionWriteSchema as j, getAttributeConfigSchema as k, getAttributeConfigWriteSchema as l, multiselectOptionWriteSchema as m, parseAttributeConfig as p, refuseForeignKeys as r, selectOptionWriteSchema as s };
@@ -52,6 +52,30 @@ interface RelationOptionsResponse {
52
52
  nextOffset?: number;
53
53
  }
54
54
 
55
+ /**
56
+ * `baseConfigSchema`'s keys — the model never sets these directly, and the
57
+ * prompt (`attribute-reference.ts`'s `BASE_CONFIG_KEYS`) already hides them
58
+ * from every `<attribute_types>` line. `ADD_ATTRIBUTE_WIRE` omits them from
59
+ * each per-type wire config for the same reason, so the wire never offers a
60
+ * key the model was never told about — and never exposes `metadata`, the one
61
+ * genuine open record among them, on the wire. Single source: the runtime
62
+ * prompt imports this instead of keeping its own copy.
63
+ */
64
+ declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
65
+ /**
66
+ * Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
67
+ * than the one sent.
68
+ *
69
+ * Two wire shapes merge several types into one member for size — the nine
70
+ * simple attribute types of `ADD_ATTRIBUTE_WIRE`, and the seven simple
71
+ * qualified-property types below — so a merged member structurally accepts
72
+ * every merged type's keys. Without this, a `text`-only `format` sent on a
73
+ * `number` parses and is then silently `.strip()`-ped at store: a key lost
74
+ * with no feedback. Checked against the SENT type, and the message names the
75
+ * keys that type does accept so the next call is right. One factory rather
76
+ * than two near-identical loops — the second one drifted first.
77
+ */
78
+ declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z.RefinementCtx, path?: readonly string[]) => void;
55
79
  declare const statusGroupSchema: z.ZodEnum<{
56
80
  idle: "idle";
57
81
  in_progress: "in_progress";
@@ -146,6 +170,50 @@ declare const statusOptionWriteSchema: z.ZodObject<{
146
170
  finished: "finished";
147
171
  }>;
148
172
  }, z.core.$strict>;
173
+ /**
174
+ * Property types whose config differs from `baseConfigSchema` only by
175
+ * independent optional scalars — no options array, no relation targets. Same
176
+ * shape as `SIMPLE_ATTRIBUTE_TYPES` in `architect/operations/schema.ts` minus
177
+ * `richtext`/`user` (not valid property types) — none of these seven types'
178
+ * keys collide, proven by `tests/validation/config/property-config.test.ts`.
179
+ * Merged into one wire member for the same reason `ADD_ATTRIBUTE_WIRE` merges
180
+ * its nine: the model reads one shape instead of seven near-identical ones,
181
+ * and this is also what keeps a qualified relation/document's `add_attribute`
182
+ * leaf under its wire-size cap (`tests/architect/wire-schema-size.test.ts`) —
183
+ * ten separate members, each paying its own JSON Schema object/`$defs`
184
+ * boilerplate, blew the budget even after the base config keys were omitted.
185
+ */
186
+ declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
187
+ declare const propertyAttributeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
188
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
189
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
190
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
191
+ }>, z.core.$strip>[]], "type">;
192
+ declare const propertySchemaSchema: z.ZodObject<{
193
+ definitions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
194
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
195
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
196
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
197
+ }>, z.core.$strip>[]], "type">>;
198
+ }, z.core.$strip>;
199
+ /**
200
+ * The wire-facing property union, derived from the stored one: the same seven
201
+ * simple types merged into one member, the option-carrying types alongside,
202
+ * everything the model never sets omitted, and `.strict()` so an invented key
203
+ * is refused by name instead of silently stripped at store.
204
+ */
205
+ declare const propertyAttributeWireSchema: z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
206
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
207
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
208
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
209
+ }>, z.core.$strip>[]], "type">;
210
+ declare const propertySchemaWireSchema: z.ZodObject<{
211
+ definitions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<Readonly<{
212
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
213
+ }>, z.core.$strip>, ...z.ZodObject<Readonly<{
214
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
215
+ }>, z.core.$strip>[]], "type">>;
216
+ }, z.core.$strict>;
149
217
  /**
150
218
  * Map of attribute type to config schema
151
219
  */
@@ -181,4 +249,4 @@ declare function parseAttributeConfigForCreate(type: AttributeType, input: unkno
181
249
  */
182
250
  declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
183
251
 
184
- export { type AddAttributeInput as A, type CreateCustomObjectInput as C, type RelationOption as R, type UpdateObjectInput as U, type RelationOptionsResponse as a, attributeConfigSchemas as b, parseAttributeConfigForCreate as c, parseAttributeConfigForUpdate as d, statusGroupSchema as e, statusOptionWriteSchema as f, getAttributeConfigSchema as g, getAttributeConfigWriteSchema as h, multiselectOptionWriteSchema as m, parseAttributeConfig as p, selectOptionWriteSchema as s };
252
+ export { type AddAttributeInput as A, type CreateCustomObjectInput as C, type RelationOption as R, SIMPLE_PROPERTY_TYPES as S, type UpdateObjectInput as U, WIRE_OMITTED_CONFIG_KEYS as W, type RelationOptionsResponse as a, attributeConfigSchemas as b, parseAttributeConfigForCreate as c, parseAttributeConfigForUpdate as d, propertyAttributeSchema as e, propertyAttributeWireSchema as f, propertySchemaSchema as g, propertySchemaWireSchema as h, statusGroupSchema as i, statusOptionWriteSchema as j, getAttributeConfigSchema as k, getAttributeConfigWriteSchema as l, multiselectOptionWriteSchema as m, parseAttributeConfig as p, refuseForeignKeys as r, selectOptionWriteSchema as s };