fullstacked 0.12.0-1273 → 0.12.0-1291

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 (163) hide show
  1. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +20 -2
  2. package/fullstacked_modules/@fullstacked/ai-agent/lock.json +469 -38
  3. package/fullstacked_modules/@fullstacked/ai-agent/package.json +11 -1
  4. package/fullstacked_modules/@fullstacked/ai-agent/src/conversation.ts +72 -14
  5. package/fullstacked_modules/@fullstacked/ai-agent/src/index.ts +1 -2
  6. package/fullstacked_modules/@fullstacked/ai-agent/src/markdown.ts +8 -4
  7. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/anthropic.ts +46 -0
  8. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/deepseek.ts +46 -0
  9. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/google.ts +40 -0
  10. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/index.ts +41 -0
  11. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/interface.ts +19 -0
  12. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/mistral.ts +47 -0
  13. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +26 -9
  14. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/openai.ts +21 -9
  15. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/xai.ts +43 -0
  16. package/fullstacked_modules/@fullstacked/ai-agent/summary.txt +7 -0
  17. package/fullstacked_modules/ai/index.js +155667 -87447
  18. package/fullstacked_modules/ai/tools/fs.ts +12 -2
  19. package/fullstacked_modules/fetch/index.ts +41 -16
  20. package/fullstacked_modules/fs/fs.ts +1 -1
  21. package/fullstacked_modules/zod/README.md +3 -3
  22. package/fullstacked_modules/zod/index.d.cts +2 -2
  23. package/fullstacked_modules/zod/index.d.ts +2 -2
  24. package/fullstacked_modules/zod/package.json +10 -26
  25. package/fullstacked_modules/zod/src/index.ts +2 -2
  26. package/fullstacked_modules/zod/src/v3/tests/string.test.ts +2 -2
  27. package/fullstacked_modules/zod/src/v3/types.ts +1 -3
  28. package/fullstacked_modules/zod/src/v4/classic/checks.ts +0 -1
  29. package/fullstacked_modules/zod/src/v4/classic/compat.ts +0 -4
  30. package/fullstacked_modules/zod/src/v4/classic/errors.ts +2 -9
  31. package/fullstacked_modules/zod/src/v4/classic/schemas.ts +47 -24
  32. package/fullstacked_modules/zod/src/v4/classic/tests/catch.test.ts +5 -4
  33. package/fullstacked_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -6
  34. package/fullstacked_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -42
  35. package/fullstacked_modules/zod/src/v4/classic/tests/error-utils.test.ts +2 -70
  36. package/fullstacked_modules/zod/src/v4/classic/tests/file.test.ts +2 -5
  37. package/fullstacked_modules/zod/src/v4/classic/tests/literal.test.ts +0 -25
  38. package/fullstacked_modules/zod/src/v4/classic/tests/number.test.ts +0 -23
  39. package/fullstacked_modules/zod/src/v4/classic/tests/optional.test.ts +0 -13
  40. package/fullstacked_modules/zod/src/v4/classic/tests/partial.test.ts +0 -193
  41. package/fullstacked_modules/zod/src/v4/classic/tests/pickomit.test.ts +5 -5
  42. package/fullstacked_modules/zod/src/v4/classic/tests/preprocess.test.ts +15 -4
  43. package/fullstacked_modules/zod/src/v4/classic/tests/record.test.ts +1 -15
  44. package/fullstacked_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -121
  45. package/fullstacked_modules/zod/src/v4/classic/tests/string.test.ts +4 -119
  46. package/fullstacked_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -3
  47. package/fullstacked_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -27
  48. package/fullstacked_modules/zod/src/v4/classic/tests/transform.test.ts +0 -104
  49. package/fullstacked_modules/zod/src/v4/classic/tests/tuple.test.ts +2 -2
  50. package/fullstacked_modules/zod/src/v4/classic/tests/union.test.ts +3 -90
  51. package/fullstacked_modules/zod/src/v4/core/api.ts +96 -130
  52. package/fullstacked_modules/zod/src/v4/core/checks.ts +2 -4
  53. package/fullstacked_modules/zod/src/v4/core/doc.ts +2 -2
  54. package/fullstacked_modules/zod/src/v4/core/errors.ts +44 -43
  55. package/fullstacked_modules/zod/src/v4/core/json-schema.ts +3 -6
  56. package/fullstacked_modules/zod/src/v4/core/regexes.ts +6 -9
  57. package/fullstacked_modules/zod/src/v4/core/registries.ts +2 -3
  58. package/fullstacked_modules/zod/src/v4/core/schemas.ts +107 -165
  59. package/fullstacked_modules/zod/src/v4/core/to-json-schema.ts +11 -38
  60. package/fullstacked_modules/zod/src/v4/core/util.ts +105 -157
  61. package/fullstacked_modules/zod/src/v4/core/versions.ts +1 -1
  62. package/fullstacked_modules/zod/src/v4/locales/index.ts +0 -3
  63. package/fullstacked_modules/zod/src/v4/mini/schemas.ts +1 -14
  64. package/fullstacked_modules/zod/src/v4/mini/tests/assignability.test.ts +1 -1
  65. package/fullstacked_modules/zod/src/v4/mini/tests/computed.test.ts +1 -1
  66. package/fullstacked_modules/zod/src/v4/mini/tests/error.test.ts +1 -1
  67. package/fullstacked_modules/zod/src/v4/mini/tests/index.test.ts +1 -1
  68. package/fullstacked_modules/zod/src/v4/mini/tests/number.test.ts +1 -1
  69. package/fullstacked_modules/zod/src/v4/mini/tests/object.test.ts +1 -1
  70. package/fullstacked_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
  71. package/fullstacked_modules/zod/src/v4/mini/tests/recursive-types.test.ts +1 -1
  72. package/fullstacked_modules/zod/src/v4/mini/tests/string.test.ts +1 -1
  73. package/fullstacked_modules/zod/v3/ZodError.d.cts +6 -6
  74. package/fullstacked_modules/zod/v3/ZodError.d.ts +6 -6
  75. package/fullstacked_modules/zod/v3/locales/en.d.cts +1 -1
  76. package/fullstacked_modules/zod/v3/types.d.cts +1 -4
  77. package/fullstacked_modules/zod/v3/types.d.ts +1 -4
  78. package/fullstacked_modules/zod/v4/classic/checks.d.cts +1 -1
  79. package/fullstacked_modules/zod/v4/classic/checks.d.ts +1 -1
  80. package/fullstacked_modules/zod/v4/classic/compat.d.cts +0 -4
  81. package/fullstacked_modules/zod/v4/classic/compat.d.ts +0 -4
  82. package/fullstacked_modules/zod/v4/classic/schemas.d.cts +20 -9
  83. package/fullstacked_modules/zod/v4/classic/schemas.d.ts +20 -9
  84. package/fullstacked_modules/zod/v4/core/api.d.cts +72 -84
  85. package/fullstacked_modules/zod/v4/core/api.d.ts +72 -84
  86. package/fullstacked_modules/zod/v4/core/checks.d.cts +2 -2
  87. package/fullstacked_modules/zod/v4/core/checks.d.ts +2 -2
  88. package/fullstacked_modules/zod/v4/core/doc.d.cts +1 -1
  89. package/fullstacked_modules/zod/v4/core/doc.d.ts +1 -1
  90. package/fullstacked_modules/zod/v4/core/errors.d.cts +22 -24
  91. package/fullstacked_modules/zod/v4/core/errors.d.ts +22 -24
  92. package/fullstacked_modules/zod/v4/core/json-schema.d.cts +3 -3
  93. package/fullstacked_modules/zod/v4/core/json-schema.d.ts +3 -3
  94. package/fullstacked_modules/zod/v4/core/regexes.d.cts +2 -2
  95. package/fullstacked_modules/zod/v4/core/regexes.d.ts +2 -2
  96. package/fullstacked_modules/zod/v4/core/registries.d.cts +1 -1
  97. package/fullstacked_modules/zod/v4/core/registries.d.ts +1 -1
  98. package/fullstacked_modules/zod/v4/core/schemas.d.cts +6 -20
  99. package/fullstacked_modules/zod/v4/core/schemas.d.ts +6 -20
  100. package/fullstacked_modules/zod/v4/core/to-json-schema.d.cts +3 -4
  101. package/fullstacked_modules/zod/v4/core/to-json-schema.d.ts +3 -4
  102. package/fullstacked_modules/zod/v4/core/util.d.cts +0 -2
  103. package/fullstacked_modules/zod/v4/core/util.d.ts +0 -2
  104. package/fullstacked_modules/zod/v4/locales/ar.d.cts +1 -2
  105. package/fullstacked_modules/zod/v4/locales/az.d.cts +1 -2
  106. package/fullstacked_modules/zod/v4/locales/be.d.cts +1 -2
  107. package/fullstacked_modules/zod/v4/locales/ca.d.cts +1 -2
  108. package/fullstacked_modules/zod/v4/locales/cs.d.cts +1 -2
  109. package/fullstacked_modules/zod/v4/locales/de.d.cts +1 -2
  110. package/fullstacked_modules/zod/v4/locales/es.d.cts +1 -2
  111. package/fullstacked_modules/zod/v4/locales/fa.d.cts +1 -2
  112. package/fullstacked_modules/zod/v4/locales/fi.d.cts +1 -2
  113. package/fullstacked_modules/zod/v4/locales/fr-CA.d.cts +1 -2
  114. package/fullstacked_modules/zod/v4/locales/fr.d.cts +1 -2
  115. package/fullstacked_modules/zod/v4/locales/he.d.cts +1 -2
  116. package/fullstacked_modules/zod/v4/locales/hu.d.cts +1 -2
  117. package/fullstacked_modules/zod/v4/locales/id.d.cts +1 -2
  118. package/fullstacked_modules/zod/v4/locales/index.d.cts +0 -3
  119. package/fullstacked_modules/zod/v4/locales/index.d.ts +0 -3
  120. package/fullstacked_modules/zod/v4/locales/it.d.cts +1 -2
  121. package/fullstacked_modules/zod/v4/locales/ja.d.cts +1 -2
  122. package/fullstacked_modules/zod/v4/locales/kh.d.cts +1 -2
  123. package/fullstacked_modules/zod/v4/locales/ko.d.cts +1 -2
  124. package/fullstacked_modules/zod/v4/locales/mk.d.cts +1 -2
  125. package/fullstacked_modules/zod/v4/locales/ms.d.cts +1 -2
  126. package/fullstacked_modules/zod/v4/locales/nl.d.cts +1 -2
  127. package/fullstacked_modules/zod/v4/locales/no.d.cts +1 -2
  128. package/fullstacked_modules/zod/v4/locales/ota.d.cts +1 -2
  129. package/fullstacked_modules/zod/v4/locales/pl.d.cts +1 -2
  130. package/fullstacked_modules/zod/v4/locales/ps.d.cts +1 -2
  131. package/fullstacked_modules/zod/v4/locales/pt.d.cts +1 -2
  132. package/fullstacked_modules/zod/v4/locales/ru.d.cts +1 -2
  133. package/fullstacked_modules/zod/v4/locales/sl.d.cts +1 -2
  134. package/fullstacked_modules/zod/v4/locales/sv.d.cts +1 -2
  135. package/fullstacked_modules/zod/v4/locales/ta.d.cts +1 -2
  136. package/fullstacked_modules/zod/v4/locales/th.d.cts +1 -2
  137. package/fullstacked_modules/zod/v4/locales/ua.d.cts +1 -2
  138. package/fullstacked_modules/zod/v4/locales/ur.d.cts +1 -2
  139. package/fullstacked_modules/zod/v4/locales/vi.d.cts +1 -2
  140. package/fullstacked_modules/zod/v4/locales/zh-CN.d.cts +1 -2
  141. package/fullstacked_modules/zod/v4/locales/zh-TW.d.cts +1 -2
  142. package/fullstacked_modules/zod/v4/mini/schemas.d.cts +0 -2
  143. package/fullstacked_modules/zod/v4/mini/schemas.d.ts +0 -2
  144. package/package.json +1 -1
  145. package/fullstacked_modules/zod/locales/index.d.cts +0 -1
  146. package/fullstacked_modules/zod/locales/index.d.ts +0 -1
  147. package/fullstacked_modules/zod/mini/index.d.cts +0 -1
  148. package/fullstacked_modules/zod/mini/index.d.ts +0 -1
  149. package/fullstacked_modules/zod/src/locales/index.ts +0 -1
  150. package/fullstacked_modules/zod/src/mini/index.ts +0 -1
  151. package/fullstacked_modules/zod/src/v4/core/tests/extend.test.ts +0 -18
  152. package/fullstacked_modules/zod/src/v4/locales/bg.ts +0 -136
  153. package/fullstacked_modules/zod/src/v4/locales/da.ts +0 -141
  154. package/fullstacked_modules/zod/src/v4/locales/is.ts +0 -127
  155. package/fullstacked_modules/zod/src/v4/locales/yo.ts +0 -131
  156. package/fullstacked_modules/zod/v4/locales/bg.d.cts +0 -5
  157. package/fullstacked_modules/zod/v4/locales/bg.d.ts +0 -5
  158. package/fullstacked_modules/zod/v4/locales/da.d.cts +0 -5
  159. package/fullstacked_modules/zod/v4/locales/da.d.ts +0 -4
  160. package/fullstacked_modules/zod/v4/locales/is.d.cts +0 -5
  161. package/fullstacked_modules/zod/v4/locales/is.d.ts +0 -5
  162. package/fullstacked_modules/zod/v4/locales/yo.d.cts +0 -5
  163. package/fullstacked_modules/zod/v4/locales/yo.d.ts +0 -4
@@ -1,7 +1,6 @@
1
1
  import type { $ZodCheck, $ZodStringFormats } from "./checks.js";
2
2
  import { $constructor } from "./core.js";
3
3
  import type { $ZodType } from "./schemas.js";
4
- import type { StandardSchemaV1 } from "./standard-schema.js";
5
4
  import * as util from "./util.js";
6
5
 
7
6
  ///////////////////////////
@@ -12,6 +11,7 @@ export interface $ZodIssueBase {
12
11
  readonly input?: unknown;
13
12
  readonly path: PropertyKey[];
14
13
  readonly message: string;
14
+ // [k: string]: unknown;
15
15
  }
16
16
 
17
17
  ////////////////////////////////
@@ -20,7 +20,7 @@ export interface $ZodIssueBase {
20
20
  export interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
21
21
  readonly code: "invalid_type";
22
22
  readonly expected: $ZodType["_zod"]["def"]["type"];
23
- readonly input?: Input;
23
+ readonly input: Input;
24
24
  }
25
25
 
26
26
  export interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
@@ -29,7 +29,7 @@ export interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
29
29
  readonly maximum: number | bigint;
30
30
  readonly inclusive?: boolean;
31
31
  readonly exact?: boolean;
32
- readonly input?: Input;
32
+ readonly input: Input;
33
33
  }
34
34
 
35
35
  export interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
@@ -40,40 +40,39 @@ export interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
40
40
  readonly inclusive?: boolean;
41
41
  /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
42
42
  readonly exact?: boolean;
43
- readonly input?: Input;
43
+ readonly input: Input;
44
44
  }
45
45
 
46
46
  export interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
47
47
  readonly code: "invalid_format";
48
48
  readonly format: $ZodStringFormats | (string & {});
49
49
  readonly pattern?: string;
50
- readonly input?: string;
50
+ readonly input: string;
51
51
  }
52
52
 
53
53
  export interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
54
54
  readonly code: "not_multiple_of";
55
55
  readonly divisor: number;
56
- readonly input?: Input;
56
+ readonly input: Input;
57
57
  }
58
58
 
59
59
  export interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
60
60
  readonly code: "unrecognized_keys";
61
61
  readonly keys: string[];
62
- readonly input?: Record<string, unknown>;
62
+ readonly input: Record<string, unknown>;
63
63
  }
64
64
 
65
65
  export interface $ZodIssueInvalidUnion extends $ZodIssueBase {
66
66
  readonly code: "invalid_union";
67
67
  readonly errors: $ZodIssue[][];
68
- readonly input?: unknown;
69
- readonly discriminator?: string | undefined;
68
+ readonly input: unknown;
70
69
  }
71
70
 
72
71
  export interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
73
72
  readonly code: "invalid_key";
74
73
  readonly origin: "map" | "record";
75
74
  readonly issues: $ZodIssue[];
76
- readonly input?: Input;
75
+ readonly input: Input;
77
76
  }
78
77
 
79
78
  export interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
@@ -81,19 +80,19 @@ export interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase
81
80
  readonly origin: "map" | "set";
82
81
  readonly key: unknown;
83
82
  readonly issues: $ZodIssue[];
84
- readonly input?: Input;
83
+ readonly input: Input;
85
84
  }
86
85
 
87
86
  export interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
88
87
  readonly code: "invalid_value";
89
88
  readonly values: util.Primitive[];
90
- readonly input?: Input;
89
+ readonly input: Input;
91
90
  }
92
91
 
93
92
  export interface $ZodIssueCustom extends $ZodIssueBase {
94
93
  readonly code: "custom";
95
94
  readonly params?: Record<string, any> | undefined;
96
- readonly input?: unknown;
95
+ readonly input: unknown;
97
96
  }
98
97
 
99
98
  ////////////////////////////////////////////
@@ -156,21 +155,17 @@ export type $ZodIssue =
156
155
 
157
156
  export type $ZodIssueCode = $ZodIssue["code"];
158
157
 
159
- export type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
160
- type RawIssue<T extends $ZodIssueBase> = T extends any
161
- ? util.Flatten<
162
- util.MakePartial<T, "message" | "path"> & {
163
- /** The input data */
164
- readonly input: unknown;
165
- /** The schema or check that originated this issue. */
166
- readonly inst?: $ZodType | $ZodCheck;
167
- /** If `true`, Zod will continue executing checks/refinements after this issue. */
168
- readonly continue?: boolean | undefined;
169
- } & Record<string, unknown>
170
- >
171
- : never;
172
-
173
- export type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
158
+ export type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
159
+ type RawIssue<T extends $ZodIssueBase> = util.Flatten<
160
+ util.MakePartial<T, "message" | "path"> & {
161
+ /** The input data */
162
+ readonly input?: unknown;
163
+ /** The schema or check that originated this issue. */
164
+ readonly inst?: $ZodType | $ZodCheck;
165
+ /** @deprecated Internal use only. If `true`, Zod will continue executing validation despite this issue. */
166
+ readonly continue?: boolean | undefined;
167
+ } & Record<string, any>
168
+ >;
174
169
 
175
170
  export interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
176
171
  // biome-ignore lint:
@@ -201,8 +196,13 @@ const initializer = (inst: $ZodError, def: $ZodIssue[]): void => {
201
196
  value: def,
202
197
  enumerable: false,
203
198
  });
204
- inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);
205
-
199
+ Object.defineProperty(inst, "message", {
200
+ get() {
201
+ return JSON.stringify(def, util.jsonStringifyReplacer, 2);
202
+ },
203
+ enumerable: true,
204
+ // configurable: false,
205
+ });
206
206
  Object.defineProperty(inst, "toString", {
207
207
  value: () => inst.message,
208
208
  enumerable: false,
@@ -295,15 +295,13 @@ export function formatError<T>(error: $ZodError, _mapper?: any) {
295
295
  return fieldErrors;
296
296
  }
297
297
 
298
- export type $ZodErrorTree<T, U = string> = T extends util.Primitive
299
- ? { errors: U[] }
300
- : T extends [any, ...any[]]
301
- ? { errors: U[]; items?: { [K in keyof T]?: $ZodErrorTree<T[K], U> } }
302
- : T extends any[]
303
- ? { errors: U[]; items?: Array<$ZodErrorTree<T[number], U>> }
304
- : T extends object
305
- ? { errors: U[]; properties?: { [K in keyof T]?: $ZodErrorTree<T[K], U> } }
306
- : { errors: U[] };
298
+ export type $ZodErrorTree<T, U = string> = T extends [any, ...any[]]
299
+ ? { errors: U[]; items?: { [K in keyof T]?: $ZodErrorTree<T[K], U> } }
300
+ : T extends any[]
301
+ ? { errors: U[]; items?: Array<$ZodErrorTree<T[number], U>> }
302
+ : T extends object
303
+ ? { errors: U[]; properties?: { [K in keyof T]?: $ZodErrorTree<T[K], U> } }
304
+ : { errors: U[] };
307
305
 
308
306
  export function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;
309
307
  export function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;
@@ -391,9 +389,8 @@ export function treeifyError<T>(error: $ZodError, _mapper?: any) {
391
389
  * ✖ Invalid input: expected number
392
390
  * ```
393
391
  */
394
- export function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string {
392
+ export function toDotPath(path: (string | number | symbol)[]): string {
395
393
  const segs: string[] = [];
396
- const path: PropertyKey[] = _path.map((seg: any) => (typeof seg === "object" ? seg.key : seg));
397
394
  for (const seg of path) {
398
395
  if (typeof seg === "number") segs.push(`[${seg}]`);
399
396
  else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
@@ -407,10 +404,14 @@ export function toDotPath(_path: readonly (string | number | symbol | StandardSc
407
404
  return segs.join("");
408
405
  }
409
406
 
410
- export function prettifyError(error: StandardSchemaV1.FailureResult): string {
407
+ interface BaseError {
408
+ issues: $ZodIssueBase[];
409
+ }
410
+
411
+ export function prettifyError(error: BaseError): string {
411
412
  const lines: string[] = [];
412
413
  // sort by path length
413
- const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
414
+ const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);
414
415
 
415
416
  // Process each issue
416
417
  for (const issue of issues) {
@@ -45,10 +45,7 @@ export type Schema =
45
45
  export type _JSONSchema = boolean | JSONSchema;
46
46
  export type JSONSchema = {
47
47
  [k: string]: unknown;
48
- $schema?:
49
- | "https://json-schema.org/draft/2020-12/schema"
50
- | "http://json-schema.org/draft-07/schema#"
51
- | "http://json-schema.org/draft-04/schema#";
48
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#";
52
49
  $id?: string;
53
50
  $anchor?: string;
54
51
  $ref?: string;
@@ -78,9 +75,9 @@ export type JSONSchema = {
78
75
  not?: _JSONSchema;
79
76
  multipleOf?: number;
80
77
  maximum?: number;
81
- exclusiveMaximum?: number | boolean;
78
+ exclusiveMaximum?: number;
82
79
  minimum?: number;
83
- exclusiveMinimum?: number | boolean;
80
+ exclusiveMinimum?: number;
84
81
  maxLength?: number;
85
82
  minLength?: number;
86
83
  pattern?: string;
@@ -16,7 +16,7 @@ export const extendedDuration: RegExp =
16
16
  /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
17
17
  export const guid: RegExp = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
18
18
 
19
- /** Returns a regex for validating an RFC 9562/4122 UUID.
19
+ /** Returns a regex for validating an RFC 4122 UUID.
20
20
  *
21
21
  * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
22
22
  export const uuid = (version?: number | undefined): RegExp => {
@@ -44,13 +44,12 @@ export const rfc5322Email =
44
44
 
45
45
  /** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
46
46
  export const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
47
- export const idnEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
48
47
 
49
48
  export const browserEmail: RegExp =
50
49
  /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
51
50
  // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
52
51
 
53
- const _emoji: string = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
52
+ export const _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
54
53
  export function emoji(): RegExp {
55
54
  return new RegExp(_emoji, "u");
56
55
  }
@@ -70,10 +69,9 @@ export const base64: RegExp = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==
70
69
  export const base64url: RegExp = /^[A-Za-z0-9_-]*$/;
71
70
 
72
71
  // based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
73
- // export const hostname: RegExp = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
74
- export const hostname: RegExp =
75
- /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
76
-
72
+ // export const hostname: RegExp =
73
+ // /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
74
+ export const hostname: RegExp = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
77
75
  export const domain: RegExp = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
78
76
 
79
77
  // https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
@@ -111,8 +109,7 @@ export function datetime(args: {
111
109
  const time = timeSource({ precision: args.precision });
112
110
  const opts = ["Z"];
113
111
  if (args.local) opts.push("");
114
- // if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
115
- if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
112
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
116
113
  const timeRegex = `${time}(?:${opts.join("|")})`;
117
114
 
118
115
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
@@ -23,7 +23,7 @@ export type $replace<Meta, S extends $ZodType> = Meta extends $output
23
23
  ? { [K in keyof Meta]: $replace<Meta[K], S> }
24
24
  : Meta;
25
25
 
26
- type MetadataType = object | undefined;
26
+ type MetadataType = Record<string, unknown> | undefined;
27
27
  export class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
28
28
  _meta!: Meta;
29
29
  _schema!: Schema;
@@ -68,8 +68,7 @@ export class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema exten
68
68
  if (p) {
69
69
  const pm: any = { ...(this.get(p) ?? {}) };
70
70
  delete pm.id; // do not inherit id
71
- const f = { ...pm, ...this._map.get(schema) } as any;
72
- return Object.keys(f).length ? f : undefined;
71
+ return { ...pm, ...this._map.get(schema) } as any;
73
72
  }
74
73
  return this._map.get(schema) as any;
75
74
  }