@sjsf/zod-validator 1.9.2 → 2.0.0-next.0
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/README.md +6 -7
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +35 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/validator.d.ts +24 -28
- package/dist/validator.d.ts.map +1 -1
- package/dist/validator.js +62 -64
- package/dist/validator.js.map +1 -1
- package/package.json +6 -10
- package/dist/augmentation.d.ts +0 -11
- package/dist/augmentation.d.ts.map +0 -1
- package/dist/augmentation.js +0 -26
- package/dist/augmentation.js.map +0 -1
- package/dist/factory.d.ts +0 -6
- package/dist/factory.d.ts.map +0 -1
- package/dist/factory.js +0 -8
- package/dist/factory.js.map +0 -1
- package/dist/shared.d.ts +0 -5
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -23
- package/dist/shared.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ npm install @sjsf/zod-validator zod zod-to-json-schema json-schema-to-zod
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { createForm, type Schema } from '@sjsf/form'
|
|
18
|
+
import { createFormValidator } from "@sjsf/zod-validator";
|
|
19
19
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
|
|
@@ -23,13 +23,12 @@ const schema = z.object({
|
|
|
23
23
|
/* your schema */
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const validator =
|
|
27
|
-
schema,
|
|
28
|
-
});
|
|
26
|
+
const validator = createFormValidator(schema);
|
|
29
27
|
|
|
30
|
-
const form =
|
|
28
|
+
const form = createForm({
|
|
31
29
|
schema: zodToJsonSchema(schema) as Schema,
|
|
32
|
-
validator
|
|
30
|
+
validator,
|
|
31
|
+
...
|
|
33
32
|
})
|
|
34
33
|
```
|
|
35
34
|
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Config, type PathToIdOptions, type UiSchemaRoot, type ValidationError } from "@sjsf/form";
|
|
2
|
+
import type { z, ZodIssue } from "zod";
|
|
3
|
+
export interface ErrorsTransformerOptions extends PathToIdOptions {
|
|
4
|
+
uiSchema?: UiSchemaRoot;
|
|
5
|
+
}
|
|
6
|
+
export declare function createErrorsTransformer(options: ErrorsTransformerOptions): (result: z.SafeParseReturnType<any, any>) => ValidationError<ZodIssue>[];
|
|
7
|
+
export declare function transformFieldErrors(config: Config, result: z.SafeParseReturnType<any, any>): ValidationError<ZodIssue>[];
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEvC,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,IAErE,QAAQ,CAAC,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,KACtC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAoB/B;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,GACtC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAY7B"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getValueByPath } from "@sjsf/form/lib/object";
|
|
2
|
+
import { pathToId, } from "@sjsf/form";
|
|
3
|
+
export function createErrorsTransformer(options) {
|
|
4
|
+
return (result) => {
|
|
5
|
+
if (result.success) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
return result.error.issues.map((issue) => {
|
|
9
|
+
const instanceId = pathToId(issue.path, options);
|
|
10
|
+
const propertyTitle = getValueByPath(options.uiSchema, issue.path)?.["ui:options"]?.title ??
|
|
11
|
+
issue.path[issue.path.length - 1] ??
|
|
12
|
+
instanceId;
|
|
13
|
+
return {
|
|
14
|
+
instanceId,
|
|
15
|
+
propertyTitle: String(propertyTitle),
|
|
16
|
+
message: issue.message,
|
|
17
|
+
error: issue,
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function transformFieldErrors(config, result) {
|
|
23
|
+
if (result.success) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
return result.error.issues.map((issue) => {
|
|
27
|
+
return {
|
|
28
|
+
instanceId: config.id,
|
|
29
|
+
propertyTitle: config.title,
|
|
30
|
+
message: issue.message,
|
|
31
|
+
error: issue,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,QAAQ,GAMT,MAAM,YAAY,CAAC;AAOpB,MAAM,UAAU,uBAAuB,CAAC,OAAiC;IACvE,OAAO,CACL,MAAuC,EACV,EAAE;QAC/B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACjD,MAAM,aAAa,GACjB,cAAc,CAA0B,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CACrE,YAAY,CACb,EAAE,KAAK;gBACR,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBACjC,UAAU,CAAC;YACb,OAAO;gBACL,UAAU;gBACV,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;gBACpC,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,KAAK,EAAE,KAAK;aACb,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,MAAuC;IAEvC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACvC,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,EAAE;YACrB,aAAa,EAAE,MAAM,CAAC,KAAK;YAC3B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
package/dist/validator.d.ts
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import { type SchemaDefinition } from "@sjsf/form/core";
|
|
2
|
-
import { type Config, type FormValidator2, type Schema, type SchemaValue, type UiSchemaRoot, type ValidationError } from "@sjsf/form";
|
|
3
1
|
import { z, type ZodIssue, type ZodSchema } from "zod";
|
|
2
|
+
import { type Schema, type Validator } from "@sjsf/form/core";
|
|
3
|
+
import { type AsyncFieldValueValidator, type AsyncFormValueValidator, type Config, type FieldValueValidator, type FormValueValidator } from "@sjsf/form";
|
|
4
|
+
import { type ErrorsTransformerOptions } from "./errors.js";
|
|
4
5
|
export declare function evalZodSchema(schema: Schema): any;
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export interface ValidatorOptions
|
|
8
|
-
|
|
9
|
-
schema: ZodSchema;
|
|
10
|
-
uiSchema?: UiSchemaRoot;
|
|
11
|
-
idPrefix?: string;
|
|
12
|
-
idSeparator?: string;
|
|
13
|
-
zodSchemaFactory?: (schema: Schema, rootSchema: Schema) => ZodSchema;
|
|
14
|
-
fieldZodSchemaFactory?: (config: Config) => ZodSchema;
|
|
6
|
+
export declare function createZodSchemaFactory(): (schema: Schema, rootSchema: Schema) => z.ZodType<any, z.ZodTypeDef, any>;
|
|
7
|
+
export declare function createFieldZodSchemaFactory(): (config: Config) => z.ZodType<any, z.ZodTypeDef, any>;
|
|
8
|
+
export interface ValidatorOptions {
|
|
9
|
+
createZodSchema: (schema: Schema, rootSchema: Schema) => ZodSchema;
|
|
15
10
|
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
protected readonly zodSchema: ZodSchema;
|
|
20
|
-
protected readonly uiSchema: UiSchemaRoot;
|
|
21
|
-
protected readonly idPrefix: string;
|
|
22
|
-
protected readonly idSeparator: string;
|
|
23
|
-
protected readonly zodSchemaFactory: (schema: Schema, rootSchema: Schema) => ZodSchema;
|
|
24
|
-
protected readonly fieldZodSchemaFactory: (config: Config) => ZodSchema;
|
|
25
|
-
protected readonly transformFormDataValidationResult: (result: z.SafeParseReturnType<any, any>) => ValidationError<ZodIssue>[];
|
|
26
|
-
constructor({ async, schema, uiSchema, idPrefix, idSeparator, zodSchemaFactory, fieldZodSchemaFactory, }: ValidatorOptions<Async>);
|
|
27
|
-
validateFieldData(config: Config, fieldData: SchemaValue | undefined): ValidationResult<Async>;
|
|
28
|
-
isValid(schema: SchemaDefinition, rootSchema: Schema, formData: SchemaValue | undefined): boolean;
|
|
29
|
-
reset(): void;
|
|
30
|
-
validateFormData(_rootSchema: Schema, formData: SchemaValue | undefined): ValidationResult<Async>;
|
|
31
|
-
protected transformFieldDataValidationResult: (result: z.SafeParseReturnType<any, any>, config: Config) => ValidationError<ZodIssue>[];
|
|
11
|
+
export declare function createValidator({ createZodSchema, }: ValidatorOptions): Validator;
|
|
12
|
+
export interface FormValueValidatorOptions extends ErrorsTransformerOptions {
|
|
13
|
+
zodSchema: ZodSchema;
|
|
32
14
|
}
|
|
15
|
+
export declare function createFormValueValidator(options: FormValueValidatorOptions): FormValueValidator<ZodIssue>;
|
|
16
|
+
export declare function createAsyncFormValueValidator(options: FormValueValidatorOptions): AsyncFormValueValidator<ZodIssue>;
|
|
17
|
+
export interface FieldValueValidatorOptions {
|
|
18
|
+
createFieldZodSchema: (config: Config) => ZodSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare function createFieldValueValidator({ createFieldZodSchema, }: FieldValueValidatorOptions): FieldValueValidator<ZodIssue>;
|
|
21
|
+
export declare function createAsyncFieldValueValidator({ createFieldZodSchema, }: FieldValueValidatorOptions): AsyncFieldValueValidator<ZodIssue>;
|
|
22
|
+
export interface FormValidatorOptions extends ValidatorOptions, FormValueValidatorOptions, FieldValueValidatorOptions {
|
|
23
|
+
}
|
|
24
|
+
export type ZodFormValidator = Validator & FormValueValidator<ZodIssue> & FieldValueValidator<ZodIssue>;
|
|
25
|
+
export type AsyncZodFormValidator = Validator & AsyncFormValueValidator<ZodIssue> & AsyncFieldValueValidator<ZodIssue>;
|
|
26
|
+
export declare function createFormValidator<Async extends boolean = false>(zodSchema: ZodSchema, { async, createZodSchema, createFieldZodSchema, ...rest }?: Partial<Omit<FormValidatorOptions, "zodSchema">> & {
|
|
27
|
+
async?: Async;
|
|
28
|
+
}): Async extends true ? AsyncZodFormValidator : ZodFormValidator;
|
|
33
29
|
//# sourceMappingURL=validator.d.ts.map
|
package/dist/validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAEvD,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,aAAa,CAAC;AAKrB,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,OAE3C;AAED,wBAAgB,sBAAsB,KAM5B,QAAQ,MAAM,EAAE,YAAY,MAAM,uCAO3C;AAED,wBAAgB,2BA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I,EACR,GAAE,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC,GAAG;IACpD,KAAK,CAAC,EAAE,KAAK,CAAC;CACV,GAqBD,KAAK,SAAS,IAAI,GAAG,qBAAqB,GAAG,gBAAgB,CACnE"}
|
package/dist/validator.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { resolveAllReferences } from "@sjsf/form/core";
|
|
2
|
-
import { DEFAULT_ID_PREFIX, DEFAULT_ID_SEPARATOR, } from "@sjsf/form";
|
|
3
1
|
import { z } from "zod";
|
|
4
|
-
import { jsonSchemaToZod } from "json-schema-to-zod";
|
|
5
2
|
import { weakMemoize } from "@sjsf/form/lib/memoize";
|
|
6
|
-
import {
|
|
3
|
+
import { resolveAllReferences, } from "@sjsf/form/core";
|
|
4
|
+
import {} from "@sjsf/form";
|
|
5
|
+
import { jsonSchemaToZod } from "json-schema-to-zod";
|
|
6
|
+
import { createErrorsTransformer, transformFieldErrors, } from "./errors.js";
|
|
7
7
|
const FIELD_REQUIRED = ["field"];
|
|
8
8
|
const FIELD_NOT_REQUIRED = [];
|
|
9
9
|
export function evalZodSchema(schema) {
|
|
10
10
|
return new Function("z", `return ${jsonSchemaToZod(schema)}`)(z);
|
|
11
11
|
}
|
|
12
|
-
export function
|
|
12
|
+
export function createZodSchemaFactory() {
|
|
13
13
|
const cache = new WeakMap();
|
|
14
14
|
let lastRootSchema;
|
|
15
15
|
const factory = weakMemoize(cache, (schema) => evalZodSchema(resolveAllReferences(schema, lastRootSchema)));
|
|
@@ -21,7 +21,7 @@ export function makeZodSchemaFactory() {
|
|
|
21
21
|
return factory(schema);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export function
|
|
24
|
+
export function createFieldZodSchemaFactory() {
|
|
25
25
|
const cache = new WeakMap();
|
|
26
26
|
const requiredCache = new WeakMap();
|
|
27
27
|
let isRequired = false;
|
|
@@ -42,64 +42,62 @@ export function makeFieldZodSchemaFactory() {
|
|
|
42
42
|
return factory(config.schema);
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
instanceId: config.idSchema.$id,
|
|
98
|
-
propertyTitle: config.title,
|
|
99
|
-
message: issue.message,
|
|
100
|
-
error: issue,
|
|
101
|
-
};
|
|
102
|
-
});
|
|
45
|
+
export function createValidator({ createZodSchema, }) {
|
|
46
|
+
return {
|
|
47
|
+
isValid(schema, rootSchema, formValue) {
|
|
48
|
+
if (typeof schema === "boolean") {
|
|
49
|
+
return schema;
|
|
50
|
+
}
|
|
51
|
+
const zodSchema = createZodSchema(schema, rootSchema);
|
|
52
|
+
return zodSchema.safeParse(formValue).success;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function createFormValueValidator(options) {
|
|
57
|
+
return {
|
|
58
|
+
validateFormValue(_, formValue) {
|
|
59
|
+
const transform = createErrorsTransformer(options);
|
|
60
|
+
return transform(options.zodSchema.safeParse(formValue));
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function createAsyncFormValueValidator(options) {
|
|
65
|
+
return {
|
|
66
|
+
async validateFormValueAsync(_signal, _rootSchema, formValue) {
|
|
67
|
+
const transform = createErrorsTransformer(options);
|
|
68
|
+
const result = await options.zodSchema.safeParseAsync(formValue);
|
|
69
|
+
return transform(result);
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function createFieldValueValidator({ createFieldZodSchema, }) {
|
|
74
|
+
return {
|
|
75
|
+
validateFieldValue(config, fieldValue) {
|
|
76
|
+
const schema = createFieldZodSchema(config);
|
|
77
|
+
const result = schema.safeParse({ field: fieldValue });
|
|
78
|
+
return transformFieldErrors(config, result);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export function createAsyncFieldValueValidator({ createFieldZodSchema, }) {
|
|
83
|
+
return {
|
|
84
|
+
async validateFieldValueAsync(_signal, config, fieldValue) {
|
|
85
|
+
const schema = createFieldZodSchema(config);
|
|
86
|
+
const result = await schema.safeParseAsync(fieldValue);
|
|
87
|
+
return transformFieldErrors(config, result);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function createFormValidator(zodSchema, { async, createZodSchema = createZodSchemaFactory(), createFieldZodSchema = createFieldZodSchemaFactory(), ...rest } = {}) {
|
|
92
|
+
const options = {
|
|
93
|
+
...rest,
|
|
94
|
+
zodSchema,
|
|
95
|
+
createZodSchema,
|
|
96
|
+
createFieldZodSchema,
|
|
103
97
|
};
|
|
98
|
+
const validator = createValidator(options);
|
|
99
|
+
return (async
|
|
100
|
+
? Object.assign(validator, createAsyncFormValueValidator(options), createAsyncFieldValueValidator(options))
|
|
101
|
+
: Object.assign(validator, createFormValueValidator(options), createFieldValueValidator(options)));
|
|
104
102
|
}
|
|
105
103
|
//# sourceMappingURL=validator.js.map
|
package/dist/validator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiC,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,oBAAoB,GAGrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAMN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAErB,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC,CAAC;AACjC,MAAM,kBAAkB,GAAa,EAAE,CAAC;AAExC,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,UAAU,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,KAAK,GAAG,IAAI,OAAO,EAAqB,CAAC;IAC/C,IAAI,cAAsB,CAAC;IAC3B,MAAM,OAAO,GAAG,WAAW,CAAoB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAC/D,aAAa,CAAC,oBAAoB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAC5D,CAAC;IACF,OAAO,CAAC,MAAc,EAAE,UAAkB,EAAE,EAAE;QAC5C,IAAI,cAAc,KAAK,UAAU,EAAE,CAAC;YAClC,cAAc,GAAG,UAAU,CAAC;YAC5B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B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AC;AACJ,CAAC;AAeD,MAAM,UAAU,mBAAmB,CACjC,SAAoB,EACpB,EACE,KAAK,EACL,eAAe,GAAG,sBAAsB,EAAE,EAC1C,oBAAoB,GAAG,2BAA2B,EAAE,EACpD,GAAG,IAAI,KAGL,EAAE;IAEN,MAAM,OAAO,GAAyB;QACpC,GAAG,IAAI;QACP,SAAS;QACT,eAAe;QACf,oBAAoB;KACrB,CAAC;IACF,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,CACL,KAAK;QACH,CAAC,CAAE,MAAM,CAAC,MAAM,CACZ,SAAS,EACT,6BAA6B,CAAC,OAAO,CAAC,EACtC,8BAA8B,CAAC,OAAO,CAAC,CACP;QACpC,CAAC,CAAE,MAAM,CAAC,MAAM,CACZ,SAAS,EACT,wBAAwB,CAAC,OAAO,CAAC,EACjC,yBAAyB,CAAC,OAAO,CAAC,CACP,CAC+B,CAAC;AACrE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjsf/zod-validator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.0",
|
|
4
4
|
"description": "The zod based validator for svelte-jsonschema-form",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -30,21 +30,17 @@
|
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"svelte": "./dist/index.js"
|
|
33
|
-
},
|
|
34
|
-
"./augmentation": {
|
|
35
|
-
"types": "./dist/augmentation.d.ts",
|
|
36
|
-
"svelte": "./dist/augmentation.js"
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
35
|
"peerDependencies": {
|
|
40
|
-
"@sjsf/form": "^
|
|
41
|
-
"zod": "^3.
|
|
42
|
-
"json-schema-to-zod": "^2.
|
|
36
|
+
"@sjsf/form": "^2.0.0-next.0",
|
|
37
|
+
"zod": "^3.24.2",
|
|
38
|
+
"json-schema-to-zod": "^2.6.0"
|
|
43
39
|
},
|
|
44
40
|
"devDependencies": {
|
|
45
|
-
"zod": "^3.24.
|
|
41
|
+
"zod": "^3.24.2",
|
|
46
42
|
"json-schema-to-zod": "^2.6.0",
|
|
47
|
-
"@sjsf/form": "
|
|
43
|
+
"@sjsf/form": "2.0.0-next.0"
|
|
48
44
|
},
|
|
49
45
|
"scripts": {
|
|
50
46
|
"build": "tsc && publint",
|
package/dist/augmentation.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type FormValidator2, type UiSchemaRoot } from "@sjsf/form";
|
|
2
|
-
import type { ZodIssue, ZodSchema } from "zod";
|
|
3
|
-
export interface ZodOptions {
|
|
4
|
-
async?: boolean;
|
|
5
|
-
schema: ZodSchema;
|
|
6
|
-
uiSchema?: UiSchemaRoot;
|
|
7
|
-
idPrefix?: string;
|
|
8
|
-
idSeparator?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function withZod<E>(validator: FormValidator2<E>, { schema: zodSchema, uiSchema, idPrefix, idSeparator, async, }: ZodOptions): FormValidator2<E | ZodIssue>;
|
|
11
|
-
//# sourceMappingURL=augmentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"augmentation.d.ts","sourceRoot":"","sources":["../src/augmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAI/C,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,CAAC,EACvB,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,EAC5B,EACE,MAAM,EAAE,SAAS,EACjB,QAAa,EACb,QAA4B,EAC5B,WAAkC,EAClC,KAAa,GACd,EAAE,UAAU,GACZ,cAAc,CAAC,CAAC,GAAG,QAAQ,CAAC,CAuB9B"}
|
package/dist/augmentation.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ID_PREFIX, DEFAULT_ID_SEPARATOR, } from "@sjsf/form";
|
|
2
|
-
import { makeFormDataValidationResultTransformer } from "./shared.js";
|
|
3
|
-
export function withZod(validator, { schema: zodSchema, uiSchema = {}, idPrefix = DEFAULT_ID_PREFIX, idSeparator = DEFAULT_ID_SEPARATOR, async = false, }) {
|
|
4
|
-
const transformFormDataValidationResult = makeFormDataValidationResultTransformer(idPrefix, idSeparator, uiSchema);
|
|
5
|
-
return {
|
|
6
|
-
isValid(schema, rootSchema, formData) {
|
|
7
|
-
return validator.isValid(schema, rootSchema, formData);
|
|
8
|
-
},
|
|
9
|
-
validateFieldData(field, fieldData, signal) {
|
|
10
|
-
return validator.validateFieldData(field, fieldData, signal);
|
|
11
|
-
},
|
|
12
|
-
reset() {
|
|
13
|
-
validator.reset();
|
|
14
|
-
},
|
|
15
|
-
validateFormData(_rootSchema, formData) {
|
|
16
|
-
if (async) {
|
|
17
|
-
return zodSchema
|
|
18
|
-
.safeParseAsync(formData)
|
|
19
|
-
.then(transformFormDataValidationResult);
|
|
20
|
-
}
|
|
21
|
-
const result = zodSchema.safeParse(formData);
|
|
22
|
-
return transformFormDataValidationResult(result);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=augmentation.js.map
|
package/dist/augmentation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"augmentation.js","sourceRoot":"","sources":["../src/augmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAC;AAUtE,MAAM,UAAU,OAAO,CACrB,SAA4B,EAC5B,EACE,MAAM,EAAE,SAAS,EACjB,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,iBAAiB,EAC5B,WAAW,GAAG,oBAAoB,EAClC,KAAK,GAAG,KAAK,GACF;IAEb,MAAM,iCAAiC,GACrC,uCAAuC,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC3E,OAAO;QACL,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ;YAClC,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QACzD,CAAC;QACD,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM;YACxC,OAAO,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;QACD,KAAK;YACH,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;QACD,gBAAgB,CAAC,WAAW,EAAE,QAAQ;YACpC,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,SAAS;qBACb,cAAc,CAAC,QAAQ,CAAC;qBACxB,IAAI,CAAC,iCAAiC,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,iCAAiC,CAAC,MAAM,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/factory.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Validator, type ValidatorOptions } from "./validator.js";
|
|
2
|
-
export type ValidatorFactoryOptions<Async extends boolean> = Omit<ValidatorOptions<Async>, "async"> & {
|
|
3
|
-
async?: Async;
|
|
4
|
-
};
|
|
5
|
-
export declare function createValidator<Async extends boolean = false>(options: ValidatorFactoryOptions<Async>): Validator<false | Async>;
|
|
6
|
-
//# sourceMappingURL=factory.d.ts.map
|
package/dist/factory.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,uBAAuB,CAAC,KAAK,SAAS,OAAO,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IACpG,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,uBAAuB,CAAC,KAAK,CAAC,4BAKrG"}
|
package/dist/factory.js
DELETED
package/dist/factory.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAMlE,MAAM,UAAU,eAAe,CAAgC,OAAuC;IACpG,OAAO,IAAI,SAAS,CAAC;QACnB,GAAG,OAAO;QACV,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
package/dist/shared.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type FieldErrors, type UiSchemaRoot, type ValidationError } from "@sjsf/form";
|
|
2
|
-
import type { z, ZodIssue } from "zod";
|
|
3
|
-
export declare const NO_ERRORS: FieldErrors<ZodIssue>;
|
|
4
|
-
export declare function makeFormDataValidationResultTransformer(idPrefix: string, idSeparator: string, uiSchema: UiSchemaRoot): (result: z.SafeParseReturnType<any, any>) => ValidationError<ZodIssue>[];
|
|
5
|
-
//# sourceMappingURL=shared.d.ts.map
|
package/dist/shared.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEvC,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAM,CAAC;AAEnD,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,YAAY,YAGZ,CAAC,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,KACtC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAkB/B"}
|
package/dist/shared.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { getValueByPath } from "@sjsf/form/lib/object";
|
|
2
|
-
import { pathToId, } from "@sjsf/form";
|
|
3
|
-
export const NO_ERRORS = [];
|
|
4
|
-
export function makeFormDataValidationResultTransformer(idPrefix, idSeparator, uiSchema) {
|
|
5
|
-
return (result) => {
|
|
6
|
-
if (result.success) {
|
|
7
|
-
return NO_ERRORS;
|
|
8
|
-
}
|
|
9
|
-
return result.error.issues.map((issue) => {
|
|
10
|
-
const instanceId = pathToId(idPrefix, idSeparator, issue.path);
|
|
11
|
-
const propertyTitle = getValueByPath(uiSchema, issue.path)?.["ui:options"]?.title ??
|
|
12
|
-
issue.path[issue.path.length - 1] ??
|
|
13
|
-
instanceId;
|
|
14
|
-
return {
|
|
15
|
-
instanceId,
|
|
16
|
-
propertyTitle,
|
|
17
|
-
message: issue.message,
|
|
18
|
-
error: issue,
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=shared.js.map
|
package/dist/shared.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,QAAQ,GAIT,MAAM,YAAY,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAA0B,EAAE,CAAC;AAEnD,MAAM,UAAU,uCAAuC,CACrD,QAAgB,EAChB,WAAmB,EACnB,QAAsB;IAEtB,OAAO,CACL,MAAuC,EACV,EAAE;QAC/B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/D,MAAM,aAAa,GACjB,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK;gBAC3D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBACjC,UAAU,CAAC;YACb,OAAO;gBACL,UAAU;gBACV,aAAa;gBACb,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,KAAK,EAAE,KAAK;aACb,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|