@stndrds/schema 1.0.0-alpha.332 → 1.0.0-alpha.335
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-DilIWUev.d.mts → all-hyIoY9Y2.d.mts} +21 -9
- package/dist/{all-CWDgBPuS.d.ts → all-m7G8bXjY.d.ts} +21 -9
- package/dist/{checkbox-preO352q.d.mts → checkbox-DGuL9Z3k.d.mts} +2 -2
- package/dist/{checkbox-CjnTd8DE.d.ts → checkbox-DIk051px.d.ts} +2 -2
- package/dist/{config-BQJJHopR.js → config-BvijG1IN.js} +5 -5
- package/dist/{config-_sOeudpS.mjs → config-aeELOnWd.mjs} +5 -5
- package/dist/{date-CxwHkbid.d.ts → date-B4ZumBBO.d.ts} +2 -2
- package/dist/{date-BL3UHIXs.d.mts → date-D7P9JtGg.d.mts} +2 -2
- package/dist/{exceptions-DGCzCc9t.d.mts → exceptions-DG_iMvYs.d.mts} +5 -2
- package/dist/{exceptions-DGCzCc9t.d.ts → exceptions-DG_iMvYs.d.ts} +5 -2
- package/dist/exceptions.d.mts +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/{index-BoUwfrDH.d.mts → index--ukNqScY.d.mts} +2 -2
- package/dist/{index-DqwNrDSp.d.ts → index-B6DXIuf2.d.ts} +2 -2
- package/dist/{index-XtmC-C7J.d.mts → index-CK7gaSRm.d.mts} +1 -1
- package/dist/{index-Uwy7CTKo.d.ts → index-CePzb28P.d.ts} +1 -1
- package/dist/{index-B7HmBsUS.d.ts → index-ZnCTYc93.d.ts} +1 -1
- package/dist/{index-C8M7Amy9.d.mts → index-gM_g_Y_H.d.mts} +1 -1
- package/dist/index.d.mts +104 -17
- package/dist/index.d.ts +104 -17
- package/dist/index.js +2 -2
- package/dist/index.mjs +9 -9
- package/dist/{number-GmD5PM5s.d.ts → number-BMX9OJ46.d.ts} +2 -2
- package/dist/{number-Ddi_YYfm.d.mts → number-DYExtkZN.d.mts} +2 -2
- package/dist/{object-DGu0m2Y1.js → object-BfGtzS7g.js} +2 -2
- package/dist/object-D-aDCAHn.mjs +4 -0
- package/dist/phone-CUgSbH-z.js +2 -0
- package/dist/phone-X_nKo0qe.mjs +2 -0
- package/dist/{text-D6UypN8p.d.ts → text-6w5qf9V1.d.ts} +2 -2
- package/dist/{text-CxwF5K4k.d.mts → text-BwN_Y1Du.d.mts} +2 -2
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/validation/all.d.mts +4 -4
- package/dist/validation/all.d.ts +4 -4
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/phone.js +1 -1
- package/dist/validation/complex/phone.mjs +1 -1
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/view-config.schema-4QhPV9el.js +2 -0
- package/dist/view-config.schema-CMjVNRCh.mjs +2 -0
- package/package.json +2 -2
- package/dist/object-DSRy1coV.mjs +0 -4
- package/dist/phone-BawtTYVi.mjs +0 -2
- package/dist/phone-DVaELsa3.js +0 -2
- package/dist/view-config.schema-B4AkqLKQ.mjs +0 -2
- package/dist/view-config.schema-to6p1m8L.js +0 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { Tt as RollupAttribute, Y as Attribute, Z as AttributeType } from "./exceptions-
|
|
3
|
-
import { m as ListViewTabVisibility } from "./index
|
|
4
|
-
import "./index-
|
|
5
|
-
import "./index-
|
|
6
|
-
import "./text-
|
|
7
|
-
import "./number-
|
|
8
|
-
import "./checkbox-
|
|
9
|
-
import "./date-
|
|
2
|
+
import { Tt as RollupAttribute, Y as Attribute, Z as AttributeType } from "./exceptions-DG_iMvYs.mjs";
|
|
3
|
+
import { m as ListViewTabVisibility } from "./index--ukNqScY.mjs";
|
|
4
|
+
import "./index-gM_g_Y_H.mjs";
|
|
5
|
+
import "./index-CK7gaSRm.mjs";
|
|
6
|
+
import "./text-BwN_Y1Du.mjs";
|
|
7
|
+
import "./number-DYExtkZN.mjs";
|
|
8
|
+
import "./checkbox-DGuL9Z3k.mjs";
|
|
9
|
+
import "./date-D7P9JtGg.mjs";
|
|
10
10
|
import { IconName } from "@stndrds/constants";
|
|
11
11
|
import { z as z$1 } from "zod";
|
|
12
12
|
//#region src/types/filters.d.ts
|
|
@@ -158,6 +158,17 @@ declare const NO_VALUE_OPERATORS: readonly NoValueOperator[];
|
|
|
158
158
|
* Check if an operator requires a value
|
|
159
159
|
*/
|
|
160
160
|
declare function isNoValueOperator(operator: FilterOperator): operator is NoValueOperator;
|
|
161
|
+
/**
|
|
162
|
+
* The operators a rule may carry on an attribute known by TYPE alone — the
|
|
163
|
+
* filter generator's catalogue, shared by the server that offers it and the
|
|
164
|
+
* client that reads the answer back so the two cannot drift (#3629).
|
|
165
|
+
*
|
|
166
|
+
* A rollup's real operators depend on its aggregation, which the wire shape
|
|
167
|
+
* does not carry and `OPERATORS_BY_TYPE` therefore excludes; presence is the
|
|
168
|
+
* one question every rollup answers, so that is what it gets. An unknown type
|
|
169
|
+
* carries nothing.
|
|
170
|
+
*/
|
|
171
|
+
declare function filterOperatorsByTypeForGeneration(type: string): readonly FilterOperator[];
|
|
161
172
|
/**
|
|
162
173
|
* Get the filter operators for a rollup attribute based on its aggregation function and target type.
|
|
163
174
|
*
|
|
@@ -334,6 +345,7 @@ declare const SCHEMA_LIMITS: {
|
|
|
334
345
|
readonly historyMax: 50;
|
|
335
346
|
readonly iconQueries: 5;
|
|
336
347
|
readonly iconResults: 20;
|
|
348
|
+
readonly labelLength: 128;
|
|
337
349
|
};
|
|
338
350
|
//#endregion
|
|
339
351
|
//#region src/validation/primitives.d.ts
|
|
@@ -1183,4 +1195,4 @@ declare const draftContentViewDefinitionSchema: z$1.ZodObject<{
|
|
|
1183
1195
|
}, z$1.core.$strict>;
|
|
1184
1196
|
declare const contentViewDefinitionSchema: z$1.ZodType<ContentViewDefinition>;
|
|
1185
1197
|
//#endregion
|
|
1186
|
-
export { QueryState as $, FormContentDefinition as A, DayMonthValue as B, ContentOpenMode as C, CustomContentDefinition as D, ContentViewDefinition as E, MeetingsContentDefinition as F, FilterOperator as G, EdgeQuantifier as H, RichtextContentDefinition as I, FilterValue as J, FilterRule as K, ViewContentDefinition as L, FormsContentDefinition as M, KanbanCollectionContentDefinition as N, DocumentsContentDefinition as O, ListViewLayout as P, PhoneFilterValue as Q, ViewRead as R, ContentFieldGroup as S, ContentViewContext as T, ExtendedFilterRule as U, DynamicValue as V, FilterCombinator as W, NoValueOperator as X, NO_VALUE_OPERATORS as Y, OPERATORS_BY_TYPE as Z, CollectionContentDefinition as _, contentViewDefinitionSchemaFor as a, ContentCreateMode as b, draftContentViewDefinitionSchemaFor as c, sortsSchema as d, RelativeDateValue as et, colorIdSchema as f, CollectionAction as g, ActivityContentDefinition as h, contentViewDefinitionSchema as i,
|
|
1198
|
+
export { QueryState as $, FormContentDefinition as A, DayMonthValue as B, ContentOpenMode as C, CustomContentDefinition as D, ContentViewDefinition as E, MeetingsContentDefinition as F, FilterOperator as G, EdgeQuantifier as H, RichtextContentDefinition as I, FilterValue as J, FilterRule as K, ViewContentDefinition as L, FormsContentDefinition as M, KanbanCollectionContentDefinition as N, DocumentsContentDefinition as O, ListViewLayout as P, PhoneFilterValue as Q, ViewRead as R, ContentFieldGroup as S, ContentViewContext as T, ExtendedFilterRule as U, DynamicValue as V, FilterCombinator as W, NoValueOperator as X, NO_VALUE_OPERATORS as Y, OPERATORS_BY_TYPE as Z, CollectionContentDefinition as _, contentViewDefinitionSchemaFor as a, isNoValueOperator as at, ContentCreateMode as b, draftContentViewDefinitionSchemaFor as c, sortsSchema as d, RelativeDateValue as et, colorIdSchema as f, CollectionAction as g, ActivityContentDefinition as h, contentViewDefinitionSchema as i, getRollupFilterOperators as it, FormDensity as j, EmailsContentDefinition as k, filterStateSchema as l, SCHEMA_LIMITS as m, collectionContentSourceSchema as n, SortRule as nt, displayAttributesSchema as o, iconNameSchema as p, FilterState as q, columnsSchema as r, filterOperatorsByTypeForGeneration as rt, draftContentViewDefinitionSchema as s, AsideRule as t, SortDirection as tt, publishedViewContentDefinitionSchema as u, CollectionContentSource as v, ContentPlacement as w, ContentField as x, ColumnReference as y, CurrencyFilterValue as z };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { Tt as RollupAttribute, Y as Attribute, Z as AttributeType } from "./exceptions-
|
|
3
|
-
import { m as ListViewTabVisibility } from "./index-
|
|
4
|
-
import "./index-
|
|
5
|
-
import "./index-
|
|
6
|
-
import "./text-
|
|
7
|
-
import "./number-
|
|
8
|
-
import "./checkbox-
|
|
9
|
-
import "./date-
|
|
2
|
+
import { Tt as RollupAttribute, Y as Attribute, Z as AttributeType } from "./exceptions-DG_iMvYs.js";
|
|
3
|
+
import { m as ListViewTabVisibility } from "./index-B6DXIuf2.js";
|
|
4
|
+
import "./index-CePzb28P.js";
|
|
5
|
+
import "./index-ZnCTYc93.js";
|
|
6
|
+
import "./text-6w5qf9V1.js";
|
|
7
|
+
import "./number-BMX9OJ46.js";
|
|
8
|
+
import "./checkbox-DIk051px.js";
|
|
9
|
+
import "./date-B4ZumBBO.js";
|
|
10
10
|
import { z as z$1 } from "zod";
|
|
11
11
|
import { IconName } from "@stndrds/constants";
|
|
12
12
|
//#region src/types/filters.d.ts
|
|
@@ -158,6 +158,17 @@ declare const NO_VALUE_OPERATORS: readonly NoValueOperator[];
|
|
|
158
158
|
* Check if an operator requires a value
|
|
159
159
|
*/
|
|
160
160
|
declare function isNoValueOperator(operator: FilterOperator): operator is NoValueOperator;
|
|
161
|
+
/**
|
|
162
|
+
* The operators a rule may carry on an attribute known by TYPE alone — the
|
|
163
|
+
* filter generator's catalogue, shared by the server that offers it and the
|
|
164
|
+
* client that reads the answer back so the two cannot drift (#3629).
|
|
165
|
+
*
|
|
166
|
+
* A rollup's real operators depend on its aggregation, which the wire shape
|
|
167
|
+
* does not carry and `OPERATORS_BY_TYPE` therefore excludes; presence is the
|
|
168
|
+
* one question every rollup answers, so that is what it gets. An unknown type
|
|
169
|
+
* carries nothing.
|
|
170
|
+
*/
|
|
171
|
+
declare function filterOperatorsByTypeForGeneration(type: string): readonly FilterOperator[];
|
|
161
172
|
/**
|
|
162
173
|
* Get the filter operators for a rollup attribute based on its aggregation function and target type.
|
|
163
174
|
*
|
|
@@ -334,6 +345,7 @@ declare const SCHEMA_LIMITS: {
|
|
|
334
345
|
readonly historyMax: 50;
|
|
335
346
|
readonly iconQueries: 5;
|
|
336
347
|
readonly iconResults: 20;
|
|
348
|
+
readonly labelLength: 128;
|
|
337
349
|
};
|
|
338
350
|
//#endregion
|
|
339
351
|
//#region src/validation/primitives.d.ts
|
|
@@ -1183,4 +1195,4 @@ declare const draftContentViewDefinitionSchema: z$1.ZodObject<{
|
|
|
1183
1195
|
}, z$1.core.$strict>;
|
|
1184
1196
|
declare const contentViewDefinitionSchema: z$1.ZodType<ContentViewDefinition>;
|
|
1185
1197
|
//#endregion
|
|
1186
|
-
export { QueryState as $, FormContentDefinition as A, DayMonthValue as B, ContentOpenMode as C, CustomContentDefinition as D, ContentViewDefinition as E, MeetingsContentDefinition as F, FilterOperator as G, EdgeQuantifier as H, RichtextContentDefinition as I, FilterValue as J, FilterRule as K, ViewContentDefinition as L, FormsContentDefinition as M, KanbanCollectionContentDefinition as N, DocumentsContentDefinition as O, ListViewLayout as P, PhoneFilterValue as Q, ViewRead as R, ContentFieldGroup as S, ContentViewContext as T, ExtendedFilterRule as U, DynamicValue as V, FilterCombinator as W, NoValueOperator as X, NO_VALUE_OPERATORS as Y, OPERATORS_BY_TYPE as Z, CollectionContentDefinition as _, contentViewDefinitionSchemaFor as a, ContentCreateMode as b, draftContentViewDefinitionSchemaFor as c, sortsSchema as d, RelativeDateValue as et, colorIdSchema as f, CollectionAction as g, ActivityContentDefinition as h, contentViewDefinitionSchema as i,
|
|
1198
|
+
export { QueryState as $, FormContentDefinition as A, DayMonthValue as B, ContentOpenMode as C, CustomContentDefinition as D, ContentViewDefinition as E, MeetingsContentDefinition as F, FilterOperator as G, EdgeQuantifier as H, RichtextContentDefinition as I, FilterValue as J, FilterRule as K, ViewContentDefinition as L, FormsContentDefinition as M, KanbanCollectionContentDefinition as N, DocumentsContentDefinition as O, ListViewLayout as P, PhoneFilterValue as Q, ViewRead as R, ContentFieldGroup as S, ContentViewContext as T, ExtendedFilterRule as U, DynamicValue as V, FilterCombinator as W, NoValueOperator as X, NO_VALUE_OPERATORS as Y, OPERATORS_BY_TYPE as Z, CollectionContentDefinition as _, contentViewDefinitionSchemaFor as a, isNoValueOperator as at, ContentCreateMode as b, draftContentViewDefinitionSchemaFor as c, sortsSchema as d, RelativeDateValue as et, colorIdSchema as f, CollectionAction as g, ActivityContentDefinition as h, contentViewDefinitionSchema as i, getRollupFilterOperators as it, FormDensity as j, EmailsContentDefinition as k, filterStateSchema as l, SCHEMA_LIMITS as m, collectionContentSourceSchema as n, SortRule as nt, displayAttributesSchema as o, iconNameSchema as p, FilterState as q, columnsSchema as r, filterOperatorsByTypeForGeneration as rt, draftContentViewDefinitionSchema as s, AsideRule as t, SortDirection as tt, publishedViewContentDefinitionSchema as u, CollectionContentSource as v, ContentPlacement as w, ContentField as x, ColumnReference as y, CurrencyFilterValue as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { et as CheckboxAttribute } from "./exceptions-
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { et as CheckboxAttribute } from "./exceptions-DG_iMvYs.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-CK7gaSRm.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/checkbox.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { et as CheckboxAttribute } from "./exceptions-
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { et as CheckboxAttribute } from "./exceptions-DG_iMvYs.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-ZnCTYc93.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/checkbox.d.ts
|
|
6
6
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,__copyProps=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},__toESM=(n,r,o)=>(o=n==null?{}:e(i(n)),__copyProps(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));const o=require("./exceptions.js");let s=require("@stndrds/constants"),c=require("zod");c=__toESM(c);const l=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return l.includes(e)}const u=[`workspace`,`private`],d=[`all`,...u];function parseResourceVisibility(e){if(typeof e==`string`&&u.includes(e))return e;throw new o.ValidationError(`visibility must be one of: ${u.join(`, `)} (received: ${String(e)})`,[])}const f=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],p=[...f,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`owned_by`],
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,__copyProps=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},__toESM=(n,r,o)=>(o=n==null?{}:e(i(n)),__copyProps(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));const o=require("./exceptions.js");let s=require("@stndrds/constants"),c=require("zod");c=__toESM(c);const l=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return l.includes(e)}const u=[`workspace`,`private`],d=[`all`,...u];function parseResourceVisibility(e){if(typeof e==`string`&&u.includes(e))return e;throw new o.ValidationError(`visibility must be one of: ${u.join(`, `)} (received: ${String(e)})`,[])}const f=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],p=[...f,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`owned_by`],m=l,h={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20,labelLength:128},ee=Object.keys(s.COLORS),te=new Set(s.ICONS),g=c.z.enum(ee).describe(`A color id from the palette`),_=c.z.string().superRefine((e,t)=>{te.has(e)||t.addIssue({code:`custom`,message:`Invalid icon name`})}).transform(e=>e),ne=new Set(s.ICONS),v=/^[a-zA-Z_][a-zA-Z0-9_]*$/,re=/^[a-z][a-z0-9-]*$/,y=h.labelLength,b=c.default.string().min(1,`Object name cannot be empty`).max(63,`Object name is too long (max 63 characters)`).regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
|
|
3
3
|
Name must be in kebab-case (slug format):
|
|
4
4
|
✅ Valid: 'products', 'user-profiles', 'order-items'
|
|
5
|
-
❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(e){try{
|
|
5
|
+
❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(e){try{b.parse(e)}catch(e){throw e instanceof c.default.ZodError?new o.SchemaError(e.issues[0].message,o.SchemaErrorCode.INVALID_OBJECT_NAME):e}}function validateViewName(e){if(!e||e.length===0)throw new o.ValidationError(`View name cannot be empty`,[{path:[`name`],message:`View name cannot be empty`}]);if(e.length>63)throw new o.ValidationError(`View name is too long`,[{path:[`name`],message:`View name is too long (max 63 characters)`}]);if(!re.test(e))throw new o.ValidationError(`Invalid view name format`,[{path:[`name`],message:`View name must be in kebab-case (e.g., 'detail', 'list-view')`}])}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw n(e);r.add(e)}}const x=c.default.string().min(1,`Attribute name cannot be empty`).max(63,`Attribute name is too long (max 63 characters)`).regex(v,{message:`Invalid attribute name format.
|
|
6
6
|
Name must be a valid variable identifier:
|
|
7
7
|
✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
8
|
-
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!p.includes(e),{message:`This is a reserved attribute name. Reserved names: ${p.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!
|
|
8
|
+
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!p.includes(e),{message:`This is a reserved attribute name. Reserved names: ${p.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!v.test(e))throw Error(`[AttributeBuilder] Invalid attribute name format.
|
|
9
9
|
Name must be a valid variable identifier:
|
|
10
10
|
✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
11
|
-
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(p.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${p.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>
|
|
11
|
+
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(p.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${p.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>y)throw Error(`[AttributeBuilder] Attribute label is too long (max ${y} characters)`)}function validateIconName(e,t){if(!ne.has(e))throw Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.\nIcon must be one of the predefined icons from @stndrds/constants.`)}function validateOptions(e,t){let n=new Set;for(let r of t){if(!r.value?.trim())throw Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!r.label?.trim())throw Error(`[AttributeBuilder] Option "${r.value}" in "${e}" has an empty or missing label.`);if(n.has(r.value))throw Error(`[AttributeBuilder] Duplicate option value "${r.value}" in "${e}".`);n.add(r.value)}for(let n of t){if(n.inverse===void 0)continue;let r=t.find(e=>e.value===n.inverse);if(!r)throw Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(r.inverse!==n.value)throw Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${r.inverse??`(none)`}". Inverse pairs must be symmetric.`)}}var ComputedFormulaParseError=class extends Error{constructor(e){super(e),this.name=`ComputedFormulaParseError`}};function parseComputedFormula(e){let t=new Parser(tokenize(e)),n=t.parseExpression();return t.expectEnd(),n}function tokenize(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===` `||r===` `||r===`
|
|
12
12
|
`||r===`\r`){n+=1;continue}if(r===`"`||r===`'`){let i=scanString(e,n,r);t.push({kind:`string`,value:i.value,position:n}),n=i.nextIndex;continue}if(isDigit(r)){let r=scanNumber(e,n);t.push({kind:`number`,value:r.value,position:n}),n=r.nextIndex;continue}if(isIdentifierStart(r)){let r=scanIdentifier(e,n),i=r.value.toLowerCase();i===`true`?t.push({kind:`boolean`,value:!0,position:n}):i===`false`?t.push({kind:`boolean`,value:!1,position:n}):i===`null`?t.push({kind:`null`,position:n}):t.push({kind:`identifier`,value:r.value,position:n}),n=r.nextIndex;continue}let i=e.slice(n,n+2);if(i===`>=`||i===`<=`||i===`==`||i===`!=`){t.push({kind:`operator`,value:i,position:n}),n+=2;continue}if(r===`>`||r===`<`||r===`+`||r===`-`||r===`*`||r===`/`){t.push({kind:`operator`,value:r,position:n}),n+=1;continue}if(r===`(`||r===`)`||r===`,`||r===`.`){t.push({kind:`punctuation`,value:r,position:n}),n+=1;continue}throw new ComputedFormulaParseError(`Unexpected character "${r}" at position ${n}`)}return t}function scanString(e,t,n=`"`){let r=``,i=t+1;for(;i<e.length;){let t=e[i];if(t===n)return{value:r,nextIndex:i+1};if(t===`\\`){let t=e[i+1];if(t===void 0)throw new ComputedFormulaParseError(`Unterminated string literal at position ${i}`);r+=decodeEscape(t,i),i+=2;continue}r+=t,i+=1}throw new ComputedFormulaParseError(`Unterminated string literal at position ${t}`)}function decodeEscape(e,t){switch(e){case`"`:case`\\`:return e;case`n`:return`
|
|
13
|
-
`;case`r`:return`\r`;case`t`:return` `;default:throw new ComputedFormulaParseError(`Unknown escape sequence "\\${e}" at position ${t}`)}}function scanNumber(e,t){let n=t;for(;n<e.length&&isDigit(e[n]);)n+=1;if(e[n]===`.`){let t=n;if(n+=1,!isDigit(e[n]))throw new ComputedFormulaParseError(`Invalid number literal at position ${t}`);for(;n<e.length&&isDigit(e[n]);)n+=1}let r=e.slice(t,n),i=Number(r);if(!Number.isFinite(i))throw new ComputedFormulaParseError(`Invalid number literal "${r}"`);return{value:i,nextIndex:n}}function scanIdentifier(e,t){let n=t+1;for(;n<e.length&&isIdentifierPart(e[n]);)n+=1;return{value:e.slice(t,n),nextIndex:n}}function isDigit(e){return e!==void 0&&e>=`0`&&e<=`9`}function isIdentifierStart(e){return e!==void 0&&/[A-Za-z_]/.test(e)}function isIdentifierPart(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}var Parser=class{constructor(e){this.tokens=e,this.position=0}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new ComputedFormulaParseError(`Unexpected token ${describeToken(e)} at position ${e.position}`)}parseBinaryExpression(e){let t=this.parsePrimary();for(;;){let n=this.peek();if(n?.kind!==`operator`)return t;let r=getOperatorPrecedence(n.value);if(r<e)return t;let i=n.value;this.consume();let a=this.parseBinaryExpression(r+1);t={kind:`binary`,operator:i,left:t,right:a}}}parsePrimary(){let e=this.consume();if(e===void 0)throw new ComputedFormulaParseError(`Unexpected end of expression`);switch(e.kind){case`string`:case`number`:case`boolean`:return{kind:`literal`,value:e.value};case`null`:return{kind:`literal`,value:null};case`identifier`:return this.parseIdentifier(e.value);case`punctuation`:if(e.value===`(`){let e=this.parseExpression();return this.expectPunctuation(`)`),e}break;case`operator`:if(e.value===`-`){let e=this.consume();if(e?.kind===`number`)return{kind:`literal`,value:-e.value}}}throw new ComputedFormulaParseError(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation(`(`)){let t=[];if(!this.matchPunctuation(`)`)){do t.push(this.parseExpression());while(this.matchPunctuation(`,`));this.expectPunctuation(`)`)}return{kind:`call`,functionName:e.toLowerCase(),args:t}}let t=[e];for(;this.matchPunctuation(`.`);){let e=this.consume();if(e?.kind!==`identifier`)throw new ComputedFormulaParseError(`Expected attribute name after path separator at position ${e?.position??this.previousPosition()}`);t.push(e.value)}return{kind:`path`,parts:t}}expectPunctuation(e){if(!this.matchPunctuation(e))throw new ComputedFormulaParseError(`Expected "${e}" at position ${this.peek()?.position??this.previousPosition()}`)}matchPunctuation(e){let t=this.peek();return t?.kind===`punctuation`&&t.value===e&&(this.consume(),!0)}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};function describeToken(e){switch(e.kind){case`identifier`:case`number`:case`string`:case`boolean`:case`operator`:case`punctuation`:return`"${String(e.value)}"`;case`null`:return`"null"`;default:return e}}function getOperatorPrecedence(e){switch(e){case`*`:case`/`:return 3;case`+`:case`-`:return 2;case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return 1;default:return e}}const x=c.z.object({placeholder:c.z.string().optional(),description:c.z.string().optional(),defaultValue:c.z.unknown().optional(),icon:c.z.string().optional(),order:c.z.number().int().optional(),hidden:c.z.boolean().optional(),archived:c.z.boolean().optional(),deprecated:c.z.boolean().optional(),metadata:c.z.record(c.z.string(),c.z.unknown()).optional()}),S=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`];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 C=c.z.object({value:c.z.string().min(1).describe(`Stored value`),label:c.z.string().min(1).describe(`Label people see`),description:c.z.string().describe(`Extra context`).optional(),inverse:c.z.string().describe(`Paired option's value (symmetric)`).optional(),archived:c.z.boolean().describe(`Hides without deleting`).optional()}),w=c.z.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),T=C.extend({color:y}).strict(),E=T,D=C.extend({color:y,group:w}).strict(),O=C.extend({color:c.z.string().optional().describe(`A color id`),group:w.optional()}).strict(),k=c.z.array(O).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 c.z.array(e).min(1).max(v.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 A=writeOptionsArraySchema(T),j=writeOptionsArraySchema(E),M=writeOptionsArraySchema(D),ie=c.z.object({object:c.z.string().min(1).describe(`Target object`),displayTemplate:c.z.string().optional().describe(`Linked record label template`),filter:c.z.record(c.z.string(),c.z.unknown()).optional().describe(`Restricts linkable records`)}),ae=c.z.object({object:c.z.string().min(1).describe(`Other side's object`),attribute:c.z.string().min(1).describe(`Other side's attribute`),cardinality:c.z.enum([`one`,`many`]).optional().describe(`Other side's cardinality`),label:c.z.string().min(1).optional().describe(`Other side's label`),storageOwner:c.z.boolean().optional().describe(`Owns the join storage`)}),N=c.z.object({objectName:c.z.string().min(1).describe(`API name of the object whose options are mirrored`),attributeName:c.z.string().min(1).describe(`API name of the select/status attribute to mirror options from`),attributeId:c.z.string().optional().describe(`Id of the source attribute, resolved by the server`)}),P=x.extend({multiline:c.z.boolean().describe(`Renders as a multi-line textarea`).optional(),minLength:c.z.number().int().min(0).describe(`Minimum character count`).optional(),maxLength:c.z.number().int().min(1).describe(`Maximum character count`).optional(),pattern:c.z.string().describe(`Regular expression the value must match`).optional(),format:c.z.enum([`email`,`url`,`slug`]).describe(`Validates and renders as this format`).optional()}),oe=x,F=x.extend({renderAs:c.z.enum([`number`,`rating`]).describe(`Plain number or a star rating`).optional(),min:c.z.number().describe(`Minimum allowed value`).optional(),max:c.z.number().describe(`Maximum allowed value`).optional(),unit:c.z.enum([`integer`,`decimal`,`percentage`]).describe(`How the value is stored and rendered`).optional(),decimals:c.z.number().int().min(0).max(10).describe(`Decimal places shown`).optional()}),I=x,L=x.extend({dateFormat:c.z.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).optional(),minDate:c.z.string().describe(`Earliest allowed date (ISO)`).optional(),maxDate:c.z.string().describe(`Latest allowed date (ISO)`).optional(),includeTime:c.z.boolean().describe(`Also captures a time of day`).optional(),endDate:c.z.boolean().describe(`Paired with another date attribute as a range's end`).optional(),timeFormat:c.z.enum([`12h`,`24h`]).describe(`Clock format when a time is included`).optional()}),R=x.extend({defaultCountryCode:c.z.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),z=x.extend({defaultCurrency:c.z.string().length(3).describe(`ISO currency code preselected for new values`).optional(),allowedCurrencies:c.z.array(c.z.string().length(3)).describe(`ISO currency codes a value may use; any currency when omitted`).optional(),allowNegative:c.z.boolean().describe(`Whether a negative amount is accepted`).optional()}),B=x.extend({options:k.describe(`The workflow statuses, in order`)}),V=x.extend({granularity:c.z.enum([`full`,`address`,`city`,`state`,`country`,`coordinates`]).describe(`How precise a location must be captured`).optional(),defaultCountry:c.z.string().length(3).describe(`ISO country code preselected for new values`).optional(),allowedCountries:c.z.array(c.z.string().length(3)).describe(`ISO country codes a value may use; any country when omitted`).optional()}),H=x.extend({options:k.describe(`Options`),renderAs:c.z.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),U=x.extend({options:k.describe(`Options`),renderAs:c.z.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),W=x.extend({types:c.z.array(c.z.enum([`user`,`agent`])).min(1).optional().describe(`Which kinds of actor can be picked; both when omitted`),multiple:c.z.boolean().optional().describe(`Whether more than one actor can be picked`)}),G={name:_.describe(`Property API name`),label:c.z.string().min(1).describe(`Label people see`),required:c.z.boolean().describe(`Required on every edge`).optional()},K={id:c.z.string().optional(),objectId:c.z.string().optional(),system:c.z.boolean().optional(),unique:c.z.boolean().optional()},se=Object.fromEntries(S.map(e=>[e,!0])),q=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],J=[...q,`select`,`multiselect`,`status`],Y={text:P,number:F,checkbox:I,date:L,phone:R,currency:z,location:V,select:H,multiselect:U,status:B},ce={...Y,select:H.extend({options:A.describe(`Options`)}),multiselect:U.extend({options:j.describe(`Options`)}),status:B.extend({options:M.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>ce[e].omit(se).shape,storedPropertyMember=e=>c.z.object({...G,...K,type:c.z.literal(e).describe(`Property type`),...Y[e].shape}).strip(),X=c.z.discriminatedUnion(`type`,J.map(storedPropertyMember)),Z=c.z.object({definitions:c.z.array(X).min(1).max(v.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),le=refuseForeignKeys(Object.fromEntries(J.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(G),`type`]);function refuseForeignPropertyKeys(e,t){le(e.type,e,t)}const ue=q.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>c.z.object({...G,type:e.length===1?c.z.literal(e[0]).describe(`Property type`):c.z.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),Q=c.z.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),c.z.object({...G,type:c.z.enum(q).describe(`Property type`),...ue}).strict().superRefine(refuseForeignPropertyKeys)]),de=c.z.object({definitions:c.z.array(Q).min(1).max(v.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),$={text:P,richtext:oe,number:F,checkbox:I,date:L,phone:R,currency:z,status:B,location:V,select:H,multiselect:U,user:W,relation:x.extend({targets:c.z.array(ie).min(1).describe(`Target object(s)`),cardinality:c.z.enum([`one`,`many`]).describe(`one or many`),maxItems:c.z.number().int().min(1).optional().describe(`Max linked records`),bilateral:ae.optional().describe(`Syncs the other side's attribute`),properties:Z.optional()}),formula:x.extend({expression:c.z.string().min(1).superRefine((e,t)=>{try{parseComputedFormula(e)}catch(e){t.addIssue({code:c.z.ZodIssueCode.custom,message:e instanceof Error?e.message:`Invalid formula expression`})}}).describe(`The formula expression, compiled against this object's attributes`),returnType:c.z.enum([`text`,`number`,`boolean`,`date`,`select`,`multiselect`]).describe(`The formula's result type`),decimals:c.z.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),allowRelations:c.z.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:N.optional().describe(`Mirrors an option set`)}),rollup:x.extend({relationAttribute:c.z.string().min(1).optional().describe(`API name of the relation this rollup aggregates through`),relationPath:c.z.string().optional().describe(`Not supported yet — single-hop only`),targetAttribute:c.z.string().min(1).describe(`API name of the attribute aggregated on the relation's target object`),function:c.z.enum([`sum`,`avg`,`earliest`,`latest`,`count`,`countValues`,`countUniqueValues`,`countEmpty`,`percentEmpty`,`percentNotEmpty`,`original`]).describe(`The aggregation applied across the linked records`),decimals:c.z.number().int().min(0).max(10).optional().describe(`Decimal places shown for a numeric result`),targetAttributeType:c.z.string().optional().describe(`Server-set`),targetAttributeOptions:c.z.array(O).optional().describe(`Server-set`),targetCurrencyCode:c.z.string().length(3).optional().describe(`Server-set`),optionsSource:N.optional().describe(`Mirrors an option set`)}),document:x.extend({properties:Z.optional(),accepts:c.z.array(c.z.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:c.z.number().int().min(1).optional().describe(`Maximum file size in bytes`)})};function getAttributeConfigSchema(e){let t=$[e];if(!t)throw new o.ValidationError(`Unsupported attribute type: ${e}`,[]);return t}function parseAttributeConfig(e,t){return getAttributeConfigSchema(e).strip().parse(t)}function getAttributeConfigWriteSchema(e){let t=getAttributeConfigSchema(e).extend({icon:b.optional()});switch(e){case`select`:return t.extend({options:A.describe(`Options`)});case`multiselect`:return t.extend({options:j.describe(`Options`)});case`status`:return t.extend({options:M.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(e){return o.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);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(e){if(!Object.prototype.hasOwnProperty.call(e,`icon`))return;let t=b.optional().safeParse(e.icon);if(!t.success)throw o.ValidationError.fromZodErrors(t.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;return isSelectLike(e.type)&&(s.options=a),s}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return validateOptions}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return validateIconName}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return validateAttributeName}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return parseResourceVisibility}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return validateLabel}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return assertUniqueBy}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return getAttributeConfigWriteSchema}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return parseAttributeConfigForCreate}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return getAttributeConfigSchema}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return validateViewName}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return validateObjectName}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return parseAttributeConfigForUpdate}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return refuseForeignKeys}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return parseAttributeConfig}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ComputedFormulaParseError}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return parseComputedFormula}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return isNativeObjectName}});
|
|
13
|
+
`;case`r`:return`\r`;case`t`:return` `;default:throw new ComputedFormulaParseError(`Unknown escape sequence "\\${e}" at position ${t}`)}}function scanNumber(e,t){let n=t;for(;n<e.length&&isDigit(e[n]);)n+=1;if(e[n]===`.`){let t=n;if(n+=1,!isDigit(e[n]))throw new ComputedFormulaParseError(`Invalid number literal at position ${t}`);for(;n<e.length&&isDigit(e[n]);)n+=1}let r=e.slice(t,n),i=Number(r);if(!Number.isFinite(i))throw new ComputedFormulaParseError(`Invalid number literal "${r}"`);return{value:i,nextIndex:n}}function scanIdentifier(e,t){let n=t+1;for(;n<e.length&&isIdentifierPart(e[n]);)n+=1;return{value:e.slice(t,n),nextIndex:n}}function isDigit(e){return e!==void 0&&e>=`0`&&e<=`9`}function isIdentifierStart(e){return e!==void 0&&/[A-Za-z_]/.test(e)}function isIdentifierPart(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}var Parser=class{constructor(e){this.tokens=e,this.position=0}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new ComputedFormulaParseError(`Unexpected token ${describeToken(e)} at position ${e.position}`)}parseBinaryExpression(e){let t=this.parsePrimary();for(;;){let n=this.peek();if(n?.kind!==`operator`)return t;let r=getOperatorPrecedence(n.value);if(r<e)return t;let i=n.value;this.consume();let a=this.parseBinaryExpression(r+1);t={kind:`binary`,operator:i,left:t,right:a}}}parsePrimary(){let e=this.consume();if(e===void 0)throw new ComputedFormulaParseError(`Unexpected end of expression`);switch(e.kind){case`string`:case`number`:case`boolean`:return{kind:`literal`,value:e.value};case`null`:return{kind:`literal`,value:null};case`identifier`:return this.parseIdentifier(e.value);case`punctuation`:if(e.value===`(`){let e=this.parseExpression();return this.expectPunctuation(`)`),e}break;case`operator`:if(e.value===`-`){let e=this.consume();if(e?.kind===`number`)return{kind:`literal`,value:-e.value}}}throw new ComputedFormulaParseError(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation(`(`)){let t=[];if(!this.matchPunctuation(`)`)){do t.push(this.parseExpression());while(this.matchPunctuation(`,`));this.expectPunctuation(`)`)}return{kind:`call`,functionName:e.toLowerCase(),args:t}}let t=[e];for(;this.matchPunctuation(`.`);){let e=this.consume();if(e?.kind!==`identifier`)throw new ComputedFormulaParseError(`Expected attribute name after path separator at position ${e?.position??this.previousPosition()}`);t.push(e.value)}return{kind:`path`,parts:t}}expectPunctuation(e){if(!this.matchPunctuation(e))throw new ComputedFormulaParseError(`Expected "${e}" at position ${this.peek()?.position??this.previousPosition()}`)}matchPunctuation(e){let t=this.peek();return t?.kind===`punctuation`&&t.value===e&&(this.consume(),!0)}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};function describeToken(e){switch(e.kind){case`identifier`:case`number`:case`string`:case`boolean`:case`operator`:case`punctuation`:return`"${String(e.value)}"`;case`null`:return`"null"`;default:return e}}function getOperatorPrecedence(e){switch(e){case`*`:case`/`:return 3;case`+`:case`-`:return 2;case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return 1;default:return e}}const S=c.z.object({placeholder:c.z.string().optional(),description:c.z.string().optional(),defaultValue:c.z.unknown().optional(),icon:c.z.string().optional(),order:c.z.number().int().optional(),hidden:c.z.boolean().optional(),archived:c.z.boolean().optional(),deprecated:c.z.boolean().optional(),metadata:c.z.record(c.z.string(),c.z.unknown()).optional()}),C=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`];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 w=c.z.object({value:c.z.string().min(1).describe(`Stored value`),label:c.z.string().min(1).describe(`Label people see`),description:c.z.string().describe(`Extra context`).optional(),inverse:c.z.string().describe(`Paired option's value (symmetric)`).optional(),archived:c.z.boolean().describe(`Hides without deleting`).optional()}),T=c.z.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),E=w.extend({color:g}).strict(),D=E,O=w.extend({color:g,group:T}).strict(),k=w.extend({color:c.z.string().optional().describe(`A color id`),group:T.optional()}).strict(),A=c.z.array(k).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 c.z.array(e).min(1).max(h.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 j=writeOptionsArraySchema(E),M=writeOptionsArraySchema(D),N=writeOptionsArraySchema(O),ie=c.z.object({object:c.z.string().min(1).describe(`Target object`),displayTemplate:c.z.string().optional().describe(`Linked record label template`),filter:c.z.record(c.z.string(),c.z.unknown()).optional().describe(`Restricts linkable records`)}),ae=c.z.object({object:c.z.string().min(1).describe(`Other side's object`),attribute:c.z.string().min(1).describe(`Other side's attribute`),cardinality:c.z.enum([`one`,`many`]).optional().describe(`Other side's cardinality`),label:c.z.string().min(1).optional().describe(`Other side's label`),storageOwner:c.z.boolean().optional().describe(`Owns the join storage`)}),P=c.z.object({objectName:c.z.string().min(1).describe(`API name of the object whose options are mirrored`),attributeName:c.z.string().min(1).describe(`API name of the select/status attribute to mirror options from`),attributeId:c.z.string().optional().describe(`Id of the source attribute, resolved by the server`)}),F=S.extend({multiline:c.z.boolean().describe(`Renders as a multi-line textarea`).optional(),minLength:c.z.number().int().min(0).describe(`Minimum character count`).optional(),maxLength:c.z.number().int().min(1).describe(`Maximum character count`).optional(),pattern:c.z.string().describe(`Regular expression the value must match`).optional(),format:c.z.enum([`email`,`url`,`slug`]).describe(`Validates and renders as this format`).optional()}),oe=S,I=S.extend({renderAs:c.z.enum([`number`,`rating`]).describe(`Plain number or a star rating`).optional(),min:c.z.number().describe(`Minimum allowed value`).optional(),max:c.z.number().describe(`Maximum allowed value`).optional(),unit:c.z.enum([`integer`,`decimal`,`percentage`]).describe(`How the value is stored and rendered`).optional(),decimals:c.z.number().int().min(0).max(10).describe(`Decimal places shown`).optional()}),L=S,R=S.extend({dateFormat:c.z.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).optional(),minDate:c.z.string().describe(`Earliest allowed date (ISO)`).optional(),maxDate:c.z.string().describe(`Latest allowed date (ISO)`).optional(),includeTime:c.z.boolean().describe(`Also captures a time of day`).optional(),endDate:c.z.boolean().describe(`Paired with another date attribute as a range's end`).optional(),timeFormat:c.z.enum([`12h`,`24h`]).describe(`Clock format when a time is included`).optional()}),z=S.extend({defaultCountryCode:c.z.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),B=S.extend({defaultCurrency:c.z.string().length(3).describe(`ISO currency code preselected for new values`).optional(),allowedCurrencies:c.z.array(c.z.string().length(3)).describe(`ISO currency codes a value may use; any currency when omitted`).optional(),allowNegative:c.z.boolean().describe(`Whether a negative amount is accepted`).optional()}),V=S.extend({options:A.describe(`The workflow statuses, in order`)}),H=S.extend({granularity:c.z.enum([`full`,`address`,`city`,`state`,`country`,`coordinates`]).describe(`How precise a location must be captured`).optional(),defaultCountry:c.z.string().length(3).describe(`ISO country code preselected for new values`).optional(),allowedCountries:c.z.array(c.z.string().length(3)).describe(`ISO country codes a value may use; any country when omitted`).optional()}),U=S.extend({options:A.describe(`Options`),renderAs:c.z.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),W=S.extend({options:A.describe(`Options`),renderAs:c.z.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),se=S.extend({types:c.z.array(c.z.enum([`user`,`agent`])).min(1).optional().describe(`Which kinds of actor can be picked; both when omitted`),multiple:c.z.boolean().optional().describe(`Whether more than one actor can be picked`)}),G={name:x.describe(`Property API name`),label:c.z.string().min(1).describe(`Label people see`),required:c.z.boolean().describe(`Required on every edge`).optional()},ce={id:c.z.string().optional(),objectId:c.z.string().optional(),system:c.z.boolean().optional(),unique:c.z.boolean().optional()},le=Object.fromEntries(C.map(e=>[e,!0])),K=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],q=[...K,`select`,`multiselect`,`status`],J={text:F,number:I,checkbox:L,date:R,phone:z,currency:B,location:H,select:U,multiselect:W,status:V},ue={...J,select:U.extend({options:j.describe(`Options`)}),multiselect:W.extend({options:M.describe(`Options`)}),status:V.extend({options:N.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>ue[e].omit(le).shape,storedPropertyMember=e=>c.z.object({...G,...ce,type:c.z.literal(e).describe(`Property type`),...J[e].shape}).strip(),Y=c.z.discriminatedUnion(`type`,q.map(storedPropertyMember)),X=c.z.object({definitions:c.z.array(Y).min(1).max(h.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),de=refuseForeignKeys(Object.fromEntries(q.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(G),`type`]);function refuseForeignPropertyKeys(e,t){de(e.type,e,t)}const Z=K.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>c.z.object({...G,type:e.length===1?c.z.literal(e[0]).describe(`Property type`):c.z.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),Q=c.z.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),c.z.object({...G,type:c.z.enum(K).describe(`Property type`),...Z}).strict().superRefine(refuseForeignPropertyKeys)]),fe=c.z.object({definitions:c.z.array(Q).min(1).max(h.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),pe=S.extend({targets:c.z.array(ie).min(1).describe(`Target object(s)`),cardinality:c.z.enum([`one`,`many`]).describe(`one or many`),maxItems:c.z.number().int().min(1).optional().describe(`Max linked records`),bilateral:ae.optional().describe(`Syncs the other side's attribute`),properties:X.optional()}),me=S.extend({expression:c.z.string().min(1).superRefine((e,t)=>{try{parseComputedFormula(e)}catch(e){t.addIssue({code:c.z.ZodIssueCode.custom,message:e instanceof Error?e.message:`Invalid formula expression`})}}).describe(`The formula expression, compiled against this object's attributes`),returnType:c.z.enum([`text`,`number`,`boolean`,`date`,`select`,`multiselect`]).describe(`The formula's result type`),decimals:c.z.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),allowRelations:c.z.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:P.optional().describe(`Mirrors an option set`)}),he=S.extend({relationAttribute:c.z.string().min(1).optional().describe(`API name of the relation this rollup aggregates through`),relationPath:c.z.string().optional().describe(`Not supported yet — single-hop only`),targetAttribute:c.z.string().min(1).optional().describe(`API name of the attribute aggregated on the relation's target object; not read by count`),function:c.z.enum([`sum`,`avg`,`earliest`,`latest`,`count`,`countValues`,`countUniqueValues`,`countEmpty`,`percentEmpty`,`percentNotEmpty`,`original`]).describe(`The aggregation applied across the linked records`),decimals:c.z.number().int().min(0).max(10).optional().describe(`Decimal places shown for a numeric result`),targetAttributeType:c.z.string().optional().describe(`Server-set`),targetAttributeOptions:c.z.array(k).optional().describe(`Server-set`),targetCurrencyCode:c.z.string().length(3).optional().describe(`Server-set`),optionsSource:P.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`}}const $={text:F,richtext:oe,number:I,checkbox:L,date:R,phone:z,currency:B,status:V,location:H,select:U,multiselect:W,user:se,relation:pe,formula:me,rollup:he,document:S.extend({properties:X.optional(),accepts:c.z.array(c.z.string().min(1)).optional().describe("MIME prefixes or globs a file must match (e.g. `image/*`, `*.pdf`)"),maxFileSize:c.z.number().int().min(1).optional().describe(`Maximum file size in bytes`)})};function getAttributeConfigSchema(e){let t=$[e];if(!t)throw new o.ValidationError(`Unsupported attribute type: ${e}`,[]);return t}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:_.optional()});switch(e){case`select`:return t.extend({options:j.describe(`Options`)});case`multiselect`:return t.extend({options:M.describe(`Options`)});case`status`:return t.extend({options:N.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(e){return o.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]);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(e){if(!Object.prototype.hasOwnProperty.call(e,`icon`))return;let t=_.optional().safeParse(e.icon);if(!t.success)throw o.ValidationError.fromZodErrors(t.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;return isSelectLike(e.type)&&(s.options=a),s}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return validateAttributeName}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return validateOptions}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return validateObjectName}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return parseResourceVisibility}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return validateViewName}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return assertUniqueBy}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return validateLabel}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return getAttributeConfigWriteSchema}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return parseAttributeConfigForCreate}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return getAttributeConfigSchema}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return parseAttributeConfigForUpdate}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return refuseForeignKeys}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return parseAttributeConfig}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ComputedFormulaParseError}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return validateIconName}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return parseComputedFormula}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return isNativeObjectName}});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";import{COLORS as r,ICONS as i}from"@stndrds/constants";import a,{z as o}from"zod";const s=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return s.includes(e)}const c=[`workspace`,`private`],ee=[`all`,...c];function parseResourceVisibility(e){if(typeof e==`string`&&c.includes(e))return e;throw new n(`visibility must be one of: ${c.join(`, `)} (received: ${String(e)})`,[])}const l=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],u=[...l,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`owned_by`],
|
|
2
|
+
import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";import{COLORS as r,ICONS as i}from"@stndrds/constants";import a,{z as o}from"zod";const s=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return s.includes(e)}const c=[`workspace`,`private`],ee=[`all`,...c];function parseResourceVisibility(e){if(typeof e==`string`&&c.includes(e))return e;throw new n(`visibility must be one of: ${c.join(`, `)} (received: ${String(e)})`,[])}const l=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],u=[...l,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`owned_by`],d=s,f={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20,labelLength:128},p=Object.keys(r),te=new Set(i),m=o.enum(p).describe(`A color id from the palette`),h=o.string().superRefine((e,t)=>{te.has(e)||t.addIssue({code:`custom`,message:`Invalid icon name`})}).transform(e=>e),ne=new Set(i),g=/^[a-zA-Z_][a-zA-Z0-9_]*$/,re=/^[a-z][a-z0-9-]*$/,_=f.labelLength,v=a.string().min(1,`Object name cannot be empty`).max(63,`Object name is too long (max 63 characters)`).regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
|
|
3
3
|
Name must be in kebab-case (slug format):
|
|
4
4
|
✅ Valid: 'products', 'user-profiles', 'order-items'
|
|
5
|
-
❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(n){try{
|
|
5
|
+
❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(n){try{v.parse(n)}catch(n){throw n instanceof a.ZodError?new e(n.issues[0].message,t.INVALID_OBJECT_NAME):n}}function validateViewName(e){if(!e||e.length===0)throw new n(`View name cannot be empty`,[{path:[`name`],message:`View name cannot be empty`}]);if(e.length>63)throw new n(`View name is too long`,[{path:[`name`],message:`View name is too long (max 63 characters)`}]);if(!re.test(e))throw new n(`Invalid view name format`,[{path:[`name`],message:`View name must be in kebab-case (e.g., 'detail', 'list-view')`}])}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw n(e);r.add(e)}}const y=a.string().min(1,`Attribute name cannot be empty`).max(63,`Attribute name is too long (max 63 characters)`).regex(g,{message:`Invalid attribute name format.
|
|
6
6
|
Name must be a valid variable identifier:
|
|
7
7
|
✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
8
|
-
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!u.includes(e),{message:`This is a reserved attribute name. Reserved names: ${u.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!
|
|
8
|
+
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!u.includes(e),{message:`This is a reserved attribute name. Reserved names: ${u.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!g.test(e))throw Error(`[AttributeBuilder] Invalid attribute name format.
|
|
9
9
|
Name must be a valid variable identifier:
|
|
10
10
|
✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
11
|
-
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(u.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${u.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>
|
|
11
|
+
❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(u.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${u.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>_)throw Error(`[AttributeBuilder] Attribute label is too long (max ${_} characters)`)}function validateIconName(e,t){if(!ne.has(e))throw Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.\nIcon must be one of the predefined icons from @stndrds/constants.`)}function validateOptions(e,t){let n=new Set;for(let r of t){if(!r.value?.trim())throw Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!r.label?.trim())throw Error(`[AttributeBuilder] Option "${r.value}" in "${e}" has an empty or missing label.`);if(n.has(r.value))throw Error(`[AttributeBuilder] Duplicate option value "${r.value}" in "${e}".`);n.add(r.value)}for(let n of t){if(n.inverse===void 0)continue;let r=t.find(e=>e.value===n.inverse);if(!r)throw Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(r.inverse!==n.value)throw Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${r.inverse??`(none)`}". Inverse pairs must be symmetric.`)}}var ComputedFormulaParseError=class extends Error{constructor(e){super(e),this.name=`ComputedFormulaParseError`}};function parseComputedFormula(e){let t=new Parser(tokenize(e)),n=t.parseExpression();return t.expectEnd(),n}function tokenize(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===` `||r===` `||r===`
|
|
12
12
|
`||r===`\r`){n+=1;continue}if(r===`"`||r===`'`){let i=scanString(e,n,r);t.push({kind:`string`,value:i.value,position:n}),n=i.nextIndex;continue}if(isDigit(r)){let r=scanNumber(e,n);t.push({kind:`number`,value:r.value,position:n}),n=r.nextIndex;continue}if(isIdentifierStart(r)){let r=scanIdentifier(e,n),i=r.value.toLowerCase();i===`true`?t.push({kind:`boolean`,value:!0,position:n}):i===`false`?t.push({kind:`boolean`,value:!1,position:n}):i===`null`?t.push({kind:`null`,position:n}):t.push({kind:`identifier`,value:r.value,position:n}),n=r.nextIndex;continue}let i=e.slice(n,n+2);if(i===`>=`||i===`<=`||i===`==`||i===`!=`){t.push({kind:`operator`,value:i,position:n}),n+=2;continue}if(r===`>`||r===`<`||r===`+`||r===`-`||r===`*`||r===`/`){t.push({kind:`operator`,value:r,position:n}),n+=1;continue}if(r===`(`||r===`)`||r===`,`||r===`.`){t.push({kind:`punctuation`,value:r,position:n}),n+=1;continue}throw new ComputedFormulaParseError(`Unexpected character "${r}" at position ${n}`)}return t}function scanString(e,t,n=`"`){let r=``,i=t+1;for(;i<e.length;){let t=e[i];if(t===n)return{value:r,nextIndex:i+1};if(t===`\\`){let t=e[i+1];if(t===void 0)throw new ComputedFormulaParseError(`Unterminated string literal at position ${i}`);r+=decodeEscape(t,i),i+=2;continue}r+=t,i+=1}throw new ComputedFormulaParseError(`Unterminated string literal at position ${t}`)}function decodeEscape(e,t){switch(e){case`"`:case`\\`:return e;case`n`:return`
|
|
13
|
-
`;case`r`:return`\r`;case`t`:return` `;default:throw new ComputedFormulaParseError(`Unknown escape sequence "\\${e}" at position ${t}`)}}function scanNumber(e,t){let n=t;for(;n<e.length&&isDigit(e[n]);)n+=1;if(e[n]===`.`){let t=n;if(n+=1,!isDigit(e[n]))throw new ComputedFormulaParseError(`Invalid number literal at position ${t}`);for(;n<e.length&&isDigit(e[n]);)n+=1}let r=e.slice(t,n),i=Number(r);if(!Number.isFinite(i))throw new ComputedFormulaParseError(`Invalid number literal "${r}"`);return{value:i,nextIndex:n}}function scanIdentifier(e,t){let n=t+1;for(;n<e.length&&isIdentifierPart(e[n]);)n+=1;return{value:e.slice(t,n),nextIndex:n}}function isDigit(e){return e!==void 0&&e>=`0`&&e<=`9`}function isIdentifierStart(e){return e!==void 0&&/[A-Za-z_]/.test(e)}function isIdentifierPart(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}var Parser=class{constructor(e){this.tokens=e,this.position=0}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new ComputedFormulaParseError(`Unexpected token ${describeToken(e)} at position ${e.position}`)}parseBinaryExpression(e){let t=this.parsePrimary();for(;;){let n=this.peek();if(n?.kind!==`operator`)return t;let r=getOperatorPrecedence(n.value);if(r<e)return t;let i=n.value;this.consume();let a=this.parseBinaryExpression(r+1);t={kind:`binary`,operator:i,left:t,right:a}}}parsePrimary(){let e=this.consume();if(e===void 0)throw new ComputedFormulaParseError(`Unexpected end of expression`);switch(e.kind){case`string`:case`number`:case`boolean`:return{kind:`literal`,value:e.value};case`null`:return{kind:`literal`,value:null};case`identifier`:return this.parseIdentifier(e.value);case`punctuation`:if(e.value===`(`){let e=this.parseExpression();return this.expectPunctuation(`)`),e}break;case`operator`:if(e.value===`-`){let e=this.consume();if(e?.kind===`number`)return{kind:`literal`,value:-e.value}}}throw new ComputedFormulaParseError(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation(`(`)){let t=[];if(!this.matchPunctuation(`)`)){do t.push(this.parseExpression());while(this.matchPunctuation(`,`));this.expectPunctuation(`)`)}return{kind:`call`,functionName:e.toLowerCase(),args:t}}let t=[e];for(;this.matchPunctuation(`.`);){let e=this.consume();if(e?.kind!==`identifier`)throw new ComputedFormulaParseError(`Expected attribute name after path separator at position ${e?.position??this.previousPosition()}`);t.push(e.value)}return{kind:`path`,parts:t}}expectPunctuation(e){if(!this.matchPunctuation(e))throw new ComputedFormulaParseError(`Expected "${e}" at position ${this.peek()?.position??this.previousPosition()}`)}matchPunctuation(e){let t=this.peek();return t?.kind===`punctuation`&&t.value===e&&(this.consume(),!0)}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};function describeToken(e){switch(e.kind){case`identifier`:case`number`:case`string`:case`boolean`:case`operator`:case`punctuation`:return`"${String(e.value)}"`;case`null`:return`"null"`;default:return e}}function getOperatorPrecedence(e){switch(e){case`*`:case`/`:return 3;case`+`:case`-`:return 2;case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return 1;default:return e}}const y=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()}),b=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`];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 x=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()}),S=o.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),C=x.extend({color:_}).strict(),w=C,T=x.extend({color:_,group:S}).strict(),E=x.extend({color:o.string().optional().describe(`A color id`),group:S.optional()}).strict(),D=o.array(E).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(m.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 O=writeOptionsArraySchema(C),k=writeOptionsArraySchema(w),A=writeOptionsArraySchema(T),ie=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`)}),ae=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`)}),j=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`)}),M=y.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()}),oe=y,N=y.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()}),P=y,F=y.extend({dateFormat:o.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).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()}),I=y.extend({defaultCountryCode:o.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),L=y.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()}),R=y.extend({options:D.describe(`The workflow statuses, in order`)}),z=y.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()}),B=y.extend({options:D.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),V=y.extend({options:D.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),H=y.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`)}),U={name:p.describe(`Property API name`),label:o.string().min(1).describe(`Label people see`),required:o.boolean().describe(`Required on every edge`).optional()},W={id:o.string().optional(),objectId:o.string().optional(),system:o.boolean().optional(),unique:o.boolean().optional()},G=Object.fromEntries(b.map(e=>[e,!0])),K=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],q=[...K,`select`,`multiselect`,`status`],J={text:M,number:N,checkbox:P,date:F,phone:I,currency:L,location:z,select:B,multiselect:V,status:R},se={...J,select:B.extend({options:O.describe(`Options`)}),multiselect:V.extend({options:k.describe(`Options`)}),status:R.extend({options:A.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>se[e].omit(G).shape,storedPropertyMember=e=>o.object({...U,...W,type:o.literal(e).describe(`Property type`),...J[e].shape}).strip(),Y=o.discriminatedUnion(`type`,q.map(storedPropertyMember)),X=o.object({definitions:o.array(Y).min(1).max(m.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),ce=refuseForeignKeys(Object.fromEntries(q.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(U),`type`]);function refuseForeignPropertyKeys(e,t){ce(e.type,e,t)}const Z=K.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>o.object({...U,type:e.length===1?o.literal(e[0]).describe(`Property type`):o.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),Q=o.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),o.object({...U,type:o.enum(K).describe(`Property type`),...Z}).strict().superRefine(refuseForeignPropertyKeys)]),le=o.object({definitions:o.array(Q).min(1).max(m.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),$={text:M,richtext:oe,number:N,checkbox:P,date:F,phone:I,currency:L,status:R,location:z,select:B,multiselect:V,user:H,relation:y.extend({targets:o.array(ie).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:ae.optional().describe(`Syncs the other side's attribute`),properties:X.optional()}),formula:y.extend({expression:o.string().min(1).superRefine((e,t)=>{try{parseComputedFormula(e)}catch(e){t.addIssue({code:o.ZodIssueCode.custom,message:e instanceof Error?e.message:`Invalid formula expression`})}}).describe(`The formula expression, compiled against this object's attributes`),returnType:o.enum([`text`,`number`,`boolean`,`date`,`select`,`multiselect`]).describe(`The formula's result type`),decimals:o.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),allowRelations:o.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:j.optional().describe(`Mirrors an option set`)}),rollup:y.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).describe(`API name of the attribute aggregated on the relation's target object`),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(E).optional().describe(`Server-set`),targetCurrencyCode:o.string().length(3).optional().describe(`Server-set`),optionsSource:j.optional().describe(`Mirrors an option set`)}),document:y.extend({properties:X.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(e){let t=$[e];if(!t)throw new n(`Unsupported attribute type: ${e}`,[]);return t}function parseAttributeConfig(e,t){return getAttributeConfigSchema(e).strip().parse(t)}function getAttributeConfigWriteSchema(e){let t=getAttributeConfigSchema(e).extend({icon:v.optional()});switch(e){case`select`:return t.extend({options:O.describe(`Options`)});case`multiselect`:return t.extend({options:k.describe(`Options`)});case`status`:return t.extend({options:A.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(e){return n.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);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(e){if(!Object.prototype.hasOwnProperty.call(e,`icon`))return;let t=v.optional().safeParse(e.icon);if(!t.success)throw n.fromZodErrors(t.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;return isSelectLike(e.type)&&(s.options=a),s}export{validateOptions as A,p as C,validateIconName as D,validateAttributeName as E,c as F,l as I,parseResourceVisibility as L,ee as M,u as N,validateLabel as O,te as P,s as R,m as S,assertUniqueBy as T,T as _,getAttributeConfigWriteSchema as a,_ as b,parseAttributeConfigForCreate as c,Q as d,X as f,S as g,C as h,getAttributeConfigSchema as i,validateViewName as j,validateObjectName as k,parseAttributeConfigForUpdate as l,refuseForeignKeys as m,b as n,w as o,le as p,$ as r,parseAttributeConfig as s,K as t,Y as u,ComputedFormulaParseError as v,f as w,v as x,parseComputedFormula as y,isNativeObjectName as z};
|
|
13
|
+
`;case`r`:return`\r`;case`t`:return` `;default:throw new ComputedFormulaParseError(`Unknown escape sequence "\\${e}" at position ${t}`)}}function scanNumber(e,t){let n=t;for(;n<e.length&&isDigit(e[n]);)n+=1;if(e[n]===`.`){let t=n;if(n+=1,!isDigit(e[n]))throw new ComputedFormulaParseError(`Invalid number literal at position ${t}`);for(;n<e.length&&isDigit(e[n]);)n+=1}let r=e.slice(t,n),i=Number(r);if(!Number.isFinite(i))throw new ComputedFormulaParseError(`Invalid number literal "${r}"`);return{value:i,nextIndex:n}}function scanIdentifier(e,t){let n=t+1;for(;n<e.length&&isIdentifierPart(e[n]);)n+=1;return{value:e.slice(t,n),nextIndex:n}}function isDigit(e){return e!==void 0&&e>=`0`&&e<=`9`}function isIdentifierStart(e){return e!==void 0&&/[A-Za-z_]/.test(e)}function isIdentifierPart(e){return e!==void 0&&/[A-Za-z0-9_]/.test(e)}var Parser=class{constructor(e){this.tokens=e,this.position=0}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new ComputedFormulaParseError(`Unexpected token ${describeToken(e)} at position ${e.position}`)}parseBinaryExpression(e){let t=this.parsePrimary();for(;;){let n=this.peek();if(n?.kind!==`operator`)return t;let r=getOperatorPrecedence(n.value);if(r<e)return t;let i=n.value;this.consume();let a=this.parseBinaryExpression(r+1);t={kind:`binary`,operator:i,left:t,right:a}}}parsePrimary(){let e=this.consume();if(e===void 0)throw new ComputedFormulaParseError(`Unexpected end of expression`);switch(e.kind){case`string`:case`number`:case`boolean`:return{kind:`literal`,value:e.value};case`null`:return{kind:`literal`,value:null};case`identifier`:return this.parseIdentifier(e.value);case`punctuation`:if(e.value===`(`){let e=this.parseExpression();return this.expectPunctuation(`)`),e}break;case`operator`:if(e.value===`-`){let e=this.consume();if(e?.kind===`number`)return{kind:`literal`,value:-e.value}}}throw new ComputedFormulaParseError(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation(`(`)){let t=[];if(!this.matchPunctuation(`)`)){do t.push(this.parseExpression());while(this.matchPunctuation(`,`));this.expectPunctuation(`)`)}return{kind:`call`,functionName:e.toLowerCase(),args:t}}let t=[e];for(;this.matchPunctuation(`.`);){let e=this.consume();if(e?.kind!==`identifier`)throw new ComputedFormulaParseError(`Expected attribute name after path separator at position ${e?.position??this.previousPosition()}`);t.push(e.value)}return{kind:`path`,parts:t}}expectPunctuation(e){if(!this.matchPunctuation(e))throw new ComputedFormulaParseError(`Expected "${e}" at position ${this.peek()?.position??this.previousPosition()}`)}matchPunctuation(e){let t=this.peek();return t?.kind===`punctuation`&&t.value===e&&(this.consume(),!0)}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};function describeToken(e){switch(e.kind){case`identifier`:case`number`:case`string`:case`boolean`:case`operator`:case`punctuation`:return`"${String(e.value)}"`;case`null`:return`"null"`;default:return e}}function getOperatorPrecedence(e){switch(e){case`*`:case`/`:return 3;case`+`:case`-`:return 2;case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return 1;default:return e}}const b=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()}),x=[`placeholder`,`description`,`defaultValue`,`icon`,`order`,`hidden`,`archived`,`deprecated`,`metadata`];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 S=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()}),C=o.enum([`idle`,`in_progress`,`finished`]).describe(`Workflow stage`),w=S.extend({color:m}).strict(),T=w,E=S.extend({color:m,group:C}).strict(),D=S.extend({color:o.string().optional().describe(`A color id`),group:C.optional()}).strict(),O=o.array(D).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(f.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 k=writeOptionsArraySchema(w),A=writeOptionsArraySchema(T),j=writeOptionsArraySchema(E),ie=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`)}),ae=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`)}),M=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`)}),N=b.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()}),oe=b,P=b.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()}),F=b,I=b.extend({dateFormat:o.enum([`short`,`long`,`full`,`relative`]).describe(`How the date is rendered`).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()}),L=b.extend({defaultCountryCode:o.string().length(3).describe(`ISO country code preselected in the dialer`).optional()}),R=b.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()}),z=b.extend({options:O.describe(`The workflow statuses, in order`)}),B=b.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()}),V=b.extend({options:O.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen option as a colored badge`)}),H=b.extend({options:O.describe(`Options`),renderAs:o.literal(`badges`).optional().describe(`Renders the chosen options as colored badges`)}),U=b.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`)}),W={name:y.describe(`Property API name`),label:o.string().min(1).describe(`Label people see`),required:o.boolean().describe(`Required on every edge`).optional()},G={id:o.string().optional(),objectId:o.string().optional(),system:o.boolean().optional(),unique:o.boolean().optional()},K=Object.fromEntries(x.map(e=>[e,!0])),q=[`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`location`],J=[...q,`select`,`multiselect`,`status`],Y={text:N,number:P,checkbox:F,date:I,phone:L,currency:R,location:B,select:V,multiselect:H,status:z},se={...Y,select:V.extend({options:k.describe(`Options`)}),multiselect:H.extend({options:A.describe(`Options`)}),status:z.extend({options:j.describe(`Statuses`)})},propertyWireConfigShapeFor=e=>se[e].omit(K).shape,storedPropertyMember=e=>o.object({...W,...G,type:o.literal(e).describe(`Property type`),...Y[e].shape}).strip(),X=o.discriminatedUnion(`type`,J.map(storedPropertyMember)),Z=o.object({definitions:o.array(X).min(1).max(f.optionsPerAttribute).describe(`Edge properties`)}).strip().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),ce=refuseForeignKeys(Object.fromEntries(J.map(e=>[e,new Set(Object.keys(propertyWireConfigShapeFor(e)))])),`property key`,[...Object.keys(W),`type`]);function refuseForeignPropertyKeys(e,t){ce(e.type,e,t)}const le=q.reduce((e,t)=>(Object.assign(e,propertyWireConfigShapeFor(t)),e),{}),optionPropertyWireMember=e=>o.object({...W,type:e.length===1?o.literal(e[0]).describe(`Property type`):o.enum(e).describe(`Property type`),...propertyWireConfigShapeFor(e[0])}).strict(),Q=o.discriminatedUnion(`type`,[optionPropertyWireMember([`select`,`multiselect`]),optionPropertyWireMember([`status`]),o.object({...W,type:o.enum(q).describe(`Property type`),...le}).strict().superRefine(refuseForeignPropertyKeys)]),ue=o.object({definitions:o.array(Q).min(1).max(f.optionsPerAttribute).describe(`Edge properties`)}).strict().describe(`Properties carried by the edge itself (role, share, since…), never a third object`),de=b.extend({targets:o.array(ie).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:ae.optional().describe(`Syncs the other side's attribute`),properties:Z.optional()}),fe=b.extend({expression:o.string().min(1).superRefine((e,t)=>{try{parseComputedFormula(e)}catch(e){t.addIssue({code:o.ZodIssueCode.custom,message:e instanceof Error?e.message:`Invalid formula expression`})}}).describe(`The formula expression, compiled against this object's attributes`),returnType:o.enum([`text`,`number`,`boolean`,`date`,`select`,`multiselect`]).describe(`The formula's result type`),decimals:o.number().int().min(0).max(10).optional().describe(`Decimal places shown for a number result`),allowRelations:o.boolean().optional().describe(`Whether the expression may read across a relation`),optionsSource:M.optional().describe(`Mirrors an option set`)}),pe=b.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(D).optional().describe(`Server-set`),targetCurrencyCode:o.string().length(3).optional().describe(`Server-set`),optionsSource:M.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`}}const $={text:N,richtext:oe,number:P,checkbox:F,date:I,phone:L,currency:R,status:z,location:B,select:V,multiselect:H,user:U,relation:de,formula:fe,rollup:pe,document:b.extend({properties:Z.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(e){let t=$[e];if(!t)throw new n(`Unsupported attribute type: ${e}`,[]);return t}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:h.optional()});switch(e){case`select`:return t.extend({options:k.describe(`Options`)});case`multiselect`:return t.extend({options:A.describe(`Options`)});case`status`:return t.extend({options:j.describe(`Statuses`)});default:return t}}function validationErrorFromIssues(e){return n.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]);return n.data}function parseAttributeConfigForCreate(e,t){return parseWriteSchema(e,t)}function validatePatchedIcon(e){if(!Object.prototype.hasOwnProperty.call(e,`icon`))return;let t=h.optional().safeParse(e.icon);if(!t.success)throw n.fromZodErrors(t.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;return isSelectLike(e.type)&&(s.options=a),s}export{h as A,validateAttributeName as C,validateOptions as D,validateObjectName as E,c as F,l as I,parseResourceVisibility as L,ee as M,u as N,validateViewName as O,d as P,s as R,assertUniqueBy as S,validateLabel as T,E as _,getAttributeConfigWriteSchema as a,y as b,parseAttributeConfigForCreate as c,Q as d,Z as f,C as g,w as h,getAttributeConfigSchema as i,f as j,m as k,parseAttributeConfigForUpdate as l,refuseForeignKeys as m,x as n,T as o,ue as p,$ as r,parseAttributeConfig as s,q as t,X as u,ComputedFormulaParseError as v,validateIconName as w,v as x,parseComputedFormula as y,isNativeObjectName as z};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { rt as DateAttribute } from "./exceptions-
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { rt as DateAttribute } from "./exceptions-DG_iMvYs.js";
|
|
3
|
+
import { r as ValidationMessages } from "./index-ZnCTYc93.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/date.d.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { rt as DateAttribute } from "./exceptions-
|
|
3
|
-
import { r as ValidationMessages } from "./index-
|
|
2
|
+
import { rt as DateAttribute } from "./exceptions-DG_iMvYs.mjs";
|
|
3
|
+
import { r as ValidationMessages } from "./index-CK7gaSRm.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/validation/primitives/date.d.ts
|
|
6
6
|
/**
|
|
@@ -754,8 +754,11 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
754
754
|
* @example "orders.items" - traverse through orders to items
|
|
755
755
|
*/
|
|
756
756
|
relationPath?: string;
|
|
757
|
-
/**
|
|
758
|
-
|
|
757
|
+
/**
|
|
758
|
+
* Attribute name on the target object to aggregate. Absent for `count`,
|
|
759
|
+
* which aggregates the linked records themselves (#3571).
|
|
760
|
+
*/
|
|
761
|
+
targetAttribute?: string;
|
|
759
762
|
/** Aggregation function to apply */
|
|
760
763
|
function: RollupFunction;
|
|
761
764
|
/** Decimal places for numeric results */
|
|
@@ -754,8 +754,11 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
754
754
|
* @example "orders.items" - traverse through orders to items
|
|
755
755
|
*/
|
|
756
756
|
relationPath?: string;
|
|
757
|
-
/**
|
|
758
|
-
|
|
757
|
+
/**
|
|
758
|
+
* Attribute name on the target object to aggregate. Absent for `count`,
|
|
759
|
+
* which aggregates the linked records themselves (#3571).
|
|
760
|
+
*/
|
|
761
|
+
targetAttribute?: string;
|
|
759
762
|
/** Aggregation function to apply */
|
|
760
763
|
function: RollupFunction;
|
|
761
764
|
/** Decimal places for numeric results */
|
package/dist/exceptions.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as StorageError, B as isObjectReferencedError, C as RepositoryOperation, D as SchemaErrorCode, E as SchemaError, F as SystemEntityImmutableError, H as isRecordReferencedError, I as ValidationError, L as ValidationErrorDetail, M as SyncCascadeError, N as SyncConflictError, O as SchemaPlanNotFoundError, P as SyncError, R as isAttributeInUseError, S as RepositoryError, T as RoleNotFoundError, U as isSchemaError, V as isProtectedResourceError, W as isValidationError, _ as ProtectedResourceError, a as ChangeTypeNotSupportedError, b as RecordReference, c as DuplicateError, d as MigrationTimeoutError, f as NotFoundError, g as OrphanSystemAttributeError, h as ObjectReferencedError, i as AttributeUsage, j as StorageOperation, k as SearchBackendError, l as ForbiddenError, m as ObjectNotFoundError, n as AttributeInUseError, o as ConcurrentModificationError, p as NotImplementedError, r as AttributeNotFoundError, s as DestructiveSyncNotAllowedError, t as AccessDeniedError, u as MemoryNotFoundError, v as ProtectedRoleError, w as ReservedObjectNameError, x as RecordReferencedError, y as RecordNotFoundError, z as isNotFoundError } from "./exceptions-
|
|
2
|
+
import { A as StorageError, B as isObjectReferencedError, C as RepositoryOperation, D as SchemaErrorCode, E as SchemaError, F as SystemEntityImmutableError, H as isRecordReferencedError, I as ValidationError, L as ValidationErrorDetail, M as SyncCascadeError, N as SyncConflictError, O as SchemaPlanNotFoundError, P as SyncError, R as isAttributeInUseError, S as RepositoryError, T as RoleNotFoundError, U as isSchemaError, V as isProtectedResourceError, W as isValidationError, _ as ProtectedResourceError, a as ChangeTypeNotSupportedError, b as RecordReference, c as DuplicateError, d as MigrationTimeoutError, f as NotFoundError, g as OrphanSystemAttributeError, h as ObjectReferencedError, i as AttributeUsage, j as StorageOperation, k as SearchBackendError, l as ForbiddenError, m as ObjectNotFoundError, n as AttributeInUseError, o as ConcurrentModificationError, p as NotImplementedError, r as AttributeNotFoundError, s as DestructiveSyncNotAllowedError, t as AccessDeniedError, u as MemoryNotFoundError, v as ProtectedRoleError, w as ReservedObjectNameError, x as RecordReferencedError, y as RecordNotFoundError, z as isNotFoundError } from "./exceptions-DG_iMvYs.mjs";
|
|
3
3
|
export { AccessDeniedError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ChangeTypeNotSupportedError, ConcurrentModificationError, DestructiveSyncNotAllowedError, DuplicateError, ForbiddenError, MemoryNotFoundError, MigrationTimeoutError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
|
package/dist/exceptions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as StorageError, B as isObjectReferencedError, C as RepositoryOperation, D as SchemaErrorCode, E as SchemaError, F as SystemEntityImmutableError, H as isRecordReferencedError, I as ValidationError, L as ValidationErrorDetail, M as SyncCascadeError, N as SyncConflictError, O as SchemaPlanNotFoundError, P as SyncError, R as isAttributeInUseError, S as RepositoryError, T as RoleNotFoundError, U as isSchemaError, V as isProtectedResourceError, W as isValidationError, _ as ProtectedResourceError, a as ChangeTypeNotSupportedError, b as RecordReference, c as DuplicateError, d as MigrationTimeoutError, f as NotFoundError, g as OrphanSystemAttributeError, h as ObjectReferencedError, i as AttributeUsage, j as StorageOperation, k as SearchBackendError, l as ForbiddenError, m as ObjectNotFoundError, n as AttributeInUseError, o as ConcurrentModificationError, p as NotImplementedError, r as AttributeNotFoundError, s as DestructiveSyncNotAllowedError, t as AccessDeniedError, u as MemoryNotFoundError, v as ProtectedRoleError, w as ReservedObjectNameError, x as RecordReferencedError, y as RecordNotFoundError, z as isNotFoundError } from "./exceptions-
|
|
2
|
+
import { A as StorageError, B as isObjectReferencedError, C as RepositoryOperation, D as SchemaErrorCode, E as SchemaError, F as SystemEntityImmutableError, H as isRecordReferencedError, I as ValidationError, L as ValidationErrorDetail, M as SyncCascadeError, N as SyncConflictError, O as SchemaPlanNotFoundError, P as SyncError, R as isAttributeInUseError, S as RepositoryError, T as RoleNotFoundError, U as isSchemaError, V as isProtectedResourceError, W as isValidationError, _ as ProtectedResourceError, a as ChangeTypeNotSupportedError, b as RecordReference, c as DuplicateError, d as MigrationTimeoutError, f as NotFoundError, g as OrphanSystemAttributeError, h as ObjectReferencedError, i as AttributeUsage, j as StorageOperation, k as SearchBackendError, l as ForbiddenError, m as ObjectNotFoundError, n as AttributeInUseError, o as ConcurrentModificationError, p as NotImplementedError, r as AttributeNotFoundError, s as DestructiveSyncNotAllowedError, t as AccessDeniedError, u as MemoryNotFoundError, v as ProtectedRoleError, w as ReservedObjectNameError, x as RecordReferencedError, y as RecordNotFoundError, z as isNotFoundError } from "./exceptions-DG_iMvYs.js";
|
|
3
3
|
export { AccessDeniedError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ChangeTypeNotSupportedError, ConcurrentModificationError, DestructiveSyncNotAllowedError, DuplicateError, ForbiddenError, MemoryNotFoundError, MigrationTimeoutError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { Jt as Uuid, K as MigrationDefinition, Y as Attribute } from "./exceptions-
|
|
3
|
-
import { i as ValidationResult, r as ValidationMessages } from "./index-
|
|
2
|
+
import { Jt as Uuid, K as MigrationDefinition, Y as Attribute } from "./exceptions-DG_iMvYs.mjs";
|
|
3
|
+
import { i as ValidationResult, r as ValidationMessages } from "./index-CK7gaSRm.mjs";
|
|
4
4
|
import { IconName } from "@stndrds/constants";
|
|
5
5
|
import { z as z$1 } from "zod";
|
|
6
6
|
//#region src/types/document-layout.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { Jt as Uuid, K as MigrationDefinition, Y as Attribute } from "./exceptions-
|
|
3
|
-
import { i as ValidationResult, r as ValidationMessages } from "./index-
|
|
2
|
+
import { Jt as Uuid, K as MigrationDefinition, Y as Attribute } from "./exceptions-DG_iMvYs.js";
|
|
3
|
+
import { i as ValidationResult, r as ValidationMessages } from "./index-ZnCTYc93.js";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
import { IconName } from "@stndrds/constants";
|
|
6
6
|
//#region src/types/document-layout.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { Y as Attribute, Z as AttributeType } from "./exceptions-
|
|
2
|
+
import { Y as Attribute, Z as AttributeType } from "./exceptions-DG_iMvYs.js";
|
|
3
3
|
import { z as z$1 } from "zod";
|
|
4
4
|
import { IconName } from "@stndrds/constants";
|
|
5
5
|
//#region src/types/mutations.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { Y as Attribute, Z as AttributeType } from "./exceptions-
|
|
2
|
+
import { Y as Attribute, Z as AttributeType } from "./exceptions-DG_iMvYs.mjs";
|
|
3
3
|
import { IconName } from "@stndrds/constants";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
//#region src/types/mutations.d.ts
|