@standards/schema 1.0.0-alpha.409 → 1.0.0-alpha.410
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-B606hHr3.mjs +2 -0
- package/dist/{all-BSKNqzGh.d.mts → all-B802p9b-.d.mts} +3 -3
- package/dist/all-C-dQf23e.js +2 -0
- package/dist/{all-BwAwSr3s.d.ts → all-CbM6xRtw.d.ts} +3 -3
- package/dist/api/index.d.mts +247 -150
- package/dist/api/index.d.ts +247 -150
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/{config-BWgga8mu.js → config-YSw2jzWj.js} +1 -1
- package/dist/{config-BwshhFai.mjs → config-iUwnquKr.mjs} +1 -1
- package/dist/{index-CXO6_OVC.d.ts → index-BDMlzqIt.d.ts} +1 -1
- package/dist/{index-qj0Sxls-.d.ts → index-CFSSj05K.d.ts} +1 -1
- package/dist/{index-QZR1nwQt.d.mts → index-Ckbiu3d9.d.mts} +1 -1
- package/dist/{index-BDkw6z3G.d.mts → index-CpWy2-oS.d.mts} +1 -1
- package/dist/{index-DDCXoccV.d.mts → index-DeUkwS45.d.mts} +117 -36
- package/dist/{index-BJwJSvSN.d.ts → index-ayjc-chp.d.ts} +117 -36
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{objects-CfWCm1OL.d.ts → objects-Bt5C4BNO.d.ts} +6 -1
- package/dist/{objects-C9F-MirX.d.mts → objects-Ddi_zEYp.d.mts} +6 -1
- package/dist/{primitives-D9A6pmXV.mjs → primitives-BCJLtpaI.mjs} +1 -1
- package/dist/{primitives-BBtVhLdq.js → primitives-CVbrjJ24.js} +1 -1
- package/dist/record-aggregates-Cl_62tuW.mjs +2 -0
- package/dist/record-aggregates-eFfvQOzG.js +2 -0
- package/dist/record-operation-CyVr9RBO.js +2 -0
- package/dist/record-operation-prlqtHAm.mjs +2 -0
- package/dist/validation/all.d.mts +3 -3
- package/dist/validation/all.d.ts +3 -3
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- 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/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/all-DoPwVWIX.js +0 -2
- package/dist/all-FfziiXML.mjs +0 -2
- package/dist/record-aggregates-Bhi1lCSm.js +0 -2
- package/dist/record-aggregates-DEBOOgA0.mjs +0 -2
- package/dist/record-operation-B9XPdpM4.js +0 -2
- package/dist/record-operation-DR_4hSNA.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");const n=require("./primitives-BBtVhLdq.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={icon:n.iconNameSchema.optional().describe(`Field icon from search_icons`)},c={date:[`precision`],user:[`notifiesOnAssign`,`actors`]};function wireOmittedConfigKeysFor(e){return[...o,...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=l.extend({color:n.colorIdSchema,group:u}).strict(),p=l.extend({color:r.string().optional().describe(`A color id`),group:u.optional()}).strict(),m=new Set(p.keyof().options),h=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let r of h){let i=e[r];if(!Array.isArray(i))continue;let a=!1,o=i.map(e=>!n.isPlainRecord(e)||Object.keys(e).every(e=>m.has(e))?e:(a=!0,Object.fromEntries(Object.entries(e).filter(([e])=>m.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 g=r.array(p).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 _=writeOptionsArraySchema(d),v=writeOptionsArraySchema(d),y=writeOptionsArraySchema(f),b=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`)}),x=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`)}),S=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`)}),C=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()}),w=a,T=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()}),E=a,D=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()}),O=a.extend({defaultCountryCode:r.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),k=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()}),A=a.extend({options:g.describe(`The workflow statuses, in order`)}),j=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()}),M=a.extend({options:g.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),N=a.extend({options:g.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),P=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`),actors:r.boolean().optional().describe(`Whether the value holds actor ids, named by each actor's current name`)}),F={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()},I={id:r.string().optional(),objectId:r.string().optional(),system:r.boolean().optional(),unique:r.boolean().optional()},L=Object.fromEntries(o.map(e=>[e,!0])),R=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],z=[...R,`select`,`multiselect`,`status`],B={text:C,number:T,checkbox:E,date:D,phone:O,currency:k,location:j,select:M,multiselect:N,status:A},V={...B,select:M.extend({options:_.describe(`Options`)}),multiselect:N.extend({options:v.describe(`Options`)}),status:A.extend({options:y.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>V[e].omit(L).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>r.object({...F,...I,type:r.literal(e).describe(`Property type`),...B[e].shape}).strip(),H=r.discriminatedUnion(`type`,z.map(storedPropertyMember)),U=r.object({definitions:r.array(H).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`),W=refuseForeignKeys(Object.fromEntries(z.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(F),`type`]);function refuseForeignPropertyKeys(e,t){W(e.type,e,t)}const G=R.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>r.object({...F,type:e.length===1?r.literal(e[0]).describe(`Property type`):r.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),K=r.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),r.object({...F,type:r.enum(R).describe(`Property type`),...G}).strict().superRefine(refuseForeignPropertyKeys)]),q=r.object({definitions:r.array(K).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`),J=a.extend({targets:r.array(b).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:x.optional().describe(`Syncs the other side's attribute`),properties:U.optional()}),Y=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:S.optional().describe(`Mirrors an option set`)}),X=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(p).optional().describe(`Server-set`),targetCurrencyCode:r.string().length(3).optional().describe(`Server-set`),optionsSource:S.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 Z={text:C,richtext:w,number:T,checkbox:E,date:D,phone:O,currency:k,status:A,location:j,select:M,multiselect:N,user:P,relation:J,formula:Y,rollup:X,document:a.extend({properties:U.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=Z[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:_.describe(`Options`)});case`multiselect`:return t.extend({options:v.describe(`Options`)});case`status`:return t.extend({options:y.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 R}}),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 Z}}),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,"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 H}}),Object.defineProperty(exports,"propertyAttributeWireSchema",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"propertySchemaSchema",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"propertySchemaWireSchema",{enumerable:!0,get:function(){return q}}),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 f}}),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}});
|
|
2
|
+
const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");const n=require("./primitives-CVbrjJ24.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={icon:n.iconNameSchema.optional().describe(`Field icon from search_icons`)},c={date:[`precision`],user:[`notifiesOnAssign`,`actors`]};function wireOmittedConfigKeysFor(e){return[...o,...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=l.extend({color:n.colorIdSchema,group:u}).strict(),p=l.extend({color:r.string().optional().describe(`A color id`),group:u.optional()}).strict(),m=new Set(p.keyof().options),h=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let r of h){let i=e[r];if(!Array.isArray(i))continue;let a=!1,o=i.map(e=>!n.isPlainRecord(e)||Object.keys(e).every(e=>m.has(e))?e:(a=!0,Object.fromEntries(Object.entries(e).filter(([e])=>m.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 g=r.array(p).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 _=writeOptionsArraySchema(d),v=writeOptionsArraySchema(d),y=writeOptionsArraySchema(f),b=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`)}),x=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`)}),S=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`)}),C=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()}),w=a,T=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()}),E=a,D=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()}),O=a.extend({defaultCountryCode:r.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),k=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()}),A=a.extend({options:g.describe(`The workflow statuses, in order`)}),j=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()}),M=a.extend({options:g.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),N=a.extend({options:g.describe(`Options`),renderAs:r.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),P=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`),actors:r.boolean().optional().describe(`Whether the value holds actor ids, named by each actor's current name`)}),F={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()},I={id:r.string().optional(),objectId:r.string().optional(),system:r.boolean().optional(),unique:r.boolean().optional()},L=Object.fromEntries(o.map(e=>[e,!0])),R=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],z=[...R,`select`,`multiselect`,`status`],B={text:C,number:T,checkbox:E,date:D,phone:O,currency:k,location:j,select:M,multiselect:N,status:A},V={...B,select:M.extend({options:_.describe(`Options`)}),multiselect:N.extend({options:v.describe(`Options`)}),status:A.extend({options:y.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>V[e].omit(L).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>r.object({...F,...I,type:r.literal(e).describe(`Property type`),...B[e].shape}).strip(),H=r.discriminatedUnion(`type`,z.map(storedPropertyMember)),U=r.object({definitions:r.array(H).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`),W=refuseForeignKeys(Object.fromEntries(z.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(F),`type`]);function refuseForeignPropertyKeys(e,t){W(e.type,e,t)}const G=R.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>r.object({...F,type:e.length===1?r.literal(e[0]).describe(`Property type`):r.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),K=r.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),r.object({...F,type:r.enum(R).describe(`Property type`),...G}).strict().superRefine(refuseForeignPropertyKeys)]),q=r.object({definitions:r.array(K).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`),J=a.extend({targets:r.array(b).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:x.optional().describe(`Syncs the other side's attribute`),properties:U.optional()}),Y=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:S.optional().describe(`Mirrors an option set`)}),X=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(p).optional().describe(`Server-set`),targetCurrencyCode:r.string().length(3).optional().describe(`Server-set`),optionsSource:S.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 Z={text:C,richtext:w,number:T,checkbox:E,date:D,phone:O,currency:k,status:A,location:j,select:M,multiselect:N,user:P,relation:J,formula:Y,rollup:X,document:a.extend({properties:U.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=Z[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:_.describe(`Options`)});case`multiselect`:return t.extend({options:v.describe(`Options`)});case`status`:return t.extend({options:y.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 R}}),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 Z}}),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,"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 H}}),Object.defineProperty(exports,"propertyAttributeWireSchema",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"propertySchemaSchema",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"propertySchemaWireSchema",{enumerable:!0,get:function(){return q}}),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 f}}),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}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
import{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"./primitives-D9A6pmXV.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`],ee={icon:i.optional().describe(`Field icon from search_icons`)},u={date:[`precision`],user:[`notifiesOnAssign`,`actors`]};function wireOmittedConfigKeysFor(e){return[...l,...u[e]??[]]}function wireHiddenTypeConfigMask(e){return Object.fromEntries((u[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 d=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()}),f=o.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),p=d.extend({color:r}).strict(),m=d.extend({color:r,group:f}).strict(),h=d.extend({color:o.string().optional().describe(`A color id`),group:f.optional()}).strict(),g=new Set(h.keyof().options),_=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let n of _){let r=e[n];if(!Array.isArray(r))continue;let i=!1,o=r.map(e=>!a(e)||Object.keys(e).every(e=>g.has(e))?e:(i=!0,Object.fromEntries(Object.entries(e).filter(([e])=>g.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 v=o.array(h).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 y=writeOptionsArraySchema(p),b=writeOptionsArraySchema(p),x=writeOptionsArraySchema(m),S=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`)}),C=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`)}),w=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`)}),T=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()}),E=c,D=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()}),O=c,k=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()}),A=c.extend({defaultCountryCode:o.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),j=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()}),M=c.extend({options:v.describe(`The workflow statuses, in order`)}),N=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()}),P=c.extend({options:v.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),F=c.extend({options:v.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),I=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`),actors:o.boolean().optional().describe(`Whether the value holds actor ids, named by each actor's current name`)}),L={name:t.describe(`Property API name`),label:o.string().min(1).describe(`Label people see`),required:o.boolean().describe(`Required on every edge`).optional()},R={id:o.string().optional(),objectId:o.string().optional(),system:o.boolean().optional(),unique:o.boolean().optional()},z=Object.fromEntries(l.map(e=>[e,!0])),B=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],V=[...B,`select`,`multiselect`,`status`],H={text:T,number:D,checkbox:O,date:k,phone:A,currency:j,location:N,select:P,multiselect:F,status:M},U={...H,select:P.extend({options:y.describe(`Options`)}),multiselect:F.extend({options:b.describe(`Options`)}),status:M.extend({options:x.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>U[e].omit(z).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>o.object({...L,...R,type:o.literal(e).describe(`Property type`),...H[e].shape}).strip(),W=o.discriminatedUnion(`type`,V.map(storedPropertyMember)),G=o.object({definitions:o.array(W).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),K=refuseForeignKeys(Object.fromEntries(V.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(L),`type`]);function refuseForeignPropertyKeys(e,t){K(e.type,e,t)}const q=B.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>o.object({...L,type:e.length===1?o.literal(e[0]).describe(`Property type`):o.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),J=o.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),o.object({...L,type:o.enum(B).describe(`Property type`),...q}).strict().superRefine(refuseForeignPropertyKeys)]),Y=o.object({definitions:o.array(J).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),X=c.extend({targets:o.array(S).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:C.optional().describe(`Syncs the other side's attribute`),properties:G.optional()}),Z=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:w.optional().describe(`Mirrors an option set`)}),Q=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(h).optional().describe(`Server-set`),targetCurrencyCode:o.string().length(3).optional().describe(`Server-set`),optionsSource:w.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:T,richtext:E,number:D,checkbox:O,date:k,phone:A,currency:j,status:M,location:N,select:P,multiselect:F,user:I,relation:X,formula:Z,rollup:Q,document:c.extend({properties:G.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:y.describe(`Options`)});case`multiselect`:return t.extend({options:b.describe(`Options`)});case`status`:return t.extend({options:x.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,B as SIMPLE_PROPERTY_TYPES,ee as WIRE_OFFERED_BASE_CONFIG,l as WIRE_OMITTED_CONFIG_KEYS,$ as attributeConfigSchemas,datePrecisionIssues,getAttributeConfigSchema,getAttributeConfigWriteSchema,parseAttributeConfig,parseAttributeConfigForCreate,parseAttributeConfigForUpdate,W as propertyAttributeSchema,J as propertyAttributeWireSchema,G as propertySchemaSchema,Y as propertySchemaWireSchema,refuseForeignKeys,p as selectOptionWriteSchema,f as statusGroupSchema,m as statusOptionWriteSchema,wireHiddenTypeConfigMask,wireOmittedConfigKeysFor,withoutUnknownOptionKeys};
|
|
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"./primitives-BCJLtpaI.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`],ee={icon:i.optional().describe(`Field icon from search_icons`)},u={date:[`precision`],user:[`notifiesOnAssign`,`actors`]};function wireOmittedConfigKeysFor(e){return[...l,...u[e]??[]]}function wireHiddenTypeConfigMask(e){return Object.fromEntries((u[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 d=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()}),f=o.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),p=d.extend({color:r}).strict(),m=d.extend({color:r,group:f}).strict(),h=d.extend({color:o.string().optional().describe(`A color id`),group:f.optional()}).strict(),g=new Set(h.keyof().options),_=[`options`,`targetAttributeOptions`];function withoutUnknownOptionKeys(e){let t=e;for(let n of _){let r=e[n];if(!Array.isArray(r))continue;let i=!1,o=r.map(e=>!a(e)||Object.keys(e).every(e=>g.has(e))?e:(i=!0,Object.fromEntries(Object.entries(e).filter(([e])=>g.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 v=o.array(h).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 y=writeOptionsArraySchema(p),b=writeOptionsArraySchema(p),x=writeOptionsArraySchema(m),S=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`)}),C=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`)}),w=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`)}),T=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()}),E=c,D=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()}),O=c,k=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()}),A=c.extend({defaultCountryCode:o.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),j=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()}),M=c.extend({options:v.describe(`The workflow statuses, in order`)}),N=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()}),P=c.extend({options:v.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),F=c.extend({options:v.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),I=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`),actors:o.boolean().optional().describe(`Whether the value holds actor ids, named by each actor's current name`)}),L={name:t.describe(`Property API name`),label:o.string().min(1).describe(`Label people see`),required:o.boolean().describe(`Required on every edge`).optional()},R={id:o.string().optional(),objectId:o.string().optional(),system:o.boolean().optional(),unique:o.boolean().optional()},z=Object.fromEntries(l.map(e=>[e,!0])),B=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],V=[...B,`select`,`multiselect`,`status`],H={text:T,number:D,checkbox:O,date:k,phone:A,currency:j,location:N,select:P,multiselect:F,status:M},U={...H,select:P.extend({options:y.describe(`Options`)}),multiselect:F.extend({options:b.describe(`Options`)}),status:M.extend({options:x.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>U[e].omit(z).omit(wireHiddenTypeConfigMask(e)).shape,storedPropertyMember=e=>o.object({...L,...R,type:o.literal(e).describe(`Property type`),...H[e].shape}).strip(),W=o.discriminatedUnion(`type`,V.map(storedPropertyMember)),G=o.object({definitions:o.array(W).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),K=refuseForeignKeys(Object.fromEntries(V.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(L),`type`]);function refuseForeignPropertyKeys(e,t){K(e.type,e,t)}const q=B.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>o.object({...L,type:e.length===1?o.literal(e[0]).describe(`Property type`):o.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),J=o.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),o.object({...L,type:o.enum(B).describe(`Property type`),...q}).strict().superRefine(refuseForeignPropertyKeys)]),Y=o.object({definitions:o.array(J).min(1).max(n.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),X=c.extend({targets:o.array(S).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:C.optional().describe(`Syncs the other side's attribute`),properties:G.optional()}),Z=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:w.optional().describe(`Mirrors an option set`)}),Q=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(h).optional().describe(`Server-set`),targetCurrencyCode:o.string().length(3).optional().describe(`Server-set`),optionsSource:w.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:T,richtext:E,number:D,checkbox:O,date:k,phone:A,currency:j,status:M,location:N,select:P,multiselect:F,user:I,relation:X,formula:Z,rollup:Q,document:c.extend({properties:G.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:y.describe(`Options`)});case`multiselect`:return t.extend({options:b.describe(`Options`)});case`status`:return t.extend({options:x.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,B as SIMPLE_PROPERTY_TYPES,ee as WIRE_OFFERED_BASE_CONFIG,l as WIRE_OMITTED_CONFIG_KEYS,$ as attributeConfigSchemas,datePrecisionIssues,getAttributeConfigSchema,getAttributeConfigWriteSchema,parseAttributeConfig,parseAttributeConfigForCreate,parseAttributeConfigForUpdate,W as propertyAttributeSchema,J as propertyAttributeWireSchema,G as propertySchemaSchema,Y as propertySchemaWireSchema,refuseForeignKeys,p as selectOptionWriteSchema,f as statusGroupSchema,m as statusOptionWriteSchema,wireHiddenTypeConfigMask,wireOmittedConfigKeysFor,withoutUnknownOptionKeys};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ObjectDefinition } from "./objects-
|
|
2
|
+
import { ObjectDefinition } from "./objects-Bt5C4BNO.js";
|
|
3
3
|
import { Attribute } from "./attributes-D4nvUmw6.js";
|
|
4
4
|
import { ValidationMessages, ValidationResult } from "./index-CCt_hCgK.js";
|
|
5
5
|
import * as z$2 from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ObjectImage, RecordAppearance } from "./objects-
|
|
2
|
+
import { ObjectImage, RecordAppearance } from "./objects-Bt5C4BNO.js";
|
|
3
3
|
import { Attribute, AttributeType } from "./attributes-D4nvUmw6.js";
|
|
4
4
|
import * as z$2 from "zod";
|
|
5
5
|
import { ColorId, IconName } from "@standards/constants";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ObjectDefinition } from "./objects-
|
|
2
|
+
import { ObjectDefinition } from "./objects-Ddi_zEYp.mjs";
|
|
3
3
|
import { Attribute } from "./attributes-BgPCTw3y.mjs";
|
|
4
4
|
import { ValidationMessages, ValidationResult } from "./index-B6XCKKgD.mjs";
|
|
5
5
|
import * as z$2 from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ObjectImage, RecordAppearance } from "./objects-
|
|
2
|
+
import { ObjectImage, RecordAppearance } from "./objects-Ddi_zEYp.mjs";
|
|
3
3
|
import { Attribute, AttributeType } from "./attributes-BgPCTw3y.mjs";
|
|
4
4
|
import * as z$2 from "zod";
|
|
5
5
|
import { ColorId, IconName } from "@standards/constants";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import { SchemaError, SchemaErrorCode, ValidationError } from "./exceptions-CmMd5DGH.mjs";
|
|
3
3
|
import { TenantId, Uuid } from "./utils-mBdW0zGZ.mjs";
|
|
4
|
-
import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, RecordListScope, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-
|
|
4
|
+
import { DocumentLayout, ImageShape, ListViewTabVisibility, ObjectDefinition, ObjectImage, ObjectRecord, RecordAppearance, RecordListScope, ResourceVisibility, Timestamps, ViewerAccess } from "./objects-Ddi_zEYp.mjs";
|
|
5
5
|
import { Attribute, AttributeType, BilateralConfig, CheckboxAttribute, Currency, CurrencyAttribute, DateAttribute, DatePrecision, DateRangeValue, DocumentAttribute, FormulaAttribute, FormulaReturnType, Location, LocationAttribute, LocationGranularity, MultiRelationAttribute, MultiselectAttribute, NumberAttribute, Option, Phone, PhoneAttribute, PropertyAttribute, PropertySchema, RelationAttribute, RelationTarget, RichtextAttribute, RollupAttribute, RollupFunction, SelectAttribute, SingleRelationAttribute, StatusAttribute, TextAttribute, TimeFormat, UserAttribute, UserReferenceType } from "./attributes-BgPCTw3y.mjs";
|
|
6
|
-
import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, QueryState, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, ViewRead, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-
|
|
7
|
-
import { UpdateObjectInput } from "./index-
|
|
6
|
+
import { ActivityContentDefinition, BLOCK_PERIODS, BlockContext, BlockDefinition, BlockInput, BlockWidth, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, CustomContentDefinition, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, GridPosition, GridViolation, HeightMode, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListableBlockInput, MeetingsContentDefinition, ObjectBuilderLike, ObjectViewContext, ObjectViewDefinition, PageContentDefinition, PageViewDefinition, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, QueryState, RecordMetadata, RecordQuery, RecordQueryDefinition, RelativeDateValue, RichtextContentDefinition, SortRule, ViewContentDefinition, ViewRead, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-B802p9b-.mjs";
|
|
7
|
+
import { UpdateObjectInput } from "./index-CpWy2-oS.mjs";
|
|
8
8
|
import * as z$2 from "zod";
|
|
9
9
|
import z, { z as z$1 } from "zod";
|
|
10
10
|
import { ColorId, CountryIso3, CurrencyCode, IconName, MimeType } from "@standards/constants";
|
|
@@ -517,11 +517,18 @@ export interface OperationUpload {
|
|
|
517
517
|
readonly maxCount: number;
|
|
518
518
|
readonly maxBytes?: number;
|
|
519
519
|
}
|
|
520
|
-
/**
|
|
521
|
-
|
|
520
|
+
/**
|
|
521
|
+
* The object an `objectPermission` applies to, and the action: the object a
|
|
522
|
+
* path parameter names (the record routes), or one fixed object (a route
|
|
523
|
+
* serving a single native object, such as `skills.*` on `skill`).
|
|
524
|
+
*/
|
|
525
|
+
export type OperationObjectPermission = {
|
|
522
526
|
readonly param: string;
|
|
523
527
|
readonly action: Action;
|
|
524
|
-
}
|
|
528
|
+
} | {
|
|
529
|
+
readonly object: string;
|
|
530
|
+
readonly action: Action;
|
|
531
|
+
};
|
|
525
532
|
/** One uploaded file as a handler receives it. */
|
|
526
533
|
export interface UploadedPart {
|
|
527
534
|
name: string;
|
|
@@ -574,8 +581,9 @@ export interface OperationDefinition {
|
|
|
574
581
|
body?: string;
|
|
575
582
|
/**
|
|
576
583
|
* The object-level permission of a record route: `action` on the object a
|
|
577
|
-
* path parameter names (`{ param: "objectName", action: "read" }`)
|
|
578
|
-
*
|
|
584
|
+
* path parameter names (`{ param: "objectName", action: "read" }`), or on
|
|
585
|
+
* one fixed object (`{ object: "skill", action: "read" }`). The host checks
|
|
586
|
+
* it before the handler, as it checks `permission`.
|
|
579
587
|
*/
|
|
580
588
|
objectPermission?: OperationObjectPermission;
|
|
581
589
|
/**
|
|
@@ -659,6 +667,9 @@ export declare function operation<const D extends OperationDefinition>(def: D &
|
|
|
659
667
|
objectPermission?: {
|
|
660
668
|
readonly param: PathParams<D["path"]>;
|
|
661
669
|
readonly action: Action;
|
|
670
|
+
} | {
|
|
671
|
+
readonly object: string;
|
|
672
|
+
readonly action: Action;
|
|
662
673
|
};
|
|
663
674
|
}): Operation<D>;
|
|
664
675
|
//#endregion
|
|
@@ -839,6 +850,9 @@ export type MeetingResponseStatus = "accepted" | "declined" | "tentative" | "nee
|
|
|
839
850
|
/** An invitation's answer; "needs_action" is no answer and is not sent. */
|
|
840
851
|
export declare const MEETING_RESPONSES: readonly ["accepted", "declined", "tentative"];
|
|
841
852
|
export type MeetingResponse = (typeof MEETING_RESPONSES)[number];
|
|
853
|
+
/** Every reason a recording is failed for a bot that never answered ends with
|
|
854
|
+
* this, so a reader can say so in words without parsing the sentence. */
|
|
855
|
+
export declare const MEETING_BOT_SILENT_REASON = "sent nothing back";
|
|
842
856
|
/** Lifecycle of the recording bot's transcript for one meeting. */
|
|
843
857
|
export type TranscriptStatus = "scheduled" | "recording" | "completed" | "failed";
|
|
844
858
|
/** An explicit per-meeting choice that beats the workspace policy. */
|
|
@@ -855,6 +869,9 @@ export interface MeetingRecording {
|
|
|
855
869
|
status: MeetingRecordingStatus;
|
|
856
870
|
/** Set when status is "failed"; null otherwise. */
|
|
857
871
|
failureReason: string | null;
|
|
872
|
+
/** The bot is in the call's waiting room and someone must admit it. Only
|
|
873
|
+
* ever true while status is "recording". */
|
|
874
|
+
waitingRoom: boolean;
|
|
858
875
|
/** The vendor's bot handle once dispatched; what a simulator or an operator
|
|
859
876
|
* uses to correlate a vendor call with this meeting. Null otherwise. */
|
|
860
877
|
botId: string | null;
|
|
@@ -913,6 +930,10 @@ export declare const meetingBotNotificationSchema: z$2.ZodDiscriminatedUnion<[z$
|
|
|
913
930
|
kind: z$2.ZodLiteral<"failure">;
|
|
914
931
|
botId: z$2.ZodString;
|
|
915
932
|
reason: z$2.ZodString;
|
|
933
|
+
}, z$2.core.$strip>, z$2.ZodObject<{
|
|
934
|
+
kind: z$2.ZodLiteral<"waiting-room">;
|
|
935
|
+
botId: z$2.ZodString;
|
|
936
|
+
waiting: z$2.ZodBoolean;
|
|
916
937
|
}, z$2.core.$strip>], "kind">;
|
|
917
938
|
export type MeetingBotNotification = z$2.infer<typeof meetingBotNotificationSchema>;
|
|
918
939
|
/** `GET /meetings/:id/transcript` — only a `completed` transcript answers. */
|
|
@@ -1253,8 +1274,8 @@ export declare const meetingsOperations: {
|
|
|
1253
1274
|
readonly input: z$2.ZodObject<{
|
|
1254
1275
|
meetingId: z$2.ZodString;
|
|
1255
1276
|
override: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodEnum<{
|
|
1256
|
-
skip: "skip";
|
|
1257
1277
|
force: "force";
|
|
1278
|
+
skip: "skip";
|
|
1258
1279
|
}>>>;
|
|
1259
1280
|
}, z$2.core.$strip>;
|
|
1260
1281
|
readonly output: OutputType<Meeting>;
|
|
@@ -1628,6 +1649,12 @@ export interface Decision {
|
|
|
1628
1649
|
links: DecisionLink[];
|
|
1629
1650
|
/** Who raised it, as `decisions.list` reads it; absent elsewhere and for a system decision. */
|
|
1630
1651
|
sender?: DecisionSender;
|
|
1652
|
+
/**
|
|
1653
|
+
* Everyone holding a row of a `question`, whatever its state, as
|
|
1654
|
+
* `decisions.list` reads it; absent elsewhere and for another kind. « Transférer »
|
|
1655
|
+
* (#6451) leaves them out of its picker, since the server refuses them.
|
|
1656
|
+
*/
|
|
1657
|
+
recipientActorIds?: Uuid[];
|
|
1631
1658
|
payload: Record<string, unknown>;
|
|
1632
1659
|
/** Always set (§ 3c): its primary link's text form, or `decision:<id>`. */
|
|
1633
1660
|
threadKey: string;
|
|
@@ -1669,6 +1696,26 @@ export interface DecisionRecipient {
|
|
|
1669
1696
|
createdAt: Date;
|
|
1670
1697
|
updatedAt: Date;
|
|
1671
1698
|
}
|
|
1699
|
+
/**
|
|
1700
|
+
* A transfer (#6451): a recipient handed their open row of a `question` to
|
|
1701
|
+
* someone else. The caller's row closes `dismissed`; this entry, kept in the
|
|
1702
|
+
* decision's `payload.transfers` (oldest first), is that row's reason, which
|
|
1703
|
+
* « Décisions tranchées » reads as « Transférée à <toLabel> ».
|
|
1704
|
+
*/
|
|
1705
|
+
export interface DecisionTransfer {
|
|
1706
|
+
fromActorId: Uuid;
|
|
1707
|
+
toActorId: Uuid;
|
|
1708
|
+
/** The target's name when the decision was handed over. */
|
|
1709
|
+
toLabel: string;
|
|
1710
|
+
/** ISO instant of the transfer. */
|
|
1711
|
+
at: string;
|
|
1712
|
+
}
|
|
1713
|
+
/** The payload key the transfers of a decision live under. */
|
|
1714
|
+
export declare const DECISION_TRANSFERS_KEY = "transfers";
|
|
1715
|
+
/** The transfers recorded on a decision, oldest first; anything malformed is skipped. */
|
|
1716
|
+
export declare function decisionTransfersOf(decision: Pick<Decision, "payload">): DecisionTransfer[];
|
|
1717
|
+
/** The transfer that closed `actorId`'s row, the last one they made; `undefined` when none did. */
|
|
1718
|
+
export declare function decisionTransferBy(decision: Pick<Decision, "payload">, actorId: string): DecisionTransfer | undefined;
|
|
1672
1719
|
export interface DecisionWithRecipient {
|
|
1673
1720
|
decision: Decision;
|
|
1674
1721
|
recipient: DecisionRecipient;
|
|
@@ -2348,7 +2395,7 @@ export declare const githubTriggerMatchSchema: z$2.ZodPipe<z$2.ZodObject<{
|
|
|
2348
2395
|
})[];
|
|
2349
2396
|
} | {
|
|
2350
2397
|
family: "workflow";
|
|
2351
|
-
actions: ("in_progress" | "
|
|
2398
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
2352
2399
|
repositories: string[];
|
|
2353
2400
|
sender: GithubTriggerSender;
|
|
2354
2401
|
conditions: ({
|
|
@@ -2899,7 +2946,7 @@ export declare const connectorTriggerMatchSchema: z$2.ZodUnion<readonly [z$2.Zod
|
|
|
2899
2946
|
})[];
|
|
2900
2947
|
} | {
|
|
2901
2948
|
family: "workflow";
|
|
2902
|
-
actions: ("in_progress" | "
|
|
2949
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
2903
2950
|
repositories: string[];
|
|
2904
2951
|
sender: GithubTriggerSender;
|
|
2905
2952
|
conditions: ({
|
|
@@ -6398,6 +6445,8 @@ export declare const SYSTEM_ATTRIBUTE_I18N_KEYS: {
|
|
|
6398
6445
|
readonly createdBy: "createdBy";
|
|
6399
6446
|
readonly lastUpdatedBy: "lastUpdatedBy";
|
|
6400
6447
|
readonly attachments: "attachments";
|
|
6448
|
+
readonly parentId: "parentId";
|
|
6449
|
+
readonly childIds: "childIds";
|
|
6401
6450
|
};
|
|
6402
6451
|
export type SystemAttributeI18nKey = (typeof SYSTEM_ATTRIBUTE_I18N_KEYS)[keyof typeof SYSTEM_ATTRIBUTE_I18N_KEYS];
|
|
6403
6452
|
/**
|
|
@@ -6441,6 +6490,34 @@ export declare function getSystemAttributeList(): SystemAttribute[];
|
|
|
6441
6490
|
export declare function isManagedSystemAttribute(attribute: {
|
|
6442
6491
|
id?: string;
|
|
6443
6492
|
}): boolean;
|
|
6493
|
+
/** Ids of the two relation attributes a hierarchical object carries (`hierarchy:` prefix). */
|
|
6494
|
+
export declare const HIERARCHY_ATTRIBUTE_IDS: readonly ["hierarchy:parentId", "hierarchy:childIds"];
|
|
6495
|
+
/**
|
|
6496
|
+
* Their names, which are also the record's root fields and the filter's system
|
|
6497
|
+
* columns: a rule naming one reads `parent_id`, never relation edges, whatever
|
|
6498
|
+
* type the attribute declares.
|
|
6499
|
+
*/
|
|
6500
|
+
export declare const HIERARCHY_ATTRIBUTE_NAMES: ReadonlySet<string>;
|
|
6501
|
+
/** How many children the `childIds` root field carries at most; more are read from the tree. */
|
|
6502
|
+
export declare const HIERARCHY_CHILD_IDS_LIMIT = 6;
|
|
6503
|
+
/**
|
|
6504
|
+
* The parent and children of a hierarchical object, as relation attributes to
|
|
6505
|
+
* the object itself. Empty for a flat object. Their id prefix is `hierarchy:`
|
|
6506
|
+
* (not `system:`), so they are editable: `isManagedSystemAttribute` stays false.
|
|
6507
|
+
*/
|
|
6508
|
+
export declare function getHierarchyAttributes(object: {
|
|
6509
|
+
hierarchical?: boolean;
|
|
6510
|
+
name: string;
|
|
6511
|
+
}): RelationAttribute[];
|
|
6512
|
+
/** Whether an attribute is the hierarchy's `parentId` or `childIds`. */
|
|
6513
|
+
export declare function isHierarchyAttribute(attribute: {
|
|
6514
|
+
id?: string;
|
|
6515
|
+
}): boolean;
|
|
6516
|
+
/** The system attributes of one object: the shared ones plus its hierarchy pair, if any. */
|
|
6517
|
+
export declare function getObjectSystemAttributes(object: {
|
|
6518
|
+
hierarchical?: boolean;
|
|
6519
|
+
name: string;
|
|
6520
|
+
}): Attribute[];
|
|
6444
6521
|
//#endregion
|
|
6445
6522
|
//#region src/types/schema-groups.d.ts
|
|
6446
6523
|
/** A synced bundle (core excepted) that owns objects: one sidebar section, label only. */
|
|
@@ -13094,7 +13171,11 @@ export interface FilterTarget {
|
|
|
13094
13171
|
/** What the picker offers on it — always a subset of `operators`. */
|
|
13095
13172
|
offered: readonly FilterOperator[];
|
|
13096
13173
|
}
|
|
13097
|
-
/**
|
|
13174
|
+
/**
|
|
13175
|
+
* An attribute filtered as a whole: its unfolded type's operators (a rollup
|
|
13176
|
+
* unfolds its aggregation). The hierarchy pair is a relation stored in a
|
|
13177
|
+
* column: it takes that system column's operators.
|
|
13178
|
+
*/
|
|
13098
13179
|
export declare function attributeFilterTarget(attribute: AttributeLike & {
|
|
13099
13180
|
name: string;
|
|
13100
13181
|
}): FilterTarget;
|
|
@@ -14356,8 +14437,8 @@ type AgentDataChunkOptions = {
|
|
|
14356
14437
|
};
|
|
14357
14438
|
export declare const providerNameSchema: z$2.ZodEnum<{
|
|
14358
14439
|
cursor: "cursor";
|
|
14359
|
-
anthropic: "anthropic";
|
|
14360
14440
|
openai: "openai";
|
|
14441
|
+
anthropic: "anthropic";
|
|
14361
14442
|
google: "google";
|
|
14362
14443
|
spacexai: "spacexai";
|
|
14363
14444
|
deepseek: "deepseek";
|
|
@@ -14387,8 +14468,8 @@ export declare const inferenceRoutingSchema: z$2.ZodEnum<{
|
|
|
14387
14468
|
export declare const modelReferenceSchema: z$2.ZodObject<{
|
|
14388
14469
|
provider: z$2.ZodEnum<{
|
|
14389
14470
|
cursor: "cursor";
|
|
14390
|
-
anthropic: "anthropic";
|
|
14391
14471
|
openai: "openai";
|
|
14472
|
+
anthropic: "anthropic";
|
|
14392
14473
|
google: "google";
|
|
14393
14474
|
spacexai: "spacexai";
|
|
14394
14475
|
deepseek: "deepseek";
|
|
@@ -14425,8 +14506,8 @@ export declare const agentSessionInferenceOverridesInputSchema: z$2.ZodObject<{
|
|
|
14425
14506
|
model: z$2.ZodOptional<z$2.ZodObject<{
|
|
14426
14507
|
provider: z$2.ZodEnum<{
|
|
14427
14508
|
cursor: "cursor";
|
|
14428
|
-
anthropic: "anthropic";
|
|
14429
14509
|
openai: "openai";
|
|
14510
|
+
anthropic: "anthropic";
|
|
14430
14511
|
google: "google";
|
|
14431
14512
|
spacexai: "spacexai";
|
|
14432
14513
|
deepseek: "deepseek";
|
|
@@ -14461,8 +14542,8 @@ export declare const agentSessionInferenceOverridesSchema: z$2.ZodObject<{
|
|
|
14461
14542
|
model: z$2.ZodOptional<z$2.ZodObject<{
|
|
14462
14543
|
provider: z$2.ZodEnum<{
|
|
14463
14544
|
cursor: "cursor";
|
|
14464
|
-
anthropic: "anthropic";
|
|
14465
14545
|
openai: "openai";
|
|
14546
|
+
anthropic: "anthropic";
|
|
14466
14547
|
google: "google";
|
|
14467
14548
|
spacexai: "spacexai";
|
|
14468
14549
|
deepseek: "deepseek";
|
|
@@ -14499,8 +14580,8 @@ export declare const sessionInferencePatchSchema: z$2.ZodObject<{
|
|
|
14499
14580
|
model: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodObject<{
|
|
14500
14581
|
provider: z$2.ZodEnum<{
|
|
14501
14582
|
cursor: "cursor";
|
|
14502
|
-
anthropic: "anthropic";
|
|
14503
14583
|
openai: "openai";
|
|
14584
|
+
anthropic: "anthropic";
|
|
14504
14585
|
google: "google";
|
|
14505
14586
|
spacexai: "spacexai";
|
|
14506
14587
|
deepseek: "deepseek";
|
|
@@ -14559,10 +14640,10 @@ export declare const routedMessageInferenceSchema: z$2.ZodObject<{
|
|
|
14559
14640
|
}>>;
|
|
14560
14641
|
relation: z$2.ZodOptional<z$2.ZodEnum<{
|
|
14561
14642
|
unknown: "unknown";
|
|
14562
|
-
aside: "aside";
|
|
14563
14643
|
continue: "continue";
|
|
14564
|
-
|
|
14644
|
+
aside: "aside";
|
|
14565
14645
|
modify: "modify";
|
|
14646
|
+
new: "new";
|
|
14566
14647
|
}>>;
|
|
14567
14648
|
anchorMessageId: z$2.ZodOptional<z$2.ZodString>;
|
|
14568
14649
|
}, z$2.core.$strip>;
|
|
@@ -14658,13 +14739,13 @@ export declare const agentMessagePartSchema: z$2.ZodUnion<readonly [z$2.ZodObjec
|
|
|
14658
14739
|
}>>;
|
|
14659
14740
|
state: z$2.ZodEnum<{
|
|
14660
14741
|
error: "error";
|
|
14661
|
-
running: "running";
|
|
14662
14742
|
completed: "completed";
|
|
14663
14743
|
pending: "pending";
|
|
14744
|
+
running: "running";
|
|
14745
|
+
streaming: "streaming";
|
|
14664
14746
|
"approval-requested": "approval-requested";
|
|
14665
14747
|
"approval-responded": "approval-responded";
|
|
14666
14748
|
"approval-dispatched": "approval-dispatched";
|
|
14667
|
-
streaming: "streaming";
|
|
14668
14749
|
}>;
|
|
14669
14750
|
durationMs: z$2.ZodOptional<z$2.ZodNumber>;
|
|
14670
14751
|
approvalId: z$2.ZodOptional<z$2.ZodString>;
|
|
@@ -14787,8 +14868,8 @@ export declare const mentionReferenceSchema: z$2.ZodObject<{
|
|
|
14787
14868
|
export declare const modelDefinitionSchema: z$2.ZodObject<{
|
|
14788
14869
|
provider: z$2.ZodEnum<{
|
|
14789
14870
|
cursor: "cursor";
|
|
14790
|
-
anthropic: "anthropic";
|
|
14791
14871
|
openai: "openai";
|
|
14872
|
+
anthropic: "anthropic";
|
|
14792
14873
|
google: "google";
|
|
14793
14874
|
spacexai: "spacexai";
|
|
14794
14875
|
deepseek: "deepseek";
|
|
@@ -14850,13 +14931,13 @@ export declare const agentSessionMessageSchema: z$2.ZodObject<{
|
|
|
14850
14931
|
}>>;
|
|
14851
14932
|
state: z$2.ZodEnum<{
|
|
14852
14933
|
error: "error";
|
|
14853
|
-
running: "running";
|
|
14854
14934
|
completed: "completed";
|
|
14855
14935
|
pending: "pending";
|
|
14936
|
+
running: "running";
|
|
14937
|
+
streaming: "streaming";
|
|
14856
14938
|
"approval-requested": "approval-requested";
|
|
14857
14939
|
"approval-responded": "approval-responded";
|
|
14858
14940
|
"approval-dispatched": "approval-dispatched";
|
|
14859
|
-
streaming: "streaming";
|
|
14860
14941
|
}>;
|
|
14861
14942
|
durationMs: z$2.ZodOptional<z$2.ZodNumber>;
|
|
14862
14943
|
approvalId: z$2.ZodOptional<z$2.ZodString>;
|
|
@@ -14978,8 +15059,8 @@ export declare const agentSessionMessageSchema: z$2.ZodObject<{
|
|
|
14978
15059
|
model: z$2.ZodOptional<z$2.ZodObject<{
|
|
14979
15060
|
provider: z$2.ZodEnum<{
|
|
14980
15061
|
cursor: "cursor";
|
|
14981
|
-
anthropic: "anthropic";
|
|
14982
15062
|
openai: "openai";
|
|
15063
|
+
anthropic: "anthropic";
|
|
14983
15064
|
google: "google";
|
|
14984
15065
|
spacexai: "spacexai";
|
|
14985
15066
|
deepseek: "deepseek";
|
|
@@ -15143,13 +15224,13 @@ export declare const customDataChunkSchemas: {
|
|
|
15143
15224
|
}>>;
|
|
15144
15225
|
state: z$2.ZodEnum<{
|
|
15145
15226
|
error: "error";
|
|
15146
|
-
running: "running";
|
|
15147
15227
|
completed: "completed";
|
|
15148
15228
|
pending: "pending";
|
|
15229
|
+
running: "running";
|
|
15230
|
+
streaming: "streaming";
|
|
15149
15231
|
"approval-requested": "approval-requested";
|
|
15150
15232
|
"approval-responded": "approval-responded";
|
|
15151
15233
|
"approval-dispatched": "approval-dispatched";
|
|
15152
|
-
streaming: "streaming";
|
|
15153
15234
|
}>;
|
|
15154
15235
|
durationMs: z$2.ZodOptional<z$2.ZodNumber>;
|
|
15155
15236
|
approvalId: z$2.ZodOptional<z$2.ZodString>;
|
|
@@ -15271,8 +15352,8 @@ export declare const customDataChunkSchemas: {
|
|
|
15271
15352
|
model: z$2.ZodOptional<z$2.ZodObject<{
|
|
15272
15353
|
provider: z$2.ZodEnum<{
|
|
15273
15354
|
cursor: "cursor";
|
|
15274
|
-
anthropic: "anthropic";
|
|
15275
15355
|
openai: "openai";
|
|
15356
|
+
anthropic: "anthropic";
|
|
15276
15357
|
google: "google";
|
|
15277
15358
|
spacexai: "spacexai";
|
|
15278
15359
|
deepseek: "deepseek";
|
|
@@ -15854,7 +15935,7 @@ export declare const agentTriggerBaseSchema: z$2.ZodObject<{
|
|
|
15854
15935
|
})[];
|
|
15855
15936
|
} | {
|
|
15856
15937
|
family: "workflow";
|
|
15857
|
-
actions: ("in_progress" | "
|
|
15938
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
15858
15939
|
repositories: string[];
|
|
15859
15940
|
sender: GithubTriggerSender;
|
|
15860
15941
|
conditions: ({
|
|
@@ -16292,7 +16373,7 @@ export declare const agentTriggerSchema: z$2.ZodPipe<z$2.ZodType<{
|
|
|
16292
16373
|
})[];
|
|
16293
16374
|
} | {
|
|
16294
16375
|
family: "workflow";
|
|
16295
|
-
actions: ("in_progress" | "
|
|
16376
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
16296
16377
|
repositories: string[];
|
|
16297
16378
|
sender: GithubTriggerSender;
|
|
16298
16379
|
conditions: ({
|
|
@@ -16570,7 +16651,7 @@ export declare const agentTriggerSchema: z$2.ZodPipe<z$2.ZodType<{
|
|
|
16570
16651
|
})[];
|
|
16571
16652
|
} | {
|
|
16572
16653
|
family: "workflow";
|
|
16573
|
-
actions: ("in_progress" | "
|
|
16654
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
16574
16655
|
repositories: string[];
|
|
16575
16656
|
sender: GithubTriggerSender;
|
|
16576
16657
|
conditions: ({
|
|
@@ -16849,7 +16930,7 @@ export declare const agentTriggerSchema: z$2.ZodPipe<z$2.ZodType<{
|
|
|
16849
16930
|
})[];
|
|
16850
16931
|
} | {
|
|
16851
16932
|
family: "workflow";
|
|
16852
|
-
actions: ("in_progress" | "
|
|
16933
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
16853
16934
|
repositories: string[];
|
|
16854
16935
|
sender: GithubTriggerSender;
|
|
16855
16936
|
conditions: ({
|
|
@@ -17126,7 +17207,7 @@ export declare const agentTriggerSchema: z$2.ZodPipe<z$2.ZodType<{
|
|
|
17126
17207
|
})[];
|
|
17127
17208
|
} | {
|
|
17128
17209
|
family: "workflow";
|
|
17129
|
-
actions: ("in_progress" | "
|
|
17210
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
17130
17211
|
repositories: string[];
|
|
17131
17212
|
sender: GithubTriggerSender;
|
|
17132
17213
|
conditions: ({
|
|
@@ -17551,7 +17632,7 @@ export declare const agentTriggerPatchSchema: z$2.ZodObject<{
|
|
|
17551
17632
|
})[];
|
|
17552
17633
|
} | {
|
|
17553
17634
|
family: "workflow";
|
|
17554
|
-
actions: ("in_progress" | "
|
|
17635
|
+
actions: ("in_progress" | "requested" | "completed")[];
|
|
17555
17636
|
repositories: string[];
|
|
17556
17637
|
sender: GithubTriggerSender;
|
|
17557
17638
|
conditions: ({
|
|
@@ -17819,7 +17900,7 @@ export declare function parseMergedAgentTrigger(current: AgentTriggerInput, patc
|
|
|
17819
17900
|
* yet is kept rather than refused.
|
|
17820
17901
|
*/
|
|
17821
17902
|
export declare const modelIdentitySchema: z$2.ZodObject<{
|
|
17822
|
-
provider: z$2.ZodCustom<"cursor" | "
|
|
17903
|
+
provider: z$2.ZodCustom<"cursor" | "openai" | "anthropic" | "google" | "spacexai" | "deepseek" | "moonshotai" | "alibaba" | "mistral" | "minimax" | "meta" | "zai", "cursor" | "openai" | "anthropic" | "google" | "spacexai" | "deepseek" | "moonshotai" | "alibaba" | "mistral" | "minimax" | "meta" | "zai">;
|
|
17823
17904
|
model: z$2.ZodString;
|
|
17824
17905
|
}, z$2.core.$strip>;
|
|
17825
17906
|
//#endregion
|
|
@@ -18018,7 +18099,7 @@ export declare function judgePreferenceWrite(declarations: PreferenceDeclaration
|
|
|
18018
18099
|
*/
|
|
18019
18100
|
export declare const CORE_PREFERENCES: readonly [PreferenceDeclaration<"workPosture", "manual" | "architect" | "auto">, PreferenceDeclaration<"chat.default", {
|
|
18020
18101
|
model?: {
|
|
18021
|
-
provider: "cursor" | "
|
|
18102
|
+
provider: "cursor" | "openai" | "anthropic" | "google" | "spacexai" | "deepseek" | "moonshotai" | "alibaba" | "mistral" | "minimax" | "meta" | "zai";
|
|
18022
18103
|
model: string;
|
|
18023
18104
|
} | undefined;
|
|
18024
18105
|
routing?: "auto" | undefined;
|