@coursebuilder/adapter-drizzle 0.0.5 → 0.0.6

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 (67) hide show
  1. package/dist/{chunk-RMRO5TA7.js → chunk-22KIKVBY.js} +2 -2
  2. package/dist/{chunk-PUGK2AEH.js → chunk-4HDU7QIB.js} +3 -2
  3. package/dist/{chunk-JQFZOCAU.js → chunk-FRNVLW7N.js} +595 -288
  4. package/dist/{chunk-LLWSIKQV.js → chunk-GFUUJRX7.js} +1 -1
  5. package/dist/{chunk-NISOQSUL.js → chunk-PFN4YUQZ.js} +2 -2
  6. package/dist/index.d.ts +0 -2
  7. package/dist/index.js +5 -5
  8. package/dist/lib/mysql/index.cjs +673 -365
  9. package/dist/lib/mysql/index.cjs.map +1 -1
  10. package/dist/lib/mysql/index.js +3 -3
  11. package/dist/lib/mysql/schemas/auth/accounts.cjs +2 -1
  12. package/dist/lib/mysql/schemas/auth/accounts.cjs.map +1 -1
  13. package/dist/lib/mysql/schemas/auth/accounts.js +1 -1
  14. package/dist/lib/mysql/schemas/auth/permissions.cjs.map +1 -1
  15. package/dist/lib/mysql/schemas/auth/permissions.js +1 -1
  16. package/dist/lib/mysql/schemas/auth/role-permissions.cjs.map +1 -1
  17. package/dist/lib/mysql/schemas/auth/role-permissions.js +1 -1
  18. package/dist/lib/mysql/schemas/auth/roles.cjs.map +1 -1
  19. package/dist/lib/mysql/schemas/auth/roles.js +1 -1
  20. package/dist/lib/mysql/schemas/auth/sessions.cjs +2 -1
  21. package/dist/lib/mysql/schemas/auth/sessions.cjs.map +1 -1
  22. package/dist/lib/mysql/schemas/auth/sessions.js +2 -2
  23. package/dist/lib/mysql/schemas/auth/user-permissions.cjs +2 -1
  24. package/dist/lib/mysql/schemas/auth/user-permissions.cjs.map +1 -1
  25. package/dist/lib/mysql/schemas/auth/user-permissions.js +1 -1
  26. package/dist/lib/mysql/schemas/auth/user-roles.cjs +2 -1
  27. package/dist/lib/mysql/schemas/auth/user-roles.cjs.map +1 -1
  28. package/dist/lib/mysql/schemas/auth/user-roles.js +1 -1
  29. package/dist/lib/mysql/schemas/auth/users.cjs +2 -1
  30. package/dist/lib/mysql/schemas/auth/users.cjs.map +1 -1
  31. package/dist/lib/mysql/schemas/auth/users.js +1 -1
  32. package/dist/lib/mysql/schemas/communication/communication-preferences.cjs +2 -1
  33. package/dist/lib/mysql/schemas/communication/communication-preferences.cjs.map +1 -1
  34. package/dist/lib/mysql/schemas/communication/communication-preferences.js +1 -1
  35. package/dist/lib/mysql/schemas/content/content-contributions.cjs +2 -1
  36. package/dist/lib/mysql/schemas/content/content-contributions.cjs.map +1 -1
  37. package/dist/lib/mysql/schemas/content/content-contributions.js +1 -1
  38. package/dist/lib/mysql/schemas/content/content-resource-resource.cjs.map +1 -1
  39. package/dist/lib/mysql/schemas/content/content-resource-resource.js +1 -1
  40. package/dist/lib/mysql/schemas/content/content-resource.cjs +2 -1
  41. package/dist/lib/mysql/schemas/content/content-resource.cjs.map +1 -1
  42. package/dist/lib/mysql/schemas/content/content-resource.js +1 -1
  43. package/dist/lib/mysql/schemas/content/contribution-types.cjs.map +1 -1
  44. package/dist/lib/mysql/schemas/content/contribution-types.js +1 -1
  45. package/dist/lib/sqlite.cjs.map +1 -1
  46. package/dist/lib/sqlite.d.ts +44 -45
  47. package/dist/lib/sqlite.js +2 -2
  48. package/dist/lib/utils.cjs.map +1 -1
  49. package/dist/lib/utils.d.ts +0 -2
  50. package/dist/lib/utils.js +1 -1
  51. package/package.json +9 -5
  52. package/src/index.ts +1 -1
  53. package/src/lib/mysql/index.ts +43 -35
  54. package/src/lib/mysql/schemas/auth/accounts.ts +1 -1
  55. package/src/lib/mysql/schemas/auth/permissions.ts +1 -1
  56. package/src/lib/mysql/schemas/auth/role-permissions.ts +2 -2
  57. package/src/lib/mysql/schemas/auth/roles.ts +1 -1
  58. package/src/lib/mysql/schemas/auth/sessions.ts +1 -1
  59. package/src/lib/mysql/schemas/auth/user-permissions.ts +2 -2
  60. package/src/lib/mysql/schemas/auth/user-roles.ts +2 -2
  61. package/src/lib/mysql/schemas/auth/users.ts +7 -6
  62. package/src/lib/mysql/schemas/communication/communication-preferences.ts +3 -3
  63. package/src/lib/mysql/schemas/content/content-contributions.ts +3 -3
  64. package/src/lib/mysql/schemas/content/content-resource-resource.ts +1 -1
  65. package/src/lib/mysql/schemas/content/content-resource.ts +3 -3
  66. package/src/lib/mysql/schemas/content/contribution-types.ts +1 -1
  67. package/src/lib/utils.ts +1 -1
@@ -30,18 +30,27 @@ var import_date_fns = require("date-fns");
30
30
  var import_drizzle_orm25 = require("drizzle-orm");
31
31
  var import_mysql_core30 = require("drizzle-orm/mysql-core");
32
32
 
33
- // ../../node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
33
+ // ../core/dist/chunk-DFHEFTJZ.js
34
+ var __defProp2 = Object.defineProperty;
35
+ var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
36
+ value,
37
+ configurable: true
38
+ }), "__name");
39
+
40
+ // ../core/dist/chunk-EK2ZQYRJ.js
34
41
  var util;
35
42
  (function(util2) {
36
43
  util2.assertEqual = (val) => val;
37
44
  function assertIs(_arg) {
38
45
  }
39
46
  __name(assertIs, "assertIs");
47
+ __name2(assertIs, "assertIs");
40
48
  util2.assertIs = assertIs;
41
49
  function assertNever(_x) {
42
50
  throw new Error();
43
51
  }
44
52
  __name(assertNever, "assertNever");
53
+ __name2(assertNever, "assertNever");
45
54
  util2.assertNever = assertNever;
46
55
  util2.arrayToEnum = (items) => {
47
56
  const obj = {};
@@ -84,6 +93,7 @@ var util;
84
93
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
85
94
  }
86
95
  __name(joinValues, "joinValues");
96
+ __name2(joinValues, "joinValues");
87
97
  util2.joinValues = joinValues;
88
98
  util2.jsonStringifyReplacer = (_, value) => {
89
99
  if (typeof value === "bigint") {
@@ -98,7 +108,6 @@ var objectUtil;
98
108
  return {
99
109
  ...first,
100
110
  ...second
101
- // second overwrites first
102
111
  };
103
112
  };
104
113
  })(objectUtil || (objectUtil = {}));
@@ -124,7 +133,7 @@ var ZodParsedType = util.arrayToEnum([
124
133
  "map",
125
134
  "set"
126
135
  ]);
127
- var getParsedType = /* @__PURE__ */ __name((data) => {
136
+ var getParsedType = /* @__PURE__ */ __name2((data) => {
128
137
  const t = typeof data;
129
138
  switch (t) {
130
139
  case "undefined":
@@ -183,19 +192,25 @@ var ZodIssueCode = util.arrayToEnum([
183
192
  "not_multiple_of",
184
193
  "not_finite"
185
194
  ]);
186
- var quotelessJson = /* @__PURE__ */ __name((obj) => {
195
+ var quotelessJson = /* @__PURE__ */ __name2((obj) => {
187
196
  const json8 = JSON.stringify(obj, null, 2);
188
197
  return json8.replace(/"([^"]+)":/g, "$1:");
189
198
  }, "quotelessJson");
190
- var ZodError = class extends Error {
199
+ var ZodError = /* @__PURE__ */ __name(class extends Error {
191
200
  constructor(issues) {
192
201
  super();
193
202
  this.issues = [];
194
203
  this.addIssue = (sub) => {
195
- this.issues = [...this.issues, sub];
204
+ this.issues = [
205
+ ...this.issues,
206
+ sub
207
+ ];
196
208
  };
197
209
  this.addIssues = (subs = []) => {
198
- this.issues = [...this.issues, ...subs];
210
+ this.issues = [
211
+ ...this.issues,
212
+ ...subs
213
+ ];
199
214
  };
200
215
  const actualProto = new.target.prototype;
201
216
  if (Object.setPrototypeOf) {
@@ -213,8 +228,10 @@ var ZodError = class extends Error {
213
228
  const mapper = _mapper || function(issue) {
214
229
  return issue.message;
215
230
  };
216
- const fieldErrors = { _errors: [] };
217
- const processError = /* @__PURE__ */ __name((error) => {
231
+ const fieldErrors = {
232
+ _errors: []
233
+ };
234
+ const processError = /* @__PURE__ */ __name2((error) => {
218
235
  for (const issue of error.issues) {
219
236
  if (issue.code === "invalid_union") {
220
237
  issue.unionErrors.map(processError);
@@ -231,9 +248,13 @@ var ZodError = class extends Error {
231
248
  const el = issue.path[i];
232
249
  const terminal = i === issue.path.length - 1;
233
250
  if (!terminal) {
234
- curr[el] = curr[el] || { _errors: [] };
251
+ curr[el] = curr[el] || {
252
+ _errors: []
253
+ };
235
254
  } else {
236
- curr[el] = curr[el] || { _errors: [] };
255
+ curr[el] = curr[el] || {
256
+ _errors: []
257
+ };
237
258
  curr[el]._errors.push(mapper(issue));
238
259
  }
239
260
  curr = curr[el];
@@ -265,18 +286,21 @@ var ZodError = class extends Error {
265
286
  formErrors.push(mapper(sub));
266
287
  }
267
288
  }
268
- return { formErrors, fieldErrors };
289
+ return {
290
+ formErrors,
291
+ fieldErrors
292
+ };
269
293
  }
270
294
  get formErrors() {
271
295
  return this.flatten();
272
296
  }
273
- };
274
- __name(ZodError, "ZodError");
297
+ }, "ZodError");
298
+ __name2(ZodError, "ZodError");
275
299
  ZodError.create = (issues) => {
276
300
  const error = new ZodError(issues);
277
301
  return error;
278
302
  };
279
- var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
303
+ var errorMap = /* @__PURE__ */ __name2((issue, _ctx) => {
280
304
  let message;
281
305
  switch (issue.code) {
282
306
  case ZodIssueCode.invalid_type:
@@ -372,20 +396,27 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
372
396
  message = _ctx.defaultError;
373
397
  util.assertNever(issue);
374
398
  }
375
- return { message };
399
+ return {
400
+ message
401
+ };
376
402
  }, "errorMap");
377
403
  var overrideErrorMap = errorMap;
378
404
  function setErrorMap(map) {
379
405
  overrideErrorMap = map;
380
406
  }
381
407
  __name(setErrorMap, "setErrorMap");
408
+ __name2(setErrorMap, "setErrorMap");
382
409
  function getErrorMap() {
383
410
  return overrideErrorMap;
384
411
  }
385
412
  __name(getErrorMap, "getErrorMap");
386
- var makeIssue = /* @__PURE__ */ __name((params) => {
413
+ __name2(getErrorMap, "getErrorMap");
414
+ var makeIssue = /* @__PURE__ */ __name2((params) => {
387
415
  const { data, path, errorMaps, issueData } = params;
388
- const fullPath = [...path, ...issueData.path || []];
416
+ const fullPath = [
417
+ ...path,
418
+ ...issueData.path || []
419
+ ];
389
420
  const fullIssue = {
390
421
  ...issueData,
391
422
  path: fullPath
@@ -393,7 +424,10 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
393
424
  let errorMessage = "";
394
425
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
395
426
  for (const map of maps) {
396
- errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
427
+ errorMessage = map(fullIssue, {
428
+ data,
429
+ defaultError: errorMessage
430
+ }).message;
397
431
  }
398
432
  return {
399
433
  ...issueData,
@@ -412,13 +446,13 @@ function addIssueToContext(ctx, issueData) {
412
446
  ctx.schemaErrorMap,
413
447
  getErrorMap(),
414
448
  errorMap
415
- // then global default map
416
449
  ].filter((x) => !!x)
417
450
  });
418
451
  ctx.common.issues.push(issue);
419
452
  }
420
453
  __name(addIssueToContext, "addIssueToContext");
421
- var ParseStatus = class {
454
+ __name2(addIssueToContext, "addIssueToContext");
455
+ var ParseStatus = /* @__PURE__ */ __name(class {
422
456
  constructor() {
423
457
  this.value = "valid";
424
458
  }
@@ -439,7 +473,10 @@ var ParseStatus = class {
439
473
  status.dirty();
440
474
  arrayValue.push(s.value);
441
475
  }
442
- return { status: status.value, value: arrayValue };
476
+ return {
477
+ status: status.value,
478
+ value: arrayValue
479
+ };
443
480
  }
444
481
  static async mergeObjectAsync(status, pairs) {
445
482
  const syncPairs = [];
@@ -467,25 +504,36 @@ var ParseStatus = class {
467
504
  finalObject[key.value] = value.value;
468
505
  }
469
506
  }
470
- return { status: status.value, value: finalObject };
507
+ return {
508
+ status: status.value,
509
+ value: finalObject
510
+ };
471
511
  }
472
- };
473
- __name(ParseStatus, "ParseStatus");
512
+ }, "ParseStatus");
513
+ __name2(ParseStatus, "ParseStatus");
474
514
  var INVALID = Object.freeze({
475
515
  status: "aborted"
476
516
  });
477
- var DIRTY = /* @__PURE__ */ __name((value) => ({ status: "dirty", value }), "DIRTY");
478
- var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
479
- var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
480
- var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
481
- var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
482
- var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
517
+ var DIRTY = /* @__PURE__ */ __name2((value) => ({
518
+ status: "dirty",
519
+ value
520
+ }), "DIRTY");
521
+ var OK = /* @__PURE__ */ __name2((value) => ({
522
+ status: "valid",
523
+ value
524
+ }), "OK");
525
+ var isAborted = /* @__PURE__ */ __name2((x) => x.status === "aborted", "isAborted");
526
+ var isDirty = /* @__PURE__ */ __name2((x) => x.status === "dirty", "isDirty");
527
+ var isValid = /* @__PURE__ */ __name2((x) => x.status === "valid", "isValid");
528
+ var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
483
529
  var errorUtil;
484
530
  (function(errorUtil2) {
485
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
531
+ errorUtil2.errToObj = (message) => typeof message === "string" ? {
532
+ message
533
+ } : message || {};
486
534
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
487
535
  })(errorUtil || (errorUtil = {}));
488
- var ParseInputLazyPath = class {
536
+ var ParseInputLazyPath = /* @__PURE__ */ __name(class {
489
537
  constructor(parent, value, path, key) {
490
538
  this._cachedPath = [];
491
539
  this.parent = parent;
@@ -503,11 +551,14 @@ var ParseInputLazyPath = class {
503
551
  }
504
552
  return this._cachedPath;
505
553
  }
506
- };
507
- __name(ParseInputLazyPath, "ParseInputLazyPath");
508
- var handleResult = /* @__PURE__ */ __name((ctx, result) => {
554
+ }, "ParseInputLazyPath");
555
+ __name2(ParseInputLazyPath, "ParseInputLazyPath");
556
+ var handleResult = /* @__PURE__ */ __name2((ctx, result) => {
509
557
  if (isValid(result)) {
510
- return { success: true, data: result.value };
558
+ return {
559
+ success: true,
560
+ data: result.value
561
+ };
511
562
  } else {
512
563
  if (!ctx.common.issues.length) {
513
564
  throw new Error("Validation failed but no issues detected.");
@@ -532,19 +583,32 @@ function processCreateParams(params) {
532
583
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
533
584
  }
534
585
  if (errorMap2)
535
- return { errorMap: errorMap2, description };
536
- const customMap = /* @__PURE__ */ __name((iss, ctx) => {
586
+ return {
587
+ errorMap: errorMap2,
588
+ description
589
+ };
590
+ const customMap = /* @__PURE__ */ __name2((iss, ctx) => {
537
591
  if (iss.code !== "invalid_type")
538
- return { message: ctx.defaultError };
592
+ return {
593
+ message: ctx.defaultError
594
+ };
539
595
  if (typeof ctx.data === "undefined") {
540
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
596
+ return {
597
+ message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError
598
+ };
541
599
  }
542
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
600
+ return {
601
+ message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError
602
+ };
543
603
  }, "customMap");
544
- return { errorMap: customMap, description };
604
+ return {
605
+ errorMap: customMap,
606
+ description
607
+ };
545
608
  }
546
609
  __name(processCreateParams, "processCreateParams");
547
- var ZodType = class {
610
+ __name2(processCreateParams, "processCreateParams");
611
+ var ZodType = /* @__PURE__ */ __name(class {
548
612
  constructor(def) {
549
613
  this.spa = this.safeParseAsync;
550
614
  this._def = def;
@@ -633,7 +697,11 @@ var ZodType = class {
633
697
  data,
634
698
  parsedType: getParsedType(data)
635
699
  };
636
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
700
+ const result = this._parseSync({
701
+ data,
702
+ path: ctx.path,
703
+ parent: ctx
704
+ });
637
705
  return handleResult(ctx, result);
638
706
  }
639
707
  async parseAsync(data, params) {
@@ -655,14 +723,20 @@ var ZodType = class {
655
723
  data,
656
724
  parsedType: getParsedType(data)
657
725
  };
658
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
726
+ const maybeAsyncResult = this._parse({
727
+ data,
728
+ path: ctx.path,
729
+ parent: ctx
730
+ });
659
731
  const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
660
732
  return handleResult(ctx, result);
661
733
  }
662
734
  refine(check, message) {
663
- const getIssueProperties = /* @__PURE__ */ __name((val) => {
735
+ const getIssueProperties = /* @__PURE__ */ __name2((val) => {
664
736
  if (typeof message === "string" || typeof message === "undefined") {
665
- return { message };
737
+ return {
738
+ message
739
+ };
666
740
  } else if (typeof message === "function") {
667
741
  return message(val);
668
742
  } else {
@@ -671,7 +745,7 @@ var ZodType = class {
671
745
  }, "getIssueProperties");
672
746
  return this._refinement((val, ctx) => {
673
747
  const result = check(val);
674
- const setError = /* @__PURE__ */ __name(() => ctx.addIssue({
748
+ const setError = /* @__PURE__ */ __name2(() => ctx.addIssue({
675
749
  code: ZodIssueCode.custom,
676
750
  ...getIssueProperties(val)
677
751
  }), "setError");
@@ -707,7 +781,10 @@ var ZodType = class {
707
781
  return new ZodEffects({
708
782
  schema: this,
709
783
  typeName: ZodFirstPartyTypeKind.ZodEffects,
710
- effect: { type: "refinement", refinement }
784
+ effect: {
785
+ type: "refinement",
786
+ refinement
787
+ }
711
788
  });
712
789
  }
713
790
  superRefine(refinement) {
@@ -729,7 +806,10 @@ var ZodType = class {
729
806
  return ZodPromise.create(this, this._def);
730
807
  }
731
808
  or(option) {
732
- return ZodUnion.create([this, option], this._def);
809
+ return ZodUnion.create([
810
+ this,
811
+ option
812
+ ], this._def);
733
813
  }
734
814
  and(incoming) {
735
815
  return ZodIntersection.create(this, incoming, this._def);
@@ -739,7 +819,10 @@ var ZodType = class {
739
819
  ...processCreateParams(this._def),
740
820
  schema: this,
741
821
  typeName: ZodFirstPartyTypeKind.ZodEffects,
742
- effect: { type: "transform", transform }
822
+ effect: {
823
+ type: "transform",
824
+ transform
825
+ }
743
826
  });
744
827
  }
745
828
  default(def) {
@@ -786,8 +869,8 @@ var ZodType = class {
786
869
  isNullable() {
787
870
  return this.safeParse(null).success;
788
871
  }
789
- };
790
- __name(ZodType, "ZodType");
872
+ }, "ZodType");
873
+ __name2(ZodType, "ZodType");
791
874
  var cuidRegex = /^c[^\s-]{8,}$/i;
792
875
  var cuid2Regex = /^[a-z][a-z0-9]*$/;
793
876
  var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
@@ -797,7 +880,7 @@ var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
797
880
  var emojiRegex;
798
881
  var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
799
882
  var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
800
- var datetimeRegex = /* @__PURE__ */ __name((args) => {
883
+ var datetimeRegex = /* @__PURE__ */ __name2((args) => {
801
884
  if (args.precision) {
802
885
  if (args.offset) {
803
886
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
@@ -828,7 +911,8 @@ function isValidIP(ip, version) {
828
911
  return false;
829
912
  }
830
913
  __name(isValidIP, "isValidIP");
831
- var ZodString = class extends ZodType {
914
+ __name2(isValidIP, "isValidIP");
915
+ var ZodString = /* @__PURE__ */ __name(class extends ZodType {
832
916
  _parse(input) {
833
917
  if (this._def.coerce) {
834
918
  input.data = String(input.data);
@@ -836,15 +920,11 @@ var ZodString = class extends ZodType {
836
920
  const parsedType = this._getType(input);
837
921
  if (parsedType !== ZodParsedType.string) {
838
922
  const ctx2 = this._getOrReturnCtx(input);
839
- addIssueToContext(
840
- ctx2,
841
- {
842
- code: ZodIssueCode.invalid_type,
843
- expected: ZodParsedType.string,
844
- received: ctx2.parsedType
845
- }
846
- //
847
- );
923
+ addIssueToContext(ctx2, {
924
+ code: ZodIssueCode.invalid_type,
925
+ expected: ZodParsedType.string,
926
+ received: ctx2.parsedType
927
+ });
848
928
  return INVALID;
849
929
  }
850
930
  const status = new ParseStatus();
@@ -996,7 +1076,10 @@ var ZodString = class extends ZodType {
996
1076
  ctx = this._getOrReturnCtx(input, ctx);
997
1077
  addIssueToContext(ctx, {
998
1078
  code: ZodIssueCode.invalid_string,
999
- validation: { includes: check.value, position: check.position },
1079
+ validation: {
1080
+ includes: check.value,
1081
+ position: check.position
1082
+ },
1000
1083
  message: check.message
1001
1084
  });
1002
1085
  status.dirty();
@@ -1010,7 +1093,9 @@ var ZodString = class extends ZodType {
1010
1093
  ctx = this._getOrReturnCtx(input, ctx);
1011
1094
  addIssueToContext(ctx, {
1012
1095
  code: ZodIssueCode.invalid_string,
1013
- validation: { startsWith: check.value },
1096
+ validation: {
1097
+ startsWith: check.value
1098
+ },
1014
1099
  message: check.message
1015
1100
  });
1016
1101
  status.dirty();
@@ -1020,7 +1105,9 @@ var ZodString = class extends ZodType {
1020
1105
  ctx = this._getOrReturnCtx(input, ctx);
1021
1106
  addIssueToContext(ctx, {
1022
1107
  code: ZodIssueCode.invalid_string,
1023
- validation: { endsWith: check.value },
1108
+ validation: {
1109
+ endsWith: check.value
1110
+ },
1024
1111
  message: check.message
1025
1112
  });
1026
1113
  status.dirty();
@@ -1050,7 +1137,10 @@ var ZodString = class extends ZodType {
1050
1137
  util.assertNever(check);
1051
1138
  }
1052
1139
  }
1053
- return { status: status.value, value: input.data };
1140
+ return {
1141
+ status: status.value,
1142
+ value: input.data
1143
+ };
1054
1144
  }
1055
1145
  _regex(regex, validation, message) {
1056
1146
  return this.refinement((data) => regex.test(data), {
@@ -1062,32 +1152,59 @@ var ZodString = class extends ZodType {
1062
1152
  _addCheck(check) {
1063
1153
  return new ZodString({
1064
1154
  ...this._def,
1065
- checks: [...this._def.checks, check]
1155
+ checks: [
1156
+ ...this._def.checks,
1157
+ check
1158
+ ]
1066
1159
  });
1067
1160
  }
1068
1161
  email(message) {
1069
- return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
1162
+ return this._addCheck({
1163
+ kind: "email",
1164
+ ...errorUtil.errToObj(message)
1165
+ });
1070
1166
  }
1071
1167
  url(message) {
1072
- return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
1168
+ return this._addCheck({
1169
+ kind: "url",
1170
+ ...errorUtil.errToObj(message)
1171
+ });
1073
1172
  }
1074
1173
  emoji(message) {
1075
- return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
1174
+ return this._addCheck({
1175
+ kind: "emoji",
1176
+ ...errorUtil.errToObj(message)
1177
+ });
1076
1178
  }
1077
1179
  uuid(message) {
1078
- return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
1180
+ return this._addCheck({
1181
+ kind: "uuid",
1182
+ ...errorUtil.errToObj(message)
1183
+ });
1079
1184
  }
1080
1185
  cuid(message) {
1081
- return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1186
+ return this._addCheck({
1187
+ kind: "cuid",
1188
+ ...errorUtil.errToObj(message)
1189
+ });
1082
1190
  }
1083
1191
  cuid2(message) {
1084
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1192
+ return this._addCheck({
1193
+ kind: "cuid2",
1194
+ ...errorUtil.errToObj(message)
1195
+ });
1085
1196
  }
1086
1197
  ulid(message) {
1087
- return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
1198
+ return this._addCheck({
1199
+ kind: "ulid",
1200
+ ...errorUtil.errToObj(message)
1201
+ });
1088
1202
  }
1089
1203
  ip(options) {
1090
- return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1204
+ return this._addCheck({
1205
+ kind: "ip",
1206
+ ...errorUtil.errToObj(options)
1207
+ });
1091
1208
  }
1092
1209
  datetime(options) {
1093
1210
  var _a;
@@ -1157,28 +1274,43 @@ var ZodString = class extends ZodType {
1157
1274
  });
1158
1275
  }
1159
1276
  /**
1160
- * @deprecated Use z.string().min(1) instead.
1161
- * @see {@link ZodString.min}
1162
- */
1277
+ * @deprecated Use z.string().min(1) instead.
1278
+ * @see {@link ZodString.min}
1279
+ */
1163
1280
  nonempty(message) {
1164
1281
  return this.min(1, errorUtil.errToObj(message));
1165
1282
  }
1166
1283
  trim() {
1167
1284
  return new ZodString({
1168
1285
  ...this._def,
1169
- checks: [...this._def.checks, { kind: "trim" }]
1286
+ checks: [
1287
+ ...this._def.checks,
1288
+ {
1289
+ kind: "trim"
1290
+ }
1291
+ ]
1170
1292
  });
1171
1293
  }
1172
1294
  toLowerCase() {
1173
1295
  return new ZodString({
1174
1296
  ...this._def,
1175
- checks: [...this._def.checks, { kind: "toLowerCase" }]
1297
+ checks: [
1298
+ ...this._def.checks,
1299
+ {
1300
+ kind: "toLowerCase"
1301
+ }
1302
+ ]
1176
1303
  });
1177
1304
  }
1178
1305
  toUpperCase() {
1179
1306
  return new ZodString({
1180
1307
  ...this._def,
1181
- checks: [...this._def.checks, { kind: "toUpperCase" }]
1308
+ checks: [
1309
+ ...this._def.checks,
1310
+ {
1311
+ kind: "toUpperCase"
1312
+ }
1313
+ ]
1182
1314
  });
1183
1315
  }
1184
1316
  get isDatetime() {
@@ -1228,8 +1360,8 @@ var ZodString = class extends ZodType {
1228
1360
  }
1229
1361
  return max;
1230
1362
  }
1231
- };
1232
- __name(ZodString, "ZodString");
1363
+ }, "ZodString");
1364
+ __name2(ZodString, "ZodString");
1233
1365
  ZodString.create = (params) => {
1234
1366
  var _a;
1235
1367
  return new ZodString({
@@ -1248,7 +1380,8 @@ function floatSafeRemainder(val, step) {
1248
1380
  return valInt % stepInt / Math.pow(10, decCount);
1249
1381
  }
1250
1382
  __name(floatSafeRemainder, "floatSafeRemainder");
1251
- var ZodNumber = class extends ZodType {
1383
+ __name2(floatSafeRemainder, "floatSafeRemainder");
1384
+ var ZodNumber = /* @__PURE__ */ __name(class extends ZodType {
1252
1385
  constructor() {
1253
1386
  super(...arguments);
1254
1387
  this.min = this.gte;
@@ -1334,7 +1467,10 @@ var ZodNumber = class extends ZodType {
1334
1467
  util.assertNever(check);
1335
1468
  }
1336
1469
  }
1337
- return { status: status.value, value: input.data };
1470
+ return {
1471
+ status: status.value,
1472
+ value: input.data
1473
+ };
1338
1474
  }
1339
1475
  gte(value, message) {
1340
1476
  return this.setLimit("min", value, true, errorUtil.toString(message));
@@ -1365,7 +1501,10 @@ var ZodNumber = class extends ZodType {
1365
1501
  _addCheck(check) {
1366
1502
  return new ZodNumber({
1367
1503
  ...this._def,
1368
- checks: [...this._def.checks, check]
1504
+ checks: [
1505
+ ...this._def.checks,
1506
+ check
1507
+ ]
1369
1508
  });
1370
1509
  }
1371
1510
  int(message) {
@@ -1470,8 +1609,8 @@ var ZodNumber = class extends ZodType {
1470
1609
  }
1471
1610
  return Number.isFinite(min) && Number.isFinite(max);
1472
1611
  }
1473
- };
1474
- __name(ZodNumber, "ZodNumber");
1612
+ }, "ZodNumber");
1613
+ __name2(ZodNumber, "ZodNumber");
1475
1614
  ZodNumber.create = (params) => {
1476
1615
  return new ZodNumber({
1477
1616
  checks: [],
@@ -1480,7 +1619,7 @@ ZodNumber.create = (params) => {
1480
1619
  ...processCreateParams(params)
1481
1620
  });
1482
1621
  };
1483
- var ZodBigInt = class extends ZodType {
1622
+ var ZodBigInt = /* @__PURE__ */ __name(class extends ZodType {
1484
1623
  constructor() {
1485
1624
  super(...arguments);
1486
1625
  this.min = this.gte;
@@ -1543,7 +1682,10 @@ var ZodBigInt = class extends ZodType {
1543
1682
  util.assertNever(check);
1544
1683
  }
1545
1684
  }
1546
- return { status: status.value, value: input.data };
1685
+ return {
1686
+ status: status.value,
1687
+ value: input.data
1688
+ };
1547
1689
  }
1548
1690
  gte(value, message) {
1549
1691
  return this.setLimit("min", value, true, errorUtil.toString(message));
@@ -1574,7 +1716,10 @@ var ZodBigInt = class extends ZodType {
1574
1716
  _addCheck(check) {
1575
1717
  return new ZodBigInt({
1576
1718
  ...this._def,
1577
- checks: [...this._def.checks, check]
1719
+ checks: [
1720
+ ...this._def.checks,
1721
+ check
1722
+ ]
1578
1723
  });
1579
1724
  }
1580
1725
  positive(message) {
@@ -1636,8 +1781,8 @@ var ZodBigInt = class extends ZodType {
1636
1781
  }
1637
1782
  return max;
1638
1783
  }
1639
- };
1640
- __name(ZodBigInt, "ZodBigInt");
1784
+ }, "ZodBigInt");
1785
+ __name2(ZodBigInt, "ZodBigInt");
1641
1786
  ZodBigInt.create = (params) => {
1642
1787
  var _a;
1643
1788
  return new ZodBigInt({
@@ -1647,7 +1792,7 @@ ZodBigInt.create = (params) => {
1647
1792
  ...processCreateParams(params)
1648
1793
  });
1649
1794
  };
1650
- var ZodBoolean = class extends ZodType {
1795
+ var ZodBoolean = /* @__PURE__ */ __name(class extends ZodType {
1651
1796
  _parse(input) {
1652
1797
  if (this._def.coerce) {
1653
1798
  input.data = Boolean(input.data);
@@ -1664,8 +1809,8 @@ var ZodBoolean = class extends ZodType {
1664
1809
  }
1665
1810
  return OK(input.data);
1666
1811
  }
1667
- };
1668
- __name(ZodBoolean, "ZodBoolean");
1812
+ }, "ZodBoolean");
1813
+ __name2(ZodBoolean, "ZodBoolean");
1669
1814
  ZodBoolean.create = (params) => {
1670
1815
  return new ZodBoolean({
1671
1816
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
@@ -1673,7 +1818,7 @@ ZodBoolean.create = (params) => {
1673
1818
  ...processCreateParams(params)
1674
1819
  });
1675
1820
  };
1676
- var ZodDate = class extends ZodType {
1821
+ var ZodDate = /* @__PURE__ */ __name(class extends ZodType {
1677
1822
  _parse(input) {
1678
1823
  if (this._def.coerce) {
1679
1824
  input.data = new Date(input.data);
@@ -1736,7 +1881,10 @@ var ZodDate = class extends ZodType {
1736
1881
  _addCheck(check) {
1737
1882
  return new ZodDate({
1738
1883
  ...this._def,
1739
- checks: [...this._def.checks, check]
1884
+ checks: [
1885
+ ...this._def.checks,
1886
+ check
1887
+ ]
1740
1888
  });
1741
1889
  }
1742
1890
  min(minDate, message) {
@@ -1773,8 +1921,8 @@ var ZodDate = class extends ZodType {
1773
1921
  }
1774
1922
  return max != null ? new Date(max) : null;
1775
1923
  }
1776
- };
1777
- __name(ZodDate, "ZodDate");
1924
+ }, "ZodDate");
1925
+ __name2(ZodDate, "ZodDate");
1778
1926
  ZodDate.create = (params) => {
1779
1927
  return new ZodDate({
1780
1928
  checks: [],
@@ -1783,7 +1931,7 @@ ZodDate.create = (params) => {
1783
1931
  ...processCreateParams(params)
1784
1932
  });
1785
1933
  };
1786
- var ZodSymbol = class extends ZodType {
1934
+ var ZodSymbol = /* @__PURE__ */ __name(class extends ZodType {
1787
1935
  _parse(input) {
1788
1936
  const parsedType = this._getType(input);
1789
1937
  if (parsedType !== ZodParsedType.symbol) {
@@ -1797,15 +1945,15 @@ var ZodSymbol = class extends ZodType {
1797
1945
  }
1798
1946
  return OK(input.data);
1799
1947
  }
1800
- };
1801
- __name(ZodSymbol, "ZodSymbol");
1948
+ }, "ZodSymbol");
1949
+ __name2(ZodSymbol, "ZodSymbol");
1802
1950
  ZodSymbol.create = (params) => {
1803
1951
  return new ZodSymbol({
1804
1952
  typeName: ZodFirstPartyTypeKind.ZodSymbol,
1805
1953
  ...processCreateParams(params)
1806
1954
  });
1807
1955
  };
1808
- var ZodUndefined = class extends ZodType {
1956
+ var ZodUndefined = /* @__PURE__ */ __name(class extends ZodType {
1809
1957
  _parse(input) {
1810
1958
  const parsedType = this._getType(input);
1811
1959
  if (parsedType !== ZodParsedType.undefined) {
@@ -1819,15 +1967,15 @@ var ZodUndefined = class extends ZodType {
1819
1967
  }
1820
1968
  return OK(input.data);
1821
1969
  }
1822
- };
1823
- __name(ZodUndefined, "ZodUndefined");
1970
+ }, "ZodUndefined");
1971
+ __name2(ZodUndefined, "ZodUndefined");
1824
1972
  ZodUndefined.create = (params) => {
1825
1973
  return new ZodUndefined({
1826
1974
  typeName: ZodFirstPartyTypeKind.ZodUndefined,
1827
1975
  ...processCreateParams(params)
1828
1976
  });
1829
1977
  };
1830
- var ZodNull = class extends ZodType {
1978
+ var ZodNull = /* @__PURE__ */ __name(class extends ZodType {
1831
1979
  _parse(input) {
1832
1980
  const parsedType = this._getType(input);
1833
1981
  if (parsedType !== ZodParsedType.null) {
@@ -1841,15 +1989,15 @@ var ZodNull = class extends ZodType {
1841
1989
  }
1842
1990
  return OK(input.data);
1843
1991
  }
1844
- };
1845
- __name(ZodNull, "ZodNull");
1992
+ }, "ZodNull");
1993
+ __name2(ZodNull, "ZodNull");
1846
1994
  ZodNull.create = (params) => {
1847
1995
  return new ZodNull({
1848
1996
  typeName: ZodFirstPartyTypeKind.ZodNull,
1849
1997
  ...processCreateParams(params)
1850
1998
  });
1851
1999
  };
1852
- var ZodAny = class extends ZodType {
2000
+ var ZodAny = /* @__PURE__ */ __name(class extends ZodType {
1853
2001
  constructor() {
1854
2002
  super(...arguments);
1855
2003
  this._any = true;
@@ -1857,15 +2005,15 @@ var ZodAny = class extends ZodType {
1857
2005
  _parse(input) {
1858
2006
  return OK(input.data);
1859
2007
  }
1860
- };
1861
- __name(ZodAny, "ZodAny");
2008
+ }, "ZodAny");
2009
+ __name2(ZodAny, "ZodAny");
1862
2010
  ZodAny.create = (params) => {
1863
2011
  return new ZodAny({
1864
2012
  typeName: ZodFirstPartyTypeKind.ZodAny,
1865
2013
  ...processCreateParams(params)
1866
2014
  });
1867
2015
  };
1868
- var ZodUnknown = class extends ZodType {
2016
+ var ZodUnknown = /* @__PURE__ */ __name(class extends ZodType {
1869
2017
  constructor() {
1870
2018
  super(...arguments);
1871
2019
  this._unknown = true;
@@ -1873,15 +2021,15 @@ var ZodUnknown = class extends ZodType {
1873
2021
  _parse(input) {
1874
2022
  return OK(input.data);
1875
2023
  }
1876
- };
1877
- __name(ZodUnknown, "ZodUnknown");
2024
+ }, "ZodUnknown");
2025
+ __name2(ZodUnknown, "ZodUnknown");
1878
2026
  ZodUnknown.create = (params) => {
1879
2027
  return new ZodUnknown({
1880
2028
  typeName: ZodFirstPartyTypeKind.ZodUnknown,
1881
2029
  ...processCreateParams(params)
1882
2030
  });
1883
2031
  };
1884
- var ZodNever = class extends ZodType {
2032
+ var ZodNever = /* @__PURE__ */ __name(class extends ZodType {
1885
2033
  _parse(input) {
1886
2034
  const ctx = this._getOrReturnCtx(input);
1887
2035
  addIssueToContext(ctx, {
@@ -1891,15 +2039,15 @@ var ZodNever = class extends ZodType {
1891
2039
  });
1892
2040
  return INVALID;
1893
2041
  }
1894
- };
1895
- __name(ZodNever, "ZodNever");
2042
+ }, "ZodNever");
2043
+ __name2(ZodNever, "ZodNever");
1896
2044
  ZodNever.create = (params) => {
1897
2045
  return new ZodNever({
1898
2046
  typeName: ZodFirstPartyTypeKind.ZodNever,
1899
2047
  ...processCreateParams(params)
1900
2048
  });
1901
2049
  };
1902
- var ZodVoid = class extends ZodType {
2050
+ var ZodVoid = /* @__PURE__ */ __name(class extends ZodType {
1903
2051
  _parse(input) {
1904
2052
  const parsedType = this._getType(input);
1905
2053
  if (parsedType !== ZodParsedType.undefined) {
@@ -1913,15 +2061,15 @@ var ZodVoid = class extends ZodType {
1913
2061
  }
1914
2062
  return OK(input.data);
1915
2063
  }
1916
- };
1917
- __name(ZodVoid, "ZodVoid");
2064
+ }, "ZodVoid");
2065
+ __name2(ZodVoid, "ZodVoid");
1918
2066
  ZodVoid.create = (params) => {
1919
2067
  return new ZodVoid({
1920
2068
  typeName: ZodFirstPartyTypeKind.ZodVoid,
1921
2069
  ...processCreateParams(params)
1922
2070
  });
1923
2071
  };
1924
- var ZodArray = class extends ZodType {
2072
+ var ZodArray = /* @__PURE__ */ __name(class extends ZodType {
1925
2073
  _parse(input) {
1926
2074
  const { ctx, status } = this._processInputParams(input);
1927
2075
  const def = this._def;
@@ -1976,13 +2124,17 @@ var ZodArray = class extends ZodType {
1976
2124
  }
1977
2125
  }
1978
2126
  if (ctx.common.async) {
1979
- return Promise.all([...ctx.data].map((item, i) => {
2127
+ return Promise.all([
2128
+ ...ctx.data
2129
+ ].map((item, i) => {
1980
2130
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1981
2131
  })).then((result2) => {
1982
2132
  return ParseStatus.mergeArray(status, result2);
1983
2133
  });
1984
2134
  }
1985
- const result = [...ctx.data].map((item, i) => {
2135
+ const result = [
2136
+ ...ctx.data
2137
+ ].map((item, i) => {
1986
2138
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1987
2139
  });
1988
2140
  return ParseStatus.mergeArray(status, result);
@@ -1993,26 +2145,35 @@ var ZodArray = class extends ZodType {
1993
2145
  min(minLength, message) {
1994
2146
  return new ZodArray({
1995
2147
  ...this._def,
1996
- minLength: { value: minLength, message: errorUtil.toString(message) }
2148
+ minLength: {
2149
+ value: minLength,
2150
+ message: errorUtil.toString(message)
2151
+ }
1997
2152
  });
1998
2153
  }
1999
2154
  max(maxLength, message) {
2000
2155
  return new ZodArray({
2001
2156
  ...this._def,
2002
- maxLength: { value: maxLength, message: errorUtil.toString(message) }
2157
+ maxLength: {
2158
+ value: maxLength,
2159
+ message: errorUtil.toString(message)
2160
+ }
2003
2161
  });
2004
2162
  }
2005
2163
  length(len, message) {
2006
2164
  return new ZodArray({
2007
2165
  ...this._def,
2008
- exactLength: { value: len, message: errorUtil.toString(message) }
2166
+ exactLength: {
2167
+ value: len,
2168
+ message: errorUtil.toString(message)
2169
+ }
2009
2170
  });
2010
2171
  }
2011
2172
  nonempty(message) {
2012
2173
  return this.min(1, message);
2013
2174
  }
2014
- };
2015
- __name(ZodArray, "ZodArray");
2175
+ }, "ZodArray");
2176
+ __name2(ZodArray, "ZodArray");
2016
2177
  ZodArray.create = (schema, params) => {
2017
2178
  return new ZodArray({
2018
2179
  type: schema,
@@ -2050,7 +2211,8 @@ function deepPartialify(schema) {
2050
2211
  }
2051
2212
  }
2052
2213
  __name(deepPartialify, "deepPartialify");
2053
- var ZodObject = class extends ZodType {
2214
+ __name2(deepPartialify, "deepPartialify");
2215
+ var ZodObject = /* @__PURE__ */ __name(class extends ZodType {
2054
2216
  constructor() {
2055
2217
  super(...arguments);
2056
2218
  this._cached = null;
@@ -2062,7 +2224,10 @@ var ZodObject = class extends ZodType {
2062
2224
  return this._cached;
2063
2225
  const shape = this._def.shape();
2064
2226
  const keys = util.objectKeys(shape);
2065
- return this._cached = { shape, keys };
2227
+ return this._cached = {
2228
+ shape,
2229
+ keys
2230
+ };
2066
2231
  }
2067
2232
  _parse(input) {
2068
2233
  const parsedType = this._getType(input);
@@ -2090,7 +2255,10 @@ var ZodObject = class extends ZodType {
2090
2255
  const keyValidator = shape[key];
2091
2256
  const value = ctx.data[key];
2092
2257
  pairs.push({
2093
- key: { status: "valid", value: key },
2258
+ key: {
2259
+ status: "valid",
2260
+ value: key
2261
+ },
2094
2262
  value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2095
2263
  alwaysSet: key in ctx.data
2096
2264
  });
@@ -2100,8 +2268,14 @@ var ZodObject = class extends ZodType {
2100
2268
  if (unknownKeys === "passthrough") {
2101
2269
  for (const key of extraKeys) {
2102
2270
  pairs.push({
2103
- key: { status: "valid", value: key },
2104
- value: { status: "valid", value: ctx.data[key] }
2271
+ key: {
2272
+ status: "valid",
2273
+ value: key
2274
+ },
2275
+ value: {
2276
+ status: "valid",
2277
+ value: ctx.data[key]
2278
+ }
2105
2279
  });
2106
2280
  }
2107
2281
  } else if (unknownKeys === "strict") {
@@ -2122,11 +2296,11 @@ var ZodObject = class extends ZodType {
2122
2296
  for (const key of extraKeys) {
2123
2297
  const value = ctx.data[key];
2124
2298
  pairs.push({
2125
- key: { status: "valid", value: key },
2126
- value: catchall._parse(
2127
- new ParseInputLazyPath(ctx, value, ctx.path, key)
2128
- //, ctx.child(key), value, getParsedType(value)
2129
- ),
2299
+ key: {
2300
+ status: "valid",
2301
+ value: key
2302
+ },
2303
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2130
2304
  alwaysSet: key in ctx.data
2131
2305
  });
2132
2306
  }
@@ -2212,10 +2386,10 @@ var ZodObject = class extends ZodType {
2212
2386
  });
2213
2387
  }
2214
2388
  /**
2215
- * Prior to zod@1.0.12 there was a bug in the
2216
- * inferred type of merged objects. Please
2217
- * upgrade if you are experiencing issues.
2218
- */
2389
+ * Prior to zod@1.0.12 there was a bug in the
2390
+ * inferred type of merged objects. Please
2391
+ * upgrade if you are experiencing issues.
2392
+ */
2219
2393
  merge(merging) {
2220
2394
  const merged = new ZodObject({
2221
2395
  unknownKeys: merging._def.unknownKeys,
@@ -2264,7 +2438,9 @@ var ZodObject = class extends ZodType {
2264
2438
  // return merged;
2265
2439
  // }
2266
2440
  setKey(key, schema) {
2267
- return this.augment({ [key]: schema });
2441
+ return this.augment({
2442
+ [key]: schema
2443
+ });
2268
2444
  }
2269
2445
  // merge<Incoming extends AnyZodObject>(
2270
2446
  // merging: Incoming
@@ -2318,8 +2494,8 @@ var ZodObject = class extends ZodType {
2318
2494
  });
2319
2495
  }
2320
2496
  /**
2321
- * @deprecated
2322
- */
2497
+ * @deprecated
2498
+ */
2323
2499
  deepPartial() {
2324
2500
  return deepPartialify(this);
2325
2501
  }
@@ -2360,8 +2536,8 @@ var ZodObject = class extends ZodType {
2360
2536
  keyof() {
2361
2537
  return createZodEnum(util.objectKeys(this.shape));
2362
2538
  }
2363
- };
2364
- __name(ZodObject, "ZodObject");
2539
+ }, "ZodObject");
2540
+ __name2(ZodObject, "ZodObject");
2365
2541
  ZodObject.create = (shape, params) => {
2366
2542
  return new ZodObject({
2367
2543
  shape: () => shape,
@@ -2389,7 +2565,7 @@ ZodObject.lazycreate = (shape, params) => {
2389
2565
  ...processCreateParams(params)
2390
2566
  });
2391
2567
  };
2392
- var ZodUnion = class extends ZodType {
2568
+ var ZodUnion = /* @__PURE__ */ __name(class extends ZodType {
2393
2569
  _parse(input) {
2394
2570
  const { ctx } = this._processInputParams(input);
2395
2571
  const options = this._def.options;
@@ -2413,6 +2589,7 @@ var ZodUnion = class extends ZodType {
2413
2589
  return INVALID;
2414
2590
  }
2415
2591
  __name(handleResults, "handleResults");
2592
+ __name2(handleResults, "handleResults");
2416
2593
  if (ctx.common.async) {
2417
2594
  return Promise.all(options.map(async (option) => {
2418
2595
  const childCtx = {
@@ -2452,7 +2629,10 @@ var ZodUnion = class extends ZodType {
2452
2629
  if (result.status === "valid") {
2453
2630
  return result;
2454
2631
  } else if (result.status === "dirty" && !dirty) {
2455
- dirty = { result, ctx: childCtx };
2632
+ dirty = {
2633
+ result,
2634
+ ctx: childCtx
2635
+ };
2456
2636
  }
2457
2637
  if (childCtx.common.issues.length) {
2458
2638
  issues.push(childCtx.common.issues);
@@ -2473,8 +2653,8 @@ var ZodUnion = class extends ZodType {
2473
2653
  get options() {
2474
2654
  return this._def.options;
2475
2655
  }
2476
- };
2477
- __name(ZodUnion, "ZodUnion");
2656
+ }, "ZodUnion");
2657
+ __name2(ZodUnion, "ZodUnion");
2478
2658
  ZodUnion.create = (types, params) => {
2479
2659
  return new ZodUnion({
2480
2660
  options: types,
@@ -2482,13 +2662,15 @@ ZodUnion.create = (types, params) => {
2482
2662
  ...processCreateParams(params)
2483
2663
  });
2484
2664
  };
2485
- var getDiscriminator = /* @__PURE__ */ __name((type) => {
2665
+ var getDiscriminator = /* @__PURE__ */ __name2((type) => {
2486
2666
  if (type instanceof ZodLazy) {
2487
2667
  return getDiscriminator(type.schema);
2488
2668
  } else if (type instanceof ZodEffects) {
2489
2669
  return getDiscriminator(type.innerType());
2490
2670
  } else if (type instanceof ZodLiteral) {
2491
- return [type.value];
2671
+ return [
2672
+ type.value
2673
+ ];
2492
2674
  } else if (type instanceof ZodEnum) {
2493
2675
  return type.options;
2494
2676
  } else if (type instanceof ZodNativeEnum) {
@@ -2496,14 +2678,18 @@ var getDiscriminator = /* @__PURE__ */ __name((type) => {
2496
2678
  } else if (type instanceof ZodDefault) {
2497
2679
  return getDiscriminator(type._def.innerType);
2498
2680
  } else if (type instanceof ZodUndefined) {
2499
- return [void 0];
2681
+ return [
2682
+ void 0
2683
+ ];
2500
2684
  } else if (type instanceof ZodNull) {
2501
- return [null];
2685
+ return [
2686
+ null
2687
+ ];
2502
2688
  } else {
2503
2689
  return null;
2504
2690
  }
2505
2691
  }, "getDiscriminator");
2506
- var ZodDiscriminatedUnion = class extends ZodType {
2692
+ var ZodDiscriminatedUnion = /* @__PURE__ */ __name(class extends ZodType {
2507
2693
  _parse(input) {
2508
2694
  const { ctx } = this._processInputParams(input);
2509
2695
  if (ctx.parsedType !== ZodParsedType.object) {
@@ -2521,7 +2707,9 @@ var ZodDiscriminatedUnion = class extends ZodType {
2521
2707
  addIssueToContext(ctx, {
2522
2708
  code: ZodIssueCode.invalid_union_discriminator,
2523
2709
  options: Array.from(this.optionsMap.keys()),
2524
- path: [discriminator]
2710
+ path: [
2711
+ discriminator
2712
+ ]
2525
2713
  });
2526
2714
  return INVALID;
2527
2715
  }
@@ -2549,13 +2737,13 @@ var ZodDiscriminatedUnion = class extends ZodType {
2549
2737
  return this._def.optionsMap;
2550
2738
  }
2551
2739
  /**
2552
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2553
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2554
- * have a different value for each object in the union.
2555
- * @param discriminator the name of the discriminator property
2556
- * @param types an array of object schemas
2557
- * @param params
2558
- */
2740
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2741
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2742
+ * have a different value for each object in the union.
2743
+ * @param discriminator the name of the discriminator property
2744
+ * @param types an array of object schemas
2745
+ * @param params
2746
+ */
2559
2747
  static create(discriminator, options, params) {
2560
2748
  const optionsMap = /* @__PURE__ */ new Map();
2561
2749
  for (const type of options) {
@@ -2578,28 +2766,41 @@ var ZodDiscriminatedUnion = class extends ZodType {
2578
2766
  ...processCreateParams(params)
2579
2767
  });
2580
2768
  }
2581
- };
2582
- __name(ZodDiscriminatedUnion, "ZodDiscriminatedUnion");
2769
+ }, "ZodDiscriminatedUnion");
2770
+ __name2(ZodDiscriminatedUnion, "ZodDiscriminatedUnion");
2583
2771
  function mergeValues(a, b) {
2584
2772
  const aType = getParsedType(a);
2585
2773
  const bType = getParsedType(b);
2586
2774
  if (a === b) {
2587
- return { valid: true, data: a };
2775
+ return {
2776
+ valid: true,
2777
+ data: a
2778
+ };
2588
2779
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2589
2780
  const bKeys = util.objectKeys(b);
2590
2781
  const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2591
- const newObj = { ...a, ...b };
2782
+ const newObj = {
2783
+ ...a,
2784
+ ...b
2785
+ };
2592
2786
  for (const key of sharedKeys) {
2593
2787
  const sharedValue = mergeValues(a[key], b[key]);
2594
2788
  if (!sharedValue.valid) {
2595
- return { valid: false };
2789
+ return {
2790
+ valid: false
2791
+ };
2596
2792
  }
2597
2793
  newObj[key] = sharedValue.data;
2598
2794
  }
2599
- return { valid: true, data: newObj };
2795
+ return {
2796
+ valid: true,
2797
+ data: newObj
2798
+ };
2600
2799
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2601
2800
  if (a.length !== b.length) {
2602
- return { valid: false };
2801
+ return {
2802
+ valid: false
2803
+ };
2603
2804
  }
2604
2805
  const newArray = [];
2605
2806
  for (let index16 = 0; index16 < a.length; index16++) {
@@ -2607,22 +2808,33 @@ function mergeValues(a, b) {
2607
2808
  const itemB = b[index16];
2608
2809
  const sharedValue = mergeValues(itemA, itemB);
2609
2810
  if (!sharedValue.valid) {
2610
- return { valid: false };
2811
+ return {
2812
+ valid: false
2813
+ };
2611
2814
  }
2612
2815
  newArray.push(sharedValue.data);
2613
2816
  }
2614
- return { valid: true, data: newArray };
2817
+ return {
2818
+ valid: true,
2819
+ data: newArray
2820
+ };
2615
2821
  } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
2616
- return { valid: true, data: a };
2822
+ return {
2823
+ valid: true,
2824
+ data: a
2825
+ };
2617
2826
  } else {
2618
- return { valid: false };
2827
+ return {
2828
+ valid: false
2829
+ };
2619
2830
  }
2620
2831
  }
2621
2832
  __name(mergeValues, "mergeValues");
2622
- var ZodIntersection = class extends ZodType {
2833
+ __name2(mergeValues, "mergeValues");
2834
+ var ZodIntersection = /* @__PURE__ */ __name(class extends ZodType {
2623
2835
  _parse(input) {
2624
2836
  const { status, ctx } = this._processInputParams(input);
2625
- const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {
2837
+ const handleParsed = /* @__PURE__ */ __name2((parsedLeft, parsedRight) => {
2626
2838
  if (isAborted(parsedLeft) || isAborted(parsedRight)) {
2627
2839
  return INVALID;
2628
2840
  }
@@ -2636,7 +2848,10 @@ var ZodIntersection = class extends ZodType {
2636
2848
  if (isDirty(parsedLeft) || isDirty(parsedRight)) {
2637
2849
  status.dirty();
2638
2850
  }
2639
- return { status: status.value, value: merged.data };
2851
+ return {
2852
+ status: status.value,
2853
+ value: merged.data
2854
+ };
2640
2855
  }, "handleParsed");
2641
2856
  if (ctx.common.async) {
2642
2857
  return Promise.all([
@@ -2663,8 +2878,8 @@ var ZodIntersection = class extends ZodType {
2663
2878
  }));
2664
2879
  }
2665
2880
  }
2666
- };
2667
- __name(ZodIntersection, "ZodIntersection");
2881
+ }, "ZodIntersection");
2882
+ __name2(ZodIntersection, "ZodIntersection");
2668
2883
  ZodIntersection.create = (left, right, params) => {
2669
2884
  return new ZodIntersection({
2670
2885
  left,
@@ -2673,7 +2888,7 @@ ZodIntersection.create = (left, right, params) => {
2673
2888
  ...processCreateParams(params)
2674
2889
  });
2675
2890
  };
2676
- var ZodTuple = class extends ZodType {
2891
+ var ZodTuple = /* @__PURE__ */ __name(class extends ZodType {
2677
2892
  _parse(input) {
2678
2893
  const { status, ctx } = this._processInputParams(input);
2679
2894
  if (ctx.parsedType !== ZodParsedType.array) {
@@ -2705,7 +2920,9 @@ var ZodTuple = class extends ZodType {
2705
2920
  });
2706
2921
  status.dirty();
2707
2922
  }
2708
- const items = [...ctx.data].map((item, itemIndex) => {
2923
+ const items = [
2924
+ ...ctx.data
2925
+ ].map((item, itemIndex) => {
2709
2926
  const schema = this._def.items[itemIndex] || this._def.rest;
2710
2927
  if (!schema)
2711
2928
  return null;
@@ -2728,8 +2945,8 @@ var ZodTuple = class extends ZodType {
2728
2945
  rest
2729
2946
  });
2730
2947
  }
2731
- };
2732
- __name(ZodTuple, "ZodTuple");
2948
+ }, "ZodTuple");
2949
+ __name2(ZodTuple, "ZodTuple");
2733
2950
  ZodTuple.create = (schemas, params) => {
2734
2951
  if (!Array.isArray(schemas)) {
2735
2952
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
@@ -2741,7 +2958,7 @@ ZodTuple.create = (schemas, params) => {
2741
2958
  ...processCreateParams(params)
2742
2959
  });
2743
2960
  };
2744
- var ZodRecord = class extends ZodType {
2961
+ var ZodRecord = /* @__PURE__ */ __name(class extends ZodType {
2745
2962
  get keySchema() {
2746
2963
  return this._def.keyType;
2747
2964
  }
@@ -2792,9 +3009,9 @@ var ZodRecord = class extends ZodType {
2792
3009
  ...processCreateParams(second)
2793
3010
  });
2794
3011
  }
2795
- };
2796
- __name(ZodRecord, "ZodRecord");
2797
- var ZodMap = class extends ZodType {
3012
+ }, "ZodRecord");
3013
+ __name2(ZodRecord, "ZodRecord");
3014
+ var ZodMap = /* @__PURE__ */ __name(class extends ZodType {
2798
3015
  get keySchema() {
2799
3016
  return this._def.keyType;
2800
3017
  }
@@ -2813,10 +3030,18 @@ var ZodMap = class extends ZodType {
2813
3030
  }
2814
3031
  const keyType = this._def.keyType;
2815
3032
  const valueType = this._def.valueType;
2816
- const pairs = [...ctx.data.entries()].map(([key, value], index16) => {
3033
+ const pairs = [
3034
+ ...ctx.data.entries()
3035
+ ].map(([key, value], index16) => {
2817
3036
  return {
2818
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index16, "key"])),
2819
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index16, "value"]))
3037
+ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [
3038
+ index16,
3039
+ "key"
3040
+ ])),
3041
+ value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [
3042
+ index16,
3043
+ "value"
3044
+ ]))
2820
3045
  };
2821
3046
  });
2822
3047
  if (ctx.common.async) {
@@ -2833,7 +3058,10 @@ var ZodMap = class extends ZodType {
2833
3058
  }
2834
3059
  finalMap.set(key.value, value.value);
2835
3060
  }
2836
- return { status: status.value, value: finalMap };
3061
+ return {
3062
+ status: status.value,
3063
+ value: finalMap
3064
+ };
2837
3065
  });
2838
3066
  } else {
2839
3067
  const finalMap = /* @__PURE__ */ new Map();
@@ -2848,11 +3076,14 @@ var ZodMap = class extends ZodType {
2848
3076
  }
2849
3077
  finalMap.set(key.value, value.value);
2850
3078
  }
2851
- return { status: status.value, value: finalMap };
3079
+ return {
3080
+ status: status.value,
3081
+ value: finalMap
3082
+ };
2852
3083
  }
2853
3084
  }
2854
- };
2855
- __name(ZodMap, "ZodMap");
3085
+ }, "ZodMap");
3086
+ __name2(ZodMap, "ZodMap");
2856
3087
  ZodMap.create = (keyType, valueType, params) => {
2857
3088
  return new ZodMap({
2858
3089
  valueType,
@@ -2861,7 +3092,7 @@ ZodMap.create = (keyType, valueType, params) => {
2861
3092
  ...processCreateParams(params)
2862
3093
  });
2863
3094
  };
2864
- var ZodSet = class extends ZodType {
3095
+ var ZodSet = /* @__PURE__ */ __name(class extends ZodType {
2865
3096
  _parse(input) {
2866
3097
  const { status, ctx } = this._processInputParams(input);
2867
3098
  if (ctx.parsedType !== ZodParsedType.set) {
@@ -2909,10 +3140,16 @@ var ZodSet = class extends ZodType {
2909
3140
  status.dirty();
2910
3141
  parsedSet.add(element.value);
2911
3142
  }
2912
- return { status: status.value, value: parsedSet };
3143
+ return {
3144
+ status: status.value,
3145
+ value: parsedSet
3146
+ };
2913
3147
  }
2914
3148
  __name(finalizeSet, "finalizeSet");
2915
- const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
3149
+ __name2(finalizeSet, "finalizeSet");
3150
+ const elements = [
3151
+ ...ctx.data.values()
3152
+ ].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
2916
3153
  if (ctx.common.async) {
2917
3154
  return Promise.all(elements).then((elements2) => finalizeSet(elements2));
2918
3155
  } else {
@@ -2922,13 +3159,19 @@ var ZodSet = class extends ZodType {
2922
3159
  min(minSize, message) {
2923
3160
  return new ZodSet({
2924
3161
  ...this._def,
2925
- minSize: { value: minSize, message: errorUtil.toString(message) }
3162
+ minSize: {
3163
+ value: minSize,
3164
+ message: errorUtil.toString(message)
3165
+ }
2926
3166
  });
2927
3167
  }
2928
3168
  max(maxSize, message) {
2929
3169
  return new ZodSet({
2930
3170
  ...this._def,
2931
- maxSize: { value: maxSize, message: errorUtil.toString(message) }
3171
+ maxSize: {
3172
+ value: maxSize,
3173
+ message: errorUtil.toString(message)
3174
+ }
2932
3175
  });
2933
3176
  }
2934
3177
  size(size, message) {
@@ -2937,8 +3180,8 @@ var ZodSet = class extends ZodType {
2937
3180
  nonempty(message) {
2938
3181
  return this.min(1, message);
2939
3182
  }
2940
- };
2941
- __name(ZodSet, "ZodSet");
3183
+ }, "ZodSet");
3184
+ __name2(ZodSet, "ZodSet");
2942
3185
  ZodSet.create = (valueType, params) => {
2943
3186
  return new ZodSet({
2944
3187
  valueType,
@@ -2948,7 +3191,7 @@ ZodSet.create = (valueType, params) => {
2948
3191
  ...processCreateParams(params)
2949
3192
  });
2950
3193
  };
2951
- var ZodFunction = class extends ZodType {
3194
+ var ZodFunction = /* @__PURE__ */ __name(class extends ZodType {
2952
3195
  constructor() {
2953
3196
  super(...arguments);
2954
3197
  this.validate = this.implement;
@@ -2980,6 +3223,7 @@ var ZodFunction = class extends ZodType {
2980
3223
  });
2981
3224
  }
2982
3225
  __name(makeArgsIssue, "makeArgsIssue");
3226
+ __name2(makeArgsIssue, "makeArgsIssue");
2983
3227
  function makeReturnsIssue(returns, error) {
2984
3228
  return makeIssue({
2985
3229
  data: returns,
@@ -2997,7 +3241,10 @@ var ZodFunction = class extends ZodType {
2997
3241
  });
2998
3242
  }
2999
3243
  __name(makeReturnsIssue, "makeReturnsIssue");
3000
- const params = { errorMap: ctx.common.contextualErrorMap };
3244
+ __name2(makeReturnsIssue, "makeReturnsIssue");
3245
+ const params = {
3246
+ errorMap: ctx.common.contextualErrorMap
3247
+ };
3001
3248
  const fn = ctx.data;
3002
3249
  if (this._def.returns instanceof ZodPromise) {
3003
3250
  const me = this;
@@ -3019,12 +3266,16 @@ var ZodFunction = class extends ZodType {
3019
3266
  return OK(function(...args) {
3020
3267
  const parsedArgs = me._def.args.safeParse(args, params);
3021
3268
  if (!parsedArgs.success) {
3022
- throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3269
+ throw new ZodError([
3270
+ makeArgsIssue(args, parsedArgs.error)
3271
+ ]);
3023
3272
  }
3024
3273
  const result = Reflect.apply(fn, this, parsedArgs.data);
3025
3274
  const parsedReturns = me._def.returns.safeParse(result, params);
3026
3275
  if (!parsedReturns.success) {
3027
- throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3276
+ throw new ZodError([
3277
+ makeReturnsIssue(result, parsedReturns.error)
3278
+ ]);
3028
3279
  }
3029
3280
  return parsedReturns.data;
3030
3281
  });
@@ -3064,19 +3315,23 @@ var ZodFunction = class extends ZodType {
3064
3315
  ...processCreateParams(params)
3065
3316
  });
3066
3317
  }
3067
- };
3068
- __name(ZodFunction, "ZodFunction");
3069
- var ZodLazy = class extends ZodType {
3318
+ }, "ZodFunction");
3319
+ __name2(ZodFunction, "ZodFunction");
3320
+ var ZodLazy = /* @__PURE__ */ __name(class extends ZodType {
3070
3321
  get schema() {
3071
3322
  return this._def.getter();
3072
3323
  }
3073
3324
  _parse(input) {
3074
3325
  const { ctx } = this._processInputParams(input);
3075
3326
  const lazySchema = this._def.getter();
3076
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
3327
+ return lazySchema._parse({
3328
+ data: ctx.data,
3329
+ path: ctx.path,
3330
+ parent: ctx
3331
+ });
3077
3332
  }
3078
- };
3079
- __name(ZodLazy, "ZodLazy");
3333
+ }, "ZodLazy");
3334
+ __name2(ZodLazy, "ZodLazy");
3080
3335
  ZodLazy.create = (getter, params) => {
3081
3336
  return new ZodLazy({
3082
3337
  getter,
@@ -3084,7 +3339,7 @@ ZodLazy.create = (getter, params) => {
3084
3339
  ...processCreateParams(params)
3085
3340
  });
3086
3341
  };
3087
- var ZodLiteral = class extends ZodType {
3342
+ var ZodLiteral = /* @__PURE__ */ __name(class extends ZodType {
3088
3343
  _parse(input) {
3089
3344
  if (input.data !== this._def.value) {
3090
3345
  const ctx = this._getOrReturnCtx(input);
@@ -3095,13 +3350,16 @@ var ZodLiteral = class extends ZodType {
3095
3350
  });
3096
3351
  return INVALID;
3097
3352
  }
3098
- return { status: "valid", value: input.data };
3353
+ return {
3354
+ status: "valid",
3355
+ value: input.data
3356
+ };
3099
3357
  }
3100
3358
  get value() {
3101
3359
  return this._def.value;
3102
3360
  }
3103
- };
3104
- __name(ZodLiteral, "ZodLiteral");
3361
+ }, "ZodLiteral");
3362
+ __name2(ZodLiteral, "ZodLiteral");
3105
3363
  ZodLiteral.create = (value, params) => {
3106
3364
  return new ZodLiteral({
3107
3365
  value,
@@ -3117,7 +3375,8 @@ function createZodEnum(values, params) {
3117
3375
  });
3118
3376
  }
3119
3377
  __name(createZodEnum, "createZodEnum");
3120
- var ZodEnum = class extends ZodType {
3378
+ __name2(createZodEnum, "createZodEnum");
3379
+ var ZodEnum = /* @__PURE__ */ __name(class extends ZodType {
3121
3380
  _parse(input) {
3122
3381
  if (typeof input.data !== "string") {
3123
3382
  const ctx = this._getOrReturnCtx(input);
@@ -3171,10 +3430,10 @@ var ZodEnum = class extends ZodType {
3171
3430
  exclude(values) {
3172
3431
  return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
3173
3432
  }
3174
- };
3175
- __name(ZodEnum, "ZodEnum");
3433
+ }, "ZodEnum");
3434
+ __name2(ZodEnum, "ZodEnum");
3176
3435
  ZodEnum.create = createZodEnum;
3177
- var ZodNativeEnum = class extends ZodType {
3436
+ var ZodNativeEnum = /* @__PURE__ */ __name(class extends ZodType {
3178
3437
  _parse(input) {
3179
3438
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
3180
3439
  const ctx = this._getOrReturnCtx(input);
@@ -3201,8 +3460,8 @@ var ZodNativeEnum = class extends ZodType {
3201
3460
  get enum() {
3202
3461
  return this._def.values;
3203
3462
  }
3204
- };
3205
- __name(ZodNativeEnum, "ZodNativeEnum");
3463
+ }, "ZodNativeEnum");
3464
+ __name2(ZodNativeEnum, "ZodNativeEnum");
3206
3465
  ZodNativeEnum.create = (values, params) => {
3207
3466
  return new ZodNativeEnum({
3208
3467
  values,
@@ -3210,7 +3469,7 @@ ZodNativeEnum.create = (values, params) => {
3210
3469
  ...processCreateParams(params)
3211
3470
  });
3212
3471
  };
3213
- var ZodPromise = class extends ZodType {
3472
+ var ZodPromise = /* @__PURE__ */ __name(class extends ZodType {
3214
3473
  unwrap() {
3215
3474
  return this._def.type;
3216
3475
  }
@@ -3232,8 +3491,8 @@ var ZodPromise = class extends ZodType {
3232
3491
  });
3233
3492
  }));
3234
3493
  }
3235
- };
3236
- __name(ZodPromise, "ZodPromise");
3494
+ }, "ZodPromise");
3495
+ __name2(ZodPromise, "ZodPromise");
3237
3496
  ZodPromise.create = (schema, params) => {
3238
3497
  return new ZodPromise({
3239
3498
  type: schema,
@@ -3241,7 +3500,7 @@ ZodPromise.create = (schema, params) => {
3241
3500
  ...processCreateParams(params)
3242
3501
  });
3243
3502
  };
3244
- var ZodEffects = class extends ZodType {
3503
+ var ZodEffects = /* @__PURE__ */ __name(class extends ZodType {
3245
3504
  innerType() {
3246
3505
  return this._def.schema;
3247
3506
  }
@@ -3290,7 +3549,7 @@ var ZodEffects = class extends ZodType {
3290
3549
  }
3291
3550
  }
3292
3551
  if (effect.type === "refinement") {
3293
- const executeRefinement = /* @__PURE__ */ __name((acc) => {
3552
+ const executeRefinement = /* @__PURE__ */ __name2((acc) => {
3294
3553
  const result = effect.refinement(acc, checkCtx);
3295
3554
  if (ctx.common.async) {
3296
3555
  return Promise.resolve(result);
@@ -3311,15 +3570,25 @@ var ZodEffects = class extends ZodType {
3311
3570
  if (inner.status === "dirty")
3312
3571
  status.dirty();
3313
3572
  executeRefinement(inner.value);
3314
- return { status: status.value, value: inner.value };
3573
+ return {
3574
+ status: status.value,
3575
+ value: inner.value
3576
+ };
3315
3577
  } else {
3316
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
3578
+ return this._def.schema._parseAsync({
3579
+ data: ctx.data,
3580
+ path: ctx.path,
3581
+ parent: ctx
3582
+ }).then((inner) => {
3317
3583
  if (inner.status === "aborted")
3318
3584
  return INVALID;
3319
3585
  if (inner.status === "dirty")
3320
3586
  status.dirty();
3321
3587
  return executeRefinement(inner.value).then(() => {
3322
- return { status: status.value, value: inner.value };
3588
+ return {
3589
+ status: status.value,
3590
+ value: inner.value
3591
+ };
3323
3592
  });
3324
3593
  });
3325
3594
  }
@@ -3337,19 +3606,29 @@ var ZodEffects = class extends ZodType {
3337
3606
  if (result instanceof Promise) {
3338
3607
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3339
3608
  }
3340
- return { status: status.value, value: result };
3609
+ return {
3610
+ status: status.value,
3611
+ value: result
3612
+ };
3341
3613
  } else {
3342
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3614
+ return this._def.schema._parseAsync({
3615
+ data: ctx.data,
3616
+ path: ctx.path,
3617
+ parent: ctx
3618
+ }).then((base) => {
3343
3619
  if (!isValid(base))
3344
3620
  return base;
3345
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3621
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3622
+ status: status.value,
3623
+ value: result
3624
+ }));
3346
3625
  });
3347
3626
  }
3348
3627
  }
3349
3628
  util.assertNever(effect);
3350
3629
  }
3351
- };
3352
- __name(ZodEffects, "ZodEffects");
3630
+ }, "ZodEffects");
3631
+ __name2(ZodEffects, "ZodEffects");
3353
3632
  ZodEffects.create = (schema, effect, params) => {
3354
3633
  return new ZodEffects({
3355
3634
  schema,
@@ -3361,12 +3640,15 @@ ZodEffects.create = (schema, effect, params) => {
3361
3640
  ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3362
3641
  return new ZodEffects({
3363
3642
  schema,
3364
- effect: { type: "preprocess", transform: preprocess },
3643
+ effect: {
3644
+ type: "preprocess",
3645
+ transform: preprocess
3646
+ },
3365
3647
  typeName: ZodFirstPartyTypeKind.ZodEffects,
3366
3648
  ...processCreateParams(params)
3367
3649
  });
3368
3650
  };
3369
- var ZodOptional = class extends ZodType {
3651
+ var ZodOptional = /* @__PURE__ */ __name(class extends ZodType {
3370
3652
  _parse(input) {
3371
3653
  const parsedType = this._getType(input);
3372
3654
  if (parsedType === ZodParsedType.undefined) {
@@ -3377,8 +3659,8 @@ var ZodOptional = class extends ZodType {
3377
3659
  unwrap() {
3378
3660
  return this._def.innerType;
3379
3661
  }
3380
- };
3381
- __name(ZodOptional, "ZodOptional");
3662
+ }, "ZodOptional");
3663
+ __name2(ZodOptional, "ZodOptional");
3382
3664
  ZodOptional.create = (type, params) => {
3383
3665
  return new ZodOptional({
3384
3666
  innerType: type,
@@ -3386,7 +3668,7 @@ ZodOptional.create = (type, params) => {
3386
3668
  ...processCreateParams(params)
3387
3669
  });
3388
3670
  };
3389
- var ZodNullable = class extends ZodType {
3671
+ var ZodNullable = /* @__PURE__ */ __name(class extends ZodType {
3390
3672
  _parse(input) {
3391
3673
  const parsedType = this._getType(input);
3392
3674
  if (parsedType === ZodParsedType.null) {
@@ -3397,8 +3679,8 @@ var ZodNullable = class extends ZodType {
3397
3679
  unwrap() {
3398
3680
  return this._def.innerType;
3399
3681
  }
3400
- };
3401
- __name(ZodNullable, "ZodNullable");
3682
+ }, "ZodNullable");
3683
+ __name2(ZodNullable, "ZodNullable");
3402
3684
  ZodNullable.create = (type, params) => {
3403
3685
  return new ZodNullable({
3404
3686
  innerType: type,
@@ -3406,7 +3688,7 @@ ZodNullable.create = (type, params) => {
3406
3688
  ...processCreateParams(params)
3407
3689
  });
3408
3690
  };
3409
- var ZodDefault = class extends ZodType {
3691
+ var ZodDefault = /* @__PURE__ */ __name(class extends ZodType {
3410
3692
  _parse(input) {
3411
3693
  const { ctx } = this._processInputParams(input);
3412
3694
  let data = ctx.data;
@@ -3422,8 +3704,8 @@ var ZodDefault = class extends ZodType {
3422
3704
  removeDefault() {
3423
3705
  return this._def.innerType;
3424
3706
  }
3425
- };
3426
- __name(ZodDefault, "ZodDefault");
3707
+ }, "ZodDefault");
3708
+ __name2(ZodDefault, "ZodDefault");
3427
3709
  ZodDefault.create = (type, params) => {
3428
3710
  return new ZodDefault({
3429
3711
  innerType: type,
@@ -3432,7 +3714,7 @@ ZodDefault.create = (type, params) => {
3432
3714
  ...processCreateParams(params)
3433
3715
  });
3434
3716
  };
3435
- var ZodCatch = class extends ZodType {
3717
+ var ZodCatch = /* @__PURE__ */ __name(class extends ZodType {
3436
3718
  _parse(input) {
3437
3719
  const { ctx } = this._processInputParams(input);
3438
3720
  const newCtx = {
@@ -3476,8 +3758,8 @@ var ZodCatch = class extends ZodType {
3476
3758
  removeCatch() {
3477
3759
  return this._def.innerType;
3478
3760
  }
3479
- };
3480
- __name(ZodCatch, "ZodCatch");
3761
+ }, "ZodCatch");
3762
+ __name2(ZodCatch, "ZodCatch");
3481
3763
  ZodCatch.create = (type, params) => {
3482
3764
  return new ZodCatch({
3483
3765
  innerType: type,
@@ -3486,7 +3768,7 @@ ZodCatch.create = (type, params) => {
3486
3768
  ...processCreateParams(params)
3487
3769
  });
3488
3770
  };
3489
- var ZodNaN = class extends ZodType {
3771
+ var ZodNaN = /* @__PURE__ */ __name(class extends ZodType {
3490
3772
  _parse(input) {
3491
3773
  const parsedType = this._getType(input);
3492
3774
  if (parsedType !== ZodParsedType.nan) {
@@ -3498,10 +3780,13 @@ var ZodNaN = class extends ZodType {
3498
3780
  });
3499
3781
  return INVALID;
3500
3782
  }
3501
- return { status: "valid", value: input.data };
3783
+ return {
3784
+ status: "valid",
3785
+ value: input.data
3786
+ };
3502
3787
  }
3503
- };
3504
- __name(ZodNaN, "ZodNaN");
3788
+ }, "ZodNaN");
3789
+ __name2(ZodNaN, "ZodNaN");
3505
3790
  ZodNaN.create = (params) => {
3506
3791
  return new ZodNaN({
3507
3792
  typeName: ZodFirstPartyTypeKind.ZodNaN,
@@ -3509,7 +3794,7 @@ ZodNaN.create = (params) => {
3509
3794
  });
3510
3795
  };
3511
3796
  var BRAND = Symbol("zod_brand");
3512
- var ZodBranded = class extends ZodType {
3797
+ var ZodBranded = /* @__PURE__ */ __name(class extends ZodType {
3513
3798
  _parse(input) {
3514
3799
  const { ctx } = this._processInputParams(input);
3515
3800
  const data = ctx.data;
@@ -3522,13 +3807,13 @@ var ZodBranded = class extends ZodType {
3522
3807
  unwrap() {
3523
3808
  return this._def.type;
3524
3809
  }
3525
- };
3526
- __name(ZodBranded, "ZodBranded");
3527
- var ZodPipeline = class extends ZodType {
3810
+ }, "ZodBranded");
3811
+ __name2(ZodBranded, "ZodBranded");
3812
+ var ZodPipeline = /* @__PURE__ */ __name(class extends ZodType {
3528
3813
  _parse(input) {
3529
3814
  const { status, ctx } = this._processInputParams(input);
3530
3815
  if (ctx.common.async) {
3531
- const handleAsync = /* @__PURE__ */ __name(async () => {
3816
+ const handleAsync = /* @__PURE__ */ __name2(async () => {
3532
3817
  const inResult = await this._def.in._parseAsync({
3533
3818
  data: ctx.data,
3534
3819
  path: ctx.path,
@@ -3578,9 +3863,9 @@ var ZodPipeline = class extends ZodType {
3578
3863
  typeName: ZodFirstPartyTypeKind.ZodPipeline
3579
3864
  });
3580
3865
  }
3581
- };
3582
- __name(ZodPipeline, "ZodPipeline");
3583
- var ZodReadonly = class extends ZodType {
3866
+ }, "ZodPipeline");
3867
+ __name2(ZodPipeline, "ZodPipeline");
3868
+ var ZodReadonly = /* @__PURE__ */ __name(class extends ZodType {
3584
3869
  _parse(input) {
3585
3870
  const result = this._def.innerType._parse(input);
3586
3871
  if (isValid(result)) {
@@ -3588,8 +3873,8 @@ var ZodReadonly = class extends ZodType {
3588
3873
  }
3589
3874
  return result;
3590
3875
  }
3591
- };
3592
- __name(ZodReadonly, "ZodReadonly");
3876
+ }, "ZodReadonly");
3877
+ __name2(ZodReadonly, "ZodReadonly");
3593
3878
  ZodReadonly.create = (type, params) => {
3594
3879
  return new ZodReadonly({
3595
3880
  innerType: type,
@@ -3597,15 +3882,23 @@ ZodReadonly.create = (type, params) => {
3597
3882
  ...processCreateParams(params)
3598
3883
  });
3599
3884
  };
3600
- var custom = /* @__PURE__ */ __name((check, params = {}, fatal) => {
3885
+ var custom = /* @__PURE__ */ __name2((check, params = {}, fatal) => {
3601
3886
  if (check)
3602
3887
  return ZodAny.create().superRefine((data, ctx) => {
3603
3888
  var _a, _b;
3604
3889
  if (!check(data)) {
3605
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3890
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? {
3891
+ message: params
3892
+ } : params;
3606
3893
  const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3607
- const p2 = typeof p === "string" ? { message: p } : p;
3608
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
3894
+ const p2 = typeof p === "string" ? {
3895
+ message: p
3896
+ } : p;
3897
+ ctx.addIssue({
3898
+ code: "custom",
3899
+ ...p2,
3900
+ fatal: _fatal
3901
+ });
3609
3902
  }
3610
3903
  });
3611
3904
  return ZodAny.create();
@@ -3652,7 +3945,7 @@ var ZodFirstPartyTypeKind;
3652
3945
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
3653
3946
  ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
3654
3947
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3655
- var instanceOfType = /* @__PURE__ */ __name((cls, params = {
3948
+ var instanceOfType = /* @__PURE__ */ __name2((cls, params = {
3656
3949
  message: `Input not instance of ${cls.name}`
3657
3950
  }) => custom((data) => data instanceof cls, params), "instanceOfType");
3658
3951
  var stringType = ZodString.create;
@@ -3689,18 +3982,30 @@ var optionalType = ZodOptional.create;
3689
3982
  var nullableType = ZodNullable.create;
3690
3983
  var preprocessType = ZodEffects.createWithPreprocess;
3691
3984
  var pipelineType = ZodPipeline.create;
3692
- var ostring = /* @__PURE__ */ __name(() => stringType().optional(), "ostring");
3693
- var onumber = /* @__PURE__ */ __name(() => numberType().optional(), "onumber");
3694
- var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean");
3985
+ var ostring = /* @__PURE__ */ __name2(() => stringType().optional(), "ostring");
3986
+ var onumber = /* @__PURE__ */ __name2(() => numberType().optional(), "onumber");
3987
+ var oboolean = /* @__PURE__ */ __name2(() => booleanType().optional(), "oboolean");
3695
3988
  var coerce = {
3696
- string: (arg) => ZodString.create({ ...arg, coerce: true }),
3697
- number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3989
+ string: (arg) => ZodString.create({
3990
+ ...arg,
3991
+ coerce: true
3992
+ }),
3993
+ number: (arg) => ZodNumber.create({
3994
+ ...arg,
3995
+ coerce: true
3996
+ }),
3698
3997
  boolean: (arg) => ZodBoolean.create({
3699
3998
  ...arg,
3700
3999
  coerce: true
3701
4000
  }),
3702
- bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3703
- date: (arg) => ZodDate.create({ ...arg, coerce: true })
4001
+ bigint: (arg) => ZodBigInt.create({
4002
+ ...arg,
4003
+ coerce: true
4004
+ }),
4005
+ date: (arg) => ZodDate.create({
4006
+ ...arg,
4007
+ coerce: true
4008
+ })
3704
4009
  };
3705
4010
  var NEVER = INVALID;
3706
4011
  var z = /* @__PURE__ */ Object.freeze({
@@ -3819,11 +4124,11 @@ var z = /* @__PURE__ */ Object.freeze({
3819
4124
  ZodError
3820
4125
  });
3821
4126
 
3822
- // ../core/schemas/video-resource.js
4127
+ // ../core/dist/schemas/video-resource.js
3823
4128
  var VideoResourceSchema = z.object({
3824
- _id: z.string(),
3825
- _updatedAt: z.string().optional(),
3826
- _createdAt: z.string().optional(),
4129
+ id: z.string(),
4130
+ updatedAt: z.string().optional(),
4131
+ createdAt: z.string().optional(),
3827
4132
  title: z.string().optional().nullable(),
3828
4133
  duration: z.number().optional().nullable(),
3829
4134
  muxPlaybackId: z.string().optional().nullable(),
@@ -4529,7 +4834,8 @@ function getUsersSchema(mysqlTable) {
4529
4834
  }).default(import_drizzle_orm11.sql`CURRENT_TIMESTAMP(3)`)
4530
4835
  }, (user) => ({
4531
4836
  emailIdx: (0, import_mysql_core13.index)("email_idx").on(user.email),
4532
- roleIdx: (0, import_mysql_core13.index)("role_idx").on(user.role)
4837
+ roleIdx: (0, import_mysql_core13.index)("role_idx").on(user.role),
4838
+ createdAtIdx: (0, import_mysql_core13.index)("created_at_idx").on(user.createdAt)
4533
4839
  }));
4534
4840
  }
4535
4841
  __name(getUsersSchema, "getUsersSchema");
@@ -5042,135 +5348,135 @@ function getProductSchema(mysqlTable) {
5042
5348
  }
5043
5349
  __name(getProductSchema, "getProductSchema");
5044
5350
 
5045
- // src/lib/mysql/schemas/commerce/purchase.ts
5351
+ // src/lib/mysql/schemas/commerce/purchase-user-transfer.ts
5046
5352
  var import_drizzle_orm22 = require("drizzle-orm");
5047
5353
  var import_mysql_core27 = require("drizzle-orm/mysql-core");
5048
- function getPurchaseSchema(mysqlTable) {
5049
- return mysqlTable("purchases", {
5354
+ function getPurchaseUserTransferSchema(mysqlTable) {
5355
+ return mysqlTable("purchaseUserTransfers", {
5050
5356
  id: (0, import_mysql_core27.varchar)("id", {
5051
5357
  length: 191
5052
5358
  }).notNull(),
5053
- userId: (0, import_mysql_core27.varchar)("userId", {
5359
+ transferState: (0, import_mysql_core27.mysqlEnum)("transferState", [
5360
+ "AVAILABLE",
5361
+ "INITIATED",
5362
+ "VERIFIED",
5363
+ "CANCELED",
5364
+ "EXPIRED",
5365
+ "CONFIRMED",
5366
+ "COMPLETED"
5367
+ ]).default("AVAILABLE").notNull(),
5368
+ purchaseId: (0, import_mysql_core27.varchar)("purchaseId", {
5369
+ length: 191
5370
+ }).notNull(),
5371
+ sourceUserId: (0, import_mysql_core27.varchar)("sourceUserId", {
5372
+ length: 191
5373
+ }).notNull(),
5374
+ targetUserId: (0, import_mysql_core27.varchar)("targetUserId", {
5054
5375
  length: 191
5055
5376
  }),
5056
5377
  createdAt: (0, import_mysql_core27.datetime)("createdAt", {
5057
5378
  mode: "string",
5058
5379
  fsp: 3
5059
5380
  }).default(import_drizzle_orm22.sql`CURRENT_TIMESTAMP(3)`).notNull(),
5060
- totalAmount: (0, import_mysql_core27.decimal)("totalAmount", {
5381
+ expiresAt: (0, import_mysql_core27.datetime)("expiresAt", {
5382
+ mode: "string",
5383
+ fsp: 3
5384
+ }),
5385
+ canceledAt: (0, import_mysql_core27.datetime)("canceledAt", {
5386
+ mode: "string",
5387
+ fsp: 3
5388
+ }),
5389
+ confirmedAt: (0, import_mysql_core27.datetime)("confirmedAt", {
5390
+ mode: "string",
5391
+ fsp: 3
5392
+ }),
5393
+ completedAt: (0, import_mysql_core27.datetime)("completedAt", {
5394
+ mode: "string",
5395
+ fsp: 3
5396
+ })
5397
+ }, (table) => {
5398
+ return {
5399
+ purchaseUserTransferId: (0, import_mysql_core27.primaryKey)({
5400
+ columns: [
5401
+ table.id
5402
+ ],
5403
+ name: "PurchaseUserTransfer_id"
5404
+ })
5405
+ };
5406
+ });
5407
+ }
5408
+ __name(getPurchaseUserTransferSchema, "getPurchaseUserTransferSchema");
5409
+
5410
+ // src/lib/mysql/schemas/commerce/purchase.ts
5411
+ var import_drizzle_orm23 = require("drizzle-orm");
5412
+ var import_mysql_core28 = require("drizzle-orm/mysql-core");
5413
+ function getPurchaseSchema(mysqlTable) {
5414
+ return mysqlTable("purchases", {
5415
+ id: (0, import_mysql_core28.varchar)("id", {
5416
+ length: 191
5417
+ }).notNull(),
5418
+ userId: (0, import_mysql_core28.varchar)("userId", {
5419
+ length: 191
5420
+ }),
5421
+ createdAt: (0, import_mysql_core28.datetime)("createdAt", {
5422
+ mode: "string",
5423
+ fsp: 3
5424
+ }).default(import_drizzle_orm23.sql`CURRENT_TIMESTAMP(3)`).notNull(),
5425
+ totalAmount: (0, import_mysql_core28.decimal)("totalAmount", {
5061
5426
  precision: 65,
5062
5427
  scale: 30
5063
5428
  }).notNull(),
5064
- ipAddress: (0, import_mysql_core27.varchar)("ip_address", {
5429
+ ipAddress: (0, import_mysql_core28.varchar)("ip_address", {
5065
5430
  length: 191
5066
5431
  }),
5067
- city: (0, import_mysql_core27.varchar)("city", {
5432
+ city: (0, import_mysql_core28.varchar)("city", {
5068
5433
  length: 191
5069
5434
  }),
5070
- state: (0, import_mysql_core27.varchar)("state", {
5435
+ state: (0, import_mysql_core28.varchar)("state", {
5071
5436
  length: 191
5072
5437
  }),
5073
- country: (0, import_mysql_core27.varchar)("country", {
5438
+ country: (0, import_mysql_core28.varchar)("country", {
5074
5439
  length: 191
5075
5440
  }),
5076
- couponId: (0, import_mysql_core27.varchar)("couponId", {
5441
+ couponId: (0, import_mysql_core28.varchar)("couponId", {
5077
5442
  length: 191
5078
5443
  }),
5079
- productId: (0, import_mysql_core27.varchar)("productId", {
5444
+ productId: (0, import_mysql_core28.varchar)("productId", {
5080
5445
  length: 191
5081
5446
  }).notNull(),
5082
- merchantChargeId: (0, import_mysql_core27.varchar)("merchantChargeId", {
5447
+ merchantChargeId: (0, import_mysql_core28.varchar)("merchantChargeId", {
5083
5448
  length: 191
5084
5449
  }),
5085
- upgradedFromId: (0, import_mysql_core27.varchar)("upgradedFromId", {
5450
+ upgradedFromId: (0, import_mysql_core28.varchar)("upgradedFromId", {
5086
5451
  length: 191
5087
5452
  }),
5088
- status: (0, import_mysql_core27.varchar)("status", {
5453
+ status: (0, import_mysql_core28.varchar)("status", {
5089
5454
  length: 191
5090
5455
  }).default("Valid").notNull(),
5091
- bulkCouponId: (0, import_mysql_core27.varchar)("bulkCouponId", {
5456
+ bulkCouponId: (0, import_mysql_core28.varchar)("bulkCouponId", {
5092
5457
  length: 191
5093
5458
  }),
5094
- merchantSessionId: (0, import_mysql_core27.varchar)("merchantSessionId", {
5459
+ merchantSessionId: (0, import_mysql_core28.varchar)("merchantSessionId", {
5095
5460
  length: 191
5096
5461
  }),
5097
- redeemedBulkCouponId: (0, import_mysql_core27.varchar)("redeemedBulkCouponId", {
5462
+ redeemedBulkCouponId: (0, import_mysql_core28.varchar)("redeemedBulkCouponId", {
5098
5463
  length: 191
5099
5464
  }),
5100
- metadata: (0, import_mysql_core27.json)("fields").$type().default({})
5465
+ metadata: (0, import_mysql_core28.json)("fields").$type().default({})
5101
5466
  }, (table) => {
5102
5467
  return {
5103
- purchaseId: (0, import_mysql_core27.primaryKey)({
5468
+ purchaseId: (0, import_mysql_core28.primaryKey)({
5104
5469
  columns: [
5105
5470
  table.id
5106
5471
  ],
5107
5472
  name: "Purchase_id"
5108
5473
  }),
5109
- purchaseUpgradedFromIdKey: (0, import_mysql_core27.unique)("Purchase_upgradedFromId_key").on(table.upgradedFromId)
5474
+ purchaseUpgradedFromIdKey: (0, import_mysql_core28.unique)("Purchase_upgradedFromId_key").on(table.upgradedFromId)
5110
5475
  };
5111
5476
  });
5112
5477
  }
5113
5478
  __name(getPurchaseSchema, "getPurchaseSchema");
5114
5479
 
5115
- // src/lib/mysql/schemas/commerce/purchase-user-transfer.ts
5116
- var import_drizzle_orm23 = require("drizzle-orm");
5117
- var import_mysql_core28 = require("drizzle-orm/mysql-core");
5118
- function getPurchaseUserTransferSchema(mysqlTable) {
5119
- return mysqlTable("purchaseUserTransfers", {
5120
- id: (0, import_mysql_core28.varchar)("id", {
5121
- length: 191
5122
- }).notNull(),
5123
- transferState: (0, import_mysql_core28.mysqlEnum)("transferState", [
5124
- "AVAILABLE",
5125
- "INITIATED",
5126
- "VERIFIED",
5127
- "CANCELED",
5128
- "EXPIRED",
5129
- "CONFIRMED",
5130
- "COMPLETED"
5131
- ]).default("AVAILABLE").notNull(),
5132
- purchaseId: (0, import_mysql_core28.varchar)("purchaseId", {
5133
- length: 191
5134
- }).notNull(),
5135
- sourceUserId: (0, import_mysql_core28.varchar)("sourceUserId", {
5136
- length: 191
5137
- }).notNull(),
5138
- targetUserId: (0, import_mysql_core28.varchar)("targetUserId", {
5139
- length: 191
5140
- }),
5141
- createdAt: (0, import_mysql_core28.datetime)("createdAt", {
5142
- mode: "string",
5143
- fsp: 3
5144
- }).default(import_drizzle_orm23.sql`CURRENT_TIMESTAMP(3)`).notNull(),
5145
- expiresAt: (0, import_mysql_core28.datetime)("expiresAt", {
5146
- mode: "string",
5147
- fsp: 3
5148
- }),
5149
- canceledAt: (0, import_mysql_core28.datetime)("canceledAt", {
5150
- mode: "string",
5151
- fsp: 3
5152
- }),
5153
- confirmedAt: (0, import_mysql_core28.datetime)("confirmedAt", {
5154
- mode: "string",
5155
- fsp: 3
5156
- }),
5157
- completedAt: (0, import_mysql_core28.datetime)("completedAt", {
5158
- mode: "string",
5159
- fsp: 3
5160
- })
5161
- }, (table) => {
5162
- return {
5163
- purchaseUserTransferId: (0, import_mysql_core28.primaryKey)({
5164
- columns: [
5165
- table.id
5166
- ],
5167
- name: "PurchaseUserTransfer_id"
5168
- })
5169
- };
5170
- });
5171
- }
5172
- __name(getPurchaseUserTransferSchema, "getPurchaseUserTransferSchema");
5173
-
5174
5480
  // src/lib/mysql/schemas/content/resource-progress.ts
5175
5481
  var import_drizzle_orm24 = require("drizzle-orm");
5176
5482
  var import_mysql_core29 = require("drizzle-orm/mysql-core");
@@ -5285,9 +5591,9 @@ function mySqlDrizzleAdapter(client, tableFn = import_mysql_core30.mysqlTable) {
5285
5591
  }
5286
5592
  const query = import_drizzle_orm25.sql`
5287
5593
  SELECT
5288
- id as _id,
5289
- CAST(updatedAt AS DATETIME) as _updatedAt,
5290
- CAST(createdAt AS DATETIME) as _createdAt,
5594
+ id as id,
5595
+ CAST(updatedAt AS DATETIME) as updatedAt,
5596
+ CAST(createdAt AS DATETIME) as createdAt,
5291
5597
  JSON_EXTRACT (${contentResource.fields}, "$.state") AS state,
5292
5598
  JSON_EXTRACT (${contentResource.fields}, "$.duration") AS duration,
5293
5599
  JSON_EXTRACT (${contentResource.fields}, "$.muxPlaybackId") AS muxPlaybackId,
@@ -5396,6 +5702,8 @@ function mySqlDrizzleAdapter(client, tableFn = import_mysql_core30.mysqlTable) {
5396
5702
  async deleteUser(id) {
5397
5703
  const user = await client.select().from(users).where((0, import_drizzle_orm25.eq)(users.id, id)).then((res) => res[0] ?? null);
5398
5704
  await client.delete(users).where((0, import_drizzle_orm25.eq)(users.id, id));
5705
+ await client.delete(sessions).where((0, import_drizzle_orm25.eq)(sessions.userId, id));
5706
+ await client.delete(accounts).where((0, import_drizzle_orm25.eq)(accounts.userId, id));
5399
5707
  return user;
5400
5708
  },
5401
5709
  async unlinkAccount(account) {