@sanity/types 6.12.0-next.68 → 6.12.0-next.75

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 (2) hide show
  1. package/lib/index.d.ts +16 -0
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -174,6 +174,15 @@ interface User {
174
174
  /** @public */
175
175
  interface ValidationMarker {
176
176
  level: 'error' | 'warning' | 'info';
177
+ /**
178
+ * A machine-readable identifier for the validation failure.
179
+ *
180
+ * Built-in validators use stable codes exported by `@sanity/validation`.
181
+ * Custom validators may provide their own code.
182
+ */
183
+ code?: string;
184
+ /** Structured information about the validation failure. */
185
+ details?: Record<string, unknown>;
177
186
  /**
178
187
  * The validation message for this marker. E.g. "Must be greater than 0"
179
188
  */
@@ -586,6 +595,13 @@ interface ValidationErrorClass {
586
595
  * @public
587
596
  */
588
597
  interface ValidationError {
598
+ /**
599
+ * A machine-readable identifier for the validation failure.
600
+ * Custom validators should namespace custom codes, for example `custom.seo-title`.
601
+ */
602
+ code?: string;
603
+ /** Structured information about the validation failure. */
604
+ details?: Record<string, unknown>;
589
605
  /**
590
606
  * The message describing why the value is not valid. This message will be
591
607
  * included in the validation markers after validation has finished running.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/types",
3
- "version": "6.12.0-next.68",
3
+ "version": "6.12.0-next.75",
4
4
  "description": "Type definitions for common Sanity data structures",
5
5
  "keywords": [
6
6
  "cms",