@alienplatform/bindings 3.3.11 → 3.3.12

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/dist/index.d.ts CHANGED
@@ -8,8 +8,8 @@
8
8
  * against a binding with no `ALIEN_<NAME>_BINDING` in the environment throws
9
9
  * {@link BindingNotConfiguredError}.
10
10
  */
11
- export { Bindings } from "./remote.js";
12
11
  export type { RemoteDeploymentBindingsOptions } from "./remote.js";
12
+ export { Bindings } from "./remote.js";
13
13
  /** Resolve the storage binding named `name`. */
14
14
  export declare const storage: (name: string) => import("./types.js").Storage;
15
15
  /** Resolve the key-value binding named `name`. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,YAAY,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAA;AAIlE,gDAAgD;AAChD,eAAO,MAAM,OAAO,gDAAoB,CAAA;AACxC,kDAAkD;AAClD,eAAO,MAAM,EAAE,2CAAe,CAAA;AAC9B,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,yDAAyD;AACzD,eAAO,MAAM,SAAS,kDAAsB,CAAA;AAC5C,iDAAiD;AACjD,eAAO,MAAM,QAAQ,iDAAqB,CAAA;AAE1C,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,SAAS,EACT,EAAE,EACF,eAAe,EACf,OAAO,EACP,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,YAAY,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAItC,gDAAgD;AAChD,eAAO,MAAM,OAAO,gDAAoB,CAAA;AACxC,kDAAkD;AAClD,eAAO,MAAM,EAAE,2CAAe,CAAA;AAC9B,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,yDAAyD;AACzD,eAAO,MAAM,SAAS,kDAAsB,CAAA;AAC5C,iDAAiD;AACjD,eAAO,MAAM,QAAQ,iDAAqB,CAAA;AAE1C,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,SAAS,EACT,EAAE,EACF,eAAe,EACf,OAAO,EACP,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,YAAY,CAAA"}
package/dist/loader.js CHANGED
@@ -3,7 +3,8 @@ import { AlienError, BindingNotFoundError, defineError } from "@alienplatform/co
3
3
  import { existsSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- Object.freeze({ status: "aborted" });
6
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
7
+ var _a$1;
7
8
  function $constructor(name, initializer, params) {
8
9
  function init(inst, def) {
9
10
  if (!inst._zod) Object.defineProperty(inst, "_zod", {
@@ -54,13 +55,14 @@ var $ZodEncodeError = class extends Error {
54
55
  this.name = "ZodEncodeError";
55
56
  }
56
57
  };
57
- const globalConfig = {};
58
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
59
+ const globalConfig = globalThis.__zod_globalConfig;
58
60
  function config(newConfig) {
59
61
  if (newConfig) Object.assign(globalConfig, newConfig);
60
62
  return globalConfig;
61
63
  }
62
64
  //#endregion
63
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/util.js
65
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
64
66
  function getEnumValues(entries) {
65
67
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
66
68
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -86,7 +88,7 @@ function cleanRegex(source) {
86
88
  const end = source.endsWith("$") ? source.length - 1 : source.length;
87
89
  return source.slice(start, end);
88
90
  }
89
- const EVALUATING = Symbol("evaluating");
91
+ const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
90
92
  function defineLazy(object, key, getter) {
91
93
  let value = void 0;
92
94
  Object.defineProperty(object, key, {
@@ -130,7 +132,8 @@ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace
130
132
  function isObject(data) {
131
133
  return typeof data === "object" && data !== null && !Array.isArray(data);
132
134
  }
133
- const allowsEval = cached$1(() => {
135
+ const allowsEval = /* @__PURE__*/ cached$1(() => {
136
+ if (globalConfig.jitless) return false;
134
137
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
135
138
  try {
136
139
  new Function("");
@@ -152,9 +155,11 @@ function isPlainObject(o) {
152
155
  function shallowClone(o) {
153
156
  if (isPlainObject(o)) return { ...o };
154
157
  if (Array.isArray(o)) return [...o];
158
+ if (o instanceof Map) return new Map(o);
159
+ if (o instanceof Set) return new Set(o);
155
160
  return o;
156
161
  }
157
- const propertyKeyTypes = /* @__PURE__ */ new Set([
162
+ const propertyKeyTypes = /* @__PURE__*/ new Set([
158
163
  "string",
159
164
  "number",
160
165
  "symbol"
@@ -252,6 +257,7 @@ function safeExtend(schema, shape) {
252
257
  } }));
253
258
  }
254
259
  function merge(a, b) {
260
+ if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
255
261
  return clone(a, mergeDefs(a._zod.def, {
256
262
  get shape() {
257
263
  const _shape = {
@@ -264,7 +270,7 @@ function merge(a, b) {
264
270
  get catchall() {
265
271
  return b._zod.def.catchall;
266
272
  },
267
- checks: []
273
+ checks: b._zod.def.checks ?? []
268
274
  }));
269
275
  }
270
276
  function partial(Class, schema, mask) {
@@ -317,6 +323,11 @@ function aborted(x, startIndex = 0) {
317
323
  for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
318
324
  return false;
319
325
  }
326
+ function explicitlyAborted(x, startIndex = 0) {
327
+ if (x.aborted === true) return true;
328
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
329
+ return false;
330
+ }
320
331
  function prefixIssues(path, issues) {
321
332
  return issues.map((iss) => {
322
333
  var _a;
@@ -329,15 +340,12 @@ function unwrapMessage(message) {
329
340
  return typeof message === "string" ? message : message?.message;
330
341
  }
331
342
  function finalizeIssue(iss, ctx, config) {
332
- const full = {
333
- ...iss,
334
- path: iss.path ?? []
335
- };
336
- if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
337
- delete full.inst;
338
- delete full.continue;
339
- if (!ctx?.reportInput) delete full.input;
340
- return full;
343
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
344
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
345
+ rest.path ?? (rest.path = []);
346
+ rest.message = message;
347
+ if (ctx?.reportInput) rest.input = _input;
348
+ return rest;
341
349
  }
342
350
  function getLengthableOrigin(input) {
343
351
  if (Array.isArray(input)) return "array";
@@ -355,7 +363,7 @@ function issue(...args) {
355
363
  return { ...iss };
356
364
  }
357
365
  //#endregion
358
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/errors.js
366
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
359
367
  const initializer$1 = (inst, def) => {
360
368
  inst.name = "$ZodError";
361
369
  Object.defineProperty(inst, "_zod", {
@@ -388,23 +396,26 @@ function flattenError(error, mapper = (issue) => issue.message) {
388
396
  }
389
397
  function formatError(error, mapper = (issue) => issue.message) {
390
398
  const fieldErrors = { _errors: [] };
391
- const processError = (error) => {
392
- for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
393
- else if (issue.code === "invalid_key") processError({ issues: issue.issues });
394
- else if (issue.code === "invalid_element") processError({ issues: issue.issues });
395
- else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
399
+ const processError = (error, path = []) => {
400
+ for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
401
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
402
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
396
403
  else {
397
- let curr = fieldErrors;
398
- let i = 0;
399
- while (i < issue.path.length) {
400
- const el = issue.path[i];
401
- if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
402
- else {
403
- curr[el] = curr[el] || { _errors: [] };
404
- curr[el]._errors.push(mapper(issue));
404
+ const fullpath = [...path, ...issue.path];
405
+ if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
406
+ else {
407
+ let curr = fieldErrors;
408
+ let i = 0;
409
+ while (i < fullpath.length) {
410
+ const el = fullpath[i];
411
+ if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
412
+ else {
413
+ curr[el] = curr[el] || { _errors: [] };
414
+ curr[el]._errors.push(mapper(issue));
415
+ }
416
+ curr = curr[el];
417
+ i++;
405
418
  }
406
- curr = curr[el];
407
- i++;
408
419
  }
409
420
  }
410
421
  };
@@ -412,9 +423,12 @@ function formatError(error, mapper = (issue) => issue.message) {
412
423
  return fieldErrors;
413
424
  }
414
425
  //#endregion
415
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/parse.js
426
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
416
427
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
417
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
428
+ const ctx = _ctx ? {
429
+ ..._ctx,
430
+ async: false
431
+ } : { async: false };
418
432
  const result = schema._zod.run({
419
433
  value,
420
434
  issues: []
@@ -428,7 +442,10 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
428
442
  return result.value;
429
443
  };
430
444
  const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
431
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
445
+ const ctx = _ctx ? {
446
+ ..._ctx,
447
+ async: true
448
+ } : { async: true };
432
449
  let result = schema._zod.run({
433
450
  value,
434
451
  issues: []
@@ -461,7 +478,10 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
461
478
  };
462
479
  const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
463
480
  const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
464
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
481
+ const ctx = _ctx ? {
482
+ ..._ctx,
483
+ async: true
484
+ } : { async: true };
465
485
  let result = schema._zod.run({
466
486
  value,
467
487
  issues: []
@@ -477,36 +497,53 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
477
497
  };
478
498
  const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
479
499
  const _encode = (_Err) => (schema, value, _ctx) => {
480
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
500
+ const ctx = _ctx ? {
501
+ ..._ctx,
502
+ direction: "backward"
503
+ } : { direction: "backward" };
481
504
  return _parse(_Err)(schema, value, ctx);
482
505
  };
483
506
  const _decode = (_Err) => (schema, value, _ctx) => {
484
507
  return _parse(_Err)(schema, value, _ctx);
485
508
  };
486
509
  const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
487
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
510
+ const ctx = _ctx ? {
511
+ ..._ctx,
512
+ direction: "backward"
513
+ } : { direction: "backward" };
488
514
  return _parseAsync(_Err)(schema, value, ctx);
489
515
  };
490
516
  const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
491
517
  return _parseAsync(_Err)(schema, value, _ctx);
492
518
  };
493
519
  const _safeEncode = (_Err) => (schema, value, _ctx) => {
494
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
520
+ const ctx = _ctx ? {
521
+ ..._ctx,
522
+ direction: "backward"
523
+ } : { direction: "backward" };
495
524
  return _safeParse(_Err)(schema, value, ctx);
496
525
  };
497
526
  const _safeDecode = (_Err) => (schema, value, _ctx) => {
498
527
  return _safeParse(_Err)(schema, value, _ctx);
499
528
  };
500
529
  const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
501
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
530
+ const ctx = _ctx ? {
531
+ ..._ctx,
532
+ direction: "backward"
533
+ } : { direction: "backward" };
502
534
  return _safeParseAsync(_Err)(schema, value, ctx);
503
535
  };
504
536
  const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
505
537
  return _safeParseAsync(_Err)(schema, value, _ctx);
506
538
  };
507
539
  //#endregion
508
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/regexes.js
509
- const cuid = /^[cC][^\s-]{8,}$/;
540
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
541
+ /**
542
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
543
+ * (timestamps embedded in the id). Use {@link cuid2} instead.
544
+ * See https://github.com/paralleldrive/cuid.
545
+ */
546
+ const cuid = /^[cC][0-9a-z]{6,}$/;
510
547
  const cuid2 = /^[0-9a-z]+$/;
511
548
  const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
512
549
  const xid = /^[0-9a-vA-V]{20}$/;
@@ -535,6 +572,7 @@ const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-
535
572
  const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
536
573
  const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
537
574
  const base64url = /^[A-Za-z0-9_-]*$/;
575
+ const httpProtocol = /^https?$/;
538
576
  const e164 = /^\+[1-9]\d{6,14}$/;
539
577
  const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
540
578
  const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
@@ -560,7 +598,7 @@ const string$1 = (params) => {
560
598
  const lowercase = /^[^A-Z]*$/;
561
599
  const uppercase = /^[^a-z]*$/;
562
600
  //#endregion
563
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/checks.js
601
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
564
602
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
565
603
  var _a;
566
604
  inst._zod ?? (inst._zod = {});
@@ -779,7 +817,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
779
817
  };
780
818
  });
781
819
  //#endregion
782
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/doc.js
820
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
783
821
  var Doc = class {
784
822
  constructor(args = []) {
785
823
  this.content = [];
@@ -810,14 +848,14 @@ var Doc = class {
810
848
  }
811
849
  };
812
850
  //#endregion
813
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/versions.js
851
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
814
852
  const version = {
815
853
  major: 4,
816
- minor: 3,
817
- patch: 2
854
+ minor: 4,
855
+ patch: 3
818
856
  };
819
857
  //#endregion
820
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/schemas.js
858
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
821
859
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
822
860
  var _a;
823
861
  inst ?? (inst = {});
@@ -838,6 +876,7 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
838
876
  let asyncResult;
839
877
  for (const ch of checks) {
840
878
  if (ch._zod.def.when) {
879
+ if (explicitlyAborted(payload)) continue;
841
880
  if (!ch._zod.def.when(payload)) continue;
842
881
  } else if (isAborted) continue;
843
882
  const currLen = payload.issues.length;
@@ -957,6 +996,19 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
957
996
  inst._zod.check = (payload) => {
958
997
  try {
959
998
  const trimmed = payload.value.trim();
999
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1000
+ if (!/^https?:\/\//i.test(trimmed)) {
1001
+ payload.issues.push({
1002
+ code: "invalid_format",
1003
+ format: "url",
1004
+ note: "Invalid URL format",
1005
+ input: payload.value,
1006
+ inst,
1007
+ continue: !def.abort
1008
+ });
1009
+ return;
1010
+ }
1011
+ }
960
1012
  const url = new URL(trimmed);
961
1013
  if (def.hostname) {
962
1014
  def.hostname.lastIndex = 0;
@@ -1004,6 +1056,11 @@ const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1004
1056
  def.pattern ?? (def.pattern = nanoid);
1005
1057
  $ZodStringFormat.init(inst, def);
1006
1058
  });
1059
+ /**
1060
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1061
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
1062
+ * See https://github.com/paralleldrive/cuid.
1063
+ */
1007
1064
  const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
1008
1065
  def.pattern ?? (def.pattern = cuid);
1009
1066
  $ZodStringFormat.init(inst, def);
@@ -1093,6 +1150,7 @@ const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1093
1150
  });
1094
1151
  function isValidBase64(data) {
1095
1152
  if (data === "") return true;
1153
+ if (/\s/.test(data)) return false;
1096
1154
  if (data.length % 4 !== 0) return false;
1097
1155
  try {
1098
1156
  atob(data);
@@ -1216,13 +1274,23 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1216
1274
  return payload;
1217
1275
  };
1218
1276
  });
1219
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
1277
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1278
+ const isPresent = key in input;
1220
1279
  if (result.issues.length) {
1221
- if (isOptionalOut && !(key in input)) return;
1280
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
1222
1281
  final.issues.push(...prefixIssues(key, result.issues));
1223
1282
  }
1283
+ if (!isPresent && !isOptionalIn) {
1284
+ if (!result.issues.length) final.issues.push({
1285
+ code: "invalid_type",
1286
+ expected: "nonoptional",
1287
+ input: void 0,
1288
+ path: [key]
1289
+ });
1290
+ return;
1291
+ }
1224
1292
  if (result.value === void 0) {
1225
- if (key in input) final.value[key] = void 0;
1293
+ if (isPresent) final.value[key] = void 0;
1226
1294
  } else final.value[key] = result.value;
1227
1295
  }
1228
1296
  function normalizeDef(def) {
@@ -1242,8 +1310,10 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1242
1310
  const keySet = def.keySet;
1243
1311
  const _catchall = def.catchall._zod;
1244
1312
  const t = _catchall.def.type;
1313
+ const isOptionalIn = _catchall.optin === "optional";
1245
1314
  const isOptionalOut = _catchall.optout === "optional";
1246
1315
  for (const key in input) {
1316
+ if (key === "__proto__") continue;
1247
1317
  if (keySet.has(key)) continue;
1248
1318
  if (t === "never") {
1249
1319
  unrecognized.push(key);
@@ -1253,8 +1323,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1253
1323
  value: input[key],
1254
1324
  issues: []
1255
1325
  }, ctx);
1256
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1257
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1326
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1327
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1258
1328
  }
1259
1329
  if (unrecognized.length) payload.issues.push({
1260
1330
  code: "unrecognized_keys",
@@ -1310,13 +1380,14 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1310
1380
  const shape = value.shape;
1311
1381
  for (const key of value.keys) {
1312
1382
  const el = shape[key];
1383
+ const isOptionalIn = el._zod.optin === "optional";
1313
1384
  const isOptionalOut = el._zod.optout === "optional";
1314
1385
  const r = el._zod.run({
1315
1386
  value: input[key],
1316
1387
  issues: []
1317
1388
  }, ctx);
1318
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1319
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1389
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1390
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1320
1391
  }
1321
1392
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1322
1393
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
@@ -1345,9 +1416,11 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
1345
1416
  for (const key of normalized.keys) {
1346
1417
  const id = ids[key];
1347
1418
  const k = esc(key);
1348
- const isOptionalOut = shape[key]?._zod?.optout === "optional";
1419
+ const schema = shape[key];
1420
+ const isOptionalIn = schema?._zod?.optin === "optional";
1421
+ const isOptionalOut = schema?._zod?.optout === "optional";
1349
1422
  doc.write(`const ${id} = ${parseStr(key)};`);
1350
- if (isOptionalOut) doc.write(`
1423
+ if (isOptionalIn && isOptionalOut) doc.write(`
1351
1424
  if (${id}.issues.length) {
1352
1425
  if (${k} in input) {
1353
1426
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
@@ -1365,6 +1438,32 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
1365
1438
  newResult[${k}] = ${id}.value;
1366
1439
  }
1367
1440
 
1441
+ `);
1442
+ else if (!isOptionalIn) doc.write(`
1443
+ const ${id}_present = ${k} in input;
1444
+ if (${id}.issues.length) {
1445
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1446
+ ...iss,
1447
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1448
+ })));
1449
+ }
1450
+ if (!${id}_present && !${id}.issues.length) {
1451
+ payload.issues.push({
1452
+ code: "invalid_type",
1453
+ expected: "nonoptional",
1454
+ input: undefined,
1455
+ path: [${k}]
1456
+ });
1457
+ }
1458
+
1459
+ if (${id}_present) {
1460
+ if (${id}.value === undefined) {
1461
+ newResult[${k}] = undefined;
1462
+ } else {
1463
+ newResult[${k}] = ${id}.value;
1464
+ }
1465
+ }
1466
+
1368
1467
  `);
1369
1468
  else doc.write(`
1370
1469
  if (${id}.issues.length) {
@@ -1447,10 +1546,9 @@ const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1447
1546
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1448
1547
  }
1449
1548
  });
1450
- const single = def.options.length === 1;
1451
- const first = def.options[0]._zod.run;
1549
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1452
1550
  inst._zod.parse = (payload, ctx) => {
1453
- if (single) return first(payload, ctx);
1551
+ if (first) return first(payload, ctx);
1454
1552
  let async = false;
1455
1553
  const results = [];
1456
1554
  for (const option of def.options) {
@@ -1591,20 +1689,23 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
1591
1689
  });
1592
1690
  const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
1593
1691
  $ZodType.init(inst, def);
1692
+ inst._zod.optin = "optional";
1594
1693
  inst._zod.parse = (payload, ctx) => {
1595
1694
  if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1596
1695
  const _out = def.transform(payload.value, payload);
1597
1696
  if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1598
1697
  payload.value = output;
1698
+ payload.fallback = true;
1599
1699
  return payload;
1600
1700
  });
1601
1701
  if (_out instanceof Promise) throw new $ZodAsyncError();
1602
1702
  payload.value = _out;
1703
+ payload.fallback = true;
1603
1704
  return payload;
1604
1705
  };
1605
1706
  });
1606
1707
  function handleOptionalResult(result, input) {
1607
- if (result.issues.length && input === void 0) return {
1708
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
1608
1709
  issues: [],
1609
1710
  value: void 0
1610
1711
  };
@@ -1623,9 +1724,10 @@ const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
1623
1724
  });
1624
1725
  inst._zod.parse = (payload, ctx) => {
1625
1726
  if (def.innerType._zod.optin === "optional") {
1727
+ const input = payload.value;
1626
1728
  const result = def.innerType._zod.run(payload, ctx);
1627
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
1628
- return handleOptionalResult(result, payload.value);
1729
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
1730
+ return handleOptionalResult(result, input);
1629
1731
  }
1630
1732
  if (payload.value === void 0) return payload;
1631
1733
  return def.innerType._zod.run(payload, ctx);
@@ -1710,7 +1812,7 @@ function handleNonOptionalResult(payload, inst) {
1710
1812
  }
1711
1813
  const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
1712
1814
  $ZodType.init(inst, def);
1713
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1815
+ inst._zod.optin = "optional";
1714
1816
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1715
1817
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1716
1818
  inst._zod.parse = (payload, ctx) => {
@@ -1725,6 +1827,7 @@ const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
1725
1827
  input: payload.value
1726
1828
  });
1727
1829
  payload.issues = [];
1830
+ payload.fallback = true;
1728
1831
  }
1729
1832
  return payload;
1730
1833
  });
@@ -1736,6 +1839,7 @@ const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
1736
1839
  input: payload.value
1737
1840
  });
1738
1841
  payload.issues = [];
1842
+ payload.fallback = true;
1739
1843
  }
1740
1844
  return payload;
1741
1845
  };
@@ -1764,7 +1868,8 @@ function handlePipeResult(left, next, ctx) {
1764
1868
  }
1765
1869
  return next._zod.run({
1766
1870
  value: left.value,
1767
- issues: left.issues
1871
+ issues: left.issues,
1872
+ fallback: left.fallback
1768
1873
  }, ctx);
1769
1874
  }
1770
1875
  const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
@@ -1811,7 +1916,7 @@ function handleRefineResult(result, payload, input, inst) {
1811
1916
  }
1812
1917
  }
1813
1918
  //#endregion
1814
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/registries.js
1919
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
1815
1920
  var _a;
1816
1921
  var $ZodRegistry = class {
1817
1922
  constructor() {
@@ -1858,7 +1963,7 @@ function registry() {
1858
1963
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
1859
1964
  const globalRegistry = globalThis.__zod_globalRegistry;
1860
1965
  //#endregion
1861
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/api.js
1966
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
1862
1967
  // @__NO_SIDE_EFFECTS__
1863
1968
  function _string(Class, params) {
1864
1969
  return new Class({
@@ -1959,6 +2064,11 @@ function _nanoid(Class, params) {
1959
2064
  ...normalizeParams(params)
1960
2065
  });
1961
2066
  }
2067
+ /**
2068
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
2069
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
2070
+ * See https://github.com/paralleldrive/cuid.
2071
+ */
1962
2072
  // @__NO_SIDE_EFFECTS__
1963
2073
  function _cuid(Class, params) {
1964
2074
  return new Class({
@@ -2261,7 +2371,7 @@ function _refine(Class, fn, _params) {
2261
2371
  });
2262
2372
  }
2263
2373
  // @__NO_SIDE_EFFECTS__
2264
- function _superRefine(fn) {
2374
+ function _superRefine(fn, params) {
2265
2375
  const ch = /* @__PURE__ */ _check((payload) => {
2266
2376
  payload.addIssue = (issue$2) => {
2267
2377
  if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
@@ -2276,7 +2386,7 @@ function _superRefine(fn) {
2276
2386
  }
2277
2387
  };
2278
2388
  return fn(payload.value, payload);
2279
- });
2389
+ }, params);
2280
2390
  return ch;
2281
2391
  }
2282
2392
  // @__NO_SIDE_EFFECTS__
@@ -2289,7 +2399,7 @@ function _check(fn, params) {
2289
2399
  return ch;
2290
2400
  }
2291
2401
  //#endregion
2292
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/to-json-schema.js
2402
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2293
2403
  function initializeContext(params) {
2294
2404
  let target = params?.target ?? "draft-2020-12";
2295
2405
  if (target === "draft-4") target = "draft-04";
@@ -2355,7 +2465,7 @@ function process$1(schema, ctx, _params = {
2355
2465
  delete result.schema.examples;
2356
2466
  delete result.schema.default;
2357
2467
  }
2358
- if (ctx.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2468
+ if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2359
2469
  delete result.schema._prefault;
2360
2470
  return ctx.seen.get(schema).schema;
2361
2471
  }
@@ -2460,7 +2570,7 @@ function finalize(ctx, schema) {
2460
2570
  if (key === "$ref" || key === "allOf") continue;
2461
2571
  if (!(key in _cached)) delete schema[key];
2462
2572
  }
2463
- if (refSchema.$ref) for (const key in schema) {
2573
+ if (refSchema.$ref && refSeen.def) for (const key in schema) {
2464
2574
  if (key === "$ref" || key === "allOf") continue;
2465
2575
  if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
2466
2576
  }
@@ -2495,13 +2605,20 @@ function finalize(ctx, schema) {
2495
2605
  result.$id = ctx.external.uri(id);
2496
2606
  }
2497
2607
  Object.assign(result, root.def ?? root.schema);
2608
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
2609
+ if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
2498
2610
  const defs = ctx.external?.defs ?? {};
2499
2611
  for (const entry of ctx.seen.entries()) {
2500
2612
  const seen = entry[1];
2501
- if (seen.def && seen.defId) defs[seen.defId] = seen.def;
2613
+ if (seen.def && seen.defId) {
2614
+ if (seen.def.id === seen.defId) delete seen.def.id;
2615
+ defs[seen.defId] = seen.def;
2616
+ }
2617
+ }
2618
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) {
2619
+ if (ctx.target === "draft-2020-12") result.$defs = defs;
2620
+ else result.definitions = defs;
2502
2621
  }
2503
- if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
2504
- else result.definitions = defs;
2505
2622
  try {
2506
2623
  const finalized = JSON.parse(JSON.stringify(result));
2507
2624
  Object.defineProperty(finalized, "~standard", {
@@ -2532,7 +2649,10 @@ function isTransforming(_schema, _ctx) {
2532
2649
  if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
2533
2650
  if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2534
2651
  if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2535
- if (def.type === "pipe") return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
2652
+ if (def.type === "pipe") {
2653
+ if (_schema._zod.traits.has("$ZodCodec")) return true;
2654
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
2655
+ }
2536
2656
  if (def.type === "object") {
2537
2657
  for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
2538
2658
  return false;
@@ -2574,7 +2694,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
2574
2694
  return finalize(ctx, schema);
2575
2695
  };
2576
2696
  //#endregion
2577
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/core/json-schema-processors.js
2697
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
2578
2698
  const formatMap = {
2579
2699
  guid: "uuid",
2580
2700
  url: "uri",
@@ -2739,7 +2859,8 @@ const catchProcessor = (schema, ctx, json, params) => {
2739
2859
  };
2740
2860
  const pipeProcessor = (schema, ctx, _json, params) => {
2741
2861
  const def = schema._zod.def;
2742
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
2862
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
2863
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
2743
2864
  process$1(innerType, ctx, params);
2744
2865
  const seen = ctx.seen.get(schema);
2745
2866
  seen.ref = innerType;
@@ -2758,7 +2879,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
2758
2879
  seen.ref = def.innerType;
2759
2880
  };
2760
2881
  //#endregion
2761
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/classic/iso.js
2882
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
2762
2883
  const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
2763
2884
  $ZodISODateTime.init(inst, def);
2764
2885
  ZodStringFormat.init(inst, def);
@@ -2788,7 +2909,7 @@ function duration(params) {
2788
2909
  return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
2789
2910
  }
2790
2911
  //#endregion
2791
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/classic/errors.js
2912
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
2792
2913
  const initializer = (inst, issues) => {
2793
2914
  $ZodError.init(inst, issues);
2794
2915
  inst.name = "ZodError";
@@ -2808,10 +2929,9 @@ const initializer = (inst, issues) => {
2808
2929
  } }
2809
2930
  });
2810
2931
  };
2811
- $constructor("ZodError", initializer);
2812
- const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
2932
+ const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
2813
2933
  //#endregion
2814
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/classic/parse.js
2934
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
2815
2935
  const parse = /* @__PURE__ */ _parse(ZodRealError);
2816
2936
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
2817
2937
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -2825,7 +2945,43 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
2825
2945
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
2826
2946
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
2827
2947
  //#endregion
2828
- //#region ../../node_modules/.pnpm/zod@4.3.2/node_modules/zod/v4/classic/schemas.js
2948
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
2949
+ const _installedGroups = /* @__PURE__ */ new WeakMap();
2950
+ function _installLazyMethods(inst, group, methods) {
2951
+ const proto = Object.getPrototypeOf(inst);
2952
+ let installed = _installedGroups.get(proto);
2953
+ if (!installed) {
2954
+ installed = /* @__PURE__ */ new Set();
2955
+ _installedGroups.set(proto, installed);
2956
+ }
2957
+ if (installed.has(group)) return;
2958
+ installed.add(group);
2959
+ for (const key in methods) {
2960
+ const fn = methods[key];
2961
+ Object.defineProperty(proto, key, {
2962
+ configurable: true,
2963
+ enumerable: false,
2964
+ get() {
2965
+ const bound = fn.bind(this);
2966
+ Object.defineProperty(this, key, {
2967
+ configurable: true,
2968
+ writable: true,
2969
+ enumerable: true,
2970
+ value: bound
2971
+ });
2972
+ return bound;
2973
+ },
2974
+ set(v) {
2975
+ Object.defineProperty(this, key, {
2976
+ configurable: true,
2977
+ writable: true,
2978
+ enumerable: true,
2979
+ value: v
2980
+ });
2981
+ }
2982
+ });
2983
+ }
2984
+ }
2829
2985
  const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
2830
2986
  $ZodType.init(inst, def);
2831
2987
  Object.assign(inst["~standard"], { jsonSchema: {
@@ -2836,20 +2992,6 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
2836
2992
  inst.def = def;
2837
2993
  inst.type = def.type;
2838
2994
  Object.defineProperty(inst, "_def", { value: def });
2839
- inst.check = (...checks) => {
2840
- return inst.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
2841
- check: ch,
2842
- def: { check: "custom" },
2843
- onattach: []
2844
- } } : ch)] }), { parent: true });
2845
- };
2846
- inst.with = inst.check;
2847
- inst.clone = (def, params) => clone(inst, def, params);
2848
- inst.brand = () => inst;
2849
- inst.register = ((reg, meta) => {
2850
- reg.add(inst, meta);
2851
- return inst;
2852
- });
2853
2995
  inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
2854
2996
  inst.safeParse = (data, params) => safeParse(inst, data, params);
2855
2997
  inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
@@ -2863,43 +3005,106 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
2863
3005
  inst.safeDecode = (data, params) => safeDecode(inst, data, params);
2864
3006
  inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
2865
3007
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
2866
- inst.refine = (check, params) => inst.check(refine(check, params));
2867
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
2868
- inst.overwrite = (fn) => inst.check(/* @__PURE__ */ _overwrite(fn));
2869
- inst.optional = () => optional(inst);
2870
- inst.exactOptional = () => exactOptional(inst);
2871
- inst.nullable = () => nullable(inst);
2872
- inst.nullish = () => optional(nullable(inst));
2873
- inst.nonoptional = (params) => nonoptional(inst, params);
2874
- inst.array = () => array(inst);
2875
- inst.or = (arg) => union([inst, arg]);
2876
- inst.and = (arg) => intersection(inst, arg);
2877
- inst.transform = (tx) => pipe(inst, transform(tx));
2878
- inst.default = (def) => _default(inst, def);
2879
- inst.prefault = (def) => prefault(inst, def);
2880
- inst.catch = (params) => _catch(inst, params);
2881
- inst.pipe = (target) => pipe(inst, target);
2882
- inst.readonly = () => readonly(inst);
2883
- inst.describe = (description) => {
2884
- const cl = inst.clone();
2885
- globalRegistry.add(cl, { description });
2886
- return cl;
2887
- };
3008
+ _installLazyMethods(inst, "ZodType", {
3009
+ check(...chks) {
3010
+ const def = this.def;
3011
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3012
+ check: ch,
3013
+ def: { check: "custom" },
3014
+ onattach: []
3015
+ } } : ch)] }), { parent: true });
3016
+ },
3017
+ with(...chks) {
3018
+ return this.check(...chks);
3019
+ },
3020
+ clone(def, params) {
3021
+ return clone(this, def, params);
3022
+ },
3023
+ brand() {
3024
+ return this;
3025
+ },
3026
+ register(reg, meta) {
3027
+ reg.add(this, meta);
3028
+ return this;
3029
+ },
3030
+ refine(check, params) {
3031
+ return this.check(refine(check, params));
3032
+ },
3033
+ superRefine(refinement, params) {
3034
+ return this.check(superRefine(refinement, params));
3035
+ },
3036
+ overwrite(fn) {
3037
+ return this.check(/* @__PURE__ */ _overwrite(fn));
3038
+ },
3039
+ optional() {
3040
+ return optional(this);
3041
+ },
3042
+ exactOptional() {
3043
+ return exactOptional(this);
3044
+ },
3045
+ nullable() {
3046
+ return nullable(this);
3047
+ },
3048
+ nullish() {
3049
+ return optional(nullable(this));
3050
+ },
3051
+ nonoptional(params) {
3052
+ return nonoptional(this, params);
3053
+ },
3054
+ array() {
3055
+ return array(this);
3056
+ },
3057
+ or(arg) {
3058
+ return union([this, arg]);
3059
+ },
3060
+ and(arg) {
3061
+ return intersection(this, arg);
3062
+ },
3063
+ transform(tx) {
3064
+ return pipe(this, transform(tx));
3065
+ },
3066
+ default(d) {
3067
+ return _default(this, d);
3068
+ },
3069
+ prefault(d) {
3070
+ return prefault(this, d);
3071
+ },
3072
+ catch(params) {
3073
+ return _catch(this, params);
3074
+ },
3075
+ pipe(target) {
3076
+ return pipe(this, target);
3077
+ },
3078
+ readonly() {
3079
+ return readonly(this);
3080
+ },
3081
+ describe(description) {
3082
+ const cl = this.clone();
3083
+ globalRegistry.add(cl, { description });
3084
+ return cl;
3085
+ },
3086
+ meta(...args) {
3087
+ if (args.length === 0) return globalRegistry.get(this);
3088
+ const cl = this.clone();
3089
+ globalRegistry.add(cl, args[0]);
3090
+ return cl;
3091
+ },
3092
+ isOptional() {
3093
+ return this.safeParse(void 0).success;
3094
+ },
3095
+ isNullable() {
3096
+ return this.safeParse(null).success;
3097
+ },
3098
+ apply(fn) {
3099
+ return fn(this);
3100
+ }
3101
+ });
2888
3102
  Object.defineProperty(inst, "description", {
2889
3103
  get() {
2890
3104
  return globalRegistry.get(inst)?.description;
2891
3105
  },
2892
3106
  configurable: true
2893
3107
  });
2894
- inst.meta = (...args) => {
2895
- if (args.length === 0) return globalRegistry.get(inst);
2896
- const cl = inst.clone();
2897
- globalRegistry.add(cl, args[0]);
2898
- return cl;
2899
- };
2900
- inst.isOptional = () => inst.safeParse(void 0).success;
2901
- inst.isNullable = () => inst.safeParse(null).success;
2902
- inst.apply = (fn) => fn(inst);
2903
3108
  return inst;
2904
3109
  });
2905
3110
  /** @internal */
@@ -2911,21 +3116,53 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
2911
3116
  inst.format = bag.format ?? null;
2912
3117
  inst.minLength = bag.minimum ?? null;
2913
3118
  inst.maxLength = bag.maximum ?? null;
2914
- inst.regex = (...args) => inst.check(/* @__PURE__ */ _regex(...args));
2915
- inst.includes = (...args) => inst.check(/* @__PURE__ */ _includes(...args));
2916
- inst.startsWith = (...args) => inst.check(/* @__PURE__ */ _startsWith(...args));
2917
- inst.endsWith = (...args) => inst.check(/* @__PURE__ */ _endsWith(...args));
2918
- inst.min = (...args) => inst.check(/* @__PURE__ */ _minLength(...args));
2919
- inst.max = (...args) => inst.check(/* @__PURE__ */ _maxLength(...args));
2920
- inst.length = (...args) => inst.check(/* @__PURE__ */ _length(...args));
2921
- inst.nonempty = (...args) => inst.check(/* @__PURE__ */ _minLength(1, ...args));
2922
- inst.lowercase = (params) => inst.check(/* @__PURE__ */ _lowercase(params));
2923
- inst.uppercase = (params) => inst.check(/* @__PURE__ */ _uppercase(params));
2924
- inst.trim = () => inst.check(/* @__PURE__ */ _trim());
2925
- inst.normalize = (...args) => inst.check(/* @__PURE__ */ _normalize(...args));
2926
- inst.toLowerCase = () => inst.check(/* @__PURE__ */ _toLowerCase());
2927
- inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
2928
- inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
3119
+ _installLazyMethods(inst, "_ZodString", {
3120
+ regex(...args) {
3121
+ return this.check(/* @__PURE__ */ _regex(...args));
3122
+ },
3123
+ includes(...args) {
3124
+ return this.check(/* @__PURE__ */ _includes(...args));
3125
+ },
3126
+ startsWith(...args) {
3127
+ return this.check(/* @__PURE__ */ _startsWith(...args));
3128
+ },
3129
+ endsWith(...args) {
3130
+ return this.check(/* @__PURE__ */ _endsWith(...args));
3131
+ },
3132
+ min(...args) {
3133
+ return this.check(/* @__PURE__ */ _minLength(...args));
3134
+ },
3135
+ max(...args) {
3136
+ return this.check(/* @__PURE__ */ _maxLength(...args));
3137
+ },
3138
+ length(...args) {
3139
+ return this.check(/* @__PURE__ */ _length(...args));
3140
+ },
3141
+ nonempty(...args) {
3142
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
3143
+ },
3144
+ lowercase(params) {
3145
+ return this.check(/* @__PURE__ */ _lowercase(params));
3146
+ },
3147
+ uppercase(params) {
3148
+ return this.check(/* @__PURE__ */ _uppercase(params));
3149
+ },
3150
+ trim() {
3151
+ return this.check(/* @__PURE__ */ _trim());
3152
+ },
3153
+ normalize(...args) {
3154
+ return this.check(/* @__PURE__ */ _normalize(...args));
3155
+ },
3156
+ toLowerCase() {
3157
+ return this.check(/* @__PURE__ */ _toLowerCase());
3158
+ },
3159
+ toUpperCase() {
3160
+ return this.check(/* @__PURE__ */ _toUpperCase());
3161
+ },
3162
+ slugify() {
3163
+ return this.check(/* @__PURE__ */ _slugify());
3164
+ }
3165
+ });
2929
3166
  });
2930
3167
  const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
2931
3168
  $ZodString.init(inst, def);
@@ -2989,6 +3226,11 @@ const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
2989
3226
  $ZodNanoID.init(inst, def);
2990
3227
  ZodStringFormat.init(inst, def);
2991
3228
  });
3229
+ /**
3230
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
3231
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
3232
+ * See https://github.com/paralleldrive/cuid.
3233
+ */
2992
3234
  const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
2993
3235
  $ZodCUID.init(inst, def);
2994
3236
  ZodStringFormat.init(inst, def);
@@ -3062,11 +3304,23 @@ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
3062
3304
  ZodType.init(inst, def);
3063
3305
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3064
3306
  inst.element = def.element;
3065
- inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
3066
- inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
3067
- inst.max = (maxLength, params) => inst.check(/* @__PURE__ */ _maxLength(maxLength, params));
3068
- inst.length = (len, params) => inst.check(/* @__PURE__ */ _length(len, params));
3069
- inst.unwrap = () => inst.element;
3307
+ _installLazyMethods(inst, "ZodArray", {
3308
+ min(n, params) {
3309
+ return this.check(/* @__PURE__ */ _minLength(n, params));
3310
+ },
3311
+ nonempty(params) {
3312
+ return this.check(/* @__PURE__ */ _minLength(1, params));
3313
+ },
3314
+ max(n, params) {
3315
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
3316
+ },
3317
+ length(n, params) {
3318
+ return this.check(/* @__PURE__ */ _length(n, params));
3319
+ },
3320
+ unwrap() {
3321
+ return this.element;
3322
+ }
3323
+ });
3070
3324
  });
3071
3325
  function array(element, params) {
3072
3326
  return /* @__PURE__ */ _array(ZodArray, element, params);
@@ -3078,38 +3332,62 @@ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
3078
3332
  defineLazy(inst, "shape", () => {
3079
3333
  return def.shape;
3080
3334
  });
3081
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
3082
- inst.catchall = (catchall) => inst.clone({
3083
- ...inst._zod.def,
3084
- catchall
3085
- });
3086
- inst.passthrough = () => inst.clone({
3087
- ...inst._zod.def,
3088
- catchall: unknown()
3089
- });
3090
- inst.loose = () => inst.clone({
3091
- ...inst._zod.def,
3092
- catchall: unknown()
3093
- });
3094
- inst.strict = () => inst.clone({
3095
- ...inst._zod.def,
3096
- catchall: never()
3097
- });
3098
- inst.strip = () => inst.clone({
3099
- ...inst._zod.def,
3100
- catchall: void 0
3335
+ _installLazyMethods(inst, "ZodObject", {
3336
+ keyof() {
3337
+ return _enum(Object.keys(this._zod.def.shape));
3338
+ },
3339
+ catchall(catchall) {
3340
+ return this.clone({
3341
+ ...this._zod.def,
3342
+ catchall
3343
+ });
3344
+ },
3345
+ passthrough() {
3346
+ return this.clone({
3347
+ ...this._zod.def,
3348
+ catchall: unknown()
3349
+ });
3350
+ },
3351
+ loose() {
3352
+ return this.clone({
3353
+ ...this._zod.def,
3354
+ catchall: unknown()
3355
+ });
3356
+ },
3357
+ strict() {
3358
+ return this.clone({
3359
+ ...this._zod.def,
3360
+ catchall: never()
3361
+ });
3362
+ },
3363
+ strip() {
3364
+ return this.clone({
3365
+ ...this._zod.def,
3366
+ catchall: void 0
3367
+ });
3368
+ },
3369
+ extend(incoming) {
3370
+ return extend(this, incoming);
3371
+ },
3372
+ safeExtend(incoming) {
3373
+ return safeExtend(this, incoming);
3374
+ },
3375
+ merge(other) {
3376
+ return merge(this, other);
3377
+ },
3378
+ pick(mask) {
3379
+ return pick(this, mask);
3380
+ },
3381
+ omit(mask) {
3382
+ return omit(this, mask);
3383
+ },
3384
+ partial(...args) {
3385
+ return partial(ZodOptional, this, args[0]);
3386
+ },
3387
+ required(...args) {
3388
+ return required(ZodNonOptional, this, args[0]);
3389
+ }
3101
3390
  });
3102
- inst.extend = (incoming) => {
3103
- return extend(inst, incoming);
3104
- };
3105
- inst.safeExtend = (incoming) => {
3106
- return safeExtend(inst, incoming);
3107
- };
3108
- inst.merge = (other) => merge(inst, other);
3109
- inst.pick = (mask) => pick(inst, mask);
3110
- inst.omit = (mask) => omit(inst, mask);
3111
- inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
3112
- inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
3113
3391
  });
3114
3392
  function object(shape, params) {
3115
3393
  const def = {
@@ -3202,9 +3480,11 @@ const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
3202
3480
  const output = def.transform(payload.value, payload);
3203
3481
  if (output instanceof Promise) return output.then((output) => {
3204
3482
  payload.value = output;
3483
+ payload.fallback = true;
3205
3484
  return payload;
3206
3485
  });
3207
3486
  payload.value = output;
3487
+ payload.fallback = true;
3208
3488
  return payload;
3209
3489
  };
3210
3490
  });
@@ -3342,8 +3622,8 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
3342
3622
  function refine(fn, _params = {}) {
3343
3623
  return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
3344
3624
  }
3345
- function superRefine(fn) {
3346
- return /* @__PURE__ */ _superRefine(fn);
3625
+ function superRefine(fn, params) {
3626
+ return /* @__PURE__ */ _superRefine(fn, params);
3347
3627
  }
3348
3628
  //#endregion
3349
3629
  //#region src/errors.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alienplatform/bindings",
3
- "version": "3.3.11",
3
+ "version": "3.3.12",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "types": "./dist/index.d.ts",
@@ -44,23 +44,23 @@
44
44
  "access": "public"
45
45
  },
46
46
  "devDependencies": {
47
- "@biomejs/biome": "^1.9.4",
47
+ "@biomejs/biome": "^2.0.0",
48
48
  "@napi-rs/cli": "^3.0.0",
49
49
  "@types/node": "^24.0.15",
50
50
  "tsdown": "^0.13.0",
51
- "typescript": "^5.8.3",
52
- "vitest": "^3.1.4",
53
- "zod": "4.3.2",
51
+ "typescript": "~5.9.0",
52
+ "vitest": "^4.0.0",
53
+ "zod": "4.4.3",
54
54
  "@alienplatform/typescript-config": "^1.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@alienplatform/core": "^3.3.11"
57
+ "@alienplatform/core": "^3.3.12"
58
58
  },
59
59
  "optionalDependencies": {
60
- "@alienplatform/bindings-darwin-arm64": "3.3.11",
61
- "@alienplatform/bindings-darwin-x64": "3.3.11",
62
- "@alienplatform/bindings-linux-x64-gnu": "3.3.11",
63
- "@alienplatform/bindings-linux-arm64-gnu": "3.3.11"
60
+ "@alienplatform/bindings-darwin-arm64": "3.3.12",
61
+ "@alienplatform/bindings-darwin-x64": "3.3.12",
62
+ "@alienplatform/bindings-linux-x64-gnu": "3.3.12",
63
+ "@alienplatform/bindings-linux-arm64-gnu": "3.3.12"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsdown && tsc -p tsconfig.build.json --emitDeclarationOnly",