@stndrds/schema 1.0.0-alpha.282 → 1.0.0-alpha.285
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-DanoPxKr.d.ts +879 -0
- package/dist/all-bG_ha0VV.d.mts +879 -0
- package/dist/{attributes-CU871AfG.d.ts → attributes-CNYwg_Nr.d.ts} +3 -2
- package/dist/{attributes-DoiGyNFk.d.mts → attributes-CWPLbp7c.d.mts} +3 -2
- package/dist/capabilities.d.mts +146 -0
- package/dist/capabilities.d.ts +146 -0
- package/dist/capabilities.js +77 -0
- package/dist/capabilities.mjs +70 -0
- package/dist/{chunk-R34LOMT7.mjs → chunk-5OBQRDRM.mjs} +3 -3
- package/dist/{chunk-QGRYOIHT.mjs → chunk-AGRAFDGU.mjs} +40 -14
- package/dist/{chunk-DIMTNM3F.js → chunk-BOICAZHR.js} +5 -4
- package/dist/{chunk-V4MZOTLV.js → chunk-I3EYILYO.js} +5 -5
- package/dist/{chunk-LBGLB443.js → chunk-K6ET4CXP.js} +3 -3
- package/dist/{chunk-PLTLAMWJ.mjs → chunk-PNOWKRH2.mjs} +2 -2
- package/dist/{chunk-EFSS7PGC.mjs → chunk-R57T4UDX.mjs} +1 -1
- package/dist/{chunk-HOVUEYEQ.mjs → chunk-RUO25ERR.mjs} +4 -0
- package/dist/{chunk-L4KLYMUI.js → chunk-V26R64A4.js} +4 -0
- package/dist/{chunk-KIMECN6D.js → chunk-YZ5RCMIQ.js} +83 -46
- package/dist/exceptions.d.mts +6 -2
- package/dist/exceptions.d.ts +6 -2
- package/dist/exceptions.js +39 -39
- package/dist/exceptions.mjs +1 -1
- package/dist/{helpers-BNr-Dppk.d.ts → helpers-CXkVwpsl.d.ts} +3 -3
- package/dist/{helpers-CfEOUBmB.d.mts → helpers-Dul_r9rJ.d.mts} +3 -3
- package/dist/{index-D9XBjFnu.d.mts → index-Ca-MzQuU.d.mts} +8 -3
- package/dist/{index-Br7koyHF.d.ts → index-Ns6KGfrZ.d.ts} +8 -3
- package/dist/index.d.mts +1120 -206
- package/dist/index.d.ts +1120 -206
- package/dist/index.js +1184 -359
- package/dist/index.mjs +868 -118
- package/dist/{migrations-BGWgXHXb.d.ts → migrations-DaFneOfx.d.ts} +1 -1
- package/dist/{migrations-C-GN1xx_.d.mts → migrations-fRvadl6i.d.mts} +1 -1
- package/dist/{objects-BRypaBpi.d.mts → objects-CDwMSnqv.d.mts} +2 -2
- package/dist/{objects-BiOMwzLL.d.ts → objects-DJv6WrDE.d.ts} +2 -2
- package/dist/{types-80c2rOUZ.d.mts → types-CVYiFc69.d.mts} +1 -1
- package/dist/{types-DqYz8Iv_.d.ts → types-NGEww_ln.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 +46 -46
- package/dist/validation/all.mjs +5 -5
- 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 +15 -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 +15 -15
- package/dist/validation/object/index.mjs +3 -3
- 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 +10 -5
- package/dist/all-C3EaFLCU.d.ts +0 -472
- package/dist/all-CQMswOrw.d.mts +0 -472
|
@@ -132,7 +132,8 @@ type OptionPropertyAttribute = SelectAttribute | StatusAttribute | MultiselectAt
|
|
|
132
132
|
*/
|
|
133
133
|
declare function hasOptions(attr: PropertyAttribute): attr is OptionPropertyAttribute;
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
declare const ATTRIBUTE_TYPES: readonly ["text", "richtext", "number", "checkbox", "date", "phone", "currency", "status", "location", "select", "multiselect", "user", "relation", "formula", "rollup", "document"];
|
|
136
|
+
type AttributeType = (typeof ATTRIBUTE_TYPES)[number];
|
|
136
137
|
/**
|
|
137
138
|
* Status group categorization
|
|
138
139
|
*/
|
|
@@ -580,4 +581,4 @@ declare function isAttributeSortable(attr: {
|
|
|
580
581
|
type: AttributeType;
|
|
581
582
|
}): boolean;
|
|
582
583
|
|
|
583
|
-
export { type
|
|
584
|
+
export { type OptionPropertyAttribute as $, type Attribute as A, type BilateralConfig as B, type CurrencyAttribute as C, type DateAttribute as D, ATTRIBUTE_TYPES as E, type FormulaAttribute as F, type AttributeGroup as G, type BaseAttribute as H, type ComputedFieldKind as I, type ComputedFormulaBinaryNode as J, type ComputedFormulaBinaryOperator as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, type ComputedFormulaCallNode as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type ComputedFormulaLiteralNode as V, ComputedFormulaParseError as W, type ComputedFormulaPathNode as X, type DateFormat as Y, type DateValue as Z, type NumberUnit as _, type RichtextAttribute as a, type PropertyType as a0, RELATION_TARGET_ANY as a1, type RichTextAttribute as a2, type StatusGroup as a3, hasOptions as a4, inferInverseCardinality as a5, isAttributeSortable as a6, isBilateralRelation as a7, isUniversalRelation as a8, parseComputedFormula as a9, resolvePropertyDefinitions as aa, 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 };
|
|
@@ -132,7 +132,8 @@ type OptionPropertyAttribute = SelectAttribute | StatusAttribute | MultiselectAt
|
|
|
132
132
|
*/
|
|
133
133
|
declare function hasOptions(attr: PropertyAttribute): attr is OptionPropertyAttribute;
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
declare const ATTRIBUTE_TYPES: readonly ["text", "richtext", "number", "checkbox", "date", "phone", "currency", "status", "location", "select", "multiselect", "user", "relation", "formula", "rollup", "document"];
|
|
136
|
+
type AttributeType = (typeof ATTRIBUTE_TYPES)[number];
|
|
136
137
|
/**
|
|
137
138
|
* Status group categorization
|
|
138
139
|
*/
|
|
@@ -580,4 +581,4 @@ declare function isAttributeSortable(attr: {
|
|
|
580
581
|
type: AttributeType;
|
|
581
582
|
}): boolean;
|
|
582
583
|
|
|
583
|
-
export { type
|
|
584
|
+
export { type OptionPropertyAttribute as $, type Attribute as A, type BilateralConfig as B, type CurrencyAttribute as C, type DateAttribute as D, ATTRIBUTE_TYPES as E, type FormulaAttribute as F, type AttributeGroup as G, type BaseAttribute as H, type ComputedFieldKind as I, type ComputedFormulaBinaryNode as J, type ComputedFormulaBinaryOperator as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, type ComputedFormulaCallNode as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type ComputedFormulaLiteralNode as V, ComputedFormulaParseError as W, type ComputedFormulaPathNode as X, type DateFormat as Y, type DateValue as Z, type NumberUnit as _, type RichtextAttribute as a, type PropertyType as a0, RELATION_TARGET_ANY as a1, type RichTextAttribute as a2, type StatusGroup as a3, hasOptions as a4, inferInverseCardinality as a5, isAttributeSortable as a6, isBilateralRelation as a7, isUniversalRelation as a8, parseComputedFormula as a9, resolvePropertyDefinitions as aa, 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 };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Accepted forms of the object identifier every object-scoped capability takes. */
|
|
4
|
+
declare const OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
+
/** Shared suffix for record `data` inputs that accept `$fromSandboxFile` references for large content. */
|
|
6
|
+
declare const SANDBOX_FILE_DATA_HINT = " For large text content (> a few KB), write it to a sandbox file first and pass {\"$fromSandboxFile\": \"/workspace/<file>\"} as the attribute value \u2014 the server substitutes the file content.";
|
|
7
|
+
/**
|
|
8
|
+
* The LLM-facing filter shape, deliberately looser than its two siblings:
|
|
9
|
+
* `types/filters.ts` (`FilterState`, the canonical TS model — its `quantifier`
|
|
10
|
+
* is omitted here on purpose, agents don't set edge quantifiers) and
|
|
11
|
+
* `validators/view-config.schema.ts` (`filterStateSchema`, the strict capped
|
|
12
|
+
* variant for stored view config). The operator list in the describe text
|
|
13
|
+
* restates `filters/operators.ts` (`OPERATOR_SPECS`) and
|
|
14
|
+
* `filters/normalize-operator.ts` (`SYNONYM_ALIASES`) — those are the source
|
|
15
|
+
* of truth; keep the prose in sync when adding an operator.
|
|
16
|
+
*/
|
|
17
|
+
declare const filtersSchema: z.ZodObject<{
|
|
18
|
+
combinator: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
and: "and";
|
|
20
|
+
or: "or";
|
|
21
|
+
}>>;
|
|
22
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
23
|
+
attribute: z.ZodString;
|
|
24
|
+
property: z.ZodOptional<z.ZodString>;
|
|
25
|
+
operator: z.ZodString;
|
|
26
|
+
value: z.ZodNullable<z.ZodUnknown>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
declare const sortsSchema: z.ZodArray<z.ZodObject<{
|
|
30
|
+
attribute: z.ZodString;
|
|
31
|
+
direction: z.ZodEnum<{
|
|
32
|
+
asc: "asc";
|
|
33
|
+
desc: "desc";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
/**
|
|
37
|
+
* Filter shapes derived from {@link filtersSchema} so the capability schema stays
|
|
38
|
+
* the single source of truth.
|
|
39
|
+
*
|
|
40
|
+
* The *parsed* shape (`z.infer`), deliberately: the runtime holds these after
|
|
41
|
+
* validation, when `combinator` has already been defaulted. What a caller may
|
|
42
|
+
* omit is `z.input`, and that is what {@link CapabilityInput} exposes.
|
|
43
|
+
*/
|
|
44
|
+
type FilterStateInput = z.infer<typeof filtersSchema>;
|
|
45
|
+
type FilterRuleInput = FilterStateInput["rules"][number];
|
|
46
|
+
/** How a capability mutates data, which decides whether a rehearsal captures it. */
|
|
47
|
+
type CapabilityKind = "read" | "create" | "update" | "delete";
|
|
48
|
+
/**
|
|
49
|
+
* Every capability a Reflex may call, defined once.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately five entries — the single-record tools whose input the gateway can
|
|
52
|
+
* turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
|
|
53
|
+
* `global_search` and `bulk_search`, which are not scoped to one object and so
|
|
54
|
+
* yield no object to grant a permission on; and the `bulk_*` record tools, where
|
|
55
|
+
* one call mutates many records and would be recorded as a single effect, making
|
|
56
|
+
* an effects report understate what happened.
|
|
57
|
+
*
|
|
58
|
+
* `description` is NOT here: the tools compute it per call from their config
|
|
59
|
+
* (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
|
|
60
|
+
* pins both variants. The name, the kind and the input schema are what must exist
|
|
61
|
+
* exactly once, and they do.
|
|
62
|
+
*/
|
|
63
|
+
declare const RECORD_CAPABILITIES: {
|
|
64
|
+
readonly get_record: {
|
|
65
|
+
readonly name: "get_record";
|
|
66
|
+
readonly kind: "read";
|
|
67
|
+
readonly input: z.ZodObject<{
|
|
68
|
+
recordId: z.ZodString;
|
|
69
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
};
|
|
72
|
+
readonly search_records: {
|
|
73
|
+
readonly name: "search_records";
|
|
74
|
+
readonly kind: "read";
|
|
75
|
+
readonly input: z.ZodObject<{
|
|
76
|
+
objectId: z.ZodString;
|
|
77
|
+
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
78
|
+
query: z.ZodOptional<z.ZodString>;
|
|
79
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
+
filters: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
combinator: z.ZodDefault<z.ZodEnum<{
|
|
84
|
+
and: "and";
|
|
85
|
+
or: "or";
|
|
86
|
+
}>>;
|
|
87
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
88
|
+
attribute: z.ZodString;
|
|
89
|
+
property: z.ZodOptional<z.ZodString>;
|
|
90
|
+
operator: z.ZodString;
|
|
91
|
+
value: z.ZodNullable<z.ZodUnknown>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
attribute: z.ZodString;
|
|
96
|
+
direction: z.ZodEnum<{
|
|
97
|
+
asc: "asc";
|
|
98
|
+
desc: "desc";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
};
|
|
103
|
+
readonly create_record: {
|
|
104
|
+
readonly name: "create_record";
|
|
105
|
+
readonly kind: "create";
|
|
106
|
+
readonly input: z.ZodObject<{
|
|
107
|
+
objectId: z.ZodString;
|
|
108
|
+
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
109
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
};
|
|
112
|
+
readonly update_record: {
|
|
113
|
+
readonly name: "update_record";
|
|
114
|
+
readonly kind: "update";
|
|
115
|
+
readonly input: z.ZodObject<{
|
|
116
|
+
recordId: z.ZodString;
|
|
117
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
};
|
|
120
|
+
readonly delete_record: {
|
|
121
|
+
readonly name: "delete_record";
|
|
122
|
+
readonly kind: "delete";
|
|
123
|
+
readonly input: z.ZodObject<{
|
|
124
|
+
recordId: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
|
|
129
|
+
/**
|
|
130
|
+
* A capability's argument type, inferred from the very schema the runtime
|
|
131
|
+
* validates against.
|
|
132
|
+
*
|
|
133
|
+
* `z.input`, not `z.infer`: these are the arguments a caller supplies, and the
|
|
134
|
+
* two sides differ wherever a field has a `.default()` — `filtersSchema`'s
|
|
135
|
+
* `combinator` is required on the output and optional on the input. Typing
|
|
136
|
+
* arguments with the output side made the SDK demand a `combinator` the runtime
|
|
137
|
+
* would have filled in anyway.
|
|
138
|
+
*/
|
|
139
|
+
type CapabilityInput<N extends RecordCapabilityName> = z.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
|
|
140
|
+
/**
|
|
141
|
+
* The capability → kind projection, derived rather than restated. The reflexes
|
|
142
|
+
* module reads this instead of maintaining its own table (D26/D28).
|
|
143
|
+
*/
|
|
144
|
+
declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
|
|
145
|
+
|
|
146
|
+
export { type CapabilityInput, type CapabilityKind, type FilterRuleInput, type FilterStateInput, OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, type RecordCapabilityName, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Accepted forms of the object identifier every object-scoped capability takes. */
|
|
4
|
+
declare const OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
+
/** Shared suffix for record `data` inputs that accept `$fromSandboxFile` references for large content. */
|
|
6
|
+
declare const SANDBOX_FILE_DATA_HINT = " For large text content (> a few KB), write it to a sandbox file first and pass {\"$fromSandboxFile\": \"/workspace/<file>\"} as the attribute value \u2014 the server substitutes the file content.";
|
|
7
|
+
/**
|
|
8
|
+
* The LLM-facing filter shape, deliberately looser than its two siblings:
|
|
9
|
+
* `types/filters.ts` (`FilterState`, the canonical TS model — its `quantifier`
|
|
10
|
+
* is omitted here on purpose, agents don't set edge quantifiers) and
|
|
11
|
+
* `validators/view-config.schema.ts` (`filterStateSchema`, the strict capped
|
|
12
|
+
* variant for stored view config). The operator list in the describe text
|
|
13
|
+
* restates `filters/operators.ts` (`OPERATOR_SPECS`) and
|
|
14
|
+
* `filters/normalize-operator.ts` (`SYNONYM_ALIASES`) — those are the source
|
|
15
|
+
* of truth; keep the prose in sync when adding an operator.
|
|
16
|
+
*/
|
|
17
|
+
declare const filtersSchema: z.ZodObject<{
|
|
18
|
+
combinator: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
and: "and";
|
|
20
|
+
or: "or";
|
|
21
|
+
}>>;
|
|
22
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
23
|
+
attribute: z.ZodString;
|
|
24
|
+
property: z.ZodOptional<z.ZodString>;
|
|
25
|
+
operator: z.ZodString;
|
|
26
|
+
value: z.ZodNullable<z.ZodUnknown>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
declare const sortsSchema: z.ZodArray<z.ZodObject<{
|
|
30
|
+
attribute: z.ZodString;
|
|
31
|
+
direction: z.ZodEnum<{
|
|
32
|
+
asc: "asc";
|
|
33
|
+
desc: "desc";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
/**
|
|
37
|
+
* Filter shapes derived from {@link filtersSchema} so the capability schema stays
|
|
38
|
+
* the single source of truth.
|
|
39
|
+
*
|
|
40
|
+
* The *parsed* shape (`z.infer`), deliberately: the runtime holds these after
|
|
41
|
+
* validation, when `combinator` has already been defaulted. What a caller may
|
|
42
|
+
* omit is `z.input`, and that is what {@link CapabilityInput} exposes.
|
|
43
|
+
*/
|
|
44
|
+
type FilterStateInput = z.infer<typeof filtersSchema>;
|
|
45
|
+
type FilterRuleInput = FilterStateInput["rules"][number];
|
|
46
|
+
/** How a capability mutates data, which decides whether a rehearsal captures it. */
|
|
47
|
+
type CapabilityKind = "read" | "create" | "update" | "delete";
|
|
48
|
+
/**
|
|
49
|
+
* Every capability a Reflex may call, defined once.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately five entries — the single-record tools whose input the gateway can
|
|
52
|
+
* turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
|
|
53
|
+
* `global_search` and `bulk_search`, which are not scoped to one object and so
|
|
54
|
+
* yield no object to grant a permission on; and the `bulk_*` record tools, where
|
|
55
|
+
* one call mutates many records and would be recorded as a single effect, making
|
|
56
|
+
* an effects report understate what happened.
|
|
57
|
+
*
|
|
58
|
+
* `description` is NOT here: the tools compute it per call from their config
|
|
59
|
+
* (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
|
|
60
|
+
* pins both variants. The name, the kind and the input schema are what must exist
|
|
61
|
+
* exactly once, and they do.
|
|
62
|
+
*/
|
|
63
|
+
declare const RECORD_CAPABILITIES: {
|
|
64
|
+
readonly get_record: {
|
|
65
|
+
readonly name: "get_record";
|
|
66
|
+
readonly kind: "read";
|
|
67
|
+
readonly input: z.ZodObject<{
|
|
68
|
+
recordId: z.ZodString;
|
|
69
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
};
|
|
72
|
+
readonly search_records: {
|
|
73
|
+
readonly name: "search_records";
|
|
74
|
+
readonly kind: "read";
|
|
75
|
+
readonly input: z.ZodObject<{
|
|
76
|
+
objectId: z.ZodString;
|
|
77
|
+
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
78
|
+
query: z.ZodOptional<z.ZodString>;
|
|
79
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
+
filters: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
combinator: z.ZodDefault<z.ZodEnum<{
|
|
84
|
+
and: "and";
|
|
85
|
+
or: "or";
|
|
86
|
+
}>>;
|
|
87
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
88
|
+
attribute: z.ZodString;
|
|
89
|
+
property: z.ZodOptional<z.ZodString>;
|
|
90
|
+
operator: z.ZodString;
|
|
91
|
+
value: z.ZodNullable<z.ZodUnknown>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
attribute: z.ZodString;
|
|
96
|
+
direction: z.ZodEnum<{
|
|
97
|
+
asc: "asc";
|
|
98
|
+
desc: "desc";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
};
|
|
103
|
+
readonly create_record: {
|
|
104
|
+
readonly name: "create_record";
|
|
105
|
+
readonly kind: "create";
|
|
106
|
+
readonly input: z.ZodObject<{
|
|
107
|
+
objectId: z.ZodString;
|
|
108
|
+
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
109
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
};
|
|
112
|
+
readonly update_record: {
|
|
113
|
+
readonly name: "update_record";
|
|
114
|
+
readonly kind: "update";
|
|
115
|
+
readonly input: z.ZodObject<{
|
|
116
|
+
recordId: z.ZodString;
|
|
117
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
};
|
|
120
|
+
readonly delete_record: {
|
|
121
|
+
readonly name: "delete_record";
|
|
122
|
+
readonly kind: "delete";
|
|
123
|
+
readonly input: z.ZodObject<{
|
|
124
|
+
recordId: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
|
|
129
|
+
/**
|
|
130
|
+
* A capability's argument type, inferred from the very schema the runtime
|
|
131
|
+
* validates against.
|
|
132
|
+
*
|
|
133
|
+
* `z.input`, not `z.infer`: these are the arguments a caller supplies, and the
|
|
134
|
+
* two sides differ wherever a field has a `.default()` — `filtersSchema`'s
|
|
135
|
+
* `combinator` is required on the output and optional on the input. Typing
|
|
136
|
+
* arguments with the output side made the SDK demand a `combinator` the runtime
|
|
137
|
+
* would have filled in anyway.
|
|
138
|
+
*/
|
|
139
|
+
type CapabilityInput<N extends RecordCapabilityName> = z.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
|
|
140
|
+
/**
|
|
141
|
+
* The capability → kind projection, derived rather than restated. The reflexes
|
|
142
|
+
* module reads this instead of maintaining its own table (D26/D28).
|
|
143
|
+
*/
|
|
144
|
+
declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
|
|
145
|
+
|
|
146
|
+
export { type CapabilityInput, type CapabilityKind, type FilterRuleInput, type FilterStateInput, OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, type RecordCapabilityName, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
// src/capabilities.ts
|
|
6
|
+
var OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
7
|
+
var SANDBOX_FILE_DATA_HINT = ' For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value \u2014 the server substitutes the file content.';
|
|
8
|
+
var filtersSchema = zod.z.object({
|
|
9
|
+
combinator: zod.z.enum(["and", "or"]).default("and"),
|
|
10
|
+
rules: zod.z.array(
|
|
11
|
+
zod.z.object({
|
|
12
|
+
attribute: zod.z.string().describe("Attribute name on the object being searched"),
|
|
13
|
+
property: zod.z.string().optional().describe(
|
|
14
|
+
"Optional. Only valid when 'attribute' is a relation / document / user attribute declared with .qualifyWith({...}). When set, the rule filters on the named EDGE property (not the linked record) and the operator must be valid for that property's type. See <filter_operators>."
|
|
15
|
+
),
|
|
16
|
+
operator: zod.z.string().describe(
|
|
17
|
+
"Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) \u2014 see <filter_operators>."
|
|
18
|
+
),
|
|
19
|
+
value: zod.z.unknown().nullable().describe(
|
|
20
|
+
"Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month."
|
|
21
|
+
)
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
});
|
|
25
|
+
var sortsSchema = zod.z.array(
|
|
26
|
+
zod.z.object({
|
|
27
|
+
attribute: zod.z.string().describe("Attribute name"),
|
|
28
|
+
direction: zod.z.enum(["asc", "desc"])
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
var getRecordInput = zod.z.object({
|
|
32
|
+
recordId: zod.z.string().describe("Record UUID"),
|
|
33
|
+
fields: zod.z.array(zod.z.string()).optional().describe("Attribute names to return")
|
|
34
|
+
});
|
|
35
|
+
var searchRecordsInput = zod.z.object({
|
|
36
|
+
objectId: zod.z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
37
|
+
_displayLabel: zod.z.string().optional().describe("Display label"),
|
|
38
|
+
query: zod.z.string().optional().describe("Full-text search query (omit to browse/list)"),
|
|
39
|
+
limit: zod.z.number().optional().describe("Max results per call: 1-1000 (default 20). Paginate via offset for more."),
|
|
40
|
+
offset: zod.z.number().optional().describe("Skip N records (default 0)"),
|
|
41
|
+
fields: zod.z.array(zod.z.string()).optional().describe("Attribute names to include in values"),
|
|
42
|
+
filters: filtersSchema.optional().describe(
|
|
43
|
+
"Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type \u2014 see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property."
|
|
44
|
+
),
|
|
45
|
+
sorts: sortsSchema.optional().describe("Sorts: [{ attribute, direction: 'asc'|'desc' }]")
|
|
46
|
+
});
|
|
47
|
+
var createRecordInput = zod.z.object({
|
|
48
|
+
objectId: zod.z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
49
|
+
_displayLabel: zod.z.string().optional().describe("Display label"),
|
|
50
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown()).describe(`Record data.${SANDBOX_FILE_DATA_HINT}`)
|
|
51
|
+
});
|
|
52
|
+
var updateRecordInput = zod.z.object({
|
|
53
|
+
recordId: zod.z.string().describe("Record UUID"),
|
|
54
|
+
data: zod.z.record(zod.z.string(), zod.z.unknown()).describe(`Fields to update.${SANDBOX_FILE_DATA_HINT}`)
|
|
55
|
+
});
|
|
56
|
+
var deleteRecordInput = zod.z.object({
|
|
57
|
+
recordId: zod.z.string().describe("Record UUID")
|
|
58
|
+
});
|
|
59
|
+
var RECORD_CAPABILITIES = {
|
|
60
|
+
get_record: { name: "get_record", kind: "read", input: getRecordInput },
|
|
61
|
+
search_records: { name: "search_records", kind: "read", input: searchRecordsInput },
|
|
62
|
+
create_record: { name: "create_record", kind: "create", input: createRecordInput },
|
|
63
|
+
update_record: { name: "update_record", kind: "update", input: updateRecordInput },
|
|
64
|
+
delete_record: { name: "delete_record", kind: "delete", input: deleteRecordInput }
|
|
65
|
+
};
|
|
66
|
+
var RECORD_CAPABILITY_KINDS = Object.freeze(
|
|
67
|
+
Object.fromEntries(
|
|
68
|
+
Object.values(RECORD_CAPABILITIES).map((capability) => [capability.name, capability.kind])
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
exports.OBJECT_ID_DESCRIPTION = OBJECT_ID_DESCRIPTION;
|
|
73
|
+
exports.RECORD_CAPABILITIES = RECORD_CAPABILITIES;
|
|
74
|
+
exports.RECORD_CAPABILITY_KINDS = RECORD_CAPABILITY_KINDS;
|
|
75
|
+
exports.SANDBOX_FILE_DATA_HINT = SANDBOX_FILE_DATA_HINT;
|
|
76
|
+
exports.filtersSchema = filtersSchema;
|
|
77
|
+
exports.sortsSchema = sortsSchema;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/capabilities.ts
|
|
4
|
+
var OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
+
var SANDBOX_FILE_DATA_HINT = ' For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value \u2014 the server substitutes the file content.';
|
|
6
|
+
var filtersSchema = z.object({
|
|
7
|
+
combinator: z.enum(["and", "or"]).default("and"),
|
|
8
|
+
rules: z.array(
|
|
9
|
+
z.object({
|
|
10
|
+
attribute: z.string().describe("Attribute name on the object being searched"),
|
|
11
|
+
property: z.string().optional().describe(
|
|
12
|
+
"Optional. Only valid when 'attribute' is a relation / document / user attribute declared with .qualifyWith({...}). When set, the rule filters on the named EDGE property (not the linked record) and the operator must be valid for that property's type. See <filter_operators>."
|
|
13
|
+
),
|
|
14
|
+
operator: z.string().describe(
|
|
15
|
+
"Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) \u2014 see <filter_operators>."
|
|
16
|
+
),
|
|
17
|
+
value: z.unknown().nullable().describe(
|
|
18
|
+
"Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month."
|
|
19
|
+
)
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
});
|
|
23
|
+
var sortsSchema = z.array(
|
|
24
|
+
z.object({
|
|
25
|
+
attribute: z.string().describe("Attribute name"),
|
|
26
|
+
direction: z.enum(["asc", "desc"])
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
var getRecordInput = z.object({
|
|
30
|
+
recordId: z.string().describe("Record UUID"),
|
|
31
|
+
fields: z.array(z.string()).optional().describe("Attribute names to return")
|
|
32
|
+
});
|
|
33
|
+
var searchRecordsInput = z.object({
|
|
34
|
+
objectId: z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
35
|
+
_displayLabel: z.string().optional().describe("Display label"),
|
|
36
|
+
query: z.string().optional().describe("Full-text search query (omit to browse/list)"),
|
|
37
|
+
limit: z.number().optional().describe("Max results per call: 1-1000 (default 20). Paginate via offset for more."),
|
|
38
|
+
offset: z.number().optional().describe("Skip N records (default 0)"),
|
|
39
|
+
fields: z.array(z.string()).optional().describe("Attribute names to include in values"),
|
|
40
|
+
filters: filtersSchema.optional().describe(
|
|
41
|
+
"Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type \u2014 see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property."
|
|
42
|
+
),
|
|
43
|
+
sorts: sortsSchema.optional().describe("Sorts: [{ attribute, direction: 'asc'|'desc' }]")
|
|
44
|
+
});
|
|
45
|
+
var createRecordInput = z.object({
|
|
46
|
+
objectId: z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
47
|
+
_displayLabel: z.string().optional().describe("Display label"),
|
|
48
|
+
data: z.record(z.string(), z.unknown()).describe(`Record data.${SANDBOX_FILE_DATA_HINT}`)
|
|
49
|
+
});
|
|
50
|
+
var updateRecordInput = z.object({
|
|
51
|
+
recordId: z.string().describe("Record UUID"),
|
|
52
|
+
data: z.record(z.string(), z.unknown()).describe(`Fields to update.${SANDBOX_FILE_DATA_HINT}`)
|
|
53
|
+
});
|
|
54
|
+
var deleteRecordInput = z.object({
|
|
55
|
+
recordId: z.string().describe("Record UUID")
|
|
56
|
+
});
|
|
57
|
+
var RECORD_CAPABILITIES = {
|
|
58
|
+
get_record: { name: "get_record", kind: "read", input: getRecordInput },
|
|
59
|
+
search_records: { name: "search_records", kind: "read", input: searchRecordsInput },
|
|
60
|
+
create_record: { name: "create_record", kind: "create", input: createRecordInput },
|
|
61
|
+
update_record: { name: "update_record", kind: "update", input: updateRecordInput },
|
|
62
|
+
delete_record: { name: "delete_record", kind: "delete", input: deleteRecordInput }
|
|
63
|
+
};
|
|
64
|
+
var RECORD_CAPABILITY_KINDS = Object.freeze(
|
|
65
|
+
Object.fromEntries(
|
|
66
|
+
Object.values(RECORD_CAPABILITIES).map((capability) => [capability.name, capability.kind])
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export { OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationError } from './chunk-
|
|
1
|
+
import { ValidationError } from './chunk-RUO25ERR.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { ICONS, COLORS } from '@stndrds/constants';
|
|
4
4
|
|
|
@@ -549,7 +549,7 @@ var attributeConfigSchemas = {
|
|
|
549
549
|
function getAttributeConfigSchema(type) {
|
|
550
550
|
const schema = attributeConfigSchemas[type];
|
|
551
551
|
if (!schema) {
|
|
552
|
-
throw new
|
|
552
|
+
throw new ValidationError(`Unsupported attribute type: ${type}`, []);
|
|
553
553
|
}
|
|
554
554
|
return schema;
|
|
555
555
|
}
|
|
@@ -638,4 +638,4 @@ function parseAttributeConfigForUpdate(stored, patch) {
|
|
|
638
638
|
return parsed;
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
export { ComputedFormulaParseError, SCHEMA_LIMITS, attributeConfigSchemas, colorIdSchema, getAttributeConfigSchema, iconNameSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, parseComputedFormula, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema };
|
|
641
|
+
export { ComputedFormulaParseError, SCHEMA_LIMITS, attributeConfigSchemas, colorIdSchema, getAttributeConfigSchema, getAttributeConfigWriteSchema, iconNameSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, parseComputedFormula, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-
|
|
2
|
-
import { ValidationError } from './chunk-
|
|
1
|
+
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-5OBQRDRM.mjs';
|
|
2
|
+
import { ValidationError } from './chunk-RUO25ERR.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
// src/types/system-attributes.ts
|
|
@@ -959,20 +959,25 @@ var fieldPresentationShape = {
|
|
|
959
959
|
label: z.string().optional(),
|
|
960
960
|
readOnly: z.boolean().optional()
|
|
961
961
|
};
|
|
962
|
-
var
|
|
963
|
-
/** Stable slot identity. Optional: a builder may omit it, `ensureFieldIds` assigns it. */
|
|
964
|
-
id: z.string().optional(),
|
|
962
|
+
var fieldShape = {
|
|
965
963
|
attribute: z.string().optional(),
|
|
966
964
|
attributeGroup: attributeGroupFieldSchema.optional(),
|
|
967
965
|
...fieldPresentationShape
|
|
968
|
-
}
|
|
966
|
+
};
|
|
967
|
+
function refineField(field, ctx) {
|
|
969
968
|
if (field.attribute === void 0 === (field.attributeGroup === void 0)) {
|
|
970
969
|
ctx.addIssue({
|
|
971
970
|
code: "custom",
|
|
972
971
|
message: "A field must define exactly one of attribute or attributeGroup"
|
|
973
972
|
});
|
|
974
973
|
}
|
|
975
|
-
}
|
|
974
|
+
}
|
|
975
|
+
var fieldSchema = z.object({
|
|
976
|
+
/** Stable slot identity. Optional: a builder may omit it, `ensureFieldIds` assigns it. */
|
|
977
|
+
id: z.string().optional(),
|
|
978
|
+
...fieldShape
|
|
979
|
+
}).strict().superRefine(refineField);
|
|
980
|
+
var fieldSlotSchema = z.object({ id: z.string().min(1), ...fieldShape }).strict().superRefine(refineField);
|
|
976
981
|
var baseGroupShape = {
|
|
977
982
|
id: z.string(),
|
|
978
983
|
label: z.string(),
|
|
@@ -994,13 +999,16 @@ var baseTabShape = {
|
|
|
994
999
|
icon: iconNameSchema.optional(),
|
|
995
1000
|
order: z.number().optional()
|
|
996
1001
|
};
|
|
997
|
-
var
|
|
1002
|
+
var formTabGroupsSchema = z.array(groupWriteSchema).max(SCHEMA_LIMITS.groupsPerFormTab);
|
|
1003
|
+
var formTabShape = {
|
|
998
1004
|
...baseTabShape,
|
|
999
1005
|
type: z.literal("form"),
|
|
1000
|
-
groups:
|
|
1006
|
+
groups: formTabGroupsSchema,
|
|
1001
1007
|
formColumns: z.union([z.literal(1), z.literal(2), z.literal(3)]).optional(),
|
|
1002
1008
|
density: z.enum(["compact", "comfortable", "spacious"]).optional()
|
|
1003
|
-
}
|
|
1009
|
+
};
|
|
1010
|
+
var formTabDraftObjectSchema = z.object(formTabShape).strict();
|
|
1011
|
+
function refineFormTab(tab, ctx) {
|
|
1004
1012
|
addDuplicateIdIssues(tab.groups, ctx, ["groups"]);
|
|
1005
1013
|
const totalFields = tab.groups.reduce(
|
|
1006
1014
|
(count, group) => count + (group.type === "fields" ? group.fields.length : 0),
|
|
@@ -1032,7 +1040,9 @@ var formTabWriteSchema = z.object({
|
|
|
1032
1040
|
seenAttributeGroupIds.add(id);
|
|
1033
1041
|
});
|
|
1034
1042
|
});
|
|
1035
|
-
}
|
|
1043
|
+
}
|
|
1044
|
+
var formTabWriteSchema = z.object({ ...formTabShape, groups: formTabGroupsSchema.min(1) }).strict().superRefine(refineFormTab);
|
|
1045
|
+
var formTabDraftSchema = formTabDraftObjectSchema.superRefine(refineFormTab);
|
|
1036
1046
|
var relationSourceSchema = z.object({
|
|
1037
1047
|
type: z.literal("relation"),
|
|
1038
1048
|
attribute: z.string()
|
|
@@ -1221,8 +1231,7 @@ var meetingsTabSchema = z.object({
|
|
|
1221
1231
|
type: z.literal("meetings"),
|
|
1222
1232
|
emailAttributeIds: z.array(z.string()).max(SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1223
1233
|
}).strict();
|
|
1224
|
-
var
|
|
1225
|
-
formTabWriteSchema,
|
|
1234
|
+
var nonFormDetailTabSchemas = [
|
|
1226
1235
|
tableTabSchema,
|
|
1227
1236
|
customTabSchema,
|
|
1228
1237
|
activityTabSchema,
|
|
@@ -1231,6 +1240,14 @@ var detailTabSchema = z.discriminatedUnion("type", [
|
|
|
1231
1240
|
formsTabSchema,
|
|
1232
1241
|
emailsTabSchema,
|
|
1233
1242
|
meetingsTabSchema
|
|
1243
|
+
];
|
|
1244
|
+
var detailTabSchema = z.discriminatedUnion("type", [
|
|
1245
|
+
formTabWriteSchema,
|
|
1246
|
+
...nonFormDetailTabSchemas
|
|
1247
|
+
]);
|
|
1248
|
+
var detailTabDraftSchema = z.discriminatedUnion("type", [
|
|
1249
|
+
formTabDraftSchema,
|
|
1250
|
+
...nonFormDetailTabSchemas
|
|
1234
1251
|
]);
|
|
1235
1252
|
var listTabCommonShape = {
|
|
1236
1253
|
id: z.string(),
|
|
@@ -1348,5 +1365,14 @@ function parseViewConfig(type, input) {
|
|
|
1348
1365
|
return viewConfigByTypeSchema.parse({ type, config: input }).config;
|
|
1349
1366
|
}
|
|
1350
1367
|
}
|
|
1368
|
+
var LIST_TAB_TABLE_KEYS = ["columnSizing"];
|
|
1369
|
+
var LIST_TAB_KANBAN_KEYS = [
|
|
1370
|
+
"groupByAttribute",
|
|
1371
|
+
"cardUserAttribute",
|
|
1372
|
+
"cardDateAttribute",
|
|
1373
|
+
"kanbanColumnOrder",
|
|
1374
|
+
"kanbanColumnVisibility",
|
|
1375
|
+
"kanbanPinnedColumns"
|
|
1376
|
+
];
|
|
1351
1377
|
|
|
1352
|
-
export { ATTRIBUTE_FILTER_OPERATORS, LIST_VIEW_TAB_VISIBILITIES, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, REMOVED_OPERATOR_REPLACEMENTS, RESERVED_ATTRIBUTE_NAMES, RESERVED_OBJECT_NAMES, RESOURCE_VISIBILITIES, SYNONYM_ALIASES, SYSTEM_ATTRIBUTES, SYSTEM_ATTRIBUTE_I18N_KEYS, SYSTEM_FIELD_NAMES, SYSTEM_FILTER_ATTRIBUTE_TYPES, canonicalizeFilterValue, collectQualifiedRuleIssues, currentActor, detailTabSchema, detailViewConfigSchema, extractCurrencyFilterValue, extractFilterValue, getAttributeCapabilities, getAttributeFilterOperators, getOperatorPolarity, getRollupFilterOperators2 as getRollupFilterOperators, getSystemAttributeI18nKey, getSystemAttributeList, inverseSourceSchema, isAttributeFilterable, isAttributeGroupable, isAttributeKanbanGroupable, isAttributeSearchable, isAttributeSortable, isDynamicValue, isManagedSystemAttribute, isNoValueOperator, isRelativeDateValue, isSetMembershipOperator, listViewConfigSchema, listViewTabSchema, normalizeFilterRule, normalizeForEdgeRpc, normalizeOperator, now, parseResourceVisibility, parseViewConfig, relationSourceSchema, resolveEffectiveFilterType, resolveIsWithinBounds, resolveUtcDayBounds, tableSourceSchema, toMultiValueOperator, toUtcDayString, today, validateQualifiedRule, viewConfigByTypeSchema, viewTypeSchema };
|
|
1378
|
+
export { ATTRIBUTE_FILTER_OPERATORS, LIST_TAB_KANBAN_KEYS, LIST_TAB_TABLE_KEYS, LIST_VIEW_TAB_VISIBILITIES, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, REMOVED_OPERATOR_REPLACEMENTS, RESERVED_ATTRIBUTE_NAMES, RESERVED_OBJECT_NAMES, RESOURCE_VISIBILITIES, SYNONYM_ALIASES, SYSTEM_ATTRIBUTES, SYSTEM_ATTRIBUTE_I18N_KEYS, SYSTEM_FIELD_NAMES, SYSTEM_FILTER_ATTRIBUTE_TYPES, canonicalizeFilterValue, collectQualifiedRuleIssues, columnsSchema, currentActor, detailTabDraftSchema, detailTabSchema, detailViewConfigSchema, extractCurrencyFilterValue, extractFilterValue, fieldSchema, fieldShape, fieldSlotSchema, filterGroupSchema, filterStateSchema, getAttributeCapabilities, getAttributeFilterOperators, getOperatorPolarity, getRollupFilterOperators2 as getRollupFilterOperators, getSystemAttributeI18nKey, getSystemAttributeList, groupWriteSchema, inverseSourceSchema, isAttributeFilterable, isAttributeGroupable, isAttributeKanbanGroupable, isAttributeSearchable, isAttributeSortable, isDynamicValue, isManagedSystemAttribute, isNoValueOperator, isRelativeDateValue, isSetMembershipOperator, listViewConfigSchema, listViewTabSchema, normalizeFilterRule, normalizeForEdgeRpc, normalizeOperator, now, parseResourceVisibility, parseViewConfig, relationSourceSchema, resolveEffectiveFilterType, resolveIsWithinBounds, resolveUtcDayBounds, sortsSchema, tableSourceSchema, toMultiValueOperator, toUtcDayString, today, validateQualifiedRule, viewConfigByTypeSchema, viewTypeSchema };
|