@spscommerce/asst-api 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -57,10 +57,123 @@ module.exports = __toCommonJS(lib_exports);
57
57
  // lib/asstClient.ts
58
58
  var import_ky = __toESM(require("ky"), 1);
59
59
 
60
- // ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
60
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/external.js
61
+ var external_exports = {};
62
+ __export(external_exports, {
63
+ BRAND: () => BRAND,
64
+ DIRTY: () => DIRTY,
65
+ EMPTY_PATH: () => EMPTY_PATH,
66
+ INVALID: () => INVALID,
67
+ NEVER: () => NEVER,
68
+ OK: () => OK,
69
+ ParseStatus: () => ParseStatus,
70
+ Schema: () => ZodType,
71
+ ZodAny: () => ZodAny,
72
+ ZodArray: () => ZodArray,
73
+ ZodBigInt: () => ZodBigInt,
74
+ ZodBoolean: () => ZodBoolean,
75
+ ZodBranded: () => ZodBranded,
76
+ ZodCatch: () => ZodCatch,
77
+ ZodDate: () => ZodDate,
78
+ ZodDefault: () => ZodDefault,
79
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
80
+ ZodEffects: () => ZodEffects,
81
+ ZodEnum: () => ZodEnum,
82
+ ZodError: () => ZodError,
83
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
84
+ ZodFunction: () => ZodFunction,
85
+ ZodIntersection: () => ZodIntersection,
86
+ ZodIssueCode: () => ZodIssueCode,
87
+ ZodLazy: () => ZodLazy,
88
+ ZodLiteral: () => ZodLiteral,
89
+ ZodMap: () => ZodMap,
90
+ ZodNaN: () => ZodNaN,
91
+ ZodNativeEnum: () => ZodNativeEnum,
92
+ ZodNever: () => ZodNever,
93
+ ZodNull: () => ZodNull,
94
+ ZodNullable: () => ZodNullable,
95
+ ZodNumber: () => ZodNumber,
96
+ ZodObject: () => ZodObject,
97
+ ZodOptional: () => ZodOptional,
98
+ ZodParsedType: () => ZodParsedType,
99
+ ZodPipeline: () => ZodPipeline,
100
+ ZodPromise: () => ZodPromise,
101
+ ZodReadonly: () => ZodReadonly,
102
+ ZodRecord: () => ZodRecord,
103
+ ZodSchema: () => ZodType,
104
+ ZodSet: () => ZodSet,
105
+ ZodString: () => ZodString,
106
+ ZodSymbol: () => ZodSymbol,
107
+ ZodTransformer: () => ZodEffects,
108
+ ZodTuple: () => ZodTuple,
109
+ ZodType: () => ZodType,
110
+ ZodUndefined: () => ZodUndefined,
111
+ ZodUnion: () => ZodUnion,
112
+ ZodUnknown: () => ZodUnknown,
113
+ ZodVoid: () => ZodVoid,
114
+ addIssueToContext: () => addIssueToContext,
115
+ any: () => anyType,
116
+ array: () => arrayType,
117
+ bigint: () => bigIntType,
118
+ boolean: () => booleanType,
119
+ coerce: () => coerce,
120
+ custom: () => custom,
121
+ date: () => dateType,
122
+ datetimeRegex: () => datetimeRegex,
123
+ defaultErrorMap: () => en_default,
124
+ discriminatedUnion: () => discriminatedUnionType,
125
+ effect: () => effectsType,
126
+ enum: () => enumType,
127
+ function: () => functionType,
128
+ getErrorMap: () => getErrorMap,
129
+ getParsedType: () => getParsedType,
130
+ instanceof: () => instanceOfType,
131
+ intersection: () => intersectionType,
132
+ isAborted: () => isAborted,
133
+ isAsync: () => isAsync,
134
+ isDirty: () => isDirty,
135
+ isValid: () => isValid,
136
+ late: () => late,
137
+ lazy: () => lazyType,
138
+ literal: () => literalType,
139
+ makeIssue: () => makeIssue,
140
+ map: () => mapType,
141
+ nan: () => nanType,
142
+ nativeEnum: () => nativeEnumType,
143
+ never: () => neverType,
144
+ null: () => nullType,
145
+ nullable: () => nullableType,
146
+ number: () => numberType,
147
+ object: () => objectType,
148
+ objectUtil: () => objectUtil,
149
+ oboolean: () => oboolean,
150
+ onumber: () => onumber,
151
+ optional: () => optionalType,
152
+ ostring: () => ostring,
153
+ pipeline: () => pipelineType,
154
+ preprocess: () => preprocessType,
155
+ promise: () => promiseType,
156
+ quotelessJson: () => quotelessJson,
157
+ record: () => recordType,
158
+ set: () => setType,
159
+ setErrorMap: () => setErrorMap,
160
+ strictObject: () => strictObjectType,
161
+ string: () => stringType,
162
+ symbol: () => symbolType,
163
+ transformer: () => effectsType,
164
+ tuple: () => tupleType,
165
+ undefined: () => undefinedType,
166
+ union: () => unionType,
167
+ unknown: () => unknownType,
168
+ util: () => util,
169
+ void: () => voidType
170
+ });
171
+
172
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/helpers/util.js
61
173
  var util;
62
174
  (function(util2) {
63
- util2.assertEqual = (val) => val;
175
+ util2.assertEqual = (_) => {
176
+ };
64
177
  function assertIs(_arg) {
65
178
  }
66
179
  util2.assertIs = assertIs;
@@ -104,7 +217,7 @@ var util;
104
217
  }
105
218
  return void 0;
106
219
  };
107
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
220
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
108
221
  function joinValues(array, separator = " | ") {
109
222
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
110
223
  }
@@ -156,7 +269,7 @@ var getParsedType = (data) => {
156
269
  case "string":
157
270
  return ZodParsedType.string;
158
271
  case "number":
159
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
272
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
160
273
  case "boolean":
161
274
  return ZodParsedType.boolean;
162
275
  case "function":
@@ -189,6 +302,8 @@ var getParsedType = (data) => {
189
302
  return ZodParsedType.unknown;
190
303
  }
191
304
  };
305
+
306
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/ZodError.js
192
307
  var ZodIssueCode = util.arrayToEnum([
193
308
  "invalid_type",
194
309
  "invalid_literal",
@@ -212,6 +327,9 @@ var quotelessJson = (obj) => {
212
327
  return json.replace(/"([^"]+)":/g, "$1:");
213
328
  };
214
329
  var ZodError = class _ZodError extends Error {
330
+ get errors() {
331
+ return this.issues;
332
+ }
215
333
  constructor(issues) {
216
334
  super();
217
335
  this.issues = [];
@@ -230,9 +348,6 @@ var ZodError = class _ZodError extends Error {
230
348
  this.name = "ZodError";
231
349
  this.issues = issues;
232
350
  }
233
- get errors() {
234
- return this.issues;
235
- }
236
351
  format(_mapper) {
237
352
  const mapper = _mapper || function(issue) {
238
353
  return issue.message;
@@ -304,6 +419,8 @@ ZodError.create = (issues) => {
304
419
  const error = new ZodError(issues);
305
420
  return error;
306
421
  };
422
+
423
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/locales/en.js
307
424
  var errorMap = (issue, _ctx) => {
308
425
  let message;
309
426
  switch (issue.code) {
@@ -402,13 +519,18 @@ var errorMap = (issue, _ctx) => {
402
519
  }
403
520
  return { message };
404
521
  };
405
- var overrideErrorMap = errorMap;
522
+ var en_default = errorMap;
523
+
524
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/errors.js
525
+ var overrideErrorMap = en_default;
406
526
  function setErrorMap(map) {
407
527
  overrideErrorMap = map;
408
528
  }
409
529
  function getErrorMap() {
410
530
  return overrideErrorMap;
411
531
  }
532
+
533
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
412
534
  var makeIssue = (params) => {
413
535
  const { data, path, errorMaps, issueData } = params;
414
536
  const fullPath = [...path, ...issueData.path || []];
@@ -443,9 +565,12 @@ function addIssueToContext(ctx, issueData) {
443
565
  path: ctx.path,
444
566
  errorMaps: [
445
567
  ctx.common.contextualErrorMap,
568
+ // contextual error map is first priority
446
569
  ctx.schemaErrorMap,
570
+ // then schema-bound map if available
447
571
  overrideMap,
448
- overrideMap === errorMap ? void 0 : errorMap
572
+ // then global override map
573
+ overrideMap === en_default ? void 0 : en_default
449
574
  // then global default map
450
575
  ].filter((x) => !!x)
451
576
  });
@@ -514,22 +639,26 @@ var isAborted = (x) => x.status === "aborted";
514
639
  var isDirty = (x) => x.status === "dirty";
515
640
  var isValid = (x) => x.status === "valid";
516
641
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
517
- function __classPrivateFieldGet(receiver, state, kind, f) {
642
+
643
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
644
+ var errorUtil;
645
+ (function(errorUtil2) {
646
+ errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
647
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
648
+ })(errorUtil || (errorUtil = {}));
649
+
650
+ // ../../node_modules/.pnpm/zod@3.25.30/node_modules/zod/dist/esm/v3/types.js
651
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
518
652
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
519
653
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
520
654
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
521
- }
522
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
655
+ };
656
+ var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
523
657
  if (kind === "m") throw new TypeError("Private method is not writable");
524
658
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
525
659
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
526
660
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
527
- }
528
- var errorUtil;
529
- (function(errorUtil2) {
530
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
531
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
532
- })(errorUtil || (errorUtil = {}));
661
+ };
533
662
  var _ZodEnum_cache;
534
663
  var _ZodNativeEnum_cache;
535
664
  var ParseInputLazyPath = class {
@@ -542,7 +671,7 @@ var ParseInputLazyPath = class {
542
671
  }
543
672
  get path() {
544
673
  if (!this._cachedPath.length) {
545
- if (this._key instanceof Array) {
674
+ if (Array.isArray(this._key)) {
546
675
  this._cachedPath.push(...this._path, ...this._key);
547
676
  } else {
548
677
  this._cachedPath.push(...this._path, this._key);
@@ -580,49 +709,20 @@ function processCreateParams(params) {
580
709
  if (errorMap2)
581
710
  return { errorMap: errorMap2, description };
582
711
  const customMap = (iss, ctx) => {
583
- var _a, _b;
584
712
  const { message } = params;
585
713
  if (iss.code === "invalid_enum_value") {
586
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
714
+ return { message: message ?? ctx.defaultError };
587
715
  }
588
716
  if (typeof ctx.data === "undefined") {
589
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
717
+ return { message: message ?? required_error ?? ctx.defaultError };
590
718
  }
591
719
  if (iss.code !== "invalid_type")
592
720
  return { message: ctx.defaultError };
593
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
721
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
594
722
  };
595
723
  return { errorMap: customMap, description };
596
724
  }
597
725
  var ZodType = class {
598
- constructor(def) {
599
- this.spa = this.safeParseAsync;
600
- this._def = def;
601
- this.parse = this.parse.bind(this);
602
- this.safeParse = this.safeParse.bind(this);
603
- this.parseAsync = this.parseAsync.bind(this);
604
- this.safeParseAsync = this.safeParseAsync.bind(this);
605
- this.spa = this.spa.bind(this);
606
- this.refine = this.refine.bind(this);
607
- this.refinement = this.refinement.bind(this);
608
- this.superRefine = this.superRefine.bind(this);
609
- this.optional = this.optional.bind(this);
610
- this.nullable = this.nullable.bind(this);
611
- this.nullish = this.nullish.bind(this);
612
- this.array = this.array.bind(this);
613
- this.promise = this.promise.bind(this);
614
- this.or = this.or.bind(this);
615
- this.and = this.and.bind(this);
616
- this.transform = this.transform.bind(this);
617
- this.brand = this.brand.bind(this);
618
- this.default = this.default.bind(this);
619
- this.catch = this.catch.bind(this);
620
- this.describe = this.describe.bind(this);
621
- this.pipe = this.pipe.bind(this);
622
- this.readonly = this.readonly.bind(this);
623
- this.isNullable = this.isNullable.bind(this);
624
- this.isOptional = this.isOptional.bind(this);
625
- }
626
726
  get description() {
627
727
  return this._def.description;
628
728
  }
@@ -670,14 +770,13 @@ var ZodType = class {
670
770
  throw result.error;
671
771
  }
672
772
  safeParse(data, params) {
673
- var _a;
674
773
  const ctx = {
675
774
  common: {
676
775
  issues: [],
677
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
678
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
776
+ async: params?.async ?? false,
777
+ contextualErrorMap: params?.errorMap
679
778
  },
680
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
779
+ path: params?.path || [],
681
780
  schemaErrorMap: this._def.errorMap,
682
781
  parent: null,
683
782
  data,
@@ -686,6 +785,42 @@ var ZodType = class {
686
785
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
687
786
  return handleResult(ctx, result);
688
787
  }
788
+ "~validate"(data) {
789
+ const ctx = {
790
+ common: {
791
+ issues: [],
792
+ async: !!this["~standard"].async
793
+ },
794
+ path: [],
795
+ schemaErrorMap: this._def.errorMap,
796
+ parent: null,
797
+ data,
798
+ parsedType: getParsedType(data)
799
+ };
800
+ if (!this["~standard"].async) {
801
+ try {
802
+ const result = this._parseSync({ data, path: [], parent: ctx });
803
+ return isValid(result) ? {
804
+ value: result.value
805
+ } : {
806
+ issues: ctx.common.issues
807
+ };
808
+ } catch (err) {
809
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
810
+ this["~standard"].async = true;
811
+ }
812
+ ctx.common = {
813
+ issues: [],
814
+ async: true
815
+ };
816
+ }
817
+ }
818
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
819
+ value: result.value
820
+ } : {
821
+ issues: ctx.common.issues
822
+ });
823
+ }
689
824
  async parseAsync(data, params) {
690
825
  const result = await this.safeParseAsync(data, params);
691
826
  if (result.success)
@@ -696,10 +831,10 @@ var ZodType = class {
696
831
  const ctx = {
697
832
  common: {
698
833
  issues: [],
699
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
834
+ contextualErrorMap: params?.errorMap,
700
835
  async: true
701
836
  },
702
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
837
+ path: params?.path || [],
703
838
  schemaErrorMap: this._def.errorMap,
704
839
  parent: null,
705
840
  data,
@@ -763,6 +898,39 @@ var ZodType = class {
763
898
  superRefine(refinement) {
764
899
  return this._refinement(refinement);
765
900
  }
901
+ constructor(def) {
902
+ this.spa = this.safeParseAsync;
903
+ this._def = def;
904
+ this.parse = this.parse.bind(this);
905
+ this.safeParse = this.safeParse.bind(this);
906
+ this.parseAsync = this.parseAsync.bind(this);
907
+ this.safeParseAsync = this.safeParseAsync.bind(this);
908
+ this.spa = this.spa.bind(this);
909
+ this.refine = this.refine.bind(this);
910
+ this.refinement = this.refinement.bind(this);
911
+ this.superRefine = this.superRefine.bind(this);
912
+ this.optional = this.optional.bind(this);
913
+ this.nullable = this.nullable.bind(this);
914
+ this.nullish = this.nullish.bind(this);
915
+ this.array = this.array.bind(this);
916
+ this.promise = this.promise.bind(this);
917
+ this.or = this.or.bind(this);
918
+ this.and = this.and.bind(this);
919
+ this.transform = this.transform.bind(this);
920
+ this.brand = this.brand.bind(this);
921
+ this.default = this.default.bind(this);
922
+ this.catch = this.catch.bind(this);
923
+ this.describe = this.describe.bind(this);
924
+ this.pipe = this.pipe.bind(this);
925
+ this.readonly = this.readonly.bind(this);
926
+ this.isNullable = this.isNullable.bind(this);
927
+ this.isOptional = this.isOptional.bind(this);
928
+ this["~standard"] = {
929
+ version: 1,
930
+ vendor: "zod",
931
+ validate: (data) => this["~validate"](data)
932
+ };
933
+ }
766
934
  optional() {
767
935
  return ZodOptional.create(this, this._def);
768
936
  }
@@ -773,7 +941,7 @@ var ZodType = class {
773
941
  return this.nullable().optional();
774
942
  }
775
943
  array() {
776
- return ZodArray.create(this, this._def);
944
+ return ZodArray.create(this);
777
945
  }
778
946
  promise() {
779
947
  return ZodPromise.create(this, this._def);
@@ -839,26 +1007,31 @@ var ZodType = class {
839
1007
  };
840
1008
  var cuidRegex = /^c[^\s-]{8,}$/i;
841
1009
  var cuid2Regex = /^[0-9a-z]+$/;
842
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
1010
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
843
1011
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
844
1012
  var nanoidRegex = /^[a-z0-9_-]{21}$/i;
1013
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
845
1014
  var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
846
1015
  var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
847
1016
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
848
1017
  var emojiRegex;
849
1018
  var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
850
- 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})))$/;
1019
+ var ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
1020
+ var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
1021
+ var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
851
1022
  var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
1023
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
852
1024
  var dateRegexSource = `((\\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])))`;
853
1025
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
854
1026
  function timeRegexSource(args) {
855
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
1027
+ let secondsRegexSource = `[0-5]\\d`;
856
1028
  if (args.precision) {
857
- regex = `${regex}\\.\\d{${args.precision}}`;
1029
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
858
1030
  } else if (args.precision == null) {
859
- regex = `${regex}(\\.\\d+)?`;
1031
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
860
1032
  }
861
- return regex;
1033
+ const secondsQuantifier = args.precision ? "+" : "?";
1034
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
862
1035
  }
863
1036
  function timeRegex(args) {
864
1037
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -881,6 +1054,35 @@ function isValidIP(ip, version) {
881
1054
  }
882
1055
  return false;
883
1056
  }
1057
+ function isValidJWT(jwt, alg) {
1058
+ if (!jwtRegex.test(jwt))
1059
+ return false;
1060
+ try {
1061
+ const [header] = jwt.split(".");
1062
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
1063
+ const decoded = JSON.parse(atob(base64));
1064
+ if (typeof decoded !== "object" || decoded === null)
1065
+ return false;
1066
+ if ("typ" in decoded && decoded?.typ !== "JWT")
1067
+ return false;
1068
+ if (!decoded.alg)
1069
+ return false;
1070
+ if (alg && decoded.alg !== alg)
1071
+ return false;
1072
+ return true;
1073
+ } catch {
1074
+ return false;
1075
+ }
1076
+ }
1077
+ function isValidCidr(ip, version) {
1078
+ if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
1079
+ return true;
1080
+ }
1081
+ if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
1082
+ return true;
1083
+ }
1084
+ return false;
1085
+ }
884
1086
  var ZodString = class _ZodString extends ZodType {
885
1087
  _parse(input) {
886
1088
  if (this._def.coerce) {
@@ -1027,7 +1229,7 @@ var ZodString = class _ZodString extends ZodType {
1027
1229
  } else if (check.kind === "url") {
1028
1230
  try {
1029
1231
  new URL(input.data);
1030
- } catch (_a) {
1232
+ } catch {
1031
1233
  ctx = this._getOrReturnCtx(input, ctx);
1032
1234
  addIssueToContext(ctx, {
1033
1235
  validation: "url",
@@ -1137,6 +1339,26 @@ var ZodString = class _ZodString extends ZodType {
1137
1339
  });
1138
1340
  status.dirty();
1139
1341
  }
1342
+ } else if (check.kind === "jwt") {
1343
+ if (!isValidJWT(input.data, check.alg)) {
1344
+ ctx = this._getOrReturnCtx(input, ctx);
1345
+ addIssueToContext(ctx, {
1346
+ validation: "jwt",
1347
+ code: ZodIssueCode.invalid_string,
1348
+ message: check.message
1349
+ });
1350
+ status.dirty();
1351
+ }
1352
+ } else if (check.kind === "cidr") {
1353
+ if (!isValidCidr(input.data, check.version)) {
1354
+ ctx = this._getOrReturnCtx(input, ctx);
1355
+ addIssueToContext(ctx, {
1356
+ validation: "cidr",
1357
+ code: ZodIssueCode.invalid_string,
1358
+ message: check.message
1359
+ });
1360
+ status.dirty();
1361
+ }
1140
1362
  } else if (check.kind === "base64") {
1141
1363
  if (!base64Regex.test(input.data)) {
1142
1364
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1147,6 +1369,16 @@ var ZodString = class _ZodString extends ZodType {
1147
1369
  });
1148
1370
  status.dirty();
1149
1371
  }
1372
+ } else if (check.kind === "base64url") {
1373
+ if (!base64urlRegex.test(input.data)) {
1374
+ ctx = this._getOrReturnCtx(input, ctx);
1375
+ addIssueToContext(ctx, {
1376
+ validation: "base64url",
1377
+ code: ZodIssueCode.invalid_string,
1378
+ message: check.message
1379
+ });
1380
+ status.dirty();
1381
+ }
1150
1382
  } else {
1151
1383
  util.assertNever(check);
1152
1384
  }
@@ -1193,11 +1425,22 @@ var ZodString = class _ZodString extends ZodType {
1193
1425
  base64(message) {
1194
1426
  return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
1195
1427
  }
1428
+ base64url(message) {
1429
+ return this._addCheck({
1430
+ kind: "base64url",
1431
+ ...errorUtil.errToObj(message)
1432
+ });
1433
+ }
1434
+ jwt(options) {
1435
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
1436
+ }
1196
1437
  ip(options) {
1197
1438
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1198
1439
  }
1440
+ cidr(options) {
1441
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
1442
+ }
1199
1443
  datetime(options) {
1200
- var _a, _b;
1201
1444
  if (typeof options === "string") {
1202
1445
  return this._addCheck({
1203
1446
  kind: "datetime",
@@ -1209,10 +1452,10 @@ var ZodString = class _ZodString extends ZodType {
1209
1452
  }
1210
1453
  return this._addCheck({
1211
1454
  kind: "datetime",
1212
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1213
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1214
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
1215
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1455
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1456
+ offset: options?.offset ?? false,
1457
+ local: options?.local ?? false,
1458
+ ...errorUtil.errToObj(options?.message)
1216
1459
  });
1217
1460
  }
1218
1461
  date(message) {
@@ -1228,8 +1471,8 @@ var ZodString = class _ZodString extends ZodType {
1228
1471
  }
1229
1472
  return this._addCheck({
1230
1473
  kind: "time",
1231
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1232
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1474
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
1475
+ ...errorUtil.errToObj(options?.message)
1233
1476
  });
1234
1477
  }
1235
1478
  duration(message) {
@@ -1246,8 +1489,8 @@ var ZodString = class _ZodString extends ZodType {
1246
1489
  return this._addCheck({
1247
1490
  kind: "includes",
1248
1491
  value,
1249
- position: options === null || options === void 0 ? void 0 : options.position,
1250
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1492
+ position: options?.position,
1493
+ ...errorUtil.errToObj(options?.message)
1251
1494
  });
1252
1495
  }
1253
1496
  startsWith(value, message) {
@@ -1286,8 +1529,7 @@ var ZodString = class _ZodString extends ZodType {
1286
1529
  });
1287
1530
  }
1288
1531
  /**
1289
- * @deprecated Use z.string().min(1) instead.
1290
- * @see {@link ZodString.min}
1532
+ * Equivalent to `.min(1)`
1291
1533
  */
1292
1534
  nonempty(message) {
1293
1535
  return this.min(1, errorUtil.errToObj(message));
@@ -1349,9 +1591,15 @@ var ZodString = class _ZodString extends ZodType {
1349
1591
  get isIP() {
1350
1592
  return !!this._def.checks.find((ch) => ch.kind === "ip");
1351
1593
  }
1594
+ get isCIDR() {
1595
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
1596
+ }
1352
1597
  get isBase64() {
1353
1598
  return !!this._def.checks.find((ch) => ch.kind === "base64");
1354
1599
  }
1600
+ get isBase64url() {
1601
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
1602
+ }
1355
1603
  get minLength() {
1356
1604
  let min = null;
1357
1605
  for (const ch of this._def.checks) {
@@ -1374,11 +1622,10 @@ var ZodString = class _ZodString extends ZodType {
1374
1622
  }
1375
1623
  };
1376
1624
  ZodString.create = (params) => {
1377
- var _a;
1378
1625
  return new ZodString({
1379
1626
  checks: [],
1380
1627
  typeName: ZodFirstPartyTypeKind.ZodString,
1381
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1628
+ coerce: params?.coerce ?? false,
1382
1629
  ...processCreateParams(params)
1383
1630
  });
1384
1631
  };
@@ -1386,9 +1633,9 @@ function floatSafeRemainder(val, step) {
1386
1633
  const valDecCount = (val.toString().split(".")[1] || "").length;
1387
1634
  const stepDecCount = (step.toString().split(".")[1] || "").length;
1388
1635
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1389
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
1390
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
1391
- return valInt % stepInt / Math.pow(10, decCount);
1636
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1637
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1638
+ return valInt % stepInt / 10 ** decCount;
1392
1639
  }
1393
1640
  var ZodNumber = class _ZodNumber extends ZodType {
1394
1641
  constructor() {
@@ -1598,7 +1845,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
1598
1845
  return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1599
1846
  }
1600
1847
  get isFinite() {
1601
- let max = null, min = null;
1848
+ let max = null;
1849
+ let min = null;
1602
1850
  for (const ch of this._def.checks) {
1603
1851
  if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1604
1852
  return true;
@@ -1617,7 +1865,7 @@ ZodNumber.create = (params) => {
1617
1865
  return new ZodNumber({
1618
1866
  checks: [],
1619
1867
  typeName: ZodFirstPartyTypeKind.ZodNumber,
1620
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1868
+ coerce: params?.coerce || false,
1621
1869
  ...processCreateParams(params)
1622
1870
  });
1623
1871
  };
@@ -1629,17 +1877,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
1629
1877
  }
1630
1878
  _parse(input) {
1631
1879
  if (this._def.coerce) {
1632
- input.data = BigInt(input.data);
1880
+ try {
1881
+ input.data = BigInt(input.data);
1882
+ } catch {
1883
+ return this._getInvalidInput(input);
1884
+ }
1633
1885
  }
1634
1886
  const parsedType = this._getType(input);
1635
1887
  if (parsedType !== ZodParsedType.bigint) {
1636
- const ctx2 = this._getOrReturnCtx(input);
1637
- addIssueToContext(ctx2, {
1638
- code: ZodIssueCode.invalid_type,
1639
- expected: ZodParsedType.bigint,
1640
- received: ctx2.parsedType
1641
- });
1642
- return INVALID;
1888
+ return this._getInvalidInput(input);
1643
1889
  }
1644
1890
  let ctx = void 0;
1645
1891
  const status = new ParseStatus();
@@ -1686,6 +1932,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
1686
1932
  }
1687
1933
  return { status: status.value, value: input.data };
1688
1934
  }
1935
+ _getInvalidInput(input) {
1936
+ const ctx = this._getOrReturnCtx(input);
1937
+ addIssueToContext(ctx, {
1938
+ code: ZodIssueCode.invalid_type,
1939
+ expected: ZodParsedType.bigint,
1940
+ received: ctx.parsedType
1941
+ });
1942
+ return INVALID;
1943
+ }
1689
1944
  gte(value, message) {
1690
1945
  return this.setLimit("min", value, true, errorUtil.toString(message));
1691
1946
  }
@@ -1779,11 +2034,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
1779
2034
  }
1780
2035
  };
1781
2036
  ZodBigInt.create = (params) => {
1782
- var _a;
1783
2037
  return new ZodBigInt({
1784
2038
  checks: [],
1785
2039
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
1786
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
2040
+ coerce: params?.coerce ?? false,
1787
2041
  ...processCreateParams(params)
1788
2042
  });
1789
2043
  };
@@ -1808,7 +2062,7 @@ var ZodBoolean = class extends ZodType {
1808
2062
  ZodBoolean.create = (params) => {
1809
2063
  return new ZodBoolean({
1810
2064
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
1811
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2065
+ coerce: params?.coerce || false,
1812
2066
  ...processCreateParams(params)
1813
2067
  });
1814
2068
  };
@@ -1827,7 +2081,7 @@ var ZodDate = class _ZodDate extends ZodType {
1827
2081
  });
1828
2082
  return INVALID;
1829
2083
  }
1830
- if (isNaN(input.data.getTime())) {
2084
+ if (Number.isNaN(input.data.getTime())) {
1831
2085
  const ctx2 = this._getOrReturnCtx(input);
1832
2086
  addIssueToContext(ctx2, {
1833
2087
  code: ZodIssueCode.invalid_date
@@ -1916,7 +2170,7 @@ var ZodDate = class _ZodDate extends ZodType {
1916
2170
  ZodDate.create = (params) => {
1917
2171
  return new ZodDate({
1918
2172
  checks: [],
1919
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2173
+ coerce: params?.coerce || false,
1920
2174
  typeName: ZodFirstPartyTypeKind.ZodDate,
1921
2175
  ...processCreateParams(params)
1922
2176
  });
@@ -2191,7 +2445,8 @@ var ZodObject = class _ZodObject extends ZodType {
2191
2445
  return this._cached;
2192
2446
  const shape = this._def.shape();
2193
2447
  const keys = util.objectKeys(shape);
2194
- return this._cached = { shape, keys };
2448
+ this._cached = { shape, keys };
2449
+ return this._cached;
2195
2450
  }
2196
2451
  _parse(input) {
2197
2452
  const parsedType = this._getType(input);
@@ -2241,8 +2496,8 @@ var ZodObject = class _ZodObject extends ZodType {
2241
2496
  });
2242
2497
  status.dirty();
2243
2498
  }
2244
- } else if (unknownKeys === "strip") ;
2245
- else {
2499
+ } else if (unknownKeys === "strip") {
2500
+ } else {
2246
2501
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2247
2502
  }
2248
2503
  } else {
@@ -2289,11 +2544,10 @@ var ZodObject = class _ZodObject extends ZodType {
2289
2544
  unknownKeys: "strict",
2290
2545
  ...message !== void 0 ? {
2291
2546
  errorMap: (issue, ctx) => {
2292
- var _a, _b, _c, _d;
2293
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
2547
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2294
2548
  if (issue.code === "unrecognized_keys")
2295
2549
  return {
2296
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
2550
+ message: errorUtil.errToObj(message).message ?? defaultError
2297
2551
  };
2298
2552
  return {
2299
2553
  message: defaultError
@@ -2424,11 +2678,11 @@ var ZodObject = class _ZodObject extends ZodType {
2424
2678
  }
2425
2679
  pick(mask) {
2426
2680
  const shape = {};
2427
- util.objectKeys(mask).forEach((key) => {
2681
+ for (const key of util.objectKeys(mask)) {
2428
2682
  if (mask[key] && this.shape[key]) {
2429
2683
  shape[key] = this.shape[key];
2430
2684
  }
2431
- });
2685
+ }
2432
2686
  return new _ZodObject({
2433
2687
  ...this._def,
2434
2688
  shape: () => shape
@@ -2436,11 +2690,11 @@ var ZodObject = class _ZodObject extends ZodType {
2436
2690
  }
2437
2691
  omit(mask) {
2438
2692
  const shape = {};
2439
- util.objectKeys(this.shape).forEach((key) => {
2693
+ for (const key of util.objectKeys(this.shape)) {
2440
2694
  if (!mask[key]) {
2441
2695
  shape[key] = this.shape[key];
2442
2696
  }
2443
- });
2697
+ }
2444
2698
  return new _ZodObject({
2445
2699
  ...this._def,
2446
2700
  shape: () => shape
@@ -2454,14 +2708,14 @@ var ZodObject = class _ZodObject extends ZodType {
2454
2708
  }
2455
2709
  partial(mask) {
2456
2710
  const newShape = {};
2457
- util.objectKeys(this.shape).forEach((key) => {
2711
+ for (const key of util.objectKeys(this.shape)) {
2458
2712
  const fieldSchema = this.shape[key];
2459
2713
  if (mask && !mask[key]) {
2460
2714
  newShape[key] = fieldSchema;
2461
2715
  } else {
2462
2716
  newShape[key] = fieldSchema.optional();
2463
2717
  }
2464
- });
2718
+ }
2465
2719
  return new _ZodObject({
2466
2720
  ...this._def,
2467
2721
  shape: () => newShape
@@ -2469,7 +2723,7 @@ var ZodObject = class _ZodObject extends ZodType {
2469
2723
  }
2470
2724
  required(mask) {
2471
2725
  const newShape = {};
2472
- util.objectKeys(this.shape).forEach((key) => {
2726
+ for (const key of util.objectKeys(this.shape)) {
2473
2727
  if (mask && !mask[key]) {
2474
2728
  newShape[key] = this.shape[key];
2475
2729
  } else {
@@ -2480,7 +2734,7 @@ var ZodObject = class _ZodObject extends ZodType {
2480
2734
  }
2481
2735
  newShape[key] = newField;
2482
2736
  }
2483
- });
2737
+ }
2484
2738
  return new _ZodObject({
2485
2739
  ...this._def,
2486
2740
  shape: () => newShape
@@ -3096,12 +3350,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
3096
3350
  return makeIssue({
3097
3351
  data: args,
3098
3352
  path: ctx.path,
3099
- errorMaps: [
3100
- ctx.common.contextualErrorMap,
3101
- ctx.schemaErrorMap,
3102
- getErrorMap(),
3103
- errorMap
3104
- ].filter((x) => !!x),
3353
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
3105
3354
  issueData: {
3106
3355
  code: ZodIssueCode.invalid_arguments,
3107
3356
  argumentsError: error
@@ -3112,12 +3361,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
3112
3361
  return makeIssue({
3113
3362
  data: returns,
3114
3363
  path: ctx.path,
3115
- errorMaps: [
3116
- ctx.common.contextualErrorMap,
3117
- ctx.schemaErrorMap,
3118
- getErrorMap(),
3119
- errorMap
3120
- ].filter((x) => !!x),
3364
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
3121
3365
  issueData: {
3122
3366
  code: ZodIssueCode.invalid_return_type,
3123
3367
  returnTypeError: error
@@ -3496,7 +3740,10 @@ var ZodEffects = class extends ZodType {
3496
3740
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3497
3741
  if (!isValid(base))
3498
3742
  return base;
3499
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3743
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3744
+ status: status.value,
3745
+ value: result
3746
+ }));
3500
3747
  });
3501
3748
  }
3502
3749
  }
@@ -3748,16 +3995,30 @@ ZodReadonly.create = (type, params) => {
3748
3995
  ...processCreateParams(params)
3749
3996
  });
3750
3997
  };
3751
- function custom(check, params = {}, fatal) {
3998
+ function cleanParams(params, data) {
3999
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4000
+ const p2 = typeof p === "string" ? { message: p } : p;
4001
+ return p2;
4002
+ }
4003
+ function custom(check, _params = {}, fatal) {
3752
4004
  if (check)
3753
4005
  return ZodAny.create().superRefine((data, ctx) => {
3754
- var _a, _b;
3755
- if (!check(data)) {
3756
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3757
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3758
- const p2 = typeof p === "string" ? { message: p } : p;
3759
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4006
+ const r = check(data);
4007
+ if (r instanceof Promise) {
4008
+ return r.then((r2) => {
4009
+ if (!r2) {
4010
+ const params = cleanParams(_params, data);
4011
+ const _fatal = params.fatal ?? fatal ?? true;
4012
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
4013
+ }
4014
+ });
4015
+ }
4016
+ if (!r) {
4017
+ const params = cleanParams(_params, data);
4018
+ const _fatal = params.fatal ?? fatal ?? true;
4019
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3760
4020
  }
4021
+ return;
3761
4022
  });
3762
4023
  return ZodAny.create();
3763
4024
  }
@@ -3854,130 +4115,14 @@ var coerce = {
3854
4115
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3855
4116
  };
3856
4117
  var NEVER = INVALID;
3857
- var z = /* @__PURE__ */ Object.freeze({
3858
- __proto__: null,
3859
- defaultErrorMap: errorMap,
3860
- setErrorMap,
3861
- getErrorMap,
3862
- makeIssue,
3863
- EMPTY_PATH,
3864
- addIssueToContext,
3865
- ParseStatus,
3866
- INVALID,
3867
- DIRTY,
3868
- OK,
3869
- isAborted,
3870
- isDirty,
3871
- isValid,
3872
- isAsync,
3873
- get util() {
3874
- return util;
3875
- },
3876
- get objectUtil() {
3877
- return objectUtil;
3878
- },
3879
- ZodParsedType,
3880
- getParsedType,
3881
- ZodType,
3882
- datetimeRegex,
3883
- ZodString,
3884
- ZodNumber,
3885
- ZodBigInt,
3886
- ZodBoolean,
3887
- ZodDate,
3888
- ZodSymbol,
3889
- ZodUndefined,
3890
- ZodNull,
3891
- ZodAny,
3892
- ZodUnknown,
3893
- ZodNever,
3894
- ZodVoid,
3895
- ZodArray,
3896
- ZodObject,
3897
- ZodUnion,
3898
- ZodDiscriminatedUnion,
3899
- ZodIntersection,
3900
- ZodTuple,
3901
- ZodRecord,
3902
- ZodMap,
3903
- ZodSet,
3904
- ZodFunction,
3905
- ZodLazy,
3906
- ZodLiteral,
3907
- ZodEnum,
3908
- ZodNativeEnum,
3909
- ZodPromise,
3910
- ZodEffects,
3911
- ZodTransformer: ZodEffects,
3912
- ZodOptional,
3913
- ZodNullable,
3914
- ZodDefault,
3915
- ZodCatch,
3916
- ZodNaN,
3917
- BRAND,
3918
- ZodBranded,
3919
- ZodPipeline,
3920
- ZodReadonly,
3921
- custom,
3922
- Schema: ZodType,
3923
- ZodSchema: ZodType,
3924
- late,
3925
- get ZodFirstPartyTypeKind() {
3926
- return ZodFirstPartyTypeKind;
3927
- },
3928
- coerce,
3929
- any: anyType,
3930
- array: arrayType,
3931
- bigint: bigIntType,
3932
- boolean: booleanType,
3933
- date: dateType,
3934
- discriminatedUnion: discriminatedUnionType,
3935
- effect: effectsType,
3936
- "enum": enumType,
3937
- "function": functionType,
3938
- "instanceof": instanceOfType,
3939
- intersection: intersectionType,
3940
- lazy: lazyType,
3941
- literal: literalType,
3942
- map: mapType,
3943
- nan: nanType,
3944
- nativeEnum: nativeEnumType,
3945
- never: neverType,
3946
- "null": nullType,
3947
- nullable: nullableType,
3948
- number: numberType,
3949
- object: objectType,
3950
- oboolean,
3951
- onumber,
3952
- optional: optionalType,
3953
- ostring,
3954
- pipeline: pipelineType,
3955
- preprocess: preprocessType,
3956
- promise: promiseType,
3957
- record: recordType,
3958
- set: setType,
3959
- strictObject: strictObjectType,
3960
- string: stringType,
3961
- symbol: symbolType,
3962
- transformer: effectsType,
3963
- tuple: tupleType,
3964
- "undefined": undefinedType,
3965
- union: unionType,
3966
- unknown: unknownType,
3967
- "void": voidType,
3968
- NEVER,
3969
- ZodIssueCode,
3970
- quotelessJson,
3971
- ZodError
3972
- });
3973
4118
 
3974
4119
  // lib/asstClient.ts
3975
- var baseUrlsSchema = z.object({
3976
- local: z.literal("https://localhost:8443/"),
3977
- test: z.literal(
4120
+ var baseUrlsSchema = external_exports.object({
4121
+ local: external_exports.literal("https://localhost:8443/"),
4122
+ test: external_exports.literal(
3978
4123
  "https://integration.api.spscommerce.com/assortment/gateway/"
3979
4124
  ),
3980
- prod: z.literal("https://api.spscommerce.com/assortment/gateway/")
4125
+ prod: external_exports.literal("https://api.spscommerce.com/assortment/gateway/")
3981
4126
  });
3982
4127
  var BASE_URLS = {
3983
4128
  local: "https://localhost:8443/",
@@ -4041,41 +4186,41 @@ var AsstClient = class {
4041
4186
  };
4042
4187
 
4043
4188
  // lib/imports/models/ImportDetail.ts
4044
- var importDetailSchema = z.object({
4045
- completedAt: z.number().nullish(),
4046
- errorCount: z.number(),
4047
- importId: z.number(),
4048
- name: z.string(),
4049
- startedAt: z.string().nullish(),
4050
- status: z.string(),
4051
- uploadedAt: z.string()
4189
+ var importDetailSchema = external_exports.object({
4190
+ completedAt: external_exports.number().nullish(),
4191
+ errorCount: external_exports.number(),
4192
+ importId: external_exports.number(),
4193
+ name: external_exports.string(),
4194
+ startedAt: external_exports.string().nullish(),
4195
+ status: external_exports.string(),
4196
+ uploadedAt: external_exports.string()
4052
4197
  });
4053
4198
 
4054
4199
  // lib/imports/models/Import.ts
4055
- var importSchema = z.object({
4056
- count: z.number(),
4057
- imports: z.array(importDetailSchema)
4200
+ var importSchema = external_exports.object({
4201
+ count: external_exports.number(),
4202
+ imports: external_exports.array(importDetailSchema)
4058
4203
  });
4059
4204
 
4060
4205
  // lib/imports/models/ImportError.ts
4061
- var importErrorSchema = z.object({
4062
- attribute: z.string().nullish(),
4063
- description: z.string(),
4064
- importErrorId: z.number(),
4065
- row: z.number()
4206
+ var importErrorSchema = external_exports.object({
4207
+ attribute: external_exports.string().nullish(),
4208
+ description: external_exports.string(),
4209
+ importErrorId: external_exports.number(),
4210
+ row: external_exports.number()
4066
4211
  });
4067
4212
 
4068
4213
  // lib/imports/models/ImportErrors.ts
4069
- var importErrorsSchema = z.object({
4070
- count: z.number(),
4071
- errors: z.array(importErrorSchema),
4072
- hasNext: z.boolean(),
4073
- importId: z.number(),
4074
- totalCount: z.number()
4214
+ var importErrorsSchema = external_exports.object({
4215
+ count: external_exports.number(),
4216
+ errors: external_exports.array(importErrorSchema),
4217
+ hasNext: external_exports.boolean(),
4218
+ importId: external_exports.number(),
4219
+ totalCount: external_exports.number()
4075
4220
  });
4076
4221
 
4077
4222
  // lib/imports/models/ImportsStatusEnum.ts
4078
- var importStatusEnumSchema = z.enum([
4223
+ var importStatusEnumSchema = external_exports.enum([
4079
4224
  "QUEUED_FOR_IMPORT",
4080
4225
  "IN_PROGRESS",
4081
4226
  "DOC_FAILED",
@@ -4084,32 +4229,32 @@ var importStatusEnumSchema = z.enum([
4084
4229
  ]);
4085
4230
 
4086
4231
  // lib/imports/models/ImportsStatus.ts
4087
- var importsStatusSchema = z.object({
4088
- completedAt: z.string().nullish(),
4089
- docInEventId: z.string().nullish(),
4090
- errorCount: z.number().nullish(),
4091
- importId: z.number(),
4092
- invalidItemCount: z.number().nullish(),
4093
- name: z.string().nullish(),
4232
+ var importsStatusSchema = external_exports.object({
4233
+ completedAt: external_exports.string().nullish(),
4234
+ docInEventId: external_exports.string().nullish(),
4235
+ errorCount: external_exports.number().nullish(),
4236
+ importId: external_exports.number(),
4237
+ invalidItemCount: external_exports.number().nullish(),
4238
+ name: external_exports.string().nullish(),
4094
4239
  status: importStatusEnumSchema,
4095
- totalItemCount: z.number().nullish(),
4096
- validItemCount: z.number().nullish()
4240
+ totalItemCount: external_exports.number().nullish(),
4241
+ validItemCount: external_exports.number().nullish()
4097
4242
  });
4098
4243
 
4099
4244
  // lib/imports/models/VendorPartnerAttGroups.ts
4100
- var vendorPartnerAttGroupsSchema = z.object({
4101
- partnerCompanyId: z.number(),
4102
- partnerCompanyName: z.string(),
4103
- partnerAttributeGroups: z.array(z.number())
4245
+ var vendorPartnerAttGroupsSchema = external_exports.object({
4246
+ partnerCompanyId: external_exports.number(),
4247
+ partnerCompanyName: external_exports.string(),
4248
+ partnerAttributeGroups: external_exports.array(external_exports.number())
4104
4249
  });
4105
4250
 
4106
4251
  // lib/imports/models/GenerateImportTemplateParams.ts
4107
- var generateImportTemplateParamsSchema = z.object({
4108
- "multi-sheet": z.boolean(),
4109
- gids: z.string().optional(),
4110
- productTypeIds: z.string().optional(),
4111
- groupTypeId: z.number().optional(),
4112
- includeGuides: z.boolean().optional()
4252
+ var generateImportTemplateParamsSchema = external_exports.object({
4253
+ "multi-sheet": external_exports.boolean(),
4254
+ gids: external_exports.string().optional(),
4255
+ productTypeIds: external_exports.string().optional(),
4256
+ groupTypeId: external_exports.number().optional(),
4257
+ includeGuides: external_exports.boolean().optional()
4113
4258
  });
4114
4259
 
4115
4260
  // lib/imports/index.ts
@@ -4128,14 +4273,14 @@ function createImportsApi(client) {
4128
4273
  }
4129
4274
  async function getImportsStatus(signal) {
4130
4275
  const data = await client.get(`${BASE_URL}/status`, { signal }).json();
4131
- return z.array(importsStatusSchema).parse(data);
4276
+ return external_exports.array(importsStatusSchema).parse(data);
4132
4277
  }
4133
4278
  async function uploadImport(file) {
4134
4279
  await client.post(`${BASE_URL}`, { body: file });
4135
4280
  }
4136
4281
  async function getVendorPartnerGroups(signal) {
4137
4282
  const data = await client.get(`${BASE_URL}/template/vendor-partner-groups`, { signal }).json();
4138
- return z.array(vendorPartnerAttGroupsSchema).parse(data);
4283
+ return external_exports.array(vendorPartnerAttGroupsSchema).parse(data);
4139
4284
  }
4140
4285
  async function generateImportTemplate(params) {
4141
4286
  const response = await client.get(`${BASE_URL}/template/generate`, {
@@ -4209,15 +4354,15 @@ function createExportsApi(client) {
4209
4354
  }
4210
4355
 
4211
4356
  // lib/productTypes/models/AttrProdType.ts
4212
- var attrProdTypeSchema = z.object({
4213
- attrProdTypeId: z.number(),
4214
- productType: z.string(),
4215
- description: z.string(),
4216
- createdDate: z.number(),
4217
- createdBy: z.string(),
4218
- modifiedDate: z.number().optional(),
4219
- modifiedBy: z.string().optional(),
4220
- retailerId: z.number().optional()
4357
+ var attrProdTypeSchema = external_exports.object({
4358
+ attrProdTypeId: external_exports.number(),
4359
+ productType: external_exports.string(),
4360
+ description: external_exports.string(),
4361
+ createdDate: external_exports.number(),
4362
+ createdBy: external_exports.string(),
4363
+ modifiedDate: external_exports.number().optional(),
4364
+ modifiedBy: external_exports.string().optional(),
4365
+ retailerId: external_exports.number().optional()
4221
4366
  });
4222
4367
 
4223
4368
  // lib/productTypes/index.ts
@@ -4229,7 +4374,7 @@ function createProductTypesApi(client) {
4229
4374
  searchParams,
4230
4375
  signal
4231
4376
  }).json();
4232
- return z.array(attrProdTypeSchema).parse(data.results);
4377
+ return external_exports.array(attrProdTypeSchema).parse(data.results);
4233
4378
  }
4234
4379
  return {
4235
4380
  getProductTypes
@@ -4237,43 +4382,43 @@ function createProductTypesApi(client) {
4237
4382
  }
4238
4383
 
4239
4384
  // lib/tradingPartners/models/Connection.ts
4240
- var connectionSchema = z.object({
4241
- catalog_id: z.number(),
4242
- catalog_name: z.string().nullable(),
4243
- partner_company_name: z.string(),
4244
- partner_company_id: z.number(),
4245
- partner_org_id: z.string()
4385
+ var connectionSchema = external_exports.object({
4386
+ catalog_id: external_exports.number(),
4387
+ catalog_name: external_exports.string().nullable(),
4388
+ partner_company_name: external_exports.string(),
4389
+ partner_company_id: external_exports.number(),
4390
+ partner_org_id: external_exports.string()
4246
4391
  });
4247
4392
 
4248
4393
  // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4249
- var companyRelationshipUpsertBodySchema = z.object({
4250
- supplierId: z.number(),
4251
- retailerId: z.number(),
4252
- catalogId: z.number(),
4253
- active: z.boolean(),
4254
- applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4394
+ var companyRelationshipUpsertBodySchema = external_exports.object({
4395
+ supplierId: external_exports.number(),
4396
+ retailerId: external_exports.number(),
4397
+ catalogId: external_exports.number(),
4398
+ active: external_exports.boolean(),
4399
+ applicationType: external_exports.array(external_exports.enum(["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"])).default([])
4255
4400
  });
4256
4401
 
4257
4402
  // lib/tradingPartners/models/ItemPartner.ts
4258
- var itemPartnerSchema = z.object({
4259
- itemPartnerId: z.number(),
4260
- retailerId: z.number(),
4261
- supplierId: z.number(),
4262
- catalogId: z.number(),
4263
- isActive: z.number(),
4264
- createdDate: z.string(),
4265
- modifiedDate: z.string(),
4266
- applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4403
+ var itemPartnerSchema = external_exports.object({
4404
+ itemPartnerId: external_exports.number(),
4405
+ retailerId: external_exports.number(),
4406
+ supplierId: external_exports.number(),
4407
+ catalogId: external_exports.number(),
4408
+ isActive: external_exports.number(),
4409
+ createdDate: external_exports.string(),
4410
+ modifiedDate: external_exports.string(),
4411
+ applications: external_exports.array(external_exports.enum(["ASSORTMENT", "ITEM-XREF"]))
4267
4412
  });
4268
4413
 
4269
4414
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4270
- var tradingPartnerAccessByCompanyIdSchema = z.object({
4271
- companyId: z.number(),
4272
- companyType: z.string(),
4273
- identityOrgId: z.string(),
4274
- companyName: z.string(),
4275
- count: z.number(),
4276
- connections: z.array(connectionSchema)
4415
+ var tradingPartnerAccessByCompanyIdSchema = external_exports.object({
4416
+ companyId: external_exports.number(),
4417
+ companyType: external_exports.string(),
4418
+ identityOrgId: external_exports.string(),
4419
+ companyName: external_exports.string(),
4420
+ count: external_exports.number(),
4421
+ connections: external_exports.array(connectionSchema)
4277
4422
  });
4278
4423
 
4279
4424
  // lib/tradingPartners/index.ts
@@ -4300,8 +4445,8 @@ function createTradingPartnerAccessApi(client) {
4300
4445
  }
4301
4446
 
4302
4447
  // lib/tradingPartnerSettings/models/RetailerTradingPartnerStages.ts
4303
- var retailerTradingPartnerStages = z.array(
4304
- z.enum([
4448
+ var retailerTradingPartnerStages = external_exports.array(
4449
+ external_exports.enum([
4305
4450
  "Core",
4306
4451
  "Core Plus",
4307
4452
  "Core Advanced",
@@ -4325,42 +4470,42 @@ function createTradingPartnerSettingsApi(client) {
4325
4470
  }
4326
4471
 
4327
4472
  // lib/categories/models/ItemCategory.ts
4328
- var itemCategorySchema = z.object({
4329
- categoryid: z.number(),
4330
- encodedCategoryId: z.string(),
4331
- companyId: z.number(),
4332
- name: z.string(),
4333
- isActive: z.number(),
4334
- createdDate: z.number().nullish(),
4335
- categorytimestamp: z.number().nullish(),
4336
- typeId: z.number(),
4337
- type: z.string(),
4338
- categorykey: z.string().nullish(),
4339
- description: z.string().nullish(),
4340
- categoryCatalogName: z.string().nullish()
4473
+ var itemCategorySchema = external_exports.object({
4474
+ categoryid: external_exports.number(),
4475
+ encodedCategoryId: external_exports.string(),
4476
+ companyId: external_exports.number(),
4477
+ name: external_exports.string(),
4478
+ isActive: external_exports.number(),
4479
+ createdDate: external_exports.number().nullish(),
4480
+ categorytimestamp: external_exports.number().nullish(),
4481
+ typeId: external_exports.number(),
4482
+ type: external_exports.string(),
4483
+ categorykey: external_exports.string().nullish(),
4484
+ description: external_exports.string().nullish(),
4485
+ categoryCatalogName: external_exports.string().nullish()
4341
4486
  });
4342
4487
 
4343
4488
  // lib/categories/models/ItemCategoriesSearch.ts
4344
- var itemCategoriesSearchSchema = z.object({
4345
- count: z.number(),
4346
- data: z.array(itemCategorySchema)
4489
+ var itemCategoriesSearchSchema = external_exports.object({
4490
+ count: external_exports.number(),
4491
+ data: external_exports.array(itemCategorySchema)
4347
4492
  });
4348
4493
 
4349
4494
  // lib/categories/models/ItemHierarchyResponse.ts
4350
- var baseHierarchySchema = z.object({
4351
- id: z.string(),
4352
- name: z.string().nullish(),
4353
- description: z.string().nullish(),
4354
- type: z.string().nullish()
4495
+ var baseHierarchySchema = external_exports.object({
4496
+ id: external_exports.string(),
4497
+ name: external_exports.string().nullish(),
4498
+ description: external_exports.string().nullish(),
4499
+ type: external_exports.string().nullish()
4355
4500
  });
4356
4501
  var hierarchySchema = baseHierarchySchema.extend({
4357
- child: z.lazy(() => hierarchySchema).nullable()
4502
+ child: external_exports.lazy(() => hierarchySchema).nullable()
4358
4503
  });
4359
- var itemHierarchyResponseSchema = z.object({
4360
- itemHierarchies: z.array(
4361
- z.object({
4362
- itemId: z.string(),
4363
- hierarchies: z.array(hierarchySchema)
4504
+ var itemHierarchyResponseSchema = external_exports.object({
4505
+ itemHierarchies: external_exports.array(
4506
+ external_exports.object({
4507
+ itemId: external_exports.string(),
4508
+ hierarchies: external_exports.array(hierarchySchema)
4364
4509
  })
4365
4510
  )
4366
4511
  });
@@ -4426,45 +4571,45 @@ function createCategoriesApi(client) {
4426
4571
  }
4427
4572
 
4428
4573
  // lib/attributes/models/AttributeMetaData.ts
4429
- var attributeMetaDataSchema = z.object({
4430
- dbName: z.string(),
4431
- label: z.string(),
4432
- group: z.string(),
4433
- aliases: z.array(z.string()),
4434
- orderBy: z.string().or(z.number()),
4435
- type: z.string(),
4436
- storageType: z.string(),
4437
- rsxPath: z.string(),
4438
- indexed: z.boolean(),
4439
- repeatable: z.boolean(),
4440
- extended: z.boolean(),
4441
- hybrid: z.boolean(),
4442
- userVisible: z.boolean(),
4443
- retailerOwnedId: z.number().nullish()
4574
+ var attributeMetaDataSchema = external_exports.object({
4575
+ dbName: external_exports.string(),
4576
+ label: external_exports.string(),
4577
+ group: external_exports.string(),
4578
+ aliases: external_exports.array(external_exports.string()),
4579
+ orderBy: external_exports.string().or(external_exports.number()),
4580
+ type: external_exports.string(),
4581
+ storageType: external_exports.string(),
4582
+ rsxPath: external_exports.string(),
4583
+ indexed: external_exports.boolean(),
4584
+ repeatable: external_exports.boolean(),
4585
+ extended: external_exports.boolean(),
4586
+ hybrid: external_exports.boolean(),
4587
+ userVisible: external_exports.boolean(),
4588
+ retailerOwnedId: external_exports.number().nullish()
4444
4589
  });
4445
4590
 
4446
4591
  // lib/attributes/models/AttributeSummary.ts
4447
- var attributeSummarySchema = z.object({
4448
- attributeId: z.number(),
4449
- attributeName: z.string(),
4450
- displayName: z.string(),
4451
- modifiedBy: z.string(),
4452
- modifiedDate: z.number(),
4453
- retailerOwnedId: z.number().nullish(),
4454
- clusterAttrGroupId: z.number().nullish(),
4455
- attributeType: z.string()
4592
+ var attributeSummarySchema = external_exports.object({
4593
+ attributeId: external_exports.number(),
4594
+ attributeName: external_exports.string(),
4595
+ displayName: external_exports.string(),
4596
+ modifiedBy: external_exports.string(),
4597
+ modifiedDate: external_exports.number(),
4598
+ retailerOwnedId: external_exports.number().nullish(),
4599
+ clusterAttrGroupId: external_exports.number().nullish(),
4600
+ attributeType: external_exports.string()
4456
4601
  });
4457
4602
 
4458
4603
  // lib/attributes/models/AttributesByCompany.ts
4459
- var attributesByCompanySchema = z.object({
4460
- next: z.string().nullish(),
4461
- previous: z.string().nullish(),
4462
- count: z.number(),
4463
- results: z.array(attributeSummarySchema)
4604
+ var attributesByCompanySchema = external_exports.object({
4605
+ next: external_exports.string().nullish(),
4606
+ previous: external_exports.string().nullish(),
4607
+ count: external_exports.number(),
4608
+ results: external_exports.array(attributeSummarySchema)
4464
4609
  });
4465
4610
 
4466
4611
  // lib/attributes/models/AttrDatatypeNameEnum.ts
4467
- var attrDatatypeNameEnumSchema = z.enum([
4612
+ var attrDatatypeNameEnumSchema = external_exports.enum([
4468
4613
  "TEXT",
4469
4614
  "SET",
4470
4615
  "INTEGER",
@@ -4477,106 +4622,106 @@ var attrDatatypeNameEnumSchema = z.enum([
4477
4622
  ]);
4478
4623
 
4479
4624
  // lib/attributes/models/AttributeGroup.ts
4480
- var attributeGroupSchema = z.object({
4481
- attrGroupId: z.number(),
4482
- attrGroupType: z.object({
4483
- attrGroupTypeId: z.number(),
4484
- groupTypeName: z.string(),
4485
- primary: z.boolean(),
4486
- restricted: z.boolean()
4625
+ var attributeGroupSchema = external_exports.object({
4626
+ attrGroupId: external_exports.number(),
4627
+ attrGroupType: external_exports.object({
4628
+ attrGroupTypeId: external_exports.number(),
4629
+ groupTypeName: external_exports.string(),
4630
+ primary: external_exports.boolean(),
4631
+ restricted: external_exports.boolean()
4487
4632
  }),
4488
- attrGroupTypeId: z.number(),
4489
- groupName: z.string(),
4490
- isDefault: z.boolean(),
4491
- orderWeight: z.number(),
4492
- primary: z.boolean()
4633
+ attrGroupTypeId: external_exports.number(),
4634
+ groupName: external_exports.string(),
4635
+ isDefault: external_exports.boolean(),
4636
+ orderWeight: external_exports.number(),
4637
+ primary: external_exports.boolean()
4493
4638
  });
4494
4639
 
4495
4640
  // lib/attributes/models/AttributeDefinition.ts
4496
- var parentAttributeSchema = z.object({
4497
- attrDataTypeId: z.number(),
4498
- attrDatatype: z.object({
4499
- attrDatatypeId: z.number(),
4641
+ var parentAttributeSchema = external_exports.object({
4642
+ attrDataTypeId: external_exports.number(),
4643
+ attrDatatype: external_exports.object({
4644
+ attrDatatypeId: external_exports.number(),
4500
4645
  datatypeName: attrDatatypeNameEnumSchema,
4501
- displayOnly: z.boolean()
4646
+ displayOnly: external_exports.boolean()
4502
4647
  }),
4503
- attrGroupId: z.number(),
4504
- attrGroups: z.array(attributeGroupSchema),
4505
- attrRoundId: z.number(),
4506
- attrStorageId: z.number(),
4507
- attributeId: z.number(),
4508
- attributeName: z.string(),
4509
- createdBy: z.string(),
4510
- createdDate: z.number(),
4511
- description: z.string().optional(),
4512
- displayName: z.string(),
4513
- modifiedDate: z.number(),
4514
- orderWeight: z.number(),
4515
- parentAttributeId: z.number().optional(),
4648
+ attrGroupId: external_exports.number(),
4649
+ attrGroups: external_exports.array(attributeGroupSchema),
4650
+ attrRoundId: external_exports.number(),
4651
+ attrStorageId: external_exports.number(),
4652
+ attributeId: external_exports.number(),
4653
+ attributeName: external_exports.string(),
4654
+ createdBy: external_exports.string(),
4655
+ createdDate: external_exports.number(),
4656
+ description: external_exports.string().optional(),
4657
+ displayName: external_exports.string(),
4658
+ modifiedDate: external_exports.number(),
4659
+ orderWeight: external_exports.number(),
4660
+ parentAttributeId: external_exports.number().optional(),
4516
4661
  primaryAttrGroup: attributeGroupSchema
4517
4662
  });
4518
- var attributeDefinitionSchema = z.object({
4519
- attrDataTypeId: z.number(),
4520
- attrDatatype: z.object({
4521
- attrDatatypeId: z.number(),
4663
+ var attributeDefinitionSchema = external_exports.object({
4664
+ attrDataTypeId: external_exports.number(),
4665
+ attrDatatype: external_exports.object({
4666
+ attrDatatypeId: external_exports.number(),
4522
4667
  datatypeName: attrDatatypeNameEnumSchema,
4523
- displayOnly: z.boolean()
4668
+ displayOnly: external_exports.boolean()
4524
4669
  }),
4525
- attrGroupId: z.number(),
4526
- attrGroups: z.array(attributeGroupSchema),
4527
- attrRestrictions: z.array(
4528
- z.object({
4529
- attrRestrictId: z.number(),
4530
- ignoreGlobal: z.boolean().optional(),
4531
- isDefault: z.boolean(),
4532
- isEssential: z.boolean(),
4533
- locale: z.string(),
4534
- mandatory: z.boolean(),
4535
- repeatable: z.boolean(),
4536
- minLength: z.number().optional(),
4537
- maxLength: z.number().optional()
4670
+ attrGroupId: external_exports.number(),
4671
+ attrGroups: external_exports.array(attributeGroupSchema),
4672
+ attrRestrictions: external_exports.array(
4673
+ external_exports.object({
4674
+ attrRestrictId: external_exports.number(),
4675
+ ignoreGlobal: external_exports.boolean().optional(),
4676
+ isDefault: external_exports.boolean(),
4677
+ isEssential: external_exports.boolean(),
4678
+ locale: external_exports.string(),
4679
+ mandatory: external_exports.boolean(),
4680
+ repeatable: external_exports.boolean(),
4681
+ minLength: external_exports.number().optional(),
4682
+ maxLength: external_exports.number().optional()
4538
4683
  })
4539
4684
  ).optional(),
4540
- attrRoundId: z.number(),
4541
- attrStorage: z.object({
4542
- attrStorageId: z.number(),
4543
- storageName: z.string()
4685
+ attrRoundId: external_exports.number(),
4686
+ attrStorage: external_exports.object({
4687
+ attrStorageId: external_exports.number(),
4688
+ storageName: external_exports.string()
4544
4689
  }),
4545
- attrStorageId: z.number(),
4546
- attrValues: z.array(
4547
- z.object({
4548
- attrKeyPair: z.string(),
4549
- attrValueId: z.number().optional(),
4550
- isDefault: z.boolean(),
4551
- locale: z.string(),
4552
- value: z.string()
4690
+ attrStorageId: external_exports.number(),
4691
+ attrValues: external_exports.array(
4692
+ external_exports.object({
4693
+ attrKeyPair: external_exports.string(),
4694
+ attrValueId: external_exports.number().optional(),
4695
+ isDefault: external_exports.boolean(),
4696
+ locale: external_exports.string(),
4697
+ value: external_exports.string()
4553
4698
  })
4554
4699
  ).optional(),
4555
- attributeId: z.number(),
4556
- attributeName: z.string(),
4557
- createdBy: z.string(),
4558
- createdDate: z.number(),
4559
- description: z.string().optional(),
4560
- displayName: z.string(),
4561
- modifiedDate: z.number(),
4562
- orderWeight: z.number().optional(),
4700
+ attributeId: external_exports.number(),
4701
+ attributeName: external_exports.string(),
4702
+ createdBy: external_exports.string(),
4703
+ createdDate: external_exports.number(),
4704
+ description: external_exports.string().optional(),
4705
+ displayName: external_exports.string(),
4706
+ modifiedDate: external_exports.number(),
4707
+ orderWeight: external_exports.number().optional(),
4563
4708
  parentAttribute: parentAttributeSchema.optional(),
4564
- parentAttributeId: z.number().optional(),
4709
+ parentAttributeId: external_exports.number().optional(),
4565
4710
  primaryAttrGroup: attributeGroupSchema
4566
4711
  });
4567
4712
 
4568
4713
  // lib/attributes/models/AttributeValidValues.ts
4569
- var attributeValidValuesSchema = z.object({
4570
- value: z.string(),
4571
- isDefault: z.boolean(),
4572
- locale: z.string(),
4573
- createdBy: z.string(),
4574
- createdDate: z.number(),
4575
- modifiedDate: z.number(),
4576
- modifiedBy: z.string(),
4577
- attributeId: z.number(),
4578
- attrValueId: z.number(),
4579
- attrKeyPair: z.string()
4714
+ var attributeValidValuesSchema = external_exports.object({
4715
+ value: external_exports.string(),
4716
+ isDefault: external_exports.boolean(),
4717
+ locale: external_exports.string(),
4718
+ createdBy: external_exports.string(),
4719
+ createdDate: external_exports.number(),
4720
+ modifiedDate: external_exports.number(),
4721
+ modifiedBy: external_exports.string(),
4722
+ attributeId: external_exports.number(),
4723
+ attrValueId: external_exports.number(),
4724
+ attrKeyPair: external_exports.string()
4580
4725
  });
4581
4726
 
4582
4727
  // lib/attributes/index.ts
@@ -4584,7 +4729,7 @@ var BASE_URL7 = "attributes";
4584
4729
  function createAttributesApi(client) {
4585
4730
  async function getAllAttributes(signal) {
4586
4731
  const data = await client.get(`${BASE_URL7}`, { signal }).json();
4587
- return z.array(attributeMetaDataSchema).parse(data);
4732
+ return external_exports.array(attributeMetaDataSchema).parse(data);
4588
4733
  }
4589
4734
  async function getAllAttributesByCompany(params, signal) {
4590
4735
  const data = await client.get(`${BASE_URL7}/company`, {
@@ -4595,20 +4740,20 @@ function createAttributesApi(client) {
4595
4740
  }
4596
4741
  async function getAttributesExtensiveInfo(signal) {
4597
4742
  const data = await client.get(`${BASE_URL7}/registry/editui`, { signal }).json();
4598
- return z.array(attributeDefinitionSchema).parse(data);
4743
+ return external_exports.array(attributeDefinitionSchema).parse(data);
4599
4744
  }
4600
4745
  async function getAttributeValidValues(attributeDbName, signal) {
4601
4746
  const data = await client.get(`${BASE_URL7}/registry/attribute/${attributeDbName}/values`, {
4602
4747
  signal
4603
4748
  }).json();
4604
- return z.array(attributeValidValuesSchema).parse(data);
4749
+ return external_exports.array(attributeValidValuesSchema).parse(data);
4605
4750
  }
4606
4751
  async function getCompanyInterestedAttributes(params, signal) {
4607
4752
  const data = await client.get(`${BASE_URL7}/company/interested-attributes`, {
4608
4753
  searchParams: params,
4609
4754
  signal
4610
4755
  }).json();
4611
- return z.array(z.string()).parse(data);
4756
+ return external_exports.array(external_exports.string()).parse(data);
4612
4757
  }
4613
4758
  return {
4614
4759
  getAllAttributes,
@@ -4620,9 +4765,9 @@ function createAttributesApi(client) {
4620
4765
  }
4621
4766
 
4622
4767
  // lib/locale/models/Locale.ts
4623
- var localeSchema = z.object({
4624
- localeCode: z.string(),
4625
- localeDescription: z.string()
4768
+ var localeSchema = external_exports.object({
4769
+ localeCode: external_exports.string(),
4770
+ localeDescription: external_exports.string()
4626
4771
  });
4627
4772
 
4628
4773
  // lib/locale/index.ts
@@ -4630,7 +4775,7 @@ var BASE_URL8 = "locale";
4630
4775
  function createLocaleApi(client) {
4631
4776
  async function getLocale(signal) {
4632
4777
  const data = await client.get(`${BASE_URL8}`, { signal }).json();
4633
- return z.array(localeSchema).parse(data);
4778
+ return external_exports.array(localeSchema).parse(data);
4634
4779
  }
4635
4780
  return {
4636
4781
  getLocale
@@ -4638,24 +4783,24 @@ function createLocaleApi(client) {
4638
4783
  }
4639
4784
 
4640
4785
  // lib/spreadsheetTemplate/models/SpreadsheetTemplateCompany.ts
4641
- var spreadsheetTemplateCompanySchema = z.object({
4642
- companyName: z.string(),
4643
- companyId: z.number(),
4644
- createdAt: z.number()
4786
+ var spreadsheetTemplateCompanySchema = external_exports.object({
4787
+ companyName: external_exports.string(),
4788
+ companyId: external_exports.number(),
4789
+ createdAt: external_exports.number()
4645
4790
  });
4646
4791
 
4647
4792
  // lib/spreadsheetTemplate/models/SpreadsheetTemplate.ts
4648
- var spreadsheetTemplateSchema = z.object({
4649
- id: z.number(),
4650
- fileLocation: z.string(),
4651
- name: z.string(),
4652
- templateType: z.string(),
4653
- maxItemsPerDoc: z.number(),
4654
- companies: z.array(spreadsheetTemplateCompanySchema),
4655
- createdBy: z.string().nullish(),
4656
- createdAt: z.number().nullish(),
4657
- modifiedBy: z.string().nullish(),
4658
- modifiedAt: z.number().nullish()
4793
+ var spreadsheetTemplateSchema = external_exports.object({
4794
+ id: external_exports.number(),
4795
+ fileLocation: external_exports.string(),
4796
+ name: external_exports.string(),
4797
+ templateType: external_exports.string(),
4798
+ maxItemsPerDoc: external_exports.number(),
4799
+ companies: external_exports.array(spreadsheetTemplateCompanySchema),
4800
+ createdBy: external_exports.string().nullish(),
4801
+ createdAt: external_exports.number().nullish(),
4802
+ modifiedBy: external_exports.string().nullish(),
4803
+ modifiedAt: external_exports.number().nullish()
4659
4804
  });
4660
4805
 
4661
4806
  // lib/spreadsheetTemplate/index.ts
@@ -4663,7 +4808,7 @@ var BASE_URL9 = "templates";
4663
4808
  function createSpreadsheetTemplateApi(client) {
4664
4809
  async function getTemplates(params, signal) {
4665
4810
  const data = await client.get(`${BASE_URL9}`, { searchParams: params, signal }).json();
4666
- return z.array(spreadsheetTemplateSchema).parse(data);
4811
+ return external_exports.array(spreadsheetTemplateSchema).parse(data);
4667
4812
  }
4668
4813
  return {
4669
4814
  getTemplates
@@ -4671,96 +4816,96 @@ function createSpreadsheetTemplateApi(client) {
4671
4816
  }
4672
4817
 
4673
4818
  // lib/whoami/models/IdentityServiceDatetimePreferences.ts
4674
- var identityServiceDatetimePreferencesSchema = z.object({
4675
- DATE_TIME: z.string(),
4676
- TIME: z.string(),
4677
- SHORT_DATE: z.string(),
4678
- LONG_DATETIME: z.string(),
4679
- LONG_TIME: z.string(),
4680
- DATE: z.string()
4819
+ var identityServiceDatetimePreferencesSchema = external_exports.object({
4820
+ DATE_TIME: external_exports.string(),
4821
+ TIME: external_exports.string(),
4822
+ SHORT_DATE: external_exports.string(),
4823
+ LONG_DATETIME: external_exports.string(),
4824
+ LONG_TIME: external_exports.string(),
4825
+ DATE: external_exports.string()
4681
4826
  });
4682
4827
 
4683
4828
  // lib/whoami/models/IdentityServiceOrganizationMetadata.ts
4684
- var identityServiceOrganizationMetadataSchema = z.object({
4685
- namespace: z.string(),
4686
- key: z.string(),
4687
- value: z.string()
4829
+ var identityServiceOrganizationMetadataSchema = external_exports.object({
4830
+ namespace: external_exports.string(),
4831
+ key: external_exports.string(),
4832
+ value: external_exports.string()
4688
4833
  });
4689
4834
 
4690
4835
  // lib/whoami/models/IdentityServiceOrganization.ts
4691
- var identityServiceOrganizationSchema = z.object({
4692
- organization_name: z.string().optional(),
4693
- organization_site: z.string().optional(),
4694
- namespace: z.string().optional(),
4695
- id: z.string(),
4696
- permissions: z.array(z.string()).optional(),
4836
+ var identityServiceOrganizationSchema = external_exports.object({
4837
+ organization_name: external_exports.string().optional(),
4838
+ organization_site: external_exports.string().optional(),
4839
+ namespace: external_exports.string().optional(),
4840
+ id: external_exports.string(),
4841
+ permissions: external_exports.array(external_exports.string()).optional(),
4697
4842
  metadata: identityServiceOrganizationMetadataSchema.optional()
4698
4843
  });
4699
4844
 
4700
4845
  // lib/whoami/models/IdentityServicePreferences.ts
4701
- var identityServicePreferencesSchema = z.object({
4702
- locale: z.string(),
4703
- timezone: z.string(),
4704
- cpUpgrade: z.string().optional(),
4705
- language: z.array(z.string()),
4846
+ var identityServicePreferencesSchema = external_exports.object({
4847
+ locale: external_exports.string(),
4848
+ timezone: external_exports.string(),
4849
+ cpUpgrade: external_exports.string().optional(),
4850
+ language: external_exports.array(external_exports.string()),
4706
4851
  datetime: identityServiceDatetimePreferencesSchema
4707
4852
  });
4708
4853
 
4709
4854
  // lib/whoami/models/IdentityServiceUser.ts
4710
- var identityServiceUserSchema = z.object({
4711
- id: z.string(),
4712
- email: z.string().optional(),
4713
- first_name: z.string().optional(),
4714
- last_name: z.string().optional(),
4715
- job_title: z.string().optional(),
4716
- externally_managed: z.boolean().optional(),
4717
- city: z.string().optional(),
4718
- name: z.string(),
4719
- state: z.string().optional(),
4720
- country: z.string().optional(),
4721
- user_type: z.string().optional(),
4722
- token_type: z.string().optional(),
4723
- avatar_image_id: z.string().optional(),
4724
- avatar_image_url: z.string().optional(),
4725
- origin_avatar_image_id: z.string().optional(),
4726
- bio: z.string().optional(),
4727
- phone_number: z.string().optional(),
4728
- twitter_handle: z.string().optional(),
4729
- linkedin_url: z.string().optional(),
4730
- description: z.string().optional(),
4855
+ var identityServiceUserSchema = external_exports.object({
4856
+ id: external_exports.string(),
4857
+ email: external_exports.string().optional(),
4858
+ first_name: external_exports.string().optional(),
4859
+ last_name: external_exports.string().optional(),
4860
+ job_title: external_exports.string().optional(),
4861
+ externally_managed: external_exports.boolean().optional(),
4862
+ city: external_exports.string().optional(),
4863
+ name: external_exports.string(),
4864
+ state: external_exports.string().optional(),
4865
+ country: external_exports.string().optional(),
4866
+ user_type: external_exports.string().optional(),
4867
+ token_type: external_exports.string().optional(),
4868
+ avatar_image_id: external_exports.string().optional(),
4869
+ avatar_image_url: external_exports.string().optional(),
4870
+ origin_avatar_image_id: external_exports.string().optional(),
4871
+ bio: external_exports.string().optional(),
4872
+ phone_number: external_exports.string().optional(),
4873
+ twitter_handle: external_exports.string().optional(),
4874
+ linkedin_url: external_exports.string().optional(),
4875
+ description: external_exports.string().optional(),
4731
4876
  preferences: identityServicePreferencesSchema.optional(),
4732
- roles: z.array(z.string()),
4877
+ roles: external_exports.array(external_exports.string()),
4733
4878
  organization: identityServiceOrganizationSchema,
4734
- password: z.string(),
4735
- verified: z.boolean()
4879
+ password: external_exports.string(),
4880
+ verified: external_exports.boolean()
4736
4881
  });
4737
4882
 
4738
4883
  // lib/whoami/models/RegisteredService.ts
4739
- var registeredServiceSchema = z.object({
4740
- serviceId: z.number(),
4741
- identityServiceId: z.number(),
4742
- name: z.string(),
4743
- isActive: z.boolean()
4884
+ var registeredServiceSchema = external_exports.object({
4885
+ serviceId: external_exports.number(),
4886
+ identityServiceId: external_exports.number(),
4887
+ name: external_exports.string(),
4888
+ isActive: external_exports.boolean()
4744
4889
  });
4745
4890
 
4746
4891
  // lib/whoami/models/UserAccount.ts
4747
- var userAccountSchema = z.object({
4892
+ var userAccountSchema = external_exports.object({
4748
4893
  identityUser: identityServiceUserSchema,
4749
- companyId: z.number(),
4750
- companyName: z.string(),
4751
- name: z.string(),
4752
- assortmentPartnerCompanyId: z.number().nullish(),
4753
- retailer: z.boolean(),
4754
- supplier: z.boolean(),
4894
+ companyId: external_exports.number(),
4895
+ companyName: external_exports.string(),
4896
+ name: external_exports.string(),
4897
+ assortmentPartnerCompanyId: external_exports.number().nullish(),
4898
+ retailer: external_exports.boolean(),
4899
+ supplier: external_exports.boolean(),
4755
4900
  registeredService: registeredServiceSchema,
4756
- uniqueAttributes: z.array(z.string()),
4757
- admin: z.boolean(),
4758
- adminToolUser: z.boolean(),
4759
- attributeRegistryAdmin: z.boolean(),
4760
- attributeRegistryDev: z.boolean(),
4761
- attributeRegistryRsx: z.boolean(),
4762
- attributeRegistryUser: z.boolean(),
4763
- attributeRegistryViewer: z.boolean()
4901
+ uniqueAttributes: external_exports.array(external_exports.string()),
4902
+ admin: external_exports.boolean(),
4903
+ adminToolUser: external_exports.boolean(),
4904
+ attributeRegistryAdmin: external_exports.boolean(),
4905
+ attributeRegistryDev: external_exports.boolean(),
4906
+ attributeRegistryRsx: external_exports.boolean(),
4907
+ attributeRegistryUser: external_exports.boolean(),
4908
+ attributeRegistryViewer: external_exports.boolean()
4764
4909
  });
4765
4910
 
4766
4911
  // lib/whoami/index.ts
@@ -4782,7 +4927,7 @@ function createCompanyFeaturesApi(client) {
4782
4927
  const data = await client.get(`${BASE_URL11}/isphaseditemsetupenabled`, {
4783
4928
  signal
4784
4929
  }).json();
4785
- return z.boolean().parse(data);
4930
+ return external_exports.boolean().parse(data);
4786
4931
  }
4787
4932
  return {
4788
4933
  checkIfStageItemSetupIsEnabled
@@ -4796,38 +4941,47 @@ function createFeatureFlagsApi(client) {
4796
4941
  const data = await client.get(`${BASE_URL12}/enable-item-level-msis/`, {
4797
4942
  signal
4798
4943
  }).json();
4799
- return z.boolean().parse(data);
4944
+ return external_exports.boolean().parse(data);
4800
4945
  }
4801
4946
  async function checkIfEnabledForPackagingHierarchies(signal) {
4802
4947
  const data = await client.get(`${BASE_URL12}/server-allow-import-and-export-of-packsizes-170720/`, {
4803
4948
  signal
4804
4949
  }).json();
4805
- return z.boolean().parse(data);
4950
+ return external_exports.boolean().parse(data);
4951
+ }
4952
+ async function checkIfEnabledForItemUomConversionRules(flagOptions = {}) {
4953
+ const { companyId, signal } = flagOptions;
4954
+ const path = companyId ? `${BASE_URL12}/enable-items-api-uom-conversion-rules/${companyId}/` : `${BASE_URL12}/enable-items-api-uom-conversion-rules/`;
4955
+ const data = await client.get(path, {
4956
+ signal
4957
+ }).json();
4958
+ return external_exports.boolean().parse(data);
4806
4959
  }
4807
4960
  return {
4808
4961
  checkEnableItemsLevelMSIS,
4809
- checkIfEnabledForPackagingHierarchies
4962
+ checkIfEnabledForPackagingHierarchies,
4963
+ checkIfEnabledForItemUomConversionRules
4810
4964
  };
4811
4965
  }
4812
4966
 
4813
4967
  // lib/items/v1/models/ItemHeader.ts
4814
- var itemHeaderSchema = z.object({
4815
- status: z.string().optional(),
4816
- catalogName: z.string(),
4817
- productCodeName: z.string(),
4818
- selectionCodeName: z.string(),
4819
- gtin: z.string(),
4820
- upc: z.string(),
4821
- ean: z.string(),
4822
- isbn: z.string(),
4823
- partNumber: z.string(),
4824
- lastUpdatedDateString: z.string(),
4825
- companyId: z.string(),
4826
- itemInfoId: z.string()
4968
+ var itemHeaderSchema = external_exports.object({
4969
+ status: external_exports.string().optional(),
4970
+ catalogName: external_exports.string(),
4971
+ productCodeName: external_exports.string(),
4972
+ selectionCodeName: external_exports.string(),
4973
+ gtin: external_exports.string(),
4974
+ upc: external_exports.string(),
4975
+ ean: external_exports.string(),
4976
+ isbn: external_exports.string(),
4977
+ partNumber: external_exports.string(),
4978
+ lastUpdatedDateString: external_exports.string(),
4979
+ companyId: external_exports.string(),
4980
+ itemInfoId: external_exports.string()
4827
4981
  });
4828
4982
 
4829
4983
  // lib/items/v1/models/PhaseEnum.ts
4830
- var phaseEnumSchema = z.enum([
4984
+ var phaseEnumSchema = external_exports.enum([
4831
4985
  "CORE",
4832
4986
  "CORE_PLUS",
4833
4987
  "CORE_ADVANCED",
@@ -4836,54 +4990,54 @@ var phaseEnumSchema = z.enum([
4836
4990
  ]);
4837
4991
 
4838
4992
  // lib/items/v1/models/TradingPartnerStage.ts
4839
- var tradingPartnerStageSchema = z.object({
4840
- companyId: z.number(),
4841
- companyName: z.string(),
4842
- stage: z.nullable(phaseEnumSchema),
4843
- isValid: z.boolean()
4993
+ var tradingPartnerStageSchema = external_exports.object({
4994
+ companyId: external_exports.number(),
4995
+ companyName: external_exports.string(),
4996
+ stage: external_exports.nullable(phaseEnumSchema),
4997
+ isValid: external_exports.boolean()
4844
4998
  });
4845
4999
 
4846
5000
  // lib/items/v1/models/ItemMap.ts
4847
- var itemMapSchema = z.object({
4848
- rn: z.number().optional(),
4849
- iteminfoid: z.string(),
4850
- tradingPartnerStages: z.array(tradingPartnerStageSchema).optional(),
4851
- gtin: z.string().nullish(),
4852
- catalogname: z.string().nullish(),
4853
- isbn: z.string().nullish(),
4854
- lastupdateddatestring: z.string().nullish(),
4855
- upc: z.string().nullish(),
4856
- productcodename: z.string().nullish(),
4857
- ean: z.string().nullish(),
4858
- selectioncodename: z.string().nullish(),
4859
- createddatestring: z.string().nullish(),
4860
- partnumber: z.string().nullish(),
4861
- consumeravailabledatestring: z.string().nullish(),
4862
- status: z.string().nullish(),
4863
- nrfcolorcode: z.array(z.string()).nullish(),
4864
- nrfsizecode: z.array(z.string()).nullish(),
4865
- productcolordescription: z.array(z.string()).nullish(),
4866
- productsizedescription: z.array(z.string()).nullish()
5001
+ var itemMapSchema = external_exports.object({
5002
+ rn: external_exports.number().optional(),
5003
+ iteminfoid: external_exports.string(),
5004
+ tradingPartnerStages: external_exports.array(tradingPartnerStageSchema).optional(),
5005
+ gtin: external_exports.string().nullish(),
5006
+ catalogname: external_exports.string().nullish(),
5007
+ isbn: external_exports.string().nullish(),
5008
+ lastupdateddatestring: external_exports.string().nullish(),
5009
+ upc: external_exports.string().nullish(),
5010
+ productcodename: external_exports.string().nullish(),
5011
+ ean: external_exports.string().nullish(),
5012
+ selectioncodename: external_exports.string().nullish(),
5013
+ createddatestring: external_exports.string().nullish(),
5014
+ partnumber: external_exports.string().nullish(),
5015
+ consumeravailabledatestring: external_exports.string().nullish(),
5016
+ status: external_exports.string().nullish(),
5017
+ nrfcolorcode: external_exports.array(external_exports.string()).nullish(),
5018
+ nrfsizecode: external_exports.array(external_exports.string()).nullish(),
5019
+ productcolordescription: external_exports.array(external_exports.string()).nullish(),
5020
+ productsizedescription: external_exports.array(external_exports.string()).nullish()
4867
5021
  }).passthrough();
4868
5022
 
4869
5023
  // lib/items/v1/models/ItemTable.ts
4870
- var itemTableSchema = z.object({
5024
+ var itemTableSchema = external_exports.object({
4871
5025
  headers: itemHeaderSchema,
4872
- itemMaps: z.array(itemMapSchema)
5026
+ itemMaps: external_exports.array(itemMapSchema)
4873
5027
  });
4874
5028
 
4875
5029
  // lib/items/v1/models/ItemSearchView.ts
4876
- var itemSearchViewSchema = z.object({
5030
+ var itemSearchViewSchema = external_exports.object({
4877
5031
  itemTable: itemTableSchema,
4878
- hasNext: z.boolean(),
4879
- count: z.number()
5032
+ hasNext: external_exports.boolean(),
5033
+ count: external_exports.number()
4880
5034
  });
4881
5035
 
4882
5036
  // lib/exports/models/ExportType.ts
4883
- var exportTypeEnum = z.enum(["ALL", "UPDATES", "DELTAS_UPDATE", "NO_BUYER_PART_NUMBER"]);
5037
+ var exportTypeEnum = external_exports.enum(["ALL", "UPDATES", "DELTAS_UPDATE", "NO_BUYER_PART_NUMBER"]);
4884
5038
 
4885
5039
  // lib/exports/models/ExportFrequency.ts
4886
- var exportFrequencyEnum = z.enum([
5040
+ var exportFrequencyEnum = external_exports.enum([
4887
5041
  "IMMEDIATE",
4888
5042
  "ONETIME",
4889
5043
  "DAILY",
@@ -4892,7 +5046,7 @@ var exportFrequencyEnum = z.enum([
4892
5046
  ]);
4893
5047
 
4894
5048
  // lib/exports/models/ExportDayOfWeek.ts
4895
- var exportDayOfWeekEnum = z.enum([
5049
+ var exportDayOfWeekEnum = external_exports.enum([
4896
5050
  "MON",
4897
5051
  "TUE",
4898
5052
  "WED",
@@ -4903,62 +5057,62 @@ var exportDayOfWeekEnum = z.enum([
4903
5057
  ]);
4904
5058
 
4905
5059
  // lib/exports/models/Export.ts
4906
- var exportSchema = z.object({
4907
- exportName: z.string(),
4908
- exportDescription: z.string(),
4909
- isActive: z.boolean(),
5060
+ var exportSchema = external_exports.object({
5061
+ exportName: external_exports.string(),
5062
+ exportDescription: external_exports.string(),
5063
+ isActive: external_exports.boolean(),
4910
5064
  exportType: exportTypeEnum,
4911
5065
  exportFrequency: exportFrequencyEnum,
4912
- includeValidAttributes: z.optional(z.boolean()),
4913
- dayOfMonth: z.optional(z.number()),
4914
- dayOfWeek: z.optional(exportDayOfWeekEnum),
4915
- hourOfDay: z.optional(z.number()),
4916
- date: z.optional(z.string()),
4917
- catalogIds: z.optional(z.array(z.number())),
4918
- itemInfoIds: z.optional(z.array(z.number())),
4919
- excludeItemInfoIds: z.optional(z.array(z.number())),
4920
- selectionCodeIds: z.optional(z.array(z.number())),
4921
- productCodeIds: z.optional(z.array(z.number())),
4922
- productTypes: z.optional(z.array(z.string())),
4923
- deliveryType: z.optional(z.string()),
4924
- spreadsheetTemplateId: z.optional(z.number()),
4925
- emailAddresses: z.optional(z.array(z.string())),
4926
- subjectLine: z.optional(z.string()),
4927
- additionalLocales: z.optional(z.array(z.string())),
4928
- availableAttributeList: z.optional(z.array(z.string()))
5066
+ includeValidAttributes: external_exports.optional(external_exports.boolean()),
5067
+ dayOfMonth: external_exports.optional(external_exports.number()),
5068
+ dayOfWeek: external_exports.optional(exportDayOfWeekEnum),
5069
+ hourOfDay: external_exports.optional(external_exports.number()),
5070
+ date: external_exports.optional(external_exports.string()),
5071
+ catalogIds: external_exports.optional(external_exports.array(external_exports.number())),
5072
+ itemInfoIds: external_exports.optional(external_exports.array(external_exports.number())),
5073
+ excludeItemInfoIds: external_exports.optional(external_exports.array(external_exports.number())),
5074
+ selectionCodeIds: external_exports.optional(external_exports.array(external_exports.number())),
5075
+ productCodeIds: external_exports.optional(external_exports.array(external_exports.number())),
5076
+ productTypes: external_exports.optional(external_exports.array(external_exports.string())),
5077
+ deliveryType: external_exports.optional(external_exports.string()),
5078
+ spreadsheetTemplateId: external_exports.optional(external_exports.number()),
5079
+ emailAddresses: external_exports.optional(external_exports.array(external_exports.string())),
5080
+ subjectLine: external_exports.optional(external_exports.string()),
5081
+ additionalLocales: external_exports.optional(external_exports.array(external_exports.string())),
5082
+ availableAttributeList: external_exports.optional(external_exports.array(external_exports.string()))
4929
5083
  });
4930
5084
 
4931
5085
  // lib/exports/models/DownloadItemsParams.ts
4932
- var downLoadItemsParamsSchema = z.object({
4933
- "multi-sheet": z.boolean(),
4934
- ids: z.array(z.string())
5086
+ var downLoadItemsParamsSchema = external_exports.object({
5087
+ "multi-sheet": external_exports.boolean(),
5088
+ ids: external_exports.array(external_exports.string())
4935
5089
  });
4936
5090
 
4937
5091
  // lib/errors/v1/models/ItemErrorDetails.ts
4938
- var itemErrorDetailsSchema = z.object({
4939
- errorMessage: z.string(),
4940
- attributeName: z.string().nullable(),
4941
- tradingPartnerNames: z.array(z.string()),
4942
- phases: z.array(phaseEnumSchema),
4943
- attributeDbNames: z.array(z.string()),
4944
- tradingPartnerStages: z.array(tradingPartnerStageSchema),
4945
- repeatableGroupId: z.string().nullish()
5092
+ var itemErrorDetailsSchema = external_exports.object({
5093
+ errorMessage: external_exports.string(),
5094
+ attributeName: external_exports.string().nullable(),
5095
+ tradingPartnerNames: external_exports.array(external_exports.string()),
5096
+ phases: external_exports.array(phaseEnumSchema),
5097
+ attributeDbNames: external_exports.array(external_exports.string()),
5098
+ tradingPartnerStages: external_exports.array(tradingPartnerStageSchema),
5099
+ repeatableGroupId: external_exports.string().nullish()
4946
5100
  });
4947
5101
 
4948
5102
  // lib/errors/v1/models/ItemErrorDetailsResult.ts
4949
- var itemErrorDetailsResultSchema = z.object({
4950
- itemInfoId: z.number(),
4951
- upc: z.string().nullish(),
4952
- isbn: z.string().nullish(),
4953
- gtin: z.string().nullish(),
4954
- partnumber: z.string().nullish(),
4955
- ean: z.string().nullish(),
4956
- itemName: z.string().nullable(),
4957
- itemErrorDetails: z.array(itemErrorDetailsSchema)
5103
+ var itemErrorDetailsResultSchema = external_exports.object({
5104
+ itemInfoId: external_exports.number(),
5105
+ upc: external_exports.string().nullish(),
5106
+ isbn: external_exports.string().nullish(),
5107
+ gtin: external_exports.string().nullish(),
5108
+ partnumber: external_exports.string().nullish(),
5109
+ ean: external_exports.string().nullish(),
5110
+ itemName: external_exports.string().nullable(),
5111
+ itemErrorDetails: external_exports.array(itemErrorDetailsSchema)
4958
5112
  });
4959
5113
 
4960
5114
  // lib/items/v2/models/Stage.ts
4961
- var stageSchema = z.enum([
5115
+ var stageSchema = external_exports.enum([
4962
5116
  "CORE",
4963
5117
  "CORE_PLUS",
4964
5118
  "CORE_ADVANCED",
@@ -4966,14 +5120,14 @@ var stageSchema = z.enum([
4966
5120
  ]);
4967
5121
 
4968
5122
  // lib/items/v2/models/OrgSummary.ts
4969
- var orgSummarySchema = z.object({
4970
- ref: z.string(),
4971
- id: z.string(),
4972
- name: z.string()
5123
+ var orgSummarySchema = external_exports.object({
5124
+ ref: external_exports.string(),
5125
+ id: external_exports.string(),
5126
+ name: external_exports.string()
4973
5127
  });
4974
5128
 
4975
5129
  // lib/items/v2/models/ItemOrgStageDetails.ts
4976
- var itemOrgStageDetailsSchema = z.object({
5130
+ var itemOrgStageDetailsSchema = external_exports.object({
4977
5131
  /**
4978
5132
  * When called as retailer, the vendor, else when vendor, the retailer.
4979
5133
  * */
@@ -4981,7 +5135,7 @@ var itemOrgStageDetailsSchema = z.object({
4981
5135
  /**
4982
5136
  * The company id of the retailer or vendor used for matching ItemOrgStageDetails to TradingPartnerStage for ErrorService
4983
5137
  */
4984
- companyId: z.number().nullish(),
5138
+ companyId: external_exports.number().nullish(),
4985
5139
  /**
4986
5140
  * "Standard Requirements" (null) UNLESS the retailer of the item is MSIS Enabled
4987
5141
  * OTHERWISE the retailer default Stage UNLESS there's a currently active vendor-specific Stage defined
@@ -4992,124 +5146,124 @@ var itemOrgStageDetailsSchema = z.object({
4992
5146
  * If the item is valid for the active stage. Note that for "Standard Requirements" or
4993
5147
  * "Enriched" this cam come directly from the item_doc table, but anything else requires validation
4994
5148
  */
4995
- isValid: z.boolean(),
5149
+ isValid: external_exports.boolean(),
4996
5150
  /**
4997
5151
  * Not null if there's an item level policy override for this trading partnership
4998
5152
  */
4999
- itemPolicyId: z.string().nullish(),
5153
+ itemPolicyId: external_exports.string().nullish(),
5000
5154
  /**
5001
5155
  * Start date for the Item level Stage if applicable
5002
5156
  */
5003
- startDate: z.number().transform((num) => new Date(num * 1e3)).nullish(),
5157
+ startDate: external_exports.number().transform((num) => new Date(num * 1e3)).nullish(),
5004
5158
  /**
5005
5159
  * End date for the Item level Stage if applicable
5006
5160
  */
5007
- endDate: z.number().transform((num) => new Date(num * 1e3)).nullish()
5161
+ endDate: external_exports.number().transform((num) => new Date(num * 1e3)).nullish()
5008
5162
  });
5009
5163
 
5010
5164
  // lib/items/v2/models/ItemStatusV2.ts
5011
- var itemStatusV2Schema = z.object({
5012
- itemId: z.string(),
5165
+ var itemStatusV2Schema = external_exports.object({
5166
+ itemId: external_exports.string(),
5013
5167
  mostRestrictiveRetailerStage: stageSchema.nullable(),
5014
- itemOrgStageDetails: z.array(itemOrgStageDetailsSchema)
5168
+ itemOrgStageDetails: external_exports.array(itemOrgStageDetailsSchema)
5015
5169
  });
5016
5170
 
5017
5171
  // lib/items/v2/models/ItemStatusV2Response.ts
5018
- var itemStatusV2ResponseSchema = z.object({
5019
- itemStatuses: z.array(itemStatusV2Schema)
5172
+ var itemStatusV2ResponseSchema = external_exports.object({
5173
+ itemStatuses: external_exports.array(itemStatusV2Schema)
5020
5174
  });
5021
5175
 
5022
5176
  // lib/errors/v2/models/TradingPartnerStage.ts
5023
- var tradingPartnerStageV2Schema = z.object({
5024
- companyId: z.number(),
5025
- companyName: z.string(),
5177
+ var tradingPartnerStageV2Schema = external_exports.object({
5178
+ companyId: external_exports.number(),
5179
+ companyName: external_exports.string(),
5026
5180
  stage: stageSchema.nullish(),
5027
- isValid: z.boolean()
5181
+ isValid: external_exports.boolean()
5028
5182
  });
5029
5183
 
5030
5184
  // lib/errors/v2/models/ItemErrorSummary.ts
5031
- var itemErrorSummaryV2Schema = z.object({
5032
- itemInfoId: z.number(),
5033
- upc: z.string().nullish(),
5034
- isbn: z.string().nullish(),
5035
- gtin: z.string().nullish(),
5036
- ean: z.string().nullish(),
5037
- partnumber: z.string().nullish(),
5038
- colorfamily: z.string().nullish(),
5039
- fit: z.string().nullish(),
5040
- productcolordescription: z.string().nullish(),
5041
- distributioncentercode: z.string().nullish(),
5042
- accountnumber: z.string().nullish(),
5043
- erpid: z.string().nullish(),
5044
- totalErrors: z.number(),
5045
- tradingPartners: z.array(z.string()),
5046
- tradingPartnerIds: z.array(z.number()),
5185
+ var itemErrorSummaryV2Schema = external_exports.object({
5186
+ itemInfoId: external_exports.number(),
5187
+ upc: external_exports.string().nullish(),
5188
+ isbn: external_exports.string().nullish(),
5189
+ gtin: external_exports.string().nullish(),
5190
+ ean: external_exports.string().nullish(),
5191
+ partnumber: external_exports.string().nullish(),
5192
+ colorfamily: external_exports.string().nullish(),
5193
+ fit: external_exports.string().nullish(),
5194
+ productcolordescription: external_exports.string().nullish(),
5195
+ distributioncentercode: external_exports.string().nullish(),
5196
+ accountnumber: external_exports.string().nullish(),
5197
+ erpid: external_exports.string().nullish(),
5198
+ totalErrors: external_exports.number(),
5199
+ tradingPartners: external_exports.array(external_exports.string()),
5200
+ tradingPartnerIds: external_exports.array(external_exports.number()),
5047
5201
  // These are the stages assigned to the TradingPartners, not the stages of the errors
5048
- phases: z.array(z.string()),
5202
+ phases: external_exports.array(external_exports.string()),
5049
5203
  // Same thing for the stage property in here: it's the stage of the Item & TradingPartner, not the stage of the error
5050
- tradingPartnerStages: z.array(tradingPartnerStageV2Schema),
5051
- validatedDate: z.number().pipe(z.coerce.date()).nullish()
5204
+ tradingPartnerStages: external_exports.array(tradingPartnerStageV2Schema),
5205
+ validatedDate: external_exports.number().pipe(external_exports.coerce.date()).nullish()
5052
5206
  });
5053
5207
 
5054
5208
  // lib/errors/v2/models/ItemErrorSummaryResult.ts
5055
- var itemErrorSummaryResultV2Schema = z.object({
5056
- hasNext: z.boolean(),
5057
- errors: z.array(itemErrorSummaryV2Schema)
5209
+ var itemErrorSummaryResultV2Schema = external_exports.object({
5210
+ hasNext: external_exports.boolean(),
5211
+ errors: external_exports.array(itemErrorSummaryV2Schema)
5058
5212
  });
5059
5213
 
5060
5214
  // lib/errors/v2/models/ItemErrorDetails.ts
5061
- var itemErrorDetailsV2Schema = z.object({
5062
- errorMessage: z.string(),
5063
- attributeName: z.string().nullable(),
5064
- tradingPartnerNames: z.array(z.string()),
5065
- phases: z.array(stageSchema),
5066
- attributeDbNames: z.array(z.string()),
5067
- tradingPartnerStages: z.array(tradingPartnerStageV2Schema),
5068
- repeatableGroupId: z.string().nullish()
5215
+ var itemErrorDetailsV2Schema = external_exports.object({
5216
+ errorMessage: external_exports.string(),
5217
+ attributeName: external_exports.string().nullable(),
5218
+ tradingPartnerNames: external_exports.array(external_exports.string()),
5219
+ phases: external_exports.array(stageSchema),
5220
+ attributeDbNames: external_exports.array(external_exports.string()),
5221
+ tradingPartnerStages: external_exports.array(tradingPartnerStageV2Schema),
5222
+ repeatableGroupId: external_exports.string().nullish()
5069
5223
  });
5070
5224
 
5071
5225
  // lib/errors/v2/models/ItemErrorDetailsResult.ts
5072
- var itemErrorDetailsResultV2Schema = z.object({
5073
- itemInfoId: z.number(),
5074
- upc: z.string().nullish(),
5075
- isbn: z.string().nullish(),
5076
- gtin: z.string().nullish(),
5077
- partnumber: z.string().nullish(),
5078
- ean: z.string().nullish(),
5079
- colorfamily: z.string().nullish(),
5080
- fit: z.string().nullish(),
5081
- productcolordescription: z.string().nullish(),
5082
- distributioncentercode: z.string().nullish(),
5083
- accountnumber: z.string().nullish(),
5084
- erpid: z.string().nullish(),
5085
- itemName: z.string().nullish(),
5086
- itemErrorDetails: z.array(itemErrorDetailsV2Schema)
5226
+ var itemErrorDetailsResultV2Schema = external_exports.object({
5227
+ itemInfoId: external_exports.number(),
5228
+ upc: external_exports.string().nullish(),
5229
+ isbn: external_exports.string().nullish(),
5230
+ gtin: external_exports.string().nullish(),
5231
+ partnumber: external_exports.string().nullish(),
5232
+ ean: external_exports.string().nullish(),
5233
+ colorfamily: external_exports.string().nullish(),
5234
+ fit: external_exports.string().nullish(),
5235
+ productcolordescription: external_exports.string().nullish(),
5236
+ distributioncentercode: external_exports.string().nullish(),
5237
+ accountnumber: external_exports.string().nullish(),
5238
+ erpid: external_exports.string().nullish(),
5239
+ itemName: external_exports.string().nullish(),
5240
+ itemErrorDetails: external_exports.array(itemErrorDetailsV2Schema)
5087
5241
  });
5088
5242
 
5089
5243
  // lib/companies/models/CompanyBriefByOrg.ts
5090
- var companyBriefByOrgSchema = z.object({
5091
- companyId: z.number(),
5092
- name: z.string(),
5093
- orgId: z.string(),
5094
- companyType: z.object({
5095
- type: z.enum(["SUPPLIER", "RETAILER"]),
5096
- display: z.enum(["SUPPLIER", "RETAILER"])
5244
+ var companyBriefByOrgSchema = external_exports.object({
5245
+ companyId: external_exports.number(),
5246
+ name: external_exports.string(),
5247
+ orgId: external_exports.string(),
5248
+ companyType: external_exports.object({
5249
+ type: external_exports.enum(["SUPPLIER", "RETAILER"]),
5250
+ display: external_exports.enum(["SUPPLIER", "RETAILER"])
5097
5251
  }),
5098
- dc4Id: z.number()
5252
+ dc4Id: external_exports.number()
5099
5253
  });
5100
5254
 
5101
5255
  // lib/items/v1/models/AttributeDetail.ts
5102
- var attributeDetailSchema = z.object({
5256
+ var attributeDetailSchema = external_exports.object({
5103
5257
  type: attrDatatypeNameEnumSchema,
5104
- name: z.string(),
5105
- value: z.string().or(z.number()).or(z.array(z.string())).or(z.array(z.number())).nullable(),
5106
- label: z.string(),
5107
- group: z.string(),
5108
- orderBy: z.number().or(z.string()).nullish()
5258
+ name: external_exports.string(),
5259
+ value: external_exports.string().or(external_exports.number()).or(external_exports.array(external_exports.string())).or(external_exports.array(external_exports.number())).nullable(),
5260
+ label: external_exports.string(),
5261
+ group: external_exports.string(),
5262
+ orderBy: external_exports.number().or(external_exports.string()).nullish()
5109
5263
  });
5110
5264
 
5111
5265
  // lib/items/v1/models/CategoryEnum.ts
5112
- var categoryEnumSchema = z.enum([
5266
+ var categoryEnumSchema = external_exports.enum([
5113
5267
  "ALIAS",
5114
5268
  "CATALOG",
5115
5269
  "EXPORT",
@@ -5122,212 +5276,212 @@ var categoryEnumSchema = z.enum([
5122
5276
  ]);
5123
5277
 
5124
5278
  // lib/items/v1/models/ComponentDetails.ts
5125
- var componentDetailsSchema = z.object({
5126
- itemInfoId: z.number(),
5127
- description: z.string().nullish(),
5128
- saleable: z.boolean(),
5129
- valid: z.boolean(),
5130
- uniqueCriteria: z.array(
5131
- z.object({
5132
- name: z.string(),
5133
- value: z.string()
5279
+ var componentDetailsSchema = external_exports.object({
5280
+ itemInfoId: external_exports.number(),
5281
+ description: external_exports.string().nullish(),
5282
+ saleable: external_exports.boolean(),
5283
+ valid: external_exports.boolean(),
5284
+ uniqueCriteria: external_exports.array(
5285
+ external_exports.object({
5286
+ name: external_exports.string(),
5287
+ value: external_exports.string()
5134
5288
  })
5135
5289
  )
5136
5290
  });
5137
5291
 
5138
5292
  // lib/items/v1/models/RepeatableGroup.ts
5139
- var repeatableGroupSchema = z.object({
5140
- repeatableGroupId: z.string(),
5141
- repeatableNumber: z.number()
5293
+ var repeatableGroupSchema = external_exports.object({
5294
+ repeatableGroupId: external_exports.string(),
5295
+ repeatableNumber: external_exports.number()
5142
5296
  });
5143
5297
 
5144
5298
  // lib/items/v1/models/GroupedAttributeList.ts
5145
- var groupedAttributeListSchema = z.object({
5146
- type: z.string(),
5147
- rows: z.array(z.array(attributeDetailSchema)),
5148
- repeatableGroups: z.array(repeatableGroupSchema)
5299
+ var groupedAttributeListSchema = external_exports.object({
5300
+ type: external_exports.string(),
5301
+ rows: external_exports.array(external_exports.array(attributeDetailSchema)),
5302
+ repeatableGroups: external_exports.array(repeatableGroupSchema)
5149
5303
  });
5150
5304
 
5151
5305
  // lib/items/v1/models/GroupedAttributes.ts
5152
- var groupedAttributesSchema = z.object({
5153
- type: z.string(),
5154
- attributes: z.array(attributeDetailSchema),
5155
- attributeGroups: z.array(groupedAttributeListSchema)
5306
+ var groupedAttributesSchema = external_exports.object({
5307
+ type: external_exports.string(),
5308
+ attributes: external_exports.array(attributeDetailSchema),
5309
+ attributeGroups: external_exports.array(groupedAttributeListSchema)
5156
5310
  });
5157
5311
 
5158
5312
  // lib/items/v1/models/HierarchyCategory.ts
5159
- var hierarchyCategorySchema = z.object({
5160
- name: z.string(),
5161
- description: z.string().nullish(),
5162
- id: z.number(),
5163
- companyId: z.number().nullish(),
5313
+ var hierarchyCategorySchema = external_exports.object({
5314
+ name: external_exports.string(),
5315
+ description: external_exports.string().nullish(),
5316
+ id: external_exports.number(),
5317
+ companyId: external_exports.number().nullish(),
5164
5318
  type: categoryEnumSchema
5165
5319
  });
5166
5320
 
5167
5321
  // lib/items/v1/models/HierarchyDetails.ts
5168
- var hierarchyDetailsSchema = z.object({
5169
- catalogs: z.array(hierarchyCategorySchema),
5170
- selectionCodes: z.array(hierarchyCategorySchema),
5171
- productCodes: z.array(hierarchyCategorySchema)
5322
+ var hierarchyDetailsSchema = external_exports.object({
5323
+ catalogs: external_exports.array(hierarchyCategorySchema),
5324
+ selectionCodes: external_exports.array(hierarchyCategorySchema),
5325
+ productCodes: external_exports.array(hierarchyCategorySchema)
5172
5326
  });
5173
5327
 
5174
5328
  // lib/items/v1/models/PackComponentItemInfo.ts
5175
- var packComponentItemInfoSchema = z.object({
5176
- companyid: z.number(),
5177
- createddate: z.number(),
5178
- isServiceApi: z.boolean(),
5179
- isactive: z.number(),
5180
- isvalid: z.number(),
5181
- itemType: z.string(),
5182
- iteminfoid: z.number(),
5183
- itemtimestamp: z.number(),
5184
- serviceId: z.number(),
5185
- attributes: z.record(z.string(), z.string().or(z.array(z.string())))
5329
+ var packComponentItemInfoSchema = external_exports.object({
5330
+ companyid: external_exports.number(),
5331
+ createddate: external_exports.number(),
5332
+ isServiceApi: external_exports.boolean(),
5333
+ isactive: external_exports.number(),
5334
+ isvalid: external_exports.number(),
5335
+ itemType: external_exports.string(),
5336
+ iteminfoid: external_exports.number(),
5337
+ itemtimestamp: external_exports.number(),
5338
+ serviceId: external_exports.number(),
5339
+ attributes: external_exports.record(external_exports.string(), external_exports.string().or(external_exports.array(external_exports.string())))
5186
5340
  });
5187
5341
 
5188
5342
  // lib/items/v1/models/ItemPrice.ts
5189
- var itemPriceSchema = z.object({
5190
- amount: z.number(),
5191
- currency: z.string(),
5192
- id: z.number().nullish(),
5193
- priceDivision: z.string().nullish(),
5194
- iteminfoid: z.number().nullish(),
5195
- startdate: z.string().nullish(),
5196
- enddate: z.string().nullish(),
5197
- qualifier: z.string(),
5198
- region: z.string().nullish(),
5199
- regionqualifier: z.string().nullish(),
5200
- regiondescription: z.string().nullish(),
5201
- partnercompanyid: z.string().nullish(),
5202
- itempricetimestamp: z.number().nullish(),
5203
- range_type: z.string().nullish(),
5204
- date_range_type: z.string().nullish(),
5205
- min_range: z.number().nullish(),
5206
- gtin: z.string().nullish(),
5207
- priceConditionDescription: z.string().nullish(),
5208
- priceUnitQuantity: z.number().nullish(),
5209
- priceUnitQuantityUOM: z.string().nullish()
5343
+ var itemPriceSchema = external_exports.object({
5344
+ amount: external_exports.number(),
5345
+ currency: external_exports.string(),
5346
+ id: external_exports.number().nullish(),
5347
+ priceDivision: external_exports.string().nullish(),
5348
+ iteminfoid: external_exports.number().nullish(),
5349
+ startdate: external_exports.string().nullish(),
5350
+ enddate: external_exports.string().nullish(),
5351
+ qualifier: external_exports.string(),
5352
+ region: external_exports.string().nullish(),
5353
+ regionqualifier: external_exports.string().nullish(),
5354
+ regiondescription: external_exports.string().nullish(),
5355
+ partnercompanyid: external_exports.string().nullish(),
5356
+ itempricetimestamp: external_exports.number().nullish(),
5357
+ range_type: external_exports.string().nullish(),
5358
+ date_range_type: external_exports.string().nullish(),
5359
+ min_range: external_exports.number().nullish(),
5360
+ gtin: external_exports.string().nullish(),
5361
+ priceConditionDescription: external_exports.string().nullish(),
5362
+ priceUnitQuantity: external_exports.number().nullish(),
5363
+ priceUnitQuantityUOM: external_exports.string().nullish()
5210
5364
  });
5211
5365
 
5212
5366
  // lib/items/v1/models/PackComponentDetails.ts
5213
- var packComponentDetailsSchema = z.object({
5367
+ var packComponentDetailsSchema = external_exports.object({
5214
5368
  itemInfo: packComponentItemInfoSchema,
5215
- itemPrices: z.array(itemPriceSchema)
5369
+ itemPrices: external_exports.array(itemPriceSchema)
5216
5370
  });
5217
5371
 
5218
5372
  // lib/items/v1/models/GroupedItem.ts
5219
- var groupedItemSchema = z.object({
5220
- iteminfoid: z.number(),
5221
- companyid: z.number(),
5222
- status: z.string(),
5223
- createdDate: z.string(),
5224
- lastUpdatedDate: z.string(),
5225
- identifiers: z.record(z.string(), z.any()),
5373
+ var groupedItemSchema = external_exports.object({
5374
+ iteminfoid: external_exports.number(),
5375
+ companyid: external_exports.number(),
5376
+ status: external_exports.string(),
5377
+ createdDate: external_exports.string(),
5378
+ lastUpdatedDate: external_exports.string(),
5379
+ identifiers: external_exports.record(external_exports.string(), external_exports.any()),
5226
5380
  hierarchyDetails: hierarchyDetailsSchema,
5227
- groupedAttributes: z.array(groupedAttributesSchema),
5228
- packComponentDetails: z.array(packComponentDetailsSchema),
5229
- childComponentDetails: z.array(componentDetailsSchema),
5230
- parentComponentDetails: z.array(componentDetailsSchema),
5231
- locales: z.array(z.string())
5381
+ groupedAttributes: external_exports.array(groupedAttributesSchema),
5382
+ packComponentDetails: external_exports.array(packComponentDetailsSchema),
5383
+ childComponentDetails: external_exports.array(componentDetailsSchema),
5384
+ parentComponentDetails: external_exports.array(componentDetailsSchema),
5385
+ locales: external_exports.array(external_exports.string())
5232
5386
  });
5233
5387
 
5234
5388
  // lib/items/v1/models/ItemDetailView.ts
5235
- var itemDetailViewSchema = z.object({
5389
+ var itemDetailViewSchema = external_exports.object({
5236
5390
  item: groupedItemSchema
5237
5391
  });
5238
5392
 
5239
5393
  // lib/items/v1/models/Bulb.ts
5240
- var bulbSchema = z.object({
5241
- iteminfoid: z.number(),
5242
- id: z.number(),
5243
- shape: z.string(),
5244
- position: z.number(),
5245
- quantity: z.number(),
5246
- basetype: z.string(),
5247
- maxwatt: z.number(),
5248
- createdat: z.string(),
5249
- modifiedat: z.string(),
5250
- bulbtype: z.string(),
5251
- bulbincluded: z.string(),
5252
- bulbsize: z.string(),
5253
- replacementbulb: z.string(),
5254
- threewaybulb: z.string()
5394
+ var bulbSchema = external_exports.object({
5395
+ iteminfoid: external_exports.number(),
5396
+ id: external_exports.number(),
5397
+ shape: external_exports.string(),
5398
+ position: external_exports.number(),
5399
+ quantity: external_exports.number(),
5400
+ basetype: external_exports.string(),
5401
+ maxwatt: external_exports.number(),
5402
+ createdat: external_exports.string(),
5403
+ modifiedat: external_exports.string(),
5404
+ bulbtype: external_exports.string(),
5405
+ bulbincluded: external_exports.string(),
5406
+ bulbsize: external_exports.string(),
5407
+ replacementbulb: external_exports.string(),
5408
+ threewaybulb: external_exports.string()
5255
5409
  });
5256
5410
 
5257
5411
  // lib/items/v1/models/PackComponent.ts
5258
- var packComponentSchema = z.object({
5259
- itemInfoId: z.number().nullish(),
5260
- attributes: z.record(z.string(), z.string().or(z.array(z.string()))),
5261
- prices: z.array(itemPriceSchema)
5412
+ var packComponentSchema = external_exports.object({
5413
+ itemInfoId: external_exports.number().nullish(),
5414
+ attributes: external_exports.record(external_exports.string(), external_exports.string().or(external_exports.array(external_exports.string()))),
5415
+ prices: external_exports.array(itemPriceSchema)
5262
5416
  });
5263
5417
 
5264
5418
  // lib/items/v1/models/MediaItem.ts
5265
- var mediaItemSchema = z.object({
5266
- id: z.number(),
5267
- iteminfoid: z.number(),
5268
- medianame: z.string(),
5269
- height: z.number().nullish(),
5270
- filename: z.string(),
5271
- mediafilename: z.string().nullish(),
5272
- description: z.string().nullish(),
5273
- filesize: z.number().nullish(),
5274
- format: z.string().nullish(),
5275
- orientation: z.string().nullish(),
5276
- pixeldensity: z.string().nullish(),
5277
- purpose: z.string().nullish(),
5278
- width: z.number().nullish(),
5279
- mediatype: z.string(),
5280
- mediaviewtype: z.string().nullish(),
5281
- compressionquality: z.string().nullish(),
5282
- thumbnailflag: z.string().nullish()
5419
+ var mediaItemSchema = external_exports.object({
5420
+ id: external_exports.number(),
5421
+ iteminfoid: external_exports.number(),
5422
+ medianame: external_exports.string(),
5423
+ height: external_exports.number().nullish(),
5424
+ filename: external_exports.string(),
5425
+ mediafilename: external_exports.string().nullish(),
5426
+ description: external_exports.string().nullish(),
5427
+ filesize: external_exports.number().nullish(),
5428
+ format: external_exports.string().nullish(),
5429
+ orientation: external_exports.string().nullish(),
5430
+ pixeldensity: external_exports.string().nullish(),
5431
+ purpose: external_exports.string().nullish(),
5432
+ width: external_exports.number().nullish(),
5433
+ mediatype: external_exports.string(),
5434
+ mediaviewtype: external_exports.string().nullish(),
5435
+ compressionquality: external_exports.string().nullish(),
5436
+ thumbnailflag: external_exports.string().nullish()
5283
5437
  });
5284
5438
 
5285
5439
  // lib/items/v1/models/ItemDetail.ts
5286
- var itemDetailSchema = z.object({
5287
- attributes: z.record(z.string(), z.any()),
5288
- clusters: z.record(
5289
- z.string(),
5290
- z.array(
5291
- z.object({
5292
- itemInfoAttributes: z.record(
5293
- z.string(),
5294
- z.string().or(z.number()).or(z.boolean())
5440
+ var itemDetailSchema = external_exports.object({
5441
+ attributes: external_exports.record(external_exports.string(), external_exports.any()),
5442
+ clusters: external_exports.record(
5443
+ external_exports.string(),
5444
+ external_exports.array(
5445
+ external_exports.object({
5446
+ itemInfoAttributes: external_exports.record(
5447
+ external_exports.string(),
5448
+ external_exports.string().or(external_exports.number()).or(external_exports.boolean())
5295
5449
  )
5296
5450
  })
5297
5451
  )
5298
5452
  ),
5299
- prices: z.array(itemPriceSchema),
5300
- bulbs: z.array(bulbSchema),
5301
- media: z.array(mediaItemSchema),
5302
- packs: z.array(packComponentSchema)
5453
+ prices: external_exports.array(itemPriceSchema),
5454
+ bulbs: external_exports.array(bulbSchema),
5455
+ media: external_exports.array(mediaItemSchema),
5456
+ packs: external_exports.array(packComponentSchema)
5303
5457
  });
5304
5458
 
5305
5459
  // lib/items/v1/models/SpsItemIdResponse.ts
5306
- var spsItemIdResponseSchema = z.object({
5307
- id: z.string(),
5308
- ref: z.string()
5460
+ var spsItemIdResponseSchema = external_exports.object({
5461
+ id: external_exports.string(),
5462
+ ref: external_exports.string()
5309
5463
  });
5310
5464
 
5311
5465
  // lib/items/v1/models/ItemOrgStatus.ts
5312
- var itemOrgStatusSchema = z.object({
5313
- org: z.object({
5314
- ref: z.string(),
5315
- id: z.string(),
5316
- name: z.string()
5466
+ var itemOrgStatusSchema = external_exports.object({
5467
+ org: external_exports.object({
5468
+ ref: external_exports.string(),
5469
+ id: external_exports.string(),
5470
+ name: external_exports.string()
5317
5471
  }),
5318
5472
  lowestInvalidStage: phaseEnumSchema.nullable(),
5319
- validForRelationship: z.boolean()
5473
+ validForRelationship: external_exports.boolean()
5320
5474
  });
5321
5475
 
5322
5476
  // lib/items/v1/models/ItemStatus.ts
5323
- var itemStatusSchema = z.object({
5324
- itemId: z.string(),
5325
- itemOrgStatuses: z.array(itemOrgStatusSchema)
5477
+ var itemStatusSchema = external_exports.object({
5478
+ itemId: external_exports.string(),
5479
+ itemOrgStatuses: external_exports.array(itemOrgStatusSchema)
5326
5480
  });
5327
5481
 
5328
5482
  // lib/items/v1/models/ItemStatusResponse.ts
5329
- var itemStatusResponseSchema = z.object({
5330
- itemStatuses: z.array(itemStatusSchema)
5483
+ var itemStatusResponseSchema = external_exports.object({
5484
+ itemStatuses: external_exports.array(itemStatusSchema)
5331
5485
  });
5332
5486
 
5333
5487
  // lib/items/v1/index.ts
@@ -5352,7 +5506,10 @@ function createItemsApi(client) {
5352
5506
  return itemDetailViewSchema.parse(data);
5353
5507
  }
5354
5508
  async function updateItem(itemId, item) {
5355
- await client.put(`${BASE_URL13}/details/${itemId}`, { json: { ...item } }).json();
5509
+ await client.put(`${BASE_URL13}/details/${itemId}`, {
5510
+ json: { ...item },
5511
+ timeout: 45e3
5512
+ }).json();
5356
5513
  }
5357
5514
  async function deleteItem(itemId) {
5358
5515
  await client.delete(`${BASE_URL13}/${itemId}`);
@@ -5366,7 +5523,7 @@ function createItemsApi(client) {
5366
5523
  }
5367
5524
  async function getItemInfoId(spsItemId, signal) {
5368
5525
  const data = await client.get(`${BASE_URL13}/${spsItemId}/itemInfoId`, { signal }).json();
5369
- return z.number().parse(data);
5526
+ return external_exports.number().parse(data);
5370
5527
  }
5371
5528
  async function getSpsItemId(itemInfoId, signal) {
5372
5529
  const data = await client.get(`${BASE_URL13}/${itemInfoId}/spsItemId`, { signal }).json();
@@ -5467,7 +5624,7 @@ var FlattenedItemIdentifierKeys = [
5467
5624
  "erpId",
5468
5625
  "componentId"
5469
5626
  ];
5470
- var FlattenedItemIdentifierKeysSchema = z.enum(
5627
+ var FlattenedItemIdentifierKeysSchema = external_exports.enum(
5471
5628
  FlattenedItemIdentifierKeys
5472
5629
  );
5473
5630
 
@@ -5479,14 +5636,14 @@ function createUniqueCriteriaApi(client) {
5479
5636
  searchParams: params,
5480
5637
  signal
5481
5638
  }).json();
5482
- return z.array(z.string()).parse(data);
5639
+ return external_exports.array(external_exports.string()).parse(data);
5483
5640
  }
5484
5641
  async function getProductUniqueCriteriaByOrg(params, signal) {
5485
5642
  const data = await client.get(`${BASE_URL17}/product/org`, {
5486
5643
  searchParams: params,
5487
5644
  signal
5488
5645
  }).json();
5489
- return z.array(FlattenedItemIdentifierKeysSchema).parse(data);
5646
+ return external_exports.array(FlattenedItemIdentifierKeysSchema).parse(data);
5490
5647
  }
5491
5648
  return { getUniqueCriteriaByOrg, getProductUniqueCriteriaByOrg };
5492
5649
  }