instill-sdk 0.19.0-rc.1 → 0.19.0-rc.2
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/chat/constant.d.ts +8 -0
- package/dist/chat/constant.d.ts.map +1 -0
- package/dist/core/integration/type.d.ts +12 -12
- package/dist/core/membership/types.d.ts +132 -132
- package/dist/core/organization/types.d.ts +10 -10
- package/dist/core/user/types.d.ts +14 -14
- package/dist/folder/FolderClient.d.ts +11 -0
- package/dist/folder/FolderClient.d.ts.map +1 -0
- package/dist/folder/index.d.ts +3 -0
- package/dist/folder/index.d.ts.map +1 -0
- package/dist/folder/types.d.ts +51 -0
- package/dist/folder/types.d.ts.map +1 -0
- package/dist/helper/getQueryString.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +593 -612
- package/dist/index.mjs +592 -618
- package/dist/main/index.d.ts +2 -0
- package/dist/main/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +44 -44
- package/dist/vdp/component/types.d.ts +68 -68
- package/dist/vdp/pipeline/types.d.ts +456 -456
- package/dist/vdp/release/types.d.ts +6 -6
- package/package.json +5 -5
- package/dist/helper/makeXMLRequestWithProgress.d.ts +0 -4
- package/dist/helper/makeXMLRequestWithProgress.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
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
|
-
|
|
7
1
|
// src/main/index.ts
|
|
8
2
|
import "whatwg-fetch";
|
|
9
3
|
|
|
@@ -1136,123 +1130,10 @@ var CreditClient = class extends APIResource {
|
|
|
1136
1130
|
}
|
|
1137
1131
|
};
|
|
1138
1132
|
|
|
1139
|
-
// ../../node_modules/.pnpm/zod@3.
|
|
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
|
|
1133
|
+
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
1252
1134
|
var util;
|
|
1253
1135
|
(function(util2) {
|
|
1254
|
-
util2.assertEqual = (
|
|
1255
|
-
};
|
|
1136
|
+
util2.assertEqual = (val) => val;
|
|
1256
1137
|
function assertIs(_arg) {
|
|
1257
1138
|
}
|
|
1258
1139
|
util2.assertIs = assertIs;
|
|
@@ -1296,7 +1177,7 @@ var util;
|
|
|
1296
1177
|
}
|
|
1297
1178
|
return void 0;
|
|
1298
1179
|
};
|
|
1299
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" &&
|
|
1180
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1300
1181
|
function joinValues(array, separator = " | ") {
|
|
1301
1182
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1302
1183
|
}
|
|
@@ -1348,7 +1229,7 @@ var getParsedType = (data) => {
|
|
|
1348
1229
|
case "string":
|
|
1349
1230
|
return ZodParsedType.string;
|
|
1350
1231
|
case "number":
|
|
1351
|
-
return
|
|
1232
|
+
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1352
1233
|
case "boolean":
|
|
1353
1234
|
return ZodParsedType.boolean;
|
|
1354
1235
|
case "function":
|
|
@@ -1381,8 +1262,6 @@ var getParsedType = (data) => {
|
|
|
1381
1262
|
return ZodParsedType.unknown;
|
|
1382
1263
|
}
|
|
1383
1264
|
};
|
|
1384
|
-
|
|
1385
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/ZodError.js
|
|
1386
1265
|
var ZodIssueCode = util.arrayToEnum([
|
|
1387
1266
|
"invalid_type",
|
|
1388
1267
|
"invalid_literal",
|
|
@@ -1406,9 +1285,6 @@ var quotelessJson = (obj) => {
|
|
|
1406
1285
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
1407
1286
|
};
|
|
1408
1287
|
var ZodError = class _ZodError extends Error {
|
|
1409
|
-
get errors() {
|
|
1410
|
-
return this.issues;
|
|
1411
|
-
}
|
|
1412
1288
|
constructor(issues) {
|
|
1413
1289
|
super();
|
|
1414
1290
|
this.issues = [];
|
|
@@ -1427,6 +1303,9 @@ var ZodError = class _ZodError extends Error {
|
|
|
1427
1303
|
this.name = "ZodError";
|
|
1428
1304
|
this.issues = issues;
|
|
1429
1305
|
}
|
|
1306
|
+
get errors() {
|
|
1307
|
+
return this.issues;
|
|
1308
|
+
}
|
|
1430
1309
|
format(_mapper) {
|
|
1431
1310
|
const mapper = _mapper || function(issue) {
|
|
1432
1311
|
return issue.message;
|
|
@@ -1498,8 +1377,6 @@ ZodError.create = (issues) => {
|
|
|
1498
1377
|
const error = new ZodError(issues);
|
|
1499
1378
|
return error;
|
|
1500
1379
|
};
|
|
1501
|
-
|
|
1502
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/locales/en.js
|
|
1503
1380
|
var errorMap = (issue, _ctx) => {
|
|
1504
1381
|
let message;
|
|
1505
1382
|
switch (issue.code) {
|
|
@@ -1598,18 +1475,13 @@ var errorMap = (issue, _ctx) => {
|
|
|
1598
1475
|
}
|
|
1599
1476
|
return { message };
|
|
1600
1477
|
};
|
|
1601
|
-
var
|
|
1602
|
-
|
|
1603
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/errors.js
|
|
1604
|
-
var overrideErrorMap = en_default;
|
|
1478
|
+
var overrideErrorMap = errorMap;
|
|
1605
1479
|
function setErrorMap(map) {
|
|
1606
1480
|
overrideErrorMap = map;
|
|
1607
1481
|
}
|
|
1608
1482
|
function getErrorMap() {
|
|
1609
1483
|
return overrideErrorMap;
|
|
1610
1484
|
}
|
|
1611
|
-
|
|
1612
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
|
1613
1485
|
var makeIssue = (params) => {
|
|
1614
1486
|
const { data, path, errorMaps, issueData } = params;
|
|
1615
1487
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -1644,12 +1516,9 @@ function addIssueToContext(ctx, issueData) {
|
|
|
1644
1516
|
path: ctx.path,
|
|
1645
1517
|
errorMaps: [
|
|
1646
1518
|
ctx.common.contextualErrorMap,
|
|
1647
|
-
// contextual error map is first priority
|
|
1648
1519
|
ctx.schemaErrorMap,
|
|
1649
|
-
// then schema-bound map if available
|
|
1650
1520
|
overrideMap,
|
|
1651
|
-
|
|
1652
|
-
overrideMap === en_default ? void 0 : en_default
|
|
1521
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
1653
1522
|
// then global default map
|
|
1654
1523
|
].filter((x) => !!x)
|
|
1655
1524
|
});
|
|
@@ -1718,15 +1587,24 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
1718
1587
|
var isDirty = (x) => x.status === "dirty";
|
|
1719
1588
|
var isValid = (x) => x.status === "valid";
|
|
1720
1589
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1721
|
-
|
|
1722
|
-
|
|
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
|
+
}
|
|
1723
1601
|
var errorUtil;
|
|
1724
1602
|
(function(errorUtil2) {
|
|
1725
1603
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1726
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
1604
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
1727
1605
|
})(errorUtil || (errorUtil = {}));
|
|
1728
|
-
|
|
1729
|
-
|
|
1606
|
+
var _ZodEnum_cache;
|
|
1607
|
+
var _ZodNativeEnum_cache;
|
|
1730
1608
|
var ParseInputLazyPath = class {
|
|
1731
1609
|
constructor(parent, value, path, key) {
|
|
1732
1610
|
this._cachedPath = [];
|
|
@@ -1737,7 +1615,7 @@ var ParseInputLazyPath = class {
|
|
|
1737
1615
|
}
|
|
1738
1616
|
get path() {
|
|
1739
1617
|
if (!this._cachedPath.length) {
|
|
1740
|
-
if (
|
|
1618
|
+
if (this._key instanceof Array) {
|
|
1741
1619
|
this._cachedPath.push(...this._path, ...this._key);
|
|
1742
1620
|
} else {
|
|
1743
1621
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -1775,20 +1653,49 @@ function processCreateParams(params) {
|
|
|
1775
1653
|
if (errorMap2)
|
|
1776
1654
|
return { errorMap: errorMap2, description };
|
|
1777
1655
|
const customMap = (iss, ctx) => {
|
|
1656
|
+
var _a, _b;
|
|
1778
1657
|
const { message } = params;
|
|
1779
1658
|
if (iss.code === "invalid_enum_value") {
|
|
1780
|
-
return { message: message
|
|
1659
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
1781
1660
|
}
|
|
1782
1661
|
if (typeof ctx.data === "undefined") {
|
|
1783
|
-
return { message: message
|
|
1662
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
1784
1663
|
}
|
|
1785
1664
|
if (iss.code !== "invalid_type")
|
|
1786
1665
|
return { message: ctx.defaultError };
|
|
1787
|
-
return { message: message
|
|
1666
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
1788
1667
|
};
|
|
1789
1668
|
return { errorMap: customMap, description };
|
|
1790
1669
|
}
|
|
1791
1670
|
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
|
+
}
|
|
1792
1699
|
get description() {
|
|
1793
1700
|
return this._def.description;
|
|
1794
1701
|
}
|
|
@@ -1836,13 +1743,14 @@ var ZodType = class {
|
|
|
1836
1743
|
throw result.error;
|
|
1837
1744
|
}
|
|
1838
1745
|
safeParse(data, params) {
|
|
1746
|
+
var _a;
|
|
1839
1747
|
const ctx = {
|
|
1840
1748
|
common: {
|
|
1841
1749
|
issues: [],
|
|
1842
|
-
async: params
|
|
1843
|
-
contextualErrorMap: params
|
|
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
|
|
1844
1752
|
},
|
|
1845
|
-
path: params
|
|
1753
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
1846
1754
|
schemaErrorMap: this._def.errorMap,
|
|
1847
1755
|
parent: null,
|
|
1848
1756
|
data,
|
|
@@ -1851,42 +1759,6 @@ var ZodType = class {
|
|
|
1851
1759
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
1852
1760
|
return handleResult(ctx, result);
|
|
1853
1761
|
}
|
|
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
|
-
}
|
|
1890
1762
|
async parseAsync(data, params) {
|
|
1891
1763
|
const result = await this.safeParseAsync(data, params);
|
|
1892
1764
|
if (result.success)
|
|
@@ -1897,10 +1769,10 @@ var ZodType = class {
|
|
|
1897
1769
|
const ctx = {
|
|
1898
1770
|
common: {
|
|
1899
1771
|
issues: [],
|
|
1900
|
-
contextualErrorMap: params
|
|
1772
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
|
|
1901
1773
|
async: true
|
|
1902
1774
|
},
|
|
1903
|
-
path: params
|
|
1775
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
1904
1776
|
schemaErrorMap: this._def.errorMap,
|
|
1905
1777
|
parent: null,
|
|
1906
1778
|
data,
|
|
@@ -1964,39 +1836,6 @@ var ZodType = class {
|
|
|
1964
1836
|
superRefine(refinement) {
|
|
1965
1837
|
return this._refinement(refinement);
|
|
1966
1838
|
}
|
|
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
|
-
}
|
|
2000
1839
|
optional() {
|
|
2001
1840
|
return ZodOptional.create(this, this._def);
|
|
2002
1841
|
}
|
|
@@ -2007,7 +1846,7 @@ var ZodType = class {
|
|
|
2007
1846
|
return this.nullable().optional();
|
|
2008
1847
|
}
|
|
2009
1848
|
array() {
|
|
2010
|
-
return ZodArray.create(this);
|
|
1849
|
+
return ZodArray.create(this, this._def);
|
|
2011
1850
|
}
|
|
2012
1851
|
promise() {
|
|
2013
1852
|
return ZodPromise.create(this, this._def);
|
|
@@ -2073,31 +1912,26 @@ var ZodType = class {
|
|
|
2073
1912
|
};
|
|
2074
1913
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
2075
1914
|
var cuid2Regex = /^[0-9a-z]+$/;
|
|
2076
|
-
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
|
1915
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
2077
1916
|
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;
|
|
2078
1917
|
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
2079
|
-
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
2080
1918
|
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)?)??$/;
|
|
2081
1919
|
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
2082
1920
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
2083
1921
|
var emojiRegex;
|
|
2084
1922
|
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])$/;
|
|
2085
|
-
var
|
|
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])$/;
|
|
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})))$/;
|
|
2088
1924
|
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}(=)?))?$/;
|
|
2090
1925
|
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])))`;
|
|
2091
1926
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2092
1927
|
function timeRegexSource(args) {
|
|
2093
|
-
let
|
|
1928
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
2094
1929
|
if (args.precision) {
|
|
2095
|
-
|
|
1930
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
2096
1931
|
} else if (args.precision == null) {
|
|
2097
|
-
|
|
1932
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
2098
1933
|
}
|
|
2099
|
-
|
|
2100
|
-
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
1934
|
+
return regex;
|
|
2101
1935
|
}
|
|
2102
1936
|
function timeRegex(args) {
|
|
2103
1937
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -2120,35 +1954,6 @@ function isValidIP(ip, version) {
|
|
|
2120
1954
|
}
|
|
2121
1955
|
return false;
|
|
2122
1956
|
}
|
|
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
|
-
}
|
|
2152
1957
|
var ZodString = class _ZodString extends ZodType {
|
|
2153
1958
|
_parse(input) {
|
|
2154
1959
|
if (this._def.coerce) {
|
|
@@ -2295,7 +2100,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2295
2100
|
} else if (check.kind === "url") {
|
|
2296
2101
|
try {
|
|
2297
2102
|
new URL(input.data);
|
|
2298
|
-
} catch {
|
|
2103
|
+
} catch (_a) {
|
|
2299
2104
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2300
2105
|
addIssueToContext(ctx, {
|
|
2301
2106
|
validation: "url",
|
|
@@ -2405,26 +2210,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2405
2210
|
});
|
|
2406
2211
|
status.dirty();
|
|
2407
2212
|
}
|
|
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
|
-
}
|
|
2428
2213
|
} else if (check.kind === "base64") {
|
|
2429
2214
|
if (!base64Regex.test(input.data)) {
|
|
2430
2215
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2435,16 +2220,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2435
2220
|
});
|
|
2436
2221
|
status.dirty();
|
|
2437
2222
|
}
|
|
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
|
-
}
|
|
2448
2223
|
} else {
|
|
2449
2224
|
util.assertNever(check);
|
|
2450
2225
|
}
|
|
@@ -2491,22 +2266,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2491
2266
|
base64(message) {
|
|
2492
2267
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
2493
2268
|
}
|
|
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
|
-
}
|
|
2503
2269
|
ip(options) {
|
|
2504
2270
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
2505
2271
|
}
|
|
2506
|
-
cidr(options) {
|
|
2507
|
-
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2508
|
-
}
|
|
2509
2272
|
datetime(options) {
|
|
2273
|
+
var _a, _b;
|
|
2510
2274
|
if (typeof options === "string") {
|
|
2511
2275
|
return this._addCheck({
|
|
2512
2276
|
kind: "datetime",
|
|
@@ -2518,10 +2282,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2518
2282
|
}
|
|
2519
2283
|
return this._addCheck({
|
|
2520
2284
|
kind: "datetime",
|
|
2521
|
-
precision: typeof options
|
|
2522
|
-
offset: options
|
|
2523
|
-
local: options
|
|
2524
|
-
...errorUtil.errToObj(options
|
|
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)
|
|
2525
2289
|
});
|
|
2526
2290
|
}
|
|
2527
2291
|
date(message) {
|
|
@@ -2537,8 +2301,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2537
2301
|
}
|
|
2538
2302
|
return this._addCheck({
|
|
2539
2303
|
kind: "time",
|
|
2540
|
-
precision: typeof options
|
|
2541
|
-
...errorUtil.errToObj(options
|
|
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)
|
|
2542
2306
|
});
|
|
2543
2307
|
}
|
|
2544
2308
|
duration(message) {
|
|
@@ -2555,8 +2319,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2555
2319
|
return this._addCheck({
|
|
2556
2320
|
kind: "includes",
|
|
2557
2321
|
value,
|
|
2558
|
-
position: options
|
|
2559
|
-
...errorUtil.errToObj(options
|
|
2322
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
2323
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2560
2324
|
});
|
|
2561
2325
|
}
|
|
2562
2326
|
startsWith(value, message) {
|
|
@@ -2595,7 +2359,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2595
2359
|
});
|
|
2596
2360
|
}
|
|
2597
2361
|
/**
|
|
2598
|
-
*
|
|
2362
|
+
* @deprecated Use z.string().min(1) instead.
|
|
2363
|
+
* @see {@link ZodString.min}
|
|
2599
2364
|
*/
|
|
2600
2365
|
nonempty(message) {
|
|
2601
2366
|
return this.min(1, errorUtil.errToObj(message));
|
|
@@ -2657,15 +2422,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2657
2422
|
get isIP() {
|
|
2658
2423
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
2659
2424
|
}
|
|
2660
|
-
get isCIDR() {
|
|
2661
|
-
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
2662
|
-
}
|
|
2663
2425
|
get isBase64() {
|
|
2664
2426
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
2665
2427
|
}
|
|
2666
|
-
get isBase64url() {
|
|
2667
|
-
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
2668
|
-
}
|
|
2669
2428
|
get minLength() {
|
|
2670
2429
|
let min = null;
|
|
2671
2430
|
for (const ch of this._def.checks) {
|
|
@@ -2688,10 +2447,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2688
2447
|
}
|
|
2689
2448
|
};
|
|
2690
2449
|
ZodString.create = (params) => {
|
|
2450
|
+
var _a;
|
|
2691
2451
|
return new ZodString({
|
|
2692
2452
|
checks: [],
|
|
2693
2453
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
2694
|
-
coerce: params
|
|
2454
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
2695
2455
|
...processCreateParams(params)
|
|
2696
2456
|
});
|
|
2697
2457
|
};
|
|
@@ -2699,9 +2459,9 @@ function floatSafeRemainder(val, step) {
|
|
|
2699
2459
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
2700
2460
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
2701
2461
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
2702
|
-
const valInt =
|
|
2703
|
-
const stepInt =
|
|
2704
|
-
return valInt % stepInt / 10
|
|
2462
|
+
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
2463
|
+
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
2464
|
+
return valInt % stepInt / Math.pow(10, decCount);
|
|
2705
2465
|
}
|
|
2706
2466
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
2707
2467
|
constructor() {
|
|
@@ -2911,8 +2671,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
2911
2671
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
2912
2672
|
}
|
|
2913
2673
|
get isFinite() {
|
|
2914
|
-
let max = null;
|
|
2915
|
-
let min = null;
|
|
2674
|
+
let max = null, min = null;
|
|
2916
2675
|
for (const ch of this._def.checks) {
|
|
2917
2676
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
2918
2677
|
return true;
|
|
@@ -2931,7 +2690,7 @@ ZodNumber.create = (params) => {
|
|
|
2931
2690
|
return new ZodNumber({
|
|
2932
2691
|
checks: [],
|
|
2933
2692
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2934
|
-
coerce: params
|
|
2693
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
2935
2694
|
...processCreateParams(params)
|
|
2936
2695
|
});
|
|
2937
2696
|
};
|
|
@@ -2943,15 +2702,17 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2943
2702
|
}
|
|
2944
2703
|
_parse(input) {
|
|
2945
2704
|
if (this._def.coerce) {
|
|
2946
|
-
|
|
2947
|
-
input.data = BigInt(input.data);
|
|
2948
|
-
} catch {
|
|
2949
|
-
return this._getInvalidInput(input);
|
|
2950
|
-
}
|
|
2705
|
+
input.data = BigInt(input.data);
|
|
2951
2706
|
}
|
|
2952
2707
|
const parsedType = this._getType(input);
|
|
2953
2708
|
if (parsedType !== ZodParsedType.bigint) {
|
|
2954
|
-
|
|
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;
|
|
2955
2716
|
}
|
|
2956
2717
|
let ctx = void 0;
|
|
2957
2718
|
const status = new ParseStatus();
|
|
@@ -2998,15 +2759,6 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2998
2759
|
}
|
|
2999
2760
|
return { status: status.value, value: input.data };
|
|
3000
2761
|
}
|
|
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
|
-
}
|
|
3010
2762
|
gte(value, message) {
|
|
3011
2763
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
3012
2764
|
}
|
|
@@ -3100,10 +2852,11 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3100
2852
|
}
|
|
3101
2853
|
};
|
|
3102
2854
|
ZodBigInt.create = (params) => {
|
|
2855
|
+
var _a;
|
|
3103
2856
|
return new ZodBigInt({
|
|
3104
2857
|
checks: [],
|
|
3105
2858
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3106
|
-
coerce: params
|
|
2859
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
3107
2860
|
...processCreateParams(params)
|
|
3108
2861
|
});
|
|
3109
2862
|
};
|
|
@@ -3128,7 +2881,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
3128
2881
|
ZodBoolean.create = (params) => {
|
|
3129
2882
|
return new ZodBoolean({
|
|
3130
2883
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3131
|
-
coerce: params
|
|
2884
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
3132
2885
|
...processCreateParams(params)
|
|
3133
2886
|
});
|
|
3134
2887
|
};
|
|
@@ -3147,7 +2900,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3147
2900
|
});
|
|
3148
2901
|
return INVALID;
|
|
3149
2902
|
}
|
|
3150
|
-
if (
|
|
2903
|
+
if (isNaN(input.data.getTime())) {
|
|
3151
2904
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3152
2905
|
addIssueToContext(ctx2, {
|
|
3153
2906
|
code: ZodIssueCode.invalid_date
|
|
@@ -3236,7 +2989,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3236
2989
|
ZodDate.create = (params) => {
|
|
3237
2990
|
return new ZodDate({
|
|
3238
2991
|
checks: [],
|
|
3239
|
-
coerce: params
|
|
2992
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
3240
2993
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3241
2994
|
...processCreateParams(params)
|
|
3242
2995
|
});
|
|
@@ -3511,8 +3264,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3511
3264
|
return this._cached;
|
|
3512
3265
|
const shape = this._def.shape();
|
|
3513
3266
|
const keys = util.objectKeys(shape);
|
|
3514
|
-
this._cached = { shape, keys };
|
|
3515
|
-
return this._cached;
|
|
3267
|
+
return this._cached = { shape, keys };
|
|
3516
3268
|
}
|
|
3517
3269
|
_parse(input) {
|
|
3518
3270
|
const parsedType = this._getType(input);
|
|
@@ -3562,8 +3314,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3562
3314
|
});
|
|
3563
3315
|
status.dirty();
|
|
3564
3316
|
}
|
|
3565
|
-
} else if (unknownKeys === "strip")
|
|
3566
|
-
|
|
3317
|
+
} else if (unknownKeys === "strip") ;
|
|
3318
|
+
else {
|
|
3567
3319
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3568
3320
|
}
|
|
3569
3321
|
} else {
|
|
@@ -3610,10 +3362,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3610
3362
|
unknownKeys: "strict",
|
|
3611
3363
|
...message !== void 0 ? {
|
|
3612
3364
|
errorMap: (issue, ctx) => {
|
|
3613
|
-
|
|
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;
|
|
3614
3367
|
if (issue.code === "unrecognized_keys")
|
|
3615
3368
|
return {
|
|
3616
|
-
message: errorUtil.errToObj(message).message
|
|
3369
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
3617
3370
|
};
|
|
3618
3371
|
return {
|
|
3619
3372
|
message: defaultError
|
|
@@ -3744,11 +3497,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3744
3497
|
}
|
|
3745
3498
|
pick(mask) {
|
|
3746
3499
|
const shape = {};
|
|
3747
|
-
|
|
3500
|
+
util.objectKeys(mask).forEach((key) => {
|
|
3748
3501
|
if (mask[key] && this.shape[key]) {
|
|
3749
3502
|
shape[key] = this.shape[key];
|
|
3750
3503
|
}
|
|
3751
|
-
}
|
|
3504
|
+
});
|
|
3752
3505
|
return new _ZodObject({
|
|
3753
3506
|
...this._def,
|
|
3754
3507
|
shape: () => shape
|
|
@@ -3756,11 +3509,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3756
3509
|
}
|
|
3757
3510
|
omit(mask) {
|
|
3758
3511
|
const shape = {};
|
|
3759
|
-
|
|
3512
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3760
3513
|
if (!mask[key]) {
|
|
3761
3514
|
shape[key] = this.shape[key];
|
|
3762
3515
|
}
|
|
3763
|
-
}
|
|
3516
|
+
});
|
|
3764
3517
|
return new _ZodObject({
|
|
3765
3518
|
...this._def,
|
|
3766
3519
|
shape: () => shape
|
|
@@ -3774,14 +3527,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3774
3527
|
}
|
|
3775
3528
|
partial(mask) {
|
|
3776
3529
|
const newShape = {};
|
|
3777
|
-
|
|
3530
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3778
3531
|
const fieldSchema = this.shape[key];
|
|
3779
3532
|
if (mask && !mask[key]) {
|
|
3780
3533
|
newShape[key] = fieldSchema;
|
|
3781
3534
|
} else {
|
|
3782
3535
|
newShape[key] = fieldSchema.optional();
|
|
3783
3536
|
}
|
|
3784
|
-
}
|
|
3537
|
+
});
|
|
3785
3538
|
return new _ZodObject({
|
|
3786
3539
|
...this._def,
|
|
3787
3540
|
shape: () => newShape
|
|
@@ -3789,7 +3542,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3789
3542
|
}
|
|
3790
3543
|
required(mask) {
|
|
3791
3544
|
const newShape = {};
|
|
3792
|
-
|
|
3545
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3793
3546
|
if (mask && !mask[key]) {
|
|
3794
3547
|
newShape[key] = this.shape[key];
|
|
3795
3548
|
} else {
|
|
@@ -3800,7 +3553,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3800
3553
|
}
|
|
3801
3554
|
newShape[key] = newField;
|
|
3802
3555
|
}
|
|
3803
|
-
}
|
|
3556
|
+
});
|
|
3804
3557
|
return new _ZodObject({
|
|
3805
3558
|
...this._def,
|
|
3806
3559
|
shape: () => newShape
|
|
@@ -4416,7 +4169,12 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4416
4169
|
return makeIssue({
|
|
4417
4170
|
data: args,
|
|
4418
4171
|
path: ctx.path,
|
|
4419
|
-
errorMaps: [
|
|
4172
|
+
errorMaps: [
|
|
4173
|
+
ctx.common.contextualErrorMap,
|
|
4174
|
+
ctx.schemaErrorMap,
|
|
4175
|
+
getErrorMap(),
|
|
4176
|
+
errorMap
|
|
4177
|
+
].filter((x) => !!x),
|
|
4420
4178
|
issueData: {
|
|
4421
4179
|
code: ZodIssueCode.invalid_arguments,
|
|
4422
4180
|
argumentsError: error
|
|
@@ -4427,7 +4185,12 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4427
4185
|
return makeIssue({
|
|
4428
4186
|
data: returns,
|
|
4429
4187
|
path: ctx.path,
|
|
4430
|
-
errorMaps: [
|
|
4188
|
+
errorMaps: [
|
|
4189
|
+
ctx.common.contextualErrorMap,
|
|
4190
|
+
ctx.schemaErrorMap,
|
|
4191
|
+
getErrorMap(),
|
|
4192
|
+
errorMap
|
|
4193
|
+
].filter((x) => !!x),
|
|
4431
4194
|
issueData: {
|
|
4432
4195
|
code: ZodIssueCode.invalid_return_type,
|
|
4433
4196
|
returnTypeError: error
|
|
@@ -4551,6 +4314,10 @@ function createZodEnum(values, params) {
|
|
|
4551
4314
|
});
|
|
4552
4315
|
}
|
|
4553
4316
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4317
|
+
constructor() {
|
|
4318
|
+
super(...arguments);
|
|
4319
|
+
_ZodEnum_cache.set(this, void 0);
|
|
4320
|
+
}
|
|
4554
4321
|
_parse(input) {
|
|
4555
4322
|
if (typeof input.data !== "string") {
|
|
4556
4323
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4562,10 +4329,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4562
4329
|
});
|
|
4563
4330
|
return INVALID;
|
|
4564
4331
|
}
|
|
4565
|
-
if (!this
|
|
4566
|
-
this
|
|
4332
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
4333
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
4567
4334
|
}
|
|
4568
|
-
if (!this.
|
|
4335
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
4569
4336
|
const ctx = this._getOrReturnCtx(input);
|
|
4570
4337
|
const expectedValues = this._def.values;
|
|
4571
4338
|
addIssueToContext(ctx, {
|
|
@@ -4614,8 +4381,13 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4614
4381
|
});
|
|
4615
4382
|
}
|
|
4616
4383
|
};
|
|
4384
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4617
4385
|
ZodEnum.create = createZodEnum;
|
|
4618
4386
|
var ZodNativeEnum = class extends ZodType {
|
|
4387
|
+
constructor() {
|
|
4388
|
+
super(...arguments);
|
|
4389
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
4390
|
+
}
|
|
4619
4391
|
_parse(input) {
|
|
4620
4392
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4621
4393
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4628,10 +4400,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4628
4400
|
});
|
|
4629
4401
|
return INVALID;
|
|
4630
4402
|
}
|
|
4631
|
-
if (!this
|
|
4632
|
-
this
|
|
4403
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
4404
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
4633
4405
|
}
|
|
4634
|
-
if (!this.
|
|
4406
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
4635
4407
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
4636
4408
|
addIssueToContext(ctx, {
|
|
4637
4409
|
received: ctx.data,
|
|
@@ -4646,6 +4418,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4646
4418
|
return this._def.values;
|
|
4647
4419
|
}
|
|
4648
4420
|
};
|
|
4421
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4649
4422
|
ZodNativeEnum.create = (values, params) => {
|
|
4650
4423
|
return new ZodNativeEnum({
|
|
4651
4424
|
values,
|
|
@@ -4786,7 +4559,7 @@ var ZodEffects = class extends ZodType {
|
|
|
4786
4559
|
parent: ctx
|
|
4787
4560
|
});
|
|
4788
4561
|
if (!isValid(base))
|
|
4789
|
-
return
|
|
4562
|
+
return base;
|
|
4790
4563
|
const result = effect.transform(base.value, checkCtx);
|
|
4791
4564
|
if (result instanceof Promise) {
|
|
4792
4565
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -4795,11 +4568,8 @@ var ZodEffects = class extends ZodType {
|
|
|
4795
4568
|
} else {
|
|
4796
4569
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
4797
4570
|
if (!isValid(base))
|
|
4798
|
-
return
|
|
4799
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
4800
|
-
status: status.value,
|
|
4801
|
-
value: result
|
|
4802
|
-
}));
|
|
4571
|
+
return base;
|
|
4572
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
|
|
4803
4573
|
});
|
|
4804
4574
|
}
|
|
4805
4575
|
}
|
|
@@ -5051,30 +4821,16 @@ ZodReadonly.create = (type, params) => {
|
|
|
5051
4821
|
...processCreateParams(params)
|
|
5052
4822
|
});
|
|
5053
4823
|
};
|
|
5054
|
-
function
|
|
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) {
|
|
4824
|
+
function custom(check, params = {}, fatal) {
|
|
5060
4825
|
if (check)
|
|
5061
4826
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5062
|
-
|
|
5063
|
-
if (
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5069
|
-
}
|
|
5070
|
-
});
|
|
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 });
|
|
5071
4833
|
}
|
|
5072
|
-
if (!r) {
|
|
5073
|
-
const params = cleanParams(_params, data);
|
|
5074
|
-
const _fatal = params.fatal ?? fatal ?? true;
|
|
5075
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5076
|
-
}
|
|
5077
|
-
return;
|
|
5078
4834
|
});
|
|
5079
4835
|
return ZodAny.create();
|
|
5080
4836
|
}
|
|
@@ -5171,12 +4927,128 @@ var coerce = {
|
|
|
5171
4927
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5172
4928
|
};
|
|
5173
4929
|
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
|
+
});
|
|
5174
5046
|
|
|
5175
5047
|
// src/core/credit/types.ts
|
|
5176
|
-
var getNamespaceRemainingInstillCreditResponseValidator =
|
|
5177
|
-
perishable:
|
|
5178
|
-
imperishable:
|
|
5179
|
-
total:
|
|
5048
|
+
var getNamespaceRemainingInstillCreditResponseValidator = z.object({
|
|
5049
|
+
perishable: z.number(),
|
|
5050
|
+
imperishable: z.number(),
|
|
5051
|
+
total: z.number()
|
|
5180
5052
|
});
|
|
5181
5053
|
|
|
5182
5054
|
// src/core/membership/MembershipClient.ts
|
|
@@ -5468,94 +5340,94 @@ var UserClient = class extends APIResource {
|
|
|
5468
5340
|
};
|
|
5469
5341
|
|
|
5470
5342
|
// src/core/user/types.ts
|
|
5471
|
-
var OnboardingStatusSchema =
|
|
5343
|
+
var OnboardingStatusSchema = z.enum([
|
|
5472
5344
|
"ONBOARDING_STATUS_UNSPECIFIED",
|
|
5473
5345
|
"ONBOARDING_STATUS_IN_PROGRESS",
|
|
5474
5346
|
"ONBOARDING_STATUS_COMPLETED"
|
|
5475
5347
|
]);
|
|
5476
|
-
var UserProfileSchema =
|
|
5477
|
-
displayName:
|
|
5478
|
-
bio:
|
|
5479
|
-
publicEmail:
|
|
5480
|
-
companyName:
|
|
5481
|
-
avatar:
|
|
5482
|
-
socialProfilesLinks:
|
|
5483
|
-
webiste:
|
|
5484
|
-
x:
|
|
5485
|
-
github:
|
|
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()
|
|
5486
5358
|
}).optional()
|
|
5487
5359
|
});
|
|
5488
|
-
var UserSchema =
|
|
5489
|
-
name:
|
|
5490
|
-
uid:
|
|
5491
|
-
id:
|
|
5492
|
-
createTime:
|
|
5493
|
-
updateTime:
|
|
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(),
|
|
5494
5366
|
profile: UserProfileSchema.optional()
|
|
5495
5367
|
});
|
|
5496
|
-
var AuthenticatedUserSchema =
|
|
5497
|
-
name:
|
|
5498
|
-
uid:
|
|
5499
|
-
id:
|
|
5500
|
-
createTime:
|
|
5501
|
-
updateTime:
|
|
5502
|
-
customerId:
|
|
5503
|
-
email:
|
|
5504
|
-
newsletterSubscription:
|
|
5505
|
-
role:
|
|
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(),
|
|
5506
5378
|
onboardingStatus: OnboardingStatusSchema,
|
|
5507
|
-
cookieToken:
|
|
5379
|
+
cookieToken: z.string().optional(),
|
|
5508
5380
|
profile: UserProfileSchema.optional()
|
|
5509
5381
|
});
|
|
5510
|
-
var listUsersWithPaginationResponseValidator =
|
|
5511
|
-
users:
|
|
5512
|
-
nextPageToken:
|
|
5513
|
-
totalSize:
|
|
5382
|
+
var listUsersWithPaginationResponseValidator = z.object({
|
|
5383
|
+
users: z.array(UserSchema),
|
|
5384
|
+
nextPageToken: z.string(),
|
|
5385
|
+
totalSize: z.number()
|
|
5514
5386
|
});
|
|
5515
5387
|
|
|
5516
5388
|
// src/core/organization/types.ts
|
|
5517
|
-
var OrganizationProfileSchema =
|
|
5518
|
-
displayName:
|
|
5519
|
-
bio:
|
|
5520
|
-
publicEmail:
|
|
5521
|
-
avatar:
|
|
5522
|
-
socialProfilesLinks:
|
|
5523
|
-
webiste:
|
|
5524
|
-
x:
|
|
5525
|
-
github:
|
|
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()
|
|
5526
5398
|
}).optional()
|
|
5527
5399
|
});
|
|
5528
|
-
var OrganizationSchema =
|
|
5529
|
-
name:
|
|
5530
|
-
uid:
|
|
5531
|
-
id:
|
|
5532
|
-
createTime:
|
|
5533
|
-
updateTime:
|
|
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(),
|
|
5534
5406
|
owner: UserSchema,
|
|
5535
5407
|
profile: OrganizationProfileSchema.optional()
|
|
5536
5408
|
});
|
|
5537
5409
|
|
|
5538
5410
|
// src/core/membership/types.ts
|
|
5539
|
-
var MembershipStateSchema =
|
|
5411
|
+
var MembershipStateSchema = z.enum([
|
|
5540
5412
|
"MEMBERSHIP_STATE_ACTIVE",
|
|
5541
5413
|
"MEMBERSHIP_STATE_PENDING"
|
|
5542
5414
|
]);
|
|
5543
|
-
var UserMembershipSchema =
|
|
5415
|
+
var UserMembershipSchema = z.object({
|
|
5544
5416
|
user: UserSchema,
|
|
5545
5417
|
organization: OrganizationSchema,
|
|
5546
|
-
name:
|
|
5547
|
-
role:
|
|
5418
|
+
name: z.string().nullable(),
|
|
5419
|
+
role: z.string(),
|
|
5548
5420
|
state: MembershipStateSchema
|
|
5549
5421
|
});
|
|
5550
|
-
var OrganizationMembershipSchema =
|
|
5422
|
+
var OrganizationMembershipSchema = z.object({
|
|
5551
5423
|
user: UserSchema,
|
|
5552
5424
|
organization: OrganizationSchema,
|
|
5553
|
-
name:
|
|
5554
|
-
role:
|
|
5425
|
+
name: z.string().nullable(),
|
|
5426
|
+
role: z.string(),
|
|
5555
5427
|
state: MembershipStateSchema
|
|
5556
5428
|
});
|
|
5557
|
-
var listUserMembershipsResponseValidator =
|
|
5558
|
-
var listOrganizationMembershipsResponseValidator =
|
|
5429
|
+
var listUserMembershipsResponseValidator = z.array(UserMembershipSchema);
|
|
5430
|
+
var listOrganizationMembershipsResponseValidator = z.array(
|
|
5559
5431
|
OrganizationMembershipSchema
|
|
5560
5432
|
);
|
|
5561
5433
|
|
|
@@ -6353,27 +6225,27 @@ var ComponentClient = class extends APIResource {
|
|
|
6353
6225
|
};
|
|
6354
6226
|
|
|
6355
6227
|
// src/types.ts
|
|
6356
|
-
var PermissionSchema =
|
|
6357
|
-
canEdit:
|
|
6358
|
-
canTrigger:
|
|
6228
|
+
var PermissionSchema = z.object({
|
|
6229
|
+
canEdit: z.boolean(),
|
|
6230
|
+
canTrigger: z.boolean()
|
|
6359
6231
|
});
|
|
6360
|
-
var UserOwnerSchema =
|
|
6232
|
+
var UserOwnerSchema = z.object({
|
|
6361
6233
|
user: UserSchema
|
|
6362
6234
|
});
|
|
6363
|
-
var OrganizationOwnerSchema =
|
|
6235
|
+
var OrganizationOwnerSchema = z.object({
|
|
6364
6236
|
organization: OrganizationSchema
|
|
6365
6237
|
});
|
|
6366
|
-
var OwnerSchema =
|
|
6367
|
-
var DataSpecificationSchema =
|
|
6368
|
-
input:
|
|
6369
|
-
output:
|
|
6238
|
+
var OwnerSchema = z.union([UserOwnerSchema, OrganizationOwnerSchema]);
|
|
6239
|
+
var DataSpecificationSchema = z.object({
|
|
6240
|
+
input: z.any().nullable(),
|
|
6241
|
+
output: z.any().nullable()
|
|
6370
6242
|
});
|
|
6371
|
-
var SpecSchema =
|
|
6372
|
-
componentSpecification:
|
|
6373
|
-
dataSpecifications:
|
|
6374
|
-
|
|
6375
|
-
input:
|
|
6376
|
-
output:
|
|
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()
|
|
6377
6249
|
})
|
|
6378
6250
|
).nullable()
|
|
6379
6251
|
});
|
|
@@ -6388,7 +6260,7 @@ var InstillError = class extends Error {
|
|
|
6388
6260
|
};
|
|
6389
6261
|
|
|
6390
6262
|
// src/vdp/component/types.ts
|
|
6391
|
-
var ComponentTypeSchema =
|
|
6263
|
+
var ComponentTypeSchema = z.enum([
|
|
6392
6264
|
"COMPONENT_TYPE_UNSPECIFIED",
|
|
6393
6265
|
"COMPONENT_TYPE_OPERATOR",
|
|
6394
6266
|
"COMPONENT_TYPE_DATA",
|
|
@@ -6396,79 +6268,79 @@ var ComponentTypeSchema = external_exports.enum([
|
|
|
6396
6268
|
"COMPONENT_TYPE_APPLICATION",
|
|
6397
6269
|
"COMPONENT_TYPE_GENERIC"
|
|
6398
6270
|
]);
|
|
6399
|
-
var TaskSchema =
|
|
6400
|
-
name:
|
|
6401
|
-
title:
|
|
6402
|
-
description:
|
|
6271
|
+
var TaskSchema = z.object({
|
|
6272
|
+
name: z.string(),
|
|
6273
|
+
title: z.string(),
|
|
6274
|
+
description: z.string()
|
|
6403
6275
|
});
|
|
6404
|
-
var ConnectorDefinitionSchema =
|
|
6405
|
-
name:
|
|
6406
|
-
uid:
|
|
6407
|
-
id:
|
|
6408
|
-
title:
|
|
6409
|
-
documentationUrl:
|
|
6410
|
-
icon:
|
|
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(),
|
|
6411
6283
|
type: ComponentTypeSchema,
|
|
6412
6284
|
spec: SpecSchema,
|
|
6413
|
-
tombstone:
|
|
6414
|
-
public:
|
|
6415
|
-
custom:
|
|
6416
|
-
vendor:
|
|
6417
|
-
vendorAttributes:
|
|
6418
|
-
tasks:
|
|
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)
|
|
6419
6291
|
});
|
|
6420
|
-
var ComponentDefinitionSchema =
|
|
6421
|
-
name:
|
|
6422
|
-
uid:
|
|
6423
|
-
id:
|
|
6424
|
-
title:
|
|
6425
|
-
documentationUrl:
|
|
6426
|
-
icon:
|
|
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(),
|
|
6427
6299
|
spec: SpecSchema,
|
|
6428
6300
|
type: ComponentTypeSchema,
|
|
6429
|
-
tombstone:
|
|
6430
|
-
public:
|
|
6431
|
-
custom:
|
|
6432
|
-
vendor:
|
|
6433
|
-
vendorAttributes:
|
|
6434
|
-
sourceUrl:
|
|
6435
|
-
version:
|
|
6436
|
-
tasks:
|
|
6437
|
-
description:
|
|
6438
|
-
releaseStage:
|
|
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()
|
|
6439
6311
|
});
|
|
6440
|
-
var OperatorDefinitionSchema =
|
|
6441
|
-
name:
|
|
6442
|
-
uid:
|
|
6443
|
-
id:
|
|
6444
|
-
title:
|
|
6445
|
-
documentationUrl:
|
|
6446
|
-
icon:
|
|
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(),
|
|
6447
6319
|
spec: SpecSchema,
|
|
6448
|
-
tombstone:
|
|
6449
|
-
public:
|
|
6450
|
-
custom:
|
|
6451
|
-
tasks:
|
|
6320
|
+
tombstone: z.boolean(),
|
|
6321
|
+
public: z.boolean(),
|
|
6322
|
+
custom: z.boolean(),
|
|
6323
|
+
tasks: z.array(TaskSchema),
|
|
6452
6324
|
type: ComponentTypeSchema
|
|
6453
6325
|
});
|
|
6454
|
-
var listConnectorDefinitionsWithPaginationResponseValidator =
|
|
6326
|
+
var listConnectorDefinitionsWithPaginationResponseValidator = z.object(
|
|
6455
6327
|
{
|
|
6456
|
-
connectorDefinitions:
|
|
6457
|
-
nextPageToken:
|
|
6458
|
-
totalSize:
|
|
6328
|
+
connectorDefinitions: z.array(ConnectorDefinitionSchema),
|
|
6329
|
+
nextPageToken: z.string(),
|
|
6330
|
+
totalSize: z.number()
|
|
6459
6331
|
}
|
|
6460
6332
|
);
|
|
6461
|
-
var listComponentDefinitionsWithPaginationResponseValidator =
|
|
6333
|
+
var listComponentDefinitionsWithPaginationResponseValidator = z.object(
|
|
6462
6334
|
{
|
|
6463
|
-
componentDefinitions:
|
|
6464
|
-
nextPageToken:
|
|
6465
|
-
totalSize:
|
|
6335
|
+
componentDefinitions: z.array(ComponentDefinitionSchema),
|
|
6336
|
+
nextPageToken: z.string(),
|
|
6337
|
+
totalSize: z.number()
|
|
6466
6338
|
}
|
|
6467
6339
|
);
|
|
6468
|
-
var listOperatorDefinitionsWithPaginationResponseValidator =
|
|
6469
|
-
operatorDefinitions:
|
|
6470
|
-
nextPageToken:
|
|
6471
|
-
totalSize:
|
|
6340
|
+
var listOperatorDefinitionsWithPaginationResponseValidator = z.object({
|
|
6341
|
+
operatorDefinitions: z.array(OperatorDefinitionSchema),
|
|
6342
|
+
nextPageToken: z.string(),
|
|
6343
|
+
totalSize: z.number()
|
|
6472
6344
|
});
|
|
6473
6345
|
|
|
6474
6346
|
// src/vdp/pipeline/PipelineClient.ts
|
|
@@ -6828,82 +6700,82 @@ var ReleaseClient = class extends APIResource {
|
|
|
6828
6700
|
};
|
|
6829
6701
|
|
|
6830
6702
|
// src/vdp/release/types.ts
|
|
6831
|
-
var PipelineReleaseSchema =
|
|
6832
|
-
name:
|
|
6833
|
-
uid:
|
|
6834
|
-
id:
|
|
6835
|
-
description:
|
|
6703
|
+
var PipelineReleaseSchema = z.object({
|
|
6704
|
+
name: z.string(),
|
|
6705
|
+
uid: z.string(),
|
|
6706
|
+
id: z.string(),
|
|
6707
|
+
description: z.string(),
|
|
6836
6708
|
// Our openapi isn't fully typed on the recipe field yet
|
|
6837
|
-
recipe:
|
|
6838
|
-
createTime:
|
|
6839
|
-
updateTime:
|
|
6840
|
-
deleteTime:
|
|
6841
|
-
metadata:
|
|
6842
|
-
alias:
|
|
6843
|
-
readme:
|
|
6844
|
-
rawRecipe:
|
|
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(),
|
|
6845
6717
|
dataSpecification: DataSpecificationSchema
|
|
6846
6718
|
});
|
|
6847
6719
|
|
|
6848
6720
|
// src/vdp/pipeline/types.ts
|
|
6849
|
-
var PipelineStatsSchema =
|
|
6850
|
-
lastRunTime:
|
|
6851
|
-
numberOfRuns:
|
|
6721
|
+
var PipelineStatsSchema = z.object({
|
|
6722
|
+
lastRunTime: z.string(),
|
|
6723
|
+
numberOfRuns: z.number()
|
|
6852
6724
|
});
|
|
6853
|
-
var PermissionRoleSchema =
|
|
6725
|
+
var PermissionRoleSchema = z.enum([
|
|
6854
6726
|
"ROLE_UNSPECIFIED",
|
|
6855
6727
|
"ROLE_VIEWER",
|
|
6856
6728
|
"ROLE_EXECUTOR"
|
|
6857
6729
|
]);
|
|
6858
|
-
var PipelineSharingCodeRuleSchema =
|
|
6859
|
-
user:
|
|
6860
|
-
code:
|
|
6861
|
-
enabled:
|
|
6730
|
+
var PipelineSharingCodeRuleSchema = z.object({
|
|
6731
|
+
user: z.string(),
|
|
6732
|
+
code: z.string().optional(),
|
|
6733
|
+
enabled: z.boolean(),
|
|
6862
6734
|
role: PermissionRoleSchema
|
|
6863
6735
|
});
|
|
6864
|
-
var PipelineSharingUserRulesSchema =
|
|
6865
|
-
|
|
6866
|
-
enabled:
|
|
6736
|
+
var PipelineSharingUserRulesSchema = z.record(
|
|
6737
|
+
z.object({
|
|
6738
|
+
enabled: z.boolean(),
|
|
6867
6739
|
role: PermissionRoleSchema
|
|
6868
6740
|
}).optional()
|
|
6869
6741
|
);
|
|
6870
|
-
var PipelineSharingSchema =
|
|
6742
|
+
var PipelineSharingSchema = z.object({
|
|
6871
6743
|
users: PipelineSharingUserRulesSchema,
|
|
6872
6744
|
shareCode: PipelineSharingCodeRuleSchema.nullable()
|
|
6873
6745
|
});
|
|
6874
|
-
var PipelineSchema =
|
|
6875
|
-
name:
|
|
6876
|
-
uid:
|
|
6877
|
-
id:
|
|
6878
|
-
description:
|
|
6879
|
-
readme:
|
|
6880
|
-
createTime:
|
|
6881
|
-
updateTime:
|
|
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(),
|
|
6882
6754
|
// Our openapi isn't fully typed on the recipe field yet
|
|
6883
|
-
recipe:
|
|
6755
|
+
recipe: z.record(z.any()),
|
|
6884
6756
|
dataSpecification: DataSpecificationSchema,
|
|
6885
6757
|
owner: OwnerSchema,
|
|
6886
|
-
ownerName:
|
|
6887
|
-
releases:
|
|
6758
|
+
ownerName: z.string(),
|
|
6759
|
+
releases: z.array(PipelineReleaseSchema),
|
|
6888
6760
|
sharing: PipelineSharingSchema,
|
|
6889
|
-
metadata:
|
|
6761
|
+
metadata: z.record(z.any()),
|
|
6890
6762
|
permission: PermissionSchema,
|
|
6891
|
-
tags:
|
|
6763
|
+
tags: z.array(z.string()),
|
|
6892
6764
|
stats: PipelineStatsSchema,
|
|
6893
|
-
profileImage:
|
|
6894
|
-
sourceUrl:
|
|
6895
|
-
documentationUrl:
|
|
6896
|
-
license:
|
|
6765
|
+
profileImage: z.string(),
|
|
6766
|
+
sourceUrl: z.string(),
|
|
6767
|
+
documentationUrl: z.string(),
|
|
6768
|
+
license: z.string()
|
|
6897
6769
|
});
|
|
6898
|
-
var listAccessiblePipelinesWithPaginationResponseValidator =
|
|
6899
|
-
pipelines:
|
|
6900
|
-
nextPageToken:
|
|
6901
|
-
totalSize:
|
|
6770
|
+
var listAccessiblePipelinesWithPaginationResponseValidator = z.object({
|
|
6771
|
+
pipelines: z.array(PipelineSchema),
|
|
6772
|
+
nextPageToken: z.string(),
|
|
6773
|
+
totalSize: z.number()
|
|
6902
6774
|
});
|
|
6903
|
-
var listNamespacePipelinesWithPaginationResponseValidator =
|
|
6904
|
-
pipelines:
|
|
6905
|
-
nextPageToken:
|
|
6906
|
-
totalSize:
|
|
6775
|
+
var listNamespacePipelinesWithPaginationResponseValidator = z.object({
|
|
6776
|
+
pipelines: z.array(PipelineSchema),
|
|
6777
|
+
nextPageToken: z.string(),
|
|
6778
|
+
totalSize: z.number()
|
|
6907
6779
|
});
|
|
6908
6780
|
|
|
6909
6781
|
// src/vdp/secret/SecretClient.ts
|
|
@@ -7194,63 +7066,63 @@ var TriggerClient = class extends APIResource {
|
|
|
7194
7066
|
};
|
|
7195
7067
|
|
|
7196
7068
|
// src/vdp/types.ts
|
|
7197
|
-
var PipelineVariableFieldSchema =
|
|
7198
|
-
title:
|
|
7199
|
-
instillFormat:
|
|
7200
|
-
description:
|
|
7201
|
-
instillUiOrder:
|
|
7202
|
-
instillUiMultiline:
|
|
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()
|
|
7203
7075
|
});
|
|
7204
|
-
var PipelineVariableFieldMapSchema =
|
|
7076
|
+
var PipelineVariableFieldMapSchema = z.record(
|
|
7205
7077
|
PipelineVariableFieldSchema.nullable()
|
|
7206
7078
|
);
|
|
7207
|
-
var PipelineOutputFieldSchema =
|
|
7208
|
-
title:
|
|
7209
|
-
description:
|
|
7210
|
-
value:
|
|
7211
|
-
instillUiOrder:
|
|
7079
|
+
var PipelineOutputFieldSchema = z.object({
|
|
7080
|
+
title: z.string(),
|
|
7081
|
+
description: z.string().optional(),
|
|
7082
|
+
value: z.string(),
|
|
7083
|
+
instillUiOrder: z.number().optional()
|
|
7212
7084
|
});
|
|
7213
|
-
var PipelineOutputFieldMapSchema =
|
|
7085
|
+
var PipelineOutputFieldMapSchema = z.record(
|
|
7214
7086
|
PipelineOutputFieldSchema.nullable()
|
|
7215
7087
|
);
|
|
7216
|
-
var PipelineComponentMapSchema =
|
|
7217
|
-
var PipelineRunOnEventItemMapSchema =
|
|
7218
|
-
var PipelineRunOnMapSchema =
|
|
7219
|
-
var PipelineRecipeSchema =
|
|
7220
|
-
version:
|
|
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(),
|
|
7221
7093
|
component: PipelineComponentMapSchema.optional(),
|
|
7222
7094
|
variable: PipelineVariableFieldMapSchema.optional(),
|
|
7223
7095
|
output: PipelineOutputFieldMapSchema.optional(),
|
|
7224
7096
|
on: PipelineRunOnMapSchema.optional()
|
|
7225
7097
|
});
|
|
7226
|
-
var ResourceViewSchema =
|
|
7098
|
+
var ResourceViewSchema = z.enum(["VIEW_FULL", "VIEW_BASIC"]);
|
|
7227
7099
|
|
|
7228
7100
|
// src/core/integration/type.ts
|
|
7229
|
-
var HelpLinkSchema =
|
|
7230
|
-
text:
|
|
7231
|
-
url:
|
|
7101
|
+
var HelpLinkSchema = z.object({
|
|
7102
|
+
text: z.string(),
|
|
7103
|
+
url: z.string()
|
|
7232
7104
|
});
|
|
7233
|
-
var OAuthConfigSchema =
|
|
7234
|
-
authUrl:
|
|
7235
|
-
accessUrl:
|
|
7236
|
-
scopes:
|
|
7105
|
+
var OAuthConfigSchema = z.object({
|
|
7106
|
+
authUrl: z.string(),
|
|
7107
|
+
accessUrl: z.string(),
|
|
7108
|
+
scopes: z.array(z.string())
|
|
7237
7109
|
});
|
|
7238
|
-
var IntegrationSchema =
|
|
7239
|
-
uid:
|
|
7240
|
-
id:
|
|
7241
|
-
title:
|
|
7242
|
-
description:
|
|
7243
|
-
vendor:
|
|
7244
|
-
icon:
|
|
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(),
|
|
7245
7117
|
helpLink: HelpLinkSchema,
|
|
7246
|
-
setupSchema:
|
|
7118
|
+
setupSchema: z.any(),
|
|
7247
7119
|
oAuthConfig: OAuthConfigSchema.nullable(),
|
|
7248
7120
|
view: ResourceViewSchema
|
|
7249
7121
|
});
|
|
7250
|
-
var listPaginatedIntegrationsResponseValidator =
|
|
7251
|
-
integrations:
|
|
7252
|
-
nextPageToken:
|
|
7253
|
-
totalSize:
|
|
7122
|
+
var listPaginatedIntegrationsResponseValidator = z.object({
|
|
7123
|
+
integrations: z.array(IntegrationSchema),
|
|
7124
|
+
nextPageToken: z.string().nullable(),
|
|
7125
|
+
totalSize: z.number()
|
|
7254
7126
|
});
|
|
7255
7127
|
|
|
7256
7128
|
// src/core/utils/UtilsClient.ts
|
|
@@ -8488,6 +8360,106 @@ var InstillChatTypeEnum = {
|
|
|
8488
8360
|
TableCreated: "CHAT_TABLE_CREATED"
|
|
8489
8361
|
};
|
|
8490
8362
|
|
|
8363
|
+
// src/folder/FolderClient.ts
|
|
8364
|
+
var FolderClient = class extends APIResource {
|
|
8365
|
+
async createInstillFolder(props) {
|
|
8366
|
+
const { namespaceId, ...payload } = props;
|
|
8367
|
+
try {
|
|
8368
|
+
const data = await this._client.post(
|
|
8369
|
+
`/namespaces/${namespaceId}/folders`,
|
|
8370
|
+
{
|
|
8371
|
+
body: JSON.stringify(payload)
|
|
8372
|
+
}
|
|
8373
|
+
);
|
|
8374
|
+
return Promise.resolve(data);
|
|
8375
|
+
} catch (error) {
|
|
8376
|
+
return Promise.reject(error);
|
|
8377
|
+
}
|
|
8378
|
+
}
|
|
8379
|
+
async getInstillFolder(props) {
|
|
8380
|
+
const { namespaceId, folderUid } = props;
|
|
8381
|
+
try {
|
|
8382
|
+
const response = await this._client.get(
|
|
8383
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`
|
|
8384
|
+
);
|
|
8385
|
+
return Promise.resolve(response);
|
|
8386
|
+
} catch (error) {
|
|
8387
|
+
return Promise.reject(error);
|
|
8388
|
+
}
|
|
8389
|
+
}
|
|
8390
|
+
async updateInstillFolder(props) {
|
|
8391
|
+
const { namespaceId, folderUid, ...body } = props;
|
|
8392
|
+
try {
|
|
8393
|
+
const data = await this._client.put(
|
|
8394
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`,
|
|
8395
|
+
{
|
|
8396
|
+
body: JSON.stringify(body)
|
|
8397
|
+
}
|
|
8398
|
+
);
|
|
8399
|
+
return Promise.resolve(data);
|
|
8400
|
+
} catch (error) {
|
|
8401
|
+
return Promise.reject(error);
|
|
8402
|
+
}
|
|
8403
|
+
}
|
|
8404
|
+
async deleteInstillFolder(props) {
|
|
8405
|
+
const { namespaceId, folderUid } = props;
|
|
8406
|
+
try {
|
|
8407
|
+
await this._client.delete(
|
|
8408
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`
|
|
8409
|
+
);
|
|
8410
|
+
return Promise.resolve();
|
|
8411
|
+
} catch (error) {
|
|
8412
|
+
return Promise.reject(error);
|
|
8413
|
+
}
|
|
8414
|
+
}
|
|
8415
|
+
async listPaginatedInstillFolders(props) {
|
|
8416
|
+
const { namespaceId, pageToken, pageSize } = props;
|
|
8417
|
+
const queryString = getQueryString({
|
|
8418
|
+
baseURL: `/namespaces/${namespaceId}/folders`,
|
|
8419
|
+
pageToken,
|
|
8420
|
+
pageSize
|
|
8421
|
+
});
|
|
8422
|
+
try {
|
|
8423
|
+
const data = await this._client.get(
|
|
8424
|
+
queryString
|
|
8425
|
+
);
|
|
8426
|
+
return Promise.resolve(data);
|
|
8427
|
+
} catch (error) {
|
|
8428
|
+
return Promise.reject(error);
|
|
8429
|
+
}
|
|
8430
|
+
}
|
|
8431
|
+
async listInstillFolders(props) {
|
|
8432
|
+
const { namespaceId, pageToken, pageSize } = props;
|
|
8433
|
+
const queryString = getQueryString({
|
|
8434
|
+
baseURL: `/namespaces/${namespaceId}/folders`,
|
|
8435
|
+
pageToken,
|
|
8436
|
+
pageSize
|
|
8437
|
+
});
|
|
8438
|
+
const folders = [];
|
|
8439
|
+
try {
|
|
8440
|
+
const data = await this._client.get(
|
|
8441
|
+
queryString
|
|
8442
|
+
);
|
|
8443
|
+
folders.push(...data.folders);
|
|
8444
|
+
if (data.nextPageToken) {
|
|
8445
|
+
folders.push(
|
|
8446
|
+
...(await this.listInstillFolders({
|
|
8447
|
+
namespaceId,
|
|
8448
|
+
pageSize,
|
|
8449
|
+
pageToken: data.nextPageToken
|
|
8450
|
+
})).folders
|
|
8451
|
+
);
|
|
8452
|
+
}
|
|
8453
|
+
const response = {
|
|
8454
|
+
folders
|
|
8455
|
+
};
|
|
8456
|
+
return Promise.resolve(response);
|
|
8457
|
+
} catch (error) {
|
|
8458
|
+
return Promise.reject(error);
|
|
8459
|
+
}
|
|
8460
|
+
}
|
|
8461
|
+
};
|
|
8462
|
+
|
|
8491
8463
|
// src/main/index.ts
|
|
8492
8464
|
var InstillAPIClient = class {
|
|
8493
8465
|
baseURL;
|
|
@@ -8588,6 +8560,7 @@ var InstillAPIClient = class {
|
|
|
8588
8560
|
artifact = new ArtifactClient(this);
|
|
8589
8561
|
table = new TableClient(this);
|
|
8590
8562
|
chat = new ChatClient(this);
|
|
8563
|
+
folder = new FolderClient(this);
|
|
8591
8564
|
};
|
|
8592
8565
|
|
|
8593
8566
|
// src/vdp/trigger/streamHelpers.ts
|
|
@@ -8616,6 +8589,7 @@ export {
|
|
|
8616
8589
|
ApplicationClient,
|
|
8617
8590
|
ChatClient,
|
|
8618
8591
|
DataSpecificationSchema,
|
|
8592
|
+
FolderClient,
|
|
8619
8593
|
InstillAPIClient,
|
|
8620
8594
|
InstillChatTypeEnum,
|
|
8621
8595
|
InstillError,
|