@sanity/validation 6.13.1 → 6.13.2-next.3
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/lib/_internal.d.ts +13 -13
- package/package.json +5 -5
package/lib/_internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as LocaleSource, S as ValidationContext, _ as validateItem, b as ValidationMarkerCode, d as evaluateDocumentObservable, f as resolveTypeForArrayItem, h as validateDocumentObservable, m as validateDocumentInternal, n as ValidateDocumentInternalOptions, o as ValidateItemOptions, r as ValidateDocumentObservableOptions, u as evaluateDocumentInternal } from "./validateDocument-CdvFjlAk.js";
|
|
2
2
|
import { Path, Rule as Rule$1, RuleClass, Schema, SchemaType, SchemaValidationValue, ValidationContext as ValidationContext$1, ValidationError, ValidationMarker } from "@sanity/types";
|
|
3
|
-
declare function getFallbackLocaleSource(): LocaleSource;
|
|
4
|
-
declare const validationLocaleStrings: {
|
|
3
|
+
export declare function getFallbackLocaleSource(): LocaleSource;
|
|
4
|
+
export declare const validationLocaleStrings: {
|
|
5
5
|
readonly 'array.exact-length': 'Must have exactly {{wantedLength}} items';
|
|
6
6
|
readonly 'array.exact-length_blocks': 'Must have exactly {{wantedLength}} blocks';
|
|
7
7
|
readonly 'array.item-duplicate': "Can't be a duplicate";
|
|
@@ -46,9 +46,9 @@ declare const validationLocaleStrings: {
|
|
|
46
46
|
readonly 'string.url.not-absolute': 'Relative URLs are not allowed';
|
|
47
47
|
readonly 'string.url.not-relative': 'Only relative URLs are allowed';
|
|
48
48
|
};
|
|
49
|
-
declare function inferFromSchema(schema: Schema): Schema;
|
|
50
|
-
declare function inferFromSchemaType(typeDef: SchemaType, _schema: Schema, _visited?: Set<SchemaType>): SchemaType;
|
|
51
|
-
declare function inferFromSchemaType(typeDef: SchemaType): SchemaType;
|
|
49
|
+
export declare function inferFromSchema(schema: Schema): Schema;
|
|
50
|
+
export declare function inferFromSchemaType(typeDef: SchemaType, _schema: Schema, _visited?: Set<SchemaType>): SchemaType;
|
|
51
|
+
export declare function inferFromSchemaType(typeDef: SchemaType): SchemaType;
|
|
52
52
|
/**
|
|
53
53
|
* Checks if a validation function uses the context parameter.
|
|
54
54
|
*
|
|
@@ -60,7 +60,7 @@ declare function inferFromSchemaType(typeDef: SchemaType): SchemaType;
|
|
|
60
60
|
*
|
|
61
61
|
* @internal
|
|
62
62
|
*/
|
|
63
|
-
declare function hasValidationContext(validation: SchemaValidationValue | undefined): boolean;
|
|
63
|
+
export declare function hasValidationContext(validation: SchemaValidationValue | undefined): boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Concrete Rule implementation with validation logic.
|
|
66
66
|
* This extends the base Rule class from `@sanity/schema` and adds the validate method.
|
|
@@ -83,14 +83,14 @@ declare function hasValidationContext(validation: SchemaValidationValue | undefi
|
|
|
83
83
|
*
|
|
84
84
|
* @internal
|
|
85
85
|
*/
|
|
86
|
-
declare const Rule: RuleClass;
|
|
87
|
-
declare function convertToValidationMarker(validatorResult: true | true[] | string | string[] | ValidationError | ValidationError[], level: 'error' | 'warning' | 'info' | undefined, context: ValidationContext, fallback?: {
|
|
86
|
+
export declare const Rule: RuleClass;
|
|
87
|
+
export declare function convertToValidationMarker(validatorResult: true | true[] | string | string[] | ValidationError | ValidationError[], level: 'error' | 'warning' | 'info' | undefined, context: ValidationContext, fallback?: {
|
|
88
88
|
code: ValidationMarkerCode;
|
|
89
89
|
details?: Record<string, unknown>;
|
|
90
90
|
}): ValidationMarker[];
|
|
91
|
-
declare function getTypeChain(type: SchemaType | undefined, visited?: Set<SchemaType>): SchemaType[];
|
|
92
|
-
declare function normalizeValidationRules(typeDef: SchemaType | undefined, context?: ValidationContext$1): Rule$1[];
|
|
93
|
-
declare function pathToString(path?: Path | undefined): string;
|
|
94
|
-
declare function typeString(obj: unknown): string;
|
|
95
|
-
export { type LocaleSource,
|
|
91
|
+
export declare function getTypeChain(type: SchemaType | undefined, visited?: Set<SchemaType>): SchemaType[];
|
|
92
|
+
export declare function normalizeValidationRules(typeDef: SchemaType | undefined, context?: ValidationContext$1): Rule$1[];
|
|
93
|
+
export declare function pathToString(path?: Path | undefined): string;
|
|
94
|
+
export declare function typeString(obj: unknown): string;
|
|
95
|
+
export { type LocaleSource, type ValidateDocumentInternalOptions, type ValidateDocumentObservableOptions, type ValidateItemOptions, type ValidationContext, evaluateDocumentInternal, evaluateDocumentObservable, resolveTypeForArrayItem, validateDocumentInternal, validateDocumentObservable, validateItem };
|
|
96
96
|
//# sourceMappingURL=_internal.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/validation",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.2-next.3",
|
|
4
4
|
"description": "Document validation for Sanity schemas",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@sanity/client": "^8.6.1",
|
|
46
46
|
"@sanity/id-utils": "^1.1.0",
|
|
47
|
-
"@sanity/schema": "6.13.
|
|
48
|
-
"@sanity/types": "6.13.
|
|
49
|
-
"@sanity/util": "6.13.
|
|
47
|
+
"@sanity/schema": "6.13.2-next.3+54095cc4db",
|
|
48
|
+
"@sanity/types": "6.13.2-next.3+54095cc4db",
|
|
49
|
+
"@sanity/util": "6.13.2-next.3+54095cc4db",
|
|
50
50
|
"dequal": "^2.0.3",
|
|
51
51
|
"i18next": "^26.4.1",
|
|
52
52
|
"lodash-es": "^4.18.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@repo/tsdown.config": "6.9.2",
|
|
59
59
|
"@types/lodash-es": "^4.17.12",
|
|
60
60
|
"@types/react": "^19.2.18",
|
|
61
|
-
"tsdown": "^0.
|
|
61
|
+
"tsdown": "^0.23.0",
|
|
62
62
|
"typescript": "^7.0.2",
|
|
63
63
|
"vite": "^8.2.2",
|
|
64
64
|
"vitest": "^4.1.11"
|