@magiclabs.ai/magicbook-client 0.7.29-canary → 0.7.30
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/index.cjs +437 -457
- package/index.cjs.map +1 -1
- package/index.d.cts +18 -0
- package/index.d.ts +18 -0
- package/index.iife.js +427 -456
- package/index.iife.min.js +1 -1
- package/index.js +443 -457
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -293,6 +293,12 @@ var styles = {
|
|
|
293
293
|
6166: { slug: "disney-mickey-and-friends-sfly" },
|
|
294
294
|
6169: { slug: "through-the-years-sfly" },
|
|
295
295
|
6172: { slug: "modern-editorial-moments-sfly" },
|
|
296
|
+
6173: { slug: "disneys-happily-ever-after-sfly" },
|
|
297
|
+
6176: { slug: "disney-mickey-and-friends-christmas-sfly" },
|
|
298
|
+
6177: { slug: "timeless-love-story-sfly" },
|
|
299
|
+
6178: { slug: "tiny-moments-sfly" },
|
|
300
|
+
6179: { slug: "travel-archives-sfly" },
|
|
301
|
+
6180: { slug: "illustrated-with-love-sfly" },
|
|
296
302
|
//snapfish styles
|
|
297
303
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
298
304
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -1671,10 +1677,123 @@ function getStyleIdBySlug(slug) {
|
|
|
1671
1677
|
return slug;
|
|
1672
1678
|
}
|
|
1673
1679
|
|
|
1674
|
-
// ../../node_modules/.pnpm/zod@3.
|
|
1680
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
1681
|
+
var external_exports = {};
|
|
1682
|
+
__export(external_exports, {
|
|
1683
|
+
BRAND: () => BRAND,
|
|
1684
|
+
DIRTY: () => DIRTY,
|
|
1685
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
1686
|
+
INVALID: () => INVALID,
|
|
1687
|
+
NEVER: () => NEVER,
|
|
1688
|
+
OK: () => OK,
|
|
1689
|
+
ParseStatus: () => ParseStatus,
|
|
1690
|
+
Schema: () => ZodType,
|
|
1691
|
+
ZodAny: () => ZodAny,
|
|
1692
|
+
ZodArray: () => ZodArray,
|
|
1693
|
+
ZodBigInt: () => ZodBigInt,
|
|
1694
|
+
ZodBoolean: () => ZodBoolean,
|
|
1695
|
+
ZodBranded: () => ZodBranded,
|
|
1696
|
+
ZodCatch: () => ZodCatch,
|
|
1697
|
+
ZodDate: () => ZodDate,
|
|
1698
|
+
ZodDefault: () => ZodDefault,
|
|
1699
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
1700
|
+
ZodEffects: () => ZodEffects,
|
|
1701
|
+
ZodEnum: () => ZodEnum,
|
|
1702
|
+
ZodError: () => ZodError,
|
|
1703
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1704
|
+
ZodFunction: () => ZodFunction,
|
|
1705
|
+
ZodIntersection: () => ZodIntersection,
|
|
1706
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
1707
|
+
ZodLazy: () => ZodLazy,
|
|
1708
|
+
ZodLiteral: () => ZodLiteral,
|
|
1709
|
+
ZodMap: () => ZodMap,
|
|
1710
|
+
ZodNaN: () => ZodNaN,
|
|
1711
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
1712
|
+
ZodNever: () => ZodNever,
|
|
1713
|
+
ZodNull: () => ZodNull,
|
|
1714
|
+
ZodNullable: () => ZodNullable,
|
|
1715
|
+
ZodNumber: () => ZodNumber,
|
|
1716
|
+
ZodObject: () => ZodObject,
|
|
1717
|
+
ZodOptional: () => ZodOptional,
|
|
1718
|
+
ZodParsedType: () => ZodParsedType,
|
|
1719
|
+
ZodPipeline: () => ZodPipeline,
|
|
1720
|
+
ZodPromise: () => ZodPromise,
|
|
1721
|
+
ZodReadonly: () => ZodReadonly,
|
|
1722
|
+
ZodRecord: () => ZodRecord,
|
|
1723
|
+
ZodSchema: () => ZodType,
|
|
1724
|
+
ZodSet: () => ZodSet,
|
|
1725
|
+
ZodString: () => ZodString,
|
|
1726
|
+
ZodSymbol: () => ZodSymbol,
|
|
1727
|
+
ZodTransformer: () => ZodEffects,
|
|
1728
|
+
ZodTuple: () => ZodTuple,
|
|
1729
|
+
ZodType: () => ZodType,
|
|
1730
|
+
ZodUndefined: () => ZodUndefined,
|
|
1731
|
+
ZodUnion: () => ZodUnion,
|
|
1732
|
+
ZodUnknown: () => ZodUnknown,
|
|
1733
|
+
ZodVoid: () => ZodVoid,
|
|
1734
|
+
addIssueToContext: () => addIssueToContext,
|
|
1735
|
+
any: () => anyType,
|
|
1736
|
+
array: () => arrayType,
|
|
1737
|
+
bigint: () => bigIntType,
|
|
1738
|
+
boolean: () => booleanType,
|
|
1739
|
+
coerce: () => coerce,
|
|
1740
|
+
custom: () => custom,
|
|
1741
|
+
date: () => dateType,
|
|
1742
|
+
datetimeRegex: () => datetimeRegex,
|
|
1743
|
+
defaultErrorMap: () => en_default,
|
|
1744
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
1745
|
+
effect: () => effectsType,
|
|
1746
|
+
enum: () => enumType,
|
|
1747
|
+
function: () => functionType,
|
|
1748
|
+
getErrorMap: () => getErrorMap,
|
|
1749
|
+
getParsedType: () => getParsedType,
|
|
1750
|
+
instanceof: () => instanceOfType,
|
|
1751
|
+
intersection: () => intersectionType,
|
|
1752
|
+
isAborted: () => isAborted,
|
|
1753
|
+
isAsync: () => isAsync,
|
|
1754
|
+
isDirty: () => isDirty,
|
|
1755
|
+
isValid: () => isValid,
|
|
1756
|
+
late: () => late,
|
|
1757
|
+
lazy: () => lazyType,
|
|
1758
|
+
literal: () => literalType,
|
|
1759
|
+
makeIssue: () => makeIssue,
|
|
1760
|
+
map: () => mapType,
|
|
1761
|
+
nan: () => nanType,
|
|
1762
|
+
nativeEnum: () => nativeEnumType,
|
|
1763
|
+
never: () => neverType,
|
|
1764
|
+
null: () => nullType,
|
|
1765
|
+
nullable: () => nullableType,
|
|
1766
|
+
number: () => numberType,
|
|
1767
|
+
object: () => objectType,
|
|
1768
|
+
objectUtil: () => objectUtil,
|
|
1769
|
+
oboolean: () => oboolean,
|
|
1770
|
+
onumber: () => onumber,
|
|
1771
|
+
optional: () => optionalType,
|
|
1772
|
+
ostring: () => ostring,
|
|
1773
|
+
pipeline: () => pipelineType,
|
|
1774
|
+
preprocess: () => preprocessType,
|
|
1775
|
+
promise: () => promiseType,
|
|
1776
|
+
quotelessJson: () => quotelessJson,
|
|
1777
|
+
record: () => recordType,
|
|
1778
|
+
set: () => setType,
|
|
1779
|
+
setErrorMap: () => setErrorMap,
|
|
1780
|
+
strictObject: () => strictObjectType,
|
|
1781
|
+
string: () => stringType,
|
|
1782
|
+
symbol: () => symbolType,
|
|
1783
|
+
transformer: () => effectsType,
|
|
1784
|
+
tuple: () => tupleType,
|
|
1785
|
+
undefined: () => undefinedType,
|
|
1786
|
+
union: () => unionType,
|
|
1787
|
+
unknown: () => unknownType,
|
|
1788
|
+
util: () => util,
|
|
1789
|
+
void: () => voidType
|
|
1790
|
+
});
|
|
1791
|
+
|
|
1792
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
1675
1793
|
var util;
|
|
1676
1794
|
(function(util2) {
|
|
1677
|
-
util2.assertEqual = (
|
|
1795
|
+
util2.assertEqual = (_) => {
|
|
1796
|
+
};
|
|
1678
1797
|
function assertIs(_arg) {
|
|
1679
1798
|
}
|
|
1680
1799
|
util2.assertIs = assertIs;
|
|
@@ -1718,7 +1837,7 @@ var util;
|
|
|
1718
1837
|
}
|
|
1719
1838
|
return void 0;
|
|
1720
1839
|
};
|
|
1721
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1840
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
1722
1841
|
function joinValues(array, separator = " | ") {
|
|
1723
1842
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1724
1843
|
}
|
|
@@ -1770,7 +1889,7 @@ var getParsedType = (data) => {
|
|
|
1770
1889
|
case "string":
|
|
1771
1890
|
return ZodParsedType.string;
|
|
1772
1891
|
case "number":
|
|
1773
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1892
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1774
1893
|
case "boolean":
|
|
1775
1894
|
return ZodParsedType.boolean;
|
|
1776
1895
|
case "function":
|
|
@@ -1803,6 +1922,8 @@ var getParsedType = (data) => {
|
|
|
1803
1922
|
return ZodParsedType.unknown;
|
|
1804
1923
|
}
|
|
1805
1924
|
};
|
|
1925
|
+
|
|
1926
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
1806
1927
|
var ZodIssueCode = util.arrayToEnum([
|
|
1807
1928
|
"invalid_type",
|
|
1808
1929
|
"invalid_literal",
|
|
@@ -1902,8 +2023,9 @@ var ZodError = class _ZodError extends Error {
|
|
|
1902
2023
|
const formErrors = [];
|
|
1903
2024
|
for (const sub of this.issues) {
|
|
1904
2025
|
if (sub.path.length > 0) {
|
|
1905
|
-
|
|
1906
|
-
fieldErrors[
|
|
2026
|
+
const firstEl = sub.path[0];
|
|
2027
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
2028
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
1907
2029
|
} else {
|
|
1908
2030
|
formErrors.push(mapper(sub));
|
|
1909
2031
|
}
|
|
@@ -1918,6 +2040,8 @@ ZodError.create = (issues) => {
|
|
|
1918
2040
|
const error = new ZodError(issues);
|
|
1919
2041
|
return error;
|
|
1920
2042
|
};
|
|
2043
|
+
|
|
2044
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
1921
2045
|
var errorMap = (issue, _ctx) => {
|
|
1922
2046
|
let message;
|
|
1923
2047
|
switch (issue.code) {
|
|
@@ -1979,6 +2103,8 @@ var errorMap = (issue, _ctx) => {
|
|
|
1979
2103
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
1980
2104
|
else if (issue.type === "number")
|
|
1981
2105
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2106
|
+
else if (issue.type === "bigint")
|
|
2107
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
1982
2108
|
else if (issue.type === "date")
|
|
1983
2109
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
1984
2110
|
else
|
|
@@ -2016,13 +2142,18 @@ var errorMap = (issue, _ctx) => {
|
|
|
2016
2142
|
}
|
|
2017
2143
|
return { message };
|
|
2018
2144
|
};
|
|
2019
|
-
var
|
|
2145
|
+
var en_default = errorMap;
|
|
2146
|
+
|
|
2147
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
2148
|
+
var overrideErrorMap = en_default;
|
|
2020
2149
|
function setErrorMap(map) {
|
|
2021
2150
|
overrideErrorMap = map;
|
|
2022
2151
|
}
|
|
2023
2152
|
function getErrorMap() {
|
|
2024
2153
|
return overrideErrorMap;
|
|
2025
2154
|
}
|
|
2155
|
+
|
|
2156
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
2026
2157
|
var makeIssue = (params) => {
|
|
2027
2158
|
const { data, path, errorMaps, issueData } = params;
|
|
2028
2159
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -2062,7 +2193,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
2062
2193
|
// then schema-bound map if available
|
|
2063
2194
|
overrideMap,
|
|
2064
2195
|
// then global override map
|
|
2065
|
-
overrideMap ===
|
|
2196
|
+
overrideMap === en_default ? void 0 : en_default
|
|
2066
2197
|
// then global default map
|
|
2067
2198
|
].filter((x) => !!x)
|
|
2068
2199
|
});
|
|
@@ -2131,29 +2262,15 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
2131
2262
|
var isDirty = (x) => x.status === "dirty";
|
|
2132
2263
|
var isValid = (x) => x.status === "valid";
|
|
2133
2264
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
2137
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2138
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2139
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2140
|
-
}
|
|
2141
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2142
|
-
if (kind === "m")
|
|
2143
|
-
throw new TypeError("Private method is not writable");
|
|
2144
|
-
if (kind === "a" && !f)
|
|
2145
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
2146
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2147
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2148
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2149
|
-
}
|
|
2265
|
+
|
|
2266
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
2150
2267
|
var errorUtil;
|
|
2151
2268
|
(function(errorUtil2) {
|
|
2152
2269
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2153
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
2270
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
2154
2271
|
})(errorUtil || (errorUtil = {}));
|
|
2155
|
-
|
|
2156
|
-
|
|
2272
|
+
|
|
2273
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
2157
2274
|
var ParseInputLazyPath = class {
|
|
2158
2275
|
constructor(parent, value, path, key) {
|
|
2159
2276
|
this._cachedPath = [];
|
|
@@ -2164,7 +2281,7 @@ var ParseInputLazyPath = class {
|
|
|
2164
2281
|
}
|
|
2165
2282
|
get path() {
|
|
2166
2283
|
if (!this._cachedPath.length) {
|
|
2167
|
-
if (this._key
|
|
2284
|
+
if (Array.isArray(this._key)) {
|
|
2168
2285
|
this._cachedPath.push(...this._path, ...this._key);
|
|
2169
2286
|
} else {
|
|
2170
2287
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -2202,17 +2319,16 @@ function processCreateParams(params) {
|
|
|
2202
2319
|
if (errorMap2)
|
|
2203
2320
|
return { errorMap: errorMap2, description };
|
|
2204
2321
|
const customMap = (iss, ctx) => {
|
|
2205
|
-
var _a, _b;
|
|
2206
2322
|
const { message } = params;
|
|
2207
2323
|
if (iss.code === "invalid_enum_value") {
|
|
2208
|
-
return { message: message
|
|
2324
|
+
return { message: message ?? ctx.defaultError };
|
|
2209
2325
|
}
|
|
2210
2326
|
if (typeof ctx.data === "undefined") {
|
|
2211
|
-
return { message:
|
|
2327
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
2212
2328
|
}
|
|
2213
2329
|
if (iss.code !== "invalid_type")
|
|
2214
2330
|
return { message: ctx.defaultError };
|
|
2215
|
-
return { message:
|
|
2331
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
2216
2332
|
};
|
|
2217
2333
|
return { errorMap: customMap, description };
|
|
2218
2334
|
}
|
|
@@ -2264,14 +2380,13 @@ var ZodType = class {
|
|
|
2264
2380
|
throw result.error;
|
|
2265
2381
|
}
|
|
2266
2382
|
safeParse(data, params) {
|
|
2267
|
-
var _a;
|
|
2268
2383
|
const ctx = {
|
|
2269
2384
|
common: {
|
|
2270
2385
|
issues: [],
|
|
2271
|
-
async:
|
|
2272
|
-
contextualErrorMap: params
|
|
2386
|
+
async: params?.async ?? false,
|
|
2387
|
+
contextualErrorMap: params?.errorMap
|
|
2273
2388
|
},
|
|
2274
|
-
path:
|
|
2389
|
+
path: params?.path || [],
|
|
2275
2390
|
schemaErrorMap: this._def.errorMap,
|
|
2276
2391
|
parent: null,
|
|
2277
2392
|
data,
|
|
@@ -2281,7 +2396,6 @@ var ZodType = class {
|
|
|
2281
2396
|
return handleResult(ctx, result);
|
|
2282
2397
|
}
|
|
2283
2398
|
"~validate"(data) {
|
|
2284
|
-
var _a, _b;
|
|
2285
2399
|
const ctx = {
|
|
2286
2400
|
common: {
|
|
2287
2401
|
issues: [],
|
|
@@ -2302,7 +2416,7 @@ var ZodType = class {
|
|
|
2302
2416
|
issues: ctx.common.issues
|
|
2303
2417
|
};
|
|
2304
2418
|
} catch (err) {
|
|
2305
|
-
if (
|
|
2419
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
2306
2420
|
this["~standard"].async = true;
|
|
2307
2421
|
}
|
|
2308
2422
|
ctx.common = {
|
|
@@ -2327,10 +2441,10 @@ var ZodType = class {
|
|
|
2327
2441
|
const ctx = {
|
|
2328
2442
|
common: {
|
|
2329
2443
|
issues: [],
|
|
2330
|
-
contextualErrorMap: params
|
|
2444
|
+
contextualErrorMap: params?.errorMap,
|
|
2331
2445
|
async: true
|
|
2332
2446
|
},
|
|
2333
|
-
path:
|
|
2447
|
+
path: params?.path || [],
|
|
2334
2448
|
schemaErrorMap: this._def.errorMap,
|
|
2335
2449
|
parent: null,
|
|
2336
2450
|
data,
|
|
@@ -2555,16 +2669,20 @@ function isValidJWT(jwt, alg) {
|
|
|
2555
2669
|
return false;
|
|
2556
2670
|
try {
|
|
2557
2671
|
const [header] = jwt.split(".");
|
|
2672
|
+
if (!header)
|
|
2673
|
+
return false;
|
|
2558
2674
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
2559
2675
|
const decoded = JSON.parse(atob(base64));
|
|
2560
2676
|
if (typeof decoded !== "object" || decoded === null)
|
|
2561
2677
|
return false;
|
|
2562
|
-
if (
|
|
2678
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
2679
|
+
return false;
|
|
2680
|
+
if (!decoded.alg)
|
|
2563
2681
|
return false;
|
|
2564
2682
|
if (alg && decoded.alg !== alg)
|
|
2565
2683
|
return false;
|
|
2566
2684
|
return true;
|
|
2567
|
-
} catch
|
|
2685
|
+
} catch {
|
|
2568
2686
|
return false;
|
|
2569
2687
|
}
|
|
2570
2688
|
}
|
|
@@ -2723,7 +2841,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2723
2841
|
} else if (check.kind === "url") {
|
|
2724
2842
|
try {
|
|
2725
2843
|
new URL(input.data);
|
|
2726
|
-
} catch
|
|
2844
|
+
} catch {
|
|
2727
2845
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2728
2846
|
addIssueToContext(ctx, {
|
|
2729
2847
|
validation: "url",
|
|
@@ -2935,7 +3053,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2935
3053
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2936
3054
|
}
|
|
2937
3055
|
datetime(options) {
|
|
2938
|
-
var _a, _b;
|
|
2939
3056
|
if (typeof options === "string") {
|
|
2940
3057
|
return this._addCheck({
|
|
2941
3058
|
kind: "datetime",
|
|
@@ -2947,10 +3064,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2947
3064
|
}
|
|
2948
3065
|
return this._addCheck({
|
|
2949
3066
|
kind: "datetime",
|
|
2950
|
-
precision: typeof
|
|
2951
|
-
offset:
|
|
2952
|
-
local:
|
|
2953
|
-
...errorUtil.errToObj(options
|
|
3067
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3068
|
+
offset: options?.offset ?? false,
|
|
3069
|
+
local: options?.local ?? false,
|
|
3070
|
+
...errorUtil.errToObj(options?.message)
|
|
2954
3071
|
});
|
|
2955
3072
|
}
|
|
2956
3073
|
date(message) {
|
|
@@ -2966,8 +3083,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2966
3083
|
}
|
|
2967
3084
|
return this._addCheck({
|
|
2968
3085
|
kind: "time",
|
|
2969
|
-
precision: typeof
|
|
2970
|
-
...errorUtil.errToObj(options
|
|
3086
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3087
|
+
...errorUtil.errToObj(options?.message)
|
|
2971
3088
|
});
|
|
2972
3089
|
}
|
|
2973
3090
|
duration(message) {
|
|
@@ -2984,8 +3101,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2984
3101
|
return this._addCheck({
|
|
2985
3102
|
kind: "includes",
|
|
2986
3103
|
value,
|
|
2987
|
-
position: options
|
|
2988
|
-
...errorUtil.errToObj(options
|
|
3104
|
+
position: options?.position,
|
|
3105
|
+
...errorUtil.errToObj(options?.message)
|
|
2989
3106
|
});
|
|
2990
3107
|
}
|
|
2991
3108
|
startsWith(value, message) {
|
|
@@ -3117,11 +3234,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
3117
3234
|
}
|
|
3118
3235
|
};
|
|
3119
3236
|
ZodString.create = (params) => {
|
|
3120
|
-
var _a;
|
|
3121
3237
|
return new ZodString({
|
|
3122
3238
|
checks: [],
|
|
3123
3239
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
3124
|
-
coerce:
|
|
3240
|
+
coerce: params?.coerce ?? false,
|
|
3125
3241
|
...processCreateParams(params)
|
|
3126
3242
|
});
|
|
3127
3243
|
};
|
|
@@ -3129,9 +3245,9 @@ function floatSafeRemainder(val, step) {
|
|
|
3129
3245
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
3130
3246
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
3131
3247
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
3132
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3133
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3134
|
-
return valInt % stepInt /
|
|
3248
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3249
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3250
|
+
return valInt % stepInt / 10 ** decCount;
|
|
3135
3251
|
}
|
|
3136
3252
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
3137
3253
|
constructor() {
|
|
@@ -3341,7 +3457,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
3341
3457
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
3342
3458
|
}
|
|
3343
3459
|
get isFinite() {
|
|
3344
|
-
let max = null
|
|
3460
|
+
let max = null;
|
|
3461
|
+
let min = null;
|
|
3345
3462
|
for (const ch of this._def.checks) {
|
|
3346
3463
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
3347
3464
|
return true;
|
|
@@ -3360,7 +3477,7 @@ ZodNumber.create = (params) => {
|
|
|
3360
3477
|
return new ZodNumber({
|
|
3361
3478
|
checks: [],
|
|
3362
3479
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
3363
|
-
coerce:
|
|
3480
|
+
coerce: params?.coerce || false,
|
|
3364
3481
|
...processCreateParams(params)
|
|
3365
3482
|
});
|
|
3366
3483
|
};
|
|
@@ -3374,7 +3491,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3374
3491
|
if (this._def.coerce) {
|
|
3375
3492
|
try {
|
|
3376
3493
|
input.data = BigInt(input.data);
|
|
3377
|
-
} catch
|
|
3494
|
+
} catch {
|
|
3378
3495
|
return this._getInvalidInput(input);
|
|
3379
3496
|
}
|
|
3380
3497
|
}
|
|
@@ -3529,11 +3646,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3529
3646
|
}
|
|
3530
3647
|
};
|
|
3531
3648
|
ZodBigInt.create = (params) => {
|
|
3532
|
-
var _a;
|
|
3533
3649
|
return new ZodBigInt({
|
|
3534
3650
|
checks: [],
|
|
3535
3651
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3536
|
-
coerce:
|
|
3652
|
+
coerce: params?.coerce ?? false,
|
|
3537
3653
|
...processCreateParams(params)
|
|
3538
3654
|
});
|
|
3539
3655
|
};
|
|
@@ -3558,7 +3674,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
3558
3674
|
ZodBoolean.create = (params) => {
|
|
3559
3675
|
return new ZodBoolean({
|
|
3560
3676
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3561
|
-
coerce:
|
|
3677
|
+
coerce: params?.coerce || false,
|
|
3562
3678
|
...processCreateParams(params)
|
|
3563
3679
|
});
|
|
3564
3680
|
};
|
|
@@ -3577,7 +3693,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3577
3693
|
});
|
|
3578
3694
|
return INVALID;
|
|
3579
3695
|
}
|
|
3580
|
-
if (isNaN(input.data.getTime())) {
|
|
3696
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
3581
3697
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3582
3698
|
addIssueToContext(ctx2, {
|
|
3583
3699
|
code: ZodIssueCode.invalid_date
|
|
@@ -3666,7 +3782,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3666
3782
|
ZodDate.create = (params) => {
|
|
3667
3783
|
return new ZodDate({
|
|
3668
3784
|
checks: [],
|
|
3669
|
-
coerce:
|
|
3785
|
+
coerce: params?.coerce || false,
|
|
3670
3786
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3671
3787
|
...processCreateParams(params)
|
|
3672
3788
|
});
|
|
@@ -3941,7 +4057,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3941
4057
|
return this._cached;
|
|
3942
4058
|
const shape = this._def.shape();
|
|
3943
4059
|
const keys = util.objectKeys(shape);
|
|
3944
|
-
|
|
4060
|
+
this._cached = { shape, keys };
|
|
4061
|
+
return this._cached;
|
|
3945
4062
|
}
|
|
3946
4063
|
_parse(input) {
|
|
3947
4064
|
const parsedType = this._getType(input);
|
|
@@ -3991,9 +4108,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3991
4108
|
});
|
|
3992
4109
|
status.dirty();
|
|
3993
4110
|
}
|
|
3994
|
-
} else if (unknownKeys === "strip")
|
|
3995
|
-
|
|
3996
|
-
else {
|
|
4111
|
+
} else if (unknownKeys === "strip") {
|
|
4112
|
+
} else {
|
|
3997
4113
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3998
4114
|
}
|
|
3999
4115
|
} else {
|
|
@@ -4040,11 +4156,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4040
4156
|
unknownKeys: "strict",
|
|
4041
4157
|
...message !== void 0 ? {
|
|
4042
4158
|
errorMap: (issue, ctx) => {
|
|
4043
|
-
|
|
4044
|
-
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;
|
|
4159
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
4045
4160
|
if (issue.code === "unrecognized_keys")
|
|
4046
4161
|
return {
|
|
4047
|
-
message:
|
|
4162
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
4048
4163
|
};
|
|
4049
4164
|
return {
|
|
4050
4165
|
message: defaultError
|
|
@@ -4175,11 +4290,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4175
4290
|
}
|
|
4176
4291
|
pick(mask) {
|
|
4177
4292
|
const shape = {};
|
|
4178
|
-
util.objectKeys(mask)
|
|
4293
|
+
for (const key of util.objectKeys(mask)) {
|
|
4179
4294
|
if (mask[key] && this.shape[key]) {
|
|
4180
4295
|
shape[key] = this.shape[key];
|
|
4181
4296
|
}
|
|
4182
|
-
}
|
|
4297
|
+
}
|
|
4183
4298
|
return new _ZodObject({
|
|
4184
4299
|
...this._def,
|
|
4185
4300
|
shape: () => shape
|
|
@@ -4187,11 +4302,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4187
4302
|
}
|
|
4188
4303
|
omit(mask) {
|
|
4189
4304
|
const shape = {};
|
|
4190
|
-
util.objectKeys(this.shape)
|
|
4305
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4191
4306
|
if (!mask[key]) {
|
|
4192
4307
|
shape[key] = this.shape[key];
|
|
4193
4308
|
}
|
|
4194
|
-
}
|
|
4309
|
+
}
|
|
4195
4310
|
return new _ZodObject({
|
|
4196
4311
|
...this._def,
|
|
4197
4312
|
shape: () => shape
|
|
@@ -4205,14 +4320,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4205
4320
|
}
|
|
4206
4321
|
partial(mask) {
|
|
4207
4322
|
const newShape = {};
|
|
4208
|
-
util.objectKeys(this.shape)
|
|
4323
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4209
4324
|
const fieldSchema = this.shape[key];
|
|
4210
4325
|
if (mask && !mask[key]) {
|
|
4211
4326
|
newShape[key] = fieldSchema;
|
|
4212
4327
|
} else {
|
|
4213
4328
|
newShape[key] = fieldSchema.optional();
|
|
4214
4329
|
}
|
|
4215
|
-
}
|
|
4330
|
+
}
|
|
4216
4331
|
return new _ZodObject({
|
|
4217
4332
|
...this._def,
|
|
4218
4333
|
shape: () => newShape
|
|
@@ -4220,7 +4335,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4220
4335
|
}
|
|
4221
4336
|
required(mask) {
|
|
4222
4337
|
const newShape = {};
|
|
4223
|
-
util.objectKeys(this.shape)
|
|
4338
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4224
4339
|
if (mask && !mask[key]) {
|
|
4225
4340
|
newShape[key] = this.shape[key];
|
|
4226
4341
|
} else {
|
|
@@ -4231,7 +4346,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4231
4346
|
}
|
|
4232
4347
|
newShape[key] = newField;
|
|
4233
4348
|
}
|
|
4234
|
-
}
|
|
4349
|
+
}
|
|
4235
4350
|
return new _ZodObject({
|
|
4236
4351
|
...this._def,
|
|
4237
4352
|
shape: () => newShape
|
|
@@ -4847,12 +4962,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4847
4962
|
return makeIssue({
|
|
4848
4963
|
data: args,
|
|
4849
4964
|
path: ctx.path,
|
|
4850
|
-
errorMaps: [
|
|
4851
|
-
ctx.common.contextualErrorMap,
|
|
4852
|
-
ctx.schemaErrorMap,
|
|
4853
|
-
getErrorMap(),
|
|
4854
|
-
errorMap
|
|
4855
|
-
].filter((x) => !!x),
|
|
4965
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4856
4966
|
issueData: {
|
|
4857
4967
|
code: ZodIssueCode.invalid_arguments,
|
|
4858
4968
|
argumentsError: error
|
|
@@ -4863,12 +4973,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4863
4973
|
return makeIssue({
|
|
4864
4974
|
data: returns,
|
|
4865
4975
|
path: ctx.path,
|
|
4866
|
-
errorMaps: [
|
|
4867
|
-
ctx.common.contextualErrorMap,
|
|
4868
|
-
ctx.schemaErrorMap,
|
|
4869
|
-
getErrorMap(),
|
|
4870
|
-
errorMap
|
|
4871
|
-
].filter((x) => !!x),
|
|
4976
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4872
4977
|
issueData: {
|
|
4873
4978
|
code: ZodIssueCode.invalid_return_type,
|
|
4874
4979
|
returnTypeError: error
|
|
@@ -4992,10 +5097,6 @@ function createZodEnum(values, params) {
|
|
|
4992
5097
|
});
|
|
4993
5098
|
}
|
|
4994
5099
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4995
|
-
constructor() {
|
|
4996
|
-
super(...arguments);
|
|
4997
|
-
_ZodEnum_cache.set(this, void 0);
|
|
4998
|
-
}
|
|
4999
5100
|
_parse(input) {
|
|
5000
5101
|
if (typeof input.data !== "string") {
|
|
5001
5102
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5007,10 +5108,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
5007
5108
|
});
|
|
5008
5109
|
return INVALID;
|
|
5009
5110
|
}
|
|
5010
|
-
if (!
|
|
5011
|
-
|
|
5111
|
+
if (!this._cache) {
|
|
5112
|
+
this._cache = new Set(this._def.values);
|
|
5012
5113
|
}
|
|
5013
|
-
if (!
|
|
5114
|
+
if (!this._cache.has(input.data)) {
|
|
5014
5115
|
const ctx = this._getOrReturnCtx(input);
|
|
5015
5116
|
const expectedValues = this._def.values;
|
|
5016
5117
|
addIssueToContext(ctx, {
|
|
@@ -5059,13 +5160,8 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
5059
5160
|
});
|
|
5060
5161
|
}
|
|
5061
5162
|
};
|
|
5062
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5063
5163
|
ZodEnum.create = createZodEnum;
|
|
5064
5164
|
var ZodNativeEnum = class extends ZodType {
|
|
5065
|
-
constructor() {
|
|
5066
|
-
super(...arguments);
|
|
5067
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
5068
|
-
}
|
|
5069
5165
|
_parse(input) {
|
|
5070
5166
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
5071
5167
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5078,10 +5174,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
5078
5174
|
});
|
|
5079
5175
|
return INVALID;
|
|
5080
5176
|
}
|
|
5081
|
-
if (!
|
|
5082
|
-
|
|
5177
|
+
if (!this._cache) {
|
|
5178
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
5083
5179
|
}
|
|
5084
|
-
if (!
|
|
5180
|
+
if (!this._cache.has(input.data)) {
|
|
5085
5181
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
5086
5182
|
addIssueToContext(ctx, {
|
|
5087
5183
|
received: ctx.data,
|
|
@@ -5096,7 +5192,6 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
5096
5192
|
return this._def.values;
|
|
5097
5193
|
}
|
|
5098
5194
|
};
|
|
5099
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5100
5195
|
ZodNativeEnum.create = (values, params) => {
|
|
5101
5196
|
return new ZodNativeEnum({
|
|
5102
5197
|
values,
|
|
@@ -5237,7 +5332,7 @@ var ZodEffects = class extends ZodType {
|
|
|
5237
5332
|
parent: ctx
|
|
5238
5333
|
});
|
|
5239
5334
|
if (!isValid(base))
|
|
5240
|
-
return
|
|
5335
|
+
return INVALID;
|
|
5241
5336
|
const result = effect.transform(base.value, checkCtx);
|
|
5242
5337
|
if (result instanceof Promise) {
|
|
5243
5338
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -5246,8 +5341,11 @@ var ZodEffects = class extends ZodType {
|
|
|
5246
5341
|
} else {
|
|
5247
5342
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
5248
5343
|
if (!isValid(base))
|
|
5249
|
-
return
|
|
5250
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5344
|
+
return INVALID;
|
|
5345
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5346
|
+
status: status.value,
|
|
5347
|
+
value: result
|
|
5348
|
+
}));
|
|
5251
5349
|
});
|
|
5252
5350
|
}
|
|
5253
5351
|
}
|
|
@@ -5507,21 +5605,19 @@ function cleanParams(params, data) {
|
|
|
5507
5605
|
function custom(check, _params = {}, fatal) {
|
|
5508
5606
|
if (check)
|
|
5509
5607
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5510
|
-
var _a, _b;
|
|
5511
5608
|
const r = check(data);
|
|
5512
5609
|
if (r instanceof Promise) {
|
|
5513
5610
|
return r.then((r2) => {
|
|
5514
|
-
var _a2, _b2;
|
|
5515
5611
|
if (!r2) {
|
|
5516
5612
|
const params = cleanParams(_params, data);
|
|
5517
|
-
const _fatal =
|
|
5613
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5518
5614
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5519
5615
|
}
|
|
5520
5616
|
});
|
|
5521
5617
|
}
|
|
5522
5618
|
if (!r) {
|
|
5523
5619
|
const params = cleanParams(_params, data);
|
|
5524
|
-
const _fatal =
|
|
5620
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5525
5621
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5526
5622
|
}
|
|
5527
5623
|
return;
|
|
@@ -5621,122 +5717,6 @@ var coerce = {
|
|
|
5621
5717
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5622
5718
|
};
|
|
5623
5719
|
var NEVER = INVALID;
|
|
5624
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
5625
|
-
__proto__: null,
|
|
5626
|
-
defaultErrorMap: errorMap,
|
|
5627
|
-
setErrorMap,
|
|
5628
|
-
getErrorMap,
|
|
5629
|
-
makeIssue,
|
|
5630
|
-
EMPTY_PATH,
|
|
5631
|
-
addIssueToContext,
|
|
5632
|
-
ParseStatus,
|
|
5633
|
-
INVALID,
|
|
5634
|
-
DIRTY,
|
|
5635
|
-
OK,
|
|
5636
|
-
isAborted,
|
|
5637
|
-
isDirty,
|
|
5638
|
-
isValid,
|
|
5639
|
-
isAsync,
|
|
5640
|
-
get util() {
|
|
5641
|
-
return util;
|
|
5642
|
-
},
|
|
5643
|
-
get objectUtil() {
|
|
5644
|
-
return objectUtil;
|
|
5645
|
-
},
|
|
5646
|
-
ZodParsedType,
|
|
5647
|
-
getParsedType,
|
|
5648
|
-
ZodType,
|
|
5649
|
-
datetimeRegex,
|
|
5650
|
-
ZodString,
|
|
5651
|
-
ZodNumber,
|
|
5652
|
-
ZodBigInt,
|
|
5653
|
-
ZodBoolean,
|
|
5654
|
-
ZodDate,
|
|
5655
|
-
ZodSymbol,
|
|
5656
|
-
ZodUndefined,
|
|
5657
|
-
ZodNull,
|
|
5658
|
-
ZodAny,
|
|
5659
|
-
ZodUnknown,
|
|
5660
|
-
ZodNever,
|
|
5661
|
-
ZodVoid,
|
|
5662
|
-
ZodArray,
|
|
5663
|
-
ZodObject,
|
|
5664
|
-
ZodUnion,
|
|
5665
|
-
ZodDiscriminatedUnion,
|
|
5666
|
-
ZodIntersection,
|
|
5667
|
-
ZodTuple,
|
|
5668
|
-
ZodRecord,
|
|
5669
|
-
ZodMap,
|
|
5670
|
-
ZodSet,
|
|
5671
|
-
ZodFunction,
|
|
5672
|
-
ZodLazy,
|
|
5673
|
-
ZodLiteral,
|
|
5674
|
-
ZodEnum,
|
|
5675
|
-
ZodNativeEnum,
|
|
5676
|
-
ZodPromise,
|
|
5677
|
-
ZodEffects,
|
|
5678
|
-
ZodTransformer: ZodEffects,
|
|
5679
|
-
ZodOptional,
|
|
5680
|
-
ZodNullable,
|
|
5681
|
-
ZodDefault,
|
|
5682
|
-
ZodCatch,
|
|
5683
|
-
ZodNaN,
|
|
5684
|
-
BRAND,
|
|
5685
|
-
ZodBranded,
|
|
5686
|
-
ZodPipeline,
|
|
5687
|
-
ZodReadonly,
|
|
5688
|
-
custom,
|
|
5689
|
-
Schema: ZodType,
|
|
5690
|
-
ZodSchema: ZodType,
|
|
5691
|
-
late,
|
|
5692
|
-
get ZodFirstPartyTypeKind() {
|
|
5693
|
-
return ZodFirstPartyTypeKind;
|
|
5694
|
-
},
|
|
5695
|
-
coerce,
|
|
5696
|
-
any: anyType,
|
|
5697
|
-
array: arrayType,
|
|
5698
|
-
bigint: bigIntType,
|
|
5699
|
-
boolean: booleanType,
|
|
5700
|
-
date: dateType,
|
|
5701
|
-
discriminatedUnion: discriminatedUnionType,
|
|
5702
|
-
effect: effectsType,
|
|
5703
|
-
"enum": enumType,
|
|
5704
|
-
"function": functionType,
|
|
5705
|
-
"instanceof": instanceOfType,
|
|
5706
|
-
intersection: intersectionType,
|
|
5707
|
-
lazy: lazyType,
|
|
5708
|
-
literal: literalType,
|
|
5709
|
-
map: mapType,
|
|
5710
|
-
nan: nanType,
|
|
5711
|
-
nativeEnum: nativeEnumType,
|
|
5712
|
-
never: neverType,
|
|
5713
|
-
"null": nullType,
|
|
5714
|
-
nullable: nullableType,
|
|
5715
|
-
number: numberType,
|
|
5716
|
-
object: objectType,
|
|
5717
|
-
oboolean,
|
|
5718
|
-
onumber,
|
|
5719
|
-
optional: optionalType,
|
|
5720
|
-
ostring,
|
|
5721
|
-
pipeline: pipelineType,
|
|
5722
|
-
preprocess: preprocessType,
|
|
5723
|
-
promise: promiseType,
|
|
5724
|
-
record: recordType,
|
|
5725
|
-
set: setType,
|
|
5726
|
-
strictObject: strictObjectType,
|
|
5727
|
-
string: stringType,
|
|
5728
|
-
symbol: symbolType,
|
|
5729
|
-
transformer: effectsType,
|
|
5730
|
-
tuple: tupleType,
|
|
5731
|
-
"undefined": undefinedType,
|
|
5732
|
-
union: unionType,
|
|
5733
|
-
unknown: unknownType,
|
|
5734
|
-
"void": voidType,
|
|
5735
|
-
NEVER,
|
|
5736
|
-
ZodIssueCode,
|
|
5737
|
-
quotelessJson,
|
|
5738
|
-
ZodError
|
|
5739
|
-
});
|
|
5740
5720
|
|
|
5741
5721
|
// ../../core/models/book.ts
|
|
5742
5722
|
var BookDesignRequest = class {
|
|
@@ -5761,29 +5741,29 @@ var BookDesignRequest = class {
|
|
|
5761
5741
|
this.text_sticker_level = props.text_sticker_level;
|
|
5762
5742
|
}
|
|
5763
5743
|
};
|
|
5764
|
-
var bookDesignRequestSchema =
|
|
5765
|
-
occasion:
|
|
5766
|
-
style:
|
|
5767
|
-
book_size:
|
|
5768
|
-
cover_type:
|
|
5769
|
-
page_type:
|
|
5770
|
-
image_density:
|
|
5771
|
-
image_filtering_level:
|
|
5772
|
-
embellishment_level:
|
|
5773
|
-
text_sticker_level:
|
|
5744
|
+
var bookDesignRequestSchema = external_exports.object({
|
|
5745
|
+
occasion: external_exports.enum(occasions),
|
|
5746
|
+
style: external_exports.string(),
|
|
5747
|
+
book_size: external_exports.enum(bookSizes),
|
|
5748
|
+
cover_type: external_exports.enum(coverTypes),
|
|
5749
|
+
page_type: external_exports.enum(pageTypes),
|
|
5750
|
+
image_density: external_exports.enum(imageDensities),
|
|
5751
|
+
image_filtering_level: external_exports.enum(imageFilteringLevels),
|
|
5752
|
+
embellishment_level: external_exports.enum(embellishmentLevels),
|
|
5753
|
+
text_sticker_level: external_exports.enum(textStickerLevels)
|
|
5774
5754
|
});
|
|
5775
|
-
var bookPropsSchema =
|
|
5776
|
-
id:
|
|
5777
|
-
title:
|
|
5778
|
-
subtitle:
|
|
5755
|
+
var bookPropsSchema = external_exports.object({
|
|
5756
|
+
id: external_exports.string().optional(),
|
|
5757
|
+
title: external_exports.string(),
|
|
5758
|
+
subtitle: external_exports.string().optional(),
|
|
5779
5759
|
design_request: bookDesignRequestSchema,
|
|
5780
|
-
sku:
|
|
5781
|
-
state:
|
|
5782
|
-
guid:
|
|
5783
|
-
cancelled_at:
|
|
5784
|
-
mb_client_timeout:
|
|
5785
|
-
user_id:
|
|
5786
|
-
revision:
|
|
5760
|
+
sku: external_exports.string().optional(),
|
|
5761
|
+
state: external_exports.enum(states).optional(),
|
|
5762
|
+
guid: external_exports.string().optional(),
|
|
5763
|
+
cancelled_at: external_exports.string().optional(),
|
|
5764
|
+
mb_client_timeout: external_exports.number().optional(),
|
|
5765
|
+
user_id: external_exports.string().optional(),
|
|
5766
|
+
revision: external_exports.number().optional()
|
|
5787
5767
|
});
|
|
5788
5768
|
var Book = class {
|
|
5789
5769
|
id;
|
|
@@ -5864,18 +5844,18 @@ var Images = class {
|
|
|
5864
5844
|
}
|
|
5865
5845
|
}
|
|
5866
5846
|
};
|
|
5867
|
-
var imageServerSchema =
|
|
5868
|
-
id:
|
|
5869
|
-
handle:
|
|
5870
|
-
url:
|
|
5871
|
-
width:
|
|
5872
|
-
height:
|
|
5873
|
-
orientation:
|
|
5874
|
-
taken_at:
|
|
5875
|
-
camera_make:
|
|
5876
|
-
camera:
|
|
5877
|
-
filename:
|
|
5878
|
-
metadata:
|
|
5847
|
+
var imageServerSchema = external_exports.object({
|
|
5848
|
+
id: external_exports.string().optional(),
|
|
5849
|
+
handle: external_exports.string(),
|
|
5850
|
+
url: external_exports.string(),
|
|
5851
|
+
width: external_exports.number(),
|
|
5852
|
+
height: external_exports.number(),
|
|
5853
|
+
orientation: external_exports.number(),
|
|
5854
|
+
taken_at: external_exports.string(),
|
|
5855
|
+
camera_make: external_exports.string().optional(),
|
|
5856
|
+
camera: external_exports.string().optional(),
|
|
5857
|
+
filename: external_exports.string(),
|
|
5858
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5879
5859
|
});
|
|
5880
5860
|
var ImageServer = class {
|
|
5881
5861
|
id;
|
|
@@ -5920,34 +5900,34 @@ function imageServerToImage(imageServer) {
|
|
|
5920
5900
|
}
|
|
5921
5901
|
|
|
5922
5902
|
// ../../core/models/design-request/design-options.ts
|
|
5923
|
-
var imageDensityOptionSchema =
|
|
5924
|
-
maxPageCount:
|
|
5925
|
-
minPageCount:
|
|
5926
|
-
maxImageCount:
|
|
5927
|
-
avgImageCount:
|
|
5928
|
-
minImageCount:
|
|
5903
|
+
var imageDensityOptionSchema = external_exports.object({
|
|
5904
|
+
maxPageCount: external_exports.number(),
|
|
5905
|
+
minPageCount: external_exports.number(),
|
|
5906
|
+
maxImageCount: external_exports.number(),
|
|
5907
|
+
avgImageCount: external_exports.number(),
|
|
5908
|
+
minImageCount: external_exports.number()
|
|
5929
5909
|
});
|
|
5930
|
-
var imageDensityOptionsSchema =
|
|
5910
|
+
var imageDensityOptionsSchema = external_exports.object({
|
|
5931
5911
|
high: imageDensityOptionSchema,
|
|
5932
5912
|
medium: imageDensityOptionSchema,
|
|
5933
5913
|
low: imageDensityOptionSchema
|
|
5934
5914
|
});
|
|
5935
|
-
var designOptionsSchema =
|
|
5915
|
+
var designOptionsSchema = external_exports.object({
|
|
5936
5916
|
densities: imageDensityOptionsSchema
|
|
5937
5917
|
});
|
|
5938
|
-
var imageDensityOptionServerSchema =
|
|
5939
|
-
max_page_count:
|
|
5940
|
-
min_page_count:
|
|
5941
|
-
max_image_count:
|
|
5942
|
-
avg_image_count:
|
|
5943
|
-
min_image_count:
|
|
5918
|
+
var imageDensityOptionServerSchema = external_exports.object({
|
|
5919
|
+
max_page_count: external_exports.number(),
|
|
5920
|
+
min_page_count: external_exports.number(),
|
|
5921
|
+
max_image_count: external_exports.number(),
|
|
5922
|
+
avg_image_count: external_exports.number(),
|
|
5923
|
+
min_image_count: external_exports.number()
|
|
5944
5924
|
});
|
|
5945
|
-
var imageDensityOptionsServerSchema =
|
|
5925
|
+
var imageDensityOptionsServerSchema = external_exports.object({
|
|
5946
5926
|
high: imageDensityOptionServerSchema,
|
|
5947
5927
|
medium: imageDensityOptionServerSchema,
|
|
5948
5928
|
low: imageDensityOptionServerSchema
|
|
5949
5929
|
});
|
|
5950
|
-
var designOptionsServerSchema =
|
|
5930
|
+
var designOptionsServerSchema = external_exports.object({
|
|
5951
5931
|
densities: imageDensityOptionsServerSchema
|
|
5952
5932
|
});
|
|
5953
5933
|
|
|
@@ -6245,9 +6225,9 @@ var DesignOptionsEndpoints = class {
|
|
|
6245
6225
|
};
|
|
6246
6226
|
|
|
6247
6227
|
// ../../core/models/event.ts
|
|
6248
|
-
var eventContextSchema =
|
|
6249
|
-
var eventSchema =
|
|
6250
|
-
name:
|
|
6228
|
+
var eventContextSchema = external_exports.record(external_exports.string(), external_exports.unknown()).optional();
|
|
6229
|
+
var eventSchema = external_exports.object({
|
|
6230
|
+
name: external_exports.string(),
|
|
6251
6231
|
context: eventContextSchema
|
|
6252
6232
|
});
|
|
6253
6233
|
|
|
@@ -6337,7 +6317,7 @@ var ImagesEndpoints = class {
|
|
|
6337
6317
|
const res = await this.engineAPI.fetcher.call({
|
|
6338
6318
|
path: `/v1/images/book/${bookId}`
|
|
6339
6319
|
});
|
|
6340
|
-
return
|
|
6320
|
+
return external_exports.array(imageServerSchema).parse(res);
|
|
6341
6321
|
});
|
|
6342
6322
|
}
|
|
6343
6323
|
retrieve(imageId, bookId) {
|
|
@@ -6385,119 +6365,119 @@ var ImagesEndpoints = class {
|
|
|
6385
6365
|
};
|
|
6386
6366
|
|
|
6387
6367
|
// ../../core/models/spread.ts
|
|
6388
|
-
var spreadServerSchema =
|
|
6389
|
-
id:
|
|
6390
|
-
book_id:
|
|
6391
|
-
state:
|
|
6392
|
-
spread_type:
|
|
6393
|
-
width:
|
|
6394
|
-
height:
|
|
6395
|
-
sequence:
|
|
6396
|
-
wells:
|
|
6397
|
-
background:
|
|
6398
|
-
laid_out_at:
|
|
6399
|
-
embellished_at:
|
|
6400
|
-
polished_at:
|
|
6401
|
-
metadata:
|
|
6402
|
-
url:
|
|
6368
|
+
var spreadServerSchema = external_exports.object({
|
|
6369
|
+
id: external_exports.string(),
|
|
6370
|
+
book_id: external_exports.string(),
|
|
6371
|
+
state: external_exports.string(),
|
|
6372
|
+
spread_type: external_exports.string(),
|
|
6373
|
+
width: external_exports.number(),
|
|
6374
|
+
height: external_exports.number(),
|
|
6375
|
+
sequence: external_exports.number(),
|
|
6376
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6377
|
+
background: external_exports.unknown(),
|
|
6378
|
+
laid_out_at: external_exports.string().nullable(),
|
|
6379
|
+
embellished_at: external_exports.string().nullable(),
|
|
6380
|
+
polished_at: external_exports.string().nullable(),
|
|
6381
|
+
metadata: external_exports.unknown(),
|
|
6382
|
+
url: external_exports.string().nullable().optional()
|
|
6403
6383
|
});
|
|
6404
|
-
var spreadSchema =
|
|
6405
|
-
id:
|
|
6406
|
-
bookId:
|
|
6407
|
-
state:
|
|
6408
|
-
spreadType:
|
|
6409
|
-
width:
|
|
6410
|
-
height:
|
|
6411
|
-
sequence:
|
|
6412
|
-
wells:
|
|
6413
|
-
background:
|
|
6414
|
-
laidOutAt:
|
|
6415
|
-
embellishedAt:
|
|
6416
|
-
polishedAt:
|
|
6417
|
-
metadata:
|
|
6418
|
-
url:
|
|
6384
|
+
var spreadSchema = external_exports.object({
|
|
6385
|
+
id: external_exports.string(),
|
|
6386
|
+
bookId: external_exports.string(),
|
|
6387
|
+
state: external_exports.string(),
|
|
6388
|
+
spreadType: external_exports.string(),
|
|
6389
|
+
width: external_exports.number(),
|
|
6390
|
+
height: external_exports.number(),
|
|
6391
|
+
sequence: external_exports.number(),
|
|
6392
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6393
|
+
background: external_exports.unknown(),
|
|
6394
|
+
laidOutAt: external_exports.string().nullable(),
|
|
6395
|
+
embellishedAt: external_exports.string().nullable(),
|
|
6396
|
+
polishedAt: external_exports.string().nullable(),
|
|
6397
|
+
metadata: external_exports.unknown(),
|
|
6398
|
+
url: external_exports.string().nullable().optional()
|
|
6419
6399
|
});
|
|
6420
6400
|
|
|
6421
6401
|
// ../../core/models/galleon.ts
|
|
6422
|
-
var imageAssignmentSchema =
|
|
6423
|
-
photoRefId:
|
|
6424
|
-
finalCrop:
|
|
6402
|
+
var imageAssignmentSchema = external_exports.object({
|
|
6403
|
+
photoRefId: external_exports.string(),
|
|
6404
|
+
finalCrop: external_exports.array(external_exports.number())
|
|
6425
6405
|
});
|
|
6426
|
-
var positionSchema =
|
|
6427
|
-
x:
|
|
6428
|
-
y:
|
|
6429
|
-
width:
|
|
6430
|
-
height:
|
|
6431
|
-
rotation:
|
|
6406
|
+
var positionSchema = external_exports.object({
|
|
6407
|
+
x: external_exports.number(),
|
|
6408
|
+
y: external_exports.number(),
|
|
6409
|
+
width: external_exports.number().optional(),
|
|
6410
|
+
height: external_exports.number().optional(),
|
|
6411
|
+
rotation: external_exports.number()
|
|
6432
6412
|
});
|
|
6433
|
-
var photoMetadataSchema =
|
|
6434
|
-
id:
|
|
6435
|
-
llx:
|
|
6436
|
-
lly:
|
|
6437
|
-
urx:
|
|
6438
|
-
ury:
|
|
6439
|
-
data:
|
|
6440
|
-
title:
|
|
6441
|
-
width:
|
|
6442
|
-
effect:
|
|
6443
|
-
height:
|
|
6444
|
-
source:
|
|
6445
|
-
rotation:
|
|
6446
|
-
uploadTime:
|
|
6413
|
+
var photoMetadataSchema = external_exports.object({
|
|
6414
|
+
id: external_exports.string(),
|
|
6415
|
+
llx: external_exports.number(),
|
|
6416
|
+
lly: external_exports.number(),
|
|
6417
|
+
urx: external_exports.number(),
|
|
6418
|
+
ury: external_exports.number(),
|
|
6419
|
+
data: external_exports.string().nullable(),
|
|
6420
|
+
title: external_exports.string(),
|
|
6421
|
+
width: external_exports.number(),
|
|
6422
|
+
effect: external_exports.string(),
|
|
6423
|
+
height: external_exports.number(),
|
|
6424
|
+
source: external_exports.string(),
|
|
6425
|
+
rotation: external_exports.number(),
|
|
6426
|
+
uploadTime: external_exports.string()
|
|
6447
6427
|
});
|
|
6448
|
-
var propertySchema =
|
|
6449
|
-
key:
|
|
6450
|
-
value:
|
|
6428
|
+
var propertySchema = external_exports.object({
|
|
6429
|
+
key: external_exports.string(),
|
|
6430
|
+
value: external_exports.any()
|
|
6451
6431
|
});
|
|
6452
|
-
var assetSchema =
|
|
6453
|
-
type:
|
|
6432
|
+
var assetSchema = external_exports.object({
|
|
6433
|
+
type: external_exports.string(),
|
|
6454
6434
|
imageAssignment: imageAssignmentSchema.optional(),
|
|
6455
6435
|
position: positionSchema,
|
|
6456
|
-
seqNum:
|
|
6457
|
-
z:
|
|
6458
|
-
id:
|
|
6459
|
-
horizJustification:
|
|
6460
|
-
vertJustification:
|
|
6461
|
-
text:
|
|
6462
|
-
fontId:
|
|
6463
|
-
fontSize:
|
|
6464
|
-
fontColor:
|
|
6465
|
-
frame:
|
|
6436
|
+
seqNum: external_exports.number(),
|
|
6437
|
+
z: external_exports.number(),
|
|
6438
|
+
id: external_exports.string().optional(),
|
|
6439
|
+
horizJustification: external_exports.string().optional(),
|
|
6440
|
+
vertJustification: external_exports.string().optional().nullable(),
|
|
6441
|
+
text: external_exports.string().optional(),
|
|
6442
|
+
fontId: external_exports.string().optional(),
|
|
6443
|
+
fontSize: external_exports.number().optional(),
|
|
6444
|
+
fontColor: external_exports.string().optional(),
|
|
6445
|
+
frame: external_exports.string().optional()
|
|
6466
6446
|
});
|
|
6467
|
-
var photoStripSchema =
|
|
6468
|
-
url:
|
|
6469
|
-
encryptId:
|
|
6470
|
-
photoRefId:
|
|
6471
|
-
photoId:
|
|
6447
|
+
var photoStripSchema = external_exports.object({
|
|
6448
|
+
url: external_exports.string(),
|
|
6449
|
+
encryptId: external_exports.string(),
|
|
6450
|
+
photoRefId: external_exports.string(),
|
|
6451
|
+
photoId: external_exports.string(),
|
|
6472
6452
|
photoMetadata: photoMetadataSchema
|
|
6473
6453
|
});
|
|
6474
|
-
var reportingDataSchema =
|
|
6475
|
-
properties:
|
|
6454
|
+
var reportingDataSchema = external_exports.object({
|
|
6455
|
+
properties: external_exports.array(propertySchema)
|
|
6476
6456
|
});
|
|
6477
|
-
var sflyCanvasSchema =
|
|
6478
|
-
backgroundId:
|
|
6479
|
-
assets:
|
|
6457
|
+
var sflyCanvasSchema = external_exports.object({
|
|
6458
|
+
backgroundId: external_exports.string().nullable(),
|
|
6459
|
+
assets: external_exports.array(assetSchema).optional()
|
|
6480
6460
|
});
|
|
6481
|
-
var snapCanvasSchema =
|
|
6482
|
-
surfaceNumber:
|
|
6483
|
-
surfaceData:
|
|
6484
|
-
version:
|
|
6461
|
+
var snapCanvasSchema = external_exports.object({
|
|
6462
|
+
surfaceNumber: external_exports.number(),
|
|
6463
|
+
surfaceData: external_exports.record(external_exports.any()),
|
|
6464
|
+
version: external_exports.string()
|
|
6485
6465
|
});
|
|
6486
|
-
var pageSchema =
|
|
6487
|
-
pageNum:
|
|
6488
|
-
type:
|
|
6466
|
+
var pageSchema = external_exports.object({
|
|
6467
|
+
pageNum: external_exports.number(),
|
|
6468
|
+
type: external_exports.string(),
|
|
6489
6469
|
canvas: sflyCanvasSchema
|
|
6490
6470
|
});
|
|
6491
|
-
var magicShopBookSchema =
|
|
6492
|
-
pages:
|
|
6493
|
-
photoStrip:
|
|
6471
|
+
var magicShopBookSchema = external_exports.object({
|
|
6472
|
+
pages: external_exports.array(pageSchema),
|
|
6473
|
+
photoStrip: external_exports.array(photoStripSchema)
|
|
6494
6474
|
});
|
|
6495
|
-
var bookCreationRequestSchema =
|
|
6496
|
-
title:
|
|
6497
|
-
binding:
|
|
6498
|
-
coverSpecId:
|
|
6499
|
-
styleId:
|
|
6500
|
-
userId:
|
|
6475
|
+
var bookCreationRequestSchema = external_exports.object({
|
|
6476
|
+
title: external_exports.string(),
|
|
6477
|
+
binding: external_exports.string(),
|
|
6478
|
+
coverSpecId: external_exports.string(),
|
|
6479
|
+
styleId: external_exports.number(),
|
|
6480
|
+
userId: external_exports.string(),
|
|
6501
6481
|
magicShopBook: magicShopBookSchema,
|
|
6502
6482
|
reportingData: reportingDataSchema
|
|
6503
6483
|
});
|
|
@@ -6514,7 +6494,7 @@ var SpreadsEndpoints = class {
|
|
|
6514
6494
|
const res = await this.engineAPI.fetcher.call({
|
|
6515
6495
|
path: `/v1/spreads/book/${bookId}`
|
|
6516
6496
|
});
|
|
6517
|
-
return
|
|
6497
|
+
return external_exports.array(spreadServerSchema).parse(res);
|
|
6518
6498
|
});
|
|
6519
6499
|
}
|
|
6520
6500
|
create(bookId, spread) {
|
|
@@ -6580,98 +6560,98 @@ var SpreadsEndpoints = class {
|
|
|
6580
6560
|
})
|
|
6581
6561
|
}
|
|
6582
6562
|
});
|
|
6583
|
-
return
|
|
6563
|
+
return external_exports.array(surfaceCategoryName ? snapCanvasSchema : sflyCanvasSchema).parse(res);
|
|
6584
6564
|
});
|
|
6585
6565
|
}
|
|
6586
6566
|
};
|
|
6587
6567
|
|
|
6588
6568
|
// ../../core/models/storyboard-item.ts
|
|
6589
|
-
var StoryboardItemImageFaceServerSchema =
|
|
6590
|
-
score:
|
|
6591
|
-
bounding_box:
|
|
6592
|
-
x:
|
|
6593
|
-
y:
|
|
6594
|
-
width:
|
|
6595
|
-
height:
|
|
6569
|
+
var StoryboardItemImageFaceServerSchema = external_exports.object({
|
|
6570
|
+
score: external_exports.number(),
|
|
6571
|
+
bounding_box: external_exports.object({
|
|
6572
|
+
x: external_exports.number(),
|
|
6573
|
+
y: external_exports.number(),
|
|
6574
|
+
width: external_exports.number(),
|
|
6575
|
+
height: external_exports.number()
|
|
6596
6576
|
}),
|
|
6597
|
-
size:
|
|
6598
|
-
eyes_open_score:
|
|
6599
|
-
smile_score:
|
|
6600
|
-
facing_camera_score:
|
|
6577
|
+
size: external_exports.number(),
|
|
6578
|
+
eyes_open_score: external_exports.number(),
|
|
6579
|
+
smile_score: external_exports.number(),
|
|
6580
|
+
facing_camera_score: external_exports.number()
|
|
6601
6581
|
});
|
|
6602
|
-
var StoryboardItemImageFaceSchema =
|
|
6603
|
-
score:
|
|
6604
|
-
boundingBox:
|
|
6605
|
-
x:
|
|
6606
|
-
y:
|
|
6607
|
-
width:
|
|
6608
|
-
height:
|
|
6582
|
+
var StoryboardItemImageFaceSchema = external_exports.object({
|
|
6583
|
+
score: external_exports.number(),
|
|
6584
|
+
boundingBox: external_exports.object({
|
|
6585
|
+
x: external_exports.number(),
|
|
6586
|
+
y: external_exports.number(),
|
|
6587
|
+
width: external_exports.number(),
|
|
6588
|
+
height: external_exports.number()
|
|
6609
6589
|
}),
|
|
6610
|
-
size:
|
|
6611
|
-
eyesOpenScore:
|
|
6612
|
-
smileScore:
|
|
6613
|
-
facingCameraScore:
|
|
6590
|
+
size: external_exports.number(),
|
|
6591
|
+
eyesOpenScore: external_exports.number(),
|
|
6592
|
+
smileScore: external_exports.number(),
|
|
6593
|
+
facingCameraScore: external_exports.number()
|
|
6614
6594
|
});
|
|
6615
|
-
var StoryboardItemImageServerSchema =
|
|
6616
|
-
id:
|
|
6617
|
-
url:
|
|
6618
|
-
category:
|
|
6619
|
-
aesthetic_score:
|
|
6620
|
-
faces:
|
|
6621
|
-
roi:
|
|
6622
|
-
x:
|
|
6623
|
-
y:
|
|
6624
|
-
width:
|
|
6625
|
-
height:
|
|
6595
|
+
var StoryboardItemImageServerSchema = external_exports.object({
|
|
6596
|
+
id: external_exports.string(),
|
|
6597
|
+
url: external_exports.string(),
|
|
6598
|
+
category: external_exports.string(),
|
|
6599
|
+
aesthetic_score: external_exports.number(),
|
|
6600
|
+
faces: external_exports.array(StoryboardItemImageFaceServerSchema),
|
|
6601
|
+
roi: external_exports.object({
|
|
6602
|
+
x: external_exports.number(),
|
|
6603
|
+
y: external_exports.number(),
|
|
6604
|
+
width: external_exports.number(),
|
|
6605
|
+
height: external_exports.number()
|
|
6626
6606
|
}),
|
|
6627
|
-
taken_at:
|
|
6628
|
-
width:
|
|
6629
|
-
height:
|
|
6607
|
+
taken_at: external_exports.number(),
|
|
6608
|
+
width: external_exports.number(),
|
|
6609
|
+
height: external_exports.number()
|
|
6630
6610
|
});
|
|
6631
|
-
var StoryboardItemImageSchema =
|
|
6632
|
-
id:
|
|
6633
|
-
url:
|
|
6634
|
-
category:
|
|
6635
|
-
aestheticScore:
|
|
6636
|
-
faces:
|
|
6637
|
-
roi:
|
|
6638
|
-
x:
|
|
6639
|
-
y:
|
|
6640
|
-
width:
|
|
6641
|
-
height:
|
|
6611
|
+
var StoryboardItemImageSchema = external_exports.object({
|
|
6612
|
+
id: external_exports.string(),
|
|
6613
|
+
url: external_exports.string(),
|
|
6614
|
+
category: external_exports.string(),
|
|
6615
|
+
aestheticScore: external_exports.number(),
|
|
6616
|
+
faces: external_exports.array(StoryboardItemImageFaceSchema),
|
|
6617
|
+
roi: external_exports.object({
|
|
6618
|
+
x: external_exports.number(),
|
|
6619
|
+
y: external_exports.number(),
|
|
6620
|
+
width: external_exports.number(),
|
|
6621
|
+
height: external_exports.number()
|
|
6642
6622
|
}),
|
|
6643
|
-
takenAt:
|
|
6644
|
-
width:
|
|
6645
|
-
height:
|
|
6623
|
+
takenAt: external_exports.number(),
|
|
6624
|
+
width: external_exports.number(),
|
|
6625
|
+
height: external_exports.number()
|
|
6646
6626
|
});
|
|
6647
|
-
var StoryboardItemServerSchema =
|
|
6648
|
-
id:
|
|
6649
|
-
sequence:
|
|
6650
|
-
book_id:
|
|
6651
|
-
similarity:
|
|
6652
|
-
duplicate:
|
|
6653
|
-
selected:
|
|
6654
|
-
surface_weight:
|
|
6655
|
-
front_cover:
|
|
6656
|
-
back_cover:
|
|
6657
|
-
scene:
|
|
6658
|
-
subscene:
|
|
6659
|
-
spine_break:
|
|
6627
|
+
var StoryboardItemServerSchema = external_exports.object({
|
|
6628
|
+
id: external_exports.string(),
|
|
6629
|
+
sequence: external_exports.number(),
|
|
6630
|
+
book_id: external_exports.string(),
|
|
6631
|
+
similarity: external_exports.number(),
|
|
6632
|
+
duplicate: external_exports.boolean(),
|
|
6633
|
+
selected: external_exports.boolean(),
|
|
6634
|
+
surface_weight: external_exports.number(),
|
|
6635
|
+
front_cover: external_exports.boolean().optional(),
|
|
6636
|
+
back_cover: external_exports.boolean().optional(),
|
|
6637
|
+
scene: external_exports.number(),
|
|
6638
|
+
subscene: external_exports.number(),
|
|
6639
|
+
spine_break: external_exports.boolean().optional(),
|
|
6660
6640
|
image: StoryboardItemImageServerSchema
|
|
6661
6641
|
});
|
|
6662
|
-
var StoryboardItemSchema =
|
|
6663
|
-
id:
|
|
6664
|
-
sequence:
|
|
6665
|
-
bookId:
|
|
6666
|
-
similarity:
|
|
6667
|
-
duplicate:
|
|
6668
|
-
selected:
|
|
6669
|
-
surfaceWeight:
|
|
6670
|
-
frontCover:
|
|
6671
|
-
backCover:
|
|
6672
|
-
scene:
|
|
6673
|
-
subscene:
|
|
6674
|
-
spineBreak:
|
|
6642
|
+
var StoryboardItemSchema = external_exports.object({
|
|
6643
|
+
id: external_exports.string(),
|
|
6644
|
+
sequence: external_exports.number(),
|
|
6645
|
+
bookId: external_exports.string(),
|
|
6646
|
+
similarity: external_exports.number(),
|
|
6647
|
+
duplicate: external_exports.boolean(),
|
|
6648
|
+
selected: external_exports.boolean(),
|
|
6649
|
+
surfaceWeight: external_exports.number(),
|
|
6650
|
+
frontCover: external_exports.boolean().optional(),
|
|
6651
|
+
backCover: external_exports.boolean().optional(),
|
|
6652
|
+
scene: external_exports.number(),
|
|
6653
|
+
subscene: external_exports.number(),
|
|
6654
|
+
spineBreak: external_exports.boolean().optional(),
|
|
6675
6655
|
image: StoryboardItemImageSchema
|
|
6676
6656
|
});
|
|
6677
6657
|
|
|
@@ -6687,7 +6667,7 @@ var StoryboardItemsEndpoints = class {
|
|
|
6687
6667
|
const res = await this.engineAPI.fetcher.call({
|
|
6688
6668
|
path: `/v1/storyboarditems/book/${bookId}`
|
|
6689
6669
|
});
|
|
6690
|
-
return
|
|
6670
|
+
return external_exports.array(StoryboardItemServerSchema).parse(res);
|
|
6691
6671
|
});
|
|
6692
6672
|
}
|
|
6693
6673
|
};
|