@stndrds/schema 1.0.0-alpha.280 → 1.0.0-alpha.282
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-Ig0ig9wp.d.ts → all-C3EaFLCU.d.ts} +7 -17
- package/dist/{all-C0hXd79K.d.mts → all-CQMswOrw.d.mts} +7 -17
- package/dist/{attributes-D8eHv5Kf.d.ts → attributes-CU871AfG.d.ts} +12 -12
- package/dist/{attributes--M1ifW8_.d.mts → attributes-DoiGyNFk.d.mts} +12 -12
- package/dist/{chunk-FAEOVIDJ.js → chunk-DIMTNM3F.js} +7 -3
- package/dist/{chunk-NUEIGMYS.mjs → chunk-EFSS7PGC.mjs} +1 -1
- package/dist/{chunk-XDA5PZRT.mjs → chunk-HOVUEYEQ.mjs} +34 -0
- package/dist/{chunk-MXYCCUNB.js → chunk-KIMECN6D.js} +68 -44
- package/dist/{chunk-M3WFXOA4.js → chunk-L4KLYMUI.js} +34 -0
- package/dist/{chunk-XTBGGJ3G.js → chunk-LBGLB443.js} +3 -3
- package/dist/{chunk-PUMM6SPY.mjs → chunk-PLTLAMWJ.mjs} +1 -1
- package/dist/{chunk-TBAD2T7Q.mjs → chunk-QGRYOIHT.mjs} +37 -13
- package/dist/{chunk-MSIGO7JA.mjs → chunk-R34LOMT7.mjs} +5 -1
- package/dist/{chunk-3PGLMGTR.js → chunk-V4MZOTLV.js} +4 -4
- package/dist/exceptions.d.mts +22 -3
- package/dist/exceptions.d.ts +22 -3
- package/dist/exceptions.js +39 -39
- package/dist/exceptions.mjs +1 -1
- package/dist/{helpers-DyoPqiSz.d.ts → helpers-BNr-Dppk.d.ts} +3 -3
- package/dist/{helpers-BiABdSxK.d.mts → helpers-CfEOUBmB.d.mts} +3 -3
- package/dist/{index-SpFpkWVC.d.ts → index-Br7koyHF.d.ts} +53 -27
- package/dist/{index-C3P5Dnwt.d.mts → index-D9XBjFnu.d.mts} +53 -27
- package/dist/index.d.mts +568 -151
- package/dist/index.d.ts +568 -151
- package/dist/index.js +1389 -292
- package/dist/index.mjs +1174 -99
- package/dist/{migrations-B1kkIhIX.d.ts → migrations-BGWgXHXb.d.ts} +1 -1
- package/dist/{migrations-BNlQVzDC.d.mts → migrations-C-GN1xx_.d.mts} +1 -1
- package/dist/{objects-DmMqHn3L.d.mts → objects-BRypaBpi.d.mts} +2 -4
- package/dist/{objects-DgFojgwH.d.ts → objects-BiOMwzLL.d.ts} +2 -4
- package/dist/{types-DHqXzkgW.d.mts → types-80c2rOUZ.d.mts} +1 -1
- package/dist/{types-DYYFto8d.d.ts → types-DqYz8Iv_.d.ts} +1 -1
- package/dist/utils.js +8 -8
- package/dist/utils.mjs +2 -2
- package/dist/validation/all.d.mts +7 -7
- package/dist/validation/all.d.ts +7 -7
- package/dist/validation/all.js +29 -29
- package/dist/validation/all.mjs +4 -4
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +4 -4
- package/dist/validation/config/index.d.ts +4 -4
- package/dist/validation/config/index.js +11 -11
- package/dist/validation/config/index.mjs +2 -2
- package/dist/validation/core/index.d.mts +3 -3
- package/dist/validation/core/index.d.ts +3 -3
- package/dist/validation/object/index.d.mts +5 -5
- package/dist/validation/object/index.d.ts +5 -5
- package/dist/validation/object/index.js +14 -14
- package/dist/validation/object/index.mjs +2 -2
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import './types-
|
|
1
|
+
import './types-DqYz8Iv_.js';
|
|
2
2
|
import './validation/core/index.js';
|
|
3
|
-
import { D as DetailViewConfig, L as ListViewConfig, V as ViewType, a as ViewConfig } from './index-
|
|
3
|
+
import { D as DetailViewConfig, L as ListViewConfig, V as ViewType, a as ViewConfig } from './index-Br7koyHF.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import './helpers-
|
|
5
|
+
import './helpers-BNr-Dppk.js';
|
|
6
6
|
|
|
7
7
|
declare const SCHEMA_LIMITS: {
|
|
8
8
|
readonly attributesPerObject: 300;
|
|
@@ -13,6 +13,7 @@ declare const SCHEMA_LIMITS: {
|
|
|
13
13
|
readonly columnsPerTab: 50;
|
|
14
14
|
readonly optionsPerAttribute: 200;
|
|
15
15
|
readonly sidePanelAttributes: 100;
|
|
16
|
+
readonly sidePanelPanes: 20;
|
|
16
17
|
readonly filterRulesPerTab: 50;
|
|
17
18
|
readonly sortsPerTab: 20;
|
|
18
19
|
readonly emailAttributesPerTab: 30;
|
|
@@ -67,12 +68,13 @@ declare const tableSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
67
68
|
}, z.core.$strict>], "type">;
|
|
68
69
|
declare const detailTabSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
70
|
type: z.ZodLiteral<"form">;
|
|
70
|
-
groups: z.ZodArray<z.
|
|
71
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
71
72
|
type: z.ZodLiteral<"fields">;
|
|
72
73
|
fields: z.ZodArray<z.ZodObject<{
|
|
73
74
|
span: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<11>, z.ZodLiteral<12>]>>;
|
|
74
75
|
label: z.ZodOptional<z.ZodString>;
|
|
75
76
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
id: z.ZodOptional<z.ZodString>;
|
|
76
78
|
attribute: z.ZodOptional<z.ZodString>;
|
|
77
79
|
attributeGroup: z.ZodOptional<z.ZodObject<{
|
|
78
80
|
id: z.ZodString;
|
|
@@ -88,19 +90,7 @@ declare const detailTabSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
88
90
|
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
89
91
|
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
90
92
|
order: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
}, z.core.$strict
|
|
92
|
-
type: z.ZodLiteral<"relation">;
|
|
93
|
-
attribute: z.ZodString;
|
|
94
|
-
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
-
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
-
allowCreate: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
-
id: z.ZodString;
|
|
98
|
-
label: z.ZodString;
|
|
99
|
-
description: z.ZodOptional<z.ZodString>;
|
|
100
|
-
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
-
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
103
|
-
}, z.core.$strict>], "type">>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
104
94
|
formColumns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
105
95
|
density: z.ZodOptional<z.ZodEnum<{
|
|
106
96
|
compact: "compact";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import './types-
|
|
1
|
+
import './types-80c2rOUZ.mjs';
|
|
2
2
|
import './validation/core/index.mjs';
|
|
3
|
-
import { D as DetailViewConfig, L as ListViewConfig, V as ViewType, a as ViewConfig } from './index-
|
|
3
|
+
import { D as DetailViewConfig, L as ListViewConfig, V as ViewType, a as ViewConfig } from './index-D9XBjFnu.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import './helpers-
|
|
5
|
+
import './helpers-CfEOUBmB.mjs';
|
|
6
6
|
|
|
7
7
|
declare const SCHEMA_LIMITS: {
|
|
8
8
|
readonly attributesPerObject: 300;
|
|
@@ -13,6 +13,7 @@ declare const SCHEMA_LIMITS: {
|
|
|
13
13
|
readonly columnsPerTab: 50;
|
|
14
14
|
readonly optionsPerAttribute: 200;
|
|
15
15
|
readonly sidePanelAttributes: 100;
|
|
16
|
+
readonly sidePanelPanes: 20;
|
|
16
17
|
readonly filterRulesPerTab: 50;
|
|
17
18
|
readonly sortsPerTab: 20;
|
|
18
19
|
readonly emailAttributesPerTab: 30;
|
|
@@ -67,12 +68,13 @@ declare const tableSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
67
68
|
}, z.core.$strict>], "type">;
|
|
68
69
|
declare const detailTabSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
70
|
type: z.ZodLiteral<"form">;
|
|
70
|
-
groups: z.ZodArray<z.
|
|
71
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
71
72
|
type: z.ZodLiteral<"fields">;
|
|
72
73
|
fields: z.ZodArray<z.ZodObject<{
|
|
73
74
|
span: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>, z.ZodLiteral<8>, z.ZodLiteral<9>, z.ZodLiteral<10>, z.ZodLiteral<11>, z.ZodLiteral<12>]>>;
|
|
74
75
|
label: z.ZodOptional<z.ZodString>;
|
|
75
76
|
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
id: z.ZodOptional<z.ZodString>;
|
|
76
78
|
attribute: z.ZodOptional<z.ZodString>;
|
|
77
79
|
attributeGroup: z.ZodOptional<z.ZodObject<{
|
|
78
80
|
id: z.ZodString;
|
|
@@ -88,19 +90,7 @@ declare const detailTabSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
88
90
|
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
89
91
|
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
90
92
|
order: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
}, z.core.$strict
|
|
92
|
-
type: z.ZodLiteral<"relation">;
|
|
93
|
-
attribute: z.ZodString;
|
|
94
|
-
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
-
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
-
allowCreate: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
-
id: z.ZodString;
|
|
98
|
-
label: z.ZodString;
|
|
99
|
-
description: z.ZodOptional<z.ZodString>;
|
|
100
|
-
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
-
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
103
|
-
}, z.core.$strict>], "type">>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
104
94
|
formColumns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
105
95
|
density: z.ZodOptional<z.ZodEnum<{
|
|
106
96
|
compact: "compact";
|
|
@@ -36,22 +36,11 @@ type ComputedValueType = {
|
|
|
36
36
|
kind: "collection";
|
|
37
37
|
itemType: "text" | "number" | "boolean" | "date" | "select";
|
|
38
38
|
};
|
|
39
|
-
type ComputedStateStatus = "pending" | "fresh" | "stale" | "failed";
|
|
40
39
|
interface ComputedOptionsSource {
|
|
41
40
|
objectName: string;
|
|
42
41
|
attributeName: string;
|
|
43
42
|
attributeId?: string;
|
|
44
43
|
}
|
|
45
|
-
interface ComputedAttributeState {
|
|
46
|
-
attributeName: string;
|
|
47
|
-
status: ComputedStateStatus;
|
|
48
|
-
computedAt: Date | null;
|
|
49
|
-
staleSince: Date | null;
|
|
50
|
-
dependenciesHash: string | null;
|
|
51
|
-
jobId: string | null;
|
|
52
|
-
error: string | null;
|
|
53
|
-
updatedAt: Date;
|
|
54
|
-
}
|
|
55
44
|
type ComputedDependency = {
|
|
56
45
|
kind: "local";
|
|
57
46
|
attributeName: string;
|
|
@@ -530,6 +519,17 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
530
519
|
* Used when function="original" to render values as the target type
|
|
531
520
|
*/
|
|
532
521
|
targetAttributeType?: AttributeType;
|
|
522
|
+
/**
|
|
523
|
+
* Cached currency code of a currency target, from its `defaultCurrency`
|
|
524
|
+
* (#2644). The stored rollup value stays a bare number; this is the
|
|
525
|
+
* schema-derived channel that lets a single-code sum/avg render with its
|
|
526
|
+
* symbol. Absent → the value renders bare, exactly as before.
|
|
527
|
+
*
|
|
528
|
+
* Named for what it holds — an ISO 4217 CODE — rather than the siblings'
|
|
529
|
+
* `targetAttribute*` prefix: `targetAttributeCurrency` would read as a
|
|
530
|
+
* `Currency` value, which this deliberately is not.
|
|
531
|
+
*/
|
|
532
|
+
targetCurrencyCode?: CurrencyCode;
|
|
533
533
|
/**
|
|
534
534
|
* Cached options from target attribute (for select/status/multiselect display)
|
|
535
535
|
* Required when function="original" and target is a select-like type
|
|
@@ -580,4 +580,4 @@ declare function isAttributeSortable(attr: {
|
|
|
580
580
|
type: AttributeType;
|
|
581
581
|
}): boolean;
|
|
582
582
|
|
|
583
|
-
export { type
|
|
583
|
+
export { type PropertyType as $, type Attribute as A, type BilateralConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type AttributeGroup as E, type FormulaAttribute as F, type BaseAttribute as G, type ComputedFieldKind as H, type ComputedFormulaBinaryNode as I, type ComputedFormulaBinaryOperator as J, type ComputedFormulaCallNode as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, type ComputedFormulaLiteralNode as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, ComputedFormulaParseError as V, type ComputedFormulaPathNode as W, type DateFormat as X, type DateValue as Y, type NumberUnit as Z, type OptionPropertyAttribute as _, type RichtextAttribute as a, RELATION_TARGET_ANY as a0, type RichTextAttribute as a1, type StatusGroup as a2, hasOptions as a3, inferInverseCardinality as a4, isAttributeSortable as a5, isBilateralRelation as a6, isUniversalRelation as a7, parseComputedFormula as a8, resolvePropertyDefinitions as a9, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type RollupAttribute as e, type AttributeType as f, type CheckboxAttribute as g, type ComputedValueType as h, type ComputedReturnType as i, type ComputedOptionsSource as j, type ComputedDependency as k, type ComputedPlan as l, type ComputedFormulaAstNode as m, type LocationGranularity as n, type Location as o, type DateRangeValue as p, type DocumentAttribute as q, type Phone as r, type Currency as s, type PropertySchema as t, type TimeFormat as u, type PropertyAttribute as v, type FormulaReturnType as w, type RelationTarget as x, type RollupFunction as y, type UserReferenceType as z };
|
|
@@ -36,22 +36,11 @@ type ComputedValueType = {
|
|
|
36
36
|
kind: "collection";
|
|
37
37
|
itemType: "text" | "number" | "boolean" | "date" | "select";
|
|
38
38
|
};
|
|
39
|
-
type ComputedStateStatus = "pending" | "fresh" | "stale" | "failed";
|
|
40
39
|
interface ComputedOptionsSource {
|
|
41
40
|
objectName: string;
|
|
42
41
|
attributeName: string;
|
|
43
42
|
attributeId?: string;
|
|
44
43
|
}
|
|
45
|
-
interface ComputedAttributeState {
|
|
46
|
-
attributeName: string;
|
|
47
|
-
status: ComputedStateStatus;
|
|
48
|
-
computedAt: Date | null;
|
|
49
|
-
staleSince: Date | null;
|
|
50
|
-
dependenciesHash: string | null;
|
|
51
|
-
jobId: string | null;
|
|
52
|
-
error: string | null;
|
|
53
|
-
updatedAt: Date;
|
|
54
|
-
}
|
|
55
44
|
type ComputedDependency = {
|
|
56
45
|
kind: "local";
|
|
57
46
|
attributeName: string;
|
|
@@ -530,6 +519,17 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
530
519
|
* Used when function="original" to render values as the target type
|
|
531
520
|
*/
|
|
532
521
|
targetAttributeType?: AttributeType;
|
|
522
|
+
/**
|
|
523
|
+
* Cached currency code of a currency target, from its `defaultCurrency`
|
|
524
|
+
* (#2644). The stored rollup value stays a bare number; this is the
|
|
525
|
+
* schema-derived channel that lets a single-code sum/avg render with its
|
|
526
|
+
* symbol. Absent → the value renders bare, exactly as before.
|
|
527
|
+
*
|
|
528
|
+
* Named for what it holds — an ISO 4217 CODE — rather than the siblings'
|
|
529
|
+
* `targetAttribute*` prefix: `targetAttributeCurrency` would read as a
|
|
530
|
+
* `Currency` value, which this deliberately is not.
|
|
531
|
+
*/
|
|
532
|
+
targetCurrencyCode?: CurrencyCode;
|
|
533
533
|
/**
|
|
534
534
|
* Cached options from target attribute (for select/status/multiselect display)
|
|
535
535
|
* Required when function="original" and target is a select-like type
|
|
@@ -580,4 +580,4 @@ declare function isAttributeSortable(attr: {
|
|
|
580
580
|
type: AttributeType;
|
|
581
581
|
}): boolean;
|
|
582
582
|
|
|
583
|
-
export { type
|
|
583
|
+
export { type PropertyType as $, type Attribute as A, type BilateralConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type AttributeGroup as E, type FormulaAttribute as F, type BaseAttribute as G, type ComputedFieldKind as H, type ComputedFormulaBinaryNode as I, type ComputedFormulaBinaryOperator as J, type ComputedFormulaCallNode as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, type ComputedFormulaLiteralNode as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, ComputedFormulaParseError as V, type ComputedFormulaPathNode as W, type DateFormat as X, type DateValue as Y, type NumberUnit as Z, type OptionPropertyAttribute as _, type RichtextAttribute as a, RELATION_TARGET_ANY as a0, type RichTextAttribute as a1, type StatusGroup as a2, hasOptions as a3, inferInverseCardinality as a4, isAttributeSortable as a5, isBilateralRelation as a6, isUniversalRelation as a7, parseComputedFormula as a8, resolvePropertyDefinitions as a9, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type RollupAttribute as e, type AttributeType as f, type CheckboxAttribute as g, type ComputedValueType as h, type ComputedReturnType as i, type ComputedOptionsSource as j, type ComputedDependency as k, type ComputedPlan as l, type ComputedFormulaAstNode as m, type LocationGranularity as n, type Location as o, type DateRangeValue as p, type DocumentAttribute as q, type Phone as r, type Currency as s, type PropertySchema as t, type TimeFormat as u, type PropertyAttribute as v, type FormulaReturnType as w, type RelationTarget as x, type RollupFunction as y, type UserReferenceType as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL4KLYMUI_js = require('./chunk-L4KLYMUI.js');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
var constants = require('@stndrds/constants');
|
|
6
6
|
|
|
@@ -318,6 +318,7 @@ var SCHEMA_LIMITS = {
|
|
|
318
318
|
columnsPerTab: 50,
|
|
319
319
|
optionsPerAttribute: 200,
|
|
320
320
|
sidePanelAttributes: 100,
|
|
321
|
+
sidePanelPanes: 20,
|
|
321
322
|
filterRulesPerTab: 50,
|
|
322
323
|
sortsPerTab: 20,
|
|
323
324
|
emailAttributesPerTab: 30,
|
|
@@ -512,6 +513,9 @@ var rollupConfigSchema = baseConfigSchema.extend({
|
|
|
512
513
|
decimals: zod.z.number().int().min(0).max(10).optional(),
|
|
513
514
|
targetAttributeType: zod.z.string().optional(),
|
|
514
515
|
targetAttributeOptions: zod.z.array(optionSchema).optional(),
|
|
516
|
+
// The sum's symbol (#2644) — declared here or `.strip()` eats it before
|
|
517
|
+
// storage, exactly the fate this schema spares its two siblings above.
|
|
518
|
+
targetCurrencyCode: zod.z.string().length(3).optional(),
|
|
515
519
|
optionsSource: computedOptionsSourceSchema.optional()
|
|
516
520
|
});
|
|
517
521
|
var propertySchemaPassthrough = zod.z.object({ definitions: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())) }).passthrough();
|
|
@@ -571,7 +575,7 @@ function getAttributeConfigWriteSchema(type) {
|
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
577
|
function validationErrorFromIssues(issues) {
|
|
574
|
-
return
|
|
578
|
+
return chunkL4KLYMUI_js.ValidationError.fromZodErrors(
|
|
575
579
|
issues.map((issue) => ({
|
|
576
580
|
path: issue.path.map((segment) => typeof segment === "symbol" ? String(segment) : segment),
|
|
577
581
|
message: issue.message
|
|
@@ -594,7 +598,7 @@ function validatePatchedIcon(patch) {
|
|
|
594
598
|
}
|
|
595
599
|
const result = iconNameSchema.optional().safeParse(patch.icon);
|
|
596
600
|
if (!result.success) {
|
|
597
|
-
throw
|
|
601
|
+
throw chunkL4KLYMUI_js.ValidationError.fromZodErrors(
|
|
598
602
|
result.error.issues.map((issue) => ({
|
|
599
603
|
path: [
|
|
600
604
|
"icon",
|
|
@@ -19,8 +19,40 @@ var SchemaErrorCode = {
|
|
|
19
19
|
PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW",
|
|
20
20
|
PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE",
|
|
21
21
|
// Permissions
|
|
22
|
+
//
|
|
23
|
+
// `FORBIDDEN` means "you lack permission", and only that (#2681).
|
|
22
24
|
FORBIDDEN: "SCHEMA_FORBIDDEN",
|
|
23
25
|
ACCESS_DENIED: "SCHEMA_ACCESS_DENIED",
|
|
26
|
+
// Refusals that are NOT permission denials (#2681)
|
|
27
|
+
//
|
|
28
|
+
// `FORBIDDEN`'s message is redacted to a neutral sentence (#2675), which is
|
|
29
|
+
// honest only while the code means one thing. It did not: a workspace
|
|
30
|
+
// invariant (the last owner), a state gate (a disarmed reflex), an
|
|
31
|
+
// immutability refusal (system forms) and a missing actor context each told
|
|
32
|
+
// a caller who holds every permission that they lack one, sending them to an
|
|
33
|
+
// administrator with nothing to grant. So a refusal a permission grant would
|
|
34
|
+
// NOT lift takes one of the codes below — plus `SYSTEM_ENTITY_IMMUTABLE`,
|
|
35
|
+
// which already existed — and keeps the explanatory message that names its
|
|
36
|
+
// remedy. Every one answers 403, exactly as it did while miscoded: the
|
|
37
|
+
// ruling changed the semantics, not a single HTTP status.
|
|
38
|
+
//
|
|
39
|
+
// A fifth site was seen and deliberately left alone: `ApiKeyService`'s
|
|
40
|
+
// missing-actor refusal answers 400 `VALIDATION_FAILED`, and moving it here
|
|
41
|
+
// would change a public HTTP status — which the ruling forbids. It stays at
|
|
42
|
+
// its 400 pending a ruling of its own.
|
|
43
|
+
/**
|
|
44
|
+
* A workspace RULE refuses the write — the last owner cannot be removed.
|
|
45
|
+
*
|
|
46
|
+
* Not `INVARIANT_VIOLATION`, despite the name: that one is an internal
|
|
47
|
+
* "should never happen" assertion, a bug signal nobody outside the codebase
|
|
48
|
+
* can act on. This is the opposite — a rule the caller can act on, reached
|
|
49
|
+
* by a request that was entirely well-formed, whose message tells them how.
|
|
50
|
+
*/
|
|
51
|
+
WORKSPACE_INVARIANT: "SCHEMA_WORKSPACE_INVARIANT",
|
|
52
|
+
/** The resource's own state refuses the operation — a disarmed reflex run. */
|
|
53
|
+
STATE_GATE: "SCHEMA_STATE_GATE",
|
|
54
|
+
/** The operation needs an actor and the request carried none. */
|
|
55
|
+
ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED",
|
|
24
56
|
// Connectors
|
|
25
57
|
CONNECTOR_AUTH_FAILED: "SCHEMA_CONNECTOR_AUTH_FAILED",
|
|
26
58
|
CONNECTOR_INVALID_STATE: "SCHEMA_CONNECTOR_INVALID_STATE",
|
|
@@ -103,6 +135,8 @@ var SchemaErrorCode = {
|
|
|
103
135
|
AGENT_COMPACTION_TIMEOUT: "AGENT_COMPACTION_TIMEOUT",
|
|
104
136
|
AGENT_LEASE_HELD: "AGENT_LEASE_HELD",
|
|
105
137
|
AGENT_WORK_MODE_REQUIRED: "AGENT_WORK_MODE_REQUIRED",
|
|
138
|
+
AGENT_MESSAGE_NOT_FOUND: "AGENT_MESSAGE_NOT_FOUND",
|
|
139
|
+
AGENT_MESSAGE_NOT_EDITABLE: "AGENT_MESSAGE_NOT_EDITABLE",
|
|
106
140
|
// AI / LLM
|
|
107
141
|
AI_UNKNOWN: "AI_UNKNOWN",
|
|
108
142
|
AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDIMTNM3F_js = require('./chunk-DIMTNM3F.js');
|
|
4
|
+
var chunkL4KLYMUI_js = require('./chunk-L4KLYMUI.js');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
// src/types/system-attributes.ts
|
|
@@ -500,7 +500,7 @@ function canonicalizeFilterValue(rule, effectiveType) {
|
|
|
500
500
|
const message = `Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(
|
|
501
501
|
value
|
|
502
502
|
)}`;
|
|
503
|
-
throw new
|
|
503
|
+
throw new chunkL4KLYMUI_js.ValidationError(message, [{ path: ["value"], message }]);
|
|
504
504
|
}
|
|
505
505
|
function hasCurrencyAmount(value) {
|
|
506
506
|
if (typeof value !== "object") return true;
|
|
@@ -661,13 +661,13 @@ function resolveCanonicalOperator(rawOperator, effectiveType) {
|
|
|
661
661
|
const replacement = REMOVED_OPERATOR_REPLACEMENTS[rawOperator];
|
|
662
662
|
if (replacement) {
|
|
663
663
|
const m = `Unknown filter operator "${rawOperator}" \u2014 use ${replacement}`;
|
|
664
|
-
throw new
|
|
664
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
665
665
|
}
|
|
666
666
|
const normalized = normalizeOperator(rawOperator);
|
|
667
667
|
const membership = SUBSTRING_TO_MEMBERSHIP[normalized];
|
|
668
668
|
if (membership && SET_MEMBERSHIP_TYPES.has(effectiveType)) {
|
|
669
669
|
const m = `Operator "${normalized}" is not valid for type "${effectiveType}" \u2014 use "${membership}"`;
|
|
670
|
-
throw new
|
|
670
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
671
671
|
}
|
|
672
672
|
return normalized;
|
|
673
673
|
}
|
|
@@ -677,7 +677,7 @@ function assertOperatorForType(operator, type, context) {
|
|
|
677
677
|
if (!ops?.includes(normalized)) {
|
|
678
678
|
const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
|
|
679
679
|
const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
|
|
680
|
-
throw new
|
|
680
|
+
throw new chunkL4KLYMUI_js.ValidationError(summary, [
|
|
681
681
|
{
|
|
682
682
|
path: ["operator"],
|
|
683
683
|
message: summary
|
|
@@ -690,7 +690,7 @@ function assertRelativeDateValue(rule) {
|
|
|
690
690
|
if (rule.operator !== "is_within") return;
|
|
691
691
|
if (!isRelativeDateValue(rule.value)) {
|
|
692
692
|
const m = `Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }`;
|
|
693
|
-
throw new
|
|
693
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
function applyCanonicalForm(rule, operator, effectiveType) {
|
|
@@ -703,11 +703,11 @@ function assertDynamicValueForAttribute(rule, attrType) {
|
|
|
703
703
|
const v = rule.value;
|
|
704
704
|
if (v.dynamic === "actor" && attrType !== "user") {
|
|
705
705
|
const m = `actor token (@me) is only valid on user attributes, not "${attrType}"`;
|
|
706
|
-
throw new
|
|
706
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
707
707
|
}
|
|
708
708
|
if (v.dynamic === "date" && attrType !== "date") {
|
|
709
709
|
const m = `date token (@today/@now) is only valid on date attributes, not "${attrType}"`;
|
|
710
|
-
throw new
|
|
710
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
713
|
function collectQualifiedRuleIssues(rule, context) {
|
|
@@ -715,7 +715,7 @@ function collectQualifiedRuleIssues(rule, context) {
|
|
|
715
715
|
validateQualifiedRule({ ...rule }, context);
|
|
716
716
|
return [];
|
|
717
717
|
} catch (error) {
|
|
718
|
-
if (!(error instanceof
|
|
718
|
+
if (!(error instanceof chunkL4KLYMUI_js.ValidationError)) throw error;
|
|
719
719
|
return error.errors.map((issue) => ({ ...issue, path: [...issue.path] }));
|
|
720
720
|
}
|
|
721
721
|
}
|
|
@@ -723,17 +723,17 @@ function validateQualifiedRule(rule, context) {
|
|
|
723
723
|
const rootAttr = context.attributes.find((a) => a.name === rule.attribute);
|
|
724
724
|
const systemOps = SYSTEM_FILTER_OPERATORS[rule.attribute];
|
|
725
725
|
if (!(rootAttr || systemOps)) {
|
|
726
|
-
throw new
|
|
726
|
+
throw new chunkL4KLYMUI_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
|
|
727
727
|
{ path: ["attribute"], message: `Unknown attribute: ${rule.attribute}` }
|
|
728
728
|
]);
|
|
729
729
|
}
|
|
730
730
|
if (rule.quantifier !== void 0 && !rule.property) {
|
|
731
731
|
const m = `quantifier is only valid on qualified edge rules (set "property")`;
|
|
732
|
-
throw new
|
|
732
|
+
throw new chunkL4KLYMUI_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
|
|
733
733
|
}
|
|
734
734
|
if (!rootAttr) {
|
|
735
735
|
if (rule.property) {
|
|
736
|
-
throw new
|
|
736
|
+
throw new chunkL4KLYMUI_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
|
|
737
737
|
{ path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
|
|
738
738
|
]);
|
|
739
739
|
}
|
|
@@ -741,7 +741,7 @@ function validateQualifiedRule(rule, context) {
|
|
|
741
741
|
const normalizedOperator2 = resolveCanonicalOperator(rule.operator, effectiveType);
|
|
742
742
|
if (!systemOps.includes(normalizedOperator2)) {
|
|
743
743
|
const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
|
|
744
|
-
throw new
|
|
744
|
+
throw new chunkL4KLYMUI_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
745
745
|
}
|
|
746
746
|
applyCanonicalForm(rule, normalizedOperator2, effectiveType);
|
|
747
747
|
return;
|
|
@@ -753,25 +753,25 @@ function validateQualifiedRule(rule, context) {
|
|
|
753
753
|
if (!ops.includes(normalizedOperator2)) {
|
|
754
754
|
const validList = ops.length ? ops.join(", ") : "(not filterable)";
|
|
755
755
|
const summary = `Operator "${rule.operator}" is not valid for attribute "${rootAttr.name}". Valid operators: ${validList}.`;
|
|
756
|
-
throw new
|
|
756
|
+
throw new chunkL4KLYMUI_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
757
757
|
}
|
|
758
758
|
applyCanonicalForm(rule, normalizedOperator2, resolveEffectiveFilterType(rootAttr));
|
|
759
759
|
return;
|
|
760
760
|
}
|
|
761
761
|
if (!REFERENCE_TYPES.has(rootAttr.type)) {
|
|
762
|
-
throw new
|
|
762
|
+
throw new chunkL4KLYMUI_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
|
|
763
763
|
{ path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
|
|
764
764
|
]);
|
|
765
765
|
}
|
|
766
766
|
const propSchema = rootAttr.properties;
|
|
767
767
|
if (!propSchema) {
|
|
768
|
-
throw new
|
|
768
|
+
throw new chunkL4KLYMUI_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
|
|
769
769
|
{ path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
|
|
770
770
|
]);
|
|
771
771
|
}
|
|
772
772
|
const propDef = propSchema.definitions.find((p) => p.name === rule.property);
|
|
773
773
|
if (!propDef) {
|
|
774
|
-
throw new
|
|
774
|
+
throw new chunkL4KLYMUI_js.ValidationError(
|
|
775
775
|
`Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
|
|
776
776
|
[{ path: ["property"], message: `Unknown property: ${rule.property}` }]
|
|
777
777
|
);
|
|
@@ -787,7 +787,7 @@ function parseResourceVisibility(value) {
|
|
|
787
787
|
if (typeof value === "string" && RESOURCE_VISIBILITIES.includes(value)) {
|
|
788
788
|
return value;
|
|
789
789
|
}
|
|
790
|
-
throw new
|
|
790
|
+
throw new chunkL4KLYMUI_js.ValidationError(
|
|
791
791
|
`visibility must be one of: ${RESOURCE_VISIBILITIES.join(", ")} (received: ${String(value)})`,
|
|
792
792
|
[]
|
|
793
793
|
);
|
|
@@ -821,12 +821,12 @@ var RESERVED_OBJECT_NAMES = ["skill"];
|
|
|
821
821
|
// src/validators/view-config.schema.ts
|
|
822
822
|
var createModeSchema = zod.z.enum(["redirect", "inline", "peek"]);
|
|
823
823
|
var nonEmptyStringArraySchema = zod.z.array(zod.z.string()).min(1);
|
|
824
|
-
var columnsSchema = zod.z.array(zod.z.string()).max(
|
|
824
|
+
var columnsSchema = zod.z.array(zod.z.string()).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.columnsPerTab);
|
|
825
825
|
var sortRuleSchema = zod.z.object({
|
|
826
826
|
attribute: zod.z.string(),
|
|
827
827
|
direction: zod.z.enum(["asc", "desc"])
|
|
828
828
|
}).strict();
|
|
829
|
-
var sortsSchema = zod.z.array(sortRuleSchema).max(
|
|
829
|
+
var sortsSchema = zod.z.array(sortRuleSchema).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.sortsPerTab);
|
|
830
830
|
var relativeDateValueSchema = zod.z.object({
|
|
831
831
|
amount: zod.z.number(),
|
|
832
832
|
unit: zod.z.enum(["days", "weeks", "months", "years"]),
|
|
@@ -900,7 +900,7 @@ var filterRuleSchema = zod.z.object({
|
|
|
900
900
|
operator: filterOperatorSchema,
|
|
901
901
|
value: filterValueSchema
|
|
902
902
|
}).strict();
|
|
903
|
-
var filterRulesSchema = zod.z.array(filterRuleSchema).max(
|
|
903
|
+
var filterRulesSchema = zod.z.array(filterRuleSchema).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.filterRulesPerTab);
|
|
904
904
|
var filterStateSchema = zod.z.object({
|
|
905
905
|
combinator: zod.z.enum(["and", "or"]),
|
|
906
906
|
rules: filterRulesSchema
|
|
@@ -962,6 +962,8 @@ var fieldPresentationShape = {
|
|
|
962
962
|
readOnly: zod.z.boolean().optional()
|
|
963
963
|
};
|
|
964
964
|
var fieldSchema = zod.z.object({
|
|
965
|
+
/** Stable slot identity. Optional: a builder may omit it, `ensureFieldIds` assigns it. */
|
|
966
|
+
id: zod.z.string().optional(),
|
|
965
967
|
attribute: zod.z.string().optional(),
|
|
966
968
|
attributeGroup: attributeGroupFieldSchema.optional(),
|
|
967
969
|
...fieldPresentationShape
|
|
@@ -984,28 +986,20 @@ var baseGroupShape = {
|
|
|
984
986
|
var fieldGroupWriteSchema = zod.z.object({
|
|
985
987
|
...baseGroupShape,
|
|
986
988
|
type: zod.z.literal("fields"),
|
|
987
|
-
fields: zod.z.array(fieldSchema).max(
|
|
989
|
+
fields: zod.z.array(fieldSchema).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.fieldsPerGroup)
|
|
988
990
|
}).strict();
|
|
989
|
-
var
|
|
990
|
-
...baseGroupShape,
|
|
991
|
-
type: zod.z.literal("relation"),
|
|
992
|
-
attribute: zod.z.string(),
|
|
993
|
-
columns: zod.z.array(zod.z.string()).max(chunkFAEOVIDJ_js.SCHEMA_LIMITS.columnsPerTab).optional(),
|
|
994
|
-
readOnly: zod.z.boolean().optional(),
|
|
995
|
-
allowCreate: zod.z.boolean().optional()
|
|
996
|
-
}).strict();
|
|
997
|
-
var groupWriteSchema = zod.z.discriminatedUnion("type", [fieldGroupWriteSchema, relationGroupSchema]);
|
|
991
|
+
var groupWriteSchema = fieldGroupWriteSchema;
|
|
998
992
|
var baseTabShape = {
|
|
999
993
|
id: zod.z.string(),
|
|
1000
994
|
name: zod.z.string(),
|
|
1001
995
|
label: zod.z.string(),
|
|
1002
|
-
icon:
|
|
996
|
+
icon: chunkDIMTNM3F_js.iconNameSchema.optional(),
|
|
1003
997
|
order: zod.z.number().optional()
|
|
1004
998
|
};
|
|
1005
999
|
var formTabWriteSchema = zod.z.object({
|
|
1006
1000
|
...baseTabShape,
|
|
1007
1001
|
type: zod.z.literal("form"),
|
|
1008
|
-
groups: zod.z.array(groupWriteSchema).min(1).max(
|
|
1002
|
+
groups: zod.z.array(groupWriteSchema).min(1).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.groupsPerFormTab),
|
|
1009
1003
|
formColumns: zod.z.union([zod.z.literal(1), zod.z.literal(2), zod.z.literal(3)]).optional(),
|
|
1010
1004
|
density: zod.z.enum(["compact", "comfortable", "spacious"]).optional()
|
|
1011
1005
|
}).strict().superRefine((tab, ctx) => {
|
|
@@ -1014,13 +1008,13 @@ var formTabWriteSchema = zod.z.object({
|
|
|
1014
1008
|
(count, group) => count + (group.type === "fields" ? group.fields.length : 0),
|
|
1015
1009
|
0
|
|
1016
1010
|
);
|
|
1017
|
-
if (totalFields >
|
|
1011
|
+
if (totalFields > chunkDIMTNM3F_js.SCHEMA_LIMITS.fieldsPerFormTab) {
|
|
1018
1012
|
ctx.addIssue({
|
|
1019
1013
|
code: "too_big",
|
|
1020
1014
|
origin: "array",
|
|
1021
|
-
maximum:
|
|
1015
|
+
maximum: chunkDIMTNM3F_js.SCHEMA_LIMITS.fieldsPerFormTab,
|
|
1022
1016
|
inclusive: true,
|
|
1023
|
-
message: `A form tab can contain at most ${
|
|
1017
|
+
message: `A form tab can contain at most ${chunkDIMTNM3F_js.SCHEMA_LIMITS.fieldsPerFormTab} fields`,
|
|
1024
1018
|
path: ["groups"]
|
|
1025
1019
|
});
|
|
1026
1020
|
}
|
|
@@ -1222,12 +1216,12 @@ var formsTabSchema = zod.z.object({
|
|
|
1222
1216
|
var emailsTabSchema = zod.z.object({
|
|
1223
1217
|
...baseTabShape,
|
|
1224
1218
|
type: zod.z.literal("emails"),
|
|
1225
|
-
emailAttributeIds: zod.z.array(zod.z.string()).max(
|
|
1219
|
+
emailAttributeIds: zod.z.array(zod.z.string()).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1226
1220
|
}).strict();
|
|
1227
1221
|
var meetingsTabSchema = zod.z.object({
|
|
1228
1222
|
...baseTabShape,
|
|
1229
1223
|
type: zod.z.literal("meetings"),
|
|
1230
|
-
emailAttributeIds: zod.z.array(zod.z.string()).max(
|
|
1224
|
+
emailAttributeIds: zod.z.array(zod.z.string()).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1231
1225
|
}).strict();
|
|
1232
1226
|
var detailTabSchema = zod.z.discriminatedUnion("type", [
|
|
1233
1227
|
formTabWriteSchema,
|
|
@@ -1243,7 +1237,7 @@ var detailTabSchema = zod.z.discriminatedUnion("type", [
|
|
|
1243
1237
|
var listTabCommonShape = {
|
|
1244
1238
|
id: zod.z.string(),
|
|
1245
1239
|
label: zod.z.string(),
|
|
1246
|
-
icon:
|
|
1240
|
+
icon: chunkDIMTNM3F_js.iconNameSchema.optional(),
|
|
1247
1241
|
default: zod.z.boolean().optional(),
|
|
1248
1242
|
// Which records the tab scopes to. `"all"` is the default and means "impose
|
|
1249
1243
|
// no scope" — the mandatory viewer predicate alone decides, so the tab shows
|
|
@@ -1277,7 +1271,7 @@ var listViewTabSchema = zod.z.discriminatedUnion("layout", [
|
|
|
1277
1271
|
]);
|
|
1278
1272
|
var _listViewConfigSchema = zod.z.object({
|
|
1279
1273
|
defaultFilters: filterGroupSchema.optional(),
|
|
1280
|
-
tabs: zod.z.array(listViewTabSchema).min(1).max(
|
|
1274
|
+
tabs: zod.z.array(listViewTabSchema).min(1).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.tabsPerView)
|
|
1281
1275
|
}).strict().superRefine((config, ctx) => {
|
|
1282
1276
|
addDuplicateIdIssues(config.tabs, ctx, ["tabs"]);
|
|
1283
1277
|
let hasDefault = false;
|
|
@@ -1293,12 +1287,42 @@ var _listViewConfigSchema = zod.z.object({
|
|
|
1293
1287
|
hasDefault = true;
|
|
1294
1288
|
});
|
|
1295
1289
|
});
|
|
1290
|
+
var sidePanelPaneSchema = zod.z.discriminatedUnion("kind", [
|
|
1291
|
+
zod.z.object({
|
|
1292
|
+
kind: zod.z.literal("fields"),
|
|
1293
|
+
id: zod.z.string().optional(),
|
|
1294
|
+
label: zod.z.string().optional(),
|
|
1295
|
+
attributes: zod.z.array(zod.z.string()).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.sidePanelAttributes)
|
|
1296
|
+
}).strict(),
|
|
1297
|
+
zod.z.object({
|
|
1298
|
+
kind: zod.z.literal("activity"),
|
|
1299
|
+
id: zod.z.string().optional(),
|
|
1300
|
+
label: zod.z.string().optional()
|
|
1301
|
+
}).strict(),
|
|
1302
|
+
zod.z.object({
|
|
1303
|
+
kind: zod.z.literal("documents"),
|
|
1304
|
+
// Required here alone: the documents content keys its stored sort mode
|
|
1305
|
+
// on this id, so a pane without one would share the main-column
|
|
1306
|
+
// documents tab's sort.
|
|
1307
|
+
id: zod.z.string(),
|
|
1308
|
+
label: zod.z.string().optional(),
|
|
1309
|
+
allowUpload: zod.z.boolean().optional(),
|
|
1310
|
+
allowRemove: zod.z.boolean().optional()
|
|
1311
|
+
}).strict()
|
|
1312
|
+
]);
|
|
1296
1313
|
var _detailViewConfigSchema = zod.z.object({
|
|
1297
|
-
tabs: zod.z.array(detailTabSchema).min(1).max(
|
|
1314
|
+
tabs: zod.z.array(detailTabSchema).min(1).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.tabsPerView),
|
|
1298
1315
|
sidePanel: zod.z.object({
|
|
1299
|
-
attributes: zod.z.array(zod.z.string()).max(
|
|
1316
|
+
attributes: zod.z.array(zod.z.string()).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.sidePanelAttributes).optional(),
|
|
1317
|
+
panes: zod.z.array(sidePanelPaneSchema).max(chunkDIMTNM3F_js.SCHEMA_LIMITS.sidePanelPanes).optional(),
|
|
1300
1318
|
width: zod.z.number().optional()
|
|
1301
|
-
}).strict().
|
|
1319
|
+
}).strict().refine((sidePanel) => sidePanel.attributes !== void 0 || sidePanel.panes !== void 0, {
|
|
1320
|
+
message: "sidePanel requires attributes or panes"
|
|
1321
|
+
}).refine((sidePanel) => sidePanel.panes === void 0 || sidePanel.panes.length > 0, {
|
|
1322
|
+
message: "sidePanel panes must not be empty"
|
|
1323
|
+
}).refine((sidePanel) => sidePanel.attributes === void 0 || sidePanel.panes === void 0, {
|
|
1324
|
+
message: "sidePanel takes attributes or panes, not both"
|
|
1325
|
+
}).optional()
|
|
1302
1326
|
}).strict().superRefine((config, ctx) => {
|
|
1303
1327
|
addDuplicateIdIssues(config.tabs, ctx, ["tabs"]);
|
|
1304
1328
|
addDuplicateNameIssues(config.tabs, ctx, ["tabs"]);
|