@standards/schema 1.0.0-alpha.413 → 1.0.0-alpha.415

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.
Files changed (136) hide show
  1. package/dist/all-Bldqj4jl.d.ts +4360 -0
  2. package/dist/all-BxsoHW0V.js +4 -0
  3. package/dist/all-C27HT84u.mjs +4 -0
  4. package/dist/all-CmG4j3B_.d.mts +4360 -0
  5. package/dist/api/index.d.mts +376 -709
  6. package/dist/api/index.d.ts +376 -709
  7. package/dist/api/index.js +1 -1
  8. package/dist/api/index.mjs +1 -1
  9. package/dist/{exceptions-BHqt4Omx.d.ts → exceptions-BIqEbF4H.d.mts} +0 -1
  10. package/dist/{exceptions-BHqt4Omx.d.mts → exceptions-BIqEbF4H.d.ts} +0 -1
  11. package/dist/exceptions.d.mts +1 -1
  12. package/dist/exceptions.d.ts +1 -1
  13. package/dist/exceptions.js +1 -1
  14. package/dist/exceptions.mjs +1 -1
  15. package/dist/{index-CkhBfmkf.d.mts → index-BGdQIO0V.d.mts} +535 -524
  16. package/dist/{index-C8VygCbt.d.ts → index-DIo9VcVh.d.ts} +535 -524
  17. package/dist/index.d.mts +5 -10
  18. package/dist/index.d.ts +5 -10
  19. package/dist/index.js +1653 -1
  20. package/dist/index.mjs +1653 -1
  21. package/dist/primitives-DpBFjzxV.mjs +11 -0
  22. package/dist/primitives-s7GS1T3w.js +11 -0
  23. package/dist/record-operation-C-qr4zs3.js +2 -0
  24. package/dist/record-operation-DM8ZJvmH.mjs +2 -0
  25. package/dist/{utils-BT8u9zYO.d.mts → utils-CIVBFpC3.d.mts} +1 -1
  26. package/dist/{utils-CChBw_3d.d.ts → utils-iNW5feob.d.ts} +1 -1
  27. package/dist/utils.d.mts +1 -1
  28. package/dist/utils.d.ts +1 -1
  29. package/dist/validation/all.d.mts +1 -4
  30. package/dist/validation/all.d.ts +1 -4
  31. package/dist/validation/all.js +1 -1
  32. package/dist/validation/all.mjs +1 -1
  33. package/package.json +2 -172
  34. package/dist/all-B9epSh3g.mjs +0 -2
  35. package/dist/all-Cg6JJd0x.d.ts +0 -2967
  36. package/dist/all-CkcnOJxd.d.mts +0 -2967
  37. package/dist/all-iuPkq14_.js +0 -2
  38. package/dist/attributes-DW19xkoM.d.ts +0 -561
  39. package/dist/attributes-QBySx30F.d.mts +0 -561
  40. package/dist/checkbox-O7Onsazk.d.mts +0 -10
  41. package/dist/checkbox-u5bh3lq-.d.ts +0 -10
  42. package/dist/config-YSw2jzWj.js +0 -2
  43. package/dist/config-iUwnquKr.mjs +0 -2
  44. package/dist/core-DAxRlJ5i.js +0 -2
  45. package/dist/core-rKI7Q9_U.mjs +0 -2
  46. package/dist/date-Bn8fqwCq.d.ts +0 -23
  47. package/dist/date-D7JMxFgD.d.mts +0 -23
  48. package/dist/index-BFKJEyq-.d.ts +0 -52
  49. package/dist/index-Cc3a-97k.d.ts +0 -271
  50. package/dist/index-CtmwL85u.d.ts +0 -100
  51. package/dist/index-DR5eSskq.d.mts +0 -271
  52. package/dist/index-D_IPqiMd.d.mts +0 -100
  53. package/dist/index-jE6uAt4g.d.mts +0 -52
  54. package/dist/number-DGfXEFnt.d.mts +0 -10
  55. package/dist/number-DiV9wvFE.d.ts +0 -10
  56. package/dist/object-5-wnsH0o.js +0 -4
  57. package/dist/object-BF5y6bgs.mjs +0 -4
  58. package/dist/objects-B4OojzI4.d.mts +0 -478
  59. package/dist/objects-Cvd1pe1g.d.ts +0 -478
  60. package/dist/phone-BGJea5sr.mjs +0 -2
  61. package/dist/phone-DHXyNkVY.js +0 -2
  62. package/dist/primitives-BCJLtpaI.mjs +0 -11
  63. package/dist/primitives-CVbrjJ24.js +0 -11
  64. package/dist/record-aggregates-BrLE4IsX.mjs +0 -2
  65. package/dist/record-aggregates-BuOfVWPJ.js +0 -2
  66. package/dist/record-operation-B4DrBgkp.mjs +0 -2
  67. package/dist/record-operation-BA4V9LB0.js +0 -2
  68. package/dist/rolldown-runtime-DETHMehu.js +0 -2
  69. package/dist/text-8GklpZzL.d.mts +0 -10
  70. package/dist/text-BaxaZ5Vv.mjs +0 -2
  71. package/dist/text-Biomo4m8.d.ts +0 -10
  72. package/dist/text-DVrTGjjX.js +0 -2
  73. package/dist/validation/complex/currency.d.mts +0 -13
  74. package/dist/validation/complex/currency.d.ts +0 -13
  75. package/dist/validation/complex/currency.js +0 -2
  76. package/dist/validation/complex/currency.mjs +0 -2
  77. package/dist/validation/complex/location.d.mts +0 -20
  78. package/dist/validation/complex/location.d.ts +0 -20
  79. package/dist/validation/complex/location.js +0 -2
  80. package/dist/validation/complex/location.mjs +0 -2
  81. package/dist/validation/complex/phone.d.mts +0 -20
  82. package/dist/validation/complex/phone.d.ts +0 -20
  83. package/dist/validation/complex/phone.js +0 -2
  84. package/dist/validation/complex/phone.mjs +0 -2
  85. package/dist/validation/complex/relation.d.mts +0 -23
  86. package/dist/validation/complex/relation.d.ts +0 -23
  87. package/dist/validation/complex/relation.js +0 -2
  88. package/dist/validation/complex/relation.mjs +0 -2
  89. package/dist/validation/complex/richtext.d.mts +0 -11
  90. package/dist/validation/complex/richtext.d.ts +0 -11
  91. package/dist/validation/complex/richtext.js +0 -2
  92. package/dist/validation/complex/richtext.mjs +0 -2
  93. package/dist/validation/complex/select.d.mts +0 -18
  94. package/dist/validation/complex/select.d.ts +0 -18
  95. package/dist/validation/complex/select.js +0 -2
  96. package/dist/validation/complex/select.mjs +0 -2
  97. package/dist/validation/complex/user.d.mts +0 -11
  98. package/dist/validation/complex/user.d.ts +0 -11
  99. package/dist/validation/complex/user.js +0 -2
  100. package/dist/validation/complex/user.mjs +0 -2
  101. package/dist/validation/computed/formula.d.mts +0 -12
  102. package/dist/validation/computed/formula.d.ts +0 -12
  103. package/dist/validation/computed/formula.js +0 -2
  104. package/dist/validation/computed/formula.mjs +0 -2
  105. package/dist/validation/computed/rollup.d.mts +0 -12
  106. package/dist/validation/computed/rollup.d.ts +0 -12
  107. package/dist/validation/computed/rollup.js +0 -2
  108. package/dist/validation/computed/rollup.mjs +0 -2
  109. package/dist/validation/config/index.d.mts +0 -3
  110. package/dist/validation/config/index.d.ts +0 -3
  111. package/dist/validation/config/index.js +0 -2
  112. package/dist/validation/config/index.mjs +0 -2
  113. package/dist/validation/core/index.d.mts +0 -3
  114. package/dist/validation/core/index.d.ts +0 -3
  115. package/dist/validation/core/index.js +0 -2
  116. package/dist/validation/core/index.mjs +0 -2
  117. package/dist/validation/object/index.d.mts +0 -3
  118. package/dist/validation/object/index.d.ts +0 -3
  119. package/dist/validation/object/index.js +0 -2
  120. package/dist/validation/object/index.mjs +0 -2
  121. package/dist/validation/primitives/checkbox.d.mts +0 -3
  122. package/dist/validation/primitives/checkbox.d.ts +0 -3
  123. package/dist/validation/primitives/checkbox.js +0 -2
  124. package/dist/validation/primitives/checkbox.mjs +0 -2
  125. package/dist/validation/primitives/date.d.mts +0 -3
  126. package/dist/validation/primitives/date.d.ts +0 -3
  127. package/dist/validation/primitives/date.js +0 -2
  128. package/dist/validation/primitives/date.mjs +0 -2
  129. package/dist/validation/primitives/number.d.mts +0 -3
  130. package/dist/validation/primitives/number.d.ts +0 -3
  131. package/dist/validation/primitives/number.js +0 -2
  132. package/dist/validation/primitives/number.mjs +0 -2
  133. package/dist/validation/primitives/text.d.mts +0 -3
  134. package/dist/validation/primitives/text.d.ts +0 -3
  135. package/dist/validation/primitives/text.js +0 -2
  136. package/dist/validation/primitives/text.mjs +0 -2
@@ -1,271 +0,0 @@
1
-
2
- import { ObjectImage, RecordAppearance } from "./objects-B4OojzI4.mjs";
3
- import { Attribute, AttributeType } from "./attributes-QBySx30F.mjs";
4
- import * as z$2 from "zod";
5
- import { ColorId, IconName } from "@standards/constants";
6
- //#region src/types/mutations.d.ts
7
- export interface AddAttributeInput {
8
- name: string;
9
- label: string;
10
- type: AttributeType;
11
- required?: boolean;
12
- unique?: boolean;
13
- description?: string;
14
- placeholder?: string;
15
- icon?: IconName;
16
- defaultValue?: unknown;
17
- metadata?: Record<string, unknown>;
18
- [key: string]: unknown;
19
- }
20
- export interface CreateCustomObjectInput {
21
- name: string;
22
- label: string;
23
- pluralLabel?: string;
24
- labelExpression: string;
25
- embeddingExpression?: string;
26
- description?: string;
27
- icon?: IconName;
28
- color?: ColorId;
29
- image?: ObjectImage;
30
- /** Its records may have a parent of this object. */
31
- hierarchical?: boolean;
32
- attributes?: (Attribute | {
33
- build: () => Attribute;
34
- })[];
35
- metadata?: Record<string, unknown>;
36
- }
37
- export interface UpdateObjectInput {
38
- label?: string;
39
- pluralLabel?: string;
40
- description?: string;
41
- icon?: IconName;
42
- /** `null` clears it: the colour then derives from the object name. */
43
- color?: ColorId | null;
44
- /** `null` clears it: record images then crop to a square, and are found nowhere. */
45
- image?: ObjectImage | null;
46
- labelExpression?: string;
47
- embeddingExpression?: string;
48
- hierarchical?: boolean;
49
- metadata?: Record<string, unknown>;
50
- }
51
- export interface RelationOption {
52
- id: string;
53
- objectId: string;
54
- objectName: string;
55
- objectLabel: string;
56
- objectIcon?: string;
57
- objectColor?: ColorId;
58
- /** How the target object crops its records' images: all an option needs of its image settings. */
59
- objectImage?: Pick<ObjectImage, "shape">;
60
- /** The target record's own icon / image; absent when it has neither. */
61
- appearance?: RecordAppearance;
62
- label: string;
63
- }
64
- export interface RelationOptionsResponse {
65
- options: RelationOption[];
66
- hasMore: boolean;
67
- total: number;
68
- nextOffset?: number;
69
- }
70
- //#endregion
71
- //#region src/validation/config/schemas.d.ts
72
- /**
73
- * `baseConfigSchema`'s keys — the model never sets these directly, and the
74
- * prompt (`attribute-reference.ts`'s `BASE_CONFIG_KEYS`) already hides them
75
- * from every `<attribute_types>` line. `ADD_ATTRIBUTE_WIRE` omits them from
76
- * each per-type wire config for the same reason, so the wire never offers a
77
- * key the model was never told about — and never exposes `metadata`, the one
78
- * genuine open record among them, on the wire. Single source: the runtime
79
- * prompt imports this instead of keeping its own copy. `icon` is offered back
80
- * on every attribute type (`WIRE_OFFERED_BASE_CONFIG`) and stays omitted from
81
- * qualified edge properties.
82
- */
83
- export declare const WIRE_OMITTED_CONFIG_KEYS: readonly ["placeholder", "description", "defaultValue", "icon", "order", "hidden", "archived", "deprecated", "metadata"];
84
- /**
85
- * The omitted base keys every attribute type's wire offers back, each with the
86
- * wire schema it is validated by. Karl's ruling on #5886 (2026-10-22, « Tous
87
- * les types d'attributs », reversing the relations-only ruling of #4537): every
88
- * attribute takes its own icon, a catalogue name the agent finds with
89
- * `search_icons`, exactly as an object icon. Qualified edge properties keep it
90
- * omitted. Single source for the wire (`ADD_ATTRIBUTE_WIRE`) and the prompt
91
- * (`attribute-reference.ts`), so the key the model is told about is the key
92
- * the wire accepts.
93
- */
94
- export declare const WIRE_OFFERED_BASE_CONFIG: {
95
- readonly icon: z$2.ZodOptional<z$2.ZodPipe<z$2.ZodString, z$2.ZodTransform<"delete" | "check" | "message" | "target" | "record" | "file" | "union" | "map" | "location" | "user" | "a-arrow-down" | "a-arrow-up" | "academic-hat" | "accessibility" | "activity-square" | "activity" | "add-queue" | "aeroplane" | "air-conditioner" | "airplay" | "airpods" | "alarm-check" | "alarm-minus" | "alarm-plus" | "alarm-smoke" | "alarm-snooze" | "alarm-x" | "alarm" | "album" | "align-bottom" | "align-horizontal" | "align-left" | "align-right" | "align-top" | "align-vertical" | "alt" | "ambulance" | "ampersand-square" | "ampersand" | "ampersands" | "anchor" | "angry-circle" | "angry-ghost" | "angry-square" | "annoyed-circle" | "annoyed-ghost" | "annoyed-square" | "aperture" | "api" | "ar" | "archive" | "arrow-diagonal-one" | "arrow-diagonal-two" | "arrow-down-circle" | "arrow-down-left-circle" | "arrow-down-left-square" | "arrow-down-left-waves" | "arrow-down-left" | "arrow-down-right-circle" | "arrow-down-right-square" | "arrow-down-right-waves" | "arrow-down-right" | "arrow-down-square" | "arrow-down-waves" | "arrow-down" | "arrow-left-circle" | "arrow-left-right" | "arrow-left-square" | "arrow-left-waves" | "arrow-left" | "arrow-long-down-left" | "arrow-long-down-right" | "arrow-long-down" | "arrow-long-left" | "arrow-long-right" | "arrow-long-up-left" | "arrow-long-up-right" | "arrow-long-up" | "arrow-right-circle" | "arrow-right-square" | "arrow-right-waves" | "arrow-right" | "arrow-up-circle" | "arrow-up-down" | "arrow-up-left-circle" | "arrow-up-left-square" | "arrow-up-left-waves" | "arrow-up-left" | "arrow-up-right-circle" | "arrow-up-right-square" | "arrow-up-right-waves" | "arrow-up-right" | "arrow-up-square" | "arrow-up-waves" | "arrow-up" | "asterisk-circle" | "asterisk-diamond" | "asterisk-hexagon" | "asterisk-octagon" | "asterisk-square" | "asterisk-waves" | "at" | "atom" | "baby" | "backpack" | "badge" | "baggage-claim" | "ban" | "bank" | "baseball" | "bath" | "battery-charging-four" | "battery-charging-one" | "battery-charging-three" | "battery-charging-two" | "battery-charging" | "battery-check" | "battery-empty" | "battery-full" | "battery-minus" | "battery-plus" | "battery-x" | "bell-check" | "bell-home" | "bell-minus" | "bell-on" | "bell-plus" | "bell-slash" | "bell-snooze" | "bell-user" | "bell-x" | "bell" | "binoculars" | "bitcoin-circle" | "bitcoin-diamond" | "bitcoin-hexagon" | "bitcoin-octagon" | "bitcoin-square" | "bitcoin-waves" | "bitcoin" | "bluetooth" | "boat" | "book-check" | "book-dot" | "book-home" | "book-image" | "book-minus" | "book-open" | "book-plus" | "book-slash" | "book-snooze" | "book-user" | "book-x" | "book" | "bookmark-check" | "bookmark-dot" | "bookmark-home" | "bookmark-minus" | "bookmark-plus" | "bookmark-slash" | "bookmark-snooze" | "bookmark-user" | "bookmark-x" | "bookmark" | "bounding-box" | "bowl" | "box" | "brand-chrome" | "brand-codepen" | "brand-codesandbox" | "brand-dribbble" | "brand-facebook" | "brand-figma" | "brand-framer" | "brand-github" | "brand-gitlab" | "brand-google" | "brand-instagram" | "brand-linkedin" | "brand-pinterest" | "brand-pocket" | "brand-slack" | "brand-spotify" | "brand-telegram" | "brand-threads" | "brand-trello" | "brand-twitch" | "brand-twitter" | "brand-x" | "brand-youtube" | "briefcase-conveyor-belt" | "briefcase" | "brightness-high" | "brightness-low" | "bubbles" | "building-one" | "building" | "cable-car" | "cake" | "calendar-check" | "calendar-down" | "calendar-minus" | "calendar-plus" | "calendar-slash" | "calendar-up" | "calendar-x" | "calendar" | "camera-slash" | "camera" | "campfire" | "cannabis" | "caravan" | "cart-check" | "cart-minus" | "cart-plus" | "cart-x" | "cart" | "cast-screen" | "center-focus" | "chart-area" | "chart-bar-big" | "chart-bar-decreasing" | "chart-bar-increasing" | "chart-bar-one" | "chart-bar-stacked" | "chart-bar" | "chart-bubble" | "chart-candlestick" | "chart-column-big" | "chart-column-decreasing" | "chart-column-increasing" | "chart-column-stacked" | "chart-column" | "chart-gantt" | "chart-graph" | "chart-line" | "chart-network" | "chart-no-axes-column-decreasing" | "chart-no-axes-column-increasing" | "chart-no-axes-column" | "chart-no-axes-combined" | "chart-no-axes-gantt" | "chart-pie-one" | "chart-pie-two" | "chart-pie" | "chart-scatter" | "chart-spline" | "chat-check" | "chat-dots" | "chat-messages" | "chat-minus" | "chat-plus" | "chat-x" | "chat" | "check-circle-one" | "check-circle" | "check-diamond" | "check-hexagon" | "check-octagon" | "check-square-one" | "check-square" | "check-waves" | "chevron-double-down-left" | "chevron-double-down-right" | "chevron-double-down" | "chevron-double-left" | "chevron-double-right" | "chevron-double-up-left" | "chevron-double-up-right" | "chevron-double-up" | "chevron-down-circle" | "chevron-down-left-circle" | "chevron-down-left-square" | "chevron-down-left-waves" | "chevron-down-left" | "chevron-down-right-circle" | "chevron-down-right-square" | "chevron-down-right-waves" | "chevron-down-right" | "chevron-down-square" | "chevron-down-waves" | "chevron-down" | "chevron-left-circle" | "chevron-left-square" | "chevron-left-waves" | "chevron-left" | "chevron-right-circle" | "chevron-right-square" | "chevron-right-waves" | "chevron-right" | "chevron-up-circle" | "chevron-up-down" | "chevron-up-left-circle" | "chevron-up-left-square" | "chevron-up-left-waves" | "chevron-up-left" | "chevron-up-right-circle" | "chevron-up-right-square" | "chevron-up-right-waves" | "chevron-up-right" | "chevron-up-square" | "chevron-up-waves" | "chevron-up" | "chip" | "cigarette-off" | "cigarette" | "circle-dashed" | "circle-half-circle" | "circle-half" | "circle-notch" | "circle" | "click" | "clipboard" | "clock-circle" | "clock-diamond" | "clock-eight" | "clock-eleven" | "clock-five" | "clock-four" | "clock-hand" | "clock-hexagon" | "clock-nine" | "clock-octagon" | "clock-one" | "clock-seven" | "clock-six" | "clock-square" | "clock-ten" | "clock-three" | "clock-twelve" | "clock-two" | "clock-waves" | "cloud-download" | "cloud-drizzle" | "cloud-fog" | "cloud-hail" | "cloud-lightning" | "cloud-moon-rain" | "cloud-moon" | "cloud-off" | "cloud-rain-wind" | "cloud-rain" | "cloud-snow" | "cloud-sun-rain" | "cloud-sun" | "cloud-upload" | "cloud" | "cloudy" | "cocktail" | "code-circle" | "code-diamond" | "code-hexagon" | "code-octagon" | "code-square" | "code-waves" | "code" | "coffee" | "cog-four" | "cog-one" | "cog-three" | "cog-two" | "cog" | "columns" | "command" | "compass" | "components" | "confetti" | "config-vertical" | "config" | "contactless-circle" | "contactless" | "controller" | "cookie" | "copy" | "copyleft" | "copyright-slash" | "copyright" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "credit-card-check" | "credit-card-minus" | "credit-card-plus" | "credit-card-x" | "credit-card" | "croissant" | "crop" | "crosshair" | "cupcake" | "danger-circle" | "danger-diamond" | "danger-hexagon" | "danger-octagon" | "danger-square" | "danger-triangle" | "danger-waves" | "danger" | "database" | "daze-circle" | "daze-ghost" | "daze-square" | "desktop" | "diamond" | "dice-five" | "dice-four" | "dice-one" | "dice-six" | "dice-three" | "dice-two" | "dislike" | "divide" | "dollar-circle" | "dollar-diamond" | "dollar-hexagon" | "dollar-octagon" | "dollar-square" | "dollar-waves" | "dollar" | "door-closed-locked" | "door-closed" | "door-open" | "dots-circle" | "dots-diamond" | "dots-hexagon" | "dots-octagon" | "dots-square" | "dots-vertical-circle" | "dots-vertical-diamond" | "dots-vertical-hexagon" | "dots-vertical-octagon" | "dots-vertical-square" | "dots-vertical-waves" | "dots-vertical" | "dots-waves" | "dots" | "download" | "drop" | "droplet-off" | "droplet" | "droplets" | "ear-slash" | "ear" | "earth" | "eclipse" | "edit-one" | "edit" | "egg" | "eight-circle" | "eight-diamond" | "eight-hexagon" | "eight-octagon" | "eight-square" | "eight-waves" | "eight" | "elevator" | "envelope-open" | "envelope" | "euro-circle" | "euro-diamond" | "euro-hexagon" | "euro-octagon" | "euro-square" | "euro-waves" | "euro" | "exclude" | "external-link" | "eye-slash" | "eye" | "face-id" | "fat-arrow-down-left" | "fat-arrow-down-right" | "fat-arrow-down" | "fat-arrow-left" | "fat-arrow-right" | "fat-arrow-up-left" | "fat-arrow-up-right" | "fat-arrow-up" | "fat-corner-down-left" | "fat-corner-down-right" | "fat-corner-left-down" | "fat-corner-left-up" | "fat-corner-right-down" | "fat-corner-right-up" | "fat-corner-up-left" | "fat-corner-up-right" | "female" | "file-check" | "file-minus" | "file-plus" | "file-text" | "file-x" | "film" | "filter-one" | "filter" | "fine-tune" | "fire" | "five-circle" | "five-diamond" | "five-hexagon" | "five-octagon" | "five-square" | "five-waves" | "five" | "flag-one" | "flag" | "flame-kindling" | "flame" | "flask" | "flower-2" | "flower" | "folder-check" | "folder-heart" | "folder-kanban" | "folder-minus" | "folder-one" | "folder-plus" | "folder-slash" | "folder-two" | "folder-x" | "folder" | "forward-circle" | "forward-diamond" | "forward-hexagon" | "forward-octagon" | "forward-square" | "forward-waves" | "forward" | "four-circle" | "four-diamond" | "four-hexagon" | "four-octagon" | "four-square" | "four-waves" | "four" | "frame" | "funny-circle" | "funny-ghost" | "funny-square" | "gift" | "git-branch" | "git-circle" | "git-commit" | "git-diamond" | "git-diff" | "git-hexagon" | "git-merge" | "git-octagon" | "git-pull-request" | "git-square" | "git-waves" | "glasses" | "globe" | "grid-one" | "grid" | "hand" | "hard-drive" | "hash-circle" | "hash-diamond" | "hash-hexagon" | "hash-octagon" | "hash-square" | "hash-waves" | "hash" | "haze" | "heading-five" | "heading-four" | "heading-one" | "heading-six" | "heading-three" | "heading-two" | "heading" | "headphones" | "heart-broken" | "heart-check" | "heart-circle" | "heart-diamond" | "heart-dot" | "heart-hexagon" | "heart-home" | "heart-minus" | "heart-octagon" | "heart-plus" | "heart-slash" | "heart-snooze" | "heart-square" | "heart-user" | "heart-waves" | "heart-x" | "heart" | "hexagon" | "home-check" | "home-minus" | "home-plus" | "home-smile" | "home-x" | "home" | "image-circle" | "image-rectangle" | "image" | "inbox-archive" | "inbox-check" | "inbox-down" | "inbox-minus" | "inbox-plus" | "inbox-up" | "inbox-x" | "inbox" | "incognito" | "indifferent-circle" | "indifferent-ghost" | "indifferent-square" | "infinity" | "info-circle" | "info-diamond" | "info-hexagon" | "info-octagon" | "info-square" | "info-triangle" | "info-waves" | "info" | "intersect" | "kanban" | "key" | "keyboard-brightness-high" | "keyboard-brightness-low" | "keyboard" | "label" | "lamp" | "layers-one" | "layers-three" | "layers-two" | "layout" | "leaf" | "leaves" | "letter-a-circle" | "letter-a-diamond" | "letter-a-hexagon" | "letter-a-octagon" | "letter-a-square" | "letter-a-waves" | "letter-a" | "letter-b-circle" | "letter-b-diamond" | "letter-b-hexagon" | "letter-b-octagon" | "letter-b-square" | "letter-b-waves" | "letter-b" | "letter-c-circle" | "letter-c-diamond" | "letter-c-hexagon" | "letter-c-octagon" | "letter-c-square" | "letter-c-waves" | "letter-c" | "letter-d-circle" | "letter-d-diamond" | "letter-d-hexagon" | "letter-d-octagon" | "letter-d-square" | "letter-d-waves" | "letter-d" | "letter-e-circle" | "letter-e-diamond" | "letter-e-hexagon" | "letter-e-octagon" | "letter-e-square" | "letter-e-waves" | "letter-e" | "letter-f-circle" | "letter-f-diamond" | "letter-f-hexagon" | "letter-f-octagon" | "letter-f-square" | "letter-f-waves" | "letter-f" | "letter-g-circle" | "letter-g-diamond" | "letter-g-hexagon" | "letter-g-octagon" | "letter-g-square" | "letter-g-waves" | "letter-g" | "letter-h-circle" | "letter-h-diamond" | "letter-h-hexagon" | "letter-h-octagon" | "letter-h-square" | "letter-h-waves" | "letter-h" | "letter-i-circle" | "letter-i-diamond" | "letter-i-hexagon" | "letter-i-octagon" | "letter-i-square" | "letter-i-waves" | "letter-i" | "letter-j-circle" | "letter-j-diamond" | "letter-j-hexagon" | "letter-j-octagon" | "letter-j-square" | "letter-j-waves" | "letter-j" | "letter-k-circle" | "letter-k-diamond" | "letter-k-hexagon" | "letter-k-octagon" | "letter-k-square" | "letter-k-waves" | "letter-k" | "letter-l-circle" | "letter-l-diamond" | "letter-l-hexagon" | "letter-l-octagon" | "letter-l-square" | "letter-l-waves" | "letter-l" | "letter-m-circle" | "letter-m-diamond" | "letter-m-hexagon" | "letter-m-octagon" | "letter-m-square" | "letter-m-waves" | "letter-m" | "letter-n-circle" | "letter-n-diamond" | "letter-n-hexagon" | "letter-n-octagon" | "letter-n-square" | "letter-n-waves" | "letter-n" | "letter-o-circle" | "letter-o-diamond" | "letter-o-hexagon" | "letter-o-octagon" | "letter-o-square" | "letter-o-waves" | "letter-o" | "letter-p-circle" | "letter-p-diamond" | "letter-p-hexagon" | "letter-p-octagon" | "letter-p-square" | "letter-p-waves" | "letter-p" | "letter-q-circle" | "letter-q-diamond" | "letter-q-hexagon" | "letter-q-octagon" | "letter-q-square" | "letter-q-waves" | "letter-q" | "letter-r-circle" | "letter-r-diamond" | "letter-r-hexagon" | "letter-r-octagon" | "letter-r-square" | "letter-r-waves" | "letter-r" | "letter-s-circle" | "letter-s-diamond" | "letter-s-hexagon" | "letter-s-octagon" | "letter-s-square" | "letter-s-waves" | "letter-s" | "letter-t-circle" | "letter-t-diamond" | "letter-t-hexagon" | "letter-t-octagon" | "letter-t-square" | "letter-t-waves" | "letter-t" | "letter-u-circle" | "letter-u-diamond" | "letter-u-hexagon" | "letter-u-octagon" | "letter-u-square" | "letter-u-waves" | "letter-u" | "letter-v-circle" | "letter-v-diamond" | "letter-v-hexagon" | "letter-v-octagon" | "letter-v-square" | "letter-v-waves" | "letter-v" | "letter-w-circle" | "letter-w-diamond" | "letter-w-hexagon" | "letter-w-octagon" | "letter-w-square" | "letter-w-waves" | "letter-w" | "letter-x-circle" | "letter-x-diamond" | "letter-x-hexagon" | "letter-x-octagon" | "letter-x-square" | "letter-x-waves" | "letter-x" | "letter-y-circle" | "letter-y-diamond" | "letter-y-hexagon" | "letter-y-octagon" | "letter-y-square" | "letter-y-waves" | "letter-y" | "letter-z-circle" | "letter-z-diamond" | "letter-z-hexagon" | "letter-z-octagon" | "letter-z-square" | "letter-z-waves" | "letter-z" | "lightning-off" | "lightning" | "like" | "line-chart-circle" | "line-chart-diamond" | "line-chart-hexagon" | "line-chart-octagon" | "line-chart-square" | "line-chart-waves" | "link-one" | "link-two" | "link" | "list-check" | "list-number" | "list" | "location-check" | "location-home" | "location-minus" | "location-plus" | "location-selected" | "location-slash" | "location-snooze" | "location-user" | "location-x" | "lock-circle" | "lock-diamond" | "lock-hexagon" | "lock-keyhole" | "lock-octagon" | "lock-open-keyhole" | "lock-open-password" | "lock-open" | "lock-password" | "lock-square" | "lock-waves" | "lock" | "login" | "logout" | "magnet" | "male" | "mask" | "math-square" | "math" | "maximize-one" | "maximize" | "menu" | "message-check" | "message-dots" | "message-minus" | "message-plus" | "message-reply" | "message-x" | "microphone-slash" | "microphone" | "minimize-one" | "minimize" | "minus-circle" | "minus-diamond" | "minus-hexagon" | "minus-octagon" | "minus-square" | "minus-waves" | "minus" | "mobile-signal-five" | "mobile-signal-four" | "mobile-signal-one" | "mobile-signal-three" | "mobile-signal-two" | "mobile" | "moon-star" | "moon" | "mountain-snow" | "mountain" | "mouse-pointer" | "move-diagonal-one" | "move-diagonal" | "move-horizontal" | "move-vertical" | "move" | "music-circle" | "music-diamond" | "music-hexagon" | "music-octagon" | "music-square" | "music-waves" | "music" | "myna" | "navigation-one" | "navigation" | "nine-circle" | "nine-diamond" | "nine-hexagon" | "nine-octagon" | "nine-square" | "nine-waves" | "nine" | "notification" | "octagon" | "one-circle" | "one-diamond" | "one-hexagon" | "one-octagon" | "one-square" | "one-waves" | "one" | "option" | "package" | "paint" | "panel-bottom-close" | "panel-bottom-inactive" | "panel-bottom-open" | "panel-bottom" | "panel-left-close" | "panel-left-inactive" | "panel-left-open" | "panel-left" | "panel-right-close" | "panel-right-inactive" | "panel-right-open" | "panel-right" | "panel-top-close" | "panel-top-inactive" | "panel-top-open" | "panel-top" | "paperclip" | "parking" | "password" | "path" | "pause-circle" | "pause-diamond" | "pause-hexagon" | "pause-octagon" | "pause-square" | "pause-waves" | "pause" | "pen" | "pencil" | "percentage-circle" | "percentage-diamond" | "percentage-hexagon" | "percentage-octagon" | "percentage-square" | "percentage-waves" | "percentage" | "pin" | "pizza" | "planet" | "play-circle" | "play-diamond" | "play-hexagon" | "play-octagon" | "play-square" | "play-waves" | "play" | "plus-circle" | "plus-diamond" | "plus-hexagon" | "plus-octagon" | "plus-square" | "plus-waves" | "plus" | "pokeball" | "power" | "presentation" | "printer" | "puzzle" | "question-circle" | "question-diamond" | "question-hexagon" | "question-octagon" | "question-square" | "question-waves" | "question" | "radio" | "rainbow" | "reception-bell" | "rectangle-vertical" | "rectangle" | "redo" | "refresh-alt" | "refresh" | "repeat" | "rewind-circle" | "rewind-diamond" | "rewind-hexagon" | "rewind-octagon" | "rewind-square" | "rewind-waves" | "rewind" | "rhombus" | "ribbon" | "rocket" | "room-service" | "rows" | "rss" | "ruler" | "rupee-circle" | "rupee-diamond" | "rupee-hexagon" | "rupee-octagon" | "rupee-square" | "rupee-waves" | "rupee" | "sad-circle" | "sad-ghost" | "sad-square" | "save" | "scan" | "scissors" | "sea-waves" | "search-check" | "search-circle" | "search-diamond" | "search-dot" | "search-hexagon" | "search-home" | "search-minus" | "search-octagon" | "search-plus" | "search-slash" | "search-snooze" | "search-square" | "search-user" | "search-waves" | "search-x" | "search" | "select-multiple" | "send" | "servers" | "seven-circle" | "seven-diamond" | "seven-hexagon" | "seven-octagon" | "seven-square" | "seven-waves" | "seven" | "share" | "shell" | "shield-check" | "shield-crossed" | "shield-minus" | "shield-one" | "shield-plus" | "shield-slash" | "shield-two" | "shield-x" | "shield" | "shooting-star" | "shopping-bag" | "shovel" | "shrub" | "shuffle-alt" | "shuffle" | "sidebar-alt" | "sidebar" | "signal-circle" | "signal-diamond" | "signal-hexagon" | "signal-octagon" | "signal-square" | "signal-waves" | "signal" | "six-circle" | "six-diamond" | "six-hexagon" | "six-octagon" | "six-square" | "six-waves" | "six" | "skip-back" | "skip-forward" | "slash-circle" | "slash-diamond" | "slash-hexagon" | "slash-octagon" | "slash-square" | "slash-waves" | "smile-circle" | "smile-ghost" | "smile-square" | "snow" | "snowflake" | "sofa" | "sort" | "sparkles" | "speaker" | "spinner-one" | "spinner" | "sprout" | "square-chart-gantt" | "square-dashed-kanban" | "square-dashed" | "square-half" | "square-kanban" | "square" | "star" | "stop-circle" | "stop-diamond" | "stop-hexagon" | "stop-octagon" | "stop-square" | "stop-waves" | "stop" | "store" | "subtract" | "sun-dim" | "sun-medium" | "sun-snow" | "sun" | "sunrise" | "sunset" | "support" | "swatches" | "table" | "tablet" | "tag-plus" | "tag" | "tally-five" | "tally-four" | "tally-one" | "tally-three" | "tally-two" | "telephone-call" | "telephone-forward" | "telephone-in" | "telephone-missed" | "telephone-out" | "telephone-slash" | "telephone" | "tent-tree" | "tent" | "terminal" | "text-align-center" | "text-align-left" | "text-align-right" | "text-justify" | "thermometer-snowflake" | "thermometer-sun" | "thermometer" | "three-circle" | "three-diamond" | "three-hexagon" | "three-octagon" | "three-square" | "three-waves" | "three" | "ticket-slash" | "ticket" | "toggle-left" | "toggle-right" | "tool" | "tornado" | "train" | "trash-one" | "trash-two" | "trash" | "tree-deciduous" | "tree-palm" | "tree-pine" | "tree" | "trees" | "trending-down" | "trending-up-down" | "trending-up" | "triangle" | "truck" | "tv" | "two-circle" | "two-diamond" | "two-hexagon" | "two-octagon" | "two-square" | "two-waves" | "two" | "type-bold" | "type-italic" | "type-text" | "type-underline" | "umbrella-off" | "umbrella" | "undo" | "unlink" | "upload" | "user-check" | "user-circle" | "user-diamond" | "user-hexagon" | "user-minus" | "user-octagon" | "user-plus" | "user-settings" | "user-square" | "user-waves" | "user-x" | "users-group" | "users" | "video-slash" | "video" | "volume-check" | "volume-high" | "volume-low" | "volume-minus" | "volume-none" | "volume-plus" | "volume-slash" | "volume-x" | "watch" | "waves" | "webcam" | "wheel" | "wheelchair" | "wifi-check" | "wifi-low" | "wifi-medium" | "wifi-minus" | "wifi-plus" | "wifi-slash" | "wifi-x" | "wifi" | "wind-arrow-down" | "wind" | "winds" | "wine" | "wink-circle" | "wink-ghost" | "wink-square" | "wrench" | "x-circle" | "x-diamond" | "x-hexagon" | "x-octagon" | "x-square" | "x-triangle" | "x-waves" | "x" | "yen-circle" | "yen-diamond" | "yen-hexagon" | "yen-octagon" | "yen-square" | "yen-waves" | "yen" | "zap-off" | "zap" | "zero-circle" | "zero-diamond" | "zero-hexagon" | "zero-octagon" | "zero-square" | "zero-waves" | "zero", string>>>;
96
- };
97
- /**
98
- * The keys left off `attributeType`'s prompt line: every omitted base key and
99
- * the type's hidden keys. The wire omits the same set, then adds back
100
- * `WIRE_OFFERED_BASE_CONFIG`, which the prompt states once under the block
101
- * rather than on every line.
102
- */
103
- export declare function wireOmittedConfigKeysFor(attributeType: AttributeType): readonly string[];
104
- /** `omit()` mask of the type keys hidden from `attributeType`'s wire. */
105
- export declare function wireHiddenTypeConfigMask(attributeType: AttributeType): Record<string, true>;
106
- /**
107
- * Builds the `superRefine` that refuses a key belonging to a DIFFERENT type
108
- * than the one sent.
109
- *
110
- * Two wire shapes merge several types into one member for size — the nine
111
- * simple attribute types of `ADD_ATTRIBUTE_WIRE`, and the seven simple
112
- * qualified-property types below — so a merged member structurally accepts
113
- * every merged type's keys. Without this, a `text`-only `format` sent on a
114
- * `number` parses and is then silently `.strip()`-ped at store: a key lost
115
- * with no feedback. Checked against the SENT type, and the message names the
116
- * keys that type does accept so the next call is right. One factory rather
117
- * than two near-identical loops — the second one drifted first.
118
- */
119
- 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;
120
- export declare const statusGroupSchema: z$2.ZodEnum<{
121
- idle: "idle";
122
- in_progress: "in_progress";
123
- finished: "finished";
124
- }>;
125
- export declare const selectOptionWriteSchema: z$2.ZodObject<{
126
- value: z$2.ZodString;
127
- label: z$2.ZodString;
128
- description: z$2.ZodOptional<z$2.ZodString>;
129
- inverse: z$2.ZodOptional<z$2.ZodString>;
130
- archived: z$2.ZodOptional<z$2.ZodBoolean>;
131
- color: z$2.ZodEnum<{
132
- stone: "stone";
133
- clay: "clay";
134
- brick: "brick";
135
- terra: "terra";
136
- ochre: "ochre";
137
- moss: "moss";
138
- sage: "sage";
139
- lagoon: "lagoon";
140
- ink: "ink";
141
- iris: "iris";
142
- peony: "peony";
143
- }>;
144
- }, z$2.core.$strict>;
145
- export declare const statusOptionWriteSchema: z$2.ZodObject<{
146
- value: z$2.ZodString;
147
- label: z$2.ZodString;
148
- description: z$2.ZodOptional<z$2.ZodString>;
149
- inverse: z$2.ZodOptional<z$2.ZodString>;
150
- archived: z$2.ZodOptional<z$2.ZodBoolean>;
151
- color: z$2.ZodEnum<{
152
- stone: "stone";
153
- clay: "clay";
154
- brick: "brick";
155
- terra: "terra";
156
- ochre: "ochre";
157
- moss: "moss";
158
- sage: "sage";
159
- lagoon: "lagoon";
160
- ink: "ink";
161
- iris: "iris";
162
- peony: "peony";
163
- }>;
164
- group: z$2.ZodEnum<{
165
- idle: "idle";
166
- in_progress: "in_progress";
167
- finished: "finished";
168
- }>;
169
- }, z$2.core.$strict>;
170
- /**
171
- * Drops, from every option of an attribute config or body, the keys
172
- * `optionSchema` does not know — typically an `id` the code builder accepted
173
- * without complaint (#4356). Sync stores options through it, and the schema
174
- * state reads them through it, so one stale key no longer 400s the whole state.
175
- * The options of a `relation()`/`document()`'s `.qualifyWith()` properties are
176
- * validated by the same schema, so each property definition goes through it too.
177
- *
178
- * Order is kept, and a config with nothing to drop is returned as is. A list
179
- * or option that is not the expected shape is left for strict validation to
180
- * refuse.
181
- */
182
- export declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
183
- /**
184
- * Property types whose config differs from `baseConfigSchema` only by
185
- * independent optional scalars — no options array, no relation targets. Same
186
- * shape as `SIMPLE_ATTRIBUTE_TYPES` in `architect/operations/schema.ts` minus
187
- * `richtext`/`user` (not valid property types) — none of these seven types'
188
- * keys collide, proven by `tests/validation/config/property-config.test.ts`.
189
- * Merged into one wire member for the same reason `ADD_ATTRIBUTE_WIRE` merges
190
- * its nine: the model reads one shape instead of seven near-identical ones,
191
- * and this is also what keeps a qualified relation/document's `add_attribute`
192
- * leaf under its wire-size cap (`tests/architect/wire-schema-size.test.ts`) —
193
- * ten separate members, each paying its own JSON Schema object/`$defs`
194
- * boilerplate, blew the budget even after the base config keys were omitted.
195
- */
196
- export declare const SIMPLE_PROPERTY_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "location"];
197
- export declare const propertyAttributeSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
198
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
199
- }>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
200
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
201
- }>, z$2.core.$strip>[]], "type">;
202
- export declare const propertySchemaSchema: z$2.ZodObject<{
203
- definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
204
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
205
- }>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
206
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
207
- }>, z$2.core.$strip>[]], "type">>;
208
- }, z$2.core.$strip>;
209
- /**
210
- * The wire-facing property union, derived from the stored one: the same seven
211
- * simple types merged into one member, the option-carrying types alongside,
212
- * everything the model never sets omitted, and `.strict()` so an invented key
213
- * is refused by name instead of silently stripped at store.
214
- */
215
- export declare const propertyAttributeWireSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
216
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
217
- }>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
218
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
219
- }>, z$2.core.$strip>[]], "type">;
220
- export declare const propertySchemaWireSchema: z$2.ZodObject<{
221
- definitions: z$2.ZodArray<z$2.ZodDiscriminatedUnion<[z$2.ZodObject<Readonly<{
222
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
223
- }>, z$2.core.$strip>, ...z$2.ZodObject<Readonly<{
224
- [k: string]: z$2.core.$ZodType<unknown, unknown, z$2.core.$ZodTypeInternals<unknown, unknown>>;
225
- }>, z$2.core.$strip>[]], "type">>;
226
- }, z$2.core.$strict>;
227
- /**
228
- * A month or a year has no time of day and no range end to pair with in this
229
- * slice (#5325): `precision` narrower than a day is refused beside
230
- * `includeTime` or `endDate`, on the attribute and on each date property it
231
- * qualifies an edge with.
232
- */
233
- export declare function datePrecisionIssues(type: string, config: Record<string, unknown>, path?: PropertyKey[]): {
234
- path: PropertyKey[];
235
- message: string;
236
- }[];
237
- /**
238
- * Map of attribute type to config schema
239
- */
240
- export declare const attributeConfigSchemas: Record<AttributeType, z$2.ZodObject<z$2.ZodRawShape>>;
241
- /**
242
- * Get the config schema for a specific attribute type
243
- */
244
- export declare function getAttributeConfigSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
245
- /**
246
- * Validate and strip unknown properties from attribute config
247
- * This ensures only allowed properties are stored in the database
248
- */
249
- export declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
250
- /**
251
- * The config contract as a WRITE applies it: the stored schema plus the
252
- * stricter option and icon rules newly written values must satisfy.
253
- */
254
- export declare function getAttributeConfigWriteSchema(type: AttributeType): z$2.ZodObject<z$2.ZodRawShape>;
255
- /**
256
- * Strict parser for newly created attribute definitions.
257
- *
258
- * Top-level config remains strip-compatible with the historical config
259
- * contract, while newly written icons and select-like option objects are
260
- * validated strictly.
261
- */
262
- export declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
263
- /**
264
- * Patch-aware parser for persisted attributes.
265
- *
266
- * An explicit options patch owns and strictly validates the complete new
267
- * list. Omission means the stored legacy list is preserved without
268
- * reconstruction, including options that predate required colours/groups.
269
- */
270
- export declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
271
- //#endregion
@@ -1,100 +0,0 @@
1
-
2
- import { ObjectDefinition } from "./objects-B4OojzI4.mjs";
3
- import { Attribute } from "./attributes-QBySx30F.mjs";
4
- import { ValidationMessages, ValidationResult } from "./index-jE6uAt4g.mjs";
5
- import * as z$2 from "zod";
6
- //#region src/validation/object/attribute-factory.d.ts
7
- /**
8
- * Create a Zod schema for any attribute type.
9
- * Returns a strict validator that does NOT handle optional fields.
10
- * Use createFormAttributeValidator for form validation with optional support.
11
- *
12
- * @param attr - The attribute to create a validator for
13
- * @param messages - Custom validation messages for i18n support
14
- */
15
- export declare function createAttributeValidator(attr: Attribute, messages?: ValidationMessages): z$2.ZodTypeAny;
16
- /**
17
- * Create a Zod schema for form validation.
18
- * - Normalizes empty values (empty strings, empty objects) to null for optional fields
19
- * - Accepts custom messages for i18n support
20
- *
21
- * Use this in UI forms where optional fields may have null/undefined values.
22
- *
23
- * @param attr - The attribute to create a validator for
24
- * @param messages - Custom validation messages for i18n support
25
- */
26
- export declare function createFormAttributeValidator(attr: Attribute, messages?: ValidationMessages): z$2.ZodTypeAny;
27
- //#endregion
28
- //#region src/validation/object/object-validator.d.ts
29
- /**
30
- * Create a Zod schema for an entire object
31
- *
32
- * Uses passthrough mode to allow computed fields (formula, rollup) that may be
33
- * present in record data but are not part of the mutable schema.
34
- *
35
- * Result is cached per ObjectDefinition instance — safe because ObjectDefinitions
36
- * are stable after module load and never mutated at runtime.
37
- */
38
- export declare function createObjectValidator(objectDef: ObjectDefinition): z$2.ZodType<Record<string, unknown>>;
39
- /**
40
- * Create a Zod schema for draft validation.
41
- * All attributes become optional, but provided values are still validated.
42
- *
43
- * Uses passthrough mode to allow computed fields (formula, rollup) that may be
44
- * present in record data but are not part of the mutable schema.
45
- *
46
- * Result is cached per ObjectDefinition instance — safe because ObjectDefinitions
47
- * are stable after module load and never mutated at runtime.
48
- */
49
- export declare function createDraftValidator(objectDef: ObjectDefinition): z$2.ZodType<Record<string, unknown>>;
50
- //#endregion
51
- //#region src/validation/object/helpers.d.ts
52
- /**
53
- * Validate data against an attribute schema
54
- */
55
- export declare function validateAttribute(attr: Attribute, value: unknown): ValidationResult;
56
- /**
57
- * Validate data against an object schema
58
- */
59
- export declare function validateObject(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
60
- /**
61
- * Validate and throw if invalid.
62
- *
63
- * Throws `ValidationError` (code `SCHEMA_VALIDATION_FAILED`) on failure so HTTP
64
- * adapters can map it to 400. Generic `Error` would bubble up to a 500.
65
- */
66
- export declare function validateObjectOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
67
- /**
68
- * Validate data in draft mode.
69
- * - All attributes are treated as optional (no required validation)
70
- * - Provided values are still validated for format/type correctness
71
- */
72
- export declare function validateDraft(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
73
- /**
74
- * Validate draft data and throw if format validation fails.
75
- *
76
- * Same contract as `validateObjectOrThrow` but skips `required()` checks.
77
- * Throws `ValidationError` so HTTP adapters map it to 400.
78
- */
79
- export declare function validateDraftOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
80
- /**
81
- * Throw a `ValidationError` when `data` contains keys that do not correspond
82
- * to any attribute declared on `objectDef`.
83
- *
84
- * Call this on **client-supplied input** before Zod validation so the error
85
- * message clearly names every offending key. Do NOT call on merged data that
86
- * includes existing record values — older records may legitimately carry stale
87
- * keys that predate this guard (see issue #658).
88
- *
89
- * Maps to HTTP 400 via `SchemaExceptionFilter` (code SCHEMA_VALIDATION_FAILED).
90
- */
91
- export declare function rejectUnknownAttributesOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): void;
92
- /**
93
- * Get the list of required attributes that are missing values.
94
- */
95
- export declare function getMissingRequiredAttributes(objectDef: ObjectDefinition, data: Record<string, unknown>): Attribute[];
96
- /**
97
- * Check if a record is complete (all required attributes have valid values).
98
- */
99
- export declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<string, unknown>): boolean;
100
- //#endregion
@@ -1,52 +0,0 @@
1
-
2
- import { Attribute } from "./attributes-QBySx30F.mjs";
3
- import { z as z$1 } from "zod";
4
- //#region src/validation/core/types.d.ts
5
- /**
6
- * Validation messages for Zod validators.
7
- * All functions receive the full Attribute to access label, type, etc.
8
- * Can be customized for i18n support.
9
- */
10
- export interface ValidationMessages {
11
- required: (attr: Attribute) => string;
12
- invalidType: (attr: Attribute, expected: string) => string;
13
- minLength: (attr: Attribute, min: number) => string;
14
- maxLength: (attr: Attribute, max: number) => string;
15
- invalidPattern: (attr: Attribute) => string;
16
- minValue: (attr: Attribute, min: number) => string;
17
- maxValue: (attr: Attribute, max: number) => string;
18
- mustBeInteger: (attr: Attribute) => string;
19
- invalidDate: (attr: Attribute) => string;
20
- invalidOption: (attr: Attribute, options: string[]) => string;
21
- invalidId: (attr: Attribute) => string;
22
- maxItems: (attr: Attribute, max: number) => string;
23
- invalidRichtext: (attr: Attribute) => string;
24
- invalidPhone: (attr: Attribute) => string;
25
- invalidCurrency: (attr: Attribute) => string;
26
- invalidLocation: (attr: Attribute) => string;
27
- }
28
- /**
29
- * Validation result
30
- */
31
- export interface ValidationResult {
32
- success: boolean;
33
- data?: Record<string, unknown>;
34
- errors?: Array<{
35
- path: string[];
36
- message: string;
37
- }>;
38
- }
39
- //#endregion
40
- //#region src/validation/core/messages.d.ts
41
- export declare const DEFAULT_VALIDATION_MESSAGES: ValidationMessages;
42
- //#endregion
43
- //#region src/validation/core/errors.d.ts
44
- /**
45
- * Format Zod validation errors into a consistent structure.
46
- * This eliminates code duplication across multiple validation functions.
47
- */
48
- export declare function formatZodErrors(error: z$1.ZodError): Array<{
49
- path: string[];
50
- message: string;
51
- }>;
52
- //#endregion
@@ -1,10 +0,0 @@
1
-
2
- import { NumberAttribute } from "./attributes-QBySx30F.mjs";
3
- import { ValidationMessages } from "./index-jE6uAt4g.mjs";
4
- import * as z$2 from "zod";
5
- //#region src/validation/primitives/number.d.ts
6
- /**
7
- * Create a Zod schema for a number attribute
8
- */
9
- export declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z$2.ZodNumber;
10
- //#endregion
@@ -1,10 +0,0 @@
1
-
2
- import { NumberAttribute } from "./attributes-DW19xkoM.js";
3
- import { ValidationMessages } from "./index-BFKJEyq-.js";
4
- import * as z$2 from "zod";
5
- //#region src/validation/primitives/number.d.ts
6
- /**
7
- * Create a Zod schema for a number attribute
8
- */
9
- export declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z$2.ZodNumber;
10
- //#endregion
@@ -1,4 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");const n=require("./text-DVrTGjjX.js"),r=require("./core-DAxRlJ5i.js"),i=require("./validation/primitives/number.js"),a=require("./validation/primitives/checkbox.js"),o=require("./validation/primitives/date.js"),s=require("./validation/complex/currency.js"),c=require("./validation/complex/location.js"),l=require("./phone-DHXyNkVY.js"),u=require("./validation/complex/relation.js"),d=require("./validation/complex/richtext.js"),f=require("./validation/complex/select.js"),p=require("./validation/complex/user.js"),m=require("./validation/computed/formula.js"),h=require("./validation/computed/rollup.js");let g=require("zod");g=e.__toESM(g);function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const _={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return g.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,t=r.DEFAULT_VALIDATION_MESSAGES){switch(e.type){case`text`:return n.createTextValidator(e,t);case`richtext`:return d.createRichtextValidator(e,t);case`number`:return i.createNumberValidator(e,t);case`checkbox`:return a.createCheckboxValidator(e,t);case`date`:return o.createDateValidator(e,t);case`phone`:return l.createPhoneValidator(e,t);case`currency`:return s.createCurrencyValidator(e,t);case`status`:return f.createStatusValidator(e,t);case`location`:return c.createLocationValidator(e,t);case`select`:return f.createSelectValidator(e,t);case`multiselect`:return f.createMultiselectValidator(e,t);case`user`:return p.createUserValidator(e,t);case`relation`:return u.createRelationValidator(e,t);case`formula`:return m.createFormulaValidator(e,t);case`rollup`:return h.createRollupValidator(e,t);default:return g.unknown()}}function createFormAttributeValidator(e,t=r.DEFAULT_VALIDATION_MESSAGES){let n=createAttributeValidator(e,t);return e.required?n:withEmptyToNull(n,_[e.type])}const v=new WeakMap,y=new WeakMap;function createObjectValidator(e){let t=v.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?n[t.name]=e.refine(isValuePresent,{message:r.DEFAULT_VALIDATION_MESSAGES.required(t)}):n[t.name]=withEmptyToNull(e,_[t.type])}let i=g.object(n).passthrough();return v.set(e,i),i}function createDraftValidator(e){let t=y.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,_[t.type])}let r=g.object(n).passthrough();return y.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=n.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:r.formatZodErrors(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.formatZodErrors(n.error)}}function validateObjectOrThrow(e,n){let r=validateObject(e,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
3
- `)||`Unknown validation error`;throw new t.ValidationError(`Validation failed for ${e.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r.formatZodErrors(n.error)}}function validateDraftOrThrow(e,n){let r=validateDraft(e,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
4
- `)||`Unknown validation error`;throw new t.ValidationError(`Draft validation failed for ${e.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(e,n){let r=new Set(e.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new t.ValidationError(`Unknown attribute${i.length>1?`s`:``} for ${e.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}Object.defineProperty(exports,"createAttributeValidator",{enumerable:!0,get:function(){return createAttributeValidator}}),Object.defineProperty(exports,"createDraftValidator",{enumerable:!0,get:function(){return createDraftValidator}}),Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:!0,get:function(){return createFormAttributeValidator}}),Object.defineProperty(exports,"createObjectValidator",{enumerable:!0,get:function(){return createObjectValidator}}),Object.defineProperty(exports,"getMissingRequiredAttributes",{enumerable:!0,get:function(){return getMissingRequiredAttributes}}),Object.defineProperty(exports,"isEmptyValue",{enumerable:!0,get:function(){return isEmptyValue}}),Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:!0,get:function(){return isNullishOrEmptyString}}),Object.defineProperty(exports,"isRecordComplete",{enumerable:!0,get:function(){return isRecordComplete}}),Object.defineProperty(exports,"isValuePresent",{enumerable:!0,get:function(){return isValuePresent}}),Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:!0,get:function(){return rejectUnknownAttributesOrThrow}}),Object.defineProperty(exports,"validateAttribute",{enumerable:!0,get:function(){return validateAttribute}}),Object.defineProperty(exports,"validateDraft",{enumerable:!0,get:function(){return validateDraft}}),Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:!0,get:function(){return validateDraftOrThrow}}),Object.defineProperty(exports,"validateObject",{enumerable:!0,get:function(){return validateObject}}),Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:!0,get:function(){return validateObjectOrThrow}});
@@ -1,4 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- import{ValidationError as e}from"./exceptions.mjs";import"./zod-locale.mjs";import{createTextValidator as t}from"./text-BaxaZ5Vv.mjs";import{DEFAULT_VALIDATION_MESSAGES as n,formatZodErrors as r}from"./core-rKI7Q9_U.mjs";import{createNumberValidator as i}from"./validation/primitives/number.mjs";import{createCheckboxValidator as a}from"./validation/primitives/checkbox.mjs";import{createDateValidator as o}from"./validation/primitives/date.mjs";import{createCurrencyValidator as s}from"./validation/complex/currency.mjs";import{createLocationValidator as c}from"./validation/complex/location.mjs";import{createPhoneValidator as l}from"./phone-BGJea5sr.mjs";import{createRelationValidator as u}from"./validation/complex/relation.mjs";import{createRichtextValidator as d}from"./validation/complex/richtext.mjs";import{createMultiselectValidator as f,createSelectValidator as p,createStatusValidator as m}from"./validation/complex/select.mjs";import{createUserValidator as h}from"./validation/complex/user.mjs";import{createFormulaValidator as g}from"./validation/computed/formula.mjs";import{createRollupValidator as _}from"./validation/computed/rollup.mjs";import*as v from"zod";function isNullishOrEmptyString(e){return e==null||e===``}function isValuePresent(e){return e==null?!1:typeof e==`string`?e.trim()!==``:!Array.isArray(e)||e.length>0}const y={phone:[`countryCode`]};function isEmptyValue(e,t=[]){return e==null||typeof e==`string`&&e.trim()===``?!0:e instanceof Date?!1:typeof e==`object`&&!Array.isArray(e)&&Object.entries(e).filter(([e])=>!t.includes(e)).every(([,e])=>e==null||typeof e==`string`&&e.trim()===``)}function withEmptyToNull(e,t){return v.preprocess(e=>isEmptyValue(e,t)?null:e,e.nullish())}function createAttributeValidator(e,r=n){switch(e.type){case`text`:return t(e,r);case`richtext`:return d(e,r);case`number`:return i(e,r);case`checkbox`:return a(e,r);case`date`:return o(e,r);case`phone`:return l(e,r);case`currency`:return s(e,r);case`status`:return m(e,r);case`location`:return c(e,r);case`select`:return p(e,r);case`multiselect`:return f(e,r);case`user`:return h(e,r);case`relation`:return u(e,r);case`formula`:return g(e,r);case`rollup`:return _(e,r);default:return v.unknown()}}function createFormAttributeValidator(e,t=n){let r=createAttributeValidator(e,t);return e.required?r:withEmptyToNull(r,y[e.type])}const b=new WeakMap,x=new WeakMap;function createObjectValidator(e){let t=b.get(e);if(t)return t;let r={};for(let t of e.attributes){let e=createAttributeValidator(t);t.required?r[t.name]=e.refine(isValuePresent,{message:n.required(t)}):r[t.name]=withEmptyToNull(e,y[t.type])}let i=v.object(r).passthrough();return b.set(e,i),i}function createDraftValidator(e){let t=x.get(e);if(t)return t;let n={};for(let t of e.attributes){let e=createAttributeValidator(t);n[t.name]=withEmptyToNull(e,y[t.type])}let r=v.object(n).passthrough();return x.set(e,r),r}function validateAttribute(e,t){let n=createAttributeValidator(e);if(!e.required&&t==null)return{success:!0,data:{[e.name]:t}};let i=n.safeParse(t);return i.success?{success:!0,data:{[e.name]:i.data}}:{success:!1,errors:r(i.error).map(t=>({path:[e.name,...t.path],message:t.message}))}}function validateObject(e,t){let n=createObjectValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r(n.error)}}function validateObjectOrThrow(t,n){let r=validateObject(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
3
- `)||`Unknown validation error`;throw new e(`Validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function validateDraft(e,t){let n=createDraftValidator(e).safeParse(t);return n.success?{success:!0,data:n.data}:{success:!1,errors:r(n.error)}}function validateDraftOrThrow(t,n){let r=validateDraft(t,n);if(!r.success){let n=r.errors??[],i=n.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`
4
- `)||`Unknown validation error`;throw new e(`Draft validation failed for ${t.label}:\n${i}`,n.map(e=>({path:e.path,message:e.message})))}return r.data}function rejectUnknownAttributesOrThrow(t,n){let r=new Set(t.attributes.map(e=>e.name)),i=Object.keys(n).filter(e=>!r.has(e));if(i.length>0)throw new e(`Unknown attribute${i.length>1?`s`:``} for ${t.label}: ${i.join(`, `)}`,i.map(e=>({path:[e],message:`Unknown attribute`})))}function getMissingRequiredAttributes(e,t){let n=[];for(let r of e.attributes)r.required&&!isValuePresent(t[r.name])&&n.push(r);return n}function isRecordComplete(e,t){return getMissingRequiredAttributes(e,t).length>0?!1:validateObject(e,t).success}export{createAttributeValidator,createDraftValidator,createFormAttributeValidator,createObjectValidator,getMissingRequiredAttributes,isEmptyValue,isNullishOrEmptyString,isRecordComplete,isValuePresent,rejectUnknownAttributesOrThrow,validateAttribute,validateDraft,validateDraftOrThrow,validateObject,validateObjectOrThrow};