@standards/schema 1.0.0-alpha.384 → 1.0.0-alpha.385
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{all-C9OPP-r1.d.ts → all-Czr26_QP.d.ts} +1115 -1116
- package/dist/{all-CYmW48oj.d.mts → all-DIAipZSx.d.mts} +1115 -1116
- package/dist/api/index.d.mts +2894 -2894
- package/dist/api/index.d.ts +2894 -2894
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/attribute-validators-COsyRG9V.mjs +11 -0
- package/dist/attribute-validators-CQEf6iqM.js +11 -0
- package/dist/{attributes-D35Lcoui.d.ts → attributes-BcA_reJZ.d.ts} +58 -59
- package/dist/{attributes-CZD_B0mZ.d.mts → attributes-eqr1vdPP.d.mts} +58 -59
- package/dist/checkbox-C9aJ-6gq.d.ts +10 -0
- package/dist/checkbox-DfXrFM2z.d.mts +10 -0
- package/dist/config-C1CDWJf8.mjs +2 -0
- package/dist/config-DUQAd-Ur.js +2 -0
- package/dist/{core-397tQy5q.js → core-DAxRlJ5i.js} +1 -1
- package/dist/{core-BLHhNykL.mjs → core-rKI7Q9_U.mjs} +1 -1
- package/dist/{date-CQdP6Dxe.d.ts → date-BzggmHjS.d.mts} +5 -6
- package/dist/{date-B9051Wxe.d.mts → date-CdaoV9_L.d.ts} +5 -6
- package/dist/{exceptions-DoP6VK0v.d.mts → exceptions-CgzBcQIl.d.mts} +69 -70
- package/dist/{exceptions-DoP6VK0v.d.ts → exceptions-CgzBcQIl.d.ts} +69 -70
- package/dist/exceptions.d.mts +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/{index-E9rSexij.d.ts → index-BSYjSdhW.d.mts} +17 -18
- package/dist/{index-BLXzRQr9.d.ts → index-CCH94vyR.d.ts} +6 -7
- package/dist/{index-D0L0GHU0.d.mts → index-D1iR2xuc.d.ts} +17 -18
- package/dist/{index-CgEVJG3l.d.ts → index-DFQSFYiY.d.mts} +2775 -2774
- package/dist/{index-BS-60koN.d.mts → index-DKjcsjFG.d.ts} +2775 -2774
- package/dist/{index-CH-Vc-pK.d.ts → index-e1Oh8ngS.d.ts} +73 -74
- package/dist/{index-B3wdnfLl.d.mts → index-jDwfdudj.d.mts} +73 -74
- package/dist/{index-CSDAHifu.d.mts → index-zJz3LbXr.d.mts} +6 -7
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/number-B3u9vPtb.d.ts +10 -0
- package/dist/number-Br56q0hL.d.mts +10 -0
- package/dist/object-BF5y6bgs.mjs +4 -0
- package/dist/object-Kx-ADbIo.js +4 -0
- package/dist/{objects-CH22DJOx.d.ts → objects-CLxyZh-U.d.ts} +54 -55
- package/dist/{objects-DhKrQEo4.d.mts → objects-DxEMaC2Z.d.mts} +54 -55
- package/dist/phone-BGJea5sr.mjs +2 -0
- package/dist/phone-DrHyIujN.js +2 -0
- package/dist/record-aggregates-Cj3p3_ce.js +2 -0
- package/dist/{record-aggregates-CzG86pUS.mjs → record-aggregates-DQXrIuGE.mjs} +1 -1
- package/dist/record-operation-7-DRRONb.mjs +2 -0
- package/dist/record-operation-Bbn-LZhq.js +2 -0
- package/dist/text-2DB_Jc_x.js +2 -0
- package/dist/text-BaxaZ5Vv.mjs +2 -0
- package/dist/text-Bvk4ila8.d.ts +10 -0
- package/dist/text-C5NnfCJg.d.mts +10 -0
- package/dist/{utils-gY3d9Dwp.js → utils-B-gGq3FS.js} +1 -1
- package/dist/{utils-C_J_p_tL.d.ts → utils-B2bq4zLb.d.ts} +15 -16
- package/dist/{utils-CkcPS_M9.d.mts → utils-CRx-eR8T.d.mts} +15 -16
- package/dist/{utils-fXIvFFl6.mjs → utils-DaejNWxh.mjs} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/validation/all.d.mts +4 -4
- package/dist/validation/all.d.ts +4 -4
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +4 -4
- package/dist/validation/complex/currency.d.ts +4 -4
- package/dist/validation/complex/currency.js +1 -1
- package/dist/validation/complex/currency.mjs +1 -1
- package/dist/validation/complex/location.d.mts +4 -4
- package/dist/validation/complex/location.d.ts +4 -4
- package/dist/validation/complex/location.js +1 -1
- package/dist/validation/complex/location.mjs +1 -1
- package/dist/validation/complex/phone.d.mts +4 -4
- package/dist/validation/complex/phone.d.ts +4 -4
- package/dist/validation/complex/phone.js +1 -1
- package/dist/validation/complex/phone.mjs +1 -1
- package/dist/validation/complex/relation.d.mts +6 -6
- package/dist/validation/complex/relation.d.ts +6 -6
- package/dist/validation/complex/relation.js +1 -1
- package/dist/validation/complex/relation.mjs +1 -1
- package/dist/validation/complex/richtext.d.mts +4 -4
- package/dist/validation/complex/richtext.d.ts +4 -4
- package/dist/validation/complex/richtext.js +1 -1
- package/dist/validation/complex/richtext.mjs +1 -1
- package/dist/validation/complex/select.d.mts +6 -6
- package/dist/validation/complex/select.d.ts +6 -6
- package/dist/validation/complex/select.js +1 -1
- package/dist/validation/complex/select.mjs +1 -1
- package/dist/validation/complex/user.d.mts +4 -4
- package/dist/validation/complex/user.d.ts +4 -4
- package/dist/validation/complex/user.js +1 -1
- package/dist/validation/complex/user.mjs +1 -1
- package/dist/validation/computed/formula.d.mts +4 -4
- package/dist/validation/computed/formula.d.ts +4 -4
- package/dist/validation/computed/formula.js +1 -1
- package/dist/validation/computed/formula.mjs +1 -1
- package/dist/validation/computed/rollup.d.mts +4 -4
- package/dist/validation/computed/rollup.d.ts +4 -4
- package/dist/validation/computed/rollup.js +1 -1
- package/dist/validation/computed/rollup.mjs +1 -1
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/core/index.js +1 -1
- package/dist/validation/core/index.mjs +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/checkbox.js +1 -1
- package/dist/validation/primitives/checkbox.mjs +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/date.js +1 -1
- package/dist/validation/primitives/date.mjs +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/number.js +1 -1
- package/dist/validation/primitives/number.mjs +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/validation/primitives/text.js +1 -1
- package/dist/validation/primitives/text.mjs +1 -1
- package/dist/view-config.schema-BOuNAZ5T.js +2 -0
- package/dist/view-config.schema-Dl5GkAzl.mjs +2 -0
- package/dist/zod-locale-D_QkXhnp.d.mts +2 -0
- package/dist/zod-locale-D_QkXhnp.d.ts +2 -0
- package/dist/zod-locale.d.mts +2 -0
- package/dist/zod-locale.d.ts +2 -0
- package/dist/zod-locale.js +2 -0
- package/dist/zod-locale.mjs +2 -0
- package/package.json +17 -3
- package/dist/attribute-validators-DRqhAt2t.mjs +0 -11
- package/dist/attribute-validators-WAoJbap5.js +0 -11
- package/dist/checkbox-CQRDh5tF.d.ts +0 -11
- package/dist/checkbox-D00iEidf.d.mts +0 -11
- package/dist/config-BIxnbUN8.mjs +0 -2
- package/dist/config-DdjlHdPg.js +0 -2
- package/dist/number-BwCSeK20.d.ts +0 -11
- package/dist/number-CisXUosg.d.mts +0 -11
- package/dist/object-DcgxLvip.js +0 -4
- package/dist/object-Dzl7sfq8.mjs +0 -4
- package/dist/phone-BB-tzcSr.js +0 -2
- package/dist/phone-Bca_xiOX.mjs +0 -2
- package/dist/record-aggregates-DwpIJ2Dv.js +0 -2
- package/dist/record-operation-B7t5aXW3.js +0 -2
- package/dist/record-operation-DueJTyDh.mjs +0 -2
- package/dist/text-A9AJ1wUO.js +0 -2
- package/dist/text-C8Lb-NFo.mjs +0 -2
- package/dist/text-SkYUYEnE.d.ts +0 -11
- package/dist/text-Z1_WL8cd.d.mts +0 -11
- package/dist/view-config.schema-BqO1hmWR.mjs +0 -2
- package/dist/view-config.schema-DVoE_g3g.js +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { ObjectImage, RecordAppearance } from "./objects-CLxyZh-U.js";
|
|
3
|
+
import { Attribute, AttributeType } from "./attributes-BcA_reJZ.js";
|
|
4
|
+
import * as z$2 from "zod";
|
|
5
5
|
import { ColorId, IconName } from "@standards/constants";
|
|
6
6
|
//#region src/types/mutations.d.ts
|
|
7
|
-
interface AddAttributeInput {
|
|
7
|
+
export interface AddAttributeInput {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
10
|
type: AttributeType;
|
|
@@ -17,7 +17,7 @@ interface AddAttributeInput {
|
|
|
17
17
|
metadata?: Record<string, unknown>;
|
|
18
18
|
[key: string]: unknown;
|
|
19
19
|
}
|
|
20
|
-
interface CreateCustomObjectInput {
|
|
20
|
+
export interface CreateCustomObjectInput {
|
|
21
21
|
name: string;
|
|
22
22
|
label: string;
|
|
23
23
|
pluralLabel?: string;
|
|
@@ -32,7 +32,7 @@ interface CreateCustomObjectInput {
|
|
|
32
32
|
})[];
|
|
33
33
|
metadata?: Record<string, unknown>;
|
|
34
34
|
}
|
|
35
|
-
interface UpdateObjectInput {
|
|
35
|
+
export interface UpdateObjectInput {
|
|
36
36
|
label?: string;
|
|
37
37
|
pluralLabel?: string;
|
|
38
38
|
description?: string;
|
|
@@ -45,7 +45,7 @@ interface UpdateObjectInput {
|
|
|
45
45
|
embeddingExpression?: string;
|
|
46
46
|
metadata?: Record<string, unknown>;
|
|
47
47
|
}
|
|
48
|
-
interface RelationOption {
|
|
48
|
+
export interface RelationOption {
|
|
49
49
|
id: string;
|
|
50
50
|
objectId: string;
|
|
51
51
|
objectName: string;
|
|
@@ -58,7 +58,7 @@ interface RelationOption {
|
|
|
58
58
|
appearance?: RecordAppearance;
|
|
59
59
|
label: string;
|
|
60
60
|
}
|
|
61
|
-
interface RelationOptionsResponse {
|
|
61
|
+
export interface RelationOptionsResponse {
|
|
62
62
|
options: RelationOption[];
|
|
63
63
|
hasMore: boolean;
|
|
64
64
|
total: number;
|
|
@@ -75,7 +75,7 @@ interface RelationOptionsResponse {
|
|
|
75
75
|
* genuine open record among them, on the wire. Single source: the runtime
|
|
76
76
|
* prompt imports this instead of keeping its own copy.
|
|
77
77
|
*/
|
|
78
|
-
declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
78
|
+
export declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
79
79
|
/**
|
|
80
80
|
* The omitted base keys one attribute type's wire offers back, each with the
|
|
81
81
|
* wire schema it is validated by. Karl's ruling on #4537 (2026-09-27, «
|
|
@@ -85,11 +85,11 @@ declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description",
|
|
|
85
85
|
* (`ADD_ATTRIBUTE_WIRE`) and the prompt (`attribute-reference.ts`), so the
|
|
86
86
|
* key the model is told about is the key the wire accepts.
|
|
87
87
|
*/
|
|
88
|
-
declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$
|
|
88
|
+
export declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$2.ZodType>>>>;
|
|
89
89
|
/** The keys hidden from `attributeType`'s wire config and its prompt line. */
|
|
90
|
-
declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
90
|
+
export declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
91
91
|
/** `omit()` mask of the type keys hidden from `attributeType`'s wire. */
|
|
92
|
-
declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
92
|
+
export declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
93
93
|
/**
|
|
94
94
|
* Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
|
|
95
95
|
* than the one sent.
|
|
@@ -103,19 +103,19 @@ declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<
|
|
|
103
103
|
* keys that type does accept so the next call is right. One factory rather
|
|
104
104
|
* than two near-identical loops — the second one drifted first.
|
|
105
105
|
*/
|
|
106
|
-
declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z$
|
|
107
|
-
declare const statusGroupSchema: z$
|
|
106
|
+
export declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z$2.RefinementCtx, path?: readonly string[]) => void;
|
|
107
|
+
export declare const statusGroupSchema: z$2.ZodEnum<{
|
|
108
108
|
idle: "idle";
|
|
109
109
|
in_progress: "in_progress";
|
|
110
110
|
finished: "finished";
|
|
111
111
|
}>;
|
|
112
|
-
declare const selectOptionWriteSchema: z$
|
|
113
|
-
value: z$
|
|
114
|
-
label: z$
|
|
115
|
-
description: z$
|
|
116
|
-
inverse: z$
|
|
117
|
-
archived: z$
|
|
118
|
-
color: z$
|
|
112
|
+
export declare const selectOptionWriteSchema: z$2.ZodObject<{
|
|
113
|
+
value: z$2.ZodString;
|
|
114
|
+
label: z$2.ZodString;
|
|
115
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
116
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
117
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
118
|
+
color: z$2.ZodEnum<{
|
|
119
119
|
stone: "stone";
|
|
120
120
|
clay: "clay";
|
|
121
121
|
brick: "brick";
|
|
@@ -128,14 +128,14 @@ declare const selectOptionWriteSchema: z$1.ZodObject<{
|
|
|
128
128
|
iris: "iris";
|
|
129
129
|
peony: "peony";
|
|
130
130
|
}>;
|
|
131
|
-
}, z$
|
|
132
|
-
declare const multiselectOptionWriteSchema: z$
|
|
133
|
-
value: z$
|
|
134
|
-
label: z$
|
|
135
|
-
description: z$
|
|
136
|
-
inverse: z$
|
|
137
|
-
archived: z$
|
|
138
|
-
color: z$
|
|
131
|
+
}, z$2.core.$strict>;
|
|
132
|
+
export declare const multiselectOptionWriteSchema: z$2.ZodObject<{
|
|
133
|
+
value: z$2.ZodString;
|
|
134
|
+
label: z$2.ZodString;
|
|
135
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
136
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
137
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
138
|
+
color: z$2.ZodEnum<{
|
|
139
139
|
stone: "stone";
|
|
140
140
|
clay: "clay";
|
|
141
141
|
brick: "brick";
|
|
@@ -148,14 +148,14 @@ declare const multiselectOptionWriteSchema: z$1.ZodObject<{
|
|
|
148
148
|
iris: "iris";
|
|
149
149
|
peony: "peony";
|
|
150
150
|
}>;
|
|
151
|
-
}, z$
|
|
152
|
-
declare const statusOptionWriteSchema: z$
|
|
153
|
-
value: z$
|
|
154
|
-
label: z$
|
|
155
|
-
description: z$
|
|
156
|
-
inverse: z$
|
|
157
|
-
archived: z$
|
|
158
|
-
color: z$
|
|
151
|
+
}, z$2.core.$strict>;
|
|
152
|
+
export declare const statusOptionWriteSchema: z$2.ZodObject<{
|
|
153
|
+
value: z$2.ZodString;
|
|
154
|
+
label: z$2.ZodString;
|
|
155
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
156
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
157
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
158
|
+
color: z$2.ZodEnum<{
|
|
159
159
|
stone: "stone";
|
|
160
160
|
clay: "clay";
|
|
161
161
|
brick: "brick";
|
|
@@ -168,12 +168,12 @@ declare const statusOptionWriteSchema: z$1.ZodObject<{
|
|
|
168
168
|
iris: "iris";
|
|
169
169
|
peony: "peony";
|
|
170
170
|
}>;
|
|
171
|
-
group: z$
|
|
171
|
+
group: z$2.ZodEnum<{
|
|
172
172
|
idle: "idle";
|
|
173
173
|
in_progress: "in_progress";
|
|
174
174
|
finished: "finished";
|
|
175
175
|
}>;
|
|
176
|
-
}, z$
|
|
176
|
+
}, z$2.core.$strict>;
|
|
177
177
|
/**
|
|
178
178
|
* Drops, from every option of an attribute config or body, the keys
|
|
179
179
|
* `optionSchema` does not know — typically an `id` the code builder accepted
|
|
@@ -186,7 +186,7 @@ declare const statusOptionWriteSchema: z$1.ZodObject<{
|
|
|
186
186
|
* or option that is not the expected shape is left for strict validation to
|
|
187
187
|
* refuse.
|
|
188
188
|
*/
|
|
189
|
-
declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
189
|
+
export declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
190
190
|
/**
|
|
191
191
|
* Property types whose config differs from `baseConfigSchema` only by
|
|
192
192
|
* independent optional scalars — no options array, no relation targets. Same
|
|
@@ -200,65 +200,65 @@ declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
|
200
200
|
* ten separate members, each paying its own JSON Schema object/`$defs`
|
|
201
201
|
* boilerplate, blew the budget even after the base config keys were omitted.
|
|
202
202
|
*/
|
|
203
|
-
declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
-
declare const propertyAttributeSchema: z$
|
|
205
|
-
[k: string]: z$
|
|
206
|
-
}>, z$
|
|
207
|
-
[k: string]: z$
|
|
208
|
-
}>, z$
|
|
209
|
-
declare const propertySchemaSchema: z$
|
|
210
|
-
definitions: z$
|
|
211
|
-
[k: string]: z$
|
|
212
|
-
}>, z$
|
|
213
|
-
[k: string]: z$
|
|
214
|
-
}>, z$
|
|
215
|
-
}, z$
|
|
203
|
+
export declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
+
export declare const propertyAttributeSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
205
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
206
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
207
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
208
|
+
}>, z$2.core.$strip>[]], "type">;
|
|
209
|
+
export declare const propertySchemaSchema: z$2.ZodObject<{
|
|
210
|
+
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
211
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
212
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
213
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
214
|
+
}>, z$2.core.$strip>[]], "type">>;
|
|
215
|
+
}, z$2.core.$strip>;
|
|
216
216
|
/**
|
|
217
217
|
* The wire-facing property union, derived from the stored one: the same seven
|
|
218
218
|
* simple types merged into one member, the option-carrying types alongside,
|
|
219
219
|
* everything the model never sets omitted, and `.strict()` so an invented key
|
|
220
220
|
* is refused by name instead of silently stripped at store.
|
|
221
221
|
*/
|
|
222
|
-
declare const propertyAttributeWireSchema: z$
|
|
223
|
-
[k: string]: z$
|
|
224
|
-
}>, z$
|
|
225
|
-
[k: string]: z$
|
|
226
|
-
}>, z$
|
|
227
|
-
declare const propertySchemaWireSchema: z$
|
|
228
|
-
definitions: z$
|
|
229
|
-
[k: string]: z$
|
|
230
|
-
}>, z$
|
|
231
|
-
[k: string]: z$
|
|
232
|
-
}>, z$
|
|
233
|
-
}, z$
|
|
222
|
+
export declare const propertyAttributeWireSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
223
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
224
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
225
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
226
|
+
}>, z$2.core.$strip>[]], "type">;
|
|
227
|
+
export declare const propertySchemaWireSchema: z$2.ZodObject<{
|
|
228
|
+
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
229
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
230
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
231
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
232
|
+
}>, z$2.core.$strip>[]], "type">>;
|
|
233
|
+
}, z$2.core.$strict>;
|
|
234
234
|
/**
|
|
235
235
|
* A month or a year has no time of day and no range end to pair with in this
|
|
236
236
|
* slice (#5325): `precision` narrower than a day is refused beside
|
|
237
237
|
* `includeTime` or `endDate`, on the attribute and on each date property it
|
|
238
238
|
* qualifies an edge with.
|
|
239
239
|
*/
|
|
240
|
-
declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
240
|
+
export declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
241
241
|
path: PropertyKey[];
|
|
242
242
|
message: string;
|
|
243
243
|
}[];
|
|
244
244
|
/**
|
|
245
245
|
* Map of attribute type to config schema
|
|
246
246
|
*/
|
|
247
|
-
declare const attributeConfigSchemas: Record<AttributeType, z$
|
|
247
|
+
export declare const attributeConfigSchemas: Record<AttributeType, z$2.ZodObject<z$2.ZodRawShape>>;
|
|
248
248
|
/**
|
|
249
249
|
* Get the config schema for a specific attribute type
|
|
250
250
|
*/
|
|
251
|
-
declare function getAttributeConfigSchema(type: AttributeType): z$
|
|
251
|
+
export declare function getAttributeConfigSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
252
252
|
/**
|
|
253
253
|
* Validate and strip unknown properties from attribute config
|
|
254
254
|
* This ensures only allowed properties are stored in the database
|
|
255
255
|
*/
|
|
256
|
-
declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
256
|
+
export declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
257
257
|
/**
|
|
258
258
|
* The config contract as a WRITE applies it: the stored schema plus the
|
|
259
259
|
* stricter option and icon rules newly written values must satisfy.
|
|
260
260
|
*/
|
|
261
|
-
declare function getAttributeConfigWriteSchema(type: AttributeType): z$
|
|
261
|
+
export declare function getAttributeConfigWriteSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
262
262
|
/**
|
|
263
263
|
* Strict parser for newly created attribute definitions.
|
|
264
264
|
*
|
|
@@ -266,7 +266,7 @@ declare function getAttributeConfigWriteSchema(type: AttributeType): z$1.ZodObje
|
|
|
266
266
|
* contract, while newly written icons and select-like option objects are
|
|
267
267
|
* validated strictly.
|
|
268
268
|
*/
|
|
269
|
-
declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
269
|
+
export declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
270
270
|
/**
|
|
271
271
|
* Patch-aware parser for persisted attributes.
|
|
272
272
|
*
|
|
@@ -274,6 +274,5 @@ declare function parseAttributeConfigForCreate(type: AttributeType, input: unkno
|
|
|
274
274
|
* list. Omission means the stored legacy list is preserved without
|
|
275
275
|
* reconstruction, including options that predate required colours/groups.
|
|
276
276
|
*/
|
|
277
|
-
declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
-
//#endregion
|
|
279
|
-
export { AddAttributeInput as C, UpdateObjectInput as D, RelationOptionsResponse as E, withoutUnknownOptionKeys as S, RelationOption as T, selectOptionWriteSchema as _, datePrecisionIssues as a, wireHiddenTypeConfigMask as b, multiselectOptionWriteSchema as c, parseAttributeConfigForUpdate as d, propertyAttributeSchema as f, refuseForeignKeys as g, propertySchemaWireSchema as h, attributeConfigSchemas as i, parseAttributeConfig as l, propertySchemaSchema as m, WIRE_OFFERED_BASE_CONFIG as n, getAttributeConfigSchema as o, propertyAttributeWireSchema as p, WIRE_OMITTED_CONFIG_KEYS as r, getAttributeConfigWriteSchema as s, SIMPLE_PROPERTY_TYPES as t, parseAttributeConfigForCreate as u, statusGroupSchema as v, CreateCustomObjectInput as w, wireOmittedConfigKeysFor as x, statusOptionWriteSchema as y };
|
|
277
|
+
export declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
+
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { ObjectImage, RecordAppearance } from "./objects-DxEMaC2Z.mjs";
|
|
3
|
+
import { Attribute, AttributeType } from "./attributes-eqr1vdPP.mjs";
|
|
4
|
+
import * as z$2 from "zod";
|
|
5
5
|
import { ColorId, IconName } from "@standards/constants";
|
|
6
6
|
//#region src/types/mutations.d.ts
|
|
7
|
-
interface AddAttributeInput {
|
|
7
|
+
export interface AddAttributeInput {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
10
|
type: AttributeType;
|
|
@@ -17,7 +17,7 @@ interface AddAttributeInput {
|
|
|
17
17
|
metadata?: Record<string, unknown>;
|
|
18
18
|
[key: string]: unknown;
|
|
19
19
|
}
|
|
20
|
-
interface CreateCustomObjectInput {
|
|
20
|
+
export interface CreateCustomObjectInput {
|
|
21
21
|
name: string;
|
|
22
22
|
label: string;
|
|
23
23
|
pluralLabel?: string;
|
|
@@ -32,7 +32,7 @@ interface CreateCustomObjectInput {
|
|
|
32
32
|
})[];
|
|
33
33
|
metadata?: Record<string, unknown>;
|
|
34
34
|
}
|
|
35
|
-
interface UpdateObjectInput {
|
|
35
|
+
export interface UpdateObjectInput {
|
|
36
36
|
label?: string;
|
|
37
37
|
pluralLabel?: string;
|
|
38
38
|
description?: string;
|
|
@@ -45,7 +45,7 @@ interface UpdateObjectInput {
|
|
|
45
45
|
embeddingExpression?: string;
|
|
46
46
|
metadata?: Record<string, unknown>;
|
|
47
47
|
}
|
|
48
|
-
interface RelationOption {
|
|
48
|
+
export interface RelationOption {
|
|
49
49
|
id: string;
|
|
50
50
|
objectId: string;
|
|
51
51
|
objectName: string;
|
|
@@ -58,7 +58,7 @@ interface RelationOption {
|
|
|
58
58
|
appearance?: RecordAppearance;
|
|
59
59
|
label: string;
|
|
60
60
|
}
|
|
61
|
-
interface RelationOptionsResponse {
|
|
61
|
+
export interface RelationOptionsResponse {
|
|
62
62
|
options: RelationOption[];
|
|
63
63
|
hasMore: boolean;
|
|
64
64
|
total: number;
|
|
@@ -75,7 +75,7 @@ interface RelationOptionsResponse {
|
|
|
75
75
|
* genuine open record among them, on the wire. Single source: the runtime
|
|
76
76
|
* prompt imports this instead of keeping its own copy.
|
|
77
77
|
*/
|
|
78
|
-
declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
78
|
+
export declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
|
|
79
79
|
/**
|
|
80
80
|
* The omitted base keys one attribute type's wire offers back, each with the
|
|
81
81
|
* wire schema it is validated by. Karl's ruling on #4537 (2026-09-27, «
|
|
@@ -85,11 +85,11 @@ declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description",
|
|
|
85
85
|
* (`ADD_ATTRIBUTE_WIRE`) and the prompt (`attribute-reference.ts`), so the
|
|
86
86
|
* key the model is told about is the key the wire accepts.
|
|
87
87
|
*/
|
|
88
|
-
declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$
|
|
88
|
+
export declare const WIRE_OFFERED_BASE_CONFIG: Partial<Record<AttributeType, Partial<Record<(typeof WIRE_OMITTED_CONFIG_KEYS)[number], z$2.ZodType>>>>;
|
|
89
89
|
/** The keys hidden from `attributeType`'s wire config and its prompt line. */
|
|
90
|
-
declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
90
|
+
export declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
|
|
91
91
|
/** `omit()` mask of the type keys hidden from `attributeType`'s wire. */
|
|
92
|
-
declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
92
|
+
export declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
|
|
93
93
|
/**
|
|
94
94
|
* Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
|
|
95
95
|
* than the one sent.
|
|
@@ -103,19 +103,19 @@ declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<
|
|
|
103
103
|
* keys that type does accept so the next call is right. One factory rather
|
|
104
104
|
* than two near-identical loops — the second one drifted first.
|
|
105
105
|
*/
|
|
106
|
-
declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z$
|
|
107
|
-
declare const statusGroupSchema: z$
|
|
106
|
+
export declare function refuseForeignKeys<T extends string>(keysByType: Readonly<Record<T, ReadonlySet<string>>>, noun: string, alwaysAllowed?: readonly string[]): (type: T, subject: Record<string, unknown> | undefined, ctx: z$2.RefinementCtx, path?: readonly string[]) => void;
|
|
107
|
+
export declare const statusGroupSchema: z$2.ZodEnum<{
|
|
108
108
|
idle: "idle";
|
|
109
109
|
in_progress: "in_progress";
|
|
110
110
|
finished: "finished";
|
|
111
111
|
}>;
|
|
112
|
-
declare const selectOptionWriteSchema: z$
|
|
113
|
-
value: z$
|
|
114
|
-
label: z$
|
|
115
|
-
description: z$
|
|
116
|
-
inverse: z$
|
|
117
|
-
archived: z$
|
|
118
|
-
color: z$
|
|
112
|
+
export declare const selectOptionWriteSchema: z$2.ZodObject<{
|
|
113
|
+
value: z$2.ZodString;
|
|
114
|
+
label: z$2.ZodString;
|
|
115
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
116
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
117
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
118
|
+
color: z$2.ZodEnum<{
|
|
119
119
|
stone: "stone";
|
|
120
120
|
clay: "clay";
|
|
121
121
|
brick: "brick";
|
|
@@ -128,14 +128,14 @@ declare const selectOptionWriteSchema: z$1.ZodObject<{
|
|
|
128
128
|
iris: "iris";
|
|
129
129
|
peony: "peony";
|
|
130
130
|
}>;
|
|
131
|
-
}, z$
|
|
132
|
-
declare const multiselectOptionWriteSchema: z$
|
|
133
|
-
value: z$
|
|
134
|
-
label: z$
|
|
135
|
-
description: z$
|
|
136
|
-
inverse: z$
|
|
137
|
-
archived: z$
|
|
138
|
-
color: z$
|
|
131
|
+
}, z$2.core.$strict>;
|
|
132
|
+
export declare const multiselectOptionWriteSchema: z$2.ZodObject<{
|
|
133
|
+
value: z$2.ZodString;
|
|
134
|
+
label: z$2.ZodString;
|
|
135
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
136
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
137
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
138
|
+
color: z$2.ZodEnum<{
|
|
139
139
|
stone: "stone";
|
|
140
140
|
clay: "clay";
|
|
141
141
|
brick: "brick";
|
|
@@ -148,14 +148,14 @@ declare const multiselectOptionWriteSchema: z$1.ZodObject<{
|
|
|
148
148
|
iris: "iris";
|
|
149
149
|
peony: "peony";
|
|
150
150
|
}>;
|
|
151
|
-
}, z$
|
|
152
|
-
declare const statusOptionWriteSchema: z$
|
|
153
|
-
value: z$
|
|
154
|
-
label: z$
|
|
155
|
-
description: z$
|
|
156
|
-
inverse: z$
|
|
157
|
-
archived: z$
|
|
158
|
-
color: z$
|
|
151
|
+
}, z$2.core.$strict>;
|
|
152
|
+
export declare const statusOptionWriteSchema: z$2.ZodObject<{
|
|
153
|
+
value: z$2.ZodString;
|
|
154
|
+
label: z$2.ZodString;
|
|
155
|
+
description: z$2.ZodOptional<z$2.ZodString>;
|
|
156
|
+
inverse: z$2.ZodOptional<z$2.ZodString>;
|
|
157
|
+
archived: z$2.ZodOptional<z$2.ZodBoolean>;
|
|
158
|
+
color: z$2.ZodEnum<{
|
|
159
159
|
stone: "stone";
|
|
160
160
|
clay: "clay";
|
|
161
161
|
brick: "brick";
|
|
@@ -168,12 +168,12 @@ declare const statusOptionWriteSchema: z$1.ZodObject<{
|
|
|
168
168
|
iris: "iris";
|
|
169
169
|
peony: "peony";
|
|
170
170
|
}>;
|
|
171
|
-
group: z$
|
|
171
|
+
group: z$2.ZodEnum<{
|
|
172
172
|
idle: "idle";
|
|
173
173
|
in_progress: "in_progress";
|
|
174
174
|
finished: "finished";
|
|
175
175
|
}>;
|
|
176
|
-
}, z$
|
|
176
|
+
}, z$2.core.$strict>;
|
|
177
177
|
/**
|
|
178
178
|
* Drops, from every option of an attribute config or body, the keys
|
|
179
179
|
* `optionSchema` does not know — typically an `id` the code builder accepted
|
|
@@ -186,7 +186,7 @@ declare const statusOptionWriteSchema: z$1.ZodObject<{
|
|
|
186
186
|
* or option that is not the expected shape is left for strict validation to
|
|
187
187
|
* refuse.
|
|
188
188
|
*/
|
|
189
|
-
declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
189
|
+
export declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
190
190
|
/**
|
|
191
191
|
* Property types whose config differs from `baseConfigSchema` only by
|
|
192
192
|
* independent optional scalars — no options array, no relation targets. Same
|
|
@@ -200,65 +200,65 @@ declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
|
|
|
200
200
|
* ten separate members, each paying its own JSON Schema object/`$defs`
|
|
201
201
|
* boilerplate, blew the budget even after the base config keys were omitted.
|
|
202
202
|
*/
|
|
203
|
-
declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
-
declare const propertyAttributeSchema: z$
|
|
205
|
-
[k: string]: z$
|
|
206
|
-
}>, z$
|
|
207
|
-
[k: string]: z$
|
|
208
|
-
}>, z$
|
|
209
|
-
declare const propertySchemaSchema: z$
|
|
210
|
-
definitions: z$
|
|
211
|
-
[k: string]: z$
|
|
212
|
-
}>, z$
|
|
213
|
-
[k: string]: z$
|
|
214
|
-
}>, z$
|
|
215
|
-
}, z$
|
|
203
|
+
export declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
|
|
204
|
+
export declare const propertyAttributeSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
205
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
206
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
207
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
208
|
+
}>, z$2.core.$strip>[]], "type">;
|
|
209
|
+
export declare const propertySchemaSchema: z$2.ZodObject<{
|
|
210
|
+
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
211
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
212
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
213
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
214
|
+
}>, z$2.core.$strip>[]], "type">>;
|
|
215
|
+
}, z$2.core.$strip>;
|
|
216
216
|
/**
|
|
217
217
|
* The wire-facing property union, derived from the stored one: the same seven
|
|
218
218
|
* simple types merged into one member, the option-carrying types alongside,
|
|
219
219
|
* everything the model never sets omitted, and `.strict()` so an invented key
|
|
220
220
|
* is refused by name instead of silently stripped at store.
|
|
221
221
|
*/
|
|
222
|
-
declare const propertyAttributeWireSchema: z$
|
|
223
|
-
[k: string]: z$
|
|
224
|
-
}>, z$
|
|
225
|
-
[k: string]: z$
|
|
226
|
-
}>, z$
|
|
227
|
-
declare const propertySchemaWireSchema: z$
|
|
228
|
-
definitions: z$
|
|
229
|
-
[k: string]: z$
|
|
230
|
-
}>, z$
|
|
231
|
-
[k: string]: z$
|
|
232
|
-
}>, z$
|
|
233
|
-
}, z$
|
|
222
|
+
export declare const propertyAttributeWireSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
223
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
224
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
225
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
226
|
+
}>, z$2.core.$strip>[]], "type">;
|
|
227
|
+
export declare const propertySchemaWireSchema: z$2.ZodObject<{
|
|
228
|
+
definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
|
|
229
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
230
|
+
}>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
|
|
231
|
+
[k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
|
|
232
|
+
}>, z$2.core.$strip>[]], "type">>;
|
|
233
|
+
}, z$2.core.$strict>;
|
|
234
234
|
/**
|
|
235
235
|
* A month or a year has no time of day and no range end to pair with in this
|
|
236
236
|
* slice (#5325): `precision` narrower than a day is refused beside
|
|
237
237
|
* `includeTime` or `endDate`, on the attribute and on each date property it
|
|
238
238
|
* qualifies an edge with.
|
|
239
239
|
*/
|
|
240
|
-
declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
240
|
+
export declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
|
|
241
241
|
path: PropertyKey[];
|
|
242
242
|
message: string;
|
|
243
243
|
}[];
|
|
244
244
|
/**
|
|
245
245
|
* Map of attribute type to config schema
|
|
246
246
|
*/
|
|
247
|
-
declare const attributeConfigSchemas: Record<AttributeType, z$
|
|
247
|
+
export declare const attributeConfigSchemas: Record<AttributeType, z$2.ZodObject<z$2.ZodRawShape>>;
|
|
248
248
|
/**
|
|
249
249
|
* Get the config schema for a specific attribute type
|
|
250
250
|
*/
|
|
251
|
-
declare function getAttributeConfigSchema(type: AttributeType): z$
|
|
251
|
+
export declare function getAttributeConfigSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
252
252
|
/**
|
|
253
253
|
* Validate and strip unknown properties from attribute config
|
|
254
254
|
* This ensures only allowed properties are stored in the database
|
|
255
255
|
*/
|
|
256
|
-
declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
256
|
+
export declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
|
|
257
257
|
/**
|
|
258
258
|
* The config contract as a WRITE applies it: the stored schema plus the
|
|
259
259
|
* stricter option and icon rules newly written values must satisfy.
|
|
260
260
|
*/
|
|
261
|
-
declare function getAttributeConfigWriteSchema(type: AttributeType): z$
|
|
261
|
+
export declare function getAttributeConfigWriteSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
|
|
262
262
|
/**
|
|
263
263
|
* Strict parser for newly created attribute definitions.
|
|
264
264
|
*
|
|
@@ -266,7 +266,7 @@ declare function getAttributeConfigWriteSchema(type: AttributeType): z$1.ZodObje
|
|
|
266
266
|
* contract, while newly written icons and select-like option objects are
|
|
267
267
|
* validated strictly.
|
|
268
268
|
*/
|
|
269
|
-
declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
269
|
+
export declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
|
|
270
270
|
/**
|
|
271
271
|
* Patch-aware parser for persisted attributes.
|
|
272
272
|
*
|
|
@@ -274,6 +274,5 @@ declare function parseAttributeConfigForCreate(type: AttributeType, input: unkno
|
|
|
274
274
|
* list. Omission means the stored legacy list is preserved without
|
|
275
275
|
* reconstruction, including options that predate required colours/groups.
|
|
276
276
|
*/
|
|
277
|
-
declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
-
//#endregion
|
|
279
|
-
export { AddAttributeInput as C, UpdateObjectInput as D, RelationOptionsResponse as E, withoutUnknownOptionKeys as S, RelationOption as T, selectOptionWriteSchema as _, datePrecisionIssues as a, wireHiddenTypeConfigMask as b, multiselectOptionWriteSchema as c, parseAttributeConfigForUpdate as d, propertyAttributeSchema as f, refuseForeignKeys as g, propertySchemaWireSchema as h, attributeConfigSchemas as i, parseAttributeConfig as l, propertySchemaSchema as m, WIRE_OFFERED_BASE_CONFIG as n, getAttributeConfigSchema as o, propertyAttributeWireSchema as p, WIRE_OMITTED_CONFIG_KEYS as r, getAttributeConfigWriteSchema as s, SIMPLE_PROPERTY_TYPES as t, parseAttributeConfigForCreate as u, statusGroupSchema as v, CreateCustomObjectInput as w, wireOmittedConfigKeysFor as x, statusOptionWriteSchema as y };
|
|
277
|
+
export declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
|
|
278
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Attribute } from "./attributes-eqr1vdPP.mjs";
|
|
3
3
|
import { z as z$1 } from "zod";
|
|
4
4
|
//#region src/validation/core/types.d.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { z as z$1 } from "zod";
|
|
|
7
7
|
* All functions receive the full Attribute to access label, type, etc.
|
|
8
8
|
* Can be customized for i18n support.
|
|
9
9
|
*/
|
|
10
|
-
interface ValidationMessages {
|
|
10
|
+
export interface ValidationMessages {
|
|
11
11
|
required: (attr: Attribute) => string;
|
|
12
12
|
invalidType: (attr: Attribute, expected: string) => string;
|
|
13
13
|
minLength: (attr: Attribute, min: number) => string;
|
|
@@ -28,7 +28,7 @@ interface ValidationMessages {
|
|
|
28
28
|
/**
|
|
29
29
|
* Validation result
|
|
30
30
|
*/
|
|
31
|
-
interface ValidationResult {
|
|
31
|
+
export interface ValidationResult {
|
|
32
32
|
success: boolean;
|
|
33
33
|
data?: Record<string, unknown>;
|
|
34
34
|
errors?: Array<{
|
|
@@ -38,16 +38,15 @@ interface ValidationResult {
|
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/validation/core/messages.d.ts
|
|
41
|
-
declare const DEFAULT_VALIDATION_MESSAGES: ValidationMessages;
|
|
41
|
+
export declare const DEFAULT_VALIDATION_MESSAGES: ValidationMessages;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/validation/core/errors.d.ts
|
|
44
44
|
/**
|
|
45
45
|
* Format Zod validation errors into a consistent structure.
|
|
46
46
|
* This eliminates code duplication across multiple validation functions.
|
|
47
47
|
*/
|
|
48
|
-
declare function formatZodErrors(error: z$1.ZodError): Array<{
|
|
48
|
+
export declare function formatZodErrors(error: z$1.ZodError): Array<{
|
|
49
49
|
path: string[];
|
|
50
50
|
message: string;
|
|
51
51
|
}>;
|
|
52
|
-
//#endregion
|
|
53
|
-
export { ValidationResult as i, DEFAULT_VALIDATION_MESSAGES as n, ValidationMessages as r, formatZodErrors as t };
|
|
52
|
+
//#endregion
|