@forklaunch/validator 0.9.3 → 0.9.5
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/__test__/utils/mockSchemaValidator.d.mts +1 -1
- package/lib/__test__/utils/mockSchemaValidator.d.ts +1 -1
- package/lib/index.d.mts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/{schema.types-DHEcC_qy.d.mts → schema.types-wl77iEsE.d.mts} +4 -4
- package/lib/{schema.types-DHEcC_qy.d.ts → schema.types-wl77iEsE.d.ts} +4 -4
- package/lib/src/typebox/index.d.mts +2 -2
- package/lib/src/typebox/index.d.ts +2 -2
- package/lib/src/typebox/index.js +42 -10
- package/lib/src/typebox/index.mjs +42 -10
- package/lib/src/zod/index.d.mts +2 -2
- package/lib/src/zod/index.d.ts +2 -2
- package/lib/src/zod/index.js +5 -5
- package/lib/src/zod/index.mjs +5 -5
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
2
|
-
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-
|
|
2
|
+
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-wl77iEsE.mjs';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import '@sinclair/typebox/compiler';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
2
|
-
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-
|
|
2
|
+
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-wl77iEsE.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import '@sinclair/typebox/compiler';
|
package/lib/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ParseError } from './schema.types-
|
|
2
|
-
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-
|
|
1
|
+
import { P as ParseError } from './schema.types-wl77iEsE.mjs';
|
|
2
|
+
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-wl77iEsE.mjs';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import 'openapi3-ts/oas31';
|
|
5
5
|
import '@sinclair/typebox';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ParseError } from './schema.types-
|
|
2
|
-
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-
|
|
1
|
+
import { P as ParseError } from './schema.types-wl77iEsE.js';
|
|
2
|
+
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-wl77iEsE.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import 'openapi3-ts/oas31';
|
|
5
5
|
import '@sinclair/typebox';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Prettify } from '@forklaunch/common';
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import { TTransform, TAny, TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TUnknown, TNever, TKind, TObject, StaticDecode } from '@sinclair/typebox';
|
|
3
|
+
import { TTransform, TAny, TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TUnknown, TNever, TUnsafe, TKind, TObject, StaticDecode } from '@sinclair/typebox';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
5
|
import { ZodType, ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod/v3';
|
|
6
6
|
|
|
@@ -39,8 +39,8 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T>() => TTrans
|
|
|
39
39
|
any: TAny;
|
|
40
40
|
unknown: TUnknown;
|
|
41
41
|
never: TNever;
|
|
42
|
-
binary: TTransform<TString, Uint8Array
|
|
43
|
-
file: TTransform<
|
|
42
|
+
binary: TTransform<TString, Uint8Array<ArrayBuffer>>;
|
|
43
|
+
file: TTransform<TUnsafe<Buffer<ArrayBuffer>>, Blob>;
|
|
44
44
|
type: <T>() => TTransform<TAny, T>;
|
|
45
45
|
/**
|
|
46
46
|
* Extracts the error type of a schema for error messages.
|
|
@@ -251,7 +251,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T>() => ZodType<T>
|
|
|
251
251
|
unknown: z.ZodUnknown;
|
|
252
252
|
never: z.ZodNever;
|
|
253
253
|
binary: z.ZodEffects<z.ZodString, Uint8Array<ArrayBuffer>, string>;
|
|
254
|
-
file: z.ZodEffects<z.
|
|
254
|
+
file: z.ZodEffects<z.ZodType<Buffer<ArrayBuffer>, z.ZodTypeDef, Buffer<ArrayBuffer>>, Blob, Buffer<ArrayBuffer>>;
|
|
255
255
|
type: <T>() => ZodType<T>;
|
|
256
256
|
/**
|
|
257
257
|
* Compiles schema if this exists, for optimal performance.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Prettify } from '@forklaunch/common';
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import { TTransform, TAny, TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TUnknown, TNever, TKind, TObject, StaticDecode } from '@sinclair/typebox';
|
|
3
|
+
import { TTransform, TAny, TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TUnknown, TNever, TUnsafe, TKind, TObject, StaticDecode } from '@sinclair/typebox';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
5
|
import { ZodType, ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod/v3';
|
|
6
6
|
|
|
@@ -39,8 +39,8 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T>() => TTrans
|
|
|
39
39
|
any: TAny;
|
|
40
40
|
unknown: TUnknown;
|
|
41
41
|
never: TNever;
|
|
42
|
-
binary: TTransform<TString, Uint8Array
|
|
43
|
-
file: TTransform<
|
|
42
|
+
binary: TTransform<TString, Uint8Array<ArrayBuffer>>;
|
|
43
|
+
file: TTransform<TUnsafe<Buffer<ArrayBuffer>>, Blob>;
|
|
44
44
|
type: <T>() => TTransform<TAny, T>;
|
|
45
45
|
/**
|
|
46
46
|
* Extracts the error type of a schema for error messages.
|
|
@@ -251,7 +251,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T>() => ZodType<T>
|
|
|
251
251
|
unknown: z.ZodUnknown;
|
|
252
252
|
never: z.ZodNever;
|
|
253
253
|
binary: z.ZodEffects<z.ZodString, Uint8Array<ArrayBuffer>, string>;
|
|
254
|
-
file: z.ZodEffects<z.
|
|
254
|
+
file: z.ZodEffects<z.ZodType<Buffer<ArrayBuffer>, z.ZodTypeDef, Buffer<ArrayBuffer>>, Blob, Buffer<ArrayBuffer>>;
|
|
255
255
|
type: <T>() => ZodType<T>;
|
|
256
256
|
/**
|
|
257
257
|
* Compiles schema if this exists, for optimal performance.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@sinclair/typebox';
|
|
2
|
-
import { T as TypeboxSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-
|
|
2
|
+
import { T as TypeboxSchemaValidator } from '../../schema.types-wl77iEsE.mjs';
|
|
3
|
+
export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-wl77iEsE.mjs';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox/compiler';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@sinclair/typebox';
|
|
2
|
-
import { T as TypeboxSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-
|
|
2
|
+
import { T as TypeboxSchemaValidator } from '../../schema.types-wl77iEsE.js';
|
|
3
|
+
export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-wl77iEsE.js';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox/compiler';
|
package/lib/src/typebox/index.js
CHANGED
|
@@ -92,7 +92,7 @@ var TypeboxSchemaValidator = class {
|
|
|
92
92
|
title: "UUID"
|
|
93
93
|
});
|
|
94
94
|
email = import_typebox.Type.String({
|
|
95
|
-
pattern:
|
|
95
|
+
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
|
96
96
|
errorType: "email",
|
|
97
97
|
example: "a@b.com",
|
|
98
98
|
title: "Email"
|
|
@@ -247,23 +247,25 @@ var TypeboxSchemaValidator = class {
|
|
|
247
247
|
import_typebox.Type.String({
|
|
248
248
|
errorType: "binary",
|
|
249
249
|
format: "binary",
|
|
250
|
-
example: "a
|
|
250
|
+
example: "a base-64 encodable string",
|
|
251
251
|
title: "Binary"
|
|
252
252
|
})
|
|
253
|
-
).Decode((value) => new
|
|
254
|
-
if (value instanceof
|
|
253
|
+
).Decode((value) => new Uint8Array(Buffer.from(value, "base64"))).Encode((value) => {
|
|
254
|
+
if (value instanceof Buffer) {
|
|
255
255
|
return String.fromCharCode(...new Uint8Array(value));
|
|
256
256
|
}
|
|
257
257
|
return "";
|
|
258
258
|
});
|
|
259
259
|
file = import_typebox.Type.Transform(
|
|
260
|
-
import_typebox.Type.
|
|
260
|
+
import_typebox.Type.Unsafe({
|
|
261
261
|
errorType: "binary",
|
|
262
262
|
format: "binary",
|
|
263
|
-
example: "a
|
|
263
|
+
example: "a raw buffer or file stream",
|
|
264
264
|
title: "File"
|
|
265
265
|
})
|
|
266
|
-
).Decode((value) =>
|
|
266
|
+
).Decode((value) => {
|
|
267
|
+
return new import_common.InMemoryBlob(value);
|
|
268
|
+
}).Encode((value) => value.content);
|
|
267
269
|
type = () => this.any;
|
|
268
270
|
/**
|
|
269
271
|
* Extracts the error type of a schema for error messages.
|
|
@@ -450,10 +452,40 @@ var TypeboxSchemaValidator = class {
|
|
|
450
452
|
}
|
|
451
453
|
} else {
|
|
452
454
|
const schemified = this.schemify(schema);
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
+
if (schemified[import_typebox.Kind] === "Unsafe") {
|
|
456
|
+
try {
|
|
457
|
+
if (value instanceof Buffer) {
|
|
458
|
+
conversion = new import_common.InMemoryBlob(value);
|
|
459
|
+
} else {
|
|
460
|
+
errors = [
|
|
461
|
+
{
|
|
462
|
+
type: import_errors.ValueErrorType.String,
|
|
463
|
+
schema: schemified,
|
|
464
|
+
path: "",
|
|
465
|
+
message: `Invalid file type: expected Buffer or string, got ${typeof value}`,
|
|
466
|
+
value,
|
|
467
|
+
errors: []
|
|
468
|
+
}
|
|
469
|
+
];
|
|
470
|
+
}
|
|
471
|
+
} catch (err) {
|
|
472
|
+
errors = [
|
|
473
|
+
{
|
|
474
|
+
type: import_errors.ValueErrorType.String,
|
|
475
|
+
schema: schemified,
|
|
476
|
+
path: "",
|
|
477
|
+
message: err instanceof Error ? err.message : "Invalid file type",
|
|
478
|
+
value,
|
|
479
|
+
errors: []
|
|
480
|
+
}
|
|
481
|
+
];
|
|
482
|
+
}
|
|
455
483
|
} else {
|
|
456
|
-
|
|
484
|
+
if (import_value.Value.Check(schemified, value)) {
|
|
485
|
+
conversion = import_value.Value.Decode(schemified, value);
|
|
486
|
+
} else {
|
|
487
|
+
errors = Array.from(import_value.Value.Errors(schemified, value));
|
|
488
|
+
}
|
|
457
489
|
}
|
|
458
490
|
}
|
|
459
491
|
return errors != null && errors.length === 0 ? {
|
|
@@ -43,7 +43,7 @@ var TypeboxSchemaValidator = class {
|
|
|
43
43
|
title: "UUID"
|
|
44
44
|
});
|
|
45
45
|
email = Type.String({
|
|
46
|
-
pattern:
|
|
46
|
+
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
|
47
47
|
errorType: "email",
|
|
48
48
|
example: "a@b.com",
|
|
49
49
|
title: "Email"
|
|
@@ -198,23 +198,25 @@ var TypeboxSchemaValidator = class {
|
|
|
198
198
|
Type.String({
|
|
199
199
|
errorType: "binary",
|
|
200
200
|
format: "binary",
|
|
201
|
-
example: "a
|
|
201
|
+
example: "a base-64 encodable string",
|
|
202
202
|
title: "Binary"
|
|
203
203
|
})
|
|
204
|
-
).Decode((value) => new
|
|
205
|
-
if (value instanceof
|
|
204
|
+
).Decode((value) => new Uint8Array(Buffer.from(value, "base64"))).Encode((value) => {
|
|
205
|
+
if (value instanceof Buffer) {
|
|
206
206
|
return String.fromCharCode(...new Uint8Array(value));
|
|
207
207
|
}
|
|
208
208
|
return "";
|
|
209
209
|
});
|
|
210
210
|
file = Type.Transform(
|
|
211
|
-
Type.
|
|
211
|
+
Type.Unsafe({
|
|
212
212
|
errorType: "binary",
|
|
213
213
|
format: "binary",
|
|
214
|
-
example: "a
|
|
214
|
+
example: "a raw buffer or file stream",
|
|
215
215
|
title: "File"
|
|
216
216
|
})
|
|
217
|
-
).Decode((value) =>
|
|
217
|
+
).Decode((value) => {
|
|
218
|
+
return new InMemoryBlob(value);
|
|
219
|
+
}).Encode((value) => value.content);
|
|
218
220
|
type = () => this.any;
|
|
219
221
|
/**
|
|
220
222
|
* Extracts the error type of a schema for error messages.
|
|
@@ -401,10 +403,40 @@ var TypeboxSchemaValidator = class {
|
|
|
401
403
|
}
|
|
402
404
|
} else {
|
|
403
405
|
const schemified = this.schemify(schema);
|
|
404
|
-
if (
|
|
405
|
-
|
|
406
|
+
if (schemified[Kind] === "Unsafe") {
|
|
407
|
+
try {
|
|
408
|
+
if (value instanceof Buffer) {
|
|
409
|
+
conversion = new InMemoryBlob(value);
|
|
410
|
+
} else {
|
|
411
|
+
errors = [
|
|
412
|
+
{
|
|
413
|
+
type: ValueErrorType.String,
|
|
414
|
+
schema: schemified,
|
|
415
|
+
path: "",
|
|
416
|
+
message: `Invalid file type: expected Buffer or string, got ${typeof value}`,
|
|
417
|
+
value,
|
|
418
|
+
errors: []
|
|
419
|
+
}
|
|
420
|
+
];
|
|
421
|
+
}
|
|
422
|
+
} catch (err) {
|
|
423
|
+
errors = [
|
|
424
|
+
{
|
|
425
|
+
type: ValueErrorType.String,
|
|
426
|
+
schema: schemified,
|
|
427
|
+
path: "",
|
|
428
|
+
message: err instanceof Error ? err.message : "Invalid file type",
|
|
429
|
+
value,
|
|
430
|
+
errors: []
|
|
431
|
+
}
|
|
432
|
+
];
|
|
433
|
+
}
|
|
406
434
|
} else {
|
|
407
|
-
|
|
435
|
+
if (Value.Check(schemified, value)) {
|
|
436
|
+
conversion = Value.Decode(schemified, value);
|
|
437
|
+
} else {
|
|
438
|
+
errors = Array.from(Value.Errors(schemified, value));
|
|
439
|
+
}
|
|
408
440
|
}
|
|
409
441
|
}
|
|
410
442
|
return errors != null && errors.length === 0 ? {
|
package/lib/src/zod/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod/v3';
|
|
2
|
-
import { Z as ZodSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator } from '../../schema.types-wl77iEsE.mjs';
|
|
3
|
+
export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-wl77iEsE.mjs';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox';
|
package/lib/src/zod/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod/v3';
|
|
2
|
-
import { Z as ZodSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator } from '../../schema.types-wl77iEsE.js';
|
|
3
|
+
export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-wl77iEsE.js';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox';
|
package/lib/src/zod/index.js
CHANGED
|
@@ -658,7 +658,7 @@ var ZodSchemaValidator = class {
|
|
|
658
658
|
email = import_v32.z.string().email().openapi({
|
|
659
659
|
title: "Email",
|
|
660
660
|
format: "email",
|
|
661
|
-
pattern:
|
|
661
|
+
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
|
662
662
|
example: "a@b.com"
|
|
663
663
|
});
|
|
664
664
|
uri = import_v32.z.string().url().openapi({
|
|
@@ -768,19 +768,19 @@ var ZodSchemaValidator = class {
|
|
|
768
768
|
type: "null",
|
|
769
769
|
example: "never"
|
|
770
770
|
});
|
|
771
|
-
binary = import_v32.z.string().transform((
|
|
771
|
+
binary = import_v32.z.string().transform((val) => new Uint8Array(Buffer.from(val, "base64"))).openapi({
|
|
772
772
|
title: "Binary",
|
|
773
773
|
type: "string",
|
|
774
774
|
format: "binary",
|
|
775
|
-
example: "a
|
|
775
|
+
example: "a base-64 encodable string"
|
|
776
776
|
});
|
|
777
|
-
file = import_v32.z.
|
|
777
|
+
file = import_v32.z.instanceof(Buffer).transform((val) => {
|
|
778
778
|
return new Blob([val]);
|
|
779
779
|
}).openapi({
|
|
780
780
|
title: "File",
|
|
781
781
|
type: "string",
|
|
782
782
|
format: "binary",
|
|
783
|
-
example: "a
|
|
783
|
+
example: "a base-64 encodable blob or file"
|
|
784
784
|
});
|
|
785
785
|
type = () => this.any;
|
|
786
786
|
/**
|
package/lib/src/zod/index.mjs
CHANGED
|
@@ -602,7 +602,7 @@ var ZodSchemaValidator = class {
|
|
|
602
602
|
email = z2.string().email().openapi({
|
|
603
603
|
title: "Email",
|
|
604
604
|
format: "email",
|
|
605
|
-
pattern:
|
|
605
|
+
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
|
606
606
|
example: "a@b.com"
|
|
607
607
|
});
|
|
608
608
|
uri = z2.string().url().openapi({
|
|
@@ -712,19 +712,19 @@ var ZodSchemaValidator = class {
|
|
|
712
712
|
type: "null",
|
|
713
713
|
example: "never"
|
|
714
714
|
});
|
|
715
|
-
binary = z2.string().transform((
|
|
715
|
+
binary = z2.string().transform((val) => new Uint8Array(Buffer.from(val, "base64"))).openapi({
|
|
716
716
|
title: "Binary",
|
|
717
717
|
type: "string",
|
|
718
718
|
format: "binary",
|
|
719
|
-
example: "a
|
|
719
|
+
example: "a base-64 encodable string"
|
|
720
720
|
});
|
|
721
|
-
file = z2.
|
|
721
|
+
file = z2.instanceof(Buffer).transform((val) => {
|
|
722
722
|
return new Blob([val]);
|
|
723
723
|
}).openapi({
|
|
724
724
|
title: "File",
|
|
725
725
|
type: "string",
|
|
726
726
|
format: "binary",
|
|
727
|
-
example: "a
|
|
727
|
+
example: "a base-64 encodable blob or file"
|
|
728
728
|
});
|
|
729
729
|
type = () => this.any;
|
|
730
730
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/validator",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Schema validator for ForkLaunch components.",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@sinclair/typebox": "^0.34.40",
|
|
62
62
|
"ts-deepmerge": "^7.0.3",
|
|
63
|
-
"zod": "^4.1.
|
|
64
|
-
"@forklaunch/common": "0.5.
|
|
63
|
+
"zod": "^4.1.1",
|
|
64
|
+
"@forklaunch/common": "0.5.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^9.34.0",
|
|
68
68
|
"@types/jest": "^30.0.0",
|
|
69
69
|
"@types/node": "^24.3.0",
|
|
70
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
70
|
+
"@typescript/native-preview": "7.0.0-dev.20250824.1",
|
|
71
71
|
"@vitest/coverage-v8": "^3.2.4",
|
|
72
72
|
"eslint-config-prettier": "^10.1.8",
|
|
73
73
|
"eslint-plugin-prettier": "^5.5.4",
|