@standards/schema 1.0.0-alpha.384 → 1.0.0-alpha.386
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-C9OPP-r1.d.ts → all-4D2kFfWM.d.mts} +1115 -1116
- package/dist/{all-CYmW48oj.d.mts → all-DmTOfJJI.d.ts} +1115 -1116
- package/dist/api/index.d.mts +2890 -2890
- package/dist/api/index.d.ts +2890 -2890
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/attribute-validators-COsyRG9V.mjs +11 -0
- package/dist/attribute-validators-CUqsP1j_.js +11 -0
- package/dist/{attributes-D35Lcoui.d.ts → attributes-BcA_reJZ.d.ts} +58 -59
- package/dist/{attributes-CZD_B0mZ.d.mts → attributes-eqr1vdPP.d.mts} +58 -59
- package/dist/checkbox-C9aJ-6gq.d.ts +10 -0
- package/dist/checkbox-DfXrFM2z.d.mts +10 -0
- package/dist/config-C1CDWJf8.mjs +2 -0
- package/dist/config-eqfYa9Bh.js +2 -0
- package/dist/{core-397tQy5q.js → core-DAxRlJ5i.js} +1 -1
- package/dist/{core-BLHhNykL.mjs → core-rKI7Q9_U.mjs} +1 -1
- package/dist/{date-CQdP6Dxe.d.ts → date-BzggmHjS.d.mts} +5 -6
- package/dist/{date-B9051Wxe.d.mts → date-CdaoV9_L.d.ts} +5 -6
- package/dist/{exceptions-DoP6VK0v.d.mts → exceptions-CgzBcQIl.d.mts} +69 -70
- package/dist/{exceptions-DoP6VK0v.d.ts → exceptions-CgzBcQIl.d.ts} +69 -70
- package/dist/exceptions.d.mts +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/{index-E9rSexij.d.ts → index-BSYjSdhW.d.mts} +17 -18
- package/dist/{index-CgEVJG3l.d.ts → index-BmQgUhtq.d.mts} +2770 -2769
- package/dist/{index-BLXzRQr9.d.ts → index-CCH94vyR.d.ts} +6 -7
- package/dist/{index-D0L0GHU0.d.mts → index-D1iR2xuc.d.ts} +17 -18
- package/dist/{index-BS-60koN.d.mts → index-DjWbCMUZ.d.ts} +2770 -2769
- package/dist/{index-CH-Vc-pK.d.ts → index-e1Oh8ngS.d.ts} +73 -74
- package/dist/{index-B3wdnfLl.d.mts → index-jDwfdudj.d.mts} +73 -74
- package/dist/{index-CSDAHifu.d.mts → index-zJz3LbXr.d.mts} +6 -7
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/number-B3u9vPtb.d.ts +10 -0
- package/dist/number-Br56q0hL.d.mts +10 -0
- package/dist/object-5-wnsH0o.js +4 -0
- package/dist/object-BF5y6bgs.mjs +4 -0
- package/dist/{objects-CH22DJOx.d.ts → objects-CLxyZh-U.d.ts} +54 -55
- package/dist/{objects-DhKrQEo4.d.mts → objects-DxEMaC2Z.d.mts} +54 -55
- package/dist/phone-BGJea5sr.mjs +2 -0
- package/dist/phone-DHXyNkVY.js +2 -0
- package/dist/record-aggregates-Cj3p3_ce.js +2 -0
- package/dist/{record-aggregates-CzG86pUS.mjs → record-aggregates-DQXrIuGE.mjs} +1 -1
- package/dist/record-operation-7-DRRONb.mjs +2 -0
- package/dist/record-operation-BcbgQ-0b.js +2 -0
- package/dist/rolldown-runtime-DETHMehu.js +2 -0
- package/dist/text-BaxaZ5Vv.mjs +2 -0
- package/dist/text-Bvk4ila8.d.ts +10 -0
- package/dist/text-C5NnfCJg.d.mts +10 -0
- package/dist/text-DVrTGjjX.js +2 -0
- package/dist/{utils-gY3d9Dwp.js → utils-B-gGq3FS.js} +1 -1
- package/dist/{utils-C_J_p_tL.d.ts → utils-B2bq4zLb.d.ts} +15 -16
- package/dist/{utils-CkcPS_M9.d.mts → utils-CRx-eR8T.d.mts} +15 -16
- package/dist/{utils-fXIvFFl6.mjs → utils-DaejNWxh.mjs} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +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 +4 -4
- package/dist/validation/complex/currency.d.ts +4 -4
- package/dist/validation/complex/currency.js +1 -1
- package/dist/validation/complex/currency.mjs +1 -1
- package/dist/validation/complex/location.d.mts +4 -4
- package/dist/validation/complex/location.d.ts +4 -4
- package/dist/validation/complex/location.js +1 -1
- package/dist/validation/complex/location.mjs +1 -1
- package/dist/validation/complex/phone.d.mts +4 -4
- package/dist/validation/complex/phone.d.ts +4 -4
- package/dist/validation/complex/phone.js +1 -1
- package/dist/validation/complex/phone.mjs +1 -1
- package/dist/validation/complex/relation.d.mts +6 -6
- package/dist/validation/complex/relation.d.ts +6 -6
- package/dist/validation/complex/relation.js +1 -1
- package/dist/validation/complex/relation.mjs +1 -1
- package/dist/validation/complex/richtext.d.mts +4 -4
- package/dist/validation/complex/richtext.d.ts +4 -4
- package/dist/validation/complex/richtext.js +1 -1
- package/dist/validation/complex/richtext.mjs +1 -1
- package/dist/validation/complex/select.d.mts +6 -6
- package/dist/validation/complex/select.d.ts +6 -6
- package/dist/validation/complex/select.js +1 -1
- package/dist/validation/complex/select.mjs +1 -1
- package/dist/validation/complex/user.d.mts +4 -4
- package/dist/validation/complex/user.d.ts +4 -4
- package/dist/validation/complex/user.js +1 -1
- package/dist/validation/complex/user.mjs +1 -1
- package/dist/validation/computed/formula.d.mts +4 -4
- package/dist/validation/computed/formula.d.ts +4 -4
- package/dist/validation/computed/formula.js +1 -1
- package/dist/validation/computed/formula.mjs +1 -1
- package/dist/validation/computed/rollup.d.mts +4 -4
- package/dist/validation/computed/rollup.d.ts +4 -4
- package/dist/validation/computed/rollup.js +1 -1
- package/dist/validation/computed/rollup.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/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/core/index.js +1 -1
- package/dist/validation/core/index.mjs +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/checkbox.js +1 -1
- package/dist/validation/primitives/checkbox.mjs +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/date.js +1 -1
- package/dist/validation/primitives/date.mjs +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/number.js +1 -1
- package/dist/validation/primitives/number.mjs +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/validation/primitives/text.js +1 -1
- package/dist/validation/primitives/text.mjs +1 -1
- package/dist/view-config.schema-Dl5GkAzl.mjs +2 -0
- package/dist/view-config.schema-DwZVS0Gn.js +2 -0
- package/dist/zod-locale-D_QkXhnp.d.mts +2 -0
- package/dist/zod-locale-D_QkXhnp.d.ts +2 -0
- package/dist/zod-locale.d.mts +2 -0
- package/dist/zod-locale.d.ts +2 -0
- package/dist/zod-locale.js +2 -0
- package/dist/zod-locale.mjs +2 -0
- package/package.json +17 -3
- package/dist/attribute-validators-DRqhAt2t.mjs +0 -11
- package/dist/attribute-validators-WAoJbap5.js +0 -11
- package/dist/checkbox-CQRDh5tF.d.ts +0 -11
- package/dist/checkbox-D00iEidf.d.mts +0 -11
- package/dist/config-BIxnbUN8.mjs +0 -2
- package/dist/config-DdjlHdPg.js +0 -2
- package/dist/number-BwCSeK20.d.ts +0 -11
- package/dist/number-CisXUosg.d.mts +0 -11
- package/dist/object-DcgxLvip.js +0 -4
- package/dist/object-Dzl7sfq8.mjs +0 -4
- package/dist/phone-BB-tzcSr.js +0 -2
- package/dist/phone-Bca_xiOX.mjs +0 -2
- package/dist/record-aggregates-DwpIJ2Dv.js +0 -2
- package/dist/record-operation-B7t5aXW3.js +0 -2
- package/dist/record-operation-DueJTyDh.mjs +0 -2
- package/dist/text-A9AJ1wUO.js +0 -2
- package/dist/text-C8Lb-NFo.mjs +0 -2
- package/dist/text-SkYUYEnE.d.ts +0 -11
- package/dist/text-Z1_WL8cd.d.mts +0 -11
- package/dist/view-config.schema-BqO1hmWR.mjs +0 -2
- package/dist/view-config.schema-DVoE_g3g.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");const n=require("./text-DVrTGjjX.js"),r=require("./core-DAxRlJ5i.js"),i=require("./validation/primitives/number.js"),a=require("./validation/primitives/checkbox.js"),o=require("./validation/primitives/date.js"),s=require("./validation/complex/currency.js"),c=require("./validation/complex/location.js"),l=require("./phone-DHXyNkVY.js"),u=require("./validation/complex/relation.js"),d=require("./validation/complex/richtext.js"),f=require("./validation/complex/select.js"),p=require("./validation/complex/user.js"),m=require("./validation/computed/formula.js"),h=require("./validation/computed/rollup.js");let g=require("zod");g=e.__toESM(g);function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const _={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return g.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,t=r.DEFAULT_VALIDATION_MESSAGES){switch(e.type){case`text`:return n.createTextValidator(e,t);case`richtext`:return d.createRichtextValidator(e,t);case`number`:return i.createNumberValidator(e,t);case`checkbox`:return a.createCheckboxValidator(e,t);case`date`:return o.createDateValidator(e,t);case`phone`:return l.createPhoneValidator(e,t);case`currency`:return s.createCurrencyValidator(e,t);case`status`:return f.createStatusValidator(e,t);case`location`:return c.createLocationValidator(e,t);case`select`:return f.createSelectValidator(e,t);case`multiselect`:return f.createMultiselectValidator(e,t);case`user`:return p.createUserValidator(e,t);case`relation`:return u.createRelationValidator(e,t);case`formula`:return m.createFormulaValidator(e,t);case`rollup`:return h.createRollupValidator(e,t);default:return g.unknown()}}function createFormAttributeValidator(e,t=r.DEFAULT_VALIDATION_MESSAGES){let n=createAttributeValidator(e,t);return e.required?n:withEmptyToNull(n,_[e.type])}const v=new WeakMap,y=new WeakMap;function createObjectValidator(e){let t=v.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?n[t.name]=e.refine(isValuePresent,{message:r.DEFAULT_VALIDATION_MESSAGES.required(t)}):n[t.name]=withEmptyToNull(e,_[t.type])}let i=g.object(n).passthrough();return v.set(e,i),i}function createDraftValidator(e){let t=y.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,_[t.type])}let r=g.object(n).passthrough();return y.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=n.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:r.formatZodErrors(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.formatZodErrors(n.error)}}function validateObjectOrThrow(e,n){let r=validateObject(e,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
3
|
+
`)||`Unknown validation error`;throw new t.ValidationError(`Validation failed for ${e.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.formatZodErrors(n.error)}}function validateDraftOrThrow(e,n){let r=validateDraft(e,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
4
|
+
`)||`Unknown validation error`;throw new t.ValidationError(`Draft validation failed for ${e.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(e,n){let r=new Set(e.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new t.ValidationError(`Unknown attribute${i.length>1?`s`:``} for ${e.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}Object.defineProperty(exports,"createAttributeValidator",{enumerable:!0,get:function(){return createAttributeValidator}}),Object.defineProperty(exports,"createDraftValidator",{enumerable:!0,get:function(){return createDraftValidator}}),Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:!0,get:function(){return createFormAttributeValidator}}),Object.defineProperty(exports,"createObjectValidator",{enumerable:!0,get:function(){return createObjectValidator}}),Object.defineProperty(exports,"getMissingRequiredAttributes",{enumerable:!0,get:function(){return getMissingRequiredAttributes}}),Object.defineProperty(exports,"isEmptyValue",{enumerable:!0,get:function(){return isEmptyValue}}),Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:!0,get:function(){return isNullishOrEmptyString}}),Object.defineProperty(exports,"isRecordComplete",{enumerable:!0,get:function(){return isRecordComplete}}),Object.defineProperty(exports,"isValuePresent",{enumerable:!0,get:function(){return isValuePresent}}),Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:!0,get:function(){return rejectUnknownAttributesOrThrow}}),Object.defineProperty(exports,"validateAttribute",{enumerable:!0,get:function(){return validateAttribute}}),Object.defineProperty(exports,"validateDraft",{enumerable:!0,get:function(){return validateDraft}}),Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:!0,get:function(){return validateDraftOrThrow}}),Object.defineProperty(exports,"validateObject",{enumerable:!0,get:function(){return validateObject}}),Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:!0,get:function(){return validateObjectOrThrow}});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{ValidationError as e}from"./exceptions.mjs";import"./zod-locale.mjs";import{createTextValidator as t}from"./text-BaxaZ5Vv.mjs";import{DEFAULT_VALIDATION_MESSAGES as n,formatZodErrors as r}from"./core-rKI7Q9_U.mjs";import{createNumberValidator as i}from"./validation/primitives/number.mjs";import{createCheckboxValidator as a}from"./validation/primitives/checkbox.mjs";import{createDateValidator as o}from"./validation/primitives/date.mjs";import{createCurrencyValidator as s}from"./validation/complex/currency.mjs";import{createLocationValidator as c}from"./validation/complex/location.mjs";import{createPhoneValidator as l}from"./phone-BGJea5sr.mjs";import{createRelationValidator as u}from"./validation/complex/relation.mjs";import{createRichtextValidator as d}from"./validation/complex/richtext.mjs";import{createMultiselectValidator as f,createSelectValidator as p,createStatusValidator as m}from"./validation/complex/select.mjs";import{createUserValidator as h}from"./validation/complex/user.mjs";import{createFormulaValidator as g}from"./validation/computed/formula.mjs";import{createRollupValidator as _}from"./validation/computed/rollup.mjs";import*as v from"zod";function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const y={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return v.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,r=n){switch(e.type){case`text`:return t(e,r);case`richtext`:return d(e,r);case`number`:return i(e,r);case`checkbox`:return a(e,r);case`date`:return o(e,r);case`phone`:return l(e,r);case`currency`:return s(e,r);case`status`:return m(e,r);case`location`:return c(e,r);case`select`:return p(e,r);case`multiselect`:return f(e,r);case`user`:return h(e,r);case`relation`:return u(e,r);case`formula`:return g(e,r);case`rollup`:return _(e,r);default:return v.unknown()}}function createFormAttributeValidator(e,t=n){let r=createAttributeValidator(e,t);return e.required?r:withEmptyToNull(r,y[e.type])}const b=new WeakMap,x=new WeakMap;function createObjectValidator(e){let t=b.get(e);if(t)return t;let r={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?r[t.name]=e.refine(isValuePresent,{message:n.required(t)}):r[t.name]=withEmptyToNull(e,y[t.type])}let i=v.object(r).passthrough();return b.set(e,i),i}function createDraftValidator(e){let t=x.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,y[t.type])}let r=v.object(n).passthrough();return x.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=n.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:r(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r(n.error)}}function validateObjectOrThrow(t,n){let r=validateObject(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
3
|
+
`)||`Unknown validation error`;throw new e(`Validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r(n.error)}}function validateDraftOrThrow(t,n){let r=validateDraft(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
|
|
4
|
+
`)||`Unknown validation error`;throw new e(`Draft validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(t,n){let r=new Set(t.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new e(`Unknown attribute${i.length>1?`s`:``} for ${t.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}export{createAttributeValidator,createDraftValidator,createFormAttributeValidator,createObjectValidator,getMissingRequiredAttributes,isEmptyValue,isNullishOrEmptyString,isRecordComplete,isValuePresent,rejectUnknownAttributesOrThrow,validateAttribute,validateDraft,validateDraftOrThrow,validateObject,validateObjectOrThrow};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Uuid } from "./utils-B2bq4zLb.js";
|
|
3
|
+
import { Attribute } from "./attributes-BcA_reJZ.js";
|
|
4
4
|
import { ColorId, IconName } from "@standards/constants";
|
|
5
5
|
//#region src/types/appearance.d.ts
|
|
6
6
|
/** Icon used when neither the entity nor its parent has one. */
|
|
7
|
-
declare const DEFAULT_APPEARANCE_ICON: IconName;
|
|
8
|
-
declare const IMAGE_SHAPES: readonly ["circle", "square"];
|
|
9
|
-
type ImageShape = (typeof IMAGE_SHAPES)[number];
|
|
7
|
+
export declare const DEFAULT_APPEARANCE_ICON: IconName;
|
|
8
|
+
export declare const IMAGE_SHAPES: readonly ["circle", "square"];
|
|
9
|
+
export type ImageShape = (typeof IMAGE_SHAPES)[number];
|
|
10
10
|
/**
|
|
11
11
|
* How an object's records wear an image (#5785 §2): the crop, and where the
|
|
12
12
|
* image may be found — an ordered fallback list of the object's `text`
|
|
13
13
|
* attributes, whose lookup kind is inferred (`text().url()` a website,
|
|
14
14
|
* `text().email()` an email, any other `text()` a name).
|
|
15
15
|
*/
|
|
16
|
-
interface ObjectImage {
|
|
16
|
+
export interface ObjectImage {
|
|
17
17
|
shape: ImageShape;
|
|
18
18
|
from?: readonly string[];
|
|
19
19
|
}
|
|
20
20
|
/** The one appearance shape: every entity stores the facets it accepts. */
|
|
21
|
-
interface Appearance {
|
|
21
|
+
export interface Appearance {
|
|
22
22
|
icon?: IconName;
|
|
23
23
|
color?: ColorId;
|
|
24
24
|
imageFileId?: Uuid;
|
|
25
25
|
}
|
|
26
|
-
type AppearanceFacet = "icon" | "color" | "image";
|
|
27
|
-
type AppearanceEntity = "object" | "record" | "emailCategory" | "option" | "view" | "agent" | "user";
|
|
28
|
-
declare const APPEARANCE_FACETS: Record<AppearanceEntity, readonly AppearanceFacet[]>;
|
|
29
|
-
type ResolvedAppearance = {
|
|
26
|
+
export type AppearanceFacet = "icon" | "color" | "image";
|
|
27
|
+
export type AppearanceEntity = "object" | "record" | "emailCategory" | "option" | "view" | "agent" | "user";
|
|
28
|
+
export declare const APPEARANCE_FACETS: Record<AppearanceEntity, readonly AppearanceFacet[]>;
|
|
29
|
+
export type ResolvedAppearance = {
|
|
30
30
|
kind: "image";
|
|
31
31
|
imageFileId: Uuid;
|
|
32
32
|
shape: ImageShape;
|
|
@@ -42,16 +42,16 @@ type Named = Appearance & {
|
|
|
42
42
|
name?: string;
|
|
43
43
|
};
|
|
44
44
|
/** Image wins; else an icon in a colour (own, parent's or derived from the name) is a tile, without colour a glyph. */
|
|
45
|
-
declare function resolveAppearance(entity: Named, parent?: Named & {
|
|
45
|
+
export declare function resolveAppearance(entity: Named, parent?: Named & {
|
|
46
46
|
image?: Pick<ObjectImage, "shape">;
|
|
47
47
|
}): ResolvedAppearance;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/types/document-layout.d.ts
|
|
50
|
-
interface DocumentLayout {
|
|
50
|
+
export interface DocumentLayout {
|
|
51
51
|
/** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
|
|
52
52
|
presets?: FolderPreset[];
|
|
53
53
|
}
|
|
54
|
-
interface FolderPreset {
|
|
54
|
+
export interface FolderPreset {
|
|
55
55
|
id: string;
|
|
56
56
|
label: string;
|
|
57
57
|
icon?: IconName;
|
|
@@ -60,13 +60,13 @@ interface FolderPreset {
|
|
|
60
60
|
/** When true, this preset is auto-instantiated on every new record's drive for the owning object. */
|
|
61
61
|
autoInstantiate?: boolean;
|
|
62
62
|
}
|
|
63
|
-
interface PresetNode {
|
|
63
|
+
export interface PresetNode {
|
|
64
64
|
title: string;
|
|
65
65
|
description?: string;
|
|
66
66
|
children?: PresetNode[];
|
|
67
67
|
}
|
|
68
68
|
/** Max depth allowed for preset.structure to keep instantiation predictable. */
|
|
69
|
-
declare const MAX_PRESET_DEPTH = 5;
|
|
69
|
+
export declare const MAX_PRESET_DEPTH = 5;
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/types/record-access.d.ts
|
|
72
72
|
/**
|
|
@@ -74,17 +74,17 @@ declare const MAX_PRESET_DEPTH = 5;
|
|
|
74
74
|
* 2026-10-08 §3.2): `reader` sees, `runner` also uses (agents only),
|
|
75
75
|
* `editor` also modifies and manages the grants.
|
|
76
76
|
*/
|
|
77
|
-
declare const ACCESS_ROLES: readonly ["reader", "runner", "editor"];
|
|
78
|
-
type AccessRole = (typeof ACCESS_ROLES)[number];
|
|
77
|
+
export declare const ACCESS_ROLES: readonly ["reader", "runner", "editor"];
|
|
78
|
+
export type AccessRole = (typeof ACCESS_ROLES)[number];
|
|
79
79
|
/** Roles a record access grant can carry (spec 2026-09-25 §5.1): a record is never "used". */
|
|
80
|
-
declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
|
|
81
|
-
type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
|
|
80
|
+
export declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
|
|
81
|
+
export type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
|
|
82
82
|
/**
|
|
83
83
|
* Why a grant exists — the equivalent of Salesforce's `RowCause` (spec §3):
|
|
84
84
|
* automatic grants are recomputed without ever touching manual shares.
|
|
85
85
|
*/
|
|
86
|
-
declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
|
|
87
|
-
type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
86
|
+
export declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
|
|
87
|
+
export type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
88
88
|
/**
|
|
89
89
|
* Agent-internal objects whose records are never shared (spec 2026-09-25
|
|
90
90
|
* §5.3.4): the memory resolver reads "private and visible" as "mine", and an
|
|
@@ -92,19 +92,19 @@ type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
|
92
92
|
* A constant in v1 — a definition flag would mean editing native objects. The
|
|
93
93
|
* server refuses them; the UI hides the share control for them.
|
|
94
94
|
*/
|
|
95
|
-
declare const UNSHAREABLE_OBJECT_NAMES: ReadonlySet<string>;
|
|
95
|
+
export declare const UNSHAREABLE_OBJECT_NAMES: ReadonlySet<string>;
|
|
96
96
|
/** What the reading actor may do with a resource (spec §6.6); records never produce `runner`. */
|
|
97
|
-
type ViewerAccess = "owner" | "editor" | "runner" | "reader" | "workspace";
|
|
97
|
+
export type ViewerAccess = "owner" | "editor" | "runner" | "reader" | "workspace";
|
|
98
98
|
/** One beneficiary of a private resource: its effective role and every source that grants it. */
|
|
99
|
-
interface ResourceAccessGrant<TRole extends AccessRole = AccessRole, TSource extends string = RecordAccessSource> {
|
|
99
|
+
export interface ResourceAccessGrant<TRole extends AccessRole = AccessRole, TSource extends string = RecordAccessSource> {
|
|
100
100
|
actorId: Uuid;
|
|
101
101
|
role: TRole;
|
|
102
102
|
sources: TSource[];
|
|
103
103
|
}
|
|
104
104
|
/** One beneficiary of a private record (shape unchanged since 2026-09-25, D11). */
|
|
105
|
-
type RecordAudienceGrant = ResourceAccessGrant<RecordAccessRole, RecordAccessSource>;
|
|
105
|
+
export type RecordAudienceGrant = ResourceAccessGrant<RecordAccessRole, RecordAccessSource>;
|
|
106
106
|
/** Who can reach a record beyond its owner (`GET /records/:object/:id/access`). */
|
|
107
|
-
interface RecordAudience {
|
|
107
|
+
export interface RecordAudience {
|
|
108
108
|
recordId: Uuid;
|
|
109
109
|
visibility: ResourceVisibility;
|
|
110
110
|
ownedBy: Uuid | null;
|
|
@@ -113,7 +113,7 @@ interface RecordAudience {
|
|
|
113
113
|
grants: RecordAudienceGrant[];
|
|
114
114
|
}
|
|
115
115
|
/** Who can reach an agent definition beyond its owner (`GET /agents/definitions/:id/access`). */
|
|
116
|
-
interface AgentDefinitionAudience {
|
|
116
|
+
export interface AgentDefinitionAudience {
|
|
117
117
|
definitionId: string;
|
|
118
118
|
visibility: ResourceVisibility;
|
|
119
119
|
ownedBy: Uuid | null;
|
|
@@ -122,7 +122,7 @@ interface AgentDefinitionAudience {
|
|
|
122
122
|
grants: ResourceAccessGrant<AccessRole, "manual">[];
|
|
123
123
|
}
|
|
124
124
|
/** Who can reach a private page beyond its owner (`GET /pages/:id/access`). */
|
|
125
|
-
interface PageAudience {
|
|
125
|
+
export interface PageAudience {
|
|
126
126
|
pageId: Uuid;
|
|
127
127
|
visibility: ResourceVisibility;
|
|
128
128
|
ownedBy: Uuid | null;
|
|
@@ -131,7 +131,7 @@ interface PageAudience {
|
|
|
131
131
|
grants: ResourceAccessGrant<RecordAccessRole, "manual">[];
|
|
132
132
|
}
|
|
133
133
|
/** The resource an access operation addresses. */
|
|
134
|
-
type ResourceAccessTarget = {
|
|
134
|
+
export type ResourceAccessTarget = {
|
|
135
135
|
kind: "record";
|
|
136
136
|
object: string;
|
|
137
137
|
id: string;
|
|
@@ -143,18 +143,18 @@ type ResourceAccessTarget = {
|
|
|
143
143
|
id: string;
|
|
144
144
|
};
|
|
145
145
|
/** Narrow an untrusted value (HTTP body, CLI flag) to a record grant role. */
|
|
146
|
-
declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
|
|
146
|
+
export declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
|
|
147
147
|
/** Narrow an untrusted value to an agent definition grant role. */
|
|
148
|
-
declare function parseAgentDefinitionAccessRole(value: unknown): AccessRole;
|
|
148
|
+
export declare function parseAgentDefinitionAccessRole(value: unknown): AccessRole;
|
|
149
149
|
/** Narrow an untrusted value to a page grant role: a page is read or edited, never "used". */
|
|
150
|
-
declare function parsePageAccessRole(value: unknown): RecordAccessRole;
|
|
150
|
+
export declare function parsePageAccessRole(value: unknown): RecordAccessRole;
|
|
151
151
|
/**
|
|
152
152
|
* The single derivation of `viewerAccess`, from the row's owner and the
|
|
153
153
|
* `viewer_grant` storage computed FOR this viewer. A private resource that is
|
|
154
154
|
* neither owned nor granted can only have been read by the system reader,
|
|
155
155
|
* which reads and never writes: `reader`.
|
|
156
156
|
*/
|
|
157
|
-
declare function deriveViewerAccess(resource: {
|
|
157
|
+
export declare function deriveViewerAccess(resource: {
|
|
158
158
|
visibility: ResourceVisibility;
|
|
159
159
|
ownedBy: string | null;
|
|
160
160
|
viewerGrant?: AccessRole | null;
|
|
@@ -162,8 +162,8 @@ declare function deriveViewerAccess(resource: {
|
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/types/objects.d.ts
|
|
164
164
|
/** Visibility scopes shared by resources that can be workspace-wide or actor-private. */
|
|
165
|
-
declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
|
|
166
|
-
type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
165
|
+
export declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
|
|
166
|
+
export type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
167
167
|
/**
|
|
168
168
|
* Scope a list-view tab reads. Deliberately a SEPARATE union from
|
|
169
169
|
* {@link ResourceVisibility}: a stored resource is always exactly one of
|
|
@@ -175,13 +175,13 @@ type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
|
175
175
|
* the viewer (spec 2026-10-08 §5). Never assign a tab scope to a record's
|
|
176
176
|
* `visibility` column.
|
|
177
177
|
*/
|
|
178
|
-
declare const LIST_VIEW_TAB_VISIBILITIES: readonly ["all", "workspace", "private", "shared"];
|
|
179
|
-
type ListViewTabVisibility = (typeof LIST_VIEW_TAB_VISIBILITIES)[number];
|
|
178
|
+
export declare const LIST_VIEW_TAB_VISIBILITIES: readonly ["all", "workspace", "private", "shared"];
|
|
179
|
+
export type ListViewTabVisibility = (typeof LIST_VIEW_TAB_VISIBILITIES)[number];
|
|
180
180
|
/** The exact scope a record list query may impose: a visibility, or `shared` (owned by someone else, granted to me). */
|
|
181
|
-
declare const RECORD_LIST_SCOPES: readonly ["workspace", "private", "shared"];
|
|
182
|
-
type RecordListScope = (typeof RECORD_LIST_SCOPES)[number];
|
|
181
|
+
export declare const RECORD_LIST_SCOPES: readonly ["workspace", "private", "shared"];
|
|
182
|
+
export type RecordListScope = (typeof RECORD_LIST_SCOPES)[number];
|
|
183
183
|
/** Narrow an untrusted list scope (HTTP body) or reject it — `all` is a tab value, never a query scope. */
|
|
184
|
-
declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
184
|
+
export declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
185
185
|
/**
|
|
186
186
|
* Narrow an untrusted value from an edge (HTTP body, CLI flag) to a
|
|
187
187
|
* {@link ResourceVisibility}, or reject it.
|
|
@@ -197,18 +197,18 @@ declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
|
197
197
|
* Throws {@link ValidationError} rather than a transport exception so it can
|
|
198
198
|
* be used below the controller layer; the HTTP filter maps its code to 400.
|
|
199
199
|
*/
|
|
200
|
-
declare function parseResourceVisibility(value: unknown): ResourceVisibility;
|
|
200
|
+
export declare function parseResourceVisibility(value: unknown): ResourceVisibility;
|
|
201
201
|
/**
|
|
202
202
|
* Timestamps for tracking creation and updates
|
|
203
203
|
*/
|
|
204
|
-
interface Timestamps {
|
|
204
|
+
export interface Timestamps {
|
|
205
205
|
createdAt: Date;
|
|
206
206
|
updatedAt: Date;
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Object definition - Represents a database table/entity
|
|
210
210
|
*/
|
|
211
|
-
interface ObjectDefinition {
|
|
211
|
+
export interface ObjectDefinition {
|
|
212
212
|
id?: Uuid;
|
|
213
213
|
name: string;
|
|
214
214
|
label: string;
|
|
@@ -265,18 +265,18 @@ interface ObjectDefinition {
|
|
|
265
265
|
/**
|
|
266
266
|
* Links an attribute to an object
|
|
267
267
|
*/
|
|
268
|
-
interface ObjectAttribute {
|
|
268
|
+
export interface ObjectAttribute {
|
|
269
269
|
objectId: Uuid;
|
|
270
270
|
attributeId: Uuid;
|
|
271
271
|
order?: number;
|
|
272
272
|
required?: boolean;
|
|
273
273
|
}
|
|
274
274
|
/** A record's own icon and image file (`APPEARANCE_FACETS.record`); each key is absent when unset. */
|
|
275
|
-
type RecordAppearance = Pick<Appearance, "icon" | "imageFileId">;
|
|
275
|
+
export type RecordAppearance = Pick<Appearance, "icon" | "imageFileId">;
|
|
276
276
|
/**
|
|
277
277
|
* Record - Instance of an Object (a row in the database)
|
|
278
278
|
*/
|
|
279
|
-
interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
|
|
279
|
+
export interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
|
|
280
280
|
id: Uuid;
|
|
281
281
|
objectId: Uuid;
|
|
282
282
|
/**
|
|
@@ -372,11 +372,11 @@ interface ObjectRecord<TValues extends Record<string, unknown> = Record<string,
|
|
|
372
372
|
* }
|
|
373
373
|
* ```
|
|
374
374
|
*/
|
|
375
|
-
declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy"];
|
|
375
|
+
export declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy"];
|
|
376
376
|
/**
|
|
377
377
|
* Type for system field names
|
|
378
378
|
*/
|
|
379
|
-
type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
379
|
+
export type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
380
380
|
/**
|
|
381
381
|
* Reserved attribute names that cannot be used for custom attributes.
|
|
382
382
|
* These names conflict with ObjectRecord properties.
|
|
@@ -392,17 +392,16 @@ type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
|
392
392
|
* }
|
|
393
393
|
* ```
|
|
394
394
|
*/
|
|
395
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion", "appearance", "owned_by"];
|
|
395
|
+
export declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion", "appearance", "owned_by"];
|
|
396
396
|
/**
|
|
397
397
|
* Type for reserved attribute names
|
|
398
398
|
*/
|
|
399
|
-
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
399
|
+
export type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
400
400
|
/**
|
|
401
401
|
* Reserved object names: every framework-native object. They cannot be used
|
|
402
402
|
* for user-created (runtime) objects, nor declared by a consumer's builder,
|
|
403
403
|
* registry entry, bundle or schema source — see `native/names.ts`.
|
|
404
404
|
*/
|
|
405
|
-
declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
|
|
406
|
-
type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
|
|
407
|
-
//#endregion
|
|
408
|
-
export { ResourceAccessGrant as A, MAX_PRESET_DEPTH as B, PageAudience as C, RecordAccessSource as D, RecordAccessRole as E, parseAgentDefinitionAccessRole as F, AppearanceFacet as G, APPEARANCE_FACETS as H, parsePageAccessRole as I, ImageShape as J, DEFAULT_APPEARANCE_ICON as K, parseRecordAccessRole as L, UNSHAREABLE_OBJECT_NAMES as M, ViewerAccess as N, RecordAudience as O, deriveViewerAccess as P, DocumentLayout as R, AgentDefinitionAudience as S, RECORD_ACCESS_SOURCES as T, Appearance as U, PresetNode as V, AppearanceEntity as W, ResolvedAppearance as X, ObjectImage as Y, resolveAppearance as Z, Timestamps as _, ObjectRecord as a, ACCESS_ROLES as b, RESERVED_OBJECT_NAMES as c, RecordListScope as d, ReservedAttributeName as f, SystemFieldName as g, SYSTEM_FIELD_NAMES as h, ObjectDefinition as i, ResourceAccessTarget as j, RecordAudienceGrant as k, RESOURCE_VISIBILITIES as l, ResourceVisibility as m, ListViewTabVisibility as n, RECORD_LIST_SCOPES as o, ReservedObjectName as p, IMAGE_SHAPES as q, ObjectAttribute as r, RESERVED_ATTRIBUTE_NAMES as s, LIST_VIEW_TAB_VISIBILITIES as t, RecordAppearance as u, parseRecordListScope as v, RECORD_ACCESS_ROLES as w, AccessRole as x, parseResourceVisibility as y, FolderPreset as z };
|
|
405
|
+
export declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
|
|
406
|
+
export type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
|
|
407
|
+
//#endregion
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Uuid } from "./utils-CRx-eR8T.mjs";
|
|
3
|
+
import { Attribute } from "./attributes-eqr1vdPP.mjs";
|
|
4
4
|
import { ColorId, IconName } from "@standards/constants";
|
|
5
5
|
//#region src/types/appearance.d.ts
|
|
6
6
|
/** Icon used when neither the entity nor its parent has one. */
|
|
7
|
-
declare const DEFAULT_APPEARANCE_ICON: IconName;
|
|
8
|
-
declare const IMAGE_SHAPES: readonly ["circle", "square"];
|
|
9
|
-
type ImageShape = (typeof IMAGE_SHAPES)[number];
|
|
7
|
+
export declare const DEFAULT_APPEARANCE_ICON: IconName;
|
|
8
|
+
export declare const IMAGE_SHAPES: readonly ["circle", "square"];
|
|
9
|
+
export type ImageShape = (typeof IMAGE_SHAPES)[number];
|
|
10
10
|
/**
|
|
11
11
|
* How an object's records wear an image (#5785 §2): the crop, and where the
|
|
12
12
|
* image may be found — an ordered fallback list of the object's `text`
|
|
13
13
|
* attributes, whose lookup kind is inferred (`text().url()` a website,
|
|
14
14
|
* `text().email()` an email, any other `text()` a name).
|
|
15
15
|
*/
|
|
16
|
-
interface ObjectImage {
|
|
16
|
+
export interface ObjectImage {
|
|
17
17
|
shape: ImageShape;
|
|
18
18
|
from?: readonly string[];
|
|
19
19
|
}
|
|
20
20
|
/** The one appearance shape: every entity stores the facets it accepts. */
|
|
21
|
-
interface Appearance {
|
|
21
|
+
export interface Appearance {
|
|
22
22
|
icon?: IconName;
|
|
23
23
|
color?: ColorId;
|
|
24
24
|
imageFileId?: Uuid;
|
|
25
25
|
}
|
|
26
|
-
type AppearanceFacet = "icon" | "color" | "image";
|
|
27
|
-
type AppearanceEntity = "object" | "record" | "emailCategory" | "option" | "view" | "agent" | "user";
|
|
28
|
-
declare const APPEARANCE_FACETS: Record<AppearanceEntity, readonly AppearanceFacet[]>;
|
|
29
|
-
type ResolvedAppearance = {
|
|
26
|
+
export type AppearanceFacet = "icon" | "color" | "image";
|
|
27
|
+
export type AppearanceEntity = "object" | "record" | "emailCategory" | "option" | "view" | "agent" | "user";
|
|
28
|
+
export declare const APPEARANCE_FACETS: Record<AppearanceEntity, readonly AppearanceFacet[]>;
|
|
29
|
+
export type ResolvedAppearance = {
|
|
30
30
|
kind: "image";
|
|
31
31
|
imageFileId: Uuid;
|
|
32
32
|
shape: ImageShape;
|
|
@@ -42,16 +42,16 @@ type Named = Appearance & {
|
|
|
42
42
|
name?: string;
|
|
43
43
|
};
|
|
44
44
|
/** Image wins; else an icon in a colour (own, parent's or derived from the name) is a tile, without colour a glyph. */
|
|
45
|
-
declare function resolveAppearance(entity: Named, parent?: Named & {
|
|
45
|
+
export declare function resolveAppearance(entity: Named, parent?: Named & {
|
|
46
46
|
image?: Pick<ObjectImage, "shape">;
|
|
47
47
|
}): ResolvedAppearance;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/types/document-layout.d.ts
|
|
50
|
-
interface DocumentLayout {
|
|
50
|
+
export interface DocumentLayout {
|
|
51
51
|
/** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
|
|
52
52
|
presets?: FolderPreset[];
|
|
53
53
|
}
|
|
54
|
-
interface FolderPreset {
|
|
54
|
+
export interface FolderPreset {
|
|
55
55
|
id: string;
|
|
56
56
|
label: string;
|
|
57
57
|
icon?: IconName;
|
|
@@ -60,13 +60,13 @@ interface FolderPreset {
|
|
|
60
60
|
/** When true, this preset is auto-instantiated on every new record's drive for the owning object. */
|
|
61
61
|
autoInstantiate?: boolean;
|
|
62
62
|
}
|
|
63
|
-
interface PresetNode {
|
|
63
|
+
export interface PresetNode {
|
|
64
64
|
title: string;
|
|
65
65
|
description?: string;
|
|
66
66
|
children?: PresetNode[];
|
|
67
67
|
}
|
|
68
68
|
/** Max depth allowed for preset.structure to keep instantiation predictable. */
|
|
69
|
-
declare const MAX_PRESET_DEPTH = 5;
|
|
69
|
+
export declare const MAX_PRESET_DEPTH = 5;
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/types/record-access.d.ts
|
|
72
72
|
/**
|
|
@@ -74,17 +74,17 @@ declare const MAX_PRESET_DEPTH = 5;
|
|
|
74
74
|
* 2026-10-08 §3.2): `reader` sees, `runner` also uses (agents only),
|
|
75
75
|
* `editor` also modifies and manages the grants.
|
|
76
76
|
*/
|
|
77
|
-
declare const ACCESS_ROLES: readonly ["reader", "runner", "editor"];
|
|
78
|
-
type AccessRole = (typeof ACCESS_ROLES)[number];
|
|
77
|
+
export declare const ACCESS_ROLES: readonly ["reader", "runner", "editor"];
|
|
78
|
+
export type AccessRole = (typeof ACCESS_ROLES)[number];
|
|
79
79
|
/** Roles a record access grant can carry (spec 2026-09-25 §5.1): a record is never "used". */
|
|
80
|
-
declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
|
|
81
|
-
type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
|
|
80
|
+
export declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
|
|
81
|
+
export type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
|
|
82
82
|
/**
|
|
83
83
|
* Why a grant exists — the equivalent of Salesforce's `RowCause` (spec §3):
|
|
84
84
|
* automatic grants are recomputed without ever touching manual shares.
|
|
85
85
|
*/
|
|
86
|
-
declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
|
|
87
|
-
type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
86
|
+
export declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
|
|
87
|
+
export type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
88
88
|
/**
|
|
89
89
|
* Agent-internal objects whose records are never shared (spec 2026-09-25
|
|
90
90
|
* §5.3.4): the memory resolver reads "private and visible" as "mine", and an
|
|
@@ -92,19 +92,19 @@ type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
|
|
|
92
92
|
* A constant in v1 — a definition flag would mean editing native objects. The
|
|
93
93
|
* server refuses them; the UI hides the share control for them.
|
|
94
94
|
*/
|
|
95
|
-
declare const UNSHAREABLE_OBJECT_NAMES: ReadonlySet<string>;
|
|
95
|
+
export declare const UNSHAREABLE_OBJECT_NAMES: ReadonlySet<string>;
|
|
96
96
|
/** What the reading actor may do with a resource (spec §6.6); records never produce `runner`. */
|
|
97
|
-
type ViewerAccess = "owner" | "editor" | "runner" | "reader" | "workspace";
|
|
97
|
+
export type ViewerAccess = "owner" | "editor" | "runner" | "reader" | "workspace";
|
|
98
98
|
/** One beneficiary of a private resource: its effective role and every source that grants it. */
|
|
99
|
-
interface ResourceAccessGrant<TRole extends AccessRole = AccessRole, TSource extends string = RecordAccessSource> {
|
|
99
|
+
export interface ResourceAccessGrant<TRole extends AccessRole = AccessRole, TSource extends string = RecordAccessSource> {
|
|
100
100
|
actorId: Uuid;
|
|
101
101
|
role: TRole;
|
|
102
102
|
sources: TSource[];
|
|
103
103
|
}
|
|
104
104
|
/** One beneficiary of a private record (shape unchanged since 2026-09-25, D11). */
|
|
105
|
-
type RecordAudienceGrant = ResourceAccessGrant<RecordAccessRole, RecordAccessSource>;
|
|
105
|
+
export type RecordAudienceGrant = ResourceAccessGrant<RecordAccessRole, RecordAccessSource>;
|
|
106
106
|
/** Who can reach a record beyond its owner (`GET /records/:object/:id/access`). */
|
|
107
|
-
interface RecordAudience {
|
|
107
|
+
export interface RecordAudience {
|
|
108
108
|
recordId: Uuid;
|
|
109
109
|
visibility: ResourceVisibility;
|
|
110
110
|
ownedBy: Uuid | null;
|
|
@@ -113,7 +113,7 @@ interface RecordAudience {
|
|
|
113
113
|
grants: RecordAudienceGrant[];
|
|
114
114
|
}
|
|
115
115
|
/** Who can reach an agent definition beyond its owner (`GET /agents/definitions/:id/access`). */
|
|
116
|
-
interface AgentDefinitionAudience {
|
|
116
|
+
export interface AgentDefinitionAudience {
|
|
117
117
|
definitionId: string;
|
|
118
118
|
visibility: ResourceVisibility;
|
|
119
119
|
ownedBy: Uuid | null;
|
|
@@ -122,7 +122,7 @@ interface AgentDefinitionAudience {
|
|
|
122
122
|
grants: ResourceAccessGrant<AccessRole, "manual">[];
|
|
123
123
|
}
|
|
124
124
|
/** Who can reach a private page beyond its owner (`GET /pages/:id/access`). */
|
|
125
|
-
interface PageAudience {
|
|
125
|
+
export interface PageAudience {
|
|
126
126
|
pageId: Uuid;
|
|
127
127
|
visibility: ResourceVisibility;
|
|
128
128
|
ownedBy: Uuid | null;
|
|
@@ -131,7 +131,7 @@ interface PageAudience {
|
|
|
131
131
|
grants: ResourceAccessGrant<RecordAccessRole, "manual">[];
|
|
132
132
|
}
|
|
133
133
|
/** The resource an access operation addresses. */
|
|
134
|
-
type ResourceAccessTarget = {
|
|
134
|
+
export type ResourceAccessTarget = {
|
|
135
135
|
kind: "record";
|
|
136
136
|
object: string;
|
|
137
137
|
id: string;
|
|
@@ -143,18 +143,18 @@ type ResourceAccessTarget = {
|
|
|
143
143
|
id: string;
|
|
144
144
|
};
|
|
145
145
|
/** Narrow an untrusted value (HTTP body, CLI flag) to a record grant role. */
|
|
146
|
-
declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
|
|
146
|
+
export declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
|
|
147
147
|
/** Narrow an untrusted value to an agent definition grant role. */
|
|
148
|
-
declare function parseAgentDefinitionAccessRole(value: unknown): AccessRole;
|
|
148
|
+
export declare function parseAgentDefinitionAccessRole(value: unknown): AccessRole;
|
|
149
149
|
/** Narrow an untrusted value to a page grant role: a page is read or edited, never "used". */
|
|
150
|
-
declare function parsePageAccessRole(value: unknown): RecordAccessRole;
|
|
150
|
+
export declare function parsePageAccessRole(value: unknown): RecordAccessRole;
|
|
151
151
|
/**
|
|
152
152
|
* The single derivation of `viewerAccess`, from the row's owner and the
|
|
153
153
|
* `viewer_grant` storage computed FOR this viewer. A private resource that is
|
|
154
154
|
* neither owned nor granted can only have been read by the system reader,
|
|
155
155
|
* which reads and never writes: `reader`.
|
|
156
156
|
*/
|
|
157
|
-
declare function deriveViewerAccess(resource: {
|
|
157
|
+
export declare function deriveViewerAccess(resource: {
|
|
158
158
|
visibility: ResourceVisibility;
|
|
159
159
|
ownedBy: string | null;
|
|
160
160
|
viewerGrant?: AccessRole | null;
|
|
@@ -162,8 +162,8 @@ declare function deriveViewerAccess(resource: {
|
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/types/objects.d.ts
|
|
164
164
|
/** Visibility scopes shared by resources that can be workspace-wide or actor-private. */
|
|
165
|
-
declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
|
|
166
|
-
type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
165
|
+
export declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
|
|
166
|
+
export type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
167
167
|
/**
|
|
168
168
|
* Scope a list-view tab reads. Deliberately a SEPARATE union from
|
|
169
169
|
* {@link ResourceVisibility}: a stored resource is always exactly one of
|
|
@@ -175,13 +175,13 @@ type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
|
|
|
175
175
|
* the viewer (spec 2026-10-08 §5). Never assign a tab scope to a record's
|
|
176
176
|
* `visibility` column.
|
|
177
177
|
*/
|
|
178
|
-
declare const LIST_VIEW_TAB_VISIBILITIES: readonly ["all", "workspace", "private", "shared"];
|
|
179
|
-
type ListViewTabVisibility = (typeof LIST_VIEW_TAB_VISIBILITIES)[number];
|
|
178
|
+
export declare const LIST_VIEW_TAB_VISIBILITIES: readonly ["all", "workspace", "private", "shared"];
|
|
179
|
+
export type ListViewTabVisibility = (typeof LIST_VIEW_TAB_VISIBILITIES)[number];
|
|
180
180
|
/** The exact scope a record list query may impose: a visibility, or `shared` (owned by someone else, granted to me). */
|
|
181
|
-
declare const RECORD_LIST_SCOPES: readonly ["workspace", "private", "shared"];
|
|
182
|
-
type RecordListScope = (typeof RECORD_LIST_SCOPES)[number];
|
|
181
|
+
export declare const RECORD_LIST_SCOPES: readonly ["workspace", "private", "shared"];
|
|
182
|
+
export type RecordListScope = (typeof RECORD_LIST_SCOPES)[number];
|
|
183
183
|
/** Narrow an untrusted list scope (HTTP body) or reject it — `all` is a tab value, never a query scope. */
|
|
184
|
-
declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
184
|
+
export declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
185
185
|
/**
|
|
186
186
|
* Narrow an untrusted value from an edge (HTTP body, CLI flag) to a
|
|
187
187
|
* {@link ResourceVisibility}, or reject it.
|
|
@@ -197,18 +197,18 @@ declare function parseRecordListScope(value: unknown): RecordListScope;
|
|
|
197
197
|
* Throws {@link ValidationError} rather than a transport exception so it can
|
|
198
198
|
* be used below the controller layer; the HTTP filter maps its code to 400.
|
|
199
199
|
*/
|
|
200
|
-
declare function parseResourceVisibility(value: unknown): ResourceVisibility;
|
|
200
|
+
export declare function parseResourceVisibility(value: unknown): ResourceVisibility;
|
|
201
201
|
/**
|
|
202
202
|
* Timestamps for tracking creation and updates
|
|
203
203
|
*/
|
|
204
|
-
interface Timestamps {
|
|
204
|
+
export interface Timestamps {
|
|
205
205
|
createdAt: Date;
|
|
206
206
|
updatedAt: Date;
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Object definition - Represents a database table/entity
|
|
210
210
|
*/
|
|
211
|
-
interface ObjectDefinition {
|
|
211
|
+
export interface ObjectDefinition {
|
|
212
212
|
id?: Uuid;
|
|
213
213
|
name: string;
|
|
214
214
|
label: string;
|
|
@@ -265,18 +265,18 @@ interface ObjectDefinition {
|
|
|
265
265
|
/**
|
|
266
266
|
* Links an attribute to an object
|
|
267
267
|
*/
|
|
268
|
-
interface ObjectAttribute {
|
|
268
|
+
export interface ObjectAttribute {
|
|
269
269
|
objectId: Uuid;
|
|
270
270
|
attributeId: Uuid;
|
|
271
271
|
order?: number;
|
|
272
272
|
required?: boolean;
|
|
273
273
|
}
|
|
274
274
|
/** A record's own icon and image file (`APPEARANCE_FACETS.record`); each key is absent when unset. */
|
|
275
|
-
type RecordAppearance = Pick<Appearance, "icon" | "imageFileId">;
|
|
275
|
+
export type RecordAppearance = Pick<Appearance, "icon" | "imageFileId">;
|
|
276
276
|
/**
|
|
277
277
|
* Record - Instance of an Object (a row in the database)
|
|
278
278
|
*/
|
|
279
|
-
interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
|
|
279
|
+
export interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
|
|
280
280
|
id: Uuid;
|
|
281
281
|
objectId: Uuid;
|
|
282
282
|
/**
|
|
@@ -372,11 +372,11 @@ interface ObjectRecord<TValues extends Record<string, unknown> = Record<string,
|
|
|
372
372
|
* }
|
|
373
373
|
* ```
|
|
374
374
|
*/
|
|
375
|
-
declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy"];
|
|
375
|
+
export declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy"];
|
|
376
376
|
/**
|
|
377
377
|
* Type for system field names
|
|
378
378
|
*/
|
|
379
|
-
type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
379
|
+
export type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
380
380
|
/**
|
|
381
381
|
* Reserved attribute names that cannot be used for custom attributes.
|
|
382
382
|
* These names conflict with ObjectRecord properties.
|
|
@@ -392,17 +392,16 @@ type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
|
392
392
|
* }
|
|
393
393
|
* ```
|
|
394
394
|
*/
|
|
395
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion", "appearance", "owned_by"];
|
|
395
|
+
export declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion", "appearance", "owned_by"];
|
|
396
396
|
/**
|
|
397
397
|
* Type for reserved attribute names
|
|
398
398
|
*/
|
|
399
|
-
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
399
|
+
export type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
400
400
|
/**
|
|
401
401
|
* Reserved object names: every framework-native object. They cannot be used
|
|
402
402
|
* for user-created (runtime) objects, nor declared by a consumer's builder,
|
|
403
403
|
* registry entry, bundle or schema source — see `native/names.ts`.
|
|
404
404
|
*/
|
|
405
|
-
declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
|
|
406
|
-
type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
|
|
407
|
-
//#endregion
|
|
408
|
-
export { ResourceAccessGrant as A, MAX_PRESET_DEPTH as B, PageAudience as C, RecordAccessSource as D, RecordAccessRole as E, parseAgentDefinitionAccessRole as F, AppearanceFacet as G, APPEARANCE_FACETS as H, parsePageAccessRole as I, ImageShape as J, DEFAULT_APPEARANCE_ICON as K, parseRecordAccessRole as L, UNSHAREABLE_OBJECT_NAMES as M, ViewerAccess as N, RecordAudience as O, deriveViewerAccess as P, DocumentLayout as R, AgentDefinitionAudience as S, RECORD_ACCESS_SOURCES as T, Appearance as U, PresetNode as V, AppearanceEntity as W, ResolvedAppearance as X, ObjectImage as Y, resolveAppearance as Z, Timestamps as _, ObjectRecord as a, ACCESS_ROLES as b, RESERVED_OBJECT_NAMES as c, RecordListScope as d, ReservedAttributeName as f, SystemFieldName as g, SYSTEM_FIELD_NAMES as h, ObjectDefinition as i, ResourceAccessTarget as j, RecordAudienceGrant as k, RESOURCE_VISIBILITIES as l, ResourceVisibility as m, ListViewTabVisibility as n, RECORD_LIST_SCOPES as o, ReservedObjectName as p, IMAGE_SHAPES as q, ObjectAttribute as r, RESERVED_ATTRIBUTE_NAMES as s, LIST_VIEW_TAB_VISIBILITIES as t, RecordAppearance as u, parseRecordListScope as v, RECORD_ACCESS_ROLES as w, AccessRole as x, parseResourceVisibility as y, FolderPreset as z };
|
|
405
|
+
export declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
|
|
406
|
+
export type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
|
|
407
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import"./zod-locale.mjs";import{DEFAULT_VALIDATION_MESSAGES as e}from"./core-rKI7Q9_U.mjs";import*as t from"zod";import{getCountryByIso3 as n,isValidIso3 as r,stripTrunkPrefix as i}from"@standards/constants";import{parsePhoneNumberFromString as a}from"libphonenumber-js";function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return n(e)?.iso2}function normalizePhoneNumber(e,t){if(!e)return``;let r=getIso2(t);if(!r)return digitsOnly(e);let o=a(e,r);if(o)return absorbDoubledCallingCode(o.nationalNumber,o.isValid(),t,r);let s=n(t),c=digitsOnly(e);if(s){let e=s.phoneCode.replace(`+`,``),t=c.startsWith(e)?c.slice(e.length):c;return i(t,s.phoneTrunkPrefix??``)}return c}function absorbDoubledCallingCode(e,t,r,i){if(t)return e;let o=n(r)?.phoneCode.replace(`+`,``);if(o===void 0||!e.startsWith(o))return e;let s=e.slice(o.length),c=a(`+${o}${s}`,i);return c?.isValid()?c.nationalNumber:e}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let t=getIso2(e.countryCode),r=n(e.countryCode)?.phoneCode??``;if(!t)return`${r} ${e.phoneNumber}`.trim();let i=`${r}${digitsOnly(e.phoneNumber)}`,o=a(i);return o?o.formatInternational():`${r} ${e.phoneNumber}`.trim()}function createPhoneValidator(n,i=e){return t.object({countryCode:t.string().length(3),phoneNumber:t.string().min(1,{message:i.required(n)})},{message:i.invalidPhone(n)}).refine(e=>r(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}export{createPhoneValidator,formatPhoneForDisplay,getIso2,normalizeCountrylessPhoneNumber,normalizePhoneNumber};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./rolldown-runtime-DETHMehu.js");require("./zod-locale.js");const t=require("./core-DAxRlJ5i.js");let n=require("zod");n=e.__toESM(n);let r=require("@standards/constants"),i=require("libphonenumber-js");function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return(0,r.getCountryByIso3)(e)?.iso2}function normalizePhoneNumber(e,t){if(!e)return``;let n=getIso2(t);if(!n)return digitsOnly(e);let a=(0,i.parsePhoneNumberFromString)(e,n);if(a)return absorbDoubledCallingCode(a.nationalNumber,a.isValid(),t,n);let o=(0,r.getCountryByIso3)(t),s=digitsOnly(e);if(o){let e=o.phoneCode.replace(`+`,``),t=s.startsWith(e)?s.slice(e.length):s;return(0,r.stripTrunkPrefix)(t,o.phoneTrunkPrefix??``)}return s}function absorbDoubledCallingCode(e,t,n,a){if(t)return e;let o=(0,r.getCountryByIso3)(n)?.phoneCode.replace(`+`,``);if(o===void 0||!e.startsWith(o))return e;let s=e.slice(o.length),c=(0,i.parsePhoneNumberFromString)(`+${o}${s}`,a);return c?.isValid()?c.nationalNumber:e}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let t=getIso2(e.countryCode),n=(0,r.getCountryByIso3)(e.countryCode)?.phoneCode??``;if(!t)return`${n} ${e.phoneNumber}`.trim();let a=`${n}${digitsOnly(e.phoneNumber)}`,o=(0,i.parsePhoneNumberFromString)(a);return o?o.formatInternational():`${n} ${e.phoneNumber}`.trim()}function createPhoneValidator(e,i=t.DEFAULT_VALIDATION_MESSAGES){return n.object({countryCode:n.string().length(3),phoneNumber:n.string().min(1,{message:i.required(e)})},{message:i.invalidPhone(e)}).refine(e=>(0,r.isValidIso3)(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}Object.defineProperty(exports,"createPhoneValidator",{enumerable:!0,get:function(){return createPhoneValidator}}),Object.defineProperty(exports,"formatPhoneForDisplay",{enumerable:!0,get:function(){return formatPhoneForDisplay}}),Object.defineProperty(exports,"getIso2",{enumerable:!0,get:function(){return getIso2}}),Object.defineProperty(exports,"normalizeCountrylessPhoneNumber",{enumerable:!0,get:function(){return normalizeCountrylessPhoneNumber}}),Object.defineProperty(exports,"normalizePhoneNumber",{enumerable:!0,get:function(){return normalizePhoneNumber}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=[`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}});
|