instill-sdk 0.19.0-rc.2 → 0.19.0-rc.20

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.mjs CHANGED
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/main/index.ts
2
8
  import "whatwg-fetch";
3
9
 
@@ -1130,10 +1136,123 @@ var CreditClient = class extends APIResource {
1130
1136
  }
1131
1137
  };
1132
1138
 
1133
- // ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
1139
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/external.js
1140
+ var external_exports = {};
1141
+ __export(external_exports, {
1142
+ BRAND: () => BRAND,
1143
+ DIRTY: () => DIRTY,
1144
+ EMPTY_PATH: () => EMPTY_PATH,
1145
+ INVALID: () => INVALID,
1146
+ NEVER: () => NEVER,
1147
+ OK: () => OK,
1148
+ ParseStatus: () => ParseStatus,
1149
+ Schema: () => ZodType,
1150
+ ZodAny: () => ZodAny,
1151
+ ZodArray: () => ZodArray,
1152
+ ZodBigInt: () => ZodBigInt,
1153
+ ZodBoolean: () => ZodBoolean,
1154
+ ZodBranded: () => ZodBranded,
1155
+ ZodCatch: () => ZodCatch,
1156
+ ZodDate: () => ZodDate,
1157
+ ZodDefault: () => ZodDefault,
1158
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
1159
+ ZodEffects: () => ZodEffects,
1160
+ ZodEnum: () => ZodEnum,
1161
+ ZodError: () => ZodError,
1162
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
1163
+ ZodFunction: () => ZodFunction,
1164
+ ZodIntersection: () => ZodIntersection,
1165
+ ZodIssueCode: () => ZodIssueCode,
1166
+ ZodLazy: () => ZodLazy,
1167
+ ZodLiteral: () => ZodLiteral,
1168
+ ZodMap: () => ZodMap,
1169
+ ZodNaN: () => ZodNaN,
1170
+ ZodNativeEnum: () => ZodNativeEnum,
1171
+ ZodNever: () => ZodNever,
1172
+ ZodNull: () => ZodNull,
1173
+ ZodNullable: () => ZodNullable,
1174
+ ZodNumber: () => ZodNumber,
1175
+ ZodObject: () => ZodObject,
1176
+ ZodOptional: () => ZodOptional,
1177
+ ZodParsedType: () => ZodParsedType,
1178
+ ZodPipeline: () => ZodPipeline,
1179
+ ZodPromise: () => ZodPromise,
1180
+ ZodReadonly: () => ZodReadonly,
1181
+ ZodRecord: () => ZodRecord,
1182
+ ZodSchema: () => ZodType,
1183
+ ZodSet: () => ZodSet,
1184
+ ZodString: () => ZodString,
1185
+ ZodSymbol: () => ZodSymbol,
1186
+ ZodTransformer: () => ZodEffects,
1187
+ ZodTuple: () => ZodTuple,
1188
+ ZodType: () => ZodType,
1189
+ ZodUndefined: () => ZodUndefined,
1190
+ ZodUnion: () => ZodUnion,
1191
+ ZodUnknown: () => ZodUnknown,
1192
+ ZodVoid: () => ZodVoid,
1193
+ addIssueToContext: () => addIssueToContext,
1194
+ any: () => anyType,
1195
+ array: () => arrayType,
1196
+ bigint: () => bigIntType,
1197
+ boolean: () => booleanType,
1198
+ coerce: () => coerce,
1199
+ custom: () => custom,
1200
+ date: () => dateType,
1201
+ datetimeRegex: () => datetimeRegex,
1202
+ defaultErrorMap: () => en_default,
1203
+ discriminatedUnion: () => discriminatedUnionType,
1204
+ effect: () => effectsType,
1205
+ enum: () => enumType,
1206
+ function: () => functionType,
1207
+ getErrorMap: () => getErrorMap,
1208
+ getParsedType: () => getParsedType,
1209
+ instanceof: () => instanceOfType,
1210
+ intersection: () => intersectionType,
1211
+ isAborted: () => isAborted,
1212
+ isAsync: () => isAsync,
1213
+ isDirty: () => isDirty,
1214
+ isValid: () => isValid,
1215
+ late: () => late,
1216
+ lazy: () => lazyType,
1217
+ literal: () => literalType,
1218
+ makeIssue: () => makeIssue,
1219
+ map: () => mapType,
1220
+ nan: () => nanType,
1221
+ nativeEnum: () => nativeEnumType,
1222
+ never: () => neverType,
1223
+ null: () => nullType,
1224
+ nullable: () => nullableType,
1225
+ number: () => numberType,
1226
+ object: () => objectType,
1227
+ objectUtil: () => objectUtil,
1228
+ oboolean: () => oboolean,
1229
+ onumber: () => onumber,
1230
+ optional: () => optionalType,
1231
+ ostring: () => ostring,
1232
+ pipeline: () => pipelineType,
1233
+ preprocess: () => preprocessType,
1234
+ promise: () => promiseType,
1235
+ quotelessJson: () => quotelessJson,
1236
+ record: () => recordType,
1237
+ set: () => setType,
1238
+ setErrorMap: () => setErrorMap,
1239
+ strictObject: () => strictObjectType,
1240
+ string: () => stringType,
1241
+ symbol: () => symbolType,
1242
+ transformer: () => effectsType,
1243
+ tuple: () => tupleType,
1244
+ undefined: () => undefinedType,
1245
+ union: () => unionType,
1246
+ unknown: () => unknownType,
1247
+ util: () => util,
1248
+ void: () => voidType
1249
+ });
1250
+
1251
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/util.js
1134
1252
  var util;
1135
1253
  (function(util2) {
1136
- util2.assertEqual = (val) => val;
1254
+ util2.assertEqual = (_) => {
1255
+ };
1137
1256
  function assertIs(_arg) {
1138
1257
  }
1139
1258
  util2.assertIs = assertIs;
@@ -1177,7 +1296,7 @@ var util;
1177
1296
  }
1178
1297
  return void 0;
1179
1298
  };
1180
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
1299
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
1181
1300
  function joinValues(array, separator = " | ") {
1182
1301
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
1183
1302
  }
@@ -1229,7 +1348,7 @@ var getParsedType = (data) => {
1229
1348
  case "string":
1230
1349
  return ZodParsedType.string;
1231
1350
  case "number":
1232
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
1351
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
1233
1352
  case "boolean":
1234
1353
  return ZodParsedType.boolean;
1235
1354
  case "function":
@@ -1262,6 +1381,8 @@ var getParsedType = (data) => {
1262
1381
  return ZodParsedType.unknown;
1263
1382
  }
1264
1383
  };
1384
+
1385
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/ZodError.js
1265
1386
  var ZodIssueCode = util.arrayToEnum([
1266
1387
  "invalid_type",
1267
1388
  "invalid_literal",
@@ -1285,6 +1406,9 @@ var quotelessJson = (obj) => {
1285
1406
  return json.replace(/"([^"]+)":/g, "$1:");
1286
1407
  };
1287
1408
  var ZodError = class _ZodError extends Error {
1409
+ get errors() {
1410
+ return this.issues;
1411
+ }
1288
1412
  constructor(issues) {
1289
1413
  super();
1290
1414
  this.issues = [];
@@ -1303,9 +1427,6 @@ var ZodError = class _ZodError extends Error {
1303
1427
  this.name = "ZodError";
1304
1428
  this.issues = issues;
1305
1429
  }
1306
- get errors() {
1307
- return this.issues;
1308
- }
1309
1430
  format(_mapper) {
1310
1431
  const mapper = _mapper || function(issue) {
1311
1432
  return issue.message;
@@ -1377,6 +1498,8 @@ ZodError.create = (issues) => {
1377
1498
  const error = new ZodError(issues);
1378
1499
  return error;
1379
1500
  };
1501
+
1502
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/locales/en.js
1380
1503
  var errorMap = (issue, _ctx) => {
1381
1504
  let message;
1382
1505
  switch (issue.code) {
@@ -1475,13 +1598,18 @@ var errorMap = (issue, _ctx) => {
1475
1598
  }
1476
1599
  return { message };
1477
1600
  };
1478
- var overrideErrorMap = errorMap;
1601
+ var en_default = errorMap;
1602
+
1603
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/errors.js
1604
+ var overrideErrorMap = en_default;
1479
1605
  function setErrorMap(map) {
1480
1606
  overrideErrorMap = map;
1481
1607
  }
1482
1608
  function getErrorMap() {
1483
1609
  return overrideErrorMap;
1484
1610
  }
1611
+
1612
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
1485
1613
  var makeIssue = (params) => {
1486
1614
  const { data, path, errorMaps, issueData } = params;
1487
1615
  const fullPath = [...path, ...issueData.path || []];
@@ -1516,9 +1644,12 @@ function addIssueToContext(ctx, issueData) {
1516
1644
  path: ctx.path,
1517
1645
  errorMaps: [
1518
1646
  ctx.common.contextualErrorMap,
1647
+ // contextual error map is first priority
1519
1648
  ctx.schemaErrorMap,
1649
+ // then schema-bound map if available
1520
1650
  overrideMap,
1521
- overrideMap === errorMap ? void 0 : errorMap
1651
+ // then global override map
1652
+ overrideMap === en_default ? void 0 : en_default
1522
1653
  // then global default map
1523
1654
  ].filter((x) => !!x)
1524
1655
  });
@@ -1587,24 +1718,15 @@ var isAborted = (x) => x.status === "aborted";
1587
1718
  var isDirty = (x) => x.status === "dirty";
1588
1719
  var isValid = (x) => x.status === "valid";
1589
1720
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
1590
- function __classPrivateFieldGet(receiver, state, kind, f) {
1591
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1592
- 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");
1593
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1594
- }
1595
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
1596
- if (kind === "m") throw new TypeError("Private method is not writable");
1597
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1598
- 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");
1599
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
1600
- }
1721
+
1722
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
1601
1723
  var errorUtil;
1602
1724
  (function(errorUtil2) {
1603
1725
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1604
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
1726
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
1605
1727
  })(errorUtil || (errorUtil = {}));
1606
- var _ZodEnum_cache;
1607
- var _ZodNativeEnum_cache;
1728
+
1729
+ // ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/types.js
1608
1730
  var ParseInputLazyPath = class {
1609
1731
  constructor(parent, value, path, key) {
1610
1732
  this._cachedPath = [];
@@ -1615,7 +1737,7 @@ var ParseInputLazyPath = class {
1615
1737
  }
1616
1738
  get path() {
1617
1739
  if (!this._cachedPath.length) {
1618
- if (this._key instanceof Array) {
1740
+ if (Array.isArray(this._key)) {
1619
1741
  this._cachedPath.push(...this._path, ...this._key);
1620
1742
  } else {
1621
1743
  this._cachedPath.push(...this._path, this._key);
@@ -1653,49 +1775,20 @@ function processCreateParams(params) {
1653
1775
  if (errorMap2)
1654
1776
  return { errorMap: errorMap2, description };
1655
1777
  const customMap = (iss, ctx) => {
1656
- var _a, _b;
1657
1778
  const { message } = params;
1658
1779
  if (iss.code === "invalid_enum_value") {
1659
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
1780
+ return { message: message ?? ctx.defaultError };
1660
1781
  }
1661
1782
  if (typeof ctx.data === "undefined") {
1662
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
1783
+ return { message: message ?? required_error ?? ctx.defaultError };
1663
1784
  }
1664
1785
  if (iss.code !== "invalid_type")
1665
1786
  return { message: ctx.defaultError };
1666
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
1787
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
1667
1788
  };
1668
1789
  return { errorMap: customMap, description };
1669
1790
  }
1670
1791
  var ZodType = class {
1671
- constructor(def) {
1672
- this.spa = this.safeParseAsync;
1673
- this._def = def;
1674
- this.parse = this.parse.bind(this);
1675
- this.safeParse = this.safeParse.bind(this);
1676
- this.parseAsync = this.parseAsync.bind(this);
1677
- this.safeParseAsync = this.safeParseAsync.bind(this);
1678
- this.spa = this.spa.bind(this);
1679
- this.refine = this.refine.bind(this);
1680
- this.refinement = this.refinement.bind(this);
1681
- this.superRefine = this.superRefine.bind(this);
1682
- this.optional = this.optional.bind(this);
1683
- this.nullable = this.nullable.bind(this);
1684
- this.nullish = this.nullish.bind(this);
1685
- this.array = this.array.bind(this);
1686
- this.promise = this.promise.bind(this);
1687
- this.or = this.or.bind(this);
1688
- this.and = this.and.bind(this);
1689
- this.transform = this.transform.bind(this);
1690
- this.brand = this.brand.bind(this);
1691
- this.default = this.default.bind(this);
1692
- this.catch = this.catch.bind(this);
1693
- this.describe = this.describe.bind(this);
1694
- this.pipe = this.pipe.bind(this);
1695
- this.readonly = this.readonly.bind(this);
1696
- this.isNullable = this.isNullable.bind(this);
1697
- this.isOptional = this.isOptional.bind(this);
1698
- }
1699
1792
  get description() {
1700
1793
  return this._def.description;
1701
1794
  }
@@ -1743,14 +1836,13 @@ var ZodType = class {
1743
1836
  throw result.error;
1744
1837
  }
1745
1838
  safeParse(data, params) {
1746
- var _a;
1747
1839
  const ctx = {
1748
1840
  common: {
1749
1841
  issues: [],
1750
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
1751
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
1842
+ async: params?.async ?? false,
1843
+ contextualErrorMap: params?.errorMap
1752
1844
  },
1753
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
1845
+ path: params?.path || [],
1754
1846
  schemaErrorMap: this._def.errorMap,
1755
1847
  parent: null,
1756
1848
  data,
@@ -1759,6 +1851,42 @@ var ZodType = class {
1759
1851
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
1760
1852
  return handleResult(ctx, result);
1761
1853
  }
1854
+ "~validate"(data) {
1855
+ const ctx = {
1856
+ common: {
1857
+ issues: [],
1858
+ async: !!this["~standard"].async
1859
+ },
1860
+ path: [],
1861
+ schemaErrorMap: this._def.errorMap,
1862
+ parent: null,
1863
+ data,
1864
+ parsedType: getParsedType(data)
1865
+ };
1866
+ if (!this["~standard"].async) {
1867
+ try {
1868
+ const result = this._parseSync({ data, path: [], parent: ctx });
1869
+ return isValid(result) ? {
1870
+ value: result.value
1871
+ } : {
1872
+ issues: ctx.common.issues
1873
+ };
1874
+ } catch (err) {
1875
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
1876
+ this["~standard"].async = true;
1877
+ }
1878
+ ctx.common = {
1879
+ issues: [],
1880
+ async: true
1881
+ };
1882
+ }
1883
+ }
1884
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
1885
+ value: result.value
1886
+ } : {
1887
+ issues: ctx.common.issues
1888
+ });
1889
+ }
1762
1890
  async parseAsync(data, params) {
1763
1891
  const result = await this.safeParseAsync(data, params);
1764
1892
  if (result.success)
@@ -1769,10 +1897,10 @@ var ZodType = class {
1769
1897
  const ctx = {
1770
1898
  common: {
1771
1899
  issues: [],
1772
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
1900
+ contextualErrorMap: params?.errorMap,
1773
1901
  async: true
1774
1902
  },
1775
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
1903
+ path: params?.path || [],
1776
1904
  schemaErrorMap: this._def.errorMap,
1777
1905
  parent: null,
1778
1906
  data,
@@ -1836,6 +1964,39 @@ var ZodType = class {
1836
1964
  superRefine(refinement) {
1837
1965
  return this._refinement(refinement);
1838
1966
  }
1967
+ constructor(def) {
1968
+ this.spa = this.safeParseAsync;
1969
+ this._def = def;
1970
+ this.parse = this.parse.bind(this);
1971
+ this.safeParse = this.safeParse.bind(this);
1972
+ this.parseAsync = this.parseAsync.bind(this);
1973
+ this.safeParseAsync = this.safeParseAsync.bind(this);
1974
+ this.spa = this.spa.bind(this);
1975
+ this.refine = this.refine.bind(this);
1976
+ this.refinement = this.refinement.bind(this);
1977
+ this.superRefine = this.superRefine.bind(this);
1978
+ this.optional = this.optional.bind(this);
1979
+ this.nullable = this.nullable.bind(this);
1980
+ this.nullish = this.nullish.bind(this);
1981
+ this.array = this.array.bind(this);
1982
+ this.promise = this.promise.bind(this);
1983
+ this.or = this.or.bind(this);
1984
+ this.and = this.and.bind(this);
1985
+ this.transform = this.transform.bind(this);
1986
+ this.brand = this.brand.bind(this);
1987
+ this.default = this.default.bind(this);
1988
+ this.catch = this.catch.bind(this);
1989
+ this.describe = this.describe.bind(this);
1990
+ this.pipe = this.pipe.bind(this);
1991
+ this.readonly = this.readonly.bind(this);
1992
+ this.isNullable = this.isNullable.bind(this);
1993
+ this.isOptional = this.isOptional.bind(this);
1994
+ this["~standard"] = {
1995
+ version: 1,
1996
+ vendor: "zod",
1997
+ validate: (data) => this["~validate"](data)
1998
+ };
1999
+ }
1839
2000
  optional() {
1840
2001
  return ZodOptional.create(this, this._def);
1841
2002
  }
@@ -1846,7 +2007,7 @@ var ZodType = class {
1846
2007
  return this.nullable().optional();
1847
2008
  }
1848
2009
  array() {
1849
- return ZodArray.create(this, this._def);
2010
+ return ZodArray.create(this);
1850
2011
  }
1851
2012
  promise() {
1852
2013
  return ZodPromise.create(this, this._def);
@@ -1912,26 +2073,31 @@ var ZodType = class {
1912
2073
  };
1913
2074
  var cuidRegex = /^c[^\s-]{8,}$/i;
1914
2075
  var cuid2Regex = /^[0-9a-z]+$/;
1915
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
2076
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
1916
2077
  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;
1917
2078
  var nanoidRegex = /^[a-z0-9_-]{21}$/i;
2079
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
1918
2080
  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)?)??$/;
1919
2081
  var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
1920
2082
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
1921
2083
  var emojiRegex;
1922
2084
  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])$/;
1923
- 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})))$/;
2085
+ 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])$/;
2086
+ 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]))$/;
2087
+ 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])$/;
1924
2088
  var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
2089
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
1925
2090
  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])))`;
1926
2091
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
1927
2092
  function timeRegexSource(args) {
1928
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
2093
+ let secondsRegexSource = `[0-5]\\d`;
1929
2094
  if (args.precision) {
1930
- regex = `${regex}\\.\\d{${args.precision}}`;
2095
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
1931
2096
  } else if (args.precision == null) {
1932
- regex = `${regex}(\\.\\d+)?`;
2097
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
1933
2098
  }
1934
- return regex;
2099
+ const secondsQuantifier = args.precision ? "+" : "?";
2100
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
1935
2101
  }
1936
2102
  function timeRegex(args) {
1937
2103
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -1954,6 +2120,35 @@ function isValidIP(ip, version) {
1954
2120
  }
1955
2121
  return false;
1956
2122
  }
2123
+ function isValidJWT(jwt, alg) {
2124
+ if (!jwtRegex.test(jwt))
2125
+ return false;
2126
+ try {
2127
+ const [header] = jwt.split(".");
2128
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
2129
+ const decoded = JSON.parse(atob(base64));
2130
+ if (typeof decoded !== "object" || decoded === null)
2131
+ return false;
2132
+ if ("typ" in decoded && decoded?.typ !== "JWT")
2133
+ return false;
2134
+ if (!decoded.alg)
2135
+ return false;
2136
+ if (alg && decoded.alg !== alg)
2137
+ return false;
2138
+ return true;
2139
+ } catch {
2140
+ return false;
2141
+ }
2142
+ }
2143
+ function isValidCidr(ip, version) {
2144
+ if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
2145
+ return true;
2146
+ }
2147
+ if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
2148
+ return true;
2149
+ }
2150
+ return false;
2151
+ }
1957
2152
  var ZodString = class _ZodString extends ZodType {
1958
2153
  _parse(input) {
1959
2154
  if (this._def.coerce) {
@@ -2100,7 +2295,7 @@ var ZodString = class _ZodString extends ZodType {
2100
2295
  } else if (check.kind === "url") {
2101
2296
  try {
2102
2297
  new URL(input.data);
2103
- } catch (_a) {
2298
+ } catch {
2104
2299
  ctx = this._getOrReturnCtx(input, ctx);
2105
2300
  addIssueToContext(ctx, {
2106
2301
  validation: "url",
@@ -2210,6 +2405,26 @@ var ZodString = class _ZodString extends ZodType {
2210
2405
  });
2211
2406
  status.dirty();
2212
2407
  }
2408
+ } else if (check.kind === "jwt") {
2409
+ if (!isValidJWT(input.data, check.alg)) {
2410
+ ctx = this._getOrReturnCtx(input, ctx);
2411
+ addIssueToContext(ctx, {
2412
+ validation: "jwt",
2413
+ code: ZodIssueCode.invalid_string,
2414
+ message: check.message
2415
+ });
2416
+ status.dirty();
2417
+ }
2418
+ } else if (check.kind === "cidr") {
2419
+ if (!isValidCidr(input.data, check.version)) {
2420
+ ctx = this._getOrReturnCtx(input, ctx);
2421
+ addIssueToContext(ctx, {
2422
+ validation: "cidr",
2423
+ code: ZodIssueCode.invalid_string,
2424
+ message: check.message
2425
+ });
2426
+ status.dirty();
2427
+ }
2213
2428
  } else if (check.kind === "base64") {
2214
2429
  if (!base64Regex.test(input.data)) {
2215
2430
  ctx = this._getOrReturnCtx(input, ctx);
@@ -2220,6 +2435,16 @@ var ZodString = class _ZodString extends ZodType {
2220
2435
  });
2221
2436
  status.dirty();
2222
2437
  }
2438
+ } else if (check.kind === "base64url") {
2439
+ if (!base64urlRegex.test(input.data)) {
2440
+ ctx = this._getOrReturnCtx(input, ctx);
2441
+ addIssueToContext(ctx, {
2442
+ validation: "base64url",
2443
+ code: ZodIssueCode.invalid_string,
2444
+ message: check.message
2445
+ });
2446
+ status.dirty();
2447
+ }
2223
2448
  } else {
2224
2449
  util.assertNever(check);
2225
2450
  }
@@ -2266,11 +2491,22 @@ var ZodString = class _ZodString extends ZodType {
2266
2491
  base64(message) {
2267
2492
  return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
2268
2493
  }
2494
+ base64url(message) {
2495
+ return this._addCheck({
2496
+ kind: "base64url",
2497
+ ...errorUtil.errToObj(message)
2498
+ });
2499
+ }
2500
+ jwt(options) {
2501
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
2502
+ }
2269
2503
  ip(options) {
2270
2504
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
2271
2505
  }
2506
+ cidr(options) {
2507
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
2508
+ }
2272
2509
  datetime(options) {
2273
- var _a, _b;
2274
2510
  if (typeof options === "string") {
2275
2511
  return this._addCheck({
2276
2512
  kind: "datetime",
@@ -2282,10 +2518,10 @@ var ZodString = class _ZodString extends ZodType {
2282
2518
  }
2283
2519
  return this._addCheck({
2284
2520
  kind: "datetime",
2285
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2286
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
2287
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
2288
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2521
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
2522
+ offset: options?.offset ?? false,
2523
+ local: options?.local ?? false,
2524
+ ...errorUtil.errToObj(options?.message)
2289
2525
  });
2290
2526
  }
2291
2527
  date(message) {
@@ -2301,8 +2537,8 @@ var ZodString = class _ZodString extends ZodType {
2301
2537
  }
2302
2538
  return this._addCheck({
2303
2539
  kind: "time",
2304
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2305
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2540
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
2541
+ ...errorUtil.errToObj(options?.message)
2306
2542
  });
2307
2543
  }
2308
2544
  duration(message) {
@@ -2319,8 +2555,8 @@ var ZodString = class _ZodString extends ZodType {
2319
2555
  return this._addCheck({
2320
2556
  kind: "includes",
2321
2557
  value,
2322
- position: options === null || options === void 0 ? void 0 : options.position,
2323
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2558
+ position: options?.position,
2559
+ ...errorUtil.errToObj(options?.message)
2324
2560
  });
2325
2561
  }
2326
2562
  startsWith(value, message) {
@@ -2359,8 +2595,7 @@ var ZodString = class _ZodString extends ZodType {
2359
2595
  });
2360
2596
  }
2361
2597
  /**
2362
- * @deprecated Use z.string().min(1) instead.
2363
- * @see {@link ZodString.min}
2598
+ * Equivalent to `.min(1)`
2364
2599
  */
2365
2600
  nonempty(message) {
2366
2601
  return this.min(1, errorUtil.errToObj(message));
@@ -2422,9 +2657,15 @@ var ZodString = class _ZodString extends ZodType {
2422
2657
  get isIP() {
2423
2658
  return !!this._def.checks.find((ch) => ch.kind === "ip");
2424
2659
  }
2660
+ get isCIDR() {
2661
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
2662
+ }
2425
2663
  get isBase64() {
2426
2664
  return !!this._def.checks.find((ch) => ch.kind === "base64");
2427
2665
  }
2666
+ get isBase64url() {
2667
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
2668
+ }
2428
2669
  get minLength() {
2429
2670
  let min = null;
2430
2671
  for (const ch of this._def.checks) {
@@ -2447,11 +2688,10 @@ var ZodString = class _ZodString extends ZodType {
2447
2688
  }
2448
2689
  };
2449
2690
  ZodString.create = (params) => {
2450
- var _a;
2451
2691
  return new ZodString({
2452
2692
  checks: [],
2453
2693
  typeName: ZodFirstPartyTypeKind.ZodString,
2454
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
2694
+ coerce: params?.coerce ?? false,
2455
2695
  ...processCreateParams(params)
2456
2696
  });
2457
2697
  };
@@ -2459,9 +2699,9 @@ function floatSafeRemainder(val, step) {
2459
2699
  const valDecCount = (val.toString().split(".")[1] || "").length;
2460
2700
  const stepDecCount = (step.toString().split(".")[1] || "").length;
2461
2701
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
2462
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
2463
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
2464
- return valInt % stepInt / Math.pow(10, decCount);
2702
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
2703
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
2704
+ return valInt % stepInt / 10 ** decCount;
2465
2705
  }
2466
2706
  var ZodNumber = class _ZodNumber extends ZodType {
2467
2707
  constructor() {
@@ -2671,7 +2911,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
2671
2911
  return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
2672
2912
  }
2673
2913
  get isFinite() {
2674
- let max = null, min = null;
2914
+ let max = null;
2915
+ let min = null;
2675
2916
  for (const ch of this._def.checks) {
2676
2917
  if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
2677
2918
  return true;
@@ -2690,7 +2931,7 @@ ZodNumber.create = (params) => {
2690
2931
  return new ZodNumber({
2691
2932
  checks: [],
2692
2933
  typeName: ZodFirstPartyTypeKind.ZodNumber,
2693
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2934
+ coerce: params?.coerce || false,
2694
2935
  ...processCreateParams(params)
2695
2936
  });
2696
2937
  };
@@ -2702,17 +2943,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
2702
2943
  }
2703
2944
  _parse(input) {
2704
2945
  if (this._def.coerce) {
2705
- input.data = BigInt(input.data);
2946
+ try {
2947
+ input.data = BigInt(input.data);
2948
+ } catch {
2949
+ return this._getInvalidInput(input);
2950
+ }
2706
2951
  }
2707
2952
  const parsedType = this._getType(input);
2708
2953
  if (parsedType !== ZodParsedType.bigint) {
2709
- const ctx2 = this._getOrReturnCtx(input);
2710
- addIssueToContext(ctx2, {
2711
- code: ZodIssueCode.invalid_type,
2712
- expected: ZodParsedType.bigint,
2713
- received: ctx2.parsedType
2714
- });
2715
- return INVALID;
2954
+ return this._getInvalidInput(input);
2716
2955
  }
2717
2956
  let ctx = void 0;
2718
2957
  const status = new ParseStatus();
@@ -2759,6 +2998,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
2759
2998
  }
2760
2999
  return { status: status.value, value: input.data };
2761
3000
  }
3001
+ _getInvalidInput(input) {
3002
+ const ctx = this._getOrReturnCtx(input);
3003
+ addIssueToContext(ctx, {
3004
+ code: ZodIssueCode.invalid_type,
3005
+ expected: ZodParsedType.bigint,
3006
+ received: ctx.parsedType
3007
+ });
3008
+ return INVALID;
3009
+ }
2762
3010
  gte(value, message) {
2763
3011
  return this.setLimit("min", value, true, errorUtil.toString(message));
2764
3012
  }
@@ -2852,11 +3100,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
2852
3100
  }
2853
3101
  };
2854
3102
  ZodBigInt.create = (params) => {
2855
- var _a;
2856
3103
  return new ZodBigInt({
2857
3104
  checks: [],
2858
3105
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2859
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
3106
+ coerce: params?.coerce ?? false,
2860
3107
  ...processCreateParams(params)
2861
3108
  });
2862
3109
  };
@@ -2881,7 +3128,7 @@ var ZodBoolean = class extends ZodType {
2881
3128
  ZodBoolean.create = (params) => {
2882
3129
  return new ZodBoolean({
2883
3130
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
2884
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
3131
+ coerce: params?.coerce || false,
2885
3132
  ...processCreateParams(params)
2886
3133
  });
2887
3134
  };
@@ -2900,7 +3147,7 @@ var ZodDate = class _ZodDate extends ZodType {
2900
3147
  });
2901
3148
  return INVALID;
2902
3149
  }
2903
- if (isNaN(input.data.getTime())) {
3150
+ if (Number.isNaN(input.data.getTime())) {
2904
3151
  const ctx2 = this._getOrReturnCtx(input);
2905
3152
  addIssueToContext(ctx2, {
2906
3153
  code: ZodIssueCode.invalid_date
@@ -2989,7 +3236,7 @@ var ZodDate = class _ZodDate extends ZodType {
2989
3236
  ZodDate.create = (params) => {
2990
3237
  return new ZodDate({
2991
3238
  checks: [],
2992
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
3239
+ coerce: params?.coerce || false,
2993
3240
  typeName: ZodFirstPartyTypeKind.ZodDate,
2994
3241
  ...processCreateParams(params)
2995
3242
  });
@@ -3264,7 +3511,8 @@ var ZodObject = class _ZodObject extends ZodType {
3264
3511
  return this._cached;
3265
3512
  const shape = this._def.shape();
3266
3513
  const keys = util.objectKeys(shape);
3267
- return this._cached = { shape, keys };
3514
+ this._cached = { shape, keys };
3515
+ return this._cached;
3268
3516
  }
3269
3517
  _parse(input) {
3270
3518
  const parsedType = this._getType(input);
@@ -3314,8 +3562,8 @@ var ZodObject = class _ZodObject extends ZodType {
3314
3562
  });
3315
3563
  status.dirty();
3316
3564
  }
3317
- } else if (unknownKeys === "strip") ;
3318
- else {
3565
+ } else if (unknownKeys === "strip") {
3566
+ } else {
3319
3567
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
3320
3568
  }
3321
3569
  } else {
@@ -3362,11 +3610,10 @@ var ZodObject = class _ZodObject extends ZodType {
3362
3610
  unknownKeys: "strict",
3363
3611
  ...message !== void 0 ? {
3364
3612
  errorMap: (issue, ctx) => {
3365
- var _a, _b, _c, _d;
3366
- 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;
3613
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
3367
3614
  if (issue.code === "unrecognized_keys")
3368
3615
  return {
3369
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
3616
+ message: errorUtil.errToObj(message).message ?? defaultError
3370
3617
  };
3371
3618
  return {
3372
3619
  message: defaultError
@@ -3497,11 +3744,11 @@ var ZodObject = class _ZodObject extends ZodType {
3497
3744
  }
3498
3745
  pick(mask) {
3499
3746
  const shape = {};
3500
- util.objectKeys(mask).forEach((key) => {
3747
+ for (const key of util.objectKeys(mask)) {
3501
3748
  if (mask[key] && this.shape[key]) {
3502
3749
  shape[key] = this.shape[key];
3503
3750
  }
3504
- });
3751
+ }
3505
3752
  return new _ZodObject({
3506
3753
  ...this._def,
3507
3754
  shape: () => shape
@@ -3509,11 +3756,11 @@ var ZodObject = class _ZodObject extends ZodType {
3509
3756
  }
3510
3757
  omit(mask) {
3511
3758
  const shape = {};
3512
- util.objectKeys(this.shape).forEach((key) => {
3759
+ for (const key of util.objectKeys(this.shape)) {
3513
3760
  if (!mask[key]) {
3514
3761
  shape[key] = this.shape[key];
3515
3762
  }
3516
- });
3763
+ }
3517
3764
  return new _ZodObject({
3518
3765
  ...this._def,
3519
3766
  shape: () => shape
@@ -3527,14 +3774,14 @@ var ZodObject = class _ZodObject extends ZodType {
3527
3774
  }
3528
3775
  partial(mask) {
3529
3776
  const newShape = {};
3530
- util.objectKeys(this.shape).forEach((key) => {
3777
+ for (const key of util.objectKeys(this.shape)) {
3531
3778
  const fieldSchema = this.shape[key];
3532
3779
  if (mask && !mask[key]) {
3533
3780
  newShape[key] = fieldSchema;
3534
3781
  } else {
3535
3782
  newShape[key] = fieldSchema.optional();
3536
3783
  }
3537
- });
3784
+ }
3538
3785
  return new _ZodObject({
3539
3786
  ...this._def,
3540
3787
  shape: () => newShape
@@ -3542,7 +3789,7 @@ var ZodObject = class _ZodObject extends ZodType {
3542
3789
  }
3543
3790
  required(mask) {
3544
3791
  const newShape = {};
3545
- util.objectKeys(this.shape).forEach((key) => {
3792
+ for (const key of util.objectKeys(this.shape)) {
3546
3793
  if (mask && !mask[key]) {
3547
3794
  newShape[key] = this.shape[key];
3548
3795
  } else {
@@ -3553,7 +3800,7 @@ var ZodObject = class _ZodObject extends ZodType {
3553
3800
  }
3554
3801
  newShape[key] = newField;
3555
3802
  }
3556
- });
3803
+ }
3557
3804
  return new _ZodObject({
3558
3805
  ...this._def,
3559
3806
  shape: () => newShape
@@ -4169,12 +4416,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
4169
4416
  return makeIssue({
4170
4417
  data: args,
4171
4418
  path: ctx.path,
4172
- errorMaps: [
4173
- ctx.common.contextualErrorMap,
4174
- ctx.schemaErrorMap,
4175
- getErrorMap(),
4176
- errorMap
4177
- ].filter((x) => !!x),
4419
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
4178
4420
  issueData: {
4179
4421
  code: ZodIssueCode.invalid_arguments,
4180
4422
  argumentsError: error
@@ -4185,12 +4427,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
4185
4427
  return makeIssue({
4186
4428
  data: returns,
4187
4429
  path: ctx.path,
4188
- errorMaps: [
4189
- ctx.common.contextualErrorMap,
4190
- ctx.schemaErrorMap,
4191
- getErrorMap(),
4192
- errorMap
4193
- ].filter((x) => !!x),
4430
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
4194
4431
  issueData: {
4195
4432
  code: ZodIssueCode.invalid_return_type,
4196
4433
  returnTypeError: error
@@ -4314,10 +4551,6 @@ function createZodEnum(values, params) {
4314
4551
  });
4315
4552
  }
4316
4553
  var ZodEnum = class _ZodEnum extends ZodType {
4317
- constructor() {
4318
- super(...arguments);
4319
- _ZodEnum_cache.set(this, void 0);
4320
- }
4321
4554
  _parse(input) {
4322
4555
  if (typeof input.data !== "string") {
4323
4556
  const ctx = this._getOrReturnCtx(input);
@@ -4329,10 +4562,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
4329
4562
  });
4330
4563
  return INVALID;
4331
4564
  }
4332
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
4333
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
4565
+ if (!this._cache) {
4566
+ this._cache = new Set(this._def.values);
4334
4567
  }
4335
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
4568
+ if (!this._cache.has(input.data)) {
4336
4569
  const ctx = this._getOrReturnCtx(input);
4337
4570
  const expectedValues = this._def.values;
4338
4571
  addIssueToContext(ctx, {
@@ -4381,13 +4614,8 @@ var ZodEnum = class _ZodEnum extends ZodType {
4381
4614
  });
4382
4615
  }
4383
4616
  };
4384
- _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
4385
4617
  ZodEnum.create = createZodEnum;
4386
4618
  var ZodNativeEnum = class extends ZodType {
4387
- constructor() {
4388
- super(...arguments);
4389
- _ZodNativeEnum_cache.set(this, void 0);
4390
- }
4391
4619
  _parse(input) {
4392
4620
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
4393
4621
  const ctx = this._getOrReturnCtx(input);
@@ -4400,10 +4628,10 @@ var ZodNativeEnum = class extends ZodType {
4400
4628
  });
4401
4629
  return INVALID;
4402
4630
  }
4403
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
4404
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
4631
+ if (!this._cache) {
4632
+ this._cache = new Set(util.getValidEnumValues(this._def.values));
4405
4633
  }
4406
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
4634
+ if (!this._cache.has(input.data)) {
4407
4635
  const expectedValues = util.objectValues(nativeEnumValues);
4408
4636
  addIssueToContext(ctx, {
4409
4637
  received: ctx.data,
@@ -4418,7 +4646,6 @@ var ZodNativeEnum = class extends ZodType {
4418
4646
  return this._def.values;
4419
4647
  }
4420
4648
  };
4421
- _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
4422
4649
  ZodNativeEnum.create = (values, params) => {
4423
4650
  return new ZodNativeEnum({
4424
4651
  values,
@@ -4559,7 +4786,7 @@ var ZodEffects = class extends ZodType {
4559
4786
  parent: ctx
4560
4787
  });
4561
4788
  if (!isValid(base))
4562
- return base;
4789
+ return INVALID;
4563
4790
  const result = effect.transform(base.value, checkCtx);
4564
4791
  if (result instanceof Promise) {
4565
4792
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -4568,8 +4795,11 @@ var ZodEffects = class extends ZodType {
4568
4795
  } else {
4569
4796
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
4570
4797
  if (!isValid(base))
4571
- return base;
4572
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
4798
+ return INVALID;
4799
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
4800
+ status: status.value,
4801
+ value: result
4802
+ }));
4573
4803
  });
4574
4804
  }
4575
4805
  }
@@ -4821,16 +5051,30 @@ ZodReadonly.create = (type, params) => {
4821
5051
  ...processCreateParams(params)
4822
5052
  });
4823
5053
  };
4824
- function custom(check, params = {}, fatal) {
5054
+ function cleanParams(params, data) {
5055
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
5056
+ const p2 = typeof p === "string" ? { message: p } : p;
5057
+ return p2;
5058
+ }
5059
+ function custom(check, _params = {}, fatal) {
4825
5060
  if (check)
4826
5061
  return ZodAny.create().superRefine((data, ctx) => {
4827
- var _a, _b;
4828
- if (!check(data)) {
4829
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4830
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
4831
- const p2 = typeof p === "string" ? { message: p } : p;
4832
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
5062
+ const r = check(data);
5063
+ if (r instanceof Promise) {
5064
+ return r.then((r2) => {
5065
+ if (!r2) {
5066
+ const params = cleanParams(_params, data);
5067
+ const _fatal = params.fatal ?? fatal ?? true;
5068
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
5069
+ }
5070
+ });
5071
+ }
5072
+ if (!r) {
5073
+ const params = cleanParams(_params, data);
5074
+ const _fatal = params.fatal ?? fatal ?? true;
5075
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
4833
5076
  }
5077
+ return;
4834
5078
  });
4835
5079
  return ZodAny.create();
4836
5080
  }
@@ -4927,128 +5171,12 @@ var coerce = {
4927
5171
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
4928
5172
  };
4929
5173
  var NEVER = INVALID;
4930
- var z = /* @__PURE__ */ Object.freeze({
4931
- __proto__: null,
4932
- defaultErrorMap: errorMap,
4933
- setErrorMap,
4934
- getErrorMap,
4935
- makeIssue,
4936
- EMPTY_PATH,
4937
- addIssueToContext,
4938
- ParseStatus,
4939
- INVALID,
4940
- DIRTY,
4941
- OK,
4942
- isAborted,
4943
- isDirty,
4944
- isValid,
4945
- isAsync,
4946
- get util() {
4947
- return util;
4948
- },
4949
- get objectUtil() {
4950
- return objectUtil;
4951
- },
4952
- ZodParsedType,
4953
- getParsedType,
4954
- ZodType,
4955
- datetimeRegex,
4956
- ZodString,
4957
- ZodNumber,
4958
- ZodBigInt,
4959
- ZodBoolean,
4960
- ZodDate,
4961
- ZodSymbol,
4962
- ZodUndefined,
4963
- ZodNull,
4964
- ZodAny,
4965
- ZodUnknown,
4966
- ZodNever,
4967
- ZodVoid,
4968
- ZodArray,
4969
- ZodObject,
4970
- ZodUnion,
4971
- ZodDiscriminatedUnion,
4972
- ZodIntersection,
4973
- ZodTuple,
4974
- ZodRecord,
4975
- ZodMap,
4976
- ZodSet,
4977
- ZodFunction,
4978
- ZodLazy,
4979
- ZodLiteral,
4980
- ZodEnum,
4981
- ZodNativeEnum,
4982
- ZodPromise,
4983
- ZodEffects,
4984
- ZodTransformer: ZodEffects,
4985
- ZodOptional,
4986
- ZodNullable,
4987
- ZodDefault,
4988
- ZodCatch,
4989
- ZodNaN,
4990
- BRAND,
4991
- ZodBranded,
4992
- ZodPipeline,
4993
- ZodReadonly,
4994
- custom,
4995
- Schema: ZodType,
4996
- ZodSchema: ZodType,
4997
- late,
4998
- get ZodFirstPartyTypeKind() {
4999
- return ZodFirstPartyTypeKind;
5000
- },
5001
- coerce,
5002
- any: anyType,
5003
- array: arrayType,
5004
- bigint: bigIntType,
5005
- boolean: booleanType,
5006
- date: dateType,
5007
- discriminatedUnion: discriminatedUnionType,
5008
- effect: effectsType,
5009
- "enum": enumType,
5010
- "function": functionType,
5011
- "instanceof": instanceOfType,
5012
- intersection: intersectionType,
5013
- lazy: lazyType,
5014
- literal: literalType,
5015
- map: mapType,
5016
- nan: nanType,
5017
- nativeEnum: nativeEnumType,
5018
- never: neverType,
5019
- "null": nullType,
5020
- nullable: nullableType,
5021
- number: numberType,
5022
- object: objectType,
5023
- oboolean,
5024
- onumber,
5025
- optional: optionalType,
5026
- ostring,
5027
- pipeline: pipelineType,
5028
- preprocess: preprocessType,
5029
- promise: promiseType,
5030
- record: recordType,
5031
- set: setType,
5032
- strictObject: strictObjectType,
5033
- string: stringType,
5034
- symbol: symbolType,
5035
- transformer: effectsType,
5036
- tuple: tupleType,
5037
- "undefined": undefinedType,
5038
- union: unionType,
5039
- unknown: unknownType,
5040
- "void": voidType,
5041
- NEVER,
5042
- ZodIssueCode,
5043
- quotelessJson,
5044
- ZodError
5045
- });
5046
5174
 
5047
5175
  // src/core/credit/types.ts
5048
- var getNamespaceRemainingInstillCreditResponseValidator = z.object({
5049
- perishable: z.number(),
5050
- imperishable: z.number(),
5051
- total: z.number()
5176
+ var getNamespaceRemainingInstillCreditResponseValidator = external_exports.object({
5177
+ perishable: external_exports.number(),
5178
+ imperishable: external_exports.number(),
5179
+ total: external_exports.number()
5052
5180
  });
5053
5181
 
5054
5182
  // src/core/membership/MembershipClient.ts
@@ -5340,94 +5468,94 @@ var UserClient = class extends APIResource {
5340
5468
  };
5341
5469
 
5342
5470
  // src/core/user/types.ts
5343
- var OnboardingStatusSchema = z.enum([
5471
+ var OnboardingStatusSchema = external_exports.enum([
5344
5472
  "ONBOARDING_STATUS_UNSPECIFIED",
5345
5473
  "ONBOARDING_STATUS_IN_PROGRESS",
5346
5474
  "ONBOARDING_STATUS_COMPLETED"
5347
5475
  ]);
5348
- var UserProfileSchema = z.object({
5349
- displayName: z.string().optional(),
5350
- bio: z.string().optional(),
5351
- publicEmail: z.string().optional(),
5352
- companyName: z.string().optional(),
5353
- avatar: z.string().optional(),
5354
- socialProfilesLinks: z.object({
5355
- webiste: z.string().optional(),
5356
- x: z.string().optional(),
5357
- github: z.string().optional()
5476
+ var UserProfileSchema = external_exports.object({
5477
+ displayName: external_exports.string().optional(),
5478
+ bio: external_exports.string().optional(),
5479
+ publicEmail: external_exports.string().optional(),
5480
+ companyName: external_exports.string().optional(),
5481
+ avatar: external_exports.string().optional(),
5482
+ socialProfilesLinks: external_exports.object({
5483
+ webiste: external_exports.string().optional(),
5484
+ x: external_exports.string().optional(),
5485
+ github: external_exports.string().optional()
5358
5486
  }).optional()
5359
5487
  });
5360
- var UserSchema = z.object({
5361
- name: z.string(),
5362
- uid: z.string(),
5363
- id: z.string(),
5364
- createTime: z.string(),
5365
- updateTime: z.string(),
5488
+ var UserSchema = external_exports.object({
5489
+ name: external_exports.string(),
5490
+ uid: external_exports.string(),
5491
+ id: external_exports.string(),
5492
+ createTime: external_exports.string(),
5493
+ updateTime: external_exports.string(),
5366
5494
  profile: UserProfileSchema.optional()
5367
5495
  });
5368
- var AuthenticatedUserSchema = z.object({
5369
- name: z.string(),
5370
- uid: z.string(),
5371
- id: z.string(),
5372
- createTime: z.string(),
5373
- updateTime: z.string(),
5374
- customerId: z.string(),
5375
- email: z.string(),
5376
- newsletterSubscription: z.boolean(),
5377
- role: z.string(),
5496
+ var AuthenticatedUserSchema = external_exports.object({
5497
+ name: external_exports.string(),
5498
+ uid: external_exports.string(),
5499
+ id: external_exports.string(),
5500
+ createTime: external_exports.string(),
5501
+ updateTime: external_exports.string(),
5502
+ customerId: external_exports.string(),
5503
+ email: external_exports.string(),
5504
+ newsletterSubscription: external_exports.boolean(),
5505
+ role: external_exports.string(),
5378
5506
  onboardingStatus: OnboardingStatusSchema,
5379
- cookieToken: z.string().optional(),
5507
+ cookieToken: external_exports.string().optional(),
5380
5508
  profile: UserProfileSchema.optional()
5381
5509
  });
5382
- var listUsersWithPaginationResponseValidator = z.object({
5383
- users: z.array(UserSchema),
5384
- nextPageToken: z.string(),
5385
- totalSize: z.number()
5510
+ var listUsersWithPaginationResponseValidator = external_exports.object({
5511
+ users: external_exports.array(UserSchema),
5512
+ nextPageToken: external_exports.string(),
5513
+ totalSize: external_exports.number()
5386
5514
  });
5387
5515
 
5388
5516
  // src/core/organization/types.ts
5389
- var OrganizationProfileSchema = z.object({
5390
- displayName: z.string().optional(),
5391
- bio: z.string().optional(),
5392
- publicEmail: z.string().optional(),
5393
- avatar: z.string().optional(),
5394
- socialProfilesLinks: z.object({
5395
- webiste: z.string().optional(),
5396
- x: z.string().optional(),
5397
- github: z.string().optional()
5517
+ var OrganizationProfileSchema = external_exports.object({
5518
+ displayName: external_exports.string().optional(),
5519
+ bio: external_exports.string().optional(),
5520
+ publicEmail: external_exports.string().optional(),
5521
+ avatar: external_exports.string().optional(),
5522
+ socialProfilesLinks: external_exports.object({
5523
+ webiste: external_exports.string().optional(),
5524
+ x: external_exports.string().optional(),
5525
+ github: external_exports.string().optional()
5398
5526
  }).optional()
5399
5527
  });
5400
- var OrganizationSchema = z.object({
5401
- name: z.string(),
5402
- uid: z.string(),
5403
- id: z.string(),
5404
- createTime: z.string(),
5405
- updateTime: z.string(),
5528
+ var OrganizationSchema = external_exports.object({
5529
+ name: external_exports.string(),
5530
+ uid: external_exports.string(),
5531
+ id: external_exports.string(),
5532
+ createTime: external_exports.string(),
5533
+ updateTime: external_exports.string(),
5406
5534
  owner: UserSchema,
5407
5535
  profile: OrganizationProfileSchema.optional()
5408
5536
  });
5409
5537
 
5410
5538
  // src/core/membership/types.ts
5411
- var MembershipStateSchema = z.enum([
5539
+ var MembershipStateSchema = external_exports.enum([
5412
5540
  "MEMBERSHIP_STATE_ACTIVE",
5413
5541
  "MEMBERSHIP_STATE_PENDING"
5414
5542
  ]);
5415
- var UserMembershipSchema = z.object({
5543
+ var UserMembershipSchema = external_exports.object({
5416
5544
  user: UserSchema,
5417
5545
  organization: OrganizationSchema,
5418
- name: z.string().nullable(),
5419
- role: z.string(),
5546
+ name: external_exports.string().nullable(),
5547
+ role: external_exports.string(),
5420
5548
  state: MembershipStateSchema
5421
5549
  });
5422
- var OrganizationMembershipSchema = z.object({
5550
+ var OrganizationMembershipSchema = external_exports.object({
5423
5551
  user: UserSchema,
5424
5552
  organization: OrganizationSchema,
5425
- name: z.string().nullable(),
5426
- role: z.string(),
5553
+ name: external_exports.string().nullable(),
5554
+ role: external_exports.string(),
5427
5555
  state: MembershipStateSchema
5428
5556
  });
5429
- var listUserMembershipsResponseValidator = z.array(UserMembershipSchema);
5430
- var listOrganizationMembershipsResponseValidator = z.array(
5557
+ var listUserMembershipsResponseValidator = external_exports.array(UserMembershipSchema);
5558
+ var listOrganizationMembershipsResponseValidator = external_exports.array(
5431
5559
  OrganizationMembershipSchema
5432
5560
  );
5433
5561
 
@@ -6225,27 +6353,27 @@ var ComponentClient = class extends APIResource {
6225
6353
  };
6226
6354
 
6227
6355
  // src/types.ts
6228
- var PermissionSchema = z.object({
6229
- canEdit: z.boolean(),
6230
- canTrigger: z.boolean()
6356
+ var PermissionSchema = external_exports.object({
6357
+ canEdit: external_exports.boolean(),
6358
+ canTrigger: external_exports.boolean()
6231
6359
  });
6232
- var UserOwnerSchema = z.object({
6360
+ var UserOwnerSchema = external_exports.object({
6233
6361
  user: UserSchema
6234
6362
  });
6235
- var OrganizationOwnerSchema = z.object({
6363
+ var OrganizationOwnerSchema = external_exports.object({
6236
6364
  organization: OrganizationSchema
6237
6365
  });
6238
- var OwnerSchema = z.union([UserOwnerSchema, OrganizationOwnerSchema]);
6239
- var DataSpecificationSchema = z.object({
6240
- input: z.any().nullable(),
6241
- output: z.any().nullable()
6366
+ var OwnerSchema = external_exports.union([UserOwnerSchema, OrganizationOwnerSchema]);
6367
+ var DataSpecificationSchema = external_exports.object({
6368
+ input: external_exports.any().nullable(),
6369
+ output: external_exports.any().nullable()
6242
6370
  });
6243
- var SpecSchema = z.object({
6244
- componentSpecification: z.record(z.any()),
6245
- dataSpecifications: z.record(
6246
- z.object({
6247
- input: z.any().nullable(),
6248
- output: z.any().nullable()
6371
+ var SpecSchema = external_exports.object({
6372
+ componentSpecification: external_exports.record(external_exports.any()),
6373
+ dataSpecifications: external_exports.record(
6374
+ external_exports.object({
6375
+ input: external_exports.any().nullable(),
6376
+ output: external_exports.any().nullable()
6249
6377
  })
6250
6378
  ).nullable()
6251
6379
  });
@@ -6260,7 +6388,7 @@ var InstillError = class extends Error {
6260
6388
  };
6261
6389
 
6262
6390
  // src/vdp/component/types.ts
6263
- var ComponentTypeSchema = z.enum([
6391
+ var ComponentTypeSchema = external_exports.enum([
6264
6392
  "COMPONENT_TYPE_UNSPECIFIED",
6265
6393
  "COMPONENT_TYPE_OPERATOR",
6266
6394
  "COMPONENT_TYPE_DATA",
@@ -6268,79 +6396,79 @@ var ComponentTypeSchema = z.enum([
6268
6396
  "COMPONENT_TYPE_APPLICATION",
6269
6397
  "COMPONENT_TYPE_GENERIC"
6270
6398
  ]);
6271
- var TaskSchema = z.object({
6272
- name: z.string(),
6273
- title: z.string(),
6274
- description: z.string()
6399
+ var TaskSchema = external_exports.object({
6400
+ name: external_exports.string(),
6401
+ title: external_exports.string(),
6402
+ description: external_exports.string()
6275
6403
  });
6276
- var ConnectorDefinitionSchema = z.object({
6277
- name: z.string(),
6278
- uid: z.string(),
6279
- id: z.string(),
6280
- title: z.string(),
6281
- documentationUrl: z.string(),
6282
- icon: z.string(),
6404
+ var ConnectorDefinitionSchema = external_exports.object({
6405
+ name: external_exports.string(),
6406
+ uid: external_exports.string(),
6407
+ id: external_exports.string(),
6408
+ title: external_exports.string(),
6409
+ documentationUrl: external_exports.string(),
6410
+ icon: external_exports.string(),
6283
6411
  type: ComponentTypeSchema,
6284
6412
  spec: SpecSchema,
6285
- tombstone: z.boolean(),
6286
- public: z.boolean(),
6287
- custom: z.boolean(),
6288
- vendor: z.string(),
6289
- vendorAttributes: z.record(z.any()),
6290
- tasks: z.array(TaskSchema)
6413
+ tombstone: external_exports.boolean(),
6414
+ public: external_exports.boolean(),
6415
+ custom: external_exports.boolean(),
6416
+ vendor: external_exports.string(),
6417
+ vendorAttributes: external_exports.record(external_exports.any()),
6418
+ tasks: external_exports.array(TaskSchema)
6291
6419
  });
6292
- var ComponentDefinitionSchema = z.object({
6293
- name: z.string(),
6294
- uid: z.string(),
6295
- id: z.string(),
6296
- title: z.string(),
6297
- documentationUrl: z.string(),
6298
- icon: z.string(),
6420
+ var ComponentDefinitionSchema = external_exports.object({
6421
+ name: external_exports.string(),
6422
+ uid: external_exports.string(),
6423
+ id: external_exports.string(),
6424
+ title: external_exports.string(),
6425
+ documentationUrl: external_exports.string(),
6426
+ icon: external_exports.string(),
6299
6427
  spec: SpecSchema,
6300
6428
  type: ComponentTypeSchema,
6301
- tombstone: z.boolean(),
6302
- public: z.boolean(),
6303
- custom: z.boolean(),
6304
- vendor: z.string(),
6305
- vendorAttributes: z.record(z.any()),
6306
- sourceUrl: z.string(),
6307
- version: z.string(),
6308
- tasks: z.array(TaskSchema),
6309
- description: z.string(),
6310
- releaseStage: z.string()
6429
+ tombstone: external_exports.boolean(),
6430
+ public: external_exports.boolean(),
6431
+ custom: external_exports.boolean(),
6432
+ vendor: external_exports.string(),
6433
+ vendorAttributes: external_exports.record(external_exports.any()),
6434
+ sourceUrl: external_exports.string(),
6435
+ version: external_exports.string(),
6436
+ tasks: external_exports.array(TaskSchema),
6437
+ description: external_exports.string(),
6438
+ releaseStage: external_exports.string()
6311
6439
  });
6312
- var OperatorDefinitionSchema = z.object({
6313
- name: z.string(),
6314
- uid: z.string(),
6315
- id: z.string(),
6316
- title: z.string(),
6317
- documentationUrl: z.string(),
6318
- icon: z.string(),
6440
+ var OperatorDefinitionSchema = external_exports.object({
6441
+ name: external_exports.string(),
6442
+ uid: external_exports.string(),
6443
+ id: external_exports.string(),
6444
+ title: external_exports.string(),
6445
+ documentationUrl: external_exports.string(),
6446
+ icon: external_exports.string(),
6319
6447
  spec: SpecSchema,
6320
- tombstone: z.boolean(),
6321
- public: z.boolean(),
6322
- custom: z.boolean(),
6323
- tasks: z.array(TaskSchema),
6448
+ tombstone: external_exports.boolean(),
6449
+ public: external_exports.boolean(),
6450
+ custom: external_exports.boolean(),
6451
+ tasks: external_exports.array(TaskSchema),
6324
6452
  type: ComponentTypeSchema
6325
6453
  });
6326
- var listConnectorDefinitionsWithPaginationResponseValidator = z.object(
6454
+ var listConnectorDefinitionsWithPaginationResponseValidator = external_exports.object(
6327
6455
  {
6328
- connectorDefinitions: z.array(ConnectorDefinitionSchema),
6329
- nextPageToken: z.string(),
6330
- totalSize: z.number()
6456
+ connectorDefinitions: external_exports.array(ConnectorDefinitionSchema),
6457
+ nextPageToken: external_exports.string(),
6458
+ totalSize: external_exports.number()
6331
6459
  }
6332
6460
  );
6333
- var listComponentDefinitionsWithPaginationResponseValidator = z.object(
6461
+ var listComponentDefinitionsWithPaginationResponseValidator = external_exports.object(
6334
6462
  {
6335
- componentDefinitions: z.array(ComponentDefinitionSchema),
6336
- nextPageToken: z.string(),
6337
- totalSize: z.number()
6463
+ componentDefinitions: external_exports.array(ComponentDefinitionSchema),
6464
+ nextPageToken: external_exports.string(),
6465
+ totalSize: external_exports.number()
6338
6466
  }
6339
6467
  );
6340
- var listOperatorDefinitionsWithPaginationResponseValidator = z.object({
6341
- operatorDefinitions: z.array(OperatorDefinitionSchema),
6342
- nextPageToken: z.string(),
6343
- totalSize: z.number()
6468
+ var listOperatorDefinitionsWithPaginationResponseValidator = external_exports.object({
6469
+ operatorDefinitions: external_exports.array(OperatorDefinitionSchema),
6470
+ nextPageToken: external_exports.string(),
6471
+ totalSize: external_exports.number()
6344
6472
  });
6345
6473
 
6346
6474
  // src/vdp/pipeline/PipelineClient.ts
@@ -6700,82 +6828,82 @@ var ReleaseClient = class extends APIResource {
6700
6828
  };
6701
6829
 
6702
6830
  // src/vdp/release/types.ts
6703
- var PipelineReleaseSchema = z.object({
6704
- name: z.string(),
6705
- uid: z.string(),
6706
- id: z.string(),
6707
- description: z.string(),
6831
+ var PipelineReleaseSchema = external_exports.object({
6832
+ name: external_exports.string(),
6833
+ uid: external_exports.string(),
6834
+ id: external_exports.string(),
6835
+ description: external_exports.string(),
6708
6836
  // Our openapi isn't fully typed on the recipe field yet
6709
- recipe: z.record(z.any()),
6710
- createTime: z.string(),
6711
- updateTime: z.string(),
6712
- deleteTime: z.string().optional(),
6713
- metadata: z.record(z.any()),
6714
- alias: z.string().optional(),
6715
- readme: z.string(),
6716
- rawRecipe: z.string(),
6837
+ recipe: external_exports.record(external_exports.any()),
6838
+ createTime: external_exports.string(),
6839
+ updateTime: external_exports.string(),
6840
+ deleteTime: external_exports.string().optional(),
6841
+ metadata: external_exports.record(external_exports.any()),
6842
+ alias: external_exports.string().optional(),
6843
+ readme: external_exports.string(),
6844
+ rawRecipe: external_exports.string(),
6717
6845
  dataSpecification: DataSpecificationSchema
6718
6846
  });
6719
6847
 
6720
6848
  // src/vdp/pipeline/types.ts
6721
- var PipelineStatsSchema = z.object({
6722
- lastRunTime: z.string(),
6723
- numberOfRuns: z.number()
6849
+ var PipelineStatsSchema = external_exports.object({
6850
+ lastRunTime: external_exports.string(),
6851
+ numberOfRuns: external_exports.number()
6724
6852
  });
6725
- var PermissionRoleSchema = z.enum([
6853
+ var PermissionRoleSchema = external_exports.enum([
6726
6854
  "ROLE_UNSPECIFIED",
6727
6855
  "ROLE_VIEWER",
6728
6856
  "ROLE_EXECUTOR"
6729
6857
  ]);
6730
- var PipelineSharingCodeRuleSchema = z.object({
6731
- user: z.string(),
6732
- code: z.string().optional(),
6733
- enabled: z.boolean(),
6858
+ var PipelineSharingCodeRuleSchema = external_exports.object({
6859
+ user: external_exports.string(),
6860
+ code: external_exports.string().optional(),
6861
+ enabled: external_exports.boolean(),
6734
6862
  role: PermissionRoleSchema
6735
6863
  });
6736
- var PipelineSharingUserRulesSchema = z.record(
6737
- z.object({
6738
- enabled: z.boolean(),
6864
+ var PipelineSharingUserRulesSchema = external_exports.record(
6865
+ external_exports.object({
6866
+ enabled: external_exports.boolean(),
6739
6867
  role: PermissionRoleSchema
6740
6868
  }).optional()
6741
6869
  );
6742
- var PipelineSharingSchema = z.object({
6870
+ var PipelineSharingSchema = external_exports.object({
6743
6871
  users: PipelineSharingUserRulesSchema,
6744
6872
  shareCode: PipelineSharingCodeRuleSchema.nullable()
6745
6873
  });
6746
- var PipelineSchema = z.object({
6747
- name: z.string(),
6748
- uid: z.string(),
6749
- id: z.string(),
6750
- description: z.string(),
6751
- readme: z.string(),
6752
- createTime: z.string(),
6753
- updateTime: z.string(),
6874
+ var PipelineSchema = external_exports.object({
6875
+ name: external_exports.string(),
6876
+ uid: external_exports.string(),
6877
+ id: external_exports.string(),
6878
+ description: external_exports.string(),
6879
+ readme: external_exports.string(),
6880
+ createTime: external_exports.string(),
6881
+ updateTime: external_exports.string(),
6754
6882
  // Our openapi isn't fully typed on the recipe field yet
6755
- recipe: z.record(z.any()),
6883
+ recipe: external_exports.record(external_exports.any()),
6756
6884
  dataSpecification: DataSpecificationSchema,
6757
6885
  owner: OwnerSchema,
6758
- ownerName: z.string(),
6759
- releases: z.array(PipelineReleaseSchema),
6886
+ ownerName: external_exports.string(),
6887
+ releases: external_exports.array(PipelineReleaseSchema),
6760
6888
  sharing: PipelineSharingSchema,
6761
- metadata: z.record(z.any()),
6889
+ metadata: external_exports.record(external_exports.any()),
6762
6890
  permission: PermissionSchema,
6763
- tags: z.array(z.string()),
6891
+ tags: external_exports.array(external_exports.string()),
6764
6892
  stats: PipelineStatsSchema,
6765
- profileImage: z.string(),
6766
- sourceUrl: z.string(),
6767
- documentationUrl: z.string(),
6768
- license: z.string()
6893
+ profileImage: external_exports.string(),
6894
+ sourceUrl: external_exports.string(),
6895
+ documentationUrl: external_exports.string(),
6896
+ license: external_exports.string()
6769
6897
  });
6770
- var listAccessiblePipelinesWithPaginationResponseValidator = z.object({
6771
- pipelines: z.array(PipelineSchema),
6772
- nextPageToken: z.string(),
6773
- totalSize: z.number()
6898
+ var listAccessiblePipelinesWithPaginationResponseValidator = external_exports.object({
6899
+ pipelines: external_exports.array(PipelineSchema),
6900
+ nextPageToken: external_exports.string(),
6901
+ totalSize: external_exports.number()
6774
6902
  });
6775
- var listNamespacePipelinesWithPaginationResponseValidator = z.object({
6776
- pipelines: z.array(PipelineSchema),
6777
- nextPageToken: z.string(),
6778
- totalSize: z.number()
6903
+ var listNamespacePipelinesWithPaginationResponseValidator = external_exports.object({
6904
+ pipelines: external_exports.array(PipelineSchema),
6905
+ nextPageToken: external_exports.string(),
6906
+ totalSize: external_exports.number()
6779
6907
  });
6780
6908
 
6781
6909
  // src/vdp/secret/SecretClient.ts
@@ -7066,63 +7194,63 @@ var TriggerClient = class extends APIResource {
7066
7194
  };
7067
7195
 
7068
7196
  // src/vdp/types.ts
7069
- var PipelineVariableFieldSchema = z.object({
7070
- title: z.string(),
7071
- instillFormat: z.string(),
7072
- description: z.string().optional(),
7073
- instillUiOrder: z.number().optional(),
7074
- instillUiMultiline: z.boolean().optional()
7197
+ var PipelineVariableFieldSchema = external_exports.object({
7198
+ title: external_exports.string(),
7199
+ instillFormat: external_exports.string(),
7200
+ description: external_exports.string().optional(),
7201
+ instillUiOrder: external_exports.number().optional(),
7202
+ instillUiMultiline: external_exports.boolean().optional()
7075
7203
  });
7076
- var PipelineVariableFieldMapSchema = z.record(
7204
+ var PipelineVariableFieldMapSchema = external_exports.record(
7077
7205
  PipelineVariableFieldSchema.nullable()
7078
7206
  );
7079
- var PipelineOutputFieldSchema = z.object({
7080
- title: z.string(),
7081
- description: z.string().optional(),
7082
- value: z.string(),
7083
- instillUiOrder: z.number().optional()
7207
+ var PipelineOutputFieldSchema = external_exports.object({
7208
+ title: external_exports.string(),
7209
+ description: external_exports.string().optional(),
7210
+ value: external_exports.string(),
7211
+ instillUiOrder: external_exports.number().optional()
7084
7212
  });
7085
- var PipelineOutputFieldMapSchema = z.record(
7213
+ var PipelineOutputFieldMapSchema = external_exports.record(
7086
7214
  PipelineOutputFieldSchema.nullable()
7087
7215
  );
7088
- var PipelineComponentMapSchema = z.record(z.any());
7089
- var PipelineRunOnEventItemMapSchema = z.record(z.any());
7090
- var PipelineRunOnMapSchema = z.record(z.any());
7091
- var PipelineRecipeSchema = z.object({
7092
- version: z.string(),
7216
+ var PipelineComponentMapSchema = external_exports.record(external_exports.any());
7217
+ var PipelineRunOnEventItemMapSchema = external_exports.record(external_exports.any());
7218
+ var PipelineRunOnMapSchema = external_exports.record(external_exports.any());
7219
+ var PipelineRecipeSchema = external_exports.object({
7220
+ version: external_exports.string(),
7093
7221
  component: PipelineComponentMapSchema.optional(),
7094
7222
  variable: PipelineVariableFieldMapSchema.optional(),
7095
7223
  output: PipelineOutputFieldMapSchema.optional(),
7096
7224
  on: PipelineRunOnMapSchema.optional()
7097
7225
  });
7098
- var ResourceViewSchema = z.enum(["VIEW_FULL", "VIEW_BASIC"]);
7226
+ var ResourceViewSchema = external_exports.enum(["VIEW_FULL", "VIEW_BASIC"]);
7099
7227
 
7100
7228
  // src/core/integration/type.ts
7101
- var HelpLinkSchema = z.object({
7102
- text: z.string(),
7103
- url: z.string()
7229
+ var HelpLinkSchema = external_exports.object({
7230
+ text: external_exports.string(),
7231
+ url: external_exports.string()
7104
7232
  });
7105
- var OAuthConfigSchema = z.object({
7106
- authUrl: z.string(),
7107
- accessUrl: z.string(),
7108
- scopes: z.array(z.string())
7233
+ var OAuthConfigSchema = external_exports.object({
7234
+ authUrl: external_exports.string(),
7235
+ accessUrl: external_exports.string(),
7236
+ scopes: external_exports.array(external_exports.string())
7109
7237
  });
7110
- var IntegrationSchema = z.object({
7111
- uid: z.string(),
7112
- id: z.string(),
7113
- title: z.string(),
7114
- description: z.string(),
7115
- vendor: z.string(),
7116
- icon: z.string(),
7238
+ var IntegrationSchema = external_exports.object({
7239
+ uid: external_exports.string(),
7240
+ id: external_exports.string(),
7241
+ title: external_exports.string(),
7242
+ description: external_exports.string(),
7243
+ vendor: external_exports.string(),
7244
+ icon: external_exports.string(),
7117
7245
  helpLink: HelpLinkSchema,
7118
- setupSchema: z.any(),
7246
+ setupSchema: external_exports.any(),
7119
7247
  oAuthConfig: OAuthConfigSchema.nullable(),
7120
7248
  view: ResourceViewSchema
7121
7249
  });
7122
- var listPaginatedIntegrationsResponseValidator = z.object({
7123
- integrations: z.array(IntegrationSchema),
7124
- nextPageToken: z.string().nullable(),
7125
- totalSize: z.number()
7250
+ var listPaginatedIntegrationsResponseValidator = external_exports.object({
7251
+ integrations: external_exports.array(IntegrationSchema),
7252
+ nextPageToken: external_exports.string().nullable(),
7253
+ totalSize: external_exports.number()
7126
7254
  });
7127
7255
 
7128
7256
  // src/core/utils/UtilsClient.ts
@@ -8093,6 +8221,38 @@ var TableClient = class extends APIResource {
8093
8221
  return Promise.reject(error);
8094
8222
  }
8095
8223
  }
8224
+ async suggestNamespaceTableColumnDefinition(props) {
8225
+ const { namespaceId, tableUid, ...rest } = props;
8226
+ try {
8227
+ const data = await this._client.post(
8228
+ `/namespaces/${namespaceId}/tables/${tableUid}/column-definitions-helper/suggest`,
8229
+ {
8230
+ body: JSON.stringify(rest)
8231
+ }
8232
+ );
8233
+ return Promise.resolve(data);
8234
+ } catch (error) {
8235
+ return Promise.reject(error);
8236
+ }
8237
+ }
8238
+ async enhanceNamespaceTableColumnDefinitionInstruction(props) {
8239
+ const { namespaceId, tableUid, columnDefinition } = props;
8240
+ try {
8241
+ const data = await this._client.post(
8242
+ `/namespaces/${namespaceId}/tables/${tableUid}/column-definitions-helper/enhance-instructions`,
8243
+ {
8244
+ body: JSON.stringify({
8245
+ namespaceId,
8246
+ tableUid,
8247
+ columnDefinition
8248
+ })
8249
+ }
8250
+ );
8251
+ return Promise.resolve(data);
8252
+ } catch (error) {
8253
+ return Promise.reject(error);
8254
+ }
8255
+ }
8096
8256
  };
8097
8257
 
8098
8258
  // src/chat/ChatClient.ts
@@ -8357,6 +8517,7 @@ var InstillChatTypeEnum = {
8357
8517
  ReplanTriggered: "CHAT_REPLAN_TRIGGERED",
8358
8518
  ErrorUpdated: "CHAT_ERROR_UPDATED",
8359
8519
  CitationListUpdated: "CHAT_CITATION_LIST_UPDATED",
8520
+ ChatAttachmentsUpdated: "CHAT_ATTACHMENTS_UPDATED",
8360
8521
  TableCreated: "CHAT_TABLE_CREATED"
8361
8522
  };
8362
8523