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.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(index_exports, {
|
|
|
23
23
|
ApplicationClient: () => ApplicationClient,
|
|
24
24
|
ChatClient: () => ChatClient,
|
|
25
25
|
DataSpecificationSchema: () => DataSpecificationSchema,
|
|
26
|
+
FolderClient: () => FolderClient,
|
|
26
27
|
InstillAPIClient: () => InstillAPIClient,
|
|
27
28
|
InstillChatTypeEnum: () => InstillChatTypeEnum,
|
|
28
29
|
InstillError: () => InstillError,
|
|
@@ -1183,123 +1184,10 @@ var CreditClient = class extends APIResource {
|
|
|
1183
1184
|
}
|
|
1184
1185
|
};
|
|
1185
1186
|
|
|
1186
|
-
// ../../node_modules/.pnpm/zod@3.
|
|
1187
|
-
var external_exports = {};
|
|
1188
|
-
__export(external_exports, {
|
|
1189
|
-
BRAND: () => BRAND,
|
|
1190
|
-
DIRTY: () => DIRTY,
|
|
1191
|
-
EMPTY_PATH: () => EMPTY_PATH,
|
|
1192
|
-
INVALID: () => INVALID,
|
|
1193
|
-
NEVER: () => NEVER,
|
|
1194
|
-
OK: () => OK,
|
|
1195
|
-
ParseStatus: () => ParseStatus,
|
|
1196
|
-
Schema: () => ZodType,
|
|
1197
|
-
ZodAny: () => ZodAny,
|
|
1198
|
-
ZodArray: () => ZodArray,
|
|
1199
|
-
ZodBigInt: () => ZodBigInt,
|
|
1200
|
-
ZodBoolean: () => ZodBoolean,
|
|
1201
|
-
ZodBranded: () => ZodBranded,
|
|
1202
|
-
ZodCatch: () => ZodCatch,
|
|
1203
|
-
ZodDate: () => ZodDate,
|
|
1204
|
-
ZodDefault: () => ZodDefault,
|
|
1205
|
-
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
1206
|
-
ZodEffects: () => ZodEffects,
|
|
1207
|
-
ZodEnum: () => ZodEnum,
|
|
1208
|
-
ZodError: () => ZodError,
|
|
1209
|
-
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1210
|
-
ZodFunction: () => ZodFunction,
|
|
1211
|
-
ZodIntersection: () => ZodIntersection,
|
|
1212
|
-
ZodIssueCode: () => ZodIssueCode,
|
|
1213
|
-
ZodLazy: () => ZodLazy,
|
|
1214
|
-
ZodLiteral: () => ZodLiteral,
|
|
1215
|
-
ZodMap: () => ZodMap,
|
|
1216
|
-
ZodNaN: () => ZodNaN,
|
|
1217
|
-
ZodNativeEnum: () => ZodNativeEnum,
|
|
1218
|
-
ZodNever: () => ZodNever,
|
|
1219
|
-
ZodNull: () => ZodNull,
|
|
1220
|
-
ZodNullable: () => ZodNullable,
|
|
1221
|
-
ZodNumber: () => ZodNumber,
|
|
1222
|
-
ZodObject: () => ZodObject,
|
|
1223
|
-
ZodOptional: () => ZodOptional,
|
|
1224
|
-
ZodParsedType: () => ZodParsedType,
|
|
1225
|
-
ZodPipeline: () => ZodPipeline,
|
|
1226
|
-
ZodPromise: () => ZodPromise,
|
|
1227
|
-
ZodReadonly: () => ZodReadonly,
|
|
1228
|
-
ZodRecord: () => ZodRecord,
|
|
1229
|
-
ZodSchema: () => ZodType,
|
|
1230
|
-
ZodSet: () => ZodSet,
|
|
1231
|
-
ZodString: () => ZodString,
|
|
1232
|
-
ZodSymbol: () => ZodSymbol,
|
|
1233
|
-
ZodTransformer: () => ZodEffects,
|
|
1234
|
-
ZodTuple: () => ZodTuple,
|
|
1235
|
-
ZodType: () => ZodType,
|
|
1236
|
-
ZodUndefined: () => ZodUndefined,
|
|
1237
|
-
ZodUnion: () => ZodUnion,
|
|
1238
|
-
ZodUnknown: () => ZodUnknown,
|
|
1239
|
-
ZodVoid: () => ZodVoid,
|
|
1240
|
-
addIssueToContext: () => addIssueToContext,
|
|
1241
|
-
any: () => anyType,
|
|
1242
|
-
array: () => arrayType,
|
|
1243
|
-
bigint: () => bigIntType,
|
|
1244
|
-
boolean: () => booleanType,
|
|
1245
|
-
coerce: () => coerce,
|
|
1246
|
-
custom: () => custom,
|
|
1247
|
-
date: () => dateType,
|
|
1248
|
-
datetimeRegex: () => datetimeRegex,
|
|
1249
|
-
defaultErrorMap: () => en_default,
|
|
1250
|
-
discriminatedUnion: () => discriminatedUnionType,
|
|
1251
|
-
effect: () => effectsType,
|
|
1252
|
-
enum: () => enumType,
|
|
1253
|
-
function: () => functionType,
|
|
1254
|
-
getErrorMap: () => getErrorMap,
|
|
1255
|
-
getParsedType: () => getParsedType,
|
|
1256
|
-
instanceof: () => instanceOfType,
|
|
1257
|
-
intersection: () => intersectionType,
|
|
1258
|
-
isAborted: () => isAborted,
|
|
1259
|
-
isAsync: () => isAsync,
|
|
1260
|
-
isDirty: () => isDirty,
|
|
1261
|
-
isValid: () => isValid,
|
|
1262
|
-
late: () => late,
|
|
1263
|
-
lazy: () => lazyType,
|
|
1264
|
-
literal: () => literalType,
|
|
1265
|
-
makeIssue: () => makeIssue,
|
|
1266
|
-
map: () => mapType,
|
|
1267
|
-
nan: () => nanType,
|
|
1268
|
-
nativeEnum: () => nativeEnumType,
|
|
1269
|
-
never: () => neverType,
|
|
1270
|
-
null: () => nullType,
|
|
1271
|
-
nullable: () => nullableType,
|
|
1272
|
-
number: () => numberType,
|
|
1273
|
-
object: () => objectType,
|
|
1274
|
-
objectUtil: () => objectUtil,
|
|
1275
|
-
oboolean: () => oboolean,
|
|
1276
|
-
onumber: () => onumber,
|
|
1277
|
-
optional: () => optionalType,
|
|
1278
|
-
ostring: () => ostring,
|
|
1279
|
-
pipeline: () => pipelineType,
|
|
1280
|
-
preprocess: () => preprocessType,
|
|
1281
|
-
promise: () => promiseType,
|
|
1282
|
-
quotelessJson: () => quotelessJson,
|
|
1283
|
-
record: () => recordType,
|
|
1284
|
-
set: () => setType,
|
|
1285
|
-
setErrorMap: () => setErrorMap,
|
|
1286
|
-
strictObject: () => strictObjectType,
|
|
1287
|
-
string: () => stringType,
|
|
1288
|
-
symbol: () => symbolType,
|
|
1289
|
-
transformer: () => effectsType,
|
|
1290
|
-
tuple: () => tupleType,
|
|
1291
|
-
undefined: () => undefinedType,
|
|
1292
|
-
union: () => unionType,
|
|
1293
|
-
unknown: () => unknownType,
|
|
1294
|
-
util: () => util,
|
|
1295
|
-
void: () => voidType
|
|
1296
|
-
});
|
|
1297
|
-
|
|
1298
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/util.js
|
|
1187
|
+
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
1299
1188
|
var util;
|
|
1300
1189
|
(function(util2) {
|
|
1301
|
-
util2.assertEqual = (
|
|
1302
|
-
};
|
|
1190
|
+
util2.assertEqual = (val) => val;
|
|
1303
1191
|
function assertIs(_arg) {
|
|
1304
1192
|
}
|
|
1305
1193
|
util2.assertIs = assertIs;
|
|
@@ -1343,7 +1231,7 @@ var util;
|
|
|
1343
1231
|
}
|
|
1344
1232
|
return void 0;
|
|
1345
1233
|
};
|
|
1346
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" &&
|
|
1234
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1347
1235
|
function joinValues(array, separator = " | ") {
|
|
1348
1236
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1349
1237
|
}
|
|
@@ -1395,7 +1283,7 @@ var getParsedType = (data) => {
|
|
|
1395
1283
|
case "string":
|
|
1396
1284
|
return ZodParsedType.string;
|
|
1397
1285
|
case "number":
|
|
1398
|
-
return
|
|
1286
|
+
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1399
1287
|
case "boolean":
|
|
1400
1288
|
return ZodParsedType.boolean;
|
|
1401
1289
|
case "function":
|
|
@@ -1428,8 +1316,6 @@ var getParsedType = (data) => {
|
|
|
1428
1316
|
return ZodParsedType.unknown;
|
|
1429
1317
|
}
|
|
1430
1318
|
};
|
|
1431
|
-
|
|
1432
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/ZodError.js
|
|
1433
1319
|
var ZodIssueCode = util.arrayToEnum([
|
|
1434
1320
|
"invalid_type",
|
|
1435
1321
|
"invalid_literal",
|
|
@@ -1453,9 +1339,6 @@ var quotelessJson = (obj) => {
|
|
|
1453
1339
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
1454
1340
|
};
|
|
1455
1341
|
var ZodError = class _ZodError extends Error {
|
|
1456
|
-
get errors() {
|
|
1457
|
-
return this.issues;
|
|
1458
|
-
}
|
|
1459
1342
|
constructor(issues) {
|
|
1460
1343
|
super();
|
|
1461
1344
|
this.issues = [];
|
|
@@ -1474,6 +1357,9 @@ var ZodError = class _ZodError extends Error {
|
|
|
1474
1357
|
this.name = "ZodError";
|
|
1475
1358
|
this.issues = issues;
|
|
1476
1359
|
}
|
|
1360
|
+
get errors() {
|
|
1361
|
+
return this.issues;
|
|
1362
|
+
}
|
|
1477
1363
|
format(_mapper) {
|
|
1478
1364
|
const mapper = _mapper || function(issue) {
|
|
1479
1365
|
return issue.message;
|
|
@@ -1545,8 +1431,6 @@ ZodError.create = (issues) => {
|
|
|
1545
1431
|
const error = new ZodError(issues);
|
|
1546
1432
|
return error;
|
|
1547
1433
|
};
|
|
1548
|
-
|
|
1549
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/locales/en.js
|
|
1550
1434
|
var errorMap = (issue, _ctx) => {
|
|
1551
1435
|
let message;
|
|
1552
1436
|
switch (issue.code) {
|
|
@@ -1645,18 +1529,13 @@ var errorMap = (issue, _ctx) => {
|
|
|
1645
1529
|
}
|
|
1646
1530
|
return { message };
|
|
1647
1531
|
};
|
|
1648
|
-
var
|
|
1649
|
-
|
|
1650
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/errors.js
|
|
1651
|
-
var overrideErrorMap = en_default;
|
|
1532
|
+
var overrideErrorMap = errorMap;
|
|
1652
1533
|
function setErrorMap(map) {
|
|
1653
1534
|
overrideErrorMap = map;
|
|
1654
1535
|
}
|
|
1655
1536
|
function getErrorMap() {
|
|
1656
1537
|
return overrideErrorMap;
|
|
1657
1538
|
}
|
|
1658
|
-
|
|
1659
|
-
// ../../node_modules/.pnpm/zod@3.25.56/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
|
1660
1539
|
var makeIssue = (params) => {
|
|
1661
1540
|
const { data, path, errorMaps, issueData } = params;
|
|
1662
1541
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -1691,12 +1570,9 @@ function addIssueToContext(ctx, issueData) {
|
|
|
1691
1570
|
path: ctx.path,
|
|
1692
1571
|
errorMaps: [
|
|
1693
1572
|
ctx.common.contextualErrorMap,
|
|
1694
|
-
// contextual error map is first priority
|
|
1695
1573
|
ctx.schemaErrorMap,
|
|
1696
|
-
// then schema-bound map if available
|
|
1697
1574
|
overrideMap,
|
|
1698
|
-
|
|
1699
|
-
overrideMap === en_default ? void 0 : en_default
|
|
1575
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
1700
1576
|
// then global default map
|
|
1701
1577
|
].filter((x) => !!x)
|
|
1702
1578
|
});
|
|
@@ -1765,15 +1641,24 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
1765
1641
|
var isDirty = (x) => x.status === "dirty";
|
|
1766
1642
|
var isValid = (x) => x.status === "valid";
|
|
1767
1643
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1768
|
-
|
|
1769
|
-
|
|
1644
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1645
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1646
|
+
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");
|
|
1647
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1648
|
+
}
|
|
1649
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1650
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1651
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1652
|
+
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");
|
|
1653
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
1654
|
+
}
|
|
1770
1655
|
var errorUtil;
|
|
1771
1656
|
(function(errorUtil2) {
|
|
1772
1657
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1773
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
1658
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
1774
1659
|
})(errorUtil || (errorUtil = {}));
|
|
1775
|
-
|
|
1776
|
-
|
|
1660
|
+
var _ZodEnum_cache;
|
|
1661
|
+
var _ZodNativeEnum_cache;
|
|
1777
1662
|
var ParseInputLazyPath = class {
|
|
1778
1663
|
constructor(parent, value, path, key) {
|
|
1779
1664
|
this._cachedPath = [];
|
|
@@ -1784,7 +1669,7 @@ var ParseInputLazyPath = class {
|
|
|
1784
1669
|
}
|
|
1785
1670
|
get path() {
|
|
1786
1671
|
if (!this._cachedPath.length) {
|
|
1787
|
-
if (
|
|
1672
|
+
if (this._key instanceof Array) {
|
|
1788
1673
|
this._cachedPath.push(...this._path, ...this._key);
|
|
1789
1674
|
} else {
|
|
1790
1675
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -1822,20 +1707,49 @@ function processCreateParams(params) {
|
|
|
1822
1707
|
if (errorMap2)
|
|
1823
1708
|
return { errorMap: errorMap2, description };
|
|
1824
1709
|
const customMap = (iss, ctx) => {
|
|
1710
|
+
var _a, _b;
|
|
1825
1711
|
const { message } = params;
|
|
1826
1712
|
if (iss.code === "invalid_enum_value") {
|
|
1827
|
-
return { message: message
|
|
1713
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
1828
1714
|
}
|
|
1829
1715
|
if (typeof ctx.data === "undefined") {
|
|
1830
|
-
return { message: message
|
|
1716
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
1831
1717
|
}
|
|
1832
1718
|
if (iss.code !== "invalid_type")
|
|
1833
1719
|
return { message: ctx.defaultError };
|
|
1834
|
-
return { message: message
|
|
1720
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
1835
1721
|
};
|
|
1836
1722
|
return { errorMap: customMap, description };
|
|
1837
1723
|
}
|
|
1838
1724
|
var ZodType = class {
|
|
1725
|
+
constructor(def) {
|
|
1726
|
+
this.spa = this.safeParseAsync;
|
|
1727
|
+
this._def = def;
|
|
1728
|
+
this.parse = this.parse.bind(this);
|
|
1729
|
+
this.safeParse = this.safeParse.bind(this);
|
|
1730
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
1731
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
1732
|
+
this.spa = this.spa.bind(this);
|
|
1733
|
+
this.refine = this.refine.bind(this);
|
|
1734
|
+
this.refinement = this.refinement.bind(this);
|
|
1735
|
+
this.superRefine = this.superRefine.bind(this);
|
|
1736
|
+
this.optional = this.optional.bind(this);
|
|
1737
|
+
this.nullable = this.nullable.bind(this);
|
|
1738
|
+
this.nullish = this.nullish.bind(this);
|
|
1739
|
+
this.array = this.array.bind(this);
|
|
1740
|
+
this.promise = this.promise.bind(this);
|
|
1741
|
+
this.or = this.or.bind(this);
|
|
1742
|
+
this.and = this.and.bind(this);
|
|
1743
|
+
this.transform = this.transform.bind(this);
|
|
1744
|
+
this.brand = this.brand.bind(this);
|
|
1745
|
+
this.default = this.default.bind(this);
|
|
1746
|
+
this.catch = this.catch.bind(this);
|
|
1747
|
+
this.describe = this.describe.bind(this);
|
|
1748
|
+
this.pipe = this.pipe.bind(this);
|
|
1749
|
+
this.readonly = this.readonly.bind(this);
|
|
1750
|
+
this.isNullable = this.isNullable.bind(this);
|
|
1751
|
+
this.isOptional = this.isOptional.bind(this);
|
|
1752
|
+
}
|
|
1839
1753
|
get description() {
|
|
1840
1754
|
return this._def.description;
|
|
1841
1755
|
}
|
|
@@ -1883,13 +1797,14 @@ var ZodType = class {
|
|
|
1883
1797
|
throw result.error;
|
|
1884
1798
|
}
|
|
1885
1799
|
safeParse(data, params) {
|
|
1800
|
+
var _a;
|
|
1886
1801
|
const ctx = {
|
|
1887
1802
|
common: {
|
|
1888
1803
|
issues: [],
|
|
1889
|
-
async: params
|
|
1890
|
-
contextualErrorMap: params
|
|
1804
|
+
async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
|
|
1805
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
1891
1806
|
},
|
|
1892
|
-
path: params
|
|
1807
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
1893
1808
|
schemaErrorMap: this._def.errorMap,
|
|
1894
1809
|
parent: null,
|
|
1895
1810
|
data,
|
|
@@ -1898,42 +1813,6 @@ var ZodType = class {
|
|
|
1898
1813
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
1899
1814
|
return handleResult(ctx, result);
|
|
1900
1815
|
}
|
|
1901
|
-
"~validate"(data) {
|
|
1902
|
-
const ctx = {
|
|
1903
|
-
common: {
|
|
1904
|
-
issues: [],
|
|
1905
|
-
async: !!this["~standard"].async
|
|
1906
|
-
},
|
|
1907
|
-
path: [],
|
|
1908
|
-
schemaErrorMap: this._def.errorMap,
|
|
1909
|
-
parent: null,
|
|
1910
|
-
data,
|
|
1911
|
-
parsedType: getParsedType(data)
|
|
1912
|
-
};
|
|
1913
|
-
if (!this["~standard"].async) {
|
|
1914
|
-
try {
|
|
1915
|
-
const result = this._parseSync({ data, path: [], parent: ctx });
|
|
1916
|
-
return isValid(result) ? {
|
|
1917
|
-
value: result.value
|
|
1918
|
-
} : {
|
|
1919
|
-
issues: ctx.common.issues
|
|
1920
|
-
};
|
|
1921
|
-
} catch (err) {
|
|
1922
|
-
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
1923
|
-
this["~standard"].async = true;
|
|
1924
|
-
}
|
|
1925
|
-
ctx.common = {
|
|
1926
|
-
issues: [],
|
|
1927
|
-
async: true
|
|
1928
|
-
};
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
|
1932
|
-
value: result.value
|
|
1933
|
-
} : {
|
|
1934
|
-
issues: ctx.common.issues
|
|
1935
|
-
});
|
|
1936
|
-
}
|
|
1937
1816
|
async parseAsync(data, params) {
|
|
1938
1817
|
const result = await this.safeParseAsync(data, params);
|
|
1939
1818
|
if (result.success)
|
|
@@ -1944,10 +1823,10 @@ var ZodType = class {
|
|
|
1944
1823
|
const ctx = {
|
|
1945
1824
|
common: {
|
|
1946
1825
|
issues: [],
|
|
1947
|
-
contextualErrorMap: params
|
|
1826
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
|
|
1948
1827
|
async: true
|
|
1949
1828
|
},
|
|
1950
|
-
path: params
|
|
1829
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
1951
1830
|
schemaErrorMap: this._def.errorMap,
|
|
1952
1831
|
parent: null,
|
|
1953
1832
|
data,
|
|
@@ -2011,39 +1890,6 @@ var ZodType = class {
|
|
|
2011
1890
|
superRefine(refinement) {
|
|
2012
1891
|
return this._refinement(refinement);
|
|
2013
1892
|
}
|
|
2014
|
-
constructor(def) {
|
|
2015
|
-
this.spa = this.safeParseAsync;
|
|
2016
|
-
this._def = def;
|
|
2017
|
-
this.parse = this.parse.bind(this);
|
|
2018
|
-
this.safeParse = this.safeParse.bind(this);
|
|
2019
|
-
this.parseAsync = this.parseAsync.bind(this);
|
|
2020
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
2021
|
-
this.spa = this.spa.bind(this);
|
|
2022
|
-
this.refine = this.refine.bind(this);
|
|
2023
|
-
this.refinement = this.refinement.bind(this);
|
|
2024
|
-
this.superRefine = this.superRefine.bind(this);
|
|
2025
|
-
this.optional = this.optional.bind(this);
|
|
2026
|
-
this.nullable = this.nullable.bind(this);
|
|
2027
|
-
this.nullish = this.nullish.bind(this);
|
|
2028
|
-
this.array = this.array.bind(this);
|
|
2029
|
-
this.promise = this.promise.bind(this);
|
|
2030
|
-
this.or = this.or.bind(this);
|
|
2031
|
-
this.and = this.and.bind(this);
|
|
2032
|
-
this.transform = this.transform.bind(this);
|
|
2033
|
-
this.brand = this.brand.bind(this);
|
|
2034
|
-
this.default = this.default.bind(this);
|
|
2035
|
-
this.catch = this.catch.bind(this);
|
|
2036
|
-
this.describe = this.describe.bind(this);
|
|
2037
|
-
this.pipe = this.pipe.bind(this);
|
|
2038
|
-
this.readonly = this.readonly.bind(this);
|
|
2039
|
-
this.isNullable = this.isNullable.bind(this);
|
|
2040
|
-
this.isOptional = this.isOptional.bind(this);
|
|
2041
|
-
this["~standard"] = {
|
|
2042
|
-
version: 1,
|
|
2043
|
-
vendor: "zod",
|
|
2044
|
-
validate: (data) => this["~validate"](data)
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
1893
|
optional() {
|
|
2048
1894
|
return ZodOptional.create(this, this._def);
|
|
2049
1895
|
}
|
|
@@ -2054,7 +1900,7 @@ var ZodType = class {
|
|
|
2054
1900
|
return this.nullable().optional();
|
|
2055
1901
|
}
|
|
2056
1902
|
array() {
|
|
2057
|
-
return ZodArray.create(this);
|
|
1903
|
+
return ZodArray.create(this, this._def);
|
|
2058
1904
|
}
|
|
2059
1905
|
promise() {
|
|
2060
1906
|
return ZodPromise.create(this, this._def);
|
|
@@ -2120,31 +1966,26 @@ var ZodType = class {
|
|
|
2120
1966
|
};
|
|
2121
1967
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
2122
1968
|
var cuid2Regex = /^[0-9a-z]+$/;
|
|
2123
|
-
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
|
1969
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
2124
1970
|
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;
|
|
2125
1971
|
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
2126
|
-
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
2127
1972
|
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)?)??$/;
|
|
2128
1973
|
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
2129
1974
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
2130
1975
|
var emojiRegex;
|
|
2131
1976
|
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])$/;
|
|
2132
|
-
var
|
|
2133
|
-
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]))$/;
|
|
2134
|
-
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])$/;
|
|
1977
|
+
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})))$/;
|
|
2135
1978
|
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
2136
|
-
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
2137
1979
|
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])))`;
|
|
2138
1980
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2139
1981
|
function timeRegexSource(args) {
|
|
2140
|
-
let
|
|
1982
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
2141
1983
|
if (args.precision) {
|
|
2142
|
-
|
|
1984
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
2143
1985
|
} else if (args.precision == null) {
|
|
2144
|
-
|
|
1986
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
2145
1987
|
}
|
|
2146
|
-
|
|
2147
|
-
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
1988
|
+
return regex;
|
|
2148
1989
|
}
|
|
2149
1990
|
function timeRegex(args) {
|
|
2150
1991
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -2167,35 +2008,6 @@ function isValidIP(ip, version) {
|
|
|
2167
2008
|
}
|
|
2168
2009
|
return false;
|
|
2169
2010
|
}
|
|
2170
|
-
function isValidJWT(jwt, alg) {
|
|
2171
|
-
if (!jwtRegex.test(jwt))
|
|
2172
|
-
return false;
|
|
2173
|
-
try {
|
|
2174
|
-
const [header] = jwt.split(".");
|
|
2175
|
-
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
2176
|
-
const decoded = JSON.parse(atob(base64));
|
|
2177
|
-
if (typeof decoded !== "object" || decoded === null)
|
|
2178
|
-
return false;
|
|
2179
|
-
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
2180
|
-
return false;
|
|
2181
|
-
if (!decoded.alg)
|
|
2182
|
-
return false;
|
|
2183
|
-
if (alg && decoded.alg !== alg)
|
|
2184
|
-
return false;
|
|
2185
|
-
return true;
|
|
2186
|
-
} catch {
|
|
2187
|
-
return false;
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
function isValidCidr(ip, version) {
|
|
2191
|
-
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
|
2192
|
-
return true;
|
|
2193
|
-
}
|
|
2194
|
-
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
|
2195
|
-
return true;
|
|
2196
|
-
}
|
|
2197
|
-
return false;
|
|
2198
|
-
}
|
|
2199
2011
|
var ZodString = class _ZodString extends ZodType {
|
|
2200
2012
|
_parse(input) {
|
|
2201
2013
|
if (this._def.coerce) {
|
|
@@ -2342,7 +2154,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2342
2154
|
} else if (check.kind === "url") {
|
|
2343
2155
|
try {
|
|
2344
2156
|
new URL(input.data);
|
|
2345
|
-
} catch {
|
|
2157
|
+
} catch (_a) {
|
|
2346
2158
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2347
2159
|
addIssueToContext(ctx, {
|
|
2348
2160
|
validation: "url",
|
|
@@ -2452,26 +2264,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2452
2264
|
});
|
|
2453
2265
|
status.dirty();
|
|
2454
2266
|
}
|
|
2455
|
-
} else if (check.kind === "jwt") {
|
|
2456
|
-
if (!isValidJWT(input.data, check.alg)) {
|
|
2457
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
2458
|
-
addIssueToContext(ctx, {
|
|
2459
|
-
validation: "jwt",
|
|
2460
|
-
code: ZodIssueCode.invalid_string,
|
|
2461
|
-
message: check.message
|
|
2462
|
-
});
|
|
2463
|
-
status.dirty();
|
|
2464
|
-
}
|
|
2465
|
-
} else if (check.kind === "cidr") {
|
|
2466
|
-
if (!isValidCidr(input.data, check.version)) {
|
|
2467
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
2468
|
-
addIssueToContext(ctx, {
|
|
2469
|
-
validation: "cidr",
|
|
2470
|
-
code: ZodIssueCode.invalid_string,
|
|
2471
|
-
message: check.message
|
|
2472
|
-
});
|
|
2473
|
-
status.dirty();
|
|
2474
|
-
}
|
|
2475
2267
|
} else if (check.kind === "base64") {
|
|
2476
2268
|
if (!base64Regex.test(input.data)) {
|
|
2477
2269
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2482,16 +2274,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2482
2274
|
});
|
|
2483
2275
|
status.dirty();
|
|
2484
2276
|
}
|
|
2485
|
-
} else if (check.kind === "base64url") {
|
|
2486
|
-
if (!base64urlRegex.test(input.data)) {
|
|
2487
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
2488
|
-
addIssueToContext(ctx, {
|
|
2489
|
-
validation: "base64url",
|
|
2490
|
-
code: ZodIssueCode.invalid_string,
|
|
2491
|
-
message: check.message
|
|
2492
|
-
});
|
|
2493
|
-
status.dirty();
|
|
2494
|
-
}
|
|
2495
2277
|
} else {
|
|
2496
2278
|
util.assertNever(check);
|
|
2497
2279
|
}
|
|
@@ -2538,22 +2320,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2538
2320
|
base64(message) {
|
|
2539
2321
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
2540
2322
|
}
|
|
2541
|
-
base64url(message) {
|
|
2542
|
-
return this._addCheck({
|
|
2543
|
-
kind: "base64url",
|
|
2544
|
-
...errorUtil.errToObj(message)
|
|
2545
|
-
});
|
|
2546
|
-
}
|
|
2547
|
-
jwt(options) {
|
|
2548
|
-
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
|
2549
|
-
}
|
|
2550
2323
|
ip(options) {
|
|
2551
2324
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
2552
2325
|
}
|
|
2553
|
-
cidr(options) {
|
|
2554
|
-
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2555
|
-
}
|
|
2556
2326
|
datetime(options) {
|
|
2327
|
+
var _a, _b;
|
|
2557
2328
|
if (typeof options === "string") {
|
|
2558
2329
|
return this._addCheck({
|
|
2559
2330
|
kind: "datetime",
|
|
@@ -2565,10 +2336,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2565
2336
|
}
|
|
2566
2337
|
return this._addCheck({
|
|
2567
2338
|
kind: "datetime",
|
|
2568
|
-
precision: typeof options
|
|
2569
|
-
offset: options
|
|
2570
|
-
local: options
|
|
2571
|
-
...errorUtil.errToObj(options
|
|
2339
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2340
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
2341
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
|
2342
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2572
2343
|
});
|
|
2573
2344
|
}
|
|
2574
2345
|
date(message) {
|
|
@@ -2584,8 +2355,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2584
2355
|
}
|
|
2585
2356
|
return this._addCheck({
|
|
2586
2357
|
kind: "time",
|
|
2587
|
-
precision: typeof options
|
|
2588
|
-
...errorUtil.errToObj(options
|
|
2358
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2359
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2589
2360
|
});
|
|
2590
2361
|
}
|
|
2591
2362
|
duration(message) {
|
|
@@ -2602,8 +2373,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2602
2373
|
return this._addCheck({
|
|
2603
2374
|
kind: "includes",
|
|
2604
2375
|
value,
|
|
2605
|
-
position: options
|
|
2606
|
-
...errorUtil.errToObj(options
|
|
2376
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
2377
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
2607
2378
|
});
|
|
2608
2379
|
}
|
|
2609
2380
|
startsWith(value, message) {
|
|
@@ -2642,7 +2413,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2642
2413
|
});
|
|
2643
2414
|
}
|
|
2644
2415
|
/**
|
|
2645
|
-
*
|
|
2416
|
+
* @deprecated Use z.string().min(1) instead.
|
|
2417
|
+
* @see {@link ZodString.min}
|
|
2646
2418
|
*/
|
|
2647
2419
|
nonempty(message) {
|
|
2648
2420
|
return this.min(1, errorUtil.errToObj(message));
|
|
@@ -2704,15 +2476,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2704
2476
|
get isIP() {
|
|
2705
2477
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
2706
2478
|
}
|
|
2707
|
-
get isCIDR() {
|
|
2708
|
-
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
2709
|
-
}
|
|
2710
2479
|
get isBase64() {
|
|
2711
2480
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
2712
2481
|
}
|
|
2713
|
-
get isBase64url() {
|
|
2714
|
-
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
2715
|
-
}
|
|
2716
2482
|
get minLength() {
|
|
2717
2483
|
let min = null;
|
|
2718
2484
|
for (const ch of this._def.checks) {
|
|
@@ -2735,10 +2501,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2735
2501
|
}
|
|
2736
2502
|
};
|
|
2737
2503
|
ZodString.create = (params) => {
|
|
2504
|
+
var _a;
|
|
2738
2505
|
return new ZodString({
|
|
2739
2506
|
checks: [],
|
|
2740
2507
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
2741
|
-
coerce: params
|
|
2508
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
2742
2509
|
...processCreateParams(params)
|
|
2743
2510
|
});
|
|
2744
2511
|
};
|
|
@@ -2746,9 +2513,9 @@ function floatSafeRemainder(val, step) {
|
|
|
2746
2513
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
2747
2514
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
2748
2515
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
2749
|
-
const valInt =
|
|
2750
|
-
const stepInt =
|
|
2751
|
-
return valInt % stepInt / 10
|
|
2516
|
+
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
2517
|
+
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
2518
|
+
return valInt % stepInt / Math.pow(10, decCount);
|
|
2752
2519
|
}
|
|
2753
2520
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
2754
2521
|
constructor() {
|
|
@@ -2958,8 +2725,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
2958
2725
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
2959
2726
|
}
|
|
2960
2727
|
get isFinite() {
|
|
2961
|
-
let max = null;
|
|
2962
|
-
let min = null;
|
|
2728
|
+
let max = null, min = null;
|
|
2963
2729
|
for (const ch of this._def.checks) {
|
|
2964
2730
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
2965
2731
|
return true;
|
|
@@ -2978,7 +2744,7 @@ ZodNumber.create = (params) => {
|
|
|
2978
2744
|
return new ZodNumber({
|
|
2979
2745
|
checks: [],
|
|
2980
2746
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2981
|
-
coerce: params
|
|
2747
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
2982
2748
|
...processCreateParams(params)
|
|
2983
2749
|
});
|
|
2984
2750
|
};
|
|
@@ -2990,15 +2756,17 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2990
2756
|
}
|
|
2991
2757
|
_parse(input) {
|
|
2992
2758
|
if (this._def.coerce) {
|
|
2993
|
-
|
|
2994
|
-
input.data = BigInt(input.data);
|
|
2995
|
-
} catch {
|
|
2996
|
-
return this._getInvalidInput(input);
|
|
2997
|
-
}
|
|
2759
|
+
input.data = BigInt(input.data);
|
|
2998
2760
|
}
|
|
2999
2761
|
const parsedType = this._getType(input);
|
|
3000
2762
|
if (parsedType !== ZodParsedType.bigint) {
|
|
3001
|
-
|
|
2763
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
2764
|
+
addIssueToContext(ctx2, {
|
|
2765
|
+
code: ZodIssueCode.invalid_type,
|
|
2766
|
+
expected: ZodParsedType.bigint,
|
|
2767
|
+
received: ctx2.parsedType
|
|
2768
|
+
});
|
|
2769
|
+
return INVALID;
|
|
3002
2770
|
}
|
|
3003
2771
|
let ctx = void 0;
|
|
3004
2772
|
const status = new ParseStatus();
|
|
@@ -3045,15 +2813,6 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3045
2813
|
}
|
|
3046
2814
|
return { status: status.value, value: input.data };
|
|
3047
2815
|
}
|
|
3048
|
-
_getInvalidInput(input) {
|
|
3049
|
-
const ctx = this._getOrReturnCtx(input);
|
|
3050
|
-
addIssueToContext(ctx, {
|
|
3051
|
-
code: ZodIssueCode.invalid_type,
|
|
3052
|
-
expected: ZodParsedType.bigint,
|
|
3053
|
-
received: ctx.parsedType
|
|
3054
|
-
});
|
|
3055
|
-
return INVALID;
|
|
3056
|
-
}
|
|
3057
2816
|
gte(value, message) {
|
|
3058
2817
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
3059
2818
|
}
|
|
@@ -3147,10 +2906,11 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3147
2906
|
}
|
|
3148
2907
|
};
|
|
3149
2908
|
ZodBigInt.create = (params) => {
|
|
2909
|
+
var _a;
|
|
3150
2910
|
return new ZodBigInt({
|
|
3151
2911
|
checks: [],
|
|
3152
2912
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3153
|
-
coerce: params
|
|
2913
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
3154
2914
|
...processCreateParams(params)
|
|
3155
2915
|
});
|
|
3156
2916
|
};
|
|
@@ -3175,7 +2935,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
3175
2935
|
ZodBoolean.create = (params) => {
|
|
3176
2936
|
return new ZodBoolean({
|
|
3177
2937
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3178
|
-
coerce: params
|
|
2938
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
3179
2939
|
...processCreateParams(params)
|
|
3180
2940
|
});
|
|
3181
2941
|
};
|
|
@@ -3194,7 +2954,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3194
2954
|
});
|
|
3195
2955
|
return INVALID;
|
|
3196
2956
|
}
|
|
3197
|
-
if (
|
|
2957
|
+
if (isNaN(input.data.getTime())) {
|
|
3198
2958
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3199
2959
|
addIssueToContext(ctx2, {
|
|
3200
2960
|
code: ZodIssueCode.invalid_date
|
|
@@ -3283,7 +3043,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3283
3043
|
ZodDate.create = (params) => {
|
|
3284
3044
|
return new ZodDate({
|
|
3285
3045
|
checks: [],
|
|
3286
|
-
coerce: params
|
|
3046
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
3287
3047
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3288
3048
|
...processCreateParams(params)
|
|
3289
3049
|
});
|
|
@@ -3558,8 +3318,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3558
3318
|
return this._cached;
|
|
3559
3319
|
const shape = this._def.shape();
|
|
3560
3320
|
const keys = util.objectKeys(shape);
|
|
3561
|
-
this._cached = { shape, keys };
|
|
3562
|
-
return this._cached;
|
|
3321
|
+
return this._cached = { shape, keys };
|
|
3563
3322
|
}
|
|
3564
3323
|
_parse(input) {
|
|
3565
3324
|
const parsedType = this._getType(input);
|
|
@@ -3609,8 +3368,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3609
3368
|
});
|
|
3610
3369
|
status.dirty();
|
|
3611
3370
|
}
|
|
3612
|
-
} else if (unknownKeys === "strip")
|
|
3613
|
-
|
|
3371
|
+
} else if (unknownKeys === "strip") ;
|
|
3372
|
+
else {
|
|
3614
3373
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3615
3374
|
}
|
|
3616
3375
|
} else {
|
|
@@ -3657,10 +3416,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3657
3416
|
unknownKeys: "strict",
|
|
3658
3417
|
...message !== void 0 ? {
|
|
3659
3418
|
errorMap: (issue, ctx) => {
|
|
3660
|
-
|
|
3419
|
+
var _a, _b, _c, _d;
|
|
3420
|
+
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;
|
|
3661
3421
|
if (issue.code === "unrecognized_keys")
|
|
3662
3422
|
return {
|
|
3663
|
-
message: errorUtil.errToObj(message).message
|
|
3423
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
3664
3424
|
};
|
|
3665
3425
|
return {
|
|
3666
3426
|
message: defaultError
|
|
@@ -3791,11 +3551,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3791
3551
|
}
|
|
3792
3552
|
pick(mask) {
|
|
3793
3553
|
const shape = {};
|
|
3794
|
-
|
|
3554
|
+
util.objectKeys(mask).forEach((key) => {
|
|
3795
3555
|
if (mask[key] && this.shape[key]) {
|
|
3796
3556
|
shape[key] = this.shape[key];
|
|
3797
3557
|
}
|
|
3798
|
-
}
|
|
3558
|
+
});
|
|
3799
3559
|
return new _ZodObject({
|
|
3800
3560
|
...this._def,
|
|
3801
3561
|
shape: () => shape
|
|
@@ -3803,11 +3563,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3803
3563
|
}
|
|
3804
3564
|
omit(mask) {
|
|
3805
3565
|
const shape = {};
|
|
3806
|
-
|
|
3566
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3807
3567
|
if (!mask[key]) {
|
|
3808
3568
|
shape[key] = this.shape[key];
|
|
3809
3569
|
}
|
|
3810
|
-
}
|
|
3570
|
+
});
|
|
3811
3571
|
return new _ZodObject({
|
|
3812
3572
|
...this._def,
|
|
3813
3573
|
shape: () => shape
|
|
@@ -3821,14 +3581,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3821
3581
|
}
|
|
3822
3582
|
partial(mask) {
|
|
3823
3583
|
const newShape = {};
|
|
3824
|
-
|
|
3584
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3825
3585
|
const fieldSchema = this.shape[key];
|
|
3826
3586
|
if (mask && !mask[key]) {
|
|
3827
3587
|
newShape[key] = fieldSchema;
|
|
3828
3588
|
} else {
|
|
3829
3589
|
newShape[key] = fieldSchema.optional();
|
|
3830
3590
|
}
|
|
3831
|
-
}
|
|
3591
|
+
});
|
|
3832
3592
|
return new _ZodObject({
|
|
3833
3593
|
...this._def,
|
|
3834
3594
|
shape: () => newShape
|
|
@@ -3836,7 +3596,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3836
3596
|
}
|
|
3837
3597
|
required(mask) {
|
|
3838
3598
|
const newShape = {};
|
|
3839
|
-
|
|
3599
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
3840
3600
|
if (mask && !mask[key]) {
|
|
3841
3601
|
newShape[key] = this.shape[key];
|
|
3842
3602
|
} else {
|
|
@@ -3847,7 +3607,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3847
3607
|
}
|
|
3848
3608
|
newShape[key] = newField;
|
|
3849
3609
|
}
|
|
3850
|
-
}
|
|
3610
|
+
});
|
|
3851
3611
|
return new _ZodObject({
|
|
3852
3612
|
...this._def,
|
|
3853
3613
|
shape: () => newShape
|
|
@@ -4463,7 +4223,12 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4463
4223
|
return makeIssue({
|
|
4464
4224
|
data: args,
|
|
4465
4225
|
path: ctx.path,
|
|
4466
|
-
errorMaps: [
|
|
4226
|
+
errorMaps: [
|
|
4227
|
+
ctx.common.contextualErrorMap,
|
|
4228
|
+
ctx.schemaErrorMap,
|
|
4229
|
+
getErrorMap(),
|
|
4230
|
+
errorMap
|
|
4231
|
+
].filter((x) => !!x),
|
|
4467
4232
|
issueData: {
|
|
4468
4233
|
code: ZodIssueCode.invalid_arguments,
|
|
4469
4234
|
argumentsError: error
|
|
@@ -4474,7 +4239,12 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4474
4239
|
return makeIssue({
|
|
4475
4240
|
data: returns,
|
|
4476
4241
|
path: ctx.path,
|
|
4477
|
-
errorMaps: [
|
|
4242
|
+
errorMaps: [
|
|
4243
|
+
ctx.common.contextualErrorMap,
|
|
4244
|
+
ctx.schemaErrorMap,
|
|
4245
|
+
getErrorMap(),
|
|
4246
|
+
errorMap
|
|
4247
|
+
].filter((x) => !!x),
|
|
4478
4248
|
issueData: {
|
|
4479
4249
|
code: ZodIssueCode.invalid_return_type,
|
|
4480
4250
|
returnTypeError: error
|
|
@@ -4598,6 +4368,10 @@ function createZodEnum(values, params) {
|
|
|
4598
4368
|
});
|
|
4599
4369
|
}
|
|
4600
4370
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4371
|
+
constructor() {
|
|
4372
|
+
super(...arguments);
|
|
4373
|
+
_ZodEnum_cache.set(this, void 0);
|
|
4374
|
+
}
|
|
4601
4375
|
_parse(input) {
|
|
4602
4376
|
if (typeof input.data !== "string") {
|
|
4603
4377
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4609,10 +4383,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4609
4383
|
});
|
|
4610
4384
|
return INVALID;
|
|
4611
4385
|
}
|
|
4612
|
-
if (!this
|
|
4613
|
-
this
|
|
4386
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
4387
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
4614
4388
|
}
|
|
4615
|
-
if (!this.
|
|
4389
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
4616
4390
|
const ctx = this._getOrReturnCtx(input);
|
|
4617
4391
|
const expectedValues = this._def.values;
|
|
4618
4392
|
addIssueToContext(ctx, {
|
|
@@ -4661,8 +4435,13 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4661
4435
|
});
|
|
4662
4436
|
}
|
|
4663
4437
|
};
|
|
4438
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4664
4439
|
ZodEnum.create = createZodEnum;
|
|
4665
4440
|
var ZodNativeEnum = class extends ZodType {
|
|
4441
|
+
constructor() {
|
|
4442
|
+
super(...arguments);
|
|
4443
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
4444
|
+
}
|
|
4666
4445
|
_parse(input) {
|
|
4667
4446
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4668
4447
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4675,10 +4454,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4675
4454
|
});
|
|
4676
4455
|
return INVALID;
|
|
4677
4456
|
}
|
|
4678
|
-
if (!this
|
|
4679
|
-
this
|
|
4457
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
4458
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
4680
4459
|
}
|
|
4681
|
-
if (!this.
|
|
4460
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
4682
4461
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
4683
4462
|
addIssueToContext(ctx, {
|
|
4684
4463
|
received: ctx.data,
|
|
@@ -4693,6 +4472,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4693
4472
|
return this._def.values;
|
|
4694
4473
|
}
|
|
4695
4474
|
};
|
|
4475
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4696
4476
|
ZodNativeEnum.create = (values, params) => {
|
|
4697
4477
|
return new ZodNativeEnum({
|
|
4698
4478
|
values,
|
|
@@ -4833,7 +4613,7 @@ var ZodEffects = class extends ZodType {
|
|
|
4833
4613
|
parent: ctx
|
|
4834
4614
|
});
|
|
4835
4615
|
if (!isValid(base))
|
|
4836
|
-
return
|
|
4616
|
+
return base;
|
|
4837
4617
|
const result = effect.transform(base.value, checkCtx);
|
|
4838
4618
|
if (result instanceof Promise) {
|
|
4839
4619
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -4842,11 +4622,8 @@ var ZodEffects = class extends ZodType {
|
|
|
4842
4622
|
} else {
|
|
4843
4623
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
4844
4624
|
if (!isValid(base))
|
|
4845
|
-
return
|
|
4846
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
4847
|
-
status: status.value,
|
|
4848
|
-
value: result
|
|
4849
|
-
}));
|
|
4625
|
+
return base;
|
|
4626
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
|
|
4850
4627
|
});
|
|
4851
4628
|
}
|
|
4852
4629
|
}
|
|
@@ -5098,30 +4875,16 @@ ZodReadonly.create = (type, params) => {
|
|
|
5098
4875
|
...processCreateParams(params)
|
|
5099
4876
|
});
|
|
5100
4877
|
};
|
|
5101
|
-
function
|
|
5102
|
-
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
5103
|
-
const p2 = typeof p === "string" ? { message: p } : p;
|
|
5104
|
-
return p2;
|
|
5105
|
-
}
|
|
5106
|
-
function custom(check, _params = {}, fatal) {
|
|
4878
|
+
function custom(check, params = {}, fatal) {
|
|
5107
4879
|
if (check)
|
|
5108
4880
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5109
|
-
|
|
5110
|
-
if (
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5116
|
-
}
|
|
5117
|
-
});
|
|
5118
|
-
}
|
|
5119
|
-
if (!r) {
|
|
5120
|
-
const params = cleanParams(_params, data);
|
|
5121
|
-
const _fatal = params.fatal ?? fatal ?? true;
|
|
5122
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
4881
|
+
var _a, _b;
|
|
4882
|
+
if (!check(data)) {
|
|
4883
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
4884
|
+
const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
4885
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
4886
|
+
ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
|
|
5123
4887
|
}
|
|
5124
|
-
return;
|
|
5125
4888
|
});
|
|
5126
4889
|
return ZodAny.create();
|
|
5127
4890
|
}
|
|
@@ -5218,12 +4981,128 @@ var coerce = {
|
|
|
5218
4981
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5219
4982
|
};
|
|
5220
4983
|
var NEVER = INVALID;
|
|
4984
|
+
var z = /* @__PURE__ */ Object.freeze({
|
|
4985
|
+
__proto__: null,
|
|
4986
|
+
defaultErrorMap: errorMap,
|
|
4987
|
+
setErrorMap,
|
|
4988
|
+
getErrorMap,
|
|
4989
|
+
makeIssue,
|
|
4990
|
+
EMPTY_PATH,
|
|
4991
|
+
addIssueToContext,
|
|
4992
|
+
ParseStatus,
|
|
4993
|
+
INVALID,
|
|
4994
|
+
DIRTY,
|
|
4995
|
+
OK,
|
|
4996
|
+
isAborted,
|
|
4997
|
+
isDirty,
|
|
4998
|
+
isValid,
|
|
4999
|
+
isAsync,
|
|
5000
|
+
get util() {
|
|
5001
|
+
return util;
|
|
5002
|
+
},
|
|
5003
|
+
get objectUtil() {
|
|
5004
|
+
return objectUtil;
|
|
5005
|
+
},
|
|
5006
|
+
ZodParsedType,
|
|
5007
|
+
getParsedType,
|
|
5008
|
+
ZodType,
|
|
5009
|
+
datetimeRegex,
|
|
5010
|
+
ZodString,
|
|
5011
|
+
ZodNumber,
|
|
5012
|
+
ZodBigInt,
|
|
5013
|
+
ZodBoolean,
|
|
5014
|
+
ZodDate,
|
|
5015
|
+
ZodSymbol,
|
|
5016
|
+
ZodUndefined,
|
|
5017
|
+
ZodNull,
|
|
5018
|
+
ZodAny,
|
|
5019
|
+
ZodUnknown,
|
|
5020
|
+
ZodNever,
|
|
5021
|
+
ZodVoid,
|
|
5022
|
+
ZodArray,
|
|
5023
|
+
ZodObject,
|
|
5024
|
+
ZodUnion,
|
|
5025
|
+
ZodDiscriminatedUnion,
|
|
5026
|
+
ZodIntersection,
|
|
5027
|
+
ZodTuple,
|
|
5028
|
+
ZodRecord,
|
|
5029
|
+
ZodMap,
|
|
5030
|
+
ZodSet,
|
|
5031
|
+
ZodFunction,
|
|
5032
|
+
ZodLazy,
|
|
5033
|
+
ZodLiteral,
|
|
5034
|
+
ZodEnum,
|
|
5035
|
+
ZodNativeEnum,
|
|
5036
|
+
ZodPromise,
|
|
5037
|
+
ZodEffects,
|
|
5038
|
+
ZodTransformer: ZodEffects,
|
|
5039
|
+
ZodOptional,
|
|
5040
|
+
ZodNullable,
|
|
5041
|
+
ZodDefault,
|
|
5042
|
+
ZodCatch,
|
|
5043
|
+
ZodNaN,
|
|
5044
|
+
BRAND,
|
|
5045
|
+
ZodBranded,
|
|
5046
|
+
ZodPipeline,
|
|
5047
|
+
ZodReadonly,
|
|
5048
|
+
custom,
|
|
5049
|
+
Schema: ZodType,
|
|
5050
|
+
ZodSchema: ZodType,
|
|
5051
|
+
late,
|
|
5052
|
+
get ZodFirstPartyTypeKind() {
|
|
5053
|
+
return ZodFirstPartyTypeKind;
|
|
5054
|
+
},
|
|
5055
|
+
coerce,
|
|
5056
|
+
any: anyType,
|
|
5057
|
+
array: arrayType,
|
|
5058
|
+
bigint: bigIntType,
|
|
5059
|
+
boolean: booleanType,
|
|
5060
|
+
date: dateType,
|
|
5061
|
+
discriminatedUnion: discriminatedUnionType,
|
|
5062
|
+
effect: effectsType,
|
|
5063
|
+
"enum": enumType,
|
|
5064
|
+
"function": functionType,
|
|
5065
|
+
"instanceof": instanceOfType,
|
|
5066
|
+
intersection: intersectionType,
|
|
5067
|
+
lazy: lazyType,
|
|
5068
|
+
literal: literalType,
|
|
5069
|
+
map: mapType,
|
|
5070
|
+
nan: nanType,
|
|
5071
|
+
nativeEnum: nativeEnumType,
|
|
5072
|
+
never: neverType,
|
|
5073
|
+
"null": nullType,
|
|
5074
|
+
nullable: nullableType,
|
|
5075
|
+
number: numberType,
|
|
5076
|
+
object: objectType,
|
|
5077
|
+
oboolean,
|
|
5078
|
+
onumber,
|
|
5079
|
+
optional: optionalType,
|
|
5080
|
+
ostring,
|
|
5081
|
+
pipeline: pipelineType,
|
|
5082
|
+
preprocess: preprocessType,
|
|
5083
|
+
promise: promiseType,
|
|
5084
|
+
record: recordType,
|
|
5085
|
+
set: setType,
|
|
5086
|
+
strictObject: strictObjectType,
|
|
5087
|
+
string: stringType,
|
|
5088
|
+
symbol: symbolType,
|
|
5089
|
+
transformer: effectsType,
|
|
5090
|
+
tuple: tupleType,
|
|
5091
|
+
"undefined": undefinedType,
|
|
5092
|
+
union: unionType,
|
|
5093
|
+
unknown: unknownType,
|
|
5094
|
+
"void": voidType,
|
|
5095
|
+
NEVER,
|
|
5096
|
+
ZodIssueCode,
|
|
5097
|
+
quotelessJson,
|
|
5098
|
+
ZodError
|
|
5099
|
+
});
|
|
5221
5100
|
|
|
5222
5101
|
// src/core/credit/types.ts
|
|
5223
|
-
var getNamespaceRemainingInstillCreditResponseValidator =
|
|
5224
|
-
perishable:
|
|
5225
|
-
imperishable:
|
|
5226
|
-
total:
|
|
5102
|
+
var getNamespaceRemainingInstillCreditResponseValidator = z.object({
|
|
5103
|
+
perishable: z.number(),
|
|
5104
|
+
imperishable: z.number(),
|
|
5105
|
+
total: z.number()
|
|
5227
5106
|
});
|
|
5228
5107
|
|
|
5229
5108
|
// src/core/membership/MembershipClient.ts
|
|
@@ -5515,94 +5394,94 @@ var UserClient = class extends APIResource {
|
|
|
5515
5394
|
};
|
|
5516
5395
|
|
|
5517
5396
|
// src/core/user/types.ts
|
|
5518
|
-
var OnboardingStatusSchema =
|
|
5397
|
+
var OnboardingStatusSchema = z.enum([
|
|
5519
5398
|
"ONBOARDING_STATUS_UNSPECIFIED",
|
|
5520
5399
|
"ONBOARDING_STATUS_IN_PROGRESS",
|
|
5521
5400
|
"ONBOARDING_STATUS_COMPLETED"
|
|
5522
5401
|
]);
|
|
5523
|
-
var UserProfileSchema =
|
|
5524
|
-
displayName:
|
|
5525
|
-
bio:
|
|
5526
|
-
publicEmail:
|
|
5527
|
-
companyName:
|
|
5528
|
-
avatar:
|
|
5529
|
-
socialProfilesLinks:
|
|
5530
|
-
webiste:
|
|
5531
|
-
x:
|
|
5532
|
-
github:
|
|
5402
|
+
var UserProfileSchema = z.object({
|
|
5403
|
+
displayName: z.string().optional(),
|
|
5404
|
+
bio: z.string().optional(),
|
|
5405
|
+
publicEmail: z.string().optional(),
|
|
5406
|
+
companyName: z.string().optional(),
|
|
5407
|
+
avatar: z.string().optional(),
|
|
5408
|
+
socialProfilesLinks: z.object({
|
|
5409
|
+
webiste: z.string().optional(),
|
|
5410
|
+
x: z.string().optional(),
|
|
5411
|
+
github: z.string().optional()
|
|
5533
5412
|
}).optional()
|
|
5534
5413
|
});
|
|
5535
|
-
var UserSchema =
|
|
5536
|
-
name:
|
|
5537
|
-
uid:
|
|
5538
|
-
id:
|
|
5539
|
-
createTime:
|
|
5540
|
-
updateTime:
|
|
5414
|
+
var UserSchema = z.object({
|
|
5415
|
+
name: z.string(),
|
|
5416
|
+
uid: z.string(),
|
|
5417
|
+
id: z.string(),
|
|
5418
|
+
createTime: z.string(),
|
|
5419
|
+
updateTime: z.string(),
|
|
5541
5420
|
profile: UserProfileSchema.optional()
|
|
5542
5421
|
});
|
|
5543
|
-
var AuthenticatedUserSchema =
|
|
5544
|
-
name:
|
|
5545
|
-
uid:
|
|
5546
|
-
id:
|
|
5547
|
-
createTime:
|
|
5548
|
-
updateTime:
|
|
5549
|
-
customerId:
|
|
5550
|
-
email:
|
|
5551
|
-
newsletterSubscription:
|
|
5552
|
-
role:
|
|
5422
|
+
var AuthenticatedUserSchema = z.object({
|
|
5423
|
+
name: z.string(),
|
|
5424
|
+
uid: z.string(),
|
|
5425
|
+
id: z.string(),
|
|
5426
|
+
createTime: z.string(),
|
|
5427
|
+
updateTime: z.string(),
|
|
5428
|
+
customerId: z.string(),
|
|
5429
|
+
email: z.string(),
|
|
5430
|
+
newsletterSubscription: z.boolean(),
|
|
5431
|
+
role: z.string(),
|
|
5553
5432
|
onboardingStatus: OnboardingStatusSchema,
|
|
5554
|
-
cookieToken:
|
|
5433
|
+
cookieToken: z.string().optional(),
|
|
5555
5434
|
profile: UserProfileSchema.optional()
|
|
5556
5435
|
});
|
|
5557
|
-
var listUsersWithPaginationResponseValidator =
|
|
5558
|
-
users:
|
|
5559
|
-
nextPageToken:
|
|
5560
|
-
totalSize:
|
|
5436
|
+
var listUsersWithPaginationResponseValidator = z.object({
|
|
5437
|
+
users: z.array(UserSchema),
|
|
5438
|
+
nextPageToken: z.string(),
|
|
5439
|
+
totalSize: z.number()
|
|
5561
5440
|
});
|
|
5562
5441
|
|
|
5563
5442
|
// src/core/organization/types.ts
|
|
5564
|
-
var OrganizationProfileSchema =
|
|
5565
|
-
displayName:
|
|
5566
|
-
bio:
|
|
5567
|
-
publicEmail:
|
|
5568
|
-
avatar:
|
|
5569
|
-
socialProfilesLinks:
|
|
5570
|
-
webiste:
|
|
5571
|
-
x:
|
|
5572
|
-
github:
|
|
5443
|
+
var OrganizationProfileSchema = z.object({
|
|
5444
|
+
displayName: z.string().optional(),
|
|
5445
|
+
bio: z.string().optional(),
|
|
5446
|
+
publicEmail: z.string().optional(),
|
|
5447
|
+
avatar: z.string().optional(),
|
|
5448
|
+
socialProfilesLinks: z.object({
|
|
5449
|
+
webiste: z.string().optional(),
|
|
5450
|
+
x: z.string().optional(),
|
|
5451
|
+
github: z.string().optional()
|
|
5573
5452
|
}).optional()
|
|
5574
5453
|
});
|
|
5575
|
-
var OrganizationSchema =
|
|
5576
|
-
name:
|
|
5577
|
-
uid:
|
|
5578
|
-
id:
|
|
5579
|
-
createTime:
|
|
5580
|
-
updateTime:
|
|
5454
|
+
var OrganizationSchema = z.object({
|
|
5455
|
+
name: z.string(),
|
|
5456
|
+
uid: z.string(),
|
|
5457
|
+
id: z.string(),
|
|
5458
|
+
createTime: z.string(),
|
|
5459
|
+
updateTime: z.string(),
|
|
5581
5460
|
owner: UserSchema,
|
|
5582
5461
|
profile: OrganizationProfileSchema.optional()
|
|
5583
5462
|
});
|
|
5584
5463
|
|
|
5585
5464
|
// src/core/membership/types.ts
|
|
5586
|
-
var MembershipStateSchema =
|
|
5465
|
+
var MembershipStateSchema = z.enum([
|
|
5587
5466
|
"MEMBERSHIP_STATE_ACTIVE",
|
|
5588
5467
|
"MEMBERSHIP_STATE_PENDING"
|
|
5589
5468
|
]);
|
|
5590
|
-
var UserMembershipSchema =
|
|
5469
|
+
var UserMembershipSchema = z.object({
|
|
5591
5470
|
user: UserSchema,
|
|
5592
5471
|
organization: OrganizationSchema,
|
|
5593
|
-
name:
|
|
5594
|
-
role:
|
|
5472
|
+
name: z.string().nullable(),
|
|
5473
|
+
role: z.string(),
|
|
5595
5474
|
state: MembershipStateSchema
|
|
5596
5475
|
});
|
|
5597
|
-
var OrganizationMembershipSchema =
|
|
5476
|
+
var OrganizationMembershipSchema = z.object({
|
|
5598
5477
|
user: UserSchema,
|
|
5599
5478
|
organization: OrganizationSchema,
|
|
5600
|
-
name:
|
|
5601
|
-
role:
|
|
5479
|
+
name: z.string().nullable(),
|
|
5480
|
+
role: z.string(),
|
|
5602
5481
|
state: MembershipStateSchema
|
|
5603
5482
|
});
|
|
5604
|
-
var listUserMembershipsResponseValidator =
|
|
5605
|
-
var listOrganizationMembershipsResponseValidator =
|
|
5483
|
+
var listUserMembershipsResponseValidator = z.array(UserMembershipSchema);
|
|
5484
|
+
var listOrganizationMembershipsResponseValidator = z.array(
|
|
5606
5485
|
OrganizationMembershipSchema
|
|
5607
5486
|
);
|
|
5608
5487
|
|
|
@@ -6400,27 +6279,27 @@ var ComponentClient = class extends APIResource {
|
|
|
6400
6279
|
};
|
|
6401
6280
|
|
|
6402
6281
|
// src/types.ts
|
|
6403
|
-
var PermissionSchema =
|
|
6404
|
-
canEdit:
|
|
6405
|
-
canTrigger:
|
|
6282
|
+
var PermissionSchema = z.object({
|
|
6283
|
+
canEdit: z.boolean(),
|
|
6284
|
+
canTrigger: z.boolean()
|
|
6406
6285
|
});
|
|
6407
|
-
var UserOwnerSchema =
|
|
6286
|
+
var UserOwnerSchema = z.object({
|
|
6408
6287
|
user: UserSchema
|
|
6409
6288
|
});
|
|
6410
|
-
var OrganizationOwnerSchema =
|
|
6289
|
+
var OrganizationOwnerSchema = z.object({
|
|
6411
6290
|
organization: OrganizationSchema
|
|
6412
6291
|
});
|
|
6413
|
-
var OwnerSchema =
|
|
6414
|
-
var DataSpecificationSchema =
|
|
6415
|
-
input:
|
|
6416
|
-
output:
|
|
6292
|
+
var OwnerSchema = z.union([UserOwnerSchema, OrganizationOwnerSchema]);
|
|
6293
|
+
var DataSpecificationSchema = z.object({
|
|
6294
|
+
input: z.any().nullable(),
|
|
6295
|
+
output: z.any().nullable()
|
|
6417
6296
|
});
|
|
6418
|
-
var SpecSchema =
|
|
6419
|
-
componentSpecification:
|
|
6420
|
-
dataSpecifications:
|
|
6421
|
-
|
|
6422
|
-
input:
|
|
6423
|
-
output:
|
|
6297
|
+
var SpecSchema = z.object({
|
|
6298
|
+
componentSpecification: z.record(z.any()),
|
|
6299
|
+
dataSpecifications: z.record(
|
|
6300
|
+
z.object({
|
|
6301
|
+
input: z.any().nullable(),
|
|
6302
|
+
output: z.any().nullable()
|
|
6424
6303
|
})
|
|
6425
6304
|
).nullable()
|
|
6426
6305
|
});
|
|
@@ -6435,7 +6314,7 @@ var InstillError = class extends Error {
|
|
|
6435
6314
|
};
|
|
6436
6315
|
|
|
6437
6316
|
// src/vdp/component/types.ts
|
|
6438
|
-
var ComponentTypeSchema =
|
|
6317
|
+
var ComponentTypeSchema = z.enum([
|
|
6439
6318
|
"COMPONENT_TYPE_UNSPECIFIED",
|
|
6440
6319
|
"COMPONENT_TYPE_OPERATOR",
|
|
6441
6320
|
"COMPONENT_TYPE_DATA",
|
|
@@ -6443,79 +6322,79 @@ var ComponentTypeSchema = external_exports.enum([
|
|
|
6443
6322
|
"COMPONENT_TYPE_APPLICATION",
|
|
6444
6323
|
"COMPONENT_TYPE_GENERIC"
|
|
6445
6324
|
]);
|
|
6446
|
-
var TaskSchema =
|
|
6447
|
-
name:
|
|
6448
|
-
title:
|
|
6449
|
-
description:
|
|
6325
|
+
var TaskSchema = z.object({
|
|
6326
|
+
name: z.string(),
|
|
6327
|
+
title: z.string(),
|
|
6328
|
+
description: z.string()
|
|
6450
6329
|
});
|
|
6451
|
-
var ConnectorDefinitionSchema =
|
|
6452
|
-
name:
|
|
6453
|
-
uid:
|
|
6454
|
-
id:
|
|
6455
|
-
title:
|
|
6456
|
-
documentationUrl:
|
|
6457
|
-
icon:
|
|
6330
|
+
var ConnectorDefinitionSchema = z.object({
|
|
6331
|
+
name: z.string(),
|
|
6332
|
+
uid: z.string(),
|
|
6333
|
+
id: z.string(),
|
|
6334
|
+
title: z.string(),
|
|
6335
|
+
documentationUrl: z.string(),
|
|
6336
|
+
icon: z.string(),
|
|
6458
6337
|
type: ComponentTypeSchema,
|
|
6459
6338
|
spec: SpecSchema,
|
|
6460
|
-
tombstone:
|
|
6461
|
-
public:
|
|
6462
|
-
custom:
|
|
6463
|
-
vendor:
|
|
6464
|
-
vendorAttributes:
|
|
6465
|
-
tasks:
|
|
6339
|
+
tombstone: z.boolean(),
|
|
6340
|
+
public: z.boolean(),
|
|
6341
|
+
custom: z.boolean(),
|
|
6342
|
+
vendor: z.string(),
|
|
6343
|
+
vendorAttributes: z.record(z.any()),
|
|
6344
|
+
tasks: z.array(TaskSchema)
|
|
6466
6345
|
});
|
|
6467
|
-
var ComponentDefinitionSchema =
|
|
6468
|
-
name:
|
|
6469
|
-
uid:
|
|
6470
|
-
id:
|
|
6471
|
-
title:
|
|
6472
|
-
documentationUrl:
|
|
6473
|
-
icon:
|
|
6346
|
+
var ComponentDefinitionSchema = z.object({
|
|
6347
|
+
name: z.string(),
|
|
6348
|
+
uid: z.string(),
|
|
6349
|
+
id: z.string(),
|
|
6350
|
+
title: z.string(),
|
|
6351
|
+
documentationUrl: z.string(),
|
|
6352
|
+
icon: z.string(),
|
|
6474
6353
|
spec: SpecSchema,
|
|
6475
6354
|
type: ComponentTypeSchema,
|
|
6476
|
-
tombstone:
|
|
6477
|
-
public:
|
|
6478
|
-
custom:
|
|
6479
|
-
vendor:
|
|
6480
|
-
vendorAttributes:
|
|
6481
|
-
sourceUrl:
|
|
6482
|
-
version:
|
|
6483
|
-
tasks:
|
|
6484
|
-
description:
|
|
6485
|
-
releaseStage:
|
|
6355
|
+
tombstone: z.boolean(),
|
|
6356
|
+
public: z.boolean(),
|
|
6357
|
+
custom: z.boolean(),
|
|
6358
|
+
vendor: z.string(),
|
|
6359
|
+
vendorAttributes: z.record(z.any()),
|
|
6360
|
+
sourceUrl: z.string(),
|
|
6361
|
+
version: z.string(),
|
|
6362
|
+
tasks: z.array(TaskSchema),
|
|
6363
|
+
description: z.string(),
|
|
6364
|
+
releaseStage: z.string()
|
|
6486
6365
|
});
|
|
6487
|
-
var OperatorDefinitionSchema =
|
|
6488
|
-
name:
|
|
6489
|
-
uid:
|
|
6490
|
-
id:
|
|
6491
|
-
title:
|
|
6492
|
-
documentationUrl:
|
|
6493
|
-
icon:
|
|
6366
|
+
var OperatorDefinitionSchema = z.object({
|
|
6367
|
+
name: z.string(),
|
|
6368
|
+
uid: z.string(),
|
|
6369
|
+
id: z.string(),
|
|
6370
|
+
title: z.string(),
|
|
6371
|
+
documentationUrl: z.string(),
|
|
6372
|
+
icon: z.string(),
|
|
6494
6373
|
spec: SpecSchema,
|
|
6495
|
-
tombstone:
|
|
6496
|
-
public:
|
|
6497
|
-
custom:
|
|
6498
|
-
tasks:
|
|
6374
|
+
tombstone: z.boolean(),
|
|
6375
|
+
public: z.boolean(),
|
|
6376
|
+
custom: z.boolean(),
|
|
6377
|
+
tasks: z.array(TaskSchema),
|
|
6499
6378
|
type: ComponentTypeSchema
|
|
6500
6379
|
});
|
|
6501
|
-
var listConnectorDefinitionsWithPaginationResponseValidator =
|
|
6380
|
+
var listConnectorDefinitionsWithPaginationResponseValidator = z.object(
|
|
6502
6381
|
{
|
|
6503
|
-
connectorDefinitions:
|
|
6504
|
-
nextPageToken:
|
|
6505
|
-
totalSize:
|
|
6382
|
+
connectorDefinitions: z.array(ConnectorDefinitionSchema),
|
|
6383
|
+
nextPageToken: z.string(),
|
|
6384
|
+
totalSize: z.number()
|
|
6506
6385
|
}
|
|
6507
6386
|
);
|
|
6508
|
-
var listComponentDefinitionsWithPaginationResponseValidator =
|
|
6387
|
+
var listComponentDefinitionsWithPaginationResponseValidator = z.object(
|
|
6509
6388
|
{
|
|
6510
|
-
componentDefinitions:
|
|
6511
|
-
nextPageToken:
|
|
6512
|
-
totalSize:
|
|
6389
|
+
componentDefinitions: z.array(ComponentDefinitionSchema),
|
|
6390
|
+
nextPageToken: z.string(),
|
|
6391
|
+
totalSize: z.number()
|
|
6513
6392
|
}
|
|
6514
6393
|
);
|
|
6515
|
-
var listOperatorDefinitionsWithPaginationResponseValidator =
|
|
6516
|
-
operatorDefinitions:
|
|
6517
|
-
nextPageToken:
|
|
6518
|
-
totalSize:
|
|
6394
|
+
var listOperatorDefinitionsWithPaginationResponseValidator = z.object({
|
|
6395
|
+
operatorDefinitions: z.array(OperatorDefinitionSchema),
|
|
6396
|
+
nextPageToken: z.string(),
|
|
6397
|
+
totalSize: z.number()
|
|
6519
6398
|
});
|
|
6520
6399
|
|
|
6521
6400
|
// src/vdp/pipeline/PipelineClient.ts
|
|
@@ -6875,82 +6754,82 @@ var ReleaseClient = class extends APIResource {
|
|
|
6875
6754
|
};
|
|
6876
6755
|
|
|
6877
6756
|
// src/vdp/release/types.ts
|
|
6878
|
-
var PipelineReleaseSchema =
|
|
6879
|
-
name:
|
|
6880
|
-
uid:
|
|
6881
|
-
id:
|
|
6882
|
-
description:
|
|
6757
|
+
var PipelineReleaseSchema = z.object({
|
|
6758
|
+
name: z.string(),
|
|
6759
|
+
uid: z.string(),
|
|
6760
|
+
id: z.string(),
|
|
6761
|
+
description: z.string(),
|
|
6883
6762
|
// Our openapi isn't fully typed on the recipe field yet
|
|
6884
|
-
recipe:
|
|
6885
|
-
createTime:
|
|
6886
|
-
updateTime:
|
|
6887
|
-
deleteTime:
|
|
6888
|
-
metadata:
|
|
6889
|
-
alias:
|
|
6890
|
-
readme:
|
|
6891
|
-
rawRecipe:
|
|
6763
|
+
recipe: z.record(z.any()),
|
|
6764
|
+
createTime: z.string(),
|
|
6765
|
+
updateTime: z.string(),
|
|
6766
|
+
deleteTime: z.string().optional(),
|
|
6767
|
+
metadata: z.record(z.any()),
|
|
6768
|
+
alias: z.string().optional(),
|
|
6769
|
+
readme: z.string(),
|
|
6770
|
+
rawRecipe: z.string(),
|
|
6892
6771
|
dataSpecification: DataSpecificationSchema
|
|
6893
6772
|
});
|
|
6894
6773
|
|
|
6895
6774
|
// src/vdp/pipeline/types.ts
|
|
6896
|
-
var PipelineStatsSchema =
|
|
6897
|
-
lastRunTime:
|
|
6898
|
-
numberOfRuns:
|
|
6775
|
+
var PipelineStatsSchema = z.object({
|
|
6776
|
+
lastRunTime: z.string(),
|
|
6777
|
+
numberOfRuns: z.number()
|
|
6899
6778
|
});
|
|
6900
|
-
var PermissionRoleSchema =
|
|
6779
|
+
var PermissionRoleSchema = z.enum([
|
|
6901
6780
|
"ROLE_UNSPECIFIED",
|
|
6902
6781
|
"ROLE_VIEWER",
|
|
6903
6782
|
"ROLE_EXECUTOR"
|
|
6904
6783
|
]);
|
|
6905
|
-
var PipelineSharingCodeRuleSchema =
|
|
6906
|
-
user:
|
|
6907
|
-
code:
|
|
6908
|
-
enabled:
|
|
6784
|
+
var PipelineSharingCodeRuleSchema = z.object({
|
|
6785
|
+
user: z.string(),
|
|
6786
|
+
code: z.string().optional(),
|
|
6787
|
+
enabled: z.boolean(),
|
|
6909
6788
|
role: PermissionRoleSchema
|
|
6910
6789
|
});
|
|
6911
|
-
var PipelineSharingUserRulesSchema =
|
|
6912
|
-
|
|
6913
|
-
enabled:
|
|
6790
|
+
var PipelineSharingUserRulesSchema = z.record(
|
|
6791
|
+
z.object({
|
|
6792
|
+
enabled: z.boolean(),
|
|
6914
6793
|
role: PermissionRoleSchema
|
|
6915
6794
|
}).optional()
|
|
6916
6795
|
);
|
|
6917
|
-
var PipelineSharingSchema =
|
|
6796
|
+
var PipelineSharingSchema = z.object({
|
|
6918
6797
|
users: PipelineSharingUserRulesSchema,
|
|
6919
6798
|
shareCode: PipelineSharingCodeRuleSchema.nullable()
|
|
6920
6799
|
});
|
|
6921
|
-
var PipelineSchema =
|
|
6922
|
-
name:
|
|
6923
|
-
uid:
|
|
6924
|
-
id:
|
|
6925
|
-
description:
|
|
6926
|
-
readme:
|
|
6927
|
-
createTime:
|
|
6928
|
-
updateTime:
|
|
6800
|
+
var PipelineSchema = z.object({
|
|
6801
|
+
name: z.string(),
|
|
6802
|
+
uid: z.string(),
|
|
6803
|
+
id: z.string(),
|
|
6804
|
+
description: z.string(),
|
|
6805
|
+
readme: z.string(),
|
|
6806
|
+
createTime: z.string(),
|
|
6807
|
+
updateTime: z.string(),
|
|
6929
6808
|
// Our openapi isn't fully typed on the recipe field yet
|
|
6930
|
-
recipe:
|
|
6809
|
+
recipe: z.record(z.any()),
|
|
6931
6810
|
dataSpecification: DataSpecificationSchema,
|
|
6932
6811
|
owner: OwnerSchema,
|
|
6933
|
-
ownerName:
|
|
6934
|
-
releases:
|
|
6812
|
+
ownerName: z.string(),
|
|
6813
|
+
releases: z.array(PipelineReleaseSchema),
|
|
6935
6814
|
sharing: PipelineSharingSchema,
|
|
6936
|
-
metadata:
|
|
6815
|
+
metadata: z.record(z.any()),
|
|
6937
6816
|
permission: PermissionSchema,
|
|
6938
|
-
tags:
|
|
6817
|
+
tags: z.array(z.string()),
|
|
6939
6818
|
stats: PipelineStatsSchema,
|
|
6940
|
-
profileImage:
|
|
6941
|
-
sourceUrl:
|
|
6942
|
-
documentationUrl:
|
|
6943
|
-
license:
|
|
6819
|
+
profileImage: z.string(),
|
|
6820
|
+
sourceUrl: z.string(),
|
|
6821
|
+
documentationUrl: z.string(),
|
|
6822
|
+
license: z.string()
|
|
6944
6823
|
});
|
|
6945
|
-
var listAccessiblePipelinesWithPaginationResponseValidator =
|
|
6946
|
-
pipelines:
|
|
6947
|
-
nextPageToken:
|
|
6948
|
-
totalSize:
|
|
6824
|
+
var listAccessiblePipelinesWithPaginationResponseValidator = z.object({
|
|
6825
|
+
pipelines: z.array(PipelineSchema),
|
|
6826
|
+
nextPageToken: z.string(),
|
|
6827
|
+
totalSize: z.number()
|
|
6949
6828
|
});
|
|
6950
|
-
var listNamespacePipelinesWithPaginationResponseValidator =
|
|
6951
|
-
pipelines:
|
|
6952
|
-
nextPageToken:
|
|
6953
|
-
totalSize:
|
|
6829
|
+
var listNamespacePipelinesWithPaginationResponseValidator = z.object({
|
|
6830
|
+
pipelines: z.array(PipelineSchema),
|
|
6831
|
+
nextPageToken: z.string(),
|
|
6832
|
+
totalSize: z.number()
|
|
6954
6833
|
});
|
|
6955
6834
|
|
|
6956
6835
|
// src/vdp/secret/SecretClient.ts
|
|
@@ -7241,63 +7120,63 @@ var TriggerClient = class extends APIResource {
|
|
|
7241
7120
|
};
|
|
7242
7121
|
|
|
7243
7122
|
// src/vdp/types.ts
|
|
7244
|
-
var PipelineVariableFieldSchema =
|
|
7245
|
-
title:
|
|
7246
|
-
instillFormat:
|
|
7247
|
-
description:
|
|
7248
|
-
instillUiOrder:
|
|
7249
|
-
instillUiMultiline:
|
|
7123
|
+
var PipelineVariableFieldSchema = z.object({
|
|
7124
|
+
title: z.string(),
|
|
7125
|
+
instillFormat: z.string(),
|
|
7126
|
+
description: z.string().optional(),
|
|
7127
|
+
instillUiOrder: z.number().optional(),
|
|
7128
|
+
instillUiMultiline: z.boolean().optional()
|
|
7250
7129
|
});
|
|
7251
|
-
var PipelineVariableFieldMapSchema =
|
|
7130
|
+
var PipelineVariableFieldMapSchema = z.record(
|
|
7252
7131
|
PipelineVariableFieldSchema.nullable()
|
|
7253
7132
|
);
|
|
7254
|
-
var PipelineOutputFieldSchema =
|
|
7255
|
-
title:
|
|
7256
|
-
description:
|
|
7257
|
-
value:
|
|
7258
|
-
instillUiOrder:
|
|
7133
|
+
var PipelineOutputFieldSchema = z.object({
|
|
7134
|
+
title: z.string(),
|
|
7135
|
+
description: z.string().optional(),
|
|
7136
|
+
value: z.string(),
|
|
7137
|
+
instillUiOrder: z.number().optional()
|
|
7259
7138
|
});
|
|
7260
|
-
var PipelineOutputFieldMapSchema =
|
|
7139
|
+
var PipelineOutputFieldMapSchema = z.record(
|
|
7261
7140
|
PipelineOutputFieldSchema.nullable()
|
|
7262
7141
|
);
|
|
7263
|
-
var PipelineComponentMapSchema =
|
|
7264
|
-
var PipelineRunOnEventItemMapSchema =
|
|
7265
|
-
var PipelineRunOnMapSchema =
|
|
7266
|
-
var PipelineRecipeSchema =
|
|
7267
|
-
version:
|
|
7142
|
+
var PipelineComponentMapSchema = z.record(z.any());
|
|
7143
|
+
var PipelineRunOnEventItemMapSchema = z.record(z.any());
|
|
7144
|
+
var PipelineRunOnMapSchema = z.record(z.any());
|
|
7145
|
+
var PipelineRecipeSchema = z.object({
|
|
7146
|
+
version: z.string(),
|
|
7268
7147
|
component: PipelineComponentMapSchema.optional(),
|
|
7269
7148
|
variable: PipelineVariableFieldMapSchema.optional(),
|
|
7270
7149
|
output: PipelineOutputFieldMapSchema.optional(),
|
|
7271
7150
|
on: PipelineRunOnMapSchema.optional()
|
|
7272
7151
|
});
|
|
7273
|
-
var ResourceViewSchema =
|
|
7152
|
+
var ResourceViewSchema = z.enum(["VIEW_FULL", "VIEW_BASIC"]);
|
|
7274
7153
|
|
|
7275
7154
|
// src/core/integration/type.ts
|
|
7276
|
-
var HelpLinkSchema =
|
|
7277
|
-
text:
|
|
7278
|
-
url:
|
|
7155
|
+
var HelpLinkSchema = z.object({
|
|
7156
|
+
text: z.string(),
|
|
7157
|
+
url: z.string()
|
|
7279
7158
|
});
|
|
7280
|
-
var OAuthConfigSchema =
|
|
7281
|
-
authUrl:
|
|
7282
|
-
accessUrl:
|
|
7283
|
-
scopes:
|
|
7159
|
+
var OAuthConfigSchema = z.object({
|
|
7160
|
+
authUrl: z.string(),
|
|
7161
|
+
accessUrl: z.string(),
|
|
7162
|
+
scopes: z.array(z.string())
|
|
7284
7163
|
});
|
|
7285
|
-
var IntegrationSchema =
|
|
7286
|
-
uid:
|
|
7287
|
-
id:
|
|
7288
|
-
title:
|
|
7289
|
-
description:
|
|
7290
|
-
vendor:
|
|
7291
|
-
icon:
|
|
7164
|
+
var IntegrationSchema = z.object({
|
|
7165
|
+
uid: z.string(),
|
|
7166
|
+
id: z.string(),
|
|
7167
|
+
title: z.string(),
|
|
7168
|
+
description: z.string(),
|
|
7169
|
+
vendor: z.string(),
|
|
7170
|
+
icon: z.string(),
|
|
7292
7171
|
helpLink: HelpLinkSchema,
|
|
7293
|
-
setupSchema:
|
|
7172
|
+
setupSchema: z.any(),
|
|
7294
7173
|
oAuthConfig: OAuthConfigSchema.nullable(),
|
|
7295
7174
|
view: ResourceViewSchema
|
|
7296
7175
|
});
|
|
7297
|
-
var listPaginatedIntegrationsResponseValidator =
|
|
7298
|
-
integrations:
|
|
7299
|
-
nextPageToken:
|
|
7300
|
-
totalSize:
|
|
7176
|
+
var listPaginatedIntegrationsResponseValidator = z.object({
|
|
7177
|
+
integrations: z.array(IntegrationSchema),
|
|
7178
|
+
nextPageToken: z.string().nullable(),
|
|
7179
|
+
totalSize: z.number()
|
|
7301
7180
|
});
|
|
7302
7181
|
|
|
7303
7182
|
// src/core/utils/UtilsClient.ts
|
|
@@ -8535,6 +8414,106 @@ var InstillChatTypeEnum = {
|
|
|
8535
8414
|
TableCreated: "CHAT_TABLE_CREATED"
|
|
8536
8415
|
};
|
|
8537
8416
|
|
|
8417
|
+
// src/folder/FolderClient.ts
|
|
8418
|
+
var FolderClient = class extends APIResource {
|
|
8419
|
+
async createInstillFolder(props) {
|
|
8420
|
+
const { namespaceId, ...payload } = props;
|
|
8421
|
+
try {
|
|
8422
|
+
const data = await this._client.post(
|
|
8423
|
+
`/namespaces/${namespaceId}/folders`,
|
|
8424
|
+
{
|
|
8425
|
+
body: JSON.stringify(payload)
|
|
8426
|
+
}
|
|
8427
|
+
);
|
|
8428
|
+
return Promise.resolve(data);
|
|
8429
|
+
} catch (error) {
|
|
8430
|
+
return Promise.reject(error);
|
|
8431
|
+
}
|
|
8432
|
+
}
|
|
8433
|
+
async getInstillFolder(props) {
|
|
8434
|
+
const { namespaceId, folderUid } = props;
|
|
8435
|
+
try {
|
|
8436
|
+
const response = await this._client.get(
|
|
8437
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`
|
|
8438
|
+
);
|
|
8439
|
+
return Promise.resolve(response);
|
|
8440
|
+
} catch (error) {
|
|
8441
|
+
return Promise.reject(error);
|
|
8442
|
+
}
|
|
8443
|
+
}
|
|
8444
|
+
async updateInstillFolder(props) {
|
|
8445
|
+
const { namespaceId, folderUid, ...body } = props;
|
|
8446
|
+
try {
|
|
8447
|
+
const data = await this._client.put(
|
|
8448
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`,
|
|
8449
|
+
{
|
|
8450
|
+
body: JSON.stringify(body)
|
|
8451
|
+
}
|
|
8452
|
+
);
|
|
8453
|
+
return Promise.resolve(data);
|
|
8454
|
+
} catch (error) {
|
|
8455
|
+
return Promise.reject(error);
|
|
8456
|
+
}
|
|
8457
|
+
}
|
|
8458
|
+
async deleteInstillFolder(props) {
|
|
8459
|
+
const { namespaceId, folderUid } = props;
|
|
8460
|
+
try {
|
|
8461
|
+
await this._client.delete(
|
|
8462
|
+
`/namespaces/${namespaceId}/folders/${folderUid}`
|
|
8463
|
+
);
|
|
8464
|
+
return Promise.resolve();
|
|
8465
|
+
} catch (error) {
|
|
8466
|
+
return Promise.reject(error);
|
|
8467
|
+
}
|
|
8468
|
+
}
|
|
8469
|
+
async listPaginatedInstillFolders(props) {
|
|
8470
|
+
const { namespaceId, pageToken, pageSize } = props;
|
|
8471
|
+
const queryString = getQueryString({
|
|
8472
|
+
baseURL: `/namespaces/${namespaceId}/folders`,
|
|
8473
|
+
pageToken,
|
|
8474
|
+
pageSize
|
|
8475
|
+
});
|
|
8476
|
+
try {
|
|
8477
|
+
const data = await this._client.get(
|
|
8478
|
+
queryString
|
|
8479
|
+
);
|
|
8480
|
+
return Promise.resolve(data);
|
|
8481
|
+
} catch (error) {
|
|
8482
|
+
return Promise.reject(error);
|
|
8483
|
+
}
|
|
8484
|
+
}
|
|
8485
|
+
async listInstillFolders(props) {
|
|
8486
|
+
const { namespaceId, pageToken, pageSize } = props;
|
|
8487
|
+
const queryString = getQueryString({
|
|
8488
|
+
baseURL: `/namespaces/${namespaceId}/folders`,
|
|
8489
|
+
pageToken,
|
|
8490
|
+
pageSize
|
|
8491
|
+
});
|
|
8492
|
+
const folders = [];
|
|
8493
|
+
try {
|
|
8494
|
+
const data = await this._client.get(
|
|
8495
|
+
queryString
|
|
8496
|
+
);
|
|
8497
|
+
folders.push(...data.folders);
|
|
8498
|
+
if (data.nextPageToken) {
|
|
8499
|
+
folders.push(
|
|
8500
|
+
...(await this.listInstillFolders({
|
|
8501
|
+
namespaceId,
|
|
8502
|
+
pageSize,
|
|
8503
|
+
pageToken: data.nextPageToken
|
|
8504
|
+
})).folders
|
|
8505
|
+
);
|
|
8506
|
+
}
|
|
8507
|
+
const response = {
|
|
8508
|
+
folders
|
|
8509
|
+
};
|
|
8510
|
+
return Promise.resolve(response);
|
|
8511
|
+
} catch (error) {
|
|
8512
|
+
return Promise.reject(error);
|
|
8513
|
+
}
|
|
8514
|
+
}
|
|
8515
|
+
};
|
|
8516
|
+
|
|
8538
8517
|
// src/main/index.ts
|
|
8539
8518
|
var InstillAPIClient = class {
|
|
8540
8519
|
baseURL;
|
|
@@ -8635,6 +8614,7 @@ var InstillAPIClient = class {
|
|
|
8635
8614
|
artifact = new ArtifactClient(this);
|
|
8636
8615
|
table = new TableClient(this);
|
|
8637
8616
|
chat = new ChatClient(this);
|
|
8617
|
+
folder = new FolderClient(this);
|
|
8638
8618
|
};
|
|
8639
8619
|
|
|
8640
8620
|
// src/vdp/trigger/streamHelpers.ts
|
|
@@ -8664,6 +8644,7 @@ function isComponentErrorUpdatedEvent(event) {
|
|
|
8664
8644
|
ApplicationClient,
|
|
8665
8645
|
ChatClient,
|
|
8666
8646
|
DataSpecificationSchema,
|
|
8647
|
+
FolderClient,
|
|
8667
8648
|
InstillAPIClient,
|
|
8668
8649
|
InstillChatTypeEnum,
|
|
8669
8650
|
InstillError,
|