@standards/schema 1.0.0-alpha.386 → 1.0.0-alpha.388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-DFqQ8Lh_.d.mts +2955 -0
- package/dist/all-DMrOEhf2.d.ts +2955 -0
- package/dist/api/index.d.mts +378 -150
- package/dist/api/index.d.ts +378 -150
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/{attributes-BcA_reJZ.d.ts → attributes-CyqQz0hF.d.ts} +1 -1
- package/dist/{attributes-eqr1vdPP.d.mts → attributes-aP3uDQhm.d.mts} +1 -1
- package/dist/{checkbox-DfXrFM2z.d.mts → checkbox-DUmGzDYU.d.mts} +2 -2
- package/dist/{checkbox-C9aJ-6gq.d.ts → checkbox-DtpvrX_r.d.ts} +2 -2
- package/dist/config-Bmt8Dwhr.mjs +2 -0
- package/dist/config-CegiJsta.js +2 -0
- package/dist/{date-CdaoV9_L.d.ts → date-DLot-YfL.d.ts} +2 -2
- package/dist/{date-BzggmHjS.d.mts → date-N0Jc3wQW.d.mts} +2 -2
- package/dist/{exceptions-CgzBcQIl.d.mts → exceptions-CPpO7bl9.d.mts} +13 -0
- package/dist/{exceptions-CgzBcQIl.d.ts → exceptions-CPpO7bl9.d.ts} +13 -0
- package/dist/exceptions.d.mts +2 -2
- package/dist/exceptions.d.ts +2 -2
- package/dist/exceptions.js +1 -1
- package/dist/exceptions.mjs +1 -1
- package/dist/{index-BSYjSdhW.d.mts → index--3rw-qsK.d.mts} +3 -3
- package/dist/{index-zJz3LbXr.d.mts → index-BHL9Gplq.d.mts} +1 -1
- package/dist/index-BL3pS7-D.d.ts +288 -0
- package/dist/{index-CCH94vyR.d.ts → index-C9XihEoz.d.ts} +1 -1
- package/dist/{index-DjWbCMUZ.d.ts → index-CAS7YRMe.d.mts} +550 -118
- package/dist/{index-D1iR2xuc.d.ts → index-CEJka-gc.d.ts} +3 -3
- package/dist/{index-BmQgUhtq.d.mts → index-DJ3ba5Wr.d.ts} +550 -118
- package/dist/index-DRc0yvLf.d.mts +288 -0
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{number-Br56q0hL.d.mts → number-DBgimO7d.d.mts} +2 -2
- package/dist/{number-B3u9vPtb.d.ts → number-DJPD4Ywg.d.ts} +2 -2
- package/dist/{objects-CLxyZh-U.d.ts → objects-C4eEHZp3.d.ts} +29 -7
- package/dist/{objects-DxEMaC2Z.d.mts → objects-DAE_qmhw.d.mts} +29 -7
- package/dist/record-aggregates-DY8qLwuF.mjs +2 -0
- package/dist/record-aggregates-ayabJXQ0.js +2 -0
- package/dist/record-operation-Fjq2V4-g.js +2 -0
- package/dist/record-operation-yFJABAKm.mjs +2 -0
- package/dist/{text-C5NnfCJg.d.mts → text-CYG5jEoC.d.mts} +2 -2
- package/dist/{text-Bvk4ila8.d.ts → text-CtZRnsF4.d.ts} +2 -2
- package/dist/{utils-CRx-eR8T.d.mts → utils-C2dIMiOB.d.mts} +1 -1
- package/dist/{utils-B2bq4zLb.d.ts → utils-CydvpWQ3.d.ts} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/validation/all.d.mts +4 -4
- package/dist/validation/all.d.ts +4 -4
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/view-config.schema-8c37WcS7.mjs +2 -0
- package/dist/view-config.schema-DqucFfKS.js +2 -0
- package/package.json +2 -2
- package/dist/all-4D2kFfWM.d.mts +0 -2955
- package/dist/all-DmTOfJJI.d.ts +0 -2955
- package/dist/config-C1CDWJf8.mjs +0 -2
- package/dist/config-eqfYa9Bh.js +0 -2
- package/dist/index-e1Oh8ngS.d.ts +0 -278
- package/dist/index-jDwfdudj.d.mts +0 -278
- package/dist/record-aggregates-Cj3p3_ce.js +0 -2
- package/dist/record-aggregates-DQXrIuGE.mjs +0 -2
- package/dist/record-operation-7-DRRONb.mjs +0 -2
- package/dist/record-operation-BcbgQ-0b.js +0 -2
- package/dist/view-config.schema-Dl5GkAzl.mjs +0 -2
- package/dist/view-config.schema-DwZVS0Gn.js +0 -2
package/dist/config-C1CDWJf8.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
import{ValidationError as e}from"./exceptions.mjs";import"./zod-locale.mjs";import{ATTRIBUTE_NAME_SCHEMA as t,SCHEMA_LIMITS as n,colorIdSchema as r,iconNameSchema as i,isPlainRecord as a}from"./attribute-validators-COsyRG9V.mjs";import*as o from"zod";const s=[`text`,`number`,`boolean`,`date`,`select`,`multiselect`],c=o.object({placeholder:o.string().optional(),description:o.string().optional(),defaultValue:o.unknown().optional(),icon:o.string().optional(),order:o.number().int().optional(),hidden:o.boolean().optional(),archived:o.boolean().optional(),deprecated:o.boolean().optional(),metadata:o.record(o.string(),o.unknown()).optional()}),l=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`],u={relation:{icon:i.optional().describe(`Field icon from search_icons`)}},d={date:[`precision`],user:[`notifiesOnAssign`]};function wireOmittedConfigKeysFor(e){let t=u[e]??{};return[...l.filter(e=>!(e in t)),...d[e]??[]]}function wireHiddenTypeConfigMask(e){return Object.fromEntries((d[e]??[]).map(e=>[e,!0]))}function refuseForeignKeys(e,t,n=[]){let r=new Set(n);return function refuse(n,i,a,o=[]){let s=e[n];if(s!==void 0&&i!==void 0)for(let e of Object.keys(i))s.has(e)||r.has(e)||a.addIssue({code:`custom`,path:[...o,e],message:`"${e}" is not a ${n} ${t}; keys of ${n}: ${[...s].join(`, `)}`})}}const f=o.object({value:o.string().min(1).describe(`Stored value`),label:o.string().min(1).describe(`Label people see`),description:o.string().describe(`Extra context`).optional(),inverse:o.string().describe(`Paired option's value (symmetric)`).optional(),archived:o.boolean().describe(`Hides without deleting`).optional()}),p=o.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),m=f.extend({color:r}).strict(),h=m,g=f.extend({color:r,group:p}).strict(),_=f.extend({color:o.string().optional().describe(`A color id`),group:p.optional()}).strict(),v=new Set(_.keyof().options),y=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let n of y){let r=e[n];if(!Array.isArray(r))continue;let i=!1,o=r.map(e=>!a(e)||Object.keys(e).every(e=>v.has(e))?e:(i=!0,Object.fromEntries(Object.entries(e).filter(([e])=>v.has(e)))));i&&(t={...t,[n]:o})}let n=e.properties;if(a(n)&&Array.isArray(n.definitions)){let e=n.definitions,r=e.map(e=>a(e)?withoutUnknownOptionKeys(e):e);r.some((t,n)=>t!==e[n])&&(t={...t,properties:{...n,definitions:r}})}return t}const b=o.array(_).min(1).refine(e=>{let t=e.map(e=>e.value);return new Set(t).size===t.length},{message:`Duplicate option values are not allowed`});function writeOptionsArraySchema(e){return o.array(e).min(1).max(n.optionsPerAttribute).refine(e=>{let t=e.map(e=>e.value);return new Set(t).size===t.length},{message:`Duplicate option values are not allowed`})}const x=writeOptionsArraySchema(m),S=writeOptionsArraySchema(h),C=writeOptionsArraySchema(g),ee=o.object({object:o.string().min(1).describe(`Target object`),displayTemplate:o.string().optional().describe(`Linked record label template`),filter:o.record(o.string(),o.unknown()).optional().describe(`Restricts linkable records`)}),w=o.object({object:o.string().min(1).describe(`Other side's object`),attribute:o.string().min(1).describe(`Other side's attribute`),cardinality:o.enum([`one`,`many`]).optional().describe(`Other side's cardinality`),label:o.string().min(1).optional().describe(`Other side's label`),storageOwner:o.boolean().optional().describe(`Owns the join storage`)}),T=o.object({objectName:o.string().min(1).describe(`API name of the object whose options are mirrored`),attributeName:o.string().min(1).describe(`API name of the select/status attribute to mirror options from`),attributeId:o.string().optional().describe(`Id of the source attribute, resolved by the server`)}),E=c.extend({multiline:o.boolean().describe(`Renders as a multi-line textarea`).optional(),minLength:o.number().int().min(0).describe(`Minimum character count`).optional(),maxLength:o.number().int().min(1).describe(`Maximum character count`).optional(),pattern:o.string().describe(`Regular expression the value must match`).optional(),format:o.enum([`email`,`url`,`slug`]).describe(`Validates and renders as this format`).optional()}),D=c,O=c.extend({renderAs:o.enum([`number`,`rating`]).describe(`Plain number or a star rating`).optional(),min:o.number().describe(`Minimum allowed value`).optional(),max:o.number().describe(`Maximum allowed value`).optional(),unit:o.enum([`integer`,`decimal`,`percentage`]).describe(`How the value is stored and rendered`).optional(),decimals:o.number().int().min(0).max(10).describe(`Decimal places shown`).optional()}),k=c,A=c.extend({dateFormat:o.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).optional(),precision:o.enum([`day`,`month`,`year`]).describe(`Whether the value records a day, a month or a year`).optional(),minDate:o.string().describe(`Earliest allowed date (ISO)`).optional(),maxDate:o.string().describe(`Latest allowed date (ISO)`).optional(),includeTime:o.boolean().describe(`Also captures a time of day`).optional(),endDate:o.boolean().describe(`Paired with another date attribute as a range's end`).optional(),timeFormat:o.enum([`12h`,`24h`]).describe(`Clock format when a time is included`).optional()}),j=c.extend({defaultCountryCode:o.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),M=c.extend({defaultCurrency:o.string().length(3).describe(`ISO currency code preselected for new values`).optional(),allowedCurrencies:o.array(o.string().length(3)).describe(`ISO currency codes a value may use; any currency when omitted`).optional(),allowNegative:o.boolean().describe(`Whether a negative amount is accepted`).optional()}),N=c.extend({options:b.describe(`The workflow statuses, in order`)}),P=c.extend({granularity:o.enum([`full`,`address`,`city`,`state`,`country`,`coordinates`]).describe(`How precise a location must be captured`).optional(),defaultCountry:o.string().length(3).describe(`ISO country code preselected for new values`).optional(),allowedCountries:o.array(o.string().length(3)).describe(`ISO country codes a value may use; any country when omitted`).optional()}),F=c.extend({options:b.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),I=c.extend({options:b.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),L=c.extend({types:o.array(o.enum([`user`,`agent`])).min(1).optional().describe(`Which kinds of actor can be picked; both when omitted`),multiple:o.boolean().optional().describe(`Whether more than one actor can be picked`),notifiesOnAssign:o.boolean().optional().describe(`Whether each person added to the value is notified`)}),R={name:t.describe(`Property API name`),label:o.string().min(1).describe(`Label people see`),required:o.boolean().describe(`Required on every edge`).optional()},z={id:o.string().optional(),objectId:o.string().optional(),system:o.boolean().optional(),unique:o.boolean().optional()},B=Object.fromEntries(l.map(e=>[e,!0])),V=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],H=[...V,`select`,`multiselect`,`status`],U={text:E,number:O,checkbox:k,date:A,phone:j,currency:M,location:P,select:F,multiselect:I,status:N},W={...U,select:F.extend({options:x.describe(`Options`)}),multiselect:I.extend({options:S.describe(`Options`)}),status:N.extend({options:C.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>W[e].omit(B).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>o.object({...R,...z,type:o.literal(e).describe(`Property type`),...U[e].shape}).strip(),G=o.discriminatedUnion(`type`,H.map(storedPropertyMember)),K=o.object({definitions:o.array(G).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),q=refuseForeignKeys(Object.fromEntries(H.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(R),`type`]);function refuseForeignPropertyKeys(e,t){q(e.type,e,t)}const J=V.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>o.object({...R,type:e.length===1?o.literal(e[0]).describe(`Property type`):o.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),Y=o.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),o.object({...R,type:o.enum(V).describe(`Property type`),...J}).strict().superRefine(refuseForeignPropertyKeys)]),X=o.object({definitions:o.array(Y).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),Z=c.extend({targets:o.array(ee).min(1).describe(`Target object(s)`),cardinality:o.enum([`one`,`many`]).describe(`one or many`),maxItems:o.number().int().min(1).optional().describe(`Max linked records`),bilateral:w.optional().describe(`Syncs the other side's attribute`),properties:K.optional()}),Q=c.extend({expression:o.string().min(1).describe(`The formula expression, compiled against this object's attributes`),returnType:o.enum(s).describe(`The formula's result type`),decimals:o.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),currencyCode:o.string().length(3).optional().describe(`ISO 4217 code a number result renders with; presentation only`),allowRelations:o.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:T.optional().describe(`Mirrors an option set`)}),te=c.extend({relationAttribute:o.string().min(1).optional().describe(`API name of the relation this rollup aggregates through`),relationPath:o.string().optional().describe(`Not supported yet — single-hop only`),targetAttribute:o.string().min(1).optional().describe(`API name of the attribute aggregated on the relation's target object; not read by count`),function:o.enum([`sum`,`avg`,`earliest`,`latest`,`count`,`countValues`,`countUniqueValues`,`countEmpty`,`percentEmpty`,`percentNotEmpty`,`original`]).describe(`The aggregation applied across the linked records`),decimals:o.number().int().min(0).max(10).optional().describe(`Decimal places shown for a numeric result`),targetAttributeType:o.string().optional().describe(`Server-set`),targetAttributeOptions:o.array(_).optional().describe(`Server-set`),targetCurrencyCode:o.string().length(3).optional().describe(`Server-set`),optionsSource:T.optional().describe(`Mirrors an option set`)});function rollupTargetIssue(e,t){if(e===`rollup`&&t.function!==`count`&&t.targetAttribute===void 0)return{path:[`targetAttribute`],message:`targetAttribute is required for a "${String(t.function)}" rollup`}}function datePrecisionIssues(e,t,n=[]){let r=[],i=t.precision;if(e===`date`&&i!==void 0&&i!==`day`)for(let e of[`includeTime`,`endDate`])t[e]===!0&&r.push({path:[...n,`precision`],message:`A "${String(i)}" precision cannot be combined with ${e}`});let o=t.properties;return a(o)&&Array.isArray(o.definitions)&&o.definitions.forEach((e,t)=>{a(e)&&r.push(...datePrecisionIssues(String(e.type),e,[...n,`properties`,`definitions`,t]))}),r}const $={text:E,richtext:D,number:O,checkbox:k,date:A,phone:j,currency:M,status:N,location:P,select:F,multiselect:I,user:L,relation:Z,formula:Q,rollup:te,document:c.extend({properties:K.optional(),accepts:o.array(o.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:o.number().int().min(1).optional().describe(`Maximum file size in bytes`)})};function getAttributeConfigSchema(t){let n=$[t];if(!n)throw new e(`Unsupported attribute type: ${t}`,[]);return n}function parseAttributeConfig(e,t){let n=getAttributeConfigSchema(e).strip().parse(t),r=rollupTargetIssue(e,n);if(r)throw validationErrorFromIssues([r]);return n}function getAttributeConfigWriteSchema(e){let t=getAttributeConfigSchema(e).extend({icon:i.optional()});switch(e){case`select`:return t.extend({options:x.describe(`Options`)});case`multiselect`:return t.extend({options:S.describe(`Options`)});case`status`:return t.extend({options:C.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(t){return e.fromZodErrors(t.map(e=>({path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message})))}function parseWriteSchema(e,t){let n=getAttributeConfigWriteSchema(e).strip().safeParse(t);if(!n.success)throw validationErrorFromIssues(n.error.issues);let r=rollupTargetIssue(e,n.data);if(r)throw validationErrorFromIssues([r]);let i=datePrecisionIssues(e,n.data);if(i.length>0)throw validationErrorFromIssues(i);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(t){if(!Object.prototype.hasOwnProperty.call(t,`icon`))return;let n=i.optional().safeParse(t.icon);if(!n.success)throw e.fromZodErrors(n.error.issues.map(e=>({path:[`icon`,...e.path.map(e=>typeof e==`symbol`?String(e):e)],message:e.message})))}function isSelectLike(e){return e===`select`||e===`multiselect`||e===`status`}function parseAttributeConfigForUpdate(e,t){let n=Object.prototype.hasOwnProperty.call(t,`options`),r=Object.prototype.hasOwnProperty.call(t,`icon`),i={...e,...t};if(validatePatchedIcon(t),n){let{icon:t,...n}=i,a=parseWriteSchema(e.type,r?i:n);return!r&&t!==void 0&&(a.icon=t),a}let a=e.options;isSelectLike(e.type)&&(i.options=[{value:`__legacy__`,label:`__legacy__`}]);let o=getAttributeConfigSchema(e.type).strip().safeParse(i);if(!o.success)throw validationErrorFromIssues(o.error.issues);let s=o.data,c=datePrecisionIssues(e.type,s);if(c.length>0)throw validationErrorFromIssues(c);return isSelectLike(e.type)&&(s.options=a),s}export{s as COMPUTED_RETURN_TYPES,V as SIMPLE_PROPERTY_TYPES,u as WIRE_OFFERED_BASE_CONFIG,l as WIRE_OMITTED_CONFIG_KEYS,$ as attributeConfigSchemas,datePrecisionIssues,getAttributeConfigSchema,getAttributeConfigWriteSchema,h as multiselectOptionWriteSchema,parseAttributeConfig,parseAttributeConfigForCreate,parseAttributeConfigForUpdate,G as propertyAttributeSchema,Y as propertyAttributeWireSchema,K as propertySchemaSchema,X as propertySchemaWireSchema,refuseForeignKeys,m as selectOptionWriteSchema,p as statusGroupSchema,g as statusOptionWriteSchema,wireHiddenTypeConfigMask,wireOmittedConfigKeysFor,withoutUnknownOptionKeys};
|
package/dist/config-eqfYa9Bh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");const n=require("./attribute-validators-CUqsP1j_.js");let r=require("zod");r=e.__toESM(r);const i=[`text`,`number`,`boolean`,`date`,`select`,`multiselect`],a=r.object({placeholder:r.string().optional(),description:r.string().optional(),defaultValue:r.unknown().optional(),icon:r.string().optional(),order:r.number().int().optional(),hidden:r.boolean().optional(),archived:r.boolean().optional(),deprecated:r.boolean().optional(),metadata:r.record(r.string(),r.unknown()).optional()}),o=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`],s={relation:{icon:n.iconNameSchema.optional().describe(`Field icon from search_icons`)}},c={date:[`precision`],user:[`notifiesOnAssign`]};function wireOmittedConfigKeysFor(e){let t=s[e]??{};return[...o.filter(e=>!(e in t)),...c[e]??[]]}function wireHiddenTypeConfigMask(e){return Object.fromEntries((c[e]??[]).map(e=>[e,!0]))}function refuseForeignKeys(e,t,n=[]){let r=new Set(n);return function refuse(n,i,a,o=[]){let s=e[n];if(s!==void 0&&i!==void 0)for(let e of Object.keys(i))s.has(e)||r.has(e)||a.addIssue({code:`custom`,path:[...o,e],message:`"${e}" is not a ${n} ${t}; keys of ${n}: ${[...s].join(`, `)}`})}}const l=r.object({value:r.string().min(1).describe(`Stored value`),label:r.string().min(1).describe(`Label people see`),description:r.string().describe(`Extra context`).optional(),inverse:r.string().describe(`Paired option's value (symmetric)`).optional(),archived:r.boolean().describe(`Hides without deleting`).optional()}),u=r.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),d=l.extend({color:n.colorIdSchema}).strict(),f=d,p=l.extend({color:n.colorIdSchema,group:u}).strict(),m=l.extend({color:r.string().optional().describe(`A color id`),group:u.optional()}).strict(),h=new Set(m.keyof().options),g=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let r of g){let i=e[r];if(!Array.isArray(i))continue;let a=!1,o=i.map(e=>!n.isPlainRecord(e)||Object.keys(e).every(e=>h.has(e))?e:(a=!0,Object.fromEntries(Object.entries(e).filter(([e])=>h.has(e)))));a&&(t={...t,[r]:o})}let r=e.properties;if(n.isPlainRecord(r)&&Array.isArray(r.definitions)){let e=r.definitions,i=e.map(e=>n.isPlainRecord(e)?withoutUnknownOptionKeys(e):e);i.some((t,n)=>t!==e[n])&&(t={...t,properties:{...r,definitions:i}})}return t}const _=r.array(m).min(1).refine(e=>{let t=e.map(e=>e.value);return new Set(t).size===t.length},{message:`Duplicate option values are not allowed`});function writeOptionsArraySchema(e){return r.array(e).min(1).max(n.SCHEMA_LIMITS.optionsPerAttribute).refine(e=>{let t=e.map(e=>e.value);return new Set(t).size===t.length},{message:`Duplicate option values are not allowed`})}const v=writeOptionsArraySchema(d),y=writeOptionsArraySchema(f),b=writeOptionsArraySchema(p),x=r.object({object:r.string().min(1).describe(`Target object`),displayTemplate:r.string().optional().describe(`Linked record label template`),filter:r.record(r.string(),r.unknown()).optional().describe(`Restricts linkable records`)}),S=r.object({object:r.string().min(1).describe(`Other side's object`),attribute:r.string().min(1).describe(`Other side's attribute`),cardinality:r.enum([`one`,`many`]).optional().describe(`Other side's cardinality`),label:r.string().min(1).optional().describe(`Other side's label`),storageOwner:r.boolean().optional().describe(`Owns the join storage`)}),C=r.object({objectName:r.string().min(1).describe(`API name of the object whose options are mirrored`),attributeName:r.string().min(1).describe(`API name of the select/status attribute to mirror options from`),attributeId:r.string().optional().describe(`Id of the source attribute, resolved by the server`)}),w=a.extend({multiline:r.boolean().describe(`Renders as a multi-line textarea`).optional(),minLength:r.number().int().min(0).describe(`Minimum character count`).optional(),maxLength:r.number().int().min(1).describe(`Maximum character count`).optional(),pattern:r.string().describe(`Regular expression the value must match`).optional(),format:r.enum([`email`,`url`,`slug`]).describe(`Validates and renders as this format`).optional()}),T=a,E=a.extend({renderAs:r.enum([`number`,`rating`]).describe(`Plain number or a star rating`).optional(),min:r.number().describe(`Minimum allowed value`).optional(),max:r.number().describe(`Maximum allowed value`).optional(),unit:r.enum([`integer`,`decimal`,`percentage`]).describe(`How the value is stored and rendered`).optional(),decimals:r.number().int().min(0).max(10).describe(`Decimal places shown`).optional()}),D=a,O=a.extend({dateFormat:r.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).optional(),precision:r.enum([`day`,`month`,`year`]).describe(`Whether the value records a day, a month or a year`).optional(),minDate:r.string().describe(`Earliest allowed date (ISO)`).optional(),maxDate:r.string().describe(`Latest allowed date (ISO)`).optional(),includeTime:r.boolean().describe(`Also captures a time of day`).optional(),endDate:r.boolean().describe(`Paired with another date attribute as a range's end`).optional(),timeFormat:r.enum([`12h`,`24h`]).describe(`Clock format when a time is included`).optional()}),k=a.extend({defaultCountryCode:r.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),A=a.extend({defaultCurrency:r.string().length(3).describe(`ISO currency code preselected for new values`).optional(),allowedCurrencies:r.array(r.string().length(3)).describe(`ISO currency codes a value may use; any currency when omitted`).optional(),allowNegative:r.boolean().describe(`Whether a negative amount is accepted`).optional()}),j=a.extend({options:_.describe(`The workflow statuses, in order`)}),M=a.extend({granularity:r.enum([`full`,`address`,`city`,`state`,`country`,`coordinates`]).describe(`How precise a location must be captured`).optional(),defaultCountry:r.string().length(3).describe(`ISO country code preselected for new values`).optional(),allowedCountries:r.array(r.string().length(3)).describe(`ISO country codes a value may use; any country when omitted`).optional()}),N=a.extend({options:_.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),P=a.extend({options:_.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),F=a.extend({types:r.array(r.enum([`user`,`agent`])).min(1).optional().describe(`Which kinds of actor can be picked; both when omitted`),multiple:r.boolean().optional().describe(`Whether more than one actor can be picked`),notifiesOnAssign:r.boolean().optional().describe(`Whether each person added to the value is notified`)}),I={name:n.ATTRIBUTE_NAME_SCHEMA.describe(`Property API name`),label:r.string().min(1).describe(`Label people see`),required:r.boolean().describe(`Required on every edge`).optional()},L={id:r.string().optional(),objectId:r.string().optional(),system:r.boolean().optional(),unique:r.boolean().optional()},R=Object.fromEntries(o.map(e=>[e,!0])),z=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],B=[...z,`select`,`multiselect`,`status`],V={text:w,number:E,checkbox:D,date:O,phone:k,currency:A,location:M,select:N,multiselect:P,status:j},H={...V,select:N.extend({options:v.describe(`Options`)}),multiselect:P.extend({options:y.describe(`Options`)}),status:j.extend({options:b.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>H[e].omit(R).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>r.object({...I,...L,type:r.literal(e).describe(`Property type`),...V[e].shape}).strip(),U=r.discriminatedUnion(`type`,B.map(storedPropertyMember)),W=r.object({definitions:r.array(U).min(1).max(n.SCHEMA_LIMITS.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),G=refuseForeignKeys(Object.fromEntries(B.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(I),`type`]);function refuseForeignPropertyKeys(e,t){G(e.type,e,t)}const K=z.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>r.object({...I,type:e.length===1?r.literal(e[0]).describe(`Property type`):r.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),q=r.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),r.object({...I,type:r.enum(z).describe(`Property type`),...K}).strict().superRefine(refuseForeignPropertyKeys)]),J=r.object({definitions:r.array(q).min(1).max(n.SCHEMA_LIMITS.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),Y=a.extend({targets:r.array(x).min(1).describe(`Target object(s)`),cardinality:r.enum([`one`,`many`]).describe(`one or many`),maxItems:r.number().int().min(1).optional().describe(`Max linked records`),bilateral:S.optional().describe(`Syncs the other side's attribute`),properties:W.optional()}),X=a.extend({expression:r.string().min(1).describe(`The formula expression, compiled against this object's attributes`),returnType:r.enum(i).describe(`The formula's result type`),decimals:r.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),currencyCode:r.string().length(3).optional().describe(`ISO 4217 code a number result renders with; presentation only`),allowRelations:r.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:C.optional().describe(`Mirrors an option set`)}),Z=a.extend({relationAttribute:r.string().min(1).optional().describe(`API name of the relation this rollup aggregates through`),relationPath:r.string().optional().describe(`Not supported yet — single-hop only`),targetAttribute:r.string().min(1).optional().describe(`API name of the attribute aggregated on the relation's target object; not read by count`),function:r.enum([`sum`,`avg`,`earliest`,`latest`,`count`,`countValues`,`countUniqueValues`,`countEmpty`,`percentEmpty`,`percentNotEmpty`,`original`]).describe(`The aggregation applied across the linked records`),decimals:r.number().int().min(0).max(10).optional().describe(`Decimal places shown for a numeric result`),targetAttributeType:r.string().optional().describe(`Server-set`),targetAttributeOptions:r.array(m).optional().describe(`Server-set`),targetCurrencyCode:r.string().length(3).optional().describe(`Server-set`),optionsSource:C.optional().describe(`Mirrors an option set`)});function rollupTargetIssue(e,t){if(e===`rollup`&&t.function!==`count`&&t.targetAttribute===void 0)return{path:[`targetAttribute`],message:`targetAttribute is required for a "${String(t.function)}" rollup`}}function datePrecisionIssues(e,t,r=[]){let i=[],a=t.precision;if(e===`date`&&a!==void 0&&a!==`day`)for(let e of[`includeTime`,`endDate`])t[e]===!0&&i.push({path:[...r,`precision`],message:`A "${String(a)}" precision cannot be combined with ${e}`});let o=t.properties;return n.isPlainRecord(o)&&Array.isArray(o.definitions)&&o.definitions.forEach((e,t)=>{n.isPlainRecord(e)&&i.push(...datePrecisionIssues(String(e.type),e,[...r,`properties`,`definitions`,t]))}),i}const Q={text:w,richtext:T,number:E,checkbox:D,date:O,phone:k,currency:A,status:j,location:M,select:N,multiselect:P,user:F,relation:Y,formula:X,rollup:Z,document:a.extend({properties:W.optional(),accepts:r.array(r.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:r.number().int().min(1).optional().describe(`Maximum file size in bytes`)})};function getAttributeConfigSchema(e){let n=Q[e];if(!n)throw new t.ValidationError(`Unsupported attribute type: ${e}`,[]);return n}function parseAttributeConfig(e,t){let n=getAttributeConfigSchema(e).strip().parse(t),r=rollupTargetIssue(e,n);if(r)throw validationErrorFromIssues([r]);return n}function getAttributeConfigWriteSchema(e){let t=getAttributeConfigSchema(e).extend({icon:n.iconNameSchema.optional()});switch(e){case`select`:return t.extend({options:v.describe(`Options`)});case`multiselect`:return t.extend({options:y.describe(`Options`)});case`status`:return t.extend({options:b.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(e){return t.ValidationError.fromZodErrors(e.map(e=>({path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message})))}function parseWriteSchema(e,t){let n=getAttributeConfigWriteSchema(e).strip().safeParse(t);if(!n.success)throw validationErrorFromIssues(n.error.issues);let r=rollupTargetIssue(e,n.data);if(r)throw validationErrorFromIssues([r]);let i=datePrecisionIssues(e,n.data);if(i.length>0)throw validationErrorFromIssues(i);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(e){if(!Object.prototype.hasOwnProperty.call(e,`icon`))return;let r=n.iconNameSchema.optional().safeParse(e.icon);if(!r.success)throw t.ValidationError.fromZodErrors(r.error.issues.map(e=>({path:[`icon`,...e.path.map(e=>typeof e==`symbol`?String(e):e)],message:e.message})))}function isSelectLike(e){return e===`select`||e===`multiselect`||e===`status`}function parseAttributeConfigForUpdate(e,t){let n=Object.prototype.hasOwnProperty.call(t,`options`),r=Object.prototype.hasOwnProperty.call(t,`icon`),i={...e,...t};if(validatePatchedIcon(t),n){let{icon:t,...n}=i,a=parseWriteSchema(e.type,r?i:n);return!r&&t!==void 0&&(a.icon=t),a}let a=e.options;isSelectLike(e.type)&&(i.options=[{value:`__legacy__`,label:`__legacy__`}]);let o=getAttributeConfigSchema(e.type).strip().safeParse(i);if(!o.success)throw validationErrorFromIssues(o.error.issues);let s=o.data,c=datePrecisionIssues(e.type,s);if(c.length>0)throw validationErrorFromIssues(c);return isSelectLike(e.type)&&(s.options=a),s}Object.defineProperty(exports,"COMPUTED_RETURN_TYPES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"SIMPLE_PROPERTY_TYPES",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"WIRE_OFFERED_BASE_CONFIG",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"WIRE_OMITTED_CONFIG_KEYS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"attributeConfigSchemas",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"datePrecisionIssues",{enumerable:!0,get:function(){return datePrecisionIssues}}),Object.defineProperty(exports,"getAttributeConfigSchema",{enumerable:!0,get:function(){return getAttributeConfigSchema}}),Object.defineProperty(exports,"getAttributeConfigWriteSchema",{enumerable:!0,get:function(){return getAttributeConfigWriteSchema}}),Object.defineProperty(exports,"multiselectOptionWriteSchema",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"parseAttributeConfig",{enumerable:!0,get:function(){return parseAttributeConfig}}),Object.defineProperty(exports,"parseAttributeConfigForCreate",{enumerable:!0,get:function(){return parseAttributeConfigForCreate}}),Object.defineProperty(exports,"parseAttributeConfigForUpdate",{enumerable:!0,get:function(){return parseAttributeConfigForUpdate}}),Object.defineProperty(exports,"propertyAttributeSchema",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"propertyAttributeWireSchema",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"propertySchemaSchema",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"propertySchemaWireSchema",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"refuseForeignKeys",{enumerable:!0,get:function(){return refuseForeignKeys}}),Object.defineProperty(exports,"selectOptionWriteSchema",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"statusGroupSchema",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"statusOptionWriteSchema",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"wireHiddenTypeConfigMask",{enumerable:!0,get:function(){return wireHiddenTypeConfigMask}}),Object.defineProperty(exports,"wireOmittedConfigKeysFor",{enumerable:!0,get:function(){return wireOmittedConfigKeysFor}}),Object.defineProperty(exports,"withoutUnknownOptionKeys",{enumerable:!0,get:function(){return withoutUnknownOptionKeys}});
|
package/dist/index-e1Oh8ngS.d.ts
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { ObjectImage, RecordAppearance } from "./objects-CLxyZh-U.js";
|
|
3
|
-
import { Attribute, AttributeType } from "./attributes-BcA_reJZ.js";
|
|
4
|
-
import * as z$2 from "zod";
|
|
5
|
-
import { ColorId, IconName } from "@standards/constants";
|
|
6
|
-
//#region src/types/mutations.d.ts
|
|
7
|
-
export interface AddAttributeInput {
|
|
8
|
-
name: string;
|
|
9
|
-
label: string;
|
|
10
|
-
type: AttributeType;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
unique?: boolean;
|
|
13
|
-
description?: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
icon?: IconName;
|
|
16
|
-
defaultValue?: unknown;
|
|
17
|
-
metadata?: Record<string, unknown>;
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
export interface CreateCustomObjectInput {
|
|
21
|
-
name: string;
|
|
22
|
-
label: string;
|
|
23
|
-
pluralLabel?: string;
|
|
24
|
-
labelExpression: string;
|
|
25
|
-
embeddingExpression?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
icon?: IconName;
|
|
28
|
-
color?: ColorId;
|
|
29
|
-
image?: ObjectImage;
|
|
30
|
-
attributes?: (Attribute | {
|
|
31
|
-
build: () => Attribute;
|
|
32
|
-
})[];
|
|
33
|
-
metadata?: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
export interface UpdateObjectInput {
|
|
36
|
-
label?: string;
|
|
37
|
-
pluralLabel?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
icon?: IconName;
|
|
40
|
-
/** `null` clears it: the colour then derives from the object name. */
|
|
41
|
-
color?: ColorId | null;
|
|
42
|
-
/** `null` clears it: record images then crop to a square, and are found nowhere. */
|
|
43
|
-
image?: ObjectImage | null;
|
|
44
|
-
labelExpression?: string;
|
|
45
|
-
embeddingExpression?: string;
|
|
46
|
-
metadata?: Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
export interface RelationOption {
|
|
49
|
-
id: string;
|
|
50
|
-
objectId: string;
|
|
51
|
-
objectName: string;
|
|
52
|
-
objectLabel: string;
|
|
53
|
-
objectIcon?: string;
|
|
54
|
-
objectColor?: ColorId;
|
|
55
|
-
/** How the target object crops its records' images: all an option needs of its image settings. */
|
|
56
|
-
objectImage?: Pick<ObjectImage, "shape">;
|
|
57
|
-
/** The target record's own icon / image; absent when it has neither. */
|
|
58
|
-
appearance?: RecordAppearance;
|
|
59
|
-
label: string;
|
|
60
|
-
}
|
|
61
|
-
export interface RelationOptionsResponse {
|
|
62
|
-
options: RelationOption[];
|
|
63
|
-
hasMore: boolean;
|
|
64
|
-
total: number;
|
|
65
|
-
nextOffset?: number;
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/validation/config/schemas.d.ts
|
|
69
|
-
/**
|
|
70
|
-
* `baseConfigSchema`'s keys — the model never sets these directly, and the
|
|
71
|
-
* prompt (`attribute-reference.ts`'s `BASE_CONFIG_KEYS`) already hides them
|
|
72
|
-
* from every `<attribute_types>` line. `ADD_ATTRIBUTE_WIRE` omits them from
|
|
73
|
-
* each per-type wire config for the same reason, so the wire never offers a
|
|
74
|
-
* key the model was never told about — and never exposes `metadata`, the one
|
|
75
|
-
* genuine open record among them, on the wire. Single source: the runtime
|
|
76
|
-
* prompt imports this instead of keeping its own copy.
|
|
77
|
-
*/
|
|
78
|
-
export declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
79
|
-
/**
|
|
80
|
-
* The omitted base keys one attribute type's wire offers back, each with the
|
|
81
|
-
* wire schema it is validated by. Karl's ruling on #4537 (2026-09-27, «
|
|
82
|
-
* Relations seulement »): a relation field takes its own icon, a catalogue
|
|
83
|
-
* name the agent finds with `search_icons`, exactly as an object icon; every
|
|
84
|
-
* other type keeps `icon` omitted. Single source for the wire
|
|
85
|
-
* (`ADD_ATTRIBUTE_WIRE`) and the prompt (`attribute-reference.ts`), so the
|
|
86
|
-
* key the model is told about is the key the wire accepts.
|
|
87
|
-
*/
|
|
88
|
-
export declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$2.ZodType>>>>;
|
|
89
|
-
/** The keys hidden from `attributeType`'s wire config and its prompt line. */
|
|
90
|
-
export declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
91
|
-
/** `omit()` mask of the type keys hidden from `attributeType`'s wire. */
|
|
92
|
-
export declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
93
|
-
/**
|
|
94
|
-
* Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
|
|
95
|
-
* than the one sent.
|
|
96
|
-
*
|
|
97
|
-
* Two wire shapes merge several types into one member for size — the nine
|
|
98
|
-
* simple attribute types of `ADD_ATTRIBUTE_WIRE`, and the seven simple
|
|
99
|
-
* qualified-property types below — so a merged member structurally accepts
|
|
100
|
-
* every merged type's keys. Without this, a `text`-only `format` sent on a
|
|
101
|
-
* `number` parses and is then silently `.strip()`-ped at store: a key lost
|
|
102
|
-
* with no feedback. Checked against the SENT type, and the message names the
|
|
103
|
-
* keys that type does accept so the next call is right. One factory rather
|
|
104
|
-
* than two near-identical loops — the second one drifted first.
|
|
105
|
-
*/
|
|
106
|
-
export 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$2.RefinementCtx, path?: readonly string[]) => void;
|
|
107
|
-
export declare const statusGroupSchema: z$2.ZodEnum<{
|
|
108
|
-
idle: "idle";
|
|
109
|
-
in_progress: "in_progress";
|
|
110
|
-
finished: "finished";
|
|
111
|
-
}>;
|
|
112
|
-
export declare const selectOptionWriteSchema: z$2.ZodObject<{
|
|
113
|
-
value: z$2.ZodString;
|
|
114
|
-
label: z$2.ZodString;
|
|
115
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
116
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
117
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
118
|
-
color: z$2.ZodEnum<{
|
|
119
|
-
stone: "stone";
|
|
120
|
-
clay: "clay";
|
|
121
|
-
brick: "brick";
|
|
122
|
-
terra: "terra";
|
|
123
|
-
ochre: "ochre";
|
|
124
|
-
moss: "moss";
|
|
125
|
-
sage: "sage";
|
|
126
|
-
lagoon: "lagoon";
|
|
127
|
-
ink: "ink";
|
|
128
|
-
iris: "iris";
|
|
129
|
-
peony: "peony";
|
|
130
|
-
}>;
|
|
131
|
-
}, z$2.core.$strict>;
|
|
132
|
-
export declare const multiselectOptionWriteSchema: z$2.ZodObject<{
|
|
133
|
-
value: z$2.ZodString;
|
|
134
|
-
label: z$2.ZodString;
|
|
135
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
136
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
137
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
138
|
-
color: z$2.ZodEnum<{
|
|
139
|
-
stone: "stone";
|
|
140
|
-
clay: "clay";
|
|
141
|
-
brick: "brick";
|
|
142
|
-
terra: "terra";
|
|
143
|
-
ochre: "ochre";
|
|
144
|
-
moss: "moss";
|
|
145
|
-
sage: "sage";
|
|
146
|
-
lagoon: "lagoon";
|
|
147
|
-
ink: "ink";
|
|
148
|
-
iris: "iris";
|
|
149
|
-
peony: "peony";
|
|
150
|
-
}>;
|
|
151
|
-
}, z$2.core.$strict>;
|
|
152
|
-
export declare const statusOptionWriteSchema: z$2.ZodObject<{
|
|
153
|
-
value: z$2.ZodString;
|
|
154
|
-
label: z$2.ZodString;
|
|
155
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
156
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
157
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
158
|
-
color: z$2.ZodEnum<{
|
|
159
|
-
stone: "stone";
|
|
160
|
-
clay: "clay";
|
|
161
|
-
brick: "brick";
|
|
162
|
-
terra: "terra";
|
|
163
|
-
ochre: "ochre";
|
|
164
|
-
moss: "moss";
|
|
165
|
-
sage: "sage";
|
|
166
|
-
lagoon: "lagoon";
|
|
167
|
-
ink: "ink";
|
|
168
|
-
iris: "iris";
|
|
169
|
-
peony: "peony";
|
|
170
|
-
}>;
|
|
171
|
-
group: z$2.ZodEnum<{
|
|
172
|
-
idle: "idle";
|
|
173
|
-
in_progress: "in_progress";
|
|
174
|
-
finished: "finished";
|
|
175
|
-
}>;
|
|
176
|
-
}, z$2.core.$strict>;
|
|
177
|
-
/**
|
|
178
|
-
* Drops, from every option of an attribute config or body, the keys
|
|
179
|
-
* `optionSchema` does not know — typically an `id` the code builder accepted
|
|
180
|
-
* without complaint (#4356). Sync stores options through it, and the schema
|
|
181
|
-
* state reads them through it, so one stale key no longer 400s the whole state.
|
|
182
|
-
* The options of a `relation()`/`document()`'s `.qualifyWith()` properties are
|
|
183
|
-
* validated by the same schema, so each property definition goes through it too.
|
|
184
|
-
*
|
|
185
|
-
* Order is kept, and a config with nothing to drop is returned as is. A list
|
|
186
|
-
* or option that is not the expected shape is left for strict validation to
|
|
187
|
-
* refuse.
|
|
188
|
-
*/
|
|
189
|
-
export declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
190
|
-
/**
|
|
191
|
-
* Property types whose config differs from `baseConfigSchema` only by
|
|
192
|
-
* independent optional scalars — no options array, no relation targets. Same
|
|
193
|
-
* shape as `SIMPLE_ATTRIBUTE_TYPES` in `architect/operations/schema.ts` minus
|
|
194
|
-
* `richtext`/`user` (not valid property types) — none of these seven types'
|
|
195
|
-
* keys collide, proven by `tests/validation/config/property-config.test.ts`.
|
|
196
|
-
* Merged into one wire member for the same reason `ADD_ATTRIBUTE_WIRE` merges
|
|
197
|
-
* its nine: the model reads one shape instead of seven near-identical ones,
|
|
198
|
-
* and this is also what keeps a qualified relation/document's `add_attribute`
|
|
199
|
-
* leaf under its wire-size cap (`tests/architect/wire-schema-size.test.ts`) —
|
|
200
|
-
* ten separate members, each paying its own JSON Schema object/`$defs`
|
|
201
|
-
* boilerplate, blew the budget even after the base config keys were omitted.
|
|
202
|
-
*/
|
|
203
|
-
export declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
-
export declare const propertyAttributeSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
205
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
206
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
207
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
208
|
-
}>, z$2.core.$strip>[]], "type">;
|
|
209
|
-
export declare const propertySchemaSchema: z$2.ZodObject<{
|
|
210
|
-
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
211
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
212
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
213
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
214
|
-
}>, z$2.core.$strip>[]], "type">>;
|
|
215
|
-
}, z$2.core.$strip>;
|
|
216
|
-
/**
|
|
217
|
-
* The wire-facing property union, derived from the stored one: the same seven
|
|
218
|
-
* simple types merged into one member, the option-carrying types alongside,
|
|
219
|
-
* everything the model never sets omitted, and `.strict()` so an invented key
|
|
220
|
-
* is refused by name instead of silently stripped at store.
|
|
221
|
-
*/
|
|
222
|
-
export declare const propertyAttributeWireSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
223
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
224
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
225
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
226
|
-
}>, z$2.core.$strip>[]], "type">;
|
|
227
|
-
export declare const propertySchemaWireSchema: z$2.ZodObject<{
|
|
228
|
-
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
229
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
230
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
231
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
232
|
-
}>, z$2.core.$strip>[]], "type">>;
|
|
233
|
-
}, z$2.core.$strict>;
|
|
234
|
-
/**
|
|
235
|
-
* A month or a year has no time of day and no range end to pair with in this
|
|
236
|
-
* slice (#5325): `precision` narrower than a day is refused beside
|
|
237
|
-
* `includeTime` or `endDate`, on the attribute and on each date property it
|
|
238
|
-
* qualifies an edge with.
|
|
239
|
-
*/
|
|
240
|
-
export declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
241
|
-
path: PropertyKey[];
|
|
242
|
-
message: string;
|
|
243
|
-
}[];
|
|
244
|
-
/**
|
|
245
|
-
* Map of attribute type to config schema
|
|
246
|
-
*/
|
|
247
|
-
export declare const attributeConfigSchemas: Record<AttributeType, z$2.ZodObject<z$2.ZodRawShape>>;
|
|
248
|
-
/**
|
|
249
|
-
* Get the config schema for a specific attribute type
|
|
250
|
-
*/
|
|
251
|
-
export declare function getAttributeConfigSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
252
|
-
/**
|
|
253
|
-
* Validate and strip unknown properties from attribute config
|
|
254
|
-
* This ensures only allowed properties are stored in the database
|
|
255
|
-
*/
|
|
256
|
-
export declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
257
|
-
/**
|
|
258
|
-
* The config contract as a WRITE applies it: the stored schema plus the
|
|
259
|
-
* stricter option and icon rules newly written values must satisfy.
|
|
260
|
-
*/
|
|
261
|
-
export declare function getAttributeConfigWriteSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
262
|
-
/**
|
|
263
|
-
* Strict parser for newly created attribute definitions.
|
|
264
|
-
*
|
|
265
|
-
* Top-level config remains strip-compatible with the historical config
|
|
266
|
-
* contract, while newly written icons and select-like option objects are
|
|
267
|
-
* validated strictly.
|
|
268
|
-
*/
|
|
269
|
-
export declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
270
|
-
/**
|
|
271
|
-
* Patch-aware parser for persisted attributes.
|
|
272
|
-
*
|
|
273
|
-
* An explicit options patch owns and strictly validates the complete new
|
|
274
|
-
* list. Omission means the stored legacy list is preserved without
|
|
275
|
-
* reconstruction, including options that predate required colours/groups.
|
|
276
|
-
*/
|
|
277
|
-
export declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
-
//#endregion
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { ObjectImage, RecordAppearance } from "./objects-DxEMaC2Z.mjs";
|
|
3
|
-
import { Attribute, AttributeType } from "./attributes-eqr1vdPP.mjs";
|
|
4
|
-
import * as z$2 from "zod";
|
|
5
|
-
import { ColorId, IconName } from "@standards/constants";
|
|
6
|
-
//#region src/types/mutations.d.ts
|
|
7
|
-
export interface AddAttributeInput {
|
|
8
|
-
name: string;
|
|
9
|
-
label: string;
|
|
10
|
-
type: AttributeType;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
unique?: boolean;
|
|
13
|
-
description?: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
icon?: IconName;
|
|
16
|
-
defaultValue?: unknown;
|
|
17
|
-
metadata?: Record<string, unknown>;
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
}
|
|
20
|
-
export interface CreateCustomObjectInput {
|
|
21
|
-
name: string;
|
|
22
|
-
label: string;
|
|
23
|
-
pluralLabel?: string;
|
|
24
|
-
labelExpression: string;
|
|
25
|
-
embeddingExpression?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
icon?: IconName;
|
|
28
|
-
color?: ColorId;
|
|
29
|
-
image?: ObjectImage;
|
|
30
|
-
attributes?: (Attribute | {
|
|
31
|
-
build: () => Attribute;
|
|
32
|
-
})[];
|
|
33
|
-
metadata?: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
export interface UpdateObjectInput {
|
|
36
|
-
label?: string;
|
|
37
|
-
pluralLabel?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
icon?: IconName;
|
|
40
|
-
/** `null` clears it: the colour then derives from the object name. */
|
|
41
|
-
color?: ColorId | null;
|
|
42
|
-
/** `null` clears it: record images then crop to a square, and are found nowhere. */
|
|
43
|
-
image?: ObjectImage | null;
|
|
44
|
-
labelExpression?: string;
|
|
45
|
-
embeddingExpression?: string;
|
|
46
|
-
metadata?: Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
export interface RelationOption {
|
|
49
|
-
id: string;
|
|
50
|
-
objectId: string;
|
|
51
|
-
objectName: string;
|
|
52
|
-
objectLabel: string;
|
|
53
|
-
objectIcon?: string;
|
|
54
|
-
objectColor?: ColorId;
|
|
55
|
-
/** How the target object crops its records' images: all an option needs of its image settings. */
|
|
56
|
-
objectImage?: Pick<ObjectImage, "shape">;
|
|
57
|
-
/** The target record's own icon / image; absent when it has neither. */
|
|
58
|
-
appearance?: RecordAppearance;
|
|
59
|
-
label: string;
|
|
60
|
-
}
|
|
61
|
-
export interface RelationOptionsResponse {
|
|
62
|
-
options: RelationOption[];
|
|
63
|
-
hasMore: boolean;
|
|
64
|
-
total: number;
|
|
65
|
-
nextOffset?: number;
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/validation/config/schemas.d.ts
|
|
69
|
-
/**
|
|
70
|
-
* `baseConfigSchema`'s keys — the model never sets these directly, and the
|
|
71
|
-
* prompt (`attribute-reference.ts`'s `BASE_CONFIG_KEYS`) already hides them
|
|
72
|
-
* from every `<attribute_types>` line. `ADD_ATTRIBUTE_WIRE` omits them from
|
|
73
|
-
* each per-type wire config for the same reason, so the wire never offers a
|
|
74
|
-
* key the model was never told about — and never exposes `metadata`, the one
|
|
75
|
-
* genuine open record among them, on the wire. Single source: the runtime
|
|
76
|
-
* prompt imports this instead of keeping its own copy.
|
|
77
|
-
*/
|
|
78
|
-
export declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
79
|
-
/**
|
|
80
|
-
* The omitted base keys one attribute type's wire offers back, each with the
|
|
81
|
-
* wire schema it is validated by. Karl's ruling on #4537 (2026-09-27, «
|
|
82
|
-
* Relations seulement »): a relation field takes its own icon, a catalogue
|
|
83
|
-
* name the agent finds with `search_icons`, exactly as an object icon; every
|
|
84
|
-
* other type keeps `icon` omitted. Single source for the wire
|
|
85
|
-
* (`ADD_ATTRIBUTE_WIRE`) and the prompt (`attribute-reference.ts`), so the
|
|
86
|
-
* key the model is told about is the key the wire accepts.
|
|
87
|
-
*/
|
|
88
|
-
export declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$2.ZodType>>>>;
|
|
89
|
-
/** The keys hidden from `attributeType`'s wire config and its prompt line. */
|
|
90
|
-
export declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
91
|
-
/** `omit()` mask of the type keys hidden from `attributeType`'s wire. */
|
|
92
|
-
export declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
93
|
-
/**
|
|
94
|
-
* Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
|
|
95
|
-
* than the one sent.
|
|
96
|
-
*
|
|
97
|
-
* Two wire shapes merge several types into one member for size — the nine
|
|
98
|
-
* simple attribute types of `ADD_ATTRIBUTE_WIRE`, and the seven simple
|
|
99
|
-
* qualified-property types below — so a merged member structurally accepts
|
|
100
|
-
* every merged type's keys. Without this, a `text`-only `format` sent on a
|
|
101
|
-
* `number` parses and is then silently `.strip()`-ped at store: a key lost
|
|
102
|
-
* with no feedback. Checked against the SENT type, and the message names the
|
|
103
|
-
* keys that type does accept so the next call is right. One factory rather
|
|
104
|
-
* than two near-identical loops — the second one drifted first.
|
|
105
|
-
*/
|
|
106
|
-
export 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$2.RefinementCtx, path?: readonly string[]) => void;
|
|
107
|
-
export declare const statusGroupSchema: z$2.ZodEnum<{
|
|
108
|
-
idle: "idle";
|
|
109
|
-
in_progress: "in_progress";
|
|
110
|
-
finished: "finished";
|
|
111
|
-
}>;
|
|
112
|
-
export declare const selectOptionWriteSchema: z$2.ZodObject<{
|
|
113
|
-
value: z$2.ZodString;
|
|
114
|
-
label: z$2.ZodString;
|
|
115
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
116
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
117
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
118
|
-
color: z$2.ZodEnum<{
|
|
119
|
-
stone: "stone";
|
|
120
|
-
clay: "clay";
|
|
121
|
-
brick: "brick";
|
|
122
|
-
terra: "terra";
|
|
123
|
-
ochre: "ochre";
|
|
124
|
-
moss: "moss";
|
|
125
|
-
sage: "sage";
|
|
126
|
-
lagoon: "lagoon";
|
|
127
|
-
ink: "ink";
|
|
128
|
-
iris: "iris";
|
|
129
|
-
peony: "peony";
|
|
130
|
-
}>;
|
|
131
|
-
}, z$2.core.$strict>;
|
|
132
|
-
export declare const multiselectOptionWriteSchema: z$2.ZodObject<{
|
|
133
|
-
value: z$2.ZodString;
|
|
134
|
-
label: z$2.ZodString;
|
|
135
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
136
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
137
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
138
|
-
color: z$2.ZodEnum<{
|
|
139
|
-
stone: "stone";
|
|
140
|
-
clay: "clay";
|
|
141
|
-
brick: "brick";
|
|
142
|
-
terra: "terra";
|
|
143
|
-
ochre: "ochre";
|
|
144
|
-
moss: "moss";
|
|
145
|
-
sage: "sage";
|
|
146
|
-
lagoon: "lagoon";
|
|
147
|
-
ink: "ink";
|
|
148
|
-
iris: "iris";
|
|
149
|
-
peony: "peony";
|
|
150
|
-
}>;
|
|
151
|
-
}, z$2.core.$strict>;
|
|
152
|
-
export declare const statusOptionWriteSchema: z$2.ZodObject<{
|
|
153
|
-
value: z$2.ZodString;
|
|
154
|
-
label: z$2.ZodString;
|
|
155
|
-
description: z$2.ZodOptional<z$2.ZodString>;
|
|
156
|
-
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
157
|
-
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
158
|
-
color: z$2.ZodEnum<{
|
|
159
|
-
stone: "stone";
|
|
160
|
-
clay: "clay";
|
|
161
|
-
brick: "brick";
|
|
162
|
-
terra: "terra";
|
|
163
|
-
ochre: "ochre";
|
|
164
|
-
moss: "moss";
|
|
165
|
-
sage: "sage";
|
|
166
|
-
lagoon: "lagoon";
|
|
167
|
-
ink: "ink";
|
|
168
|
-
iris: "iris";
|
|
169
|
-
peony: "peony";
|
|
170
|
-
}>;
|
|
171
|
-
group: z$2.ZodEnum<{
|
|
172
|
-
idle: "idle";
|
|
173
|
-
in_progress: "in_progress";
|
|
174
|
-
finished: "finished";
|
|
175
|
-
}>;
|
|
176
|
-
}, z$2.core.$strict>;
|
|
177
|
-
/**
|
|
178
|
-
* Drops, from every option of an attribute config or body, the keys
|
|
179
|
-
* `optionSchema` does not know — typically an `id` the code builder accepted
|
|
180
|
-
* without complaint (#4356). Sync stores options through it, and the schema
|
|
181
|
-
* state reads them through it, so one stale key no longer 400s the whole state.
|
|
182
|
-
* The options of a `relation()`/`document()`'s `.qualifyWith()` properties are
|
|
183
|
-
* validated by the same schema, so each property definition goes through it too.
|
|
184
|
-
*
|
|
185
|
-
* Order is kept, and a config with nothing to drop is returned as is. A list
|
|
186
|
-
* or option that is not the expected shape is left for strict validation to
|
|
187
|
-
* refuse.
|
|
188
|
-
*/
|
|
189
|
-
export declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
190
|
-
/**
|
|
191
|
-
* Property types whose config differs from `baseConfigSchema` only by
|
|
192
|
-
* independent optional scalars — no options array, no relation targets. Same
|
|
193
|
-
* shape as `SIMPLE_ATTRIBUTE_TYPES` in `architect/operations/schema.ts` minus
|
|
194
|
-
* `richtext`/`user` (not valid property types) — none of these seven types'
|
|
195
|
-
* keys collide, proven by `tests/validation/config/property-config.test.ts`.
|
|
196
|
-
* Merged into one wire member for the same reason `ADD_ATTRIBUTE_WIRE` merges
|
|
197
|
-
* its nine: the model reads one shape instead of seven near-identical ones,
|
|
198
|
-
* and this is also what keeps a qualified relation/document's `add_attribute`
|
|
199
|
-
* leaf under its wire-size cap (`tests/architect/wire-schema-size.test.ts`) —
|
|
200
|
-
* ten separate members, each paying its own JSON Schema object/`$defs`
|
|
201
|
-
* boilerplate, blew the budget even after the base config keys were omitted.
|
|
202
|
-
*/
|
|
203
|
-
export declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
-
export declare const propertyAttributeSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
205
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
206
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
207
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
208
|
-
}>, z$2.core.$strip>[]], "type">;
|
|
209
|
-
export declare const propertySchemaSchema: z$2.ZodObject<{
|
|
210
|
-
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
211
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
212
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
213
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
214
|
-
}>, z$2.core.$strip>[]], "type">>;
|
|
215
|
-
}, z$2.core.$strip>;
|
|
216
|
-
/**
|
|
217
|
-
* The wire-facing property union, derived from the stored one: the same seven
|
|
218
|
-
* simple types merged into one member, the option-carrying types alongside,
|
|
219
|
-
* everything the model never sets omitted, and `.strict()` so an invented key
|
|
220
|
-
* is refused by name instead of silently stripped at store.
|
|
221
|
-
*/
|
|
222
|
-
export declare const propertyAttributeWireSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
223
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
224
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
225
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
226
|
-
}>, z$2.core.$strip>[]], "type">;
|
|
227
|
-
export declare const propertySchemaWireSchema: z$2.ZodObject<{
|
|
228
|
-
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
229
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
230
|
-
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
231
|
-
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
232
|
-
}>, z$2.core.$strip>[]], "type">>;
|
|
233
|
-
}, z$2.core.$strict>;
|
|
234
|
-
/**
|
|
235
|
-
* A month or a year has no time of day and no range end to pair with in this
|
|
236
|
-
* slice (#5325): `precision` narrower than a day is refused beside
|
|
237
|
-
* `includeTime` or `endDate`, on the attribute and on each date property it
|
|
238
|
-
* qualifies an edge with.
|
|
239
|
-
*/
|
|
240
|
-
export declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
241
|
-
path: PropertyKey[];
|
|
242
|
-
message: string;
|
|
243
|
-
}[];
|
|
244
|
-
/**
|
|
245
|
-
* Map of attribute type to config schema
|
|
246
|
-
*/
|
|
247
|
-
export declare const attributeConfigSchemas: Record<AttributeType, z$2.ZodObject<z$2.ZodRawShape>>;
|
|
248
|
-
/**
|
|
249
|
-
* Get the config schema for a specific attribute type
|
|
250
|
-
*/
|
|
251
|
-
export declare function getAttributeConfigSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
252
|
-
/**
|
|
253
|
-
* Validate and strip unknown properties from attribute config
|
|
254
|
-
* This ensures only allowed properties are stored in the database
|
|
255
|
-
*/
|
|
256
|
-
export declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
257
|
-
/**
|
|
258
|
-
* The config contract as a WRITE applies it: the stored schema plus the
|
|
259
|
-
* stricter option and icon rules newly written values must satisfy.
|
|
260
|
-
*/
|
|
261
|
-
export declare function getAttributeConfigWriteSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
262
|
-
/**
|
|
263
|
-
* Strict parser for newly created attribute definitions.
|
|
264
|
-
*
|
|
265
|
-
* Top-level config remains strip-compatible with the historical config
|
|
266
|
-
* contract, while newly written icons and select-like option objects are
|
|
267
|
-
* validated strictly.
|
|
268
|
-
*/
|
|
269
|
-
export declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
270
|
-
/**
|
|
271
|
-
* Patch-aware parser for persisted attributes.
|
|
272
|
-
*
|
|
273
|
-
* An explicit options patch owns and strictly validates the complete new
|
|
274
|
-
* list. Omission means the stored legacy list is preserved without
|
|
275
|
-
* reconstruction, including options that predate required colours/groups.
|
|
276
|
-
*/
|
|
277
|
-
export declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
-
//#endregion
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=[`fyi`,`task`,`question`,`handoff`,`system`],t=[`low`,`normal`,`high`,`urgent`],n={low:0,normal:1,high:2,urgent:3},r=[`public`,`internal`,`sensitive`],i=[`unread`,`read`,`archived`,`snoozed`],a=[`none`,`pending`,`processing`,`completed`,`dismissed`,`expired`,`failed`],o=`agent.session.waiting_human`,s=`agent.task.assigned`,c=`agent.question.requested`,l=`agent.routine_run.failed`,u=`agent.routine_run.notice`,d=`connector.connection.reauth_required`,f=`connector.connection.error`,p=`record.assigned`,m=`access.granted`,h=[o,s,c,l,u,d,f,p,m],g=[`task`,`question`,`handoff`];function isActionableNotificationKind(e){return g.includes(e)}const _=[`agents`,`connectors`,`assignment`,`sharing`],v={[o]:{kind:`question`,area:`agents`},[s]:{kind:`task`,area:null},[c]:{kind:`question`,area:null},[l]:{kind:`system`,area:`agents`},[u]:{kind:`fyi`,area:`agents`},[d]:{kind:`system`,area:`connectors`},[f]:{kind:`system`,area:`connectors`},[p]:{kind:`fyi`,area:`assignment`},[m]:{kind:`fyi`,area:`sharing`}},y=[`in_app`,`email`],b={agentSession:`agent_session`,agent:`agent`,routine:`routine`,record:`record`,page:`page`},x=[`count`,`sum`,`avg`,`min`,`max`],S=[`day`,`week`,`month`,`quarter`,`year`];Object.defineProperty(exports,"ACTIONABLE_NOTIFICATION_KINDS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"AGGREGATE_BUCKETS",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"AGGREGATE_MEASURES",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"MAX_AGGREGATE_GROUPS",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"NOTIFICATION_CHANNELS",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"NOTIFICATION_INBOX_STATES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"NOTIFICATION_KINDS",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"NOTIFICATION_PRIORITIES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"NOTIFICATION_PRIORITY_RANK",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"NOTIFICATION_SENSITIVITIES",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"NOTIFICATION_SETTINGS_AREAS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"NOTIFICATION_SUBJECT_TYPES",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"NOTIFICATION_TYPES_V1",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_ACCESS_GRANTED",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_KINDS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"NOTIFICATION_TYPE_RECORD_ASSIGNED",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"NOTIFICATION_WORK_STATES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"isActionableNotificationKind",{enumerable:!0,get:function(){return isActionableNotificationKind}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=[`fyi`,`task`,`question`,`handoff`,`system`],t=[`low`,`normal`,`high`,`urgent`],n={low:0,normal:1,high:2,urgent:3},r=[`public`,`internal`,`sensitive`],i=[`unread`,`read`,`archived`,`snoozed`],a=[`none`,`pending`,`processing`,`completed`,`dismissed`,`expired`,`failed`],o=`agent.session.waiting_human`,s=`agent.task.assigned`,c=`agent.question.requested`,l=`agent.routine_run.failed`,u=`agent.routine_run.notice`,d=`connector.connection.reauth_required`,f=`connector.connection.error`,p=`record.assigned`,m=`access.granted`,h=[o,s,c,l,u,d,f,p,m],g=[`task`,`question`,`handoff`];function isActionableNotificationKind(e){return g.includes(e)}const _=[`agents`,`connectors`,`assignment`,`sharing`],v={[o]:{kind:`question`,area:`agents`},[s]:{kind:`task`,area:null},[c]:{kind:`question`,area:null},[l]:{kind:`system`,area:`agents`},[u]:{kind:`fyi`,area:`agents`},[d]:{kind:`system`,area:`connectors`},[f]:{kind:`system`,area:`connectors`},[p]:{kind:`fyi`,area:`assignment`},[m]:{kind:`fyi`,area:`sharing`}},y=[`in_app`,`email`],b={agentSession:`agent_session`,agent:`agent`,routine:`routine`,record:`record`,page:`page`},x=100,S=[`count`,`sum`,`avg`,`min`,`max`],C=[`day`,`week`,`month`,`quarter`,`year`];export{g as ACTIONABLE_NOTIFICATION_KINDS,C as AGGREGATE_BUCKETS,S as AGGREGATE_MEASURES,x as MAX_AGGREGATE_GROUPS,y as NOTIFICATION_CHANNELS,i as NOTIFICATION_INBOX_STATES,e as NOTIFICATION_KINDS,t as NOTIFICATION_PRIORITIES,n as NOTIFICATION_PRIORITY_RANK,r as NOTIFICATION_SENSITIVITIES,_ as NOTIFICATION_SETTINGS_AREAS,b as NOTIFICATION_SUBJECT_TYPES,h as NOTIFICATION_TYPES_V1,m as NOTIFICATION_TYPE_ACCESS_GRANTED,c as NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED,l as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED,u as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE,o as NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN,s as NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED,f as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR,d as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED,v as NOTIFICATION_TYPE_KINDS,p as NOTIFICATION_TYPE_RECORD_ASSIGNED,a as NOTIFICATION_WORK_STATES,isActionableNotificationKind};
|